/*  Design Tokens  */

:root {
    /* Surfaces */
    --bg:           #f1f5f9;
    --surface:      #ffffff;
    --surface-soft: #f8fafc;

    /* Text */
    --text:         #0f172a;
    --muted:        #64748b;

    /* Borders & Shadows */
    --line:         #e2e8f0;
    --shadow-sm:    0 1px 2px rgba(15, 23, 42, .06);
    --shadow:       0 1px 3px rgba(15, 23, 42, .08), 0 4px 12px rgba(15, 23, 42, .05);
    --shadow-md:    0 4px 16px rgba(15, 23, 42, .08), 0 1px 4px rgba(15, 23, 42, .05);

    /* Radius */
    --radius:       10px;
    --radius-sm:    7px;
    --radius-full:  999px;

    /* Actions */
    --primary:      #2563eb;
    --primary-dark: #1d4ed8;
    --primary-soft: #eff6ff;
    --danger:       #dc2626;
    --ok:           #16a34a;

    /* Semantic states */
    --state-ok-bg:       #f0fdf4;
    --state-ok-line:     #86efac;
    --state-ok-text:     #15803d;

    --state-info-bg:     #eff6ff;
    --state-info-line:   #bfdbfe;
    --state-info-text:   #1d4ed8;

    --state-warn-bg:     #fff7ed;
    --state-warn-line:   #fed7aa;
    --state-warn-text:   #c2410c;

    --state-error-bg:    #fef2f2;
    --state-error-line:  #fecaca;
    --state-error-text:  #b91c1c;

    --state-neutral-bg:   #f8fafc;
    --state-neutral-line: #e2e8f0;
    --state-neutral-text: #475569;

    /* Sidebar */
    --sidebar-width:  260px;
    --sidebar-bg:     #0f172a;
    --sidebar-border: rgba(255, 255, 255, .06);
    --sidebar-text:   #94a3b8;
    --sidebar-hover:  rgba(255, 255, 255, .07);
    --sidebar-active-bg:   #1e3a8a;
    --sidebar-active-text: #e0eaff;

    /* Spacing */
    --page-gap:         1.25rem;
    --page-hero-gap:    1rem;
    --page-hero-pad-y:  1.25rem;
    --page-hero-pad-x:  1.5rem;
    --page-card-pad:    1.25rem;
}

/*  Base  */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 0.9375rem;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

h2 {
    line-height: 1.25;
}

body.public-shell {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

a {
    color: var(--primary);
    text-decoration: none;
}

/*  App Shell  */
.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
}

.app-shell.auth-page {
    grid-template-columns: 1fr;
    align-items: center;
    justify-items: center;
}

.app-shell.auth-page .main-content {
    width: 100%;
    max-width: 600px;
    justify-items: center;
    align-content: center;
}

.public-shell {
    padding: 2rem;
}

.public-content {
    width: 100%;
    max-width: 520px;
}

.public-brand {
    display: none;
}

.public-brand h1 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text);
}

.public-brand-logo {
    width: 64px;
    height: auto;
    display: block;
}

.public-legal {
    margin: 1.5rem 0 0;
    text-align: center;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
}

.public-legal a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    transition: color 0.2s ease;
}

.public-legal a:hover {
    color: #fff;
}

/*  Sidebar  */
.sidebar {
    height: 100vh;
    position: sticky;
    top: 0;
    padding: 1.25rem 0.75rem;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--sidebar-border);
    overflow-y: auto;
}

.sidebar .menu {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.sidebar-footer {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem 0.5rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 0.5rem;
}

.brand-logo {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    margin-bottom: 0.75rem;
}

.brand h1 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #f1f5f9;
    letter-spacing: -0.02em;
}

.menu {
    display: grid;
    gap: 0.2rem;
}

.menu a {
    display: block;
    border-radius: var(--radius-sm);
    padding: 0.58rem 0.75rem;
    color: var(--sidebar-text);
    font-size: 0.875rem;
    font-weight: 500;
    transition: background 0.15s ease, color 0.15s ease;
}

.menu a:hover {
    background: var(--sidebar-hover);
    color: #cbd5e1;
}

.menu a.active {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-active-text);
    font-weight: 600;
}

.logout-form {
    padding: 0 0.25rem;
}

.sidebar-footer .logout-form,
.sidebar-footer .sidebar-legal {
    padding: 0 0.25rem;
}

.sidebar-legal {
    margin: 0;
    padding: 0 0.5rem;
    font-size: 0.72rem;
    line-height: 1.4;
    color: #94a3b8;
    text-align: center;
}

.sidebar-legal a {
    color: #94a3b8;
    text-decoration: none;
}

