/* ============================================================
   Tilly & Joseph — Admin Dashboard Styles
   Design: Dark, sophisticated, matching wedding elegance
   Skills: Taste + Impeccable enforced
============================================================ */

/* ── Design Tokens ─────────────────────────────────────── */
:root {
    /* Primitive palette — warm dark charcoal */
    --gray-50:  hsl(36, 20%, 96%);
    --gray-100: hsl(36, 15%, 91%);
    --gray-200: hsl(36, 12%, 82%);
    --gray-300: hsl(36, 10%, 68%);
    --gray-400: hsl(36, 8%,  52%);
    --gray-500: hsl(36, 8%,  38%);
    --gray-600: hsl(36, 10%, 28%);
    --gray-700: hsl(36, 12%, 20%);
    --gray-800: hsl(36, 14%, 14%);
    --gray-900: hsl(36, 15%, 9%);
    --gray-950: hsl(36, 17%, 6%);

    /* Accent — champagne gold */
    --accent:            hsl(42, 68%, 62%);
    --accent-dim:        hsl(42, 40%, 42%);
    --accent-subtle:     hsl(42, 30%, 18%);
    --accent-text:       hsl(42, 68%, 72%);

    /* Semantic tokens */
    --bg:            var(--gray-950);
    --bg-surface:    var(--gray-900);
    --bg-elevated:   var(--gray-800);
    --border:        hsl(36, 12%, 13%);
    --border-hover:  hsl(36, 12%, 20%);
    --text:          var(--gray-50);
    --text-muted:    var(--gray-400);
    --text-subtle:   var(--gray-500);

    /* Semantic states */
    --accept-bg:     hsl(152, 40%, 10%);
    --accept-text:   hsl(152, 60%, 55%);
    --accept-border: hsl(152, 40%, 16%);
    --decline-bg:    hsl(0, 30%, 11%);
    --decline-text:  hsl(0, 70%, 62%);
    --decline-border:hsl(0, 30%, 18%);
    --danger:        hsl(0, 70%, 60%);
    --danger-hover:  hsl(0, 70%, 50%);

    /* Spacing (4px grid) */
    --sp-1:  0.25rem;  /* 4px */
    --sp-2:  0.5rem;   /* 8px */
    --sp-3:  0.75rem;  /* 12px */
    --sp-4:  1rem;     /* 16px */
    --sp-5:  1.25rem;  /* 20px */
    --sp-6:  1.5rem;   /* 24px */
    --sp-8:  2rem;     /* 32px */
    --sp-10: 2.5rem;   /* 40px */
    --sp-12: 3rem;     /* 48px */
    --sp-16: 4rem;     /* 64px */

    /* Radii */
    --r-sm:  4px;
    --r-md:  8px;
    --r-lg:  12px;
    --r-xl:  16px;
    --r-2xl: 24px;
    --r-full: 9999px;

    /* Typography */
    --font-sans:  'Inter', system-ui, sans-serif;
    --font-serif: 'Cormorant Garamond', Georgia, serif;

    /* Sidebar width */
    --sidebar-w: 240px;
}

/* ── Reset ─────────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    min-height: 100dvh;
    line-height: 1.6;
}

.hidden { display: none !important; }

/* ── Login Screen ───────────────────────────────────────── */
.login-screen {
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--sp-6);
    position: relative;
    overflow: hidden;
    background: var(--bg);
}

.login-bg-pattern {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 50% 0%, hsl(42, 40%, 10%) 0%, transparent 60%),
        radial-gradient(ellipse 50% 40% at 80% 100%, hsl(42, 20%, 8%) 0%, transparent 50%);
    pointer-events: none;
}

.login-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    padding: var(--sp-10) var(--sp-8);
    box-shadow:
        0 1px 2px rgba(0,0,0,0.2),
        0 8px 24px rgba(0,0,0,0.3),
        0 32px 64px rgba(0,0,0,0.2);
    animation: card-enter 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes card-enter {
    from { opacity: 0; transform: translateY(24px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.login-monogram {
    display: flex;
    justify-content: center;
    margin-bottom: var(--sp-6);
}

.login-eyebrow {
    display: block;
    text-align: center;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent-text);
    margin-bottom: var(--sp-2);
}

.login-title {
    font-family: var(--font-serif);
    font-size: 2.25rem;
    font-weight: 300;
    letter-spacing: -0.02em;
    color: var(--text);
    text-align: center;
    line-height: 1.1;
    margin-bottom: var(--sp-2);
}

.login-subtitle {
    font-size: 0.875rem;
    color: var(--text-subtle);
    text-align: center;
    margin-bottom: var(--sp-8);
    letter-spacing: 0.01em;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: var(--sp-5);
}

.login-field {
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
}

.login-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.01em;
}

.login-input-wrap {
    position: relative;
}

.login-input {
    width: 100%;
    height: 44px;
    padding: 0 var(--sp-10) 0 var(--sp-4);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
}

.login-input::placeholder { color: var(--text-subtle); }

.login-input:focus {
    border-color: var(--accent-dim);
    box-shadow: 0 0 0 3px hsl(42, 40%, 25% / 0.25);
}

.login-input.input-error {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px hsl(0, 70%, 30% / 0.2);
}

.login-toggle-visibility {
    position: absolute;
    right: var(--sp-3);
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-subtle);
    padding: var(--sp-1);
    display: flex;
    align-items: center;
    transition: color 0.2s;
}

