/* ═══════════════════════════════════════════════════════════════════
   SSC LMS — Unified Design System (Admin + Public + CMS)
   Premium SaaS · 8px grid · Pixel-aligned components
   ═══════════════════════════════════════════════════════════════════ */

:root {
    /* Brand — single primary (indigo) */
    --ds-primary: #6366F1;
    --ds-primary-hover: #4F46E5;
    --ds-primary-active: #4338ca;
    --ds-primary-muted: rgba(99, 102, 241, 0.1);
    --ds-primary-ring: rgba(99, 102, 241, 0.22);

    /* Semantic */
    --ds-success: #10B981;
    --ds-success-muted: rgba(16, 185, 129, 0.1);
    --ds-warning: #d97706;
    --ds-warning-muted: #fffbeb;
    --ds-danger: #ef4444;
    --ds-danger-muted: #fef2f2;
    --ds-info: #0ea5e9;
    --ds-info-muted: #f0f9ff;

    /* Surfaces */
    --ds-bg: #f1f5f9;
    --ds-bg-subtle: #f8fafc;
    --ds-surface: #ffffff;
    --ds-surface-raised: #ffffff;
    --ds-border: #e2e8f0;
    --ds-border-subtle: #f1f5f9;
    --ds-divider: #e2e8f0;

    /* Text */
    --ds-text: #0f172a;
    --ds-text-secondary: #475569;
    --ds-text-muted: #64748b;
    --ds-text-inverse: #ffffff;

    /* Layout */
    --site-header-h: 4rem;
    --ds-sidebar-w: 16rem;
    --ds-header-h: 4rem;
    --ds-content-max: 48rem;
    --ds-page-max: 80rem;

    /* Shape */
    --ds-radius-sm: 8px;
    --ds-radius-md: 12px;
    --ds-radius-lg: 16px;
    --ds-radius-xl: 20px;
    --ds-radius-full: 9999px;

    /* Spacing */
    --ds-space-1: 8px;
    --ds-space-2: 16px;
    --ds-space-3: 24px;
    --ds-space-4: 32px;
    --ds-space-5: 40px;

    /* Shadows */
    --ds-shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
    --ds-shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
    --ds-shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
    --ds-shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.1);

    /* Motion */
    --ds-ease: cubic-bezier(0.16, 1, 0.3, 1);
    --ds-duration: 0.18s;

    /* Sidebar navigation */
    --ds-sidebar-link-hover-bg: rgba(15, 23, 42, 0.04);
    --ds-sidebar-link-hover-text: #334155;
    --ds-sidebar-link-active-bg: rgba(15, 23, 42, 0.06);
    --ds-sidebar-link-active-hover-bg: rgba(15, 23, 42, 0.08);
    --ds-sidebar-link-active-text: #0f172a;
    --ds-sidebar-link-indicator: #94a3b8;

    /* Typography */
    --ds-font-sans: 'Inter', system-ui, sans-serif;
    --ds-font-heading: 'Plus Jakarta Sans', 'Inter', sans-serif;
    --ds-text-xs: 0.75rem;
    --ds-text-sm: 0.8125rem;
    --ds-text-base: 0.875rem;
    --ds-text-lg: 1rem;
    --ds-text-xl: 1.25rem;
    --ds-text-2xl: 1.5rem;
    --ds-leading: 1.5;
}

html.dark {
    --ds-bg: #0f172a;
    --ds-bg-subtle: #1e293b;
    --ds-surface: #1e293b;
    --ds-surface-raised: #334155;
    --ds-border: #334155;
    --ds-border-subtle: #1e293b;
    --ds-divider: #334155;
    --ds-text: #f1f5f9;
    --ds-text-secondary: #cbd5e1;
    --ds-text-muted: #94a3b8;
    --ds-primary-muted: rgba(99, 102, 241, 0.15);
    --ds-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
    --ds-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.25);
    --ds-sidebar-link-hover-bg: rgba(255, 255, 255, 0.05);
    --ds-sidebar-link-hover-text: #e2e8f0;
    --ds-sidebar-link-active-bg: rgba(255, 255, 255, 0.08);
    --ds-sidebar-link-active-hover-bg: rgba(255, 255, 255, 0.1);
    --ds-sidebar-link-active-text: #f8fafc;
    --ds-sidebar-link-indicator: #64748b;
}