/*  Main Content  */
.main-content {
    padding: 1.5rem;
    display: grid;
    align-content: start;
    gap: var(--page-gap);
    min-width: 0;
}

/*  Panels & Cards  */
.panel,
.card,
.auth-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.panel,
.auth-panel {
    padding: var(--page-card-pad);
}

.panel.narrow {
    max-width: 480px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.panel h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
}

.panel h3 {
    margin: 0.15rem 0 0.3rem;
    font-size: 0.9375rem;
    font-weight: 600;
}

.panel hr {
    border: 0;
    border-top: 1px solid var(--line);
    margin: 0.75rem 0;
}

/*  Grid Utilities  */
.grid {
    display: grid;
    gap: var(--page-gap);
}

.stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.two-columns {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

/*  Stat Cards  */
.stat {
    padding: var(--page-card-pad);
}

.stat p {
    margin: 0;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.stat h3 {
    margin: 0.4rem 0 0;
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

/*  Forms  */
.stack-form {
    display: grid;
    gap: 0.875rem;
}

.stack-form label,
.ui-form label,
.cmp-form label,
.nl-card label,
.smtp-card label,
.users-form label,
.subs-form label,
.subs-filter-form label {
    display: grid;
    gap: 0.3rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text);
}

/* Unified input styles */
.ui-form input:not([type="checkbox"]):not([type="radio"]),
.ui-form select,
.ui-form textarea,
.stack-form input:not([type="checkbox"]):not([type="radio"]),
.stack-form select,
.stack-form textarea,
.cmp-form input:not([type="checkbox"]):not([type="radio"]),
.cmp-form select,
.cmp-form textarea,
.nl-card input:not([type="checkbox"]):not([type="radio"]),
.nl-card select,
.nl-card textarea,
.smtp-card input:not([type="checkbox"]):not([type="radio"]),
.smtp-card select,
.smtp-card textarea,
.users-form input:not([type="checkbox"]):not([type="radio"]),
.users-form select,
.subs-form input:not([type="checkbox"]):not([type="radio"]),
.subs-form select,
.subs-form textarea,
.subs-filter-form input:not([type="checkbox"]):not([type="radio"]),
.subs-filter-form select {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    font-size: 0.9rem;
    font-family: inherit;
    color: var(--text);
    background: var(--surface);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.stack-form textarea {
    resize: vertical;
}

.ui-form input:not([type="checkbox"]):not([type="radio"]):focus,
.ui-form select:focus,
.ui-form textarea:focus,
.stack-form input:not([type="checkbox"]):not([type="radio"]):focus,
.stack-form select:focus,
.stack-form textarea:focus,
.cmp-form input:not([type="checkbox"]):not([type="radio"]):focus,
.cmp-form select:focus,
.cmp-form textarea:focus,
.nl-card input:not([type="checkbox"]):not([type="radio"]):focus,
.nl-card select:focus,
.nl-card textarea:focus,
.smtp-card input:not([type="checkbox"]):not([type="radio"]):focus,
.smtp-card select:focus,
.smtp-card textarea:focus,
.users-form input:not([type="checkbox"]):not([type="radio"]):focus,
.users-form select:focus,
.subs-form input:not([type="checkbox"]):not([type="radio"]):focus,
.subs-form select:focus,
.subs-form textarea:focus,
.subs-filter-form input:not([type="checkbox"]):not([type="radio"]):focus,
.subs-filter-form select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}

/* Select arrow */
.ui-form select,
.stack-form select,
.cmp-form select,
.nl-card select,
.smtp-card select,
.users-form select,
.subs-form select,
.subs-filter-form select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' stroke='%2364748b' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 0.65rem;
    padding-right: 2.25rem;
    cursor: pointer;
}

.ui-form select::-ms-expand,
.stack-form select::-ms-expand,
.cmp-form select::-ms-expand,
.nl-card select::-ms-expand,
.smtp-card select::-ms-expand,
.users-form select::-ms-expand,
.subs-form select::-ms-expand,
.subs-filter-form select::-ms-expand {
    display: none;
}

.checkbox {
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 0.6rem;
}

.checkbox input {
    width: auto;
}

/*  Buttons  */
.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 0.4rem;
    border: 0;
    border-radius: var(--radius-sm);
    padding: 0.58rem 1rem;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1;
    background: var(--primary);
    color: #fff;
    cursor: pointer;
    transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
    white-space: nowrap;
}

.btn:hover {
    background: var(--primary-dark);
    box-shadow: 0 2px 8px rgba(37, 99, 235, .3);
}

.btn:active {
    transform: translateY(1px);
}

.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
    background: var(--surface-soft);
    border-color: #cbd5e1;
    box-shadow: var(--shadow-sm);
}

