@import url('https://fonts.googleapis.com/css2?family=Inter:wght@500;600;700;800&display=swap');

:root {
    --brand-950: #0c0818;
    --brand-900: #151030;
    --brand-800: #1f1645;
    --brand-700: #2d2160;
    --accent: #6366f1;
    --accent-hover: #4f46e5;
    --accent-light: #818cf8;
    --accent-soft: rgba(99, 102, 241, 0.12);
    --accent-glow: rgba(99, 102, 241, 0.28);
    --cyan: #06b6d4;
    --cyan-soft: rgba(6, 182, 212, 0.12);
    --violet: #a855f7;
    --violet-soft: rgba(168, 85, 247, 0.12);
    --emerald: #10b981;
    --emerald-soft: rgba(16, 185, 129, 0.12);
    --amber: #f59e0b;
    --amber-soft: rgba(245, 158, 11, 0.12);
    --rose: #f43f5e;
    --rose-soft: rgba(244, 63, 94, 0.12);
    --surface: #f3f4fb;
    --surface-card: #ffffff;
    --surface-tint: linear-gradient(135deg, #f8f7ff 0%, #f0fdfa 50%, #fff7ed 100%);
    --border: #e2e8f0;
    --border-light: #eef2ff;
    --text: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --radius: 14px;
    --radius-sm: 10px;
    --sidebar-width: 248px;
    --shadow-sm: 0 1px 3px rgba(79, 70, 229, 0.06);
    --shadow: 0 10px 32px rgba(79, 70, 229, 0.1);
    --shadow-lg: 0 22px 55px rgba(79, 70, 229, 0.14);
    --transition: 0.18s ease;
    --gradient-brand: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #06b6d4 100%);
    --gradient-sidebar: linear-gradient(180deg, #1a1030 0%, #0c0818 100%);
}

* { box-sizing: border-box; }

body {
    background: var(--surface);
    background-image:
        radial-gradient(ellipse 70% 50% at 0% 0%, rgba(99, 102, 241, 0.08), transparent),
        radial-gradient(ellipse 60% 45% at 100% 0%, rgba(6, 182, 212, 0.07), transparent),
        radial-gradient(ellipse 50% 40% at 100% 100%, rgba(168, 85, 247, 0.06), transparent);
    background-attachment: fixed;
    color: var(--text);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* —— Sidebar —— */
.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: var(--gradient-sidebar);
    color: #fff;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1000;
    border-right: 1px solid rgba(129, 140, 248, 0.15);
    box-shadow: 4px 0 24px rgba(12, 8, 24, 0.25);
}

.sidebar .brand {
    padding: 2rem 1.25rem 1.5rem;
    font-weight: 800;
    font-size: .95rem;
    text-align: center;
    letter-spacing: -0.03em;
    line-height: 1.35;
    color: #f8fafc;
    position: relative;
}

.sidebar .brand::after {
    content: '';
    display: block;
    width: 2.75rem;
    height: 3px;
    background: var(--gradient-brand);
    border-radius: 2px;
    margin: .85rem auto 0;
    opacity: .95;
}

.sidebar .nav-link {
    color: rgba(248, 250, 252, 0.72);
    padding: .72rem 1rem;
    margin: .12rem .85rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: .875rem;
    transition: background var(--transition), color var(--transition);
}

.sidebar .nav-link:hover {
    background: rgba(129, 140, 248, 0.15);
    color: #fff;
}

.sidebar .nav-link.active {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.35) 0%, rgba(139, 92, 246, 0.2) 100%);
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(129, 140, 248, 0.45);
}

.sidebar .nav-link.active i {
    color: #c7d2fe;
}

.sidebar .nav-link i {
    width: 1.15rem;
    opacity: .9;
}

.sidebar .session {
    padding: 1.15rem 1rem;
    text-align: center;
    border-top: 1px solid rgba(129, 140, 248, 0.2);
    font-size: .8rem;
    background: rgba(99, 102, 241, 0.08);
}

.sidebar .session-name {
    font-weight: 700;
    font-size: .875rem;
    color: #f1f5f9;
}

.sidebar .session .text-white-50 {
    color: rgba(203, 213, 225, 0.75) !important;
    font-size: .75rem;
    margin-top: .15rem;
}