/* ─── Global polish ─── */
*, *::before, *::after { box-sizing: border-box; }

:focus-visible {
    outline: 2px solid var(--ds-primary);
    outline-offset: 2px;
}

::selection {
    background: var(--ds-primary-muted);
    color: var(--ds-text);
}

/* ─── Design system components ─── */

.ds-card {
    background: var(--ds-surface);
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-lg);
    box-shadow: var(--ds-shadow-xs);
    padding: var(--ds-space-2);
    transition: box-shadow var(--ds-duration) var(--ds-ease), border-color var(--ds-duration) var(--ds-ease);
}

.ds-card:hover { box-shadow: var(--ds-shadow-sm); }

.ds-card__header {
    padding: var(--ds-space-2) var(--ds-space-2) 0;
    border-bottom: 1px solid var(--ds-border-subtle);
    margin-bottom: var(--ds-space-2);
    padding-bottom: var(--ds-space-2);
}

.ds-card__title {
    margin: 0;
    font-family: var(--ds-font-heading);
    font-size: var(--ds-text-lg);
    font-weight: 700;
    line-height: 1.35;
    color: var(--ds-text);
    letter-spacing: -0.02em;
}

.ds-card__desc {
    margin: 4px 0 0;
    font-size: var(--ds-text-sm);
    line-height: 1.5;
    color: var(--ds-text-muted);
}

.ds-stat {
    background: var(--ds-surface);
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-lg);
    padding: var(--ds-space-2);
    box-shadow: var(--ds-shadow-xs);
    transition: transform var(--ds-duration) var(--ds-ease), box-shadow var(--ds-duration) var(--ds-ease);
}

.ds-stat:hover {
    transform: translateY(-1px);
    box-shadow: var(--ds-shadow-sm);
}

.ds-stat__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--ds-space-1);
}

.ds-stat__label {
    font-size: var(--ds-text-sm);
    font-weight: 500;
    color: var(--ds-text-muted);
    line-height: 1.4;
}

.ds-stat__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--ds-radius-md);
    font-size: 15px;
    flex-shrink: 0;
}

.ds-stat__value {
    margin: var(--ds-space-1) 0 0;
    font-family: var(--ds-font-heading);
    font-size: var(--ds-text-2xl);
    font-weight: 700;
    line-height: 1.2;
    color: var(--ds-text);
    letter-spacing: -0.02em;
}

.ds-input,
.ds-select,
.ds-textarea {
    display: block;
    width: 100%;
    min-height: 40px;
    padding: 0 12px;
    font-family: var(--ds-font-sans);
    font-size: var(--ds-text-base);
    line-height: 1.4;
    color: var(--ds-text);
    background: var(--ds-surface);
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-md);
    transition: border-color var(--ds-duration), box-shadow var(--ds-duration);
}

.ds-textarea {
    min-height: 88px;
    padding: 10px 12px;
    resize: vertical;
}

.ds-input:focus,
.ds-select:focus,
.ds-textarea:focus {
    outline: none;
    border-color: var(--ds-primary);
    box-shadow: 0 0 0 3px var(--ds-primary-ring);
}

.ds-label {
    display: block;
    margin-bottom: 6px;
    font-size: var(--ds-text-sm);
    font-weight: 600;
    color: var(--ds-text);
    line-height: 1.4;
}

.ds-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 16px;
    font-family: var(--ds-font-sans);
    font-size: var(--ds-text-sm);
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: var(--ds-radius-md);
    cursor: pointer;
    white-space: nowrap;
    transition: background var(--ds-duration), border-color var(--ds-duration), transform 0.1s, box-shadow var(--ds-duration);
}

.ds-btn:active { transform: scale(0.98); }

.ds-btn--primary {
    background: var(--ds-primary);
    color: var(--ds-text-inverse);
    box-shadow: 0 4px 12px -2px rgba(99, 102, 241, 0.25);
}
.ds-btn--primary:hover { background: var(--ds-primary-hover); }

