:root {
    --zc-sidebar-width: 260px;
    --zc-header-height: 64px;
    --primary-rgb: 132, 90, 223;
    --zc-bg: #f4f6fb;
    --zc-border: #e8ebf3;
    --zc-text: #1f2430;
}

html,
body {
    margin: 0;
    padding: 0;
    background: var(--zc-bg);
    color: var(--zc-text);
    overflow-x: hidden;
}

.skip-link {
    position: absolute;
    left: 0.5rem;
    top: 0.5rem;
    z-index: 5000;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    background: #ffffff;
    border: 1px solid #cfd6e4;
    color: #233045;
    transform: translateY(-140%);
    transition: transform 0.15s ease;
}

.skip-link:focus {
    transform: translateY(0);
}

.page {
    min-height: 100vh;
}

.app-sidebar {
    position: fixed;
    inset-inline-start: 0;
    top: 0;
    width: var(--zc-sidebar-width);
    height: 100vh;
    z-index: 1040;
    overflow: hidden;
}

.main-sidebar-header {
    min-height: var(--zc-header-height);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 1rem;
    border-bottom: 0;
}

.main-sidebar-header .header-logo,
.main-sidebar-header .header-logo:hover,
.main-sidebar-header .header-logo:focus,
.main-sidebar-header .header-logo:focus-visible,
.main-sidebar-header .header-logo:active,
.main-sidebar-header .header-logo:visited {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none !important;
    outline: none !important;
    background: transparent !important;
    box-shadow: none !important;
    text-decoration: none !important;
    -webkit-tap-highlight-color: transparent;
}

.sidebar-brand {
    display: inline-block !important;
    color: #ffffff !important;
    line-height: 1;
    letter-spacing: 0.01em;
    text-align: center;
}

.main-sidebar {
    height: calc(100vh - var(--zc-header-height));
    overflow-y: auto;
}

.main-menu {
    list-style: none;
    margin: 0;
    padding: 0.5rem;
}

.slide__category {
    margin-top: 1rem;
    padding: 0.35rem 0.65rem;
}

.category-name {
    font-size: 0.67rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.65;
}

.side-menu__item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    border-radius: 0.5rem;
    padding: 0.56rem 0.7rem;
    text-decoration: none;
}

.side-menu__item.active {
    background: rgba(var(--primary-rgb), 0.16);
    color: rgb(var(--primary-rgb));
}

.side-menu__icon {
    width: 1rem;
    text-align: center;
}

.app-header {
    position: fixed;
    top: 0;
    inset-inline-start: var(--zc-sidebar-width);
    inset-inline-end: 0;
    height: var(--zc-header-height);
    z-index: 1030;
    background: #ffffff;
    border-bottom: 1px solid var(--zc-border);
    overflow: visible;
}

.main-header-container {
    min-height: var(--zc-header-height);
    overflow: visible;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.main-header-container.container-fluid {
    max-width: none !important;
    width: 100% !important;
    padding-inline: 1rem !important;
}

.header-content-left,
.header-content-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 40px;
}

.header-logo-box {
    height: 40px;
    padding: 0 0.9rem;
    border-radius: 0.625rem;
    border: 1px solid var(--zc-border);
    background: #ffffff;
    display: inline-flex;
    align-items: center;
    color: #33435f;
}

.header-control-btn {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 0.625rem;
    border: 1px solid var(--zc-border);
    background: #ffffff;
    color: #4a5f84;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
}

.header-control-btn:hover {
    background: #f7f9fd;
    border-color: #d5ddec;
}

.header-control-btn:focus-visible {
    outline: 2px solid rgba(var(--primary-rgb), 0.35);
    outline-offset: 1px;
}

.profile-toggle {
    min-height: 40px;
    border-radius: 0.625rem;
    border: 1px solid var(--zc-border);
    background: #ffffff;
    color: #33435f;
    padding: 0.25rem 0.55rem 0.25rem 0.45rem;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    cursor: pointer;
}

.profile-toggle:hover {
    background: #f7f9fd;
}

.profile-avatar {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: rgb(var(--primary-rgb));
    flex-shrink: 0;
}

.profile-avatar i {
    font-size: 1rem;
}

.profile-meta,
.profile-chevron {
    color: #4a5f84;
}

.dropdown-menu {
    border: 1px solid var(--zc-border) !important;
    border-radius: 0.625rem;
}

.hamburger-btn {
    display: none;
}

#main-content {
    margin-inline-start: var(--zc-sidebar-width);
    padding-top: var(--zc-header-height);
    min-height: 100vh;
    width: calc(100vw - var(--zc-sidebar-width));
}

