@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* =========================================================================
   app.css — Layout + legacy rules.
   Colors are now driven by theme.css (CSS variables).
   Do NOT hardcode colors here; use var(--color-*) tokens.
   ========================================================================= */

h1:focus {
    outline: none;
}

/* Blazor validation */
.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--color-success);
}

.invalid {
    outline: 1px solid var(--color-danger);
}

.validation-message {
    color: var(--color-danger);
}

#blazor-error-ui {
    background: var(--color-warning-soft);
    color: var(--color-text);
    border-top: 1px solid var(--color-warning);
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: var(--color-danger);
    padding: 1rem;
    color: white;
    border-radius: var(--radius);
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

/* ---------- Body + layout ---------- */
body {
    font-family: 'Inter', 'Poppins', system-ui, -apple-system, Segoe UI, Roboto, sans-serif !important;
    transition: background-color 0.25s ease, color 0.25s ease;
    margin: 0;
    padding: 0;
}

.content {
    padding-top: 0.6rem;
}

.sidebar {
    width: 244px;
    height: 100vh;
    position: fixed;
    transition: all 0.3s ease;
    left: 0;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    z-index: 99;
}

.sidebar-content {
    flex-grow: 1;
    overflow-y: auto;
}

.sidebar .app-info {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    height: 60px;
}

    .sidebar .app-info span {
        font-size: 0.95rem;
        font-weight: 600;
    }

.sidebar a {
    display: flex;
    align-items: center;
    text-decoration: none;
    cursor: pointer;
    gap: 10px;
}

    .sidebar a i {
        flex-shrink: 0;
    }

.sidebar.collapsed {
    width: 72px;
}

    .sidebar.collapsed a span,
    .sidebar.collapsed .app-info span,
    .sidebar.collapsed .app-info i[style] {
        display: none;
    }

.logout {
    width: 100%;
}

main {
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
}

.content {
    margin-left: 244px;
    padding: 1px;
    transition: margin-left 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: visible;
}

    .content.collapsed {
        margin-left: 72px;
    }

.main-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 10px 14px;
    background-color: var(--color-bg);
    color: var(--color-text);
}

body.dark-mode .main-body {
    background-color: var(--color-bg);
    color: var(--color-text);
}

/* The scrollable <article class="content"> wrapper must follow the body bg */
.content {
    background-color: var(--color-bg);
}

body.dark-mode .content {
    background-color: var(--color-bg);
}

.header {
    padding: 10px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 56px;
    position: sticky;
    top: 0;
    z-index: 1000;
}

    .header .icons {
        display: flex;
        align-items: center;
        gap: 18px;
    }

        .header .icons i {
            font-size: 1.15rem;
            cursor: pointer;
        }

.dropdown-menu {
    right: 0;
    left: auto;
}

/* Submenu */
.submenu {
    list-style: none;
    padding-left: 36px;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease-in-out;
}

    .submenu li {
        padding: 3px 0;
        list-style-type: disc;
        padding-left: 12px;
    }

.has-submenu.active + .submenu {
    max-height: 140px;
}

.sidebar a .arrow {
    margin-left: auto;
    transition: transform 0.25s ease;
    font-size: 0.75rem !important;
    color: var(--color-sidebar-text-muted);
}

.sidebar a.active .arrow {
    transform: rotate(90deg);
}

/* Mobile */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        position: fixed;
        height: 100vh;
        top: 0;
        left: 0;
    }

        .sidebar.active {
            transform: translateX(0);
        }

    .content {
        margin-left: 0;
    }

    .close-btn {
        display: block;
    }

    .main-body {
        padding: 8px;
    }
}

.mobile-only {
    display: none;
}

@media (max-width: 768px) {
    .mobile-only {
        display: block;
    }
}

/* ---------- Auth / misc ---------- */
.auth-bg {
    background: url('/assets/img/curved-images/curved5-small.jpg') no-repeat center center;
    background-size: cover;
    height: 100vh;
}

