/* App theme - light / dark (data-theme) - delivery-ready */
:root {
    --sidebar-width: 280px;
    --sidebar-collapsed: 78px;
    --primary: #4f46e5;
    --primary-dark: #3730a3;
    --sidebar-bg: #0f172a;
    --sidebar-hover: #1e293b;
    --sidebar-active: #4f46e5;
    --chrome-bg: #0f172a;
    --chrome-text: #e2e8f0;
    --chrome-muted: #94a3b8;
    --accent-red: #c45c5c;
    --body-bg: #f1f5f9;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --text: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --input-bg: #ffffff;
    --table-stripe: #f8fafc;
    --shadow: 0 8px 24px rgba(15, 23, 42, .06);
    --card-radius: 14px;
    --success: #15803d;
    --success-bg: #ecfdf5;
    --success-border: #a7f3d0;
    --success-text: #065f46;
    --danger: #b91c1c;
    --danger-bg: #fef2f2;
    --danger-border: #fecaca;
    --danger-text: #991b1b;
    --warning: #b45309;
    --warning-bg: #fffbeb;
    --warning-border: #fde68a;
    --warning-text: #92400e;
    --info: #0369a1;
    --info-bg: #f0f9ff;
    --info-border: #bae6fd;
    --info-text: #075985;
    --logo-bg: #ffffff;
}

[data-theme="dark"] {
    --body-bg: #1e2430;
    --surface: #2a3140;
    --surface-2: #232a38;
    --text: #eef1f6;
    --text-muted: #a8b0c0;
    --border: #3d4658;
    --input-bg: #232a38;
    --table-stripe: #262d3c;
    --shadow: 0 10px 28px rgba(0, 0, 0, .28);
    --sidebar-bg: #171c26;
    --sidebar-hover: #2a3140;
    --sidebar-active: #6366f1;
    --chrome-bg: #171c26;
    --chrome-text: #e2e8f0;
    --chrome-muted: #a8b0c0;
    --accent-red: #e07a7a;
    --success: #3dd68c;
    --success-bg: #1a3d2e;
    --success-border: #3f8f66;
    --success-text: #9af0c8;
    --danger: #f07178;
    --danger-bg: #3d2428;
    --danger-border: #6b3a42;
    --danger-text: #f5c2c7;
    --warning: #f0c674;
    --warning-bg: #3d3420;
    --warning-border: #6b5a30;
    --warning-text: #ffe8a3;
    --info: #74c0fc;
    --info-bg: #1e3040;
    --info-border: #355a72;
    --info-text: #b6e0fe;
    --logo-bg: #ffffff;
    color-scheme: dark;
}