main#main-content.empty-layout-main {
    margin-inline-start: 0;
    padding-top: 0;
    min-height: 100vh;
    width: 100%;
    display: block;
}

.main-content.app-content {
    margin: 0 !important;
    margin-inline-start: 0 !important;
    width: 100% !important;
    max-width: none !important;
    min-height: calc(100vh - var(--zc-header-height));
}

.app-content .container-fluid {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 1.5rem 1.75rem;
}

/* ── Page header ─────────────────────────────────────────── */
.page-header-breadcrumb {
    padding-bottom: 1.25rem;
    margin-bottom: 1.5rem !important;
    border-bottom: 1px solid var(--zc-border);
}

.page-header-breadcrumb h1 {
    font-size: 1.25rem !important;
    font-weight: 700 !important;
    color: #1a2540 !important;
    margin-bottom: 0.2rem !important;
    line-height: 1.3;
}

.page-header-breadcrumb p.text-muted {
    font-size: 0.84rem !important;
    color: #6b7a9b !important;
    margin-bottom: 0 !important;
}

/* ── Card colour scheme ───────────────────────────────────── */
.card {
    background: #ffffff;
    border: 1px solid #eaeff8 !important;
    border-radius: 0.75rem !important;
}

.card-header {
    background: #f8fafd !important;
    border-bottom: 1px solid #eaeff8 !important;
    padding: 0.9rem 1.25rem !important;
}

.card-title {
    color: #1a2540 !important;
    font-weight: 600 !important;
}

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

.card-footer {
    background: transparent !important;
}

/* stat card icon boxes */
.card .rounded-3[style*="rgba"] {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    flex-shrink: 0;
}

.footer {
    margin-inline-start: var(--zc-sidebar-width);
    border-top: 1px solid var(--zc-border);
    background: #ffffff;
}

#responsive-overlay {
    position: fixed;
    inset: 0;
    border: 0;
    background: rgba(15, 20, 28, 0.38);
    z-index: 1035;
    display: none;
}

.scroll-to-top {
    position: fixed;
    bottom: 1.25rem;
    right: 1.25rem;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    padding: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1045;
}

.table th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.table-light,
thead.table-light,
thead.table-light tr,
thead.table-light th {
    background-color: #f1f4f9 !important;
}

thead.table-light th {
    color: #5a667d !important;
    font-weight: 700 !important;
    border-color: #e1e7f0 !important;
}

/* Global form controls */
.form-control,
.form-select,
.input-group-text {
    border-color: #d7deea;
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(var(--primary-rgb), 0.55);
    box-shadow: 0 0 0 0.2rem rgba(var(--primary-rgb), 0.15);
}

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