.required-field::after {
    content: " *";
    color: var(--color-danger) !important;
    font-weight: 700 !important;
}

html, body {
    height: 100%;
    overflow: auto;
}

/* ---------- Stat Cards ---------- */
.stats-card {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-xs);
    background: var(--color-surface);
}

    .stats-card:hover {
        transform: translateY(-3px);
        box-shadow: var(--shadow-md);
    }

    .stats-card .card-body {
        position: relative;
        z-index: 1;
        padding: 1rem;
        height: 56px;
        display: flex;
        align-items: center;
    }

    .stats-card .curved-bg {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 70%;
        background: inherit;
        border-radius: 0 0 50% 50%/0 0 30% 30%;
        z-index: 0;
        opacity: 0.9;
    }

    .stats-card .card-footer {
        background: rgba(0, 0, 0, 0.18);
        color: #fff;
        border-top: 1px solid rgba(255, 255, 255, 0.15);
        padding: 0.5rem 1rem;
    }

        .stats-card .card-footer a {
            color: #fff;
            text-decoration: none;
            font-weight: 500;
        }

        .stats-card .card-footer a:hover {
            color: #fff;
            text-decoration: underline;
        }

    .stats-card .icon {
        font-size: 20px;
        margin-right: 8px;
    }

.count-value {
    font-size: 20px;
    font-weight: 700;
    margin-left: auto;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.bg-info-custom {
    background-color: var(--color-info) !important;
    color: white !important;
}

.bg-warning-custom {
    background-color: var(--color-warning) !important;
    color: white !important;
}

.bg-success-custom {
    background-color: var(--color-success) !important;
    color: white !important;
}

.bg-danger-custom {
    background-color: var(--color-danger) !important;
    color: white !important;
}

/* ---------- Chart cards ---------- */
.chart-card {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    overflow: hidden;
    background: var(--color-surface);
}

    .chart-card:hover {
        transform: translateY(-3px);
        box-shadow: var(--shadow-md);
    }

    .chart-card .card-header {
        font-weight: 600;
        background: var(--color-surface);
        border-bottom: 1px solid var(--color-border);
    }

    .chart-card .card-body {
        padding: 1.1rem;
        position: relative;
    }

/* Soft color palette kept for chart.js */
:root {
    --soft-blue: #6c9bcf;
    --soft-teal: #4db8b8;
    --soft-green: #7cb798;
    --soft-yellow: #e8c974;
    --soft-orange: #e89f71;
    --soft-red: #e87474;
    --soft-purple: #b28cde;
    --soft-pink: #de8cbc;
    --soft-gray: #a3a3a3;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chart-container {
    animation: fadeIn 0.5s ease-out forwards;
}

/* ---------- Loading animations ---------- */
.lds-ellipsis {
    display: inline-block;
    position: relative;
    width: 70px;
    height: 15px;
}

    .lds-ellipsis div {
        position: absolute;
        top: 33px;
        width: 10px;
        height: 10px;
        border-radius: 50%;
        background: var(--color-primary);
        animation-timing-function: cubic-bezier(0, 1, 1, 0);
    }

        .lds-ellipsis div:nth-child(1) {
            left: 8px;
            top: 8px;
            animation: lds-ellipsis1 0.6s infinite;
        }

        .lds-ellipsis div:nth-child(2) {
            left: 8px;
            top: 8px;
            animation: lds-ellipsis2 0.6s infinite;
        }

        .lds-ellipsis div:nth-child(3) {
            left: 32px;
            top: 8px;
            animation: lds-ellipsis2 0.6s infinite;
        }

        .lds-ellipsis div:nth-child(4) {
            left: 56px;
            top: 8px;
            animation: lds-ellipsis3 0.6s infinite;
        }

@keyframes lds-ellipsis1 {
    0% {
        transform: scale(0);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes lds-ellipsis3 {
    0% {
        transform: scale(1);
    }

    100% {
        transform: scale(0);
    }
}

@keyframes lds-ellipsis2 {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(24px, 0);
    }
}

.loader {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 20%;
    gap: 10px;
    margin-bottom: 20px;
}

#loader1 {
    width: 12px;
    height: 18px;
    background-color: var(--color-primary);
    border-radius: 4px;
    animation: loading1 1s 0s infinite ease-in;
}

#loader2 {
    width: 12px;
    height: 18px;
    background-color: var(--color-info);
    border-radius: 4px;
    animation: loading2 1s 0.3s infinite ease-in;
}