.ds-btn--secondary {
    background: var(--ds-surface);
    color: var(--ds-text);
    border-color: var(--ds-border);
}
.ds-btn--secondary:hover { background: var(--ds-bg-subtle); }

.ds-btn--ghost {
    background: transparent;
    color: var(--ds-text-muted);
    border-color: var(--ds-border);
}
.ds-btn--ghost:hover { background: var(--ds-bg-subtle); color: var(--ds-text); }

.ds-btn--danger {
    background: transparent;
    color: var(--ds-danger);
    border-color: rgba(220, 38, 38, 0.25);
    min-height: 32px;
    padding: 0 12px;
    font-size: var(--ds-text-xs);
}
.ds-btn--danger:hover { background: var(--ds-danger-muted); }

.ds-btn--sm { min-height: 32px; padding: 0 12px; font-size: var(--ds-text-xs); }

/* Normalize legacy submit buttons in admin forms */
.admin-shell button.rounded-xl.bg-brand-600,
.admin-shell a.rounded-xl.bg-brand-600,
.admin-shell button[type="submit"].rounded-xl.bg-brand-600 {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    font-weight: 600;
    border-radius: var(--ds-radius-md);
    box-shadow: 0 1px 2px rgba(37, 99, 235, 0.2);
    transition: background var(--ds-duration), transform 0.1s;
}
.admin-shell button.rounded-xl.bg-brand-600:active,
.admin-shell a.rounded-xl.bg-brand-600:active {
    transform: scale(0.98);
}

.ds-badge {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 8px;
    border-radius: var(--ds-radius-full);
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}

.ds-badge--success { background: var(--ds-success-muted); color: var(--ds-success); }
.ds-badge--warning { background: var(--ds-warning-muted); color: var(--ds-warning); }
.ds-badge--danger  { background: var(--ds-danger-muted); color: var(--ds-danger); }
.ds-badge--neutral { background: var(--ds-bg); color: var(--ds-text-muted); }

.ds-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--ds-space-2);
    margin-bottom: var(--ds-space-2);
}

.ds-toolbar__filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.ds-table-wrap {
    overflow: hidden;
    background: var(--ds-surface);
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-lg);
    box-shadow: var(--ds-shadow-xs);
}

.ds-table-wrap__head {
    padding: var(--ds-space-2);
    border-bottom: 1px solid var(--ds-border);
}

.ds-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--ds-text-base);
}

.ds-table thead {
    background: var(--ds-bg-subtle);
    color: var(--ds-text-muted);
    font-size: var(--ds-text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.ds-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
}

.ds-table td {
    padding: 12px 16px;
    color: var(--ds-text);
    border-top: 1px solid var(--ds-border-subtle);
    vertical-align: middle;
}

.ds-table tbody tr {
    transition: background var(--ds-duration);
}

.ds-table tbody tr:hover {
    background: var(--ds-bg-subtle);
}

.ds-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--ds-space-5) var(--ds-space-3);
    text-align: center;
    color: var(--ds-text-muted);
    font-size: var(--ds-text-sm);
    line-height: 1.5;
}

.ds-empty__icon {
    font-size: 2rem;
    margin-bottom: var(--ds-space-2);
    opacity: 0.35;
}

.ds-toast {
    position: fixed;
    bottom: var(--ds-space-2);
    right: var(--ds-space-2);
    z-index: 9999;
    max-width: 24rem;
    padding: 12px 16px;
    border-radius: var(--ds-radius-md);
    font-size: var(--ds-text-sm);
    font-weight: 500;
    line-height: 1.45;
    box-shadow: var(--ds-shadow-lg);
    animation: ds-toast-in 0.35s var(--ds-ease);
}

.ds-toast--success {
    background: var(--ds-success-muted);
    color: #065f46;
    border: 1px solid rgba(5, 150, 105, 0.25);
}

.ds-toast--error {
    background: var(--ds-danger-muted);
    color: #991b1b;
    border: 1px solid rgba(220, 38, 38, 0.25);
}