[data-theme-mode='dark'] .app-content,
[data-theme-mode='dark'] .footer {
    background: linear-gradient(180deg, #1a2130 0%, #171d2a 100%);
    color: #d7e2f5;
}

[data-theme-mode='dark'] {
    --zc-bg: #0f1420;
    --zc-border: #2a3446;
    --zc-text: #d7e2f5;
    --zc-surface: #171d2a;
    --zc-surface-2: #1c2433;
    --zc-surface-3: #222b3c;
    --zc-muted: #91a0bf;
    --zc-heading: #f4f8ff;
    color-scheme: dark;
}

[data-theme-mode='dark'] body {
    background:
        radial-gradient(circle at top left, rgba(132, 90, 223, 0.10), transparent 28%),
        radial-gradient(circle at top right, rgba(27, 125, 180, 0.08), transparent 22%),
        var(--zc-bg);
    color: var(--zc-text);
}

[data-theme-mode='dark'] .app-header,
[data-theme-mode='dark'] .header-logo-box,
[data-theme-mode='dark'] .header-control-btn,
[data-theme-mode='dark'] .profile-toggle {
    background: var(--zc-surface-2);
    border-color: var(--zc-border);
    color: var(--zc-text);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

[data-theme-mode='dark'] .profile-meta,
[data-theme-mode='dark'] .profile-chevron {
    color: #b8c7e4;
}

[data-theme-mode='dark'] .card,
[data-theme-mode='dark'] .modal-content,
[data-theme-mode='dark'] .dropdown-menu,
[data-theme-mode='dark'] .list-group-item,
[data-theme-mode='dark'] .offcanvas {
    background: linear-gradient(180deg, var(--zc-surface-2) 0%, var(--zc-surface) 100%);
    color: var(--zc-text);
    border-color: var(--zc-border) !important;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
}

[data-theme-mode='dark'] .dropdown-menu {
    padding: 0.35rem;
}

[data-theme-mode='dark'] .dropdown-menu .dropdown-item {
    color: #d7e2f5 !important;
    border-radius: 0.5rem;
    padding: 0.6rem 0.8rem;
    transition: background-color 0.15s ease, color 0.15s ease;
}

[data-theme-mode='dark'] .dropdown-menu .dropdown-item i {
    color: #9eb2d9;
}

[data-theme-mode='dark'] .dropdown-menu .dropdown-item:hover,
[data-theme-mode='dark'] .dropdown-menu .dropdown-item:focus {
    background: rgba(132, 90, 223, 0.14);
    color: #ffffff !important;
}

[data-theme-mode='dark'] .dropdown-menu .dropdown-item:hover i,
[data-theme-mode='dark'] .dropdown-menu .dropdown-item:focus i {
    color: #ffffff;
}

[data-theme-mode='dark'] .dropdown-menu .dropdown-item.text-danger {
    color: #ff9b9b !important;
}

[data-theme-mode='dark'] .dropdown-menu .dropdown-item.text-danger i {
    color: #ff8c7f;
}

[data-theme-mode='dark'] .dropdown-menu .dropdown-item.text-danger:hover,
[data-theme-mode='dark'] .dropdown-menu .dropdown-item.text-danger:focus {
    background: rgba(220, 53, 69, 0.16);
    color: #ffd7db !important;
}

[data-theme-mode='dark'] .dropdown-menu .dropdown-divider {
    border-top-color: var(--zc-border);
    opacity: 1;
}

[data-theme-mode='dark'] .card-header,
[data-theme-mode='dark'] .card-footer {
    background: rgba(255, 255, 255, 0.02) !important;
    border-color: var(--zc-border) !important;
}

[data-theme-mode='dark'] .page-header-breadcrumb h1,
[data-theme-mode='dark'] .card-title,
[data-theme-mode='dark'] .modal-title,
[data-theme-mode='dark'] h1,
[data-theme-mode='dark'] h2,
[data-theme-mode='dark'] h3,
[data-theme-mode='dark'] h4,
[data-theme-mode='dark'] h5,
[data-theme-mode='dark'] h6 {
    color: var(--zc-heading) !important;
}

[data-theme-mode='dark'] .text-muted,
[data-theme-mode='dark'] .form-text,
[data-theme-mode='dark'] .small,
[data-theme-mode='dark'] .table .text-muted {
    color: #93a3c4 !important;
}

[data-theme-mode='dark'] .form-label {
    color: #c8d4ea !important;
}

/* Dark-mode modal/dialog scheme (global) */
[data-theme-mode='dark'] .modal-backdrop.show {
    opacity: 0.6;
}

.modal {
    z-index: 2000 !important;
}

.modal-backdrop {
    z-index: 1990 !important;
}

[data-theme-mode='dark'] .modal-content {
    background: linear-gradient(180deg, #1c2433 0%, #171d2a 100%) !important;
    color: #dfe8fb !important;
    border: 1px solid var(--zc-border) !important;
    box-shadow: 0 20px 55px rgba(0, 0, 0, 0.45) !important;
}

[data-theme-mode='dark'] .modal-header,
[data-theme-mode='dark'] .modal-footer {
    border-color: var(--zc-border) !important;
}

[data-theme-mode='dark'] .modal-body,
[data-theme-mode='dark'] .modal-body p,
[data-theme-mode='dark'] .modal-body label,
[data-theme-mode='dark'] .modal-body .text-muted,
[data-theme-mode='dark'] .modal-body .form-text {
    color: #b7c5df !important;
}

[data-theme-mode='dark'] .modal-body code {
    color: #c9b5ff !important;
    background: rgba(132, 90, 223, 0.18);
    padding: 0.1rem 0.35rem;
    border-radius: 0.3rem;
}

[data-theme-mode='dark'] .modal .btn-close {
    filter: invert(1) brightness(1.1);
    opacity: 0.85;
}

[data-theme-mode='dark'] .modal .btn-close:hover {
    opacity: 1;
}

[data-theme-mode='dark'] .modal .btn-light {
    background: #243042 !important;
    border-color: var(--zc-border) !important;
    color: #d7e3fb !important;
}

[data-theme-mode='dark'] .modal .btn-light:hover {
    background: #2c3b53 !important;
    border-color: rgba(132, 90, 223, 0.35) !important;
}

/* Toasts */
.toast-item {
    background: #ffffff;
    border: 1px solid #dbe3f0 !important;
    border-radius: 0.7rem;
}

.toast-item .toast-header {
    background: transparent;
    border-bottom: 1px solid #edf2f8;
}

.toast-item .toast-title {
    color: #2d3a50;
}

.toast-item .toast-message {
    color: #4e5f7e;
}

.toast-item .toast-icon {
    color: #5a6b8b;
}

.toast-item.toast-success .toast-icon,
.toast-item.toast-success .toast-title {
    color: #129a72;
}

.toast-item.toast-danger .toast-icon,
.toast-item.toast-danger .toast-title {
    color: #d44b3a;
}

.toast-item.toast-warning .toast-icon,
.toast-item.toast-warning .toast-title {
    color: #b88209;
}

.toast-item.toast-info .toast-icon,
.toast-item.toast-info .toast-title {
    color: #1b7db4;
}

[data-theme-mode='dark'] .toast-item {
    background: linear-gradient(180deg, #1c2433 0%, #171d2a 100%);
    border: 1px solid var(--zc-border) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35) !important;
}

[data-theme-mode='dark'] .toast-item .toast-header {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

[data-theme-mode='dark'] .toast-item .toast-title {
    color: #e9f1ff;
}

[data-theme-mode='dark'] .toast-item .toast-message {
    color: #b8c8e6;
}

[data-theme-mode='dark'] .toast-item .toast-icon {
    color: #c5d4ef;
}

[data-theme-mode='dark'] .toast-item.toast-success .toast-icon,
[data-theme-mode='dark'] .toast-item.toast-success .toast-title {
    color: #34d39f;
}

[data-theme-mode='dark'] .toast-item.toast-danger .toast-icon,
[data-theme-mode='dark'] .toast-item.toast-danger .toast-title {
    color: #ff8c7f;
}

[data-theme-mode='dark'] .toast-item.toast-warning .toast-icon,
[data-theme-mode='dark'] .toast-item.toast-warning .toast-title {
    color: #ffd36a;
}

[data-theme-mode='dark'] .toast-item.toast-info .toast-icon,
[data-theme-mode='dark'] .toast-item.toast-info .toast-title {
    color: #7ec8ff;
}

[data-theme-mode='dark'] .toast-item .toast-close {
    filter: invert(1) brightness(1.05);
    opacity: 0.8;
}

[data-theme-mode='dark'] .toast-item .toast-close:hover {
    opacity: 1;
}

[data-theme-mode='dark'] .table-light,
[data-theme-mode='dark'] thead.table-light,
[data-theme-mode='dark'] thead.table-light tr,
[data-theme-mode='dark'] thead.table-light th {
    background-color: rgba(255, 255, 255, 0.03) !important;
}

[data-theme-mode='dark'] thead.table-light th {
    color: #bfcbed !important;
    border-color: var(--zc-border) !important;
    box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.03);
}

[data-theme-mode='dark'] .table {
    color: var(--zc-text) !important;
    --bs-table-color: var(--zc-text);
    --bs-table-bg: transparent;
    --bs-table-striped-bg: rgba(255, 255, 255, 0.025);
    --bs-table-striped-color: var(--zc-text);
    --bs-table-hover-bg: rgba(132, 90, 223, 0.10);
    --bs-table-hover-color: var(--zc-text);
}

[data-theme-mode='dark'] .table > :not(caption) > * > * {
    background-color: transparent !important;
    color: var(--zc-text) !important;
    border-color: var(--zc-border) !important;
}

[data-theme-mode='dark'] .table-hover > tbody > tr:hover > * {
    background-color: rgba(132, 90, 223, 0.08) !important;
}

[data-theme-mode='dark'] .table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: rgba(255, 255, 255, 0.02) !important;
}

[data-theme-mode='dark'] .table-bordered > :not(caption) > * > * {
    border-color: var(--zc-border) !important;
}

/* Dark-mode form controls (fix white search bars/inputs across all pages) */
[data-theme-mode='dark'] .form-control,
[data-theme-mode='dark'] .form-select {
    background-color: #141b26 !important;
    color: #dfe8fb !important;
    border-color: var(--zc-border) !important;
}

[data-theme-mode='dark'] .form-control::placeholder {
    color: #8ea0bf !important;
    opacity: 1;
}

[data-theme-mode='dark'] .form-control:focus,
[data-theme-mode='dark'] .form-select:focus {
    background-color: #141b26 !important;
    color: #eef4ff !important;
    border-color: rgba(var(--primary-rgb), 0.65) !important;
    box-shadow: 0 0 0 0.2rem rgba(var(--primary-rgb), 0.2) !important;
}

[data-theme-mode='dark'] .input-group-text,
[data-theme-mode='dark'] .input-group-text.bg-transparent {
    background-color: #141b26 !important;
    color: #8ea0bf !important;
    border-color: var(--zc-border) !important;
}

[data-theme-mode='dark'] .input-group .form-control.border-start-0 {
    border-inline-start-color: transparent !important;
}

[data-theme-mode='dark'] .input-group .input-group-text.border-end-0 {
    border-inline-end-color: transparent !important;
}

[data-theme-mode='dark'] .page-link {
    background-color: #141b26;
    color: #d7e2f5;
    border-color: var(--zc-border);
}

[data-theme-mode='dark'] .page-link:hover {
    background-color: #1d2637;
    color: #f5f8ff;
    border-color: rgba(132, 90, 223, 0.35);
}

[data-theme-mode='dark'] .page-item.active .page-link {
    background-color: rgba(132, 90, 223, 0.92);
    border-color: rgba(132, 90, 223, 0.92);
    color: #ffffff;
}

[data-theme-mode='dark'] .page-item.disabled .page-link {
    background-color: #111723;
    color: #6f7c97;
    border-color: var(--zc-border);
}

[data-theme-mode='dark'] .bg-white,
[data-theme-mode='dark'] .bg-light,
[data-theme-mode='dark'] .bg-body,
[data-theme-mode='dark'] .bg-body-tertiary {
    background-color: var(--zc-surface) !important;
    color: var(--zc-text) !important;
}

[data-theme-mode='dark'] .border,
[data-theme-mode='dark'] .border-top,
[data-theme-mode='dark'] .border-bottom,
[data-theme-mode='dark'] .border-start,
[data-theme-mode='dark'] .border-end {
    border-color: var(--zc-border) !important;
}

[data-theme-mode='dark'] .text-dark {
    color: var(--zc-heading) !important;
}

@media (max-width: 991.98px) {
    .app-header {
        inset-inline-start: 0;
    }

    .hamburger-btn {
        display: inline-flex;
    }

    .header-logo-box {
        padding: 0 0.75rem;
    }

    #main-content,
    .footer {
        margin-inline-start: 0;
        width: 100%;
    }

    .app-sidebar {
        transform: translateX(-100%);
        transition: transform 0.22s ease;
    }

    html[data-toggled='open'] .app-sidebar {
        transform: translateX(0);
    }

    html[data-toggled='open'] #responsive-overlay {
        display: block;
    }

    .app-content .container-fluid {
        padding: 1rem;
    }

    .profile-toggle {
        padding-inline: 0.4rem;
    }
}

/* ── Login page ───────────────────────────────────────────── */
.vt-login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eef1f8;
    padding: 1.5rem;
}

