/**
 * Custom dark theme — black + golden/amber (#d4a437) palette.
 *
 * Matches old site:
 *   Background (all): #000000  (pure black)
 *   Accent / links:   #d4a437  (golden amber)
 *   Active nav text:  #d4a437  (no background highlight)
 */

[data-bs-theme=dark],
[data-menu-theme=dark] {
    /* ── Body / page background ── */
    --tblr-body-bg:         #000000;
    --tblr-body-bg-rgb:     0, 0, 0;
    --tblr-bg-main-color:   #000000;

    /* ── Card & surface backgrounds ── */
    --tblr-bg-surface:      #111111;
    --tblr-bg-surface-secondary: #0a0a0a;

    /* ── Sidebar / top-bar ── */
    --tblr-navbar-bg:       #000000;

    /* ── Secondary / tertiary (form groups, striped rows, etc.) ── */
    --tblr-secondary-bg:     #111111;
    --tblr-secondary-bg-rgb: 17, 17, 17;
    --tblr-tertiary-bg:      #0a0a0a;
    --tblr-tertiary-bg-rgb:  10, 10, 10;

    /* ── Borders ── */
    --tblr-border-color:             #2a2a2a;
    --tblr-border-color-translucent: rgba(255, 255, 255, 0.08);
    --tblr-dark-mode-border-color:   #2a2a2a;
    --tblr-light-border-subtle:      #2a2a2a;
    --tblr-dark-border-subtle:       #1a1a1a;

    /* ── Form inputs ── */
    --tblr-bg-forms: #111111;

    /* ── Primary accent → golden amber ── */
    --tblr-primary:          #d4a437;
    --tblr-primary-rgb:      212, 164, 55;
    --tblr-tabler:           #d4a437;
    --tblr-tabler-rgb:       212, 164, 55;
    --tblr-link-color:       #d4a437;
    --tblr-link-color-rgb:   212, 164, 55;
    --tblr-link-hover-color: #e8bc55;

    /* Primary subtle backgrounds/borders for dark mode */
    --tblr-primary-bg-subtle:     #1a1200;
    --tblr-primary-border-subtle: #5a4010;
    --tblr-primary-text-emphasis: #e8bc55;

    /* Focus ring */
    --tblr-focus-ring-color: rgba(212, 164, 55, 0.25);

    /* Nav link text color */
    --tblr-navbar-color: #ffffff;
    --tblr-nav-link-color: #ffffff;
}

/* ── Page / wrapper backgrounds ── */
[data-bs-theme=dark] body,
[data-bs-theme=dark] .wrapper,
[data-bs-theme=dark] .page-wrapper,
[data-bs-theme=dark] .page-body,
[data-bs-theme=dark] .page-body-wrapper {
    background-color: #000000 !important;
}

/* ── Sidebar (vertical layout) ── */
[data-bs-theme=dark] .navbar-vertical,
[data-bs-theme=dark] .navbar-side,
[data-bs-theme=dark] aside.sidebar,
[data-bs-theme=dark] .sidebar {
    background-color: #000000 !important;
    border-right-color: #2a2a2a !important;
}

/* ── Top header bar ── */
[data-bs-theme=dark] header.navbar,
[data-bs-theme=dark] .navbar.navbar-expand-md,
[data-bs-theme=dark] .navbar-overlap,
[data-bs-theme=dark] nav.navbar {
    background-color: #000000 !important;
    border-bottom-color: #2a2a2a !important;
}

/* ── Sidebar nav links — white text by default ── */
[data-bs-theme=dark] .navbar-vertical .nav-link,
[data-bs-theme=dark] .sidebar .nav-link {
    color: #ffffff !important;
}

/* ── Sidebar nav links — golden on hover ── */
[data-bs-theme=dark] .navbar-vertical .nav-link:hover,
[data-bs-theme=dark] .sidebar .nav-link:hover {
    color: #d4a437 !important;
}