html, body {
    background: var(--body-bg);
    color: var(--text);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* -- Layout -- */
.topbar {
    background: var(--chrome-bg);
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    height: 64px;
    z-index: 1030;
    color: var(--chrome-text);
}
.topbar .text-dark,
.topbar a.text-dark { color: #f8fafc !important; }
.topbar .text-muted { color: var(--chrome-muted) !important; }
.topbar .btn-outline-secondary,
.topbar .btn-outline-primary {
    color: var(--chrome-text);
    border-color: rgba(255, 255, 255, .28);
    background: transparent;
}
.topbar .btn-outline-secondary:hover,
.topbar .btn-outline-primary:hover {
    color: #fff;
    background: rgba(255, 255, 255, .1);
    border-color: rgba(255, 255, 255, .4);
}
.topbar .btn-light {
    background: rgba(255, 255, 255, .12);
    border-color: transparent;
    color: #fff;
}
.topbar .btn-light:hover {
    background: rgba(255, 255, 255, .2);
    color: #fff;
}
.topbar .app-logo {
    border-color: rgba(255, 255, 255, .18);
}

.app-logo {
    width: 38px;
    height: 38px;
    object-fit: cover;
    object-position: center;
    background: var(--logo-bg);
    border: 1px solid var(--border);
    border-radius: .5rem;
}
.app-logo-sm {
    width: 32px;
    height: 32px;
    object-fit: cover;
    object-position: center;
    background: var(--logo-bg);
    border-radius: .4rem;
}

.app-wrapper { min-height: calc(100vh - 64px); }

.sidebar {
    width: var(--sidebar-width);
    background: var(--chrome-bg);
    color: #cbd5e1;
    transition: width .25s ease;
    flex-shrink: 0;
    position: sticky;
    top: 64px;
    height: calc(100vh - 64px);
    overflow-y: auto;
    overflow-x: hidden;
}
.sidebar.collapsed { width: var(--sidebar-collapsed); }
.sidebar.collapsed .nav-text,
.sidebar.collapsed .toggle-icon,
.sidebar.collapsed .sidebar-brand-text { display: none; }
.sidebar.collapsed .nav-submenu { display: none !important; }
.sidebar-brand {
    padding: 1rem 1.1rem;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    font-weight: 700;
    color: #fff;
}
.sidebar-divider {
    height: 1px;
    background: rgba(255, 255, 255, .08);
    margin: .35rem .75rem;
}
.nav-item, .nav-group-toggle, .nav-sub, .nav-logout {
    color: #cbd5e1;
    text-decoration: none;
    border: 0;
    background: transparent;
    width: 100%;
    text-align: left;
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .65rem 1rem;
    border-radius: 10px;
    margin: .15rem .5rem;
    transition: all .2s;
}
.nav-item:hover, .nav-group-toggle:hover, .nav-sub:hover, .nav-logout:hover {
    background: var(--sidebar-hover);
    color: #fff;
}
.nav-item.active, .nav-group-toggle.active, .nav-sub.active {
    background: var(--sidebar-active);
    color: #fff;
    box-shadow: 0 8px 20px rgba(79, 70, 229, .25);
}
.nav-submenu { max-height: 0; overflow: hidden; transition: max-height .3s ease; }
.nav-group.open .nav-submenu { max-height: 500px; }
.nav-group.open .toggle-icon { transform: rotate(180deg); }
.toggle-icon { transition: transform .25s; font-size: .75rem; }
.nav-sub { padding-left: 2.5rem; font-size: .92rem; }
.nav-logout-form { margin: 0; }
.nav-logout-form .nav-logout {
    cursor: pointer;
    width: calc(100% - 1rem);
    border: 0;
    font: inherit;
}

/* -- Bulk selection toolbars -- */
.bulk-toolbar {
    position: sticky;
    top: 72px;
    z-index: 20;
    border: 1px solid color-mix(in srgb, var(--primary) 28%, var(--border));
    box-shadow: 0 10px 28px rgba(79, 70, 229, .12);
}
[data-bulk-root] tbody tr:has([data-bulk-row]:checked) {
    background: color-mix(in srgb, var(--primary) 8%, var(--surface));
}

.sidebar.sidebar-simple { --sidebar-active: #2563eb; }
.sidebar.sidebar-simple.collapsed { width: var(--sidebar-width); }
.sidebar.sidebar-simple.collapsed .nav-text,
.sidebar.sidebar-simple.collapsed .sidebar-brand-text { display: inline; }
.sidebar.sidebar-simple .nav-item,
.sidebar.sidebar-simple .nav-logout {
    margin: .1rem .4rem;
    border-radius: 8px;
    padding: .7rem 1rem;
    color: #94a3b8;
    box-shadow: none;
}
.sidebar.sidebar-simple .nav-item:hover,
.sidebar.sidebar-simple .nav-logout:hover {
    background: rgba(255, 255, 255, .06);
    color: #e2e8f0;
}
.sidebar.sidebar-simple .nav-item.active {
    background: #2563eb;
    color: #fff !important;
    box-shadow: none;
    font-weight: 600;
}
.sidebar.sidebar-simple .nav-item.active i,
.sidebar.sidebar-simple .nav-item.active .nav-text {
    color: #fff !important;
    opacity: 1;
}
.sidebar.sidebar-simple .nav-item:not(.active) i,
.sidebar.sidebar-simple .nav-logout i { opacity: .85; }

.main-content {
    flex: 1;
    min-width: 0;
    padding: 1.25rem 1.5rem;
    color: var(--text);
    font-size: 0.9375rem;
    line-height: 1.5;
}

/* Evite le double padding (main-content + container-fluid) */
.main-content > .container-fluid {
    padding-left: 0;
    padding-right: 0;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(30, 35, 45, .45);
    z-index: 1025;
}
@media (max-width: 991px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 64px;
        z-index: 1030;
        transform: translateX(-100%);
    }
    .sidebar.mobile-open { transform: translateX(0); }
    .sidebar-overlay.show { display: block; }
}

/* -- Unified cards / page chrome -- */
.card,
.stat-card {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border);
    border-radius: var(--card-radius);
    box-shadow: var(--shadow);
}
.card.border-0 { border: 0 !important; }
.stat-card { border: 0; }
.card-header,
.card-footer {
    background: var(--surface-2);
    color: var(--text);
    border-color: var(--border);
}
.page-title {
    color: var(--text);
    font-weight: 700;
}
.page-subtitle { color: var(--text-muted); }

/* -- Typo unifiee (titres de page) -- */
.main-content h1.h3,
.main-content h1.fw-bold,
.main-content h2.fw-bold {
    font-size: 1.35rem !important;
    font-weight: 700 !important;
    line-height: 1.3;
    color: var(--text);
    letter-spacing: -0.01em;
}
.main-content h1.h3 i,
.main-content h1.fw-bold i,
.main-content h2.fw-bold i {
    font-size: 1.05em;
    vertical-align: -0.05em;
}
.main-content h1.h3 + p,
.main-content h1.fw-bold + p,
.main-content h2.fw-bold + p,
.main-content h1 + .text-muted,
.main-content h2 + .text-muted {
    font-size: 0.875rem;
    margin-bottom: 0;
}

/* Titres de section dans les cartes */
.main-content .card .card-title,
.main-content .card-body > h5.mb-3,
.main-content .card-body > h5.mb-0:not(.fw-bold) {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
}

/* -- KPI unifies (libelle + valeur) -- */
.kpi-label,
.main-content .card :is(small.text-muted, .text-muted.small):has(+ :is(h3, h4, h5)) {
    display: block;
    font-size: 0.75rem !important;
    font-weight: 500;
    line-height: 1.25;
    margin-bottom: 0.2rem;
    color: var(--text-muted) !important;
}

.kpi-value,
.main-content .card :is(small.text-muted, .text-muted.small) + :is(h3, h4, h5) {
    font-size: 1.15rem !important;
    font-weight: 700 !important;
    line-height: 1.25;
    margin-bottom: 0 !important;
    letter-spacing: -0.015em;
    word-break: break-word;
}

.main-content .card .card-body:has(> :is(small.text-muted, .text-muted.small) + :is(h3, h4, h5)),
.main-content .card .card-body:has(> div > :is(small.text-muted, .text-muted.small) + :is(h3, h4, h5)),
.main-content .card .card-body.py-2 {
    padding-top: 0.85rem;
    padding-bottom: 0.85rem;
}

.main-content .table {
    font-size: 0.9rem;
}
.main-content .form-label {
    font-size: 0.875rem;
    font-weight: 500;
}
.main-content .form-control,
.main-content .form-select,
.main-content .btn {
    font-size: 0.9rem;
}

/* -- Forms -- */
.form-control,
.form-select,
.input-group-text {
    background-color: var(--input-bg);
    color: var(--text);
    border-color: var(--border);
}
.form-control:focus,
.form-select:focus {
    background-color: var(--input-bg);
    color: var(--text);
    border-color: var(--primary);
    box-shadow: 0 0 0 .2rem rgba(79, 70, 229, .2);
}
.form-control::placeholder { color: var(--text-muted); opacity: .85; }
.form-label { color: var(--text); }
.form-text,
.text-muted,
.text-secondary { color: var(--text-muted) !important; }

/* -- Tables -- */
.table {
    --bs-table-bg: var(--surface);
    --bs-table-color: var(--text);
    --bs-table-border-color: var(--border);
    --bs-table-striped-bg: var(--table-stripe);
    --bs-table-striped-color: var(--text);
    --bs-table-hover-bg: var(--surface-2);
    --bs-table-hover-color: var(--text);
    color: var(--text);
}
.table > thead,
.table-light,
thead.table-light {
    --bs-table-bg: var(--surface-2);
    --bs-table-color: var(--text);
    color: var(--text);
}

/* -- Pagination -- */
.pagination { gap: .15rem; margin-bottom: 0; }
.pagination .page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    padding: .25rem .5rem;
    font-size: .875rem;
    line-height: 1;
    background: var(--surface);
    border-color: var(--border);
    color: var(--text);
}
.pagination .page-item.active .page-link {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.pagination .page-item.disabled .page-link {
    background: var(--surface-2);
    color: var(--text-muted);
}
.pagination .page-link svg,
.pagination .page-link .bi {
    width: .85rem;
    height: .85rem;
    font-size: .85rem;
}

/* -- Badges: keep readable on both themes -- */
.badge.bg-warning,
.badge.bg-warning.text-dark {
    background-color: #f59e0b !important;
    color: #1f2937 !important;
}
.badge.bg-light,
.badge.bg-light.text-dark {
    background-color: var(--surface-2) !important;
    color: var(--text) !important;
    border: 1px solid var(--border);
}

/* Vert / succes lisibles en mode sombre */
[data-theme="dark"] .text-success,
[data-theme="dark"] .text-success-emphasis {
    color: var(--success) !important;
}
[data-theme="dark"] .bg-success,
[data-theme="dark"] .badge.bg-success,
[data-theme="dark"] .text-bg-success {
    background-color: #1f6b45 !important;
    color: #e8fff3 !important;
}
[data-theme="dark"] .btn-success {
    background-color: #20965a !important;
    border-color: #20965a !important;
    color: #fff !important;
}
[data-theme="dark"] .btn-success:hover,
[data-theme="dark"] .btn-success:focus {
    background-color: #27a968 !important;
    border-color: #27a968 !important;
    color: #fff !important;
}
[data-theme="dark"] .btn-outline-success {
    color: var(--success) !important;
    border-color: var(--success) !important;
}
[data-theme="dark"] .btn-outline-success:hover,
[data-theme="dark"] .btn-outline-success:focus {
    background-color: rgba(61, 214, 140, .18) !important;
    color: #c8ffe0 !important;
    border-color: var(--success) !important;
}
[data-theme="dark"] .link-success {
    color: var(--success) !important;
}
[data-theme="dark"] i.text-success,
[data-theme="dark"] .bi.text-success {
    color: var(--success) !important;
}

/* -- Classic Bootstrap alerts -- */
.alert-success {
    background: var(--success-bg);
    color: var(--success-text);
    border-color: var(--success-border);
}
.alert-danger {
    background: var(--danger-bg);
    color: var(--danger-text);
    border-color: var(--danger-border);
}
.alert-warning {
    background: var(--warning-bg);
    color: var(--warning-text);
    border-color: var(--warning-border);
}
.alert-info {
    background: var(--info-bg);
    color: var(--info-text);
    border-color: var(--info-border);
}
.alert-light {
    background: var(--surface-2);
    color: var(--text);
    border-color: var(--border);
}

/* -- Flash toasts -- */
.app-toast-stack {
    position: fixed;
    top: 76px;
    right: 1rem;
    z-index: 1080;
    display: flex;
    flex-direction: column;
    gap: .65rem;
    width: min(400px, calc(100vw - 2rem));
    pointer-events: none;
}
.app-toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: .85rem 1rem;
    border-radius: 12px;
    border: 1px solid transparent;
    box-shadow: 0 12px 32px rgba(15, 23, 42, .14);
    background: var(--surface);
    color: var(--text);
    animation: app-toast-in .28s ease;
}
.app-toast.is-hiding {
    animation: app-toast-out .22s ease forwards;
}
.app-toast-icon {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}
.app-toast-body {
    flex: 1;
    min-width: 0;
    font-size: .95rem;
    line-height: 1.4;
    font-weight: 500;
    padding-top: .15rem;
}
.app-toast .btn-close {
    flex-shrink: 0;
    margin-top: .15rem;
    opacity: .55;
}
.app-toast-success {
    background: var(--success-bg);
    border-color: var(--success-border);
    color: var(--success-text);
}
.app-toast-success .app-toast-icon {
    background: rgba(21, 128, 61, .15);
    color: var(--success);
}
.app-toast-danger {
    background: var(--danger-bg);
    border-color: var(--danger-border);
    color: var(--danger-text);
}
.app-toast-danger .app-toast-icon {
    background: rgba(185, 28, 28, .15);
    color: var(--danger);
}
.app-toast-warning {
    background: var(--warning-bg);
    border-color: var(--warning-border);
    color: var(--warning-text);
}
.app-toast-info {
    background: var(--info-bg);
    border-color: var(--info-border);
    color: var(--info-text);
}
[data-theme="dark"] .app-toast-success .app-toast-icon { color: var(--success-text); background: rgba(183, 240, 208, .12); }
[data-theme="dark"] .app-toast-danger .app-toast-icon { color: var(--danger-text); background: rgba(245, 194, 199, .12); }
[data-theme="dark"] .app-toast .btn-close { filter: invert(1) grayscale(1); }