/* —— Main —— */
.main-content {
    margin-left: var(--sidebar-width);
    padding: 1.75rem 2rem;
    max-width: 1140px;
}

.topbar {
    position: relative;
    background: linear-gradient(180deg, #ffffff 0%, #fafaff 100%);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 1.35rem 3.75rem;
    margin-bottom: 1.75rem;
    box-shadow: var(--shadow-sm);
    text-align: center;
}

.topbar-actions {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: .5rem;
}

.topbar-logout {
    position: static;
    transform: none;
    border-color: var(--border);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    padding: .35rem .65rem;
    transition: all var(--transition);
}

/* —— Notifications —— */
.notif-bell-btn {
    position: relative;
    border-color: var(--border);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    padding: .4rem .7rem;
    transition: all var(--transition);
}

.notif-bell-btn:hover,
.notif-bell-btn.show {
    background: var(--accent-soft);
    border-color: rgba(99, 102, 241, 0.4);
    color: var(--accent);
}

.notif-bell-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    font-size: .62rem;
    font-weight: 800;
    line-height: 18px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.45);
}

.notif-dropdown-menu {
    width: min(400px, 94vw);
    border: 1px solid var(--border-light);
    border-radius: calc(var(--radius) + 2px);
    box-shadow: var(--shadow-lg);
    padding: 0;
    overflow: hidden;
}

.notif-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.1rem;
    background: linear-gradient(180deg, #fcfdfe 0%, #f8fafc 100%);
    border-bottom: 1px solid var(--border-light);
}

.notif-dropdown-heading {
    font-size: .95rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text);
}

.notif-dropdown-sub {
    font-size: .75rem;
    color: var(--text-muted);
    margin-top: .1rem;
}

.notif-link-btn {
    border: 0;
    background: transparent;
    color: var(--accent);
    font-size: .75rem;
    font-weight: 700;
    padding: 0;
}

.notif-link-btn:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.notif-dropdown-list {
    max-height: 380px;
    overflow-y: auto;
}

.notif-dropdown-item {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: .9rem 1.1rem;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid var(--border-light);
    position: relative;
    transition: background var(--transition);
}

.notif-dropdown-item:hover {
    background: #f8fafc;
}