#loader3 {
    width: 12px;
    height: 18px;
    background-color: var(--color-success);
    border-radius: 4px;
    animation: loading3 1s 0.5s infinite ease-in;
}

@keyframes loading1 {
    0% {
        transform: scaleY(1);
    }

    50% {
        transform: scaleY(2);
    }

    100% {
        transform: scaleY(1);
    }
}

@keyframes loading2 {
    0% {
        transform: scaleY(1);
    }

    50% {
        transform: scaleY(2);
    }

    100% {
        transform: scaleY(1);
    }
}

@keyframes loading3 {
    0% {
        transform: scaleY(1);
    }

    50% {
        transform: scaleY(2);
    }

    100% {
        transform: scaleY(1);
    }
}

/* Inline three-dot spinner shown inside a button while its request is in flight.
   Inherits the button's own text colour via currentColor, so it reads on primary,
   success, outline and link buttons alike. Usage:
   <span class="btn-dots"><span></span><span></span><span></span></span> */
.btn-dots {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    vertical-align: middle;
    line-height: 1;
}
.btn-dots > span {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
    display: inline-block;
    animation: btn-dots 1s infinite ease-in-out both;
}
.btn-dots > span:nth-child(1) { animation-delay: -0.32s; }
.btn-dots > span:nth-child(2) { animation-delay: -0.16s; }

@keyframes btn-dots {
    0%, 80%, 100% { transform: scale(0.5); opacity: 0.45; }
    40% { transform: scale(1); opacity: 1; }
}

/* Standard module page header — an icon tile + title + subtitle on the left and action
   buttons on the right. Matches the Leave / Announcements / Attendance page heads so every
   module reads the same. Uses design tokens, so it adapts to dark mode for free. */
.pg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.pg-head-l { display: flex; align-items: center; gap: 12px; }
.pg-head-ic { width: 40px; height: 40px; border-radius: 11px; background: var(--color-primary-soft); color: var(--color-primary); display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.pg-head-t h3 { margin: 0; font-size: 1.2rem; font-weight: 800; letter-spacing: -.3px; color: var(--color-text); }
.pg-head-sub { font-size: 12.5px; color: var(--color-text-subtle); }
.pg-head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* Centered, responsive progress bar — used inside loader-container divs
   (not fixed to viewport) so it flows with the layout on mobile. */
.loader-progress {
    width: min(180px, 60vw);
    max-width: 100%;
    height: 10px;
    background: linear-gradient(90deg, transparent, var(--color-primary)) left -50px top 0/50px 20px no-repeat var(--color-primary-soft);
    border-radius: 999px;
    animation: l2 1s infinite linear;
    margin: 1.5rem auto;
    display: block;
}

/* If specifically placed inside a .loader-container (centered container), no extra styling needed */
.loader-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    width: 100%;
    padding: 1rem;
}

@keyframes l2 {
    100% {
        background-position: right -50px top 0;
    }
}

/* 3-dot "travelling highlight" spinner. The element itself is the middle dot;
   the two side dots are drawn via box-shadow. All three cycle through the
   primary/primary-soft colors so there's always a highlighted dot visible. */
.loader-menu {
    width: 12px;
    aspect-ratio: 1;
    border-radius: 50%;
    animation: l5 1.2s infinite steps(3) both;
    background: var(--color-primary);
    box-shadow: 18px 0 var(--color-primary-soft),
                -18px 0 var(--color-primary-soft);
}