@keyframes app-toast-in {
    from { opacity: 0; transform: translateY(-8px) scale(.98); }
    to { opacity: 1; transform: none; }
}
@keyframes app-toast-out {
    to { opacity: 0; transform: translateX(12px); }
}

/* -- Dark mode Bootstrap surfaces -- */
[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6,
[data-theme="dark"] .text-dark,
[data-theme="dark"] a.text-dark,
[data-theme="dark"] .fw-bold.text-dark { color: var(--text) !important; }
[data-theme="dark"] .text-body,
[data-theme="dark"] .text-body-secondary { color: var(--text) !important; }

[data-theme="dark"] .list-group-item,
[data-theme="dark"] .modal-content,
[data-theme="dark"] .dropdown-menu,
[data-theme="dark"] .offcanvas,
[data-theme="dark"] .accordion-item,
[data-theme="dark"] .popover {
    background-color: var(--surface);
    color: var(--text);
    border-color: var(--border);
}
[data-theme="dark"] .modal-header,
[data-theme="dark"] .modal-footer,
[data-theme="dark"] .accordion-button,
[data-theme="dark"] .list-group-item-action:hover,
[data-theme="dark"] .list-group-item-action:focus {
    background-color: var(--surface-2);
    color: var(--text);
    border-color: var(--border);
}
[data-theme="dark"] .accordion-button:not(.collapsed) {
    background-color: #343b4c;
    color: var(--text);
    box-shadow: none;
}
[data-theme="dark"] .accordion-button::after { filter: invert(1) brightness(1.4); }

[data-theme="dark"] .bg-white,
[data-theme="dark"] .bg-light,
[data-theme="dark"] .bg-body,
[data-theme="dark"] .bg-body-tertiary,
[data-theme="dark"] .bg-body-secondary {
    background-color: var(--surface) !important;
    color: var(--text) !important;
}
[data-theme="dark"] .border,
[data-theme="dark"] .border-top,
[data-theme="dark"] .border-bottom,
[data-theme="dark"] .border-start,
[data-theme="dark"] .border-end,
[data-theme="dark"] .border-secondary-subtle { border-color: var(--border) !important; }

[data-theme="dark"] .table > :not(caption) > * > * {
    background-color: var(--bs-table-bg);
    color: var(--text);
    border-bottom-color: var(--border);
}

[data-theme="dark"] .form-control:disabled,
[data-theme="dark"] .form-select:disabled {
    background-color: #1e2430;
    color: var(--text-muted);
}
[data-theme="dark"] .form-check-input {
    background-color: var(--input-bg);
    border-color: var(--border);
}
[data-theme="dark"] .form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

[data-theme="dark"] .btn-light,
[data-theme="dark"] .btn-outline-secondary {
    background-color: var(--surface-2);
    border-color: var(--border);
    color: var(--text);
}
[data-theme="dark"] .btn-light:hover,
[data-theme="dark"] .btn-outline-secondary:hover {
    background-color: #3a4254;
    border-color: #4d5668;
    color: #fff;
}
[data-theme="dark"] .btn-close { filter: invert(1) grayscale(1); opacity: .7; }
[data-theme="dark"] .dropdown-item { color: var(--text); }
[data-theme="dark"] .dropdown-item:hover,
[data-theme="dark"] .dropdown-item:focus {
    background-color: #3a4254;
    color: #fff;
}
[data-theme="dark"] .dropdown-divider { border-color: var(--border); }

[data-theme="dark"] .nav-tabs { border-color: var(--border); }
[data-theme="dark"] .nav-tabs .nav-link { color: var(--text-muted); }
[data-theme="dark"] .nav-tabs .nav-link.active {
    background-color: var(--surface);
    color: var(--text);
    border-color: var(--border) var(--border) var(--surface);
}

[data-theme="dark"] .progress { background-color: #1e2430; }
[data-theme="dark"] hr { border-color: var(--border); opacity: 1; }

[data-theme="dark"] a.text-decoration-none.text-dark,
[data-theme="dark"] a.text-dark { color: var(--text) !important; }
[data-theme="dark"] a.link-primary,
[data-theme="dark"] .text-primary { color: #a5b4fc !important; }

/* DataTables */
[data-theme="dark"] .dt-container,
[data-theme="dark"] .dataTables_wrapper { color: var(--text); }
[data-theme="dark"] .dt-search input,
[data-theme="dark"] .dt-length select,
[data-theme="dark"] div.dt-container .dt-search input,
[data-theme="dark"] div.dt-container .dt-length select {
    background-color: var(--input-bg);
    color: var(--text);
    border-color: var(--border);
}
[data-theme="dark"] .dt-buttons .btn {
    background-color: var(--surface-2);
    border-color: var(--border);
    color: var(--text);
}
[data-theme="dark"] table.dataTable thead th,
[data-theme="dark"] table.dataTable tbody td {
    border-color: var(--border) !important;
    color: var(--text);
}
[data-theme="dark"] table.dataTable.stripe > tbody > tr:nth-of-type(odd) > * {
    box-shadow: inset 0 0 0 9999px var(--table-stripe);
}

/* SweetAlert2 */
[data-theme="dark"] .swal2-popup {
    background: var(--surface) !important;
    color: var(--text) !important;
}
[data-theme="dark"] .swal2-title,
[data-theme="dark"] .swal2-html-container { color: var(--text) !important; }
[data-theme="dark"] .swal2-icon.swal2-warning { border-color: #f59e0b; color: #f59e0b; }

/* Empty states / muted icons */
.text-placeholder { color: var(--text-muted); opacity: .55; }

/* -- Notification bell -- */
.notif-bell-btn { min-width: 2.15rem; }
.notif-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 1.1rem;
    height: 1.1rem;
    padding: 0 .28rem;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: .65rem;
    font-weight: 700;
    line-height: 1.1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--surface);
}
.notif-panel {
    width: min(380px, calc(100vw - 1.5rem));
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    background: var(--surface);
    color: var(--text);
}
.notif-panel-header {
    padding: .85rem 1rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
}
.notif-panel-list {
    max-height: 360px;
    overflow-y: auto;
}
.notif-item {
    display: flex;
    align-items: stretch;
    gap: .35rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}
.notif-item.is-unread { background: color-mix(in srgb, var(--primary) 8%, var(--surface)); }
.notif-item-link {
    display: flex;
    gap: .7rem;
    flex: 1;
    min-width: 0;
    padding: .75rem .85rem;
    text-decoration: none;
    color: inherit;
}
.notif-item-link:hover { background: var(--surface-2); color: inherit; }
.notif-item-icon {
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-2);
    flex-shrink: 0;
}
.notif-item-content { display: flex; flex-direction: column; min-width: 0; gap: .1rem; }
.notif-item-title { font-weight: 600; font-size: .9rem; }
.notif-item-body { font-size: .82rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-item-time { font-size: .72rem; color: var(--text-muted); }
.notif-item-actions {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: .2rem;
    padding: .4rem .55rem .4rem 0;
}
.notif-panel-footer {
    padding: .65rem .85rem;
    border-top: 1px solid var(--border);
    background: var(--surface-2);
}
.notif-page-item.is-unread {
    border-left: 3px solid var(--primary);
    background: color-mix(in srgb, var(--primary) 6%, var(--surface));
}

.btn-brand {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff !important;
    font-weight: 600;
}

.btn-brand:hover,
.btn-brand:focus {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: #fff !important;
}