/* ── Active nav item — golden text, subtle dark highlight ── */
[data-bs-theme=dark] .navbar-vertical .nav-link.active,
[data-bs-theme=dark] .navbar-vertical .nav-item.active > .nav-link,
[data-bs-theme=dark] .sidebar .nav-link.active,
[data-bs-theme=dark] .sidebar .nav-item.active > .nav-link {
    color: #d4a437 !important;
    background-color: rgba(255, 255, 255, 0.07) !important;
    font-weight: 600;
}

/* ── Headings — white ── */
[data-bs-theme=dark] h1,
[data-bs-theme=dark] h2,
[data-bs-theme=dark] h3,
[data-bs-theme=dark] h4,
[data-bs-theme=dark] h5,
[data-bs-theme=dark] h6,
[data-bs-theme=dark] .page-title {
    color: #ffffff;
}

/* ── Links — white by default, golden on hover ── */
[data-bs-theme=dark] a {
    color: #ffffff;
}
[data-bs-theme=dark] a:hover {
    color: #d4a437;
}

/* ── Buttons (primary) ── */
[data-bs-theme=dark] .btn-primary {
    background-color: #d4a437 !important;
    border-color: #d4a437 !important;
    color: #000000 !important;
}
[data-bs-theme=dark] .btn-primary:hover {
    background-color: #e8bc55 !important;
    border-color: #e8bc55 !important;
}

/* ── Cards / surfaces ── */
[data-bs-theme=dark] .card,
[data-bs-theme=dark] .card-body {
    background-color: #111111;
    border-color: #2a2a2a;
}

/* ── Calendar modal images ── */
.calendar-modal-img {
    height: 75px;
    border: 1px solid #000000;
    border-radius: 4px;
    object-fit: cover;
}

/* ── Modal close button — plain ×, no box, floated right ── */
.modal-header .close {
    background: none;
    border: none;
    box-shadow: none;
    padding: 0;
    margin-left: auto;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.6;
}
.modal-header .close:hover {
    opacity: 1;
}

/* ── Modals ── */
[data-bs-theme=dark] .modal-content {
    background-color: #111111;
    border-color: #2a2a2a;
    color: #ffffff;
}
[data-bs-theme=dark] .modal-header {
    background-color: #000000;
    border-bottom-color: #2a2a2a;
}
[data-bs-theme=dark] .modal-footer {
    background-color: #000000;
    border-top-color: #2a2a2a;
}
[data-bs-theme=dark] .modal-title {
    color: #ffffff;
}
[data-bs-theme=dark] .modal .btn-close {
    filter: invert(1);
}
[data-bs-theme=dark] .modal-header .close {
    color: #ffffff;
}
[data-bs-theme=dark] .userlistitem {
    color: #ffffff !important;
}


/* ============================================
   LIGHT THEME — clean white + golden accents
   ============================================ */

[data-bs-theme=light],
[data-menu-theme=light] {
    --tblr-primary:          #d4a437;
    --tblr-primary-rgb:      212, 164, 55;
    --tblr-tabler:           #d4a437;
    --tblr-tabler-rgb:       212, 164, 55;
    --tblr-link-color:       #d4a437;
    --tblr-link-color-rgb:   212, 164, 55;
    --tblr-link-hover-color: #b8891e;
    --tblr-focus-ring-color: rgba(212, 164, 55, 0.25);

    /* Fix the beige/cream bleed from Tabler's default primary subtle */
    --tblr-primary-bg-subtle:     rgba(212, 164, 55, 0.08);
    --tblr-primary-border-subtle: rgba(212, 164, 55, 0.2);
}

/* ── Sidebar ── */
[data-bs-theme=light] .navbar-vertical,
[data-bs-theme=light] .sidebar,
[data-bs-theme=light] aside {
    background-color: #ffffff !important;
    border-right-color: #7f7f7f !important;
}

/* ── Sidebar nav links ── */
[data-bs-theme=light] .navbar-vertical .nav-link,
[data-bs-theme=light] .sidebar .nav-link {
    color: #000000 !important;
}

[data-bs-theme=light] .navbar-vertical .nav-link:hover,
[data-bs-theme=light] .sidebar .nav-link:hover {
    color: #d4a437 !important;
}