html.dark .ds-toast--success { color: #6ee7b7; background: #064e3b; }
html.dark .ds-toast--error  { color: #fca5a5; background: #7f1d1d; }

@keyframes ds-toast-in {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.ds-page-header {
    margin-bottom: var(--ds-space-3);
}

.ds-page-header__title {
    margin: 0;
    font-family: var(--ds-font-heading);
    font-size: var(--ds-text-xl);
    font-weight: 700;
    color: var(--ds-text);
}

.ds-skeleton {
    background: linear-gradient(90deg, var(--ds-border-subtle) 25%, var(--ds-border) 50%, var(--ds-border-subtle) 75%);
    background-size: 200% 100%;
    animation: ds-shimmer 1.2s infinite;
    border-radius: var(--ds-radius-sm);
}

@keyframes ds-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ═══ Dashboard layout — full-width fluid shell ═══ */
.dash-layout {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

.dash-main {
    flex: 1 1 0%;
    min-width: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
}

.dash-sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 35;
    background: rgba(15, 23, 42, 0.45);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--ds-duration) var(--ds-ease), visibility var(--ds-duration);
    backdrop-filter: blur(2px);
}

.dash-sidebar-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

#sidebar.dash-sidebar {
    flex-shrink: 0;
    width: var(--ds-sidebar-w);
    transition: width 0.3s var(--ds-ease), transform 0.3s var(--ds-ease);
}

/* ═══ Admin shell — normalizes legacy Tailwind admin pages ═══ */
.admin-shell {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    color: var(--ds-text);
}

.admin-shell--fluid {
    flex: 1;
    margin: 0;
}

/* Responsive admin grids */
.admin-grid-stats {
    display: grid;
    gap: var(--ds-space-2);
    grid-template-columns: 1fr;
    width: 100%;
}

@media (min-width: 640px) {
    .admin-grid-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
    .admin-grid-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.admin-grid-charts {
    display: grid;
    gap: var(--ds-space-3);
    grid-template-columns: 1fr;
    width: 100%;
}

@media (min-width: 1280px) {
    .admin-grid-charts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Full-width tables with horizontal scroll when needed */
.admin-shell .ds-table-wrap,
.admin-shell .admin-table-scroll {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.admin-shell .ds-table-wrap table,
.admin-shell .admin-table-scroll table,
.admin-shell table.w-full {
    width: 100%;
    min-width: 0;
}

.admin-shell .overflow-hidden.rounded-2xl.border.border-slate-200.bg-white,
.admin-shell .overflow-hidden.rounded-2xl.border {
    max-width: 100%;
}

.admin-shell .overflow-hidden.rounded-2xl.border:has(table) {
    overflow-x: auto;
}

/* List pages: let tables and cards breathe on desktop */
.admin-shell--fluid > .mx-auto.max-w-5xl,
.admin-shell--fluid > .mx-auto.max-w-4xl {
    max-width: none;
    margin-left: 0;
    margin-right: 0;
    width: 100%;
}

.admin-shell input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="color"]),
.admin-shell select,
.admin-shell textarea {
    min-height: 40px;
    padding: 0 12px;
    font-size: var(--ds-text-base);
    color: var(--ds-text);
    background: var(--ds-surface);
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-md);
    transition: border-color var(--ds-duration), box-shadow var(--ds-duration);
}

.admin-shell textarea { padding: 10px 12px; }

.admin-shell input:focus,
.admin-shell select:focus,
.admin-shell textarea:focus {
    outline: none;
    border-color: var(--ds-primary);
    box-shadow: 0 0 0 3px var(--ds-primary-ring);
}

.admin-shell table {
    font-size: var(--ds-text-base);
}

.admin-shell table thead {
    background: var(--ds-bg-subtle);
}

.admin-shell table th {
    padding: 12px 16px;
    font-size: var(--ds-text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ds-text-muted);
}

.admin-shell table td {
    padding: 12px 16px;
    border-top: 1px solid var(--ds-border-subtle);
    vertical-align: middle;
}

.admin-shell table tbody tr:hover {
    background: var(--ds-bg-subtle);
}

.admin-shell .rounded-2xl.border.border-slate-200.bg-white,
.admin-shell .overflow-hidden.rounded-2xl.border {
    background: var(--ds-surface) !important;
    border-color: var(--ds-border) !important;
    border-radius: var(--ds-radius-xl) !important;
    box-shadow: var(--ds-shadow-sm);
}

html.dark .admin-shell .rounded-2xl.border.border-slate-200.bg-white,
html.dark .admin-shell .overflow-hidden.rounded-2xl.border {
    background: var(--ds-surface) !important;
    border-color: var(--ds-border) !important;
}

.admin-shell .font-heading {
    font-family: var(--ds-font-heading);
    letter-spacing: -0.02em;
}

/* ═══ Dashboard sidebar (premium) ═══ */
.dash-sidebar {
    background: var(--ds-surface);
    border-right: 1px solid var(--ds-border);
}

.dash-sidebar__brand {
    height: var(--ds-header-h);
    padding: 0 var(--ds-space-2);
    border-bottom: 1px solid var(--ds-border);
    display: flex;
    align-items: center;
}

.dash-sidebar__site-name {
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--ds-text);
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dash-sidebar__nav {
    padding: var(--ds-space-1);
    flex: 1;
    overflow-y: auto;
}

.dash-sidebar__link {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 40px;
    padding: 8px 12px;
    margin-bottom: 2px;
    border-radius: var(--ds-radius-md);
    font-size: var(--ds-text-sm);
    font-weight: 500;
    color: var(--ds-text-muted);
    text-decoration: none;
    border: 1px solid transparent;
    transition:
        background 0.22s var(--ds-ease),
        color 0.22s var(--ds-ease),
        border-color 0.22s var(--ds-ease),
        transform 0.22s var(--ds-ease);
}

.dash-sidebar__link i {
    width: 20px;
    text-align: center;
    font-size: 14px;
    flex-shrink: 0;
    color: inherit;
    opacity: 0.88;
    transition: opacity 0.22s var(--ds-ease), transform 0.22s var(--ds-ease);
}

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

.dash-sidebar__link:hover i {
    opacity: 1;
}

.dash-sidebar__link:focus-visible {
    outline: none;
    border-color: var(--ds-border);
    background: var(--ds-sidebar-link-hover-bg);
    color: var(--ds-sidebar-link-hover-text);
    box-shadow: 0 0 0 2px rgba(148, 163, 184, 0.35);
}

.dash-sidebar__link.is-active {
    background: var(--ds-sidebar-link-active-bg);
    color: var(--ds-sidebar-link-active-text);
    font-weight: 600;
    box-shadow: none;
}

.dash-sidebar__link.is-active i {
    opacity: 1;
}

.dash-sidebar__link.is-active:hover {
    background: var(--ds-sidebar-link-active-hover-bg);
    color: var(--ds-sidebar-link-active-text);
}

.dash-sidebar__link.is-active:focus-visible {
    border-color: transparent;
    box-shadow: 0 0 0 2px rgba(148, 163, 184, 0.4);
}

.sidebar-badge {
    font-size: 0.625rem;
    font-weight: 700;
    line-height: 1;
    padding: 0.2rem 0.45rem;
    border-radius: var(--ds-radius-full);
    background: rgba(15, 23, 42, 0.08);
    color: var(--ds-text-secondary);
}

.sidebar-badge--alert {
    background: rgba(239, 68, 68, 0.1);
    color: #991b1b;
}

html.dark .sidebar-badge {
    background: rgba(255, 255, 255, 0.1);
    color: var(--ds-text-secondary);
}

html.dark .sidebar-badge--alert {
    background: rgba(248, 113, 113, 0.14);
    color: #fecaca;
}

.dash-header {
    height: var(--ds-header-h);
    background: var(--ds-surface);
    border-bottom: 1px solid var(--ds-border);
    box-shadow: var(--ds-shadow-xs);
}

.dash-header__title {
    font-family: var(--ds-font-heading);
    font-size: var(--ds-text-lg);
    font-weight: 700;
    color: var(--ds-text);
    letter-spacing: -0.02em;
}

/* ═══ Public site ═══ */
.public-main {
    flex: 1;
}

.public-section {
    padding: var(--ds-space-5) 0;
}

@media (min-width: 768px) {
    .public-section { padding: 64px 0; }
}

.site-header {
    background: rgba(255, 255, 255, 0.92) !important;
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--ds-border) !important;
    box-shadow: var(--ds-shadow-xs);
}