[data-theme-mode='dark'] .vt-login-wrap {
    background: #111827;
}

.vt-login-card {
    width: 100%;
    max-width: 420px;
    background: #ffffff;
    border-radius: 1rem;
    padding: 2.5rem 2rem;
    box-shadow: 0 4px 32px rgba(20, 30, 60, 0.10);
}

[data-theme-mode='dark'] .vt-login-card {
    background: #1c2330;
    box-shadow: 0 4px 32px rgba(0, 0, 0, 0.4);
}

.vt-login-brand {
    text-align: center;
    margin-bottom: 2rem;
}

.vt-login-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(var(--primary-rgb), 0.12);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.vt-login-icon i {
    font-size: 1.75rem;
    color: rgb(var(--primary-rgb));
}

.vt-login-brand h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1a2540;
    margin-bottom: 0.25rem;
}

[data-theme-mode='dark'] .vt-login-brand h1 {
    color: #eef4ff;
}

.vt-login-brand p {
    font-size: 0.875rem;
    color: #6b7a9b;
    margin-bottom: 0;
}

.vt-login-card .form-label {
    font-weight: 500;
    font-size: 0.875rem;
    color: #374151;
    margin-bottom: 0.4rem;
}

[data-theme-mode='dark'] .vt-login-card .form-label {
    color: #c4d2f2;
}

.vt-pw-toggle {
    border: 1px solid #d7deea;
    border-left: 0;
    background: #ffffff;
    color: #6b7a9b;
    padding: 0 0.75rem;
    border-radius: 0 0.375rem 0.375rem 0;
}

.vt-pw-toggle:hover {
    background: #f7f9fd;
}

[data-theme-mode='dark'] .vt-pw-toggle {
    background: #141b26;
    border-color: rgba(255, 255, 255, 0.14);
    color: #8ea0bf;
}