@keyframes l5 {
    0% {
        background: var(--color-primary);
        box-shadow: 18px 0 var(--color-primary-soft),
                    -18px 0 var(--color-primary-soft);
    }

    33% {
        background: var(--color-primary-soft);
        box-shadow: 18px 0 var(--color-primary),
                    -18px 0 var(--color-primary-soft);
    }

    66% {
        background: var(--color-primary-soft);
        box-shadow: 18px 0 var(--color-primary-soft),
                    -18px 0 var(--color-primary);
    }

    100% {
        background: var(--color-primary);
        box-shadow: 18px 0 var(--color-primary-soft),
                    -18px 0 var(--color-primary-soft);
    }
}

/* Select2 dropdown-height fix (kept) */
.form-select-sm ~ .select2-container--bootstrap-5 .select2-dropdown.select2-dropdown--below {
    max-height: 155px;
    overflow: auto;
    scrollbar-width: thin;
}

/* ---------- Dark-mode component-level fixes (Bootstrap overrides that tokens alone can't reach) ---------- */
body.dark-mode .form-control,
body.dark-mode .form-select {
    background-color: var(--color-surface);
    color: var(--color-text);
    border-color: var(--color-border-strong);
}

body.dark-mode .input-group-text {
    background-color: var(--color-surface-alt);
    color: var(--color-text);
    border-color: var(--color-border-strong);
}

body.dark-mode .select2-container--bootstrap-5 .select2-selection {
    background-color: var(--color-surface) !important;
    color: var(--color-text) !important;
    border-color: var(--color-border-strong) !important;
}

body.dark-mode .select2-container--bootstrap-5 .select2-selection__rendered {
    color: var(--color-text) !important;
}

body.dark-mode .select2-container--bootstrap-5 .select2-dropdown {
    background-color: var(--color-surface) !important;
    border-color: var(--color-border-strong) !important;
}

body.dark-mode .select2-container--bootstrap-5 .select2-results__option {
    color: var(--color-text) !important;
}

body.dark-mode .select2-container--bootstrap-5 .select2-results__option--highlighted {
    background-color: var(--color-surface-alt) !important;
    color: var(--color-text) !important;
}

body.dark-mode .select2-container--bootstrap-5 .select2-search__field {
    background-color: var(--color-surface-alt) !important;
    color: var(--color-text) !important;
    border-color: var(--color-border-strong) !important;
}

/* ---------- Status badges ----------
 *
 * Bootstrap's .bg-* utilities declare "background-color: ... !important" (bootstrap.min.css). A page
 * rule such as ".badge.bg-success { background:#dcfce7; color:#15803d; }" sets a NON-important
 * shorthand for the background and a colour that wins on specificity. So the !important longhand
 * takes the background and the page rule takes the text, and the two halves of the pair arrive from
 * different palettes: dark-green text on Bootstrap's saturated green for "Present", grey on grey for
 * "HalfDay", brown on amber for "late". Same failure shape as the striped-table rows above — half a
 * colour pair overridden and the other half not.
 *
 * Both halves are stated here at the same weight so they cannot be split again, as soft pills with a
 * real dark-mode variant. Pages should not redefine .badge.bg-* locally; if a page needs a new status
 * colour, add it here.
 */