[data-bs-theme=light] .navbar-vertical .nav-link.active,
[data-bs-theme=light] .navbar-vertical .nav-item.active > .nav-link,
[data-bs-theme=light] .sidebar .nav-link.active,
[data-bs-theme=light] .sidebar .nav-item.active > .nav-link {
    color: #d4a437 !important;
    background-color: rgba(212, 164, 55, 0.08) !important;
    font-weight: 600;
}

/* ── Sidebar nav items — no beige background bleed ── */
[data-bs-theme=light] .navbar-vertical .nav-item,
[data-bs-theme=light] .sidebar .nav-item {
    background-color: transparent !important;
}

/* ── Sidebar dropdown submenus ── */
[data-bs-theme=light] .navbar-vertical .nav-item .dropdown-menu,
[data-bs-theme=light] .sidebar .nav-item .dropdown-menu {
    background-color: #ffffff !important;
    border-color: #dee2e6 !important;
}

/* ── Submenu / nested nav items ── */
[data-bs-theme=light] .navbar-vertical .nav-item .nav-item .nav-link,
[data-bs-theme=light] .sidebar .nav-item .nav-item .nav-link {
    color: #000000 !important;
    background-color: transparent !important;
}

[data-bs-theme=light] .navbar-vertical .nav-item .nav-item .nav-link:hover,
[data-bs-theme=light] .sidebar .nav-item .nav-item .nav-link:hover {
    color: #d4a437 !important;
    background-color: rgba(212, 164, 55, 0.08) !important;
}

[data-bs-theme=light] .navbar-vertical .nav-item .nav-item .nav-link.active,
[data-bs-theme=light] .sidebar .nav-item .nav-item .nav-link.active {
    color: #d4a437 !important;
    background-color: rgba(212, 164, 55, 0.08) !important;
}

/* ── Sidebar brand/logo area ── */
[data-bs-theme=light] .navbar-vertical .navbar-brand,
[data-bs-theme=light] .sidebar .navbar-brand {
    color: #000000 !important;
}

/* ── Sidebar user dropdown text ── */
[data-bs-theme=light] .navbar-vertical .nav-link .dropdown-toggle,
[data-bs-theme=light] .sidebar .dropdown-toggle {
    color: #000000 !important;
}

/* ── Sidebar nav icons ── */
[data-bs-theme=light] .navbar-vertical .nav-link-icon,
[data-bs-theme=light] .sidebar .nav-link-icon {
    color: #000000 !important;
}

/* ── Buttons (primary) ── */
[data-bs-theme=light] .btn-primary {
    background-color: #d4a437 !important;
    border-color: #d4a437 !important;
    color: #000000 !important;
}
[data-bs-theme=light] .btn-primary:hover {
    background-color: #b8891e !important;
    border-color: #b8891e !important;
}

/* ── Links in content area ── */
[data-bs-theme=light] .page-body a {
    color: #d4a437;
}
[data-bs-theme=light] .page-body a:hover {
    color: #b8891e;
}

/* ── Page background ── */
[data-bs-theme=light] .page-wrapper,
[data-bs-theme=light] .page-body,
[data-bs-theme=light] .page-body-wrapper,
[data-bs-theme=light] body,
[data-bs-theme=light] .wrapper {
    background-color: #ffffff !important;
}

/* ── Modals ── */
[data-bs-theme=light] .modal-content {
    background-color: #ffffff;
    border-color: #dee2e6;
    color: #000000;
}
[data-bs-theme=light] .modal-header {
    background-color: #f8f9fa;
    border-bottom-color: #dee2e6;
}
[data-bs-theme=light] .modal-footer {
    background-color: #f8f9fa;
    border-top-color: #dee2e6;
}
[data-bs-theme=light] .modal-title {
    color: #000000;
}
[data-bs-theme=light] .modal-header .close {
    color: #000000;
}
[data-bs-theme=light] .userlistitem {
    color: #000000 !important;
}

/* Fix select2 dropdown inside modals */
.modal .select2-container--open {
    z-index: 9999 !important;
}

.modal .select2-dropdown {
    z-index: 9999 !important;
}

.modal-body {
    overflow: visible !important;
}

.modal-content {
    overflow: visible !important;
}