html.dark .site-header {
    background: rgba(15, 23, 42, 0.92) !important;
    border-bottom-color: var(--ds-border) !important;
}

.site-header-cta,
.site-header-cta-mobile {
    background: var(--ds-primary) !important;
    border-radius: var(--ds-radius-md) !important;
    font-weight: 600 !important;
    transition: background var(--ds-duration) !important;
}

.site-header-cta:hover,
.site-header-cta-mobile:hover {
    background: var(--ds-primary-hover) !important;
}

.site-footer {
    background: var(--ds-bg-subtle) !important;
    border-top-color: var(--ds-border) !important;
}

/* Nav link polish */
.site-nav-link {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 12px;
    border-radius: var(--ds-radius-sm);
    font-size: var(--ds-text-sm);
    font-weight: 500;
    color: var(--ds-text-secondary);
    text-decoration: none;
    transition: background var(--ds-duration), color var(--ds-duration);
}

.site-nav-link:hover {
    background: var(--ds-bg);
    color: var(--ds-primary);
}

/* Pagination in admin */
.admin-shell nav[aria-label="Pagination"] a,
.admin-shell .pagination a {
    min-width: 36px;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--ds-radius-sm);
    font-size: var(--ds-text-sm);
    font-weight: 600;
}

/* Dark mode — normalize legacy Tailwind slate utilities in admin */
html.dark .admin-shell .text-slate-900,
html.dark .admin-shell .font-bold.text-slate-900,
html.dark .admin-shell h1.text-slate-900,
html.dark .admin-shell h2.text-slate-900,
html.dark .admin-shell h3.text-slate-900 {
    color: var(--ds-text) !important;
}