.btn-full {
    width: 100%;
}

.btn-small {
    padding: 0.42rem 0.72rem;
    font-size: 0.8rem;
    position: relative;
    z-index: 5;
}

/*  Tables  */
.table-wrap {
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 620px;
    font-size: 0.875rem;
}

th,
td {
    border-bottom: 1px solid var(--line);
    text-align: left;
    padding: 0.65rem 0.6rem;
    vertical-align: middle;
}

td {
    vertical-align: top;
}

th {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted);
    background: var(--surface-soft);
}

tbody tr:hover {
    background: #f8fafc;
}

/*  Badges / Pills  */
.pill {
    display: inline-flex;
    border: 1px solid var(--line);
    border-radius: var(--radius-full);
    padding: 0.2rem 0.6rem;
    background: var(--surface-soft);
    font-size: 0.75rem;
    font-weight: 500;
}

.pill.ok {
    border-color: var(--state-ok-line);
    background: var(--state-ok-bg);
    color: var(--state-ok-text);
}

.pill.danger {
    border-color: var(--state-error-line);
    background: var(--state-error-bg);
    color: var(--state-error-text);
}

/* Unified state pills  all feature-specific pill variants map here */
.ui-status-pill,
.dash-state,
.dash-status-pill,
.subs-state,
.subs-status-pill,
.subs-bounce-pill,
.subs-meta-pill,
.cmp-state,
.cmp-status-pill,
.nl-signup-pill,
.nl-state,
.smtp-state,
.users-role-pill {
    display: inline-flex;
    align-items: center;
    border-radius: var(--radius-full);
    border: 1px solid transparent;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    padding: 0.25rem 0.6rem;
}

/* State: OK / success */
.ui-status-pill.is-ok,
.dash-state.is-ok,
.dash-status-pill.is-ok,
.subs-state.is-ok,
.subs-status-pill.is-ok,
.cmp-state.is-ok,
.cmp-status-pill.is-ok,
.nl-signup-pill.is-on,
.nl-state.is-ok {
    background: var(--state-ok-bg);
    border-color: var(--state-ok-line);
    color: var(--state-ok-text);
}

/* State: info */
.ui-status-pill.is-info,
.dash-state.is-info,
.dash-status-pill.is-info,
.subs-state.is-info,
.cmp-state.is-info,
.cmp-status-pill.is-info {
    background: var(--state-info-bg);
    border-color: var(--state-info-line);
    color: var(--state-info-text);
}

/* State: warn */
.ui-status-pill.is-warn,
.dash-state.is-warn,
.dash-status-pill.is-warn,
.subs-state.is-warn,
.subs-status-pill.is-warn,
.cmp-status-pill.is-warn {
    background: var(--state-warn-bg);
    border-color: var(--state-warn-line);
    color: var(--state-warn-text);
}

/* State: neutral / off */
.ui-status-pill.is-neutral,
.dash-state.is-neutral,
.dash-status-pill.is-neutral,
.subs-status-pill.is-neutral,
.subs-bounce-pill.is-neutral,
.subs-meta-pill,
.cmp-state.is-neutral,
.cmp-status-pill.is-neutral,
.nl-signup-pill.is-off,
.nl-state.is-neutral {
    background: var(--state-neutral-bg);
    border-color: var(--state-neutral-line);
    color: var(--state-neutral-text);
}

/*  Actions Row  */
.actions,
.inline-form {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

/*  Flash Messages  */
.flash {
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    border: 1px solid var(--line);
    background: var(--surface-soft);
    font-size: 0.875rem;
    font-weight: 500;
    transition: opacity 0.4s ease;
}

.flash.is-fading {
    opacity: 0;
}

.flash-success {
    border-color: var(--state-ok-line);
    background: var(--state-ok-bg);
    color: var(--state-ok-text);
}

.flash-error {
    border-color: var(--state-error-line);
    background: var(--state-error-bg);
    color: var(--state-error-text);
}

/*  Toast Notifications  */
.toast-stack {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 1200;
    display: grid;
    gap: 0.5rem;
    max-width: min(400px, calc(100vw - 2.5rem));
    pointer-events: none;
}

.toast {
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: var(--shadow-md);
    padding: 0.875rem 1rem;
    pointer-events: auto;
    animation: toast-enter 0.25s ease;
    transition: opacity 0.3s ease;
}

.toast.is-fading {
    opacity: 0;
}

.toast-title {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text);
}

.toast-text {
    margin: 0.3rem 0 0;
    color: var(--muted);
    font-size: 0.8125rem;
    line-height: 1.4;
}

.toast-warning {
    border-color: var(--state-warn-line);
    background: var(--state-warn-bg);
}