.notif-dropdown-item.is-unread {
    background: linear-gradient(90deg, #eef2ff 0%, #fff 100%);
}

.notif-dropdown-body {
    flex: 1;
    min-width: 0;
}

.notif-dropdown-title {
    display: block;
    font-size: .84rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: .15rem;
}

.notif-dropdown-msg {
    display: block;
    font-size: .78rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: .25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notif-dropdown-time {
    display: block;
    font-size: .7rem;
    color: var(--text-muted);
}

.notif-dropdown-arrow {
    color: var(--text-muted);
    font-size: .75rem;
    margin-top: .35rem;
    opacity: .5;
}

.notif-dropdown-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .5rem;
    padding: 2.5rem 1rem;
    color: var(--text-muted);
    font-size: .85rem;
}

.notif-dropdown-empty i {
    font-size: 1.75rem;
    opacity: .35;
}

.notif-dropdown-footer {
    padding: .75rem 1rem;
    background: #f8fafc;
    border-top: 1px solid var(--border-light);
}

.notif-footer-btn {
    display: block;
    text-align: center;
    padding: .55rem;
    border-radius: var(--radius-sm);
    background: var(--surface-card);
    border: 1px solid var(--border-light);
    color: var(--accent);
    font-size: .8rem;
    font-weight: 700;
    text-decoration: none;
    transition: all var(--transition);
}

.notif-footer-btn:hover {
    background: var(--accent-soft);
    border-color: rgba(99, 102, 241, 0.35);
    color: var(--accent-hover);
}

.notif-dot {
    position: absolute;
    left: .55rem;
    top: 50%;
    transform: translateY(-50%);
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.notif-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    flex-shrink: 0;
}

.notif-icon--sm {
    width: 2rem;
    height: 2rem;
    font-size: .9rem;
}

.notif-icon--md {
    width: 2.65rem;
    height: 2.65rem;
    font-size: 1.05rem;
}

.notif-accent-info {
    background: #cffafe;
    color: #0e7490;
}

.notif-accent-warning {
    background: #fef3c7;
    color: #b45309;
}

.notif-accent-primary {
    background: var(--accent-soft);
    color: var(--accent-hover);
}

.notif-accent-success {
    background: #d1fae5;
    color: #047857;
}

.notif-accent-neutral {
    background: #f1f5f9;
    color: var(--text-secondary);
}

.notif-stats .notif-stat-card {
    text-align: center;
    padding: 1.15rem .75rem;
    border-radius: var(--radius);
    background: var(--surface-card);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
}

.notif-stat-card.is-unread {
    border-color: rgba(99, 102, 241, 0.3);
    background: linear-gradient(180deg, #fff 0%, #eef2ff 100%);
}

.notif-stat-icon {
    font-size: 1.1rem;
    color: var(--accent);
    margin-bottom: .35rem;
    opacity: .85;
}

.notif-stat-value {
    font-size: 1.65rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: var(--text);
    line-height: 1;
}

.notif-stat-label {
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
    margin-top: .45rem;
}

.notif-prefs-hint {
    text-align: center;
    font-size: .82rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.notif-prefs-list {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.notif-pref-item {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .65rem .75rem;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    margin: 0;
}

.notif-pref-item:hover {
    border-color: rgba(99, 102, 241, 0.35);
    background: #fafaff;
}

.notif-pref-check {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.notif-pref-label {
    flex: 1;
    font-size: .84rem;
    font-weight: 600;
    color: var(--text);
}

.notif-pref-toggle {
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 50%;
    border: 2px solid var(--border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
    color: transparent;
    transition: all var(--transition);
}

.notif-pref-item.is-active,
.notif-pref-item:has(.notif-pref-check:checked) {
    border-color: rgba(99, 102, 241, 0.45);
    background: var(--accent-soft);
}

.notif-pref-item.is-active .notif-pref-toggle,
.notif-pref-item:has(.notif-pref-check:checked) .notif-pref-toggle {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.notif-toolbar .card-body {
    padding: 1rem 1.15rem;
}

.notif-filter-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .65rem;
}

.notif-filter-label {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
    min-width: 3.5rem;
}

.notif-pills {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
}

.notif-pill {
    display: inline-block;
    padding: .35rem .75rem;
    border-radius: 999px;
    border: 1px solid var(--border-light);
    background: #fff;
    color: var(--text-secondary);
    font-size: .76rem;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--transition);
}

.notif-pill:hover {
    border-color: rgba(99, 102, 241, 0.4);
    color: var(--accent);
    background: var(--accent-soft);
}

.notif-pill.is-active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.notif-action-chip {
    border: 1px solid var(--border-light);
    background: #fff;
    border-radius: 999px;
    padding: .25rem .65rem;
    font-size: .72rem;
    font-weight: 700;
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    gap: .25rem;
}

.notif-action-chip.is-muted {
    color: var(--text-muted);
}

.notif-feed {
    padding: .5rem 0;
}

.notif-date-group + .notif-date-group {
    border-top: 1px solid var(--border-light);
    margin-top: .25rem;
    padding-top: .25rem;
}

.notif-date-label {
    padding: .65rem 1.25rem .35rem;
    font-size: .68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-muted);
}

.notif-card {
    display: flex;
    align-items: flex-start;
    gap: .85rem;
    padding: 1rem 1.25rem 1rem 1.5rem;
    position: relative;
    border-bottom: 1px solid var(--border-light);
    transition: background var(--transition);
}

.notif-card:last-child {
    border-bottom: 0;
}

.notif-card:hover {
    background: #fafbfc;
}

.notif-card.is-unread {
    background: linear-gradient(90deg, rgba(238, 242, 255, 0.95) 0%, #fff 55%);
}

.notif-card-body {
    flex: 1;
    min-width: 0;
}

.notif-card-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    margin-bottom: .25rem;
}

.notif-card-title {
    margin: 0;
    font-size: .9rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text);
}

.notif-type-tag {
    display: inline-block;
    padding: .2rem .55rem;
    border-radius: 999px;
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .02em;
}

.notif-type-tag.notif-accent-info { background: #e0f2fe; color: #0369a1; }
.notif-type-tag.notif-accent-warning { background: #fef3c7; color: #b45309; }
.notif-type-tag.notif-accent-primary { background: var(--accent-soft); color: var(--accent); }
.notif-type-tag.notif-accent-success { background: #d1fae5; color: #047857; }
.notif-type-tag.notif-accent-neutral { background: #f1f5f9; color: var(--text-secondary); }

.notif-card-msg {
    margin: 0 0 .35rem;
    font-size: .82rem;
    color: var(--text-secondary);
    line-height: 1.45;
}

.notif-card-time {
    font-size: .72rem;
    color: var(--text-muted);
    font-weight: 500;
}

.notif-card-actions {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    flex-shrink: 0;
}

.notif-icon-btn {
    width: 2rem;
    height: 2rem;
    border-radius: 10px;
    border: 1px solid var(--border-light);
    background: #fff;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: .85rem;
    text-decoration: none;
    transition: all var(--transition);
}

.notif-icon-btn:hover {
    border-color: rgba(99, 102, 241, 0.4);
    color: var(--accent);
    background: var(--accent-soft);
}

.notif-icon-btn.is-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.notif-icon-btn.is-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    color: #fff;
}

.notif-icon-btn.is-danger:hover {
    border-color: rgba(220, 38, 38, 0.35);
    color: #dc2626;
    background: #fef2f2;
}

.page-title {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.035em;
    margin: 0;
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.topbar-logout:hover {
    background: var(--surface);
    border-color: #cbd5e1;
    color: var(--text);
}

/* —— Cards —— */
.card-panel {
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    background: var(--surface-card);
    overflow: hidden;
}

.card-panel > .card-header {
    background: linear-gradient(180deg, #fafaff 0%, #f5f3ff 100%);
    border-bottom: 1px solid var(--border-light);
    text-align: center;
    font-weight: 700;
    font-size: .875rem;
    letter-spacing: -0.02em;
    padding: 1rem 1.25rem;
    color: var(--brand-800);
    position: relative;
}

.card-panel > .card-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-brand);
    opacity: .85;
}

.card-header-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: .65rem;
}

.card-header-title {
    font-weight: 700;
}

.card-header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    justify-content: center;
}

@media (min-width: 992px) {
    .card-header-toolbar {
        position: relative;
        min-height: 3rem;
    }

    .card-header-toolbar .card-header-actions {
        position: absolute;
        right: 1rem;
        top: 50%;
        transform: translateY(-50%);
    }
}

.stat-card {
    text-align: center;
    padding: 1.35rem 1rem;
    border-top: 3px solid var(--accent);
    transition: transform var(--transition), box-shadow var(--transition);
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

.row > [class*="col"]:nth-child(1) .stat-card {
    border-top-color: #6366f1;
    background: linear-gradient(180deg, #fff 0%, #eef2ff 100%);
}
.row > [class*="col"]:nth-child(2) .stat-card {
    border-top-color: #f59e0b;
    background: linear-gradient(180deg, #fff 0%, #fffbeb 100%);
}
.row > [class*="col"]:nth-child(3) .stat-card {
    border-top-color: #06b6d4;
    background: linear-gradient(180deg, #fff 0%, #ecfeff 100%);
}
.row > [class*="col"]:nth-child(4) .stat-card {
    border-top-color: #10b981;
    background: linear-gradient(180deg, #fff 0%, #ecfdf5 100%);
}

.row > [class*="col"]:nth-child(1) .stat-card .stat-value { color: #4f46e5; }
.row > [class*="col"]:nth-child(2) .stat-card .stat-value { color: #d97706; }
.row > [class*="col"]:nth-child(3) .stat-card .stat-value { color: #0891b2; }
.row > [class*="col"]:nth-child(4) .stat-card .stat-value { color: #059669; }

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.stat-card .stat-label {
    color: var(--text-muted);
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: .5rem;
}

.stat-card .stat-value {
    font-size: 1.85rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1;
    color: var(--text);
}

/* —— Tables —— */
.table-responsive {
    -webkit-overflow-scrolling: touch;
    overflow-x: auto;
}

.table {
    --bs-table-hover-bg: #f8fafc;
    margin-bottom: 0;
}

.table thead th {
    text-align: center;
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #6366f1;
    background: linear-gradient(180deg, #fafaff 0%, #f5f3ff 100%);
    border-bottom: 1px solid var(--border-light);
    padding: .85rem .75rem;
}

.table tbody td {
    text-align: center;
    vertical-align: middle;
    padding: .9rem .75rem;
    font-size: .875rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-light);
}

.table tbody tr:last-child td {
    border-bottom: 0;
}

.table tbody td strong,
.table tbody td:first-child {
    color: var(--text);
    font-weight: 600;
}

/* —— Buttons —— */
.btn-brand {
    background: var(--gradient-brand);
    border: 0;
    font-weight: 700;
    letter-spacing: -0.01em;
    border-radius: var(--radius-sm);
    padding: .6rem 1.1rem;
    box-shadow: 0 4px 14px var(--accent-glow);
    transition: transform var(--transition), box-shadow var(--transition);
    color: #fff;
}

.btn-brand:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #0891b2 100%);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
    transform: translateY(-1px);
    color: #fff;
}

.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
}

.btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

.btn-outline-primary {
    color: var(--accent);
    border-color: rgba(99, 102, 241, 0.45);
    font-weight: 600;
    border-radius: var(--radius-sm);
}

.btn-outline-primary:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent-hover);
}

.btn-light {
    background: #f1f5f9;
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    font-weight: 600;
    border-radius: var(--radius-sm);
}

.btn-light:hover {
    background: #e2e8f0;
    color: var(--text);
}

/* —— Badges —— */
.badge {
    font-weight: 600;
    font-size: .72rem;
    letter-spacing: .02em;
    padding: .4em .65em;
    border-radius: 6px;
}

.text-bg-secondary { background: #64748b !important; }
.text-bg-info { background: #06b6d4 !important; }
.text-bg-warning { background: #f59e0b !important; color: #fff !important; }
.text-bg-primary { background: var(--accent) !important; }
.text-bg-success { background: #10b981 !important; }
.text-bg-dark { background: #1e1645 !important; }

/* —— Forms —— */
.form-control,
.form-select {
    border-color: var(--border);
    border-radius: var(--radius-sm);
    padding: .6rem .85rem;
    font-size: .875rem;
    color: var(--text);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-label {
    font-weight: 600;
    font-size: .8rem;
    color: var(--text-secondary);
    margin-bottom: .4rem;
}

/* —— Alerts —— */
.alert {
    border-radius: var(--radius-sm);
    border: 0;
    font-size: .875rem;
    font-weight: 500;
}

.alert-danger {
    background: #fef2f2;
    color: #991b1b;
}

.alert-success {
    background: #ecfdf5;
    color: #065f46;
}

.alert-warning {
    background: #fffbeb;
    color: #92400e;
}

/* —— Login —— */
.login-page {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(1.5rem, env(safe-area-inset-top))
             max(1.5rem, env(safe-area-inset-right))
             max(1.5rem, env(safe-area-inset-bottom))
             max(1.5rem, env(safe-area-inset-left));
    background:
        radial-gradient(ellipse 80% 60% at 20% 10%, rgba(99, 102, 241, 0.25), transparent),
        radial-gradient(ellipse 70% 55% at 85% 20%, rgba(6, 182, 212, 0.2), transparent),
        radial-gradient(ellipse 60% 50% at 50% 100%, rgba(168, 85, 247, 0.18), transparent),
        linear-gradient(165deg, #ede9fe 0%, #f0fdfa 45%, #fff7ed 100%);
}

.login-card {
    width: 100%;
    max-width: 400px;
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
}

.login-title {
    text-align: center;
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    margin: 0 0 2rem;
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.login-title::after {
    content: '';
    display: block;
    width: 2.75rem;
    height: 3px;
    background: var(--gradient-brand);
    border-radius: 2px;
    margin: .75rem auto 0;
}

.request-new-wrap {
    max-width: 640px;
    margin: 0 auto;
}

.list-group-item {
    border-color: var(--border-light);
}

.filter-bar {
    background: var(--surface-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.filter-bar .btn-sm {
    font-weight: 600;
    border-radius: 8px;
    font-size: .78rem;
}

/* —— Layout utilities —— */
.page-grid {
    --bs-gutter-x: 1.5rem;
    --bs-gutter-y: 1.5rem;
}

.page-narrow {
    max-width: 640px;
    margin: 0 auto;
}

.card-body-form {
    padding: 1.5rem;
}

.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-muted);
}

.empty-state-icon {
    display: block;
    font-size: 2rem;
    margin-bottom: .75rem;
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    opacity: .75;
}

.empty-state p {
    margin: 0;
    font-size: .875rem;
    font-weight: 500;
}

.table td .empty-state {
    padding: 2rem 1rem;
}

.detail-list dt {
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-muted);
}

.detail-list dd {
    font-size: .875rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.detail-list dd:last-child {
    margin-bottom: 0;
}

.detail-pre {
    background: #f8fafc;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: .75rem 1rem;
    font-size: .8125rem;
    color: var(--text-secondary);
    margin: 0;
    white-space: pre-wrap;
}

.list-panel .list-group-item {
    padding: 1rem 1.25rem;
    border-color: var(--border-light);
}

.list-panel .list-group-item h6 {
    font-weight: 700;
    font-size: .9rem;
    color: var(--text);
    margin-bottom: .35rem;
}

.inline-form-panel {
    background: linear-gradient(180deg, #fafaff 0%, #f8fafc 100%);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: var(--radius-sm);
    padding: 1rem;
    margin-top: .75rem;
}

.action-card > .card-body {
    padding: 1.25rem;
}

.highlight-card {
    border-color: rgba(16, 185, 129, 0.4);
    box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.1);
}

.highlight-card > .card-header {
    background: linear-gradient(180deg, #ecfdf5 0%, #d1fae5 100%);
    color: #047857;
    border-bottom-color: rgba(16, 185, 129, 0.15);
}

.tag-badge {
    background: var(--accent-soft) !important;
    color: var(--accent-hover) !important;
    border: 1px solid rgba(99, 102, 241, 0.2) !important;
    font-weight: 600;
}

/* —— Product form —— */
.product-spec-checks {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: .35rem .75rem;
    padding: .85rem 1rem;
    background: linear-gradient(180deg, #fafaff 0%, #f5f3ff 100%);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: var(--radius-sm);
}

.product-spec-checks .form-check {
    margin-bottom: 0;
}

.btn-table-action {
    font-weight: 600;
    font-size: .78rem;
    border-radius: 8px;
    padding: .35rem .75rem;
}

.timeline-item .timeline-title {
    font-weight: 700;
    font-size: .85rem;
    color: var(--text);
}

.timeline-item .timeline-meta {
    font-size: .78rem;
    color: var(--text-muted);
}

.btn-outline-secondary {
    color: var(--text-secondary);
    border-color: var(--border);
    font-weight: 600;
    border-radius: var(--radius-sm);
}

.btn-outline-secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: var(--text);
}

.btn-success {
    background: #059669;
    border-color: #059669;
    font-weight: 600;
    border-radius: var(--radius-sm);
}

.btn-success:hover {
    background: #047857;
    border-color: #047857;
}

.form-check-input:checked {
    background-color: var(--accent);
    border-color: var(--accent);
}

.card-panel > .card-body.text-muted,
.card-panel > .card-body.text-center.text-muted {
    padding: 2rem 1.5rem;
    font-size: .875rem;
}

@media (max-width: 991.98px) {
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(7, 11, 18, 0.55);
        z-index: 1040;
        backdrop-filter: blur(2px);
    }

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

    body.sidebar-open {
        overflow: hidden;
    }

    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: min(288px, 88vw);
        min-height: 100vh;
        min-height: 100dvh;
        transform: translateX(-105%);
        transition: transform 0.28s ease;
        z-index: 1050;
        box-shadow: var(--shadow-lg);
    }

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

    .sidebar .brand {
        padding-top: max(1.5rem, env(safe-area-inset-top));
    }

    .sidebar .session {
        padding-bottom: max(1.15rem, env(safe-area-inset-bottom));
    }

    .main-content {
        margin-left: 0;
        max-width: none;
        padding: 1rem;
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
    }

    .topbar {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: .85rem 3.4rem;
        margin-bottom: 1.25rem;
        position: sticky;
        top: max(0px, env(safe-area-inset-top));
        z-index: 1020;
    }

    .sidebar-toggle {
        position: absolute;
        left: .65rem;
        top: 50%;
        transform: translateY(-50%);
        min-width: 2.5rem;
        min-height: 2.5rem;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0;
    }

    .topbar-actions {
        right: .65rem;
    }

    .page-title {
        font-size: 1.05rem;
        line-height: 1.3;
        padding: 0 .25rem;
    }

    .notif-dropdown-menu {
        width: min(400px, calc(100vw - 1.5rem));
        max-width: calc(100vw - 1.5rem);
    }

    .notif-card {
        flex-wrap: wrap;
        padding-left: 1.15rem;
    }

    .notif-card-actions {
        flex-direction: row;
        width: 100%;
        padding-left: 3.35rem;
    }

    .notif-filter-label {
        width: 100%;
    }

    .notif-filter-group {
        flex-direction: column;
        align-items: stretch;
    }

    .notif-pills {
        width: 100%;
    }

    .filter-bar .card-body {
        padding: .85rem !important;
    }

    .filter-bar .btn-sm {
        flex: 1 1 auto;
        min-width: fit-content;
    }

    .row.page-grid > [class*="col-lg-4"],
    .row.page-grid > [class*="col-lg-8"],
    .row.page-grid > [class*="col-lg-7"],
    .row.page-grid > [class*="col-lg-5"] {
        margin-bottom: 0;
    }

    .stat-card,
    .notif-stat-card {
        padding: 1rem .65rem;
    }

    .stat-card .stat-value,
    .notif-stat-value {
        font-size: 1.45rem;
    }

    .table thead th,
    .table tbody td {
        padding: .75rem .55rem;
        font-size: .8125rem;
    }

    .card-body-form {
        padding: 1.15rem;
    }

    .detail-list dt,
    .detail-list dd {
        text-align: left;
    }

    .detail-list dt {
        margin-top: .5rem;
    }

    .detail-list dt:first-child {
        margin-top: 0;
    }

    .request-new-wrap,
    .page-narrow {
        max-width: none;
    }
}

@media (max-width: 575.98px) {
    .main-content {
        padding: .75rem;
    }

    .topbar {
        padding: .75rem 3rem;
    }

    .page-title {
        font-size: .95rem;
    }

    .notif-stats .col-4 {
        padding-left: .35rem;
        padding-right: .35rem;
    }

    .notif-stat-value {
        font-size: 1.25rem;
    }

    .notif-stat-label,
    .stat-card .stat-label {
        font-size: .62rem;
    }

    .notif-card-top {
        flex-direction: column;
        align-items: flex-start;
    }

    .notif-dropdown-item {
        padding-left: 1.35rem;
    }

    .notif-dot {
        left: .45rem;
    }

    .login-card .card-body {
        padding: 1.5rem !important;
    }

    .card-header-toolbar .card-header-actions {
        width: 100%;
    }

    .card-header-actions form,
    .card-header-actions .btn {
        width: 100%;
    }

    .notif-action-chip {
        width: 100%;
        justify-content: center;
    }

    .inline-form-panel .btn,
    .inline-form-panel .form-control,
    .inline-form-panel .form-select {
        width: 100%;
    }

    .input-group.input-group-sm {
        flex-direction: column;
    }

    .input-group.input-group-sm .btn {
        width: 100%;
        margin-top: .35rem;
        border-radius: var(--radius-sm) !important;
    }

    .list-panel .list-group-item > .d-flex.justify-content-between {
        flex-direction: column;
        align-items: flex-start !important;
    }

    .list-panel .list-group-item .text-end {
        text-align: left !important;
        width: 100%;
        margin-top: .5rem;
    }

    .form-control,
    .form-select,
    .btn {
        min-height: 2.75rem;
    }

    .btn-sm {
        min-height: 2.25rem;
    }
}