.login-toggle-visibility:hover { color: var(--text-muted); }

.login-error {
    font-size: 0.8125rem;
    color: var(--danger);
    display: none;
}

.login-error.visible { display: block; }

.login-btn {
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-2);
    background: var(--accent);
    color: hsl(36, 17%, 6%);
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    font-weight: 600;
    border: none;
    border-radius: var(--r-md);
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
    letter-spacing: 0.01em;
}

.login-btn:hover {
    background: hsl(42, 68%, 72%);
    transform: translateY(-1px);
}

.login-btn:active { transform: translateY(0); }

/* ── Dashboard Layout ───────────────────────────────────── */
.dashboard-screen {
    display: flex;
    min-height: 100dvh;
}

/* ── Sidebar ────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-w);
    min-height: 100dvh;
    background: var(--bg-surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100dvh;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-5) var(--sp-5);
    border-bottom: 1px solid var(--border);
}

.sidebar-title-group {
    display: flex;
    flex-direction: column;
}

.sidebar-name {
    font-family: var(--font-serif);
    font-size: 1rem;
    font-weight: 400;
    color: var(--text);
    line-height: 1.2;
}

.sidebar-date {
    font-size: 0.6875rem;
    color: var(--text-subtle);
    letter-spacing: 0.01em;
}

.sidebar-nav {
    flex: 1;
    padding: var(--sp-4) var(--sp-3);
    display: flex;
    flex-direction: column;
    gap: var(--sp-1);
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-3) var(--sp-3);
    border-radius: var(--r-md);
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
}

.sidebar-link:hover {
    background: var(--bg-elevated);
    color: var(--text);
}

.sidebar-link.active {
    background: var(--accent-subtle);
    color: var(--accent-text);
}

.sidebar-footer {
    padding: var(--sp-4) var(--sp-4);
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
}

.connection-status {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: var(--r-full);
    background: var(--gray-600);
    flex-shrink: 0;
    transition: background 0.3s;
}

.status-dot.connected { background: hsl(152, 60%, 50%); }
.status-dot.error     { background: var(--danger); }

.status-label {
    font-size: 0.75rem;
    color: var(--text-subtle);
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    padding: var(--sp-2) var(--sp-3);
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.logout-btn:hover {
    border-color: var(--border-hover);
    color: var(--text);
    background: var(--bg-elevated);
}

/* ── Main Content ───────────────────────────────────────── */
.dashboard-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding: 0;
}

/* ── Top Bar ────────────────────────────────────────────── */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--sp-5) var(--sp-8);
    border-bottom: 1px solid var(--border);
    background: var(--bg-surface);
    flex-shrink: 0;
}

.topbar-title {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 400;
    letter-spacing: -0.01em;
    color: var(--text);
    line-height: 1.2;
}

.topbar-subtitle {
    display: block;
    font-size: 0.8125rem;
    color: var(--text-subtle);
    margin-top: var(--sp-1);
}

.export-dropdown-container {
    position: relative;
    display: inline-block;
}

.btn-export {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    height: 40px;
    padding: 0 var(--sp-5);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.btn-export:hover,
.btn-export[aria-expanded="true"] {
    border-color: var(--accent-dim);
    color: var(--accent-text);
    background: var(--accent-subtle);
}

.btn-export[aria-expanded="true"] .chevron-icon {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + var(--sp-2));
    right: 0;
    width: 190px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    z-index: 100;
    display: flex;
    flex-direction: column;
    padding: var(--sp-1) 0;
    transform-origin: top right;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.dropdown-menu.hidden {
    display: none !important;
}

.dropdown-item {
    background: none;
    border: none;
    padding: var(--sp-2) var(--sp-4);
    text-align: left;
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-size: 0.875rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    width: 100%;
}

.dropdown-item:hover {
    background: var(--accent-subtle);
    color: var(--accent-text);
}

/* ── Stats Row ──────────────────────────────────────────── */
.stats-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.stat-card {
    padding: var(--sp-5) var(--sp-6);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: var(--sp-1);
    transition: background 0.15s, border-color 0.15s;
    cursor: pointer;
}

.stat-card:hover {
    background: var(--bg-surface);
}

.stat-card:last-child { border-right: none; }

.stat-value {
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 400;
    letter-spacing: -0.02em;
    color: var(--text);
    line-height: 1;
}

.stat-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-subtle);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.stat-accept .stat-value { color: var(--accept-text); }
.stat-decline .stat-value { color: var(--decline-text); }
.stat-bride .stat-value, .stat-groom .stat-value { color: var(--accent-text); }