.toast-warning .toast-title {
    color: var(--state-warn-text);
}

.toast-ok {
    border-color: var(--state-ok-line);
    background: var(--state-ok-bg);
}

.toast-ok .toast-title {
    color: var(--state-ok-text);
}

/*  Focus Visible  */
.btn:focus-visible,
.menu a:focus-visible,
.dash-quick-link:focus-visible,
.subs-subnav-link:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/*  Utilities  */
.muted {
    color: var(--muted);
    font-size: 0.8125rem;
}

/*  Auth & Setup  */
.auth-panel {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding: 3.5rem;
    text-align: center;
    background: var(--surface);
    border-radius: 24px;
    box-shadow: 
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 20px 25px -5px rgba(0, 0, 0, 0.1),
        0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.auth-brand {
    margin-bottom: 2rem;
}

.auth-brand-logo {
    width: 72px;
    height: 72px;
    margin-bottom: 1rem;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.auth-brand h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.02em;
}

.auth-panel h2 {
    margin: 0 0 0.5rem;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
}

.auth-panel > p {
    margin: 0 0 2.5rem;
    color: var(--muted);
    font-size: 1rem;
}

.auth-panel .stack-form {
    text-align: left;
    margin-top: 2rem;
    gap: 1.5rem;
}

.auth-panel .stack-form label {
    font-size: 0.875rem;
    font-weight: 600;
    gap: 0.5rem;
    color: var(--text);
}

.auth-panel .stack-form input {
    padding: 1rem 1.25rem;
    font-size: 1rem;
    border-radius: 12px;
    border: 2px solid var(--line);
    background: var(--bg);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-panel .stack-form input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15);
}

.auth-panel .btn {
    margin-top: 1rem;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    width: 100%;
}

.auth-panel .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

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

.auth-copyright {
    margin-top: auto;
    padding-top: 1.5rem;
    border-top: 1px solid var(--line);
    font-size: 0.8125rem;
    color: var(--muted);
}

.auth-copyright a {
    color: var(--muted);
    text-decoration: none;
    transition: color 0.2s ease;
}

.auth-copyright a:hover {
    color: var(--text);
    text-decoration: underline;
}

.setup-panel {
    width: 100%;
    margin: 0 auto;
    padding: var(--page-hero-pad-y) var(--page-hero-pad-x);
    background:
        radial-gradient(circle at 5% 50%, rgba(37, 99, 235, .07), transparent 50%),
        var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.setup-grid {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.setup-span-2 {
    grid-column: 1 / -1;
}

.setup-note {
    color: var(--muted);
    font-size: 0.8125rem;
}

.auth-brand {
    display: grid;
    justify-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.auth-brand h1 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text);
    text-align: center;
    letter-spacing: -0.01em;
}

.auth-brand-logo {
    width: 100px;
    height: auto;
    display: block;
}

/*  Animations  */
@keyframes toast-enter {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.menu-toggle {
    display: none;
}

/*  Responsive  */
@media (max-width: 960px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .menu-toggle {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        width: 44px;
        height: 44px;
        background: var(--sidebar-bg);
        border: none;
        border-radius: 8px;
        cursor: pointer;
        position: fixed;
        top: 1rem;
        left: 1rem;
        z-index: 1001;
        gap: 5px;
    }

    .menu-toggle span {
        display: block;
        width: 24px;
        height: 2px;
        background: #e2e8f0;
        border-radius: 2px;
        transition: transform 0.3s ease, opacity 0.3s ease;
    }

    .menu-toggle[aria-expanded="true"] span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    .menu-toggle[aria-expanded="true"] span:nth-child(2) {
        opacity: 0;
    }

    .menu-toggle[aria-expanded="true"] span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 280px;
        height: 100vh;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1000;
        padding-top: 4rem;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }

    .sidebar-overlay.open {
        display: block;
    }
}

@media (min-width: 961px) {
    .sidebar {
        position: sticky;
        transform: none;
        width: auto;
        height: 100vh;
    }

    .sidebar-overlay {
        display: none !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/*  Modal  */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.open {
    display: flex;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--surface);
    border-radius: 16px;
    padding: 2rem;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: modalSlideIn 0.2s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-content h3 {
    margin: 0 0 1rem;
    font-size: 1.25rem;
    font-weight: 700;
}

.modal-content p {
    margin: 0 0 1.5rem;
    color: var(--muted);
    line-height: 1.5;
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

.btn-danger {
    background: #ef4444;
    color: #fff;
    border: none;
    cursor: pointer;
    position: relative;
    z-index: 10;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-danger:focus {
    outline: 2px solid #fca5a5;
    outline-offset: 2px;
}