html.dark .admin-shell .text-slate-700,
html.dark .admin-shell .text-slate-600 {
    color: var(--ds-text-secondary) !important;
}

html.dark .admin-shell .text-slate-500,
html.dark .admin-shell .text-slate-400 {
    color: var(--ds-text-muted) !important;
}

html.dark .admin-shell .bg-slate-50,
html.dark .admin-shell thead.bg-slate-50 {
    background: var(--ds-bg-subtle) !important;
}

html.dark .admin-shell .border-slate-200,
html.dark .admin-shell .border-slate-100 {
    border-color: var(--ds-border) !important;
}

html.dark .admin-shell .bg-white {
    background: var(--ds-surface) !important;
}

html.dark .dash-sidebar,
html.dark .dash-header {
    background: var(--ds-surface) !important;
    border-color: var(--ds-border) !important;
}

/* Confirm modal */
.ds-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.ds-modal[hidden] {
    display: none !important;
}

body.ds-modal-open {
    overflow: hidden;
}

.ds-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
}

.ds-modal__panel {
    position: relative;
    width: 100%;
    max-width: 420px;
    border-radius: var(--ds-radius-lg);
    background: var(--ds-surface);
    border: 1px solid var(--ds-border);
    box-shadow: var(--ds-shadow-lg);
    padding: 1.5rem;
    text-align: center;
}

.ds-modal__icon {
    width: 3rem;
    height: 3rem;
    margin: 0 auto 1rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.ds-modal__icon--warning {
    background: rgba(245, 158, 11, 0.12);
    color: #d97706;
}

.ds-modal__title {
    font-family: var(--ds-font-heading);
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--ds-text);
    margin-bottom: 0.5rem;
}

.ds-modal__message {
    font-size: 0.875rem;
    color: var(--ds-text-muted);
    line-height: 1.5;
    margin-bottom: 1.25rem;
}

.ds-modal__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.ds-select--sm {
    min-height: 32px;
    padding: 0.25rem 0.75rem;
    font-size: var(--ds-text-xs);
}