/* ── Filter Bar ─────────────────────────────────────────── */
.filter-bar {
    display: flex;
    align-items: center;
    gap: var(--sp-4);
    padding: var(--sp-4) var(--sp-8);
    border-bottom: 1px solid var(--border);
    background: var(--bg);
    flex-shrink: 0;
    flex-wrap: wrap;
}

.search-wrap {
    position: relative;
    flex: 1;
    min-width: 220px;
    max-width: 360px;
}

.search-icon {
    position: absolute;
    left: var(--sp-3);
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-subtle);
    pointer-events: none;
}

.search-input {
    width: 100%;
    height: 40px;
    padding: 0 var(--sp-4) 0 var(--sp-8);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input::placeholder { color: var(--text-subtle); }

.search-input:focus {
    border-color: var(--accent-dim);
    box-shadow: 0 0 0 3px hsl(42, 40%, 25% / 0.2);
}

.filter-chips {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    flex-wrap: wrap;
}

.chip {
    display: flex;
    align-items: center;
    gap: var(--sp-1);
    height: 32px;
    padding: 0 var(--sp-3);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--r-full);
    color: var(--text-subtle);
    font-family: var(--font-sans);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.chip:hover {
    border-color: var(--border-hover);
    color: var(--text-muted);
}

.chip-active {
    background: var(--accent-subtle);
    border-color: var(--accent-dim);
    color: var(--accent-text);
}

.chip-dot {
    width: 6px;
    height: 6px;
    border-radius: var(--r-full);
}

.chip-dot-accept  { background: var(--accept-text); }
.chip-dot-decline { background: var(--decline-text); }

/* ── Table Container ────────────────────────────────────── */
.table-container {
    flex: 1;
    overflow: auto;
    padding: var(--sp-6) var(--sp-8);
}

/* Loading */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--sp-4);
    padding: var(--sp-16) var(--sp-8);
    color: var(--text-subtle);
    font-size: 0.875rem;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: var(--r-full);
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-16) var(--sp-8);
    color: var(--text-subtle);
    text-align: center;
}

.empty-state svg { opacity: 0.3; }
.empty-title { font-size: 1rem; font-weight: 500; color: var(--text-muted); }
.empty-sub   { font-size: 0.875rem; max-width: 36ch; }

/* Connection Error State */
.connection-error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-16) var(--sp-8);
    color: var(--text-subtle);
    text-align: center;
}

.connection-error-state svg {
    opacity: 0.45;
    color: var(--danger);
}

.connection-error-state .empty-sub code {
    font-family: 'Courier New', monospace;
    font-size: 0.8125rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    padding: 1px 6px;
    color: var(--accent-text);
}

.btn-retry {
    margin-top: var(--sp-2);
    height: 40px;
    padding: 0 var(--sp-6);
    background: var(--accent);
    border: none;
    border-radius: var(--r-md);
    color: hsl(36, 17%, 6%);
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
}

.btn-retry:hover {
    background: hsl(42, 68%, 72%);
    transform: translateY(-1px);
}

/* No results */
.no-results {
    padding: var(--sp-8);
    text-align: center;
    color: var(--text-subtle);
    font-size: 0.875rem;
}

/* ── RSVP Table ─────────────────────────────────────────── */
.rsvp-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.875rem;
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    overflow: hidden;
}

.rsvp-table thead tr {
    background: var(--bg-surface);
}

.rsvp-table th {
    padding: var(--sp-3) var(--sp-4);
    text-align: left;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-subtle);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.rsvp-table tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background 0.12s;
}

.rsvp-table tbody tr:last-child { border-bottom: none; }

.rsvp-table tbody tr:hover { background: var(--bg-surface); }

.rsvp-table td {
    padding: var(--sp-4) var(--sp-4);
    vertical-align: top;
    color: var(--text);
}

/* Guest cell */
.guest-name {
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
}

.guest-title-tag {
    display: inline-block;
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--accent-text);
    background: var(--accent-subtle);
    border-radius: var(--r-sm);
    padding: 1px 6px;
    margin-bottom: var(--sp-1);
    letter-spacing: 0.02em;
}

.guest-spouse {
    font-size: 0.8125rem;
    color: var(--text-subtle);
    margin-top: 2px;
}

/* Email cell */
.email-cell {
    color: var(--text-muted);
    font-size: 0.8125rem;
}