.badge.bg-success,   .at-badge.bg-success   { background-color:#dcfce7 !important; color:#15803d !important; }
.badge.bg-warning,   .at-badge.bg-warning   { background-color:#fef3c7 !important; color:#92400e !important; }
.badge.bg-danger,    .at-badge.bg-danger    { background-color:#fee2e2 !important; color:#b91c1c !important; }
.badge.bg-primary,   .at-badge.bg-primary   { background-color:#dbeafe !important; color:#1e40af !important; }
.badge.bg-info,      .at-badge.bg-info      { background-color:#e0e7ff !important; color:#4338ca !important; }
.badge.bg-secondary, .at-badge.bg-secondary { background-color:#e5e7eb !important; color:#4b5563 !important; }

body.dark-mode .badge.bg-success,   body.dark-mode .at-badge.bg-success   { background-color:#16341f !important; color:#86efac !important; }
body.dark-mode .badge.bg-warning,   body.dark-mode .at-badge.bg-warning   { background-color:#3b3123 !important; color:#fcd34d !important; }
body.dark-mode .badge.bg-danger,    body.dark-mode .at-badge.bg-danger    { background-color:#3b2225 !important; color:#fca5a5 !important; }
body.dark-mode .badge.bg-primary,   body.dark-mode .at-badge.bg-primary   { background-color:#1b2f4d !important; color:#93c5fd !important; }
body.dark-mode .badge.bg-info,      body.dark-mode .at-badge.bg-info      { background-color:#232447 !important; color:#a5b4fc !important; }
body.dark-mode .badge.bg-secondary, body.dark-mode .at-badge.bg-secondary { background-color:#2a323e !important; color:#cbd5e1 !important; }

/* The attendance pages also use semantic names that never touch a Bootstrap utility. Those are
 * readable as-is in light mode but keep a pale light-mode fill in dark mode, which reads as a bright
 * patch in an otherwise dark grid. Give them the same dark treatment for consistency. */
body.dark-mode .at-badge.present { background:#16341f !important; color:#86efac !important; }
body.dark-mode .at-badge.working { background:#1b2f4d !important; color:#93c5fd !important; }
body.dark-mode .at-badge.absent  { background:#3b2225 !important; color:#fca5a5 !important; }
body.dark-mode .at-badge.leave   { background:#232447 !important; color:#a5b4fc !important; }
body.dark-mode .at-badge.none    { background:#2a323e !important; color:#cbd5e1 !important; }

/* Dark-mode tables.
 *
 * Bootstrap 5.3 does not paint table cell backgrounds with background-color. It paints them with
 * an inset box-shadow driven by CSS variables (bootstrap.css, ".table > :not(caption) > * > *"):
 *
 *     background-color: var(--bs-table-bg);
 *     box-shadow: inset 0 0 0 9999px
 *         var(--bs-table-bg-state, var(--bs-table-bg-type, var(--bs-table-accent-bg)));
 *
 * So a dark-mode rule that sets "background-color: ... !important" is painted straight over on any
 * striped, hovered or contextual row, while a "color: ... !important" on the same rule still takes
 * effect. That mismatch is what produces a light-on-light, unreadable row: the cell keeps the light
 * stripe from the box-shadow but takes the light dark-mode text colour.
 *
 * Setting Bootstrap's own variables instead works with the mechanism rather than against it, and
 * covers striped/hover/active states for free. Keep it that way — reintroducing a background-color
 * override here brings the unreadable rows straight back.
 */
body.dark-mode .table {
    --bs-table-color: var(--color-text);
    --bs-table-bg: var(--color-surface);
    --bs-table-border-color: var(--color-border-strong);
    --bs-table-striped-color: var(--color-text);
    --bs-table-striped-bg: var(--color-surface-alt);
    --bs-table-active-color: var(--color-text);
    --bs-table-active-bg: var(--color-border-strong);
    --bs-table-hover-color: var(--color-text);
    --bs-table-hover-bg: var(--color-border-strong);
    --bs-table-accent-bg: transparent;
    color: var(--color-text);
}

/* Contextual rows ship a light background with black text (.table-warning is #fff3cd on #000).
 * Remap each to a dark tone that keeps the semantic hue and stays readable, including its striped
 * variant — otherwise every other contextual row is unreadable exactly as described above.
 */
body.dark-mode .table > tbody > tr.table-warning {
    --bs-table-color: #f5d98b;
    --bs-table-bg: #3b3123;
    --bs-table-striped-color: #f5d98b;
    --bs-table-striped-bg: #473b2b;
    --bs-table-hover-color: #ffeab4;
    --bs-table-hover-bg: #52442f;
}

body.dark-mode .table > tbody > tr.table-success {
    --bs-table-color: #a7e0b5;
    --bs-table-bg: #1c3327;
    --bs-table-striped-color: #a7e0b5;
    --bs-table-striped-bg: #234030;
    --bs-table-hover-color: #c2ecce;
    --bs-table-hover-bg: #2a4d3a;
}

body.dark-mode .table > tbody > tr.table-danger {
    --bs-table-color: #f1a9ae;
    --bs-table-bg: #3b2225;
    --bs-table-striped-color: #f1a9ae;
    --bs-table-striped-bg: #472a2e;
    --bs-table-hover-color: #ffc4c8;
    --bs-table-hover-bg: #533237;
}

body.dark-mode .table > tbody > tr.table-info {
    --bs-table-color: #a6dbe6;
    --bs-table-bg: #1b3239;
    --bs-table-striped-color: #a6dbe6;
    --bs-table-striped-bg: #223f47;
    --bs-table-hover-color: #c3ebf4;
    --bs-table-hover-bg: #294c55;
}

body.dark-mode .table-bordered {
    border-color: var(--color-border-strong) !important;
}

body.dark-mode .table-bordered thead {
    background-color: var(--color-surface-alt) !important;
    color: var(--color-text) !important;
}

/* Borders only. This deliberately no longer forces background-color/color: doing so flattened every
 * stripe and, worse, fought the box-shadow above to produce unreadable rows. Colour now comes from
 * the --bs-table-* variables so striped, hover and contextual states all resolve correctly.
 */
body.dark-mode .table-bordered td,
body.dark-mode .table-bordered th {
    border-color: var(--color-border-strong) !important;
}

/* Row hover for bordered tables that are not also .table-hover.
 *
 * --bs-table-hover-bg above only does anything on a table carrying .table-hover, and most bordered
 * tables in this app do not — they used to get their dark-mode hover from a rule of their own.
 * Restored here through the same inset box-shadow Bootstrap paints cells with (see the block
 * above), NOT background-color: a background-color would lose to that shadow on any striped or
 * contextual row and leave the light stripe standing with dark-mode text on top of it.
 */
body.dark-mode .table-bordered:not(.table-hover) > tbody > tr:hover > * {
    box-shadow: inset 0 0 0 9999px var(--color-surface-alt);
}

body.dark-mode .grid-page-link,
body.dark-mode .page-link {
    background-color: var(--color-surface) !important;
    color: var(--color-text) !important;
    border-color: var(--color-border) !important;
}

body.dark-mode .grid-page-link:hover,
body.dark-mode .page-link:hover {
    background-color: var(--color-surface-alt) !important;
    color: var(--color-text) !important;
}

body.dark-mode .grid-page-item.active .grid-page-link,
body.dark-mode .page-item.active .page-link {
    background-color: var(--color-primary) !important;
    color: #fff !important;
    border-color: var(--color-primary) !important;
}

/* Accordion */
.accordion {
    background-color: var(--color-surface);
    color: var(--color-text);
    border-color: var(--color-border);
}

.accordion-button {
    background-color: var(--color-surface);
    color: var(--color-text);
}

    .accordion-button:not(.collapsed) {
        background-color: var(--color-surface-alt);
        color: var(--color-text);
    }

.accordion-body {
    background-color: var(--color-surface);
    color: var(--color-text);
}

body.dark-mode .accordion,
body.dark-mode .accordion-button,
body.dark-mode .accordion-button:not(.collapsed),
body.dark-mode .accordion-body {
    background-color: var(--color-surface) !important;
    color: var(--color-text) !important;
    border-color: var(--color-border) !important;
}

/* Misc tables on detail pages */
body.dark-mode .m-view-table th,
body.dark-mode .view-table th {
    background: var(--color-surface-alt) !important;
    color: var(--color-text) !important;
    border-bottom: 2px solid var(--color-border-strong) !important;
}

body.dark-mode .m-view-table td,
body.dark-mode .view-table td {
    background: var(--color-surface) !important;
    color: var(--color-text) !important;
    border-bottom: 1px solid var(--color-border) !important;
}

body.dark-mode .m-view-table tr:nth-child(even) td,
body.dark-mode .view-table tr:nth-child(even) td {
    background: var(--color-surface-alt) !important;
}