/* Side cell */
.side-cell {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* Attendance badge */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: var(--r-full);
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-accept {
    background: var(--accept-bg);
    color: var(--accept-text);
    border: 1px solid var(--accept-border);
}

.badge-decline {
    background: var(--decline-bg);
    color: var(--decline-text);
    border: 1px solid var(--decline-border);
}

.badge-dot {
    width: 5px;
    height: 5px;
    border-radius: var(--r-full);
    background: currentColor;
}

/* Wishes cell */
.wishes-cell {
    max-width: 220px;
    color: var(--text-muted);
    font-size: 0.8125rem;
    font-style: italic;
    line-height: 1.5;
}

.no-wishes {
    color: var(--text-subtle);
    font-style: normal;
}

/* Note cell */
.note-cell {
    min-width: 160px;
    max-width: 200px;
}

.note-input {
    width: 100%;
    height: 32px;
    padding: 0 var(--sp-2);
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--r-sm);
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-size: 0.8125rem;
    outline: none;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.note-input::placeholder {
    color: var(--text-subtle);
    font-style: italic;
}

.note-input:hover {
    background: var(--bg-elevated);
    border-color: var(--border);
}

.note-input:focus {
    background: var(--bg-elevated);
    border-color: var(--accent-dim);
    box-shadow: 0 0 0 2px hsl(42, 40%, 25% / 0.2);
    color: var(--text);
}

/* Date cell */
.date-cell {
    color: var(--text-subtle);
    font-size: 0.8125rem;
    white-space: nowrap;
}

/* Actions cell */
.actions-cell {
    white-space: nowrap;
}

.btn-delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    color: var(--text-subtle);
    cursor: pointer;
    transition: all 0.15s;
}

.btn-delete:hover {
    background: var(--decline-bg);
    border-color: var(--decline-border);
    color: var(--decline-text);
}

/* ── Delete Modal ───────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 40;
    padding: var(--sp-6);
    animation: fade-in 0.15s ease;
}

@keyframes fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.modal-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    padding: var(--sp-8);
    max-width: 400px;
    width: 100%;
    text-align: center;
    box-shadow:
        0 4px 16px rgba(0,0,0,0.3),
        0 24px 64px rgba(0,0,0,0.3);
    animation: modal-enter 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modal-enter {
    from { opacity: 0; transform: scale(0.95) translateY(8px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: var(--decline-bg);
    border: 1px solid var(--decline-border);
    border-radius: var(--r-xl);
    color: var(--decline-text);
    margin: 0 auto var(--sp-5);
}

.modal-title {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 400;
    letter-spacing: -0.01em;
    color: var(--text);
    margin-bottom: var(--sp-2);
}

.modal-desc {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: var(--sp-8);
    line-height: 1.6;
}

.modal-actions {
    display: flex;
    gap: var(--sp-3);
}

.btn-modal-cancel,
.btn-modal-delete {
    flex: 1;
    height: 44px;
    border-radius: var(--r-md);
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-modal-cancel {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text-muted);
}

.btn-modal-cancel:hover {
    border-color: var(--border-hover);
    color: var(--text);
}

.btn-modal-delete {
    background: var(--danger);
    border: none;
    color: #fff;
}

.btn-modal-delete:hover { background: var(--danger-hover); }

/* ── Toast ──────────────────────────────────────────────── */
.toast {
    position: fixed;
    bottom: var(--sp-6);
    right: var(--sp-6);
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: var(--sp-3) var(--sp-5);
    font-size: 0.875rem;
    color: var(--text);
    z-index: 60;
    box-shadow:
        0 4px 12px rgba(0,0,0,0.3),
        0 16px 32px rgba(0,0,0,0.2);
    animation: toast-enter 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes toast-enter {
    from { opacity: 0; transform: translateY(16px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.toast-icon {
    color: var(--accept-text);
    font-size: 1rem;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 1024px) {
    .stats-row {
        grid-template-columns: repeat(3, 1fr);
    }

    .stat-card:nth-child(3) { border-right: none; }
    .stat-card:nth-child(4) { border-top: 1px solid var(--border); }
    .stat-card:nth-child(5) { border-top: 1px solid var(--border); }
}

@media (max-width: 768px) {
    :root { --sidebar-w: 0px; }

    .sidebar { display: none; }

    .topbar {
        padding: var(--sp-4) var(--sp-4);
        flex-wrap: wrap;
        gap: var(--sp-3);
    }

    .filter-bar { padding: var(--sp-4) var(--sp-4); }

    .table-container { padding: var(--sp-4); }

    .stats-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .stat-card:nth-child(3) { border-right: 1px solid var(--border); }
    .stat-card:nth-child(2n) { border-right: none; }
    .stat-card:nth-child(n+3) { border-top: 1px solid var(--border); }
}
