@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

/* ═══════════════════════════════════════════════════════════
   ROOT VARIABLES
═══════════════════════════════════════════════════════════ */
:root {
    --clr-primary:   #4f46e5;
    --clr-primary-h: #4338ca;
    --clr-success:   #10b981;
    --clr-danger:    #ef4444;
    --clr-warning:   #f59e0b;
    --clr-info:      #06b6d4;
    --clr-border:    #e2e8f0;
    --clr-surface:   #ffffff;
    --clr-bg:        #f8fafc;
    --clr-text:      #0f172a;
    --clr-muted:     #64748b;
    --radius-card:   0.875rem;
    --radius-btn:    0.5rem;
    --radius-input:  0.5rem;
    --shadow-card:   0 1px 12px -3px rgba(15,23,42,.08);
    --shadow-card-h: 0 8px 24px -4px rgba(15,23,42,.12);
}
.dark {
    --clr-border:    #334155;
    --clr-surface:   #1e293b;
    --clr-bg:        #0f172a;
    --clr-text:      #f1f5f9;
    --clr-muted:     #94a3b8;
    --shadow-card:   0 1px 12px -3px rgba(0,0,0,.25);
    --shadow-card-h: 0 8px 24px -4px rgba(0,0,0,.4);
}

/* ═══════════════════════════════════════════════════════════
   BASE RESET
═══════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif !important;
    font-size: 0.875rem !important;
    line-height: 1.6 !important;
    color: var(--clr-text) !important;
    background: var(--clr-bg) !important;
    transition: background .3s, color .3s;
}
.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    line-height: 1;
    display: inline-flex;
    align-items: center;
}

/* ═══════════════════════════════════════════════════════════
   SCROLLBAR
═══════════════════════════════════════════════════════════ */
::-webkit-scrollbar            { width:5px; height:5px; }
::-webkit-scrollbar-track      { background:transparent; }
::-webkit-scrollbar-thumb      { background:rgba(148,163,184,.3); border-radius:9999px; }
::-webkit-scrollbar-thumb:hover{ background:rgba(148,163,184,.55); }
.dark ::-webkit-scrollbar-thumb{ background:rgba(71,85,105,.45); }

/* ═══════════════════════════════════════════════════════════
   SIDEBAR / LAYOUT SHELL
═══════════════════════════════════════════════════════════ */
#sidebar, header, main { transition: all .3s cubic-bezier(.4,0,.2,1); }
.sidebar-submenu {
    overflow:hidden; max-height:0; opacity:0;
    transition: max-height .35s cubic-bezier(.4,0,.2,1), opacity .2s ease;
}
.sidebar-submenu.open { max-height:600px; opacity:1; }
.sidebar-nav-active {
    color:#fff !important;
    background: rgba(99,102,241,.15) !important;
    border-left: 3px solid #6366f1;
    border-radius: 0 .5rem .5rem 0;
}

/* Sidebar collapse */
body.sidebar-collapsed #sidebar { width:76px; }
body:not(.sidebar-collapsed) #sidebar { width:260px; }
body.sidebar-collapsed header { left:76px; }
body:not(.sidebar-collapsed) header { left:260px; }
body.sidebar-collapsed main { margin-left:76px; }
body:not(.sidebar-collapsed) main { margin-left:260px; }
body.sidebar-collapsed #sidebar .sidebar-logo-text,
body.sidebar-collapsed #sidebar .sidebar-logo-sub,
body.sidebar-collapsed #sidebar nav span:not(.material-symbols-outlined),
body.sidebar-collapsed #sidebar .mt-auto p,
body.sidebar-collapsed #sidebar .cat-label { display:none !important; }
body.sidebar-collapsed #sidebar nav a,
body.sidebar-collapsed #sidebar nav button { padding-left:0 !important; padding-right:0 !important; justify-content:center !important; }
body.sidebar-collapsed #sidebar nav .material-symbols-outlined { margin-right:0 !important; }

/* ═══════════════════════════════════════════════════════════
   BOOTSTRAP GRID — keep working
═══════════════════════════════════════════════════════════ */
.container-fluid { width:100%; padding:0; }
.row { display:flex; flex-wrap:wrap; margin:-0.75rem; }
.row > * { padding:0.75rem; }
.col-sm-12,.col-lg-12,.col-md-12,.col-12 { flex:0 0 100%; max-width:100%; }
.col-sm-6,.col-md-6,.col-lg-6 { flex:0 0 50%; max-width:50%; }
.col-sm-3,.col-md-3,.col-sm-4,.col-md-4 { flex:0 0 33.3333%; max-width:33.3333%; }
.col-sm-9,.col-md-9 { flex:0 0 75%; max-width:75%; }
.col-lg-8 { flex:0 0 66.6667%; max-width:66.6667%; }
.col-lg-4 { flex:0 0 33.3333%; max-width:33.3333%; }
.col-md-4.col-lg-4 { flex:0 0 33.3333%; max-width:33.3333%; }

/* ═══════════════════════════════════════════════════════════
   CARD
═══════════════════════════════════════════════════════════ */
.card {
    background: var(--clr-surface) !important;
    border: 1px solid var(--clr-border) !important;
    border-radius: var(--radius-card) !important;
    box-shadow: var(--shadow-card) !important;
    transition: box-shadow .25s ease, transform .25s ease;
    position: relative;
    overflow: hidden;
}
.card::before {
    content:''; position:absolute; top:0; left:0; right:0; height:3px;
    background: linear-gradient(90deg, #6366f1, #06b6d4);
    opacity:0; transition: opacity .3s;
}
.card:hover { box-shadow: var(--shadow-card-h) !important; transform:translateY(-1px); }
.card:hover::before { opacity:1; }
.card-header {
    background: var(--clr-bg) !important;
    border-bottom: 1px solid var(--clr-border) !important;
    padding: 1rem 1.25rem !important;
}
.card-body { padding: 1.25rem !important; }
.card-footer {
    background: var(--clr-bg) !important;
    border-top: 1px solid var(--clr-border) !important;
    padding: 1rem 1.25rem !important;
}
.card-title {
    font-size: .9375rem !important; font-weight:700 !important;
    color: var(--clr-text) !important; margin-bottom:.25rem !important;
}
.card-description, .card-subtitle {
    font-size:.8125rem !important; color: var(--clr-muted) !important; margin-bottom:0 !important;
}

/* ═══════════════════════════════════════════════════════════
   TABLE
═══════════════════════════════════════════════════════════ */
.table {
    font-size:.8125rem !important; color: var(--clr-text) !important;
    border-collapse:separate !important; border-spacing:0 !important; width:100%;
}
.table thead tr { background: var(--clr-bg) !important; }
.table thead th {
    font-size:.6875rem !important; font-weight:700 !important;
    text-transform:uppercase !important; letter-spacing:.06em !important;
    color: var(--clr-muted) !important;
    border-bottom: 1px solid var(--clr-border) !important;
    padding:.75rem 1rem !important; white-space:nowrap;
    background: var(--clr-bg) !important;
}
.table tbody tr { background: transparent !important; transition: background .15s; }
.table tbody tr:hover { background: color-mix(in srgb, var(--clr-text) 3%, transparent) !important; }
.table tbody td {
    padding: 1rem 1.25rem !important;
    border-bottom: 1px solid var(--clr-border) !important;
    vertical-align: middle !important; color: var(--clr-text) !important;
    font-size: .875rem !important;
}
.table-striped tbody tr:nth-of-type(odd) { background: transparent !important; }
.table-responsive { overflow-x: auto !important; -webkit-overflow-scrolling: touch; border: none !important; box-shadow: none !important; border-radius: 0 !important; }

/* ═══════════════════════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════════════════════ */
.btn {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-weight:600 !important; font-size:.8125rem !important;
    border-radius: var(--radius-btn) !important;
    padding:.45rem .9rem !important;
    border:none !important;
    transition: all .2s cubic-bezier(.4,0,.2,1) !important;
    display:inline-flex; align-items:center; gap:.375rem;
    cursor:pointer; text-decoration:none !important;
    white-space:nowrap;
}
.btn:hover { transform:translateY(-1px); }
.btn:active { transform:translateY(0) scale(.98); }
.btn-sm { padding:.3rem .65rem !important; font-size:.75rem !important; }
.btn-lg { padding:.65rem 1.2rem !important; font-size:.875rem !important; }

.btn-primary   { background:#4f46e5 !important; color:#fff !important; box-shadow:0 4px 12px -2px rgba(79,70,229,.4) !important; }
.btn-primary:hover   { background:#4338ca !important; box-shadow:0 6px 16px -2px rgba(79,70,229,.5) !important; }
.btn-success   { background:#10b981 !important; color:#fff !important; box-shadow:0 4px 12px -2px rgba(16,185,129,.35) !important; }
.btn-success:hover   { background:#059669 !important; }
.btn-danger    { background:#ef4444 !important; color:#fff !important; box-shadow:0 4px 12px -2px rgba(239,68,68,.35) !important; }
.btn-danger:hover    { background:#dc2626 !important; }
.btn-warning   { background:#f59e0b !important; color:#fff !important; box-shadow:0 4px 12px -2px rgba(245,158,11,.35) !important; }
.btn-warning:hover   { background:#d97706 !important; }
.btn-info      { background:#06b6d4 !important; color:#fff !important; box-shadow:0 4px 12px -2px rgba(6,182,212,.35) !important; }
.btn-info:hover      { background:#0891b2 !important; }
.btn-secondary { background:#64748b !important; color:#fff !important; }
.btn-secondary:hover { background:#475569 !important; }
.btn-light, .btn-otline-dark {
    background: var(--clr-bg) !important; color: var(--clr-text) !important;
    border:1px solid var(--clr-border) !important; box-shadow:none !important;
}
.btn-light:hover, .btn-otline-dark:hover { background: var(--clr-border) !important; transform:translateY(-1px); }
.btn-dark { background:#0f172a !important; color:#fff !important; }
.btn-dark:hover { background:#1e293b !important; }
.btn-block { width:100%; justify-content:center; }
.btn-icon-text { gap:.5rem; }
.btn-icon-prepend { font-size:1.1em; }
.auth-form-btn { width:100%; justify-content:center; }

/* ═══════════════════════════════════════════════════════════
   BADGE
═══════════════════════════════════════════════════════════ */
.badge {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-weight:600 !important; font-size:.6875rem !important;
    border-radius:9999px !important; padding:.25rem .625rem !important;
    letter-spacing:.03em; display:inline-flex; align-items:center; gap:.25rem;
}
.badge-primary,.bg-primary    { background:#e0e7ff !important; color:#4f46e5 !important; }
.badge-success,.bg-success    { background:#d1fae5 !important; color:#059669 !important; }
.badge-danger,.bg-danger      { background:#fee2e2 !important; color:#dc2626 !important; }
.badge-warning,.bg-warning    { background:#fef3c7 !important; color:#d97706 !important; }
.badge-info,.bg-info          { background:#cffafe !important; color:#0891b2 !important; }
.badge-secondary              { background:#f1f5f9 !important; color:#475569 !important; }
/* StarAdmin custom badge classes */
.badge-opacity-success { background:rgba(16,185,129,.15) !important; color:#059669 !important; border-radius:9999px !important; padding:.25rem .625rem !important; font-size:.6875rem !important; font-weight:600 !important; }
.badge-opacity-danger  { background:rgba(239,68,68,.15)  !important; color:#dc2626 !important; border-radius:9999px !important; padding:.25rem .625rem !important; font-size:.6875rem !important; font-weight:600 !important; }
.badge-opacity-warning { background:rgba(245,158,11,.15) !important; color:#d97706 !important; border-radius:9999px !important; padding:.25rem .625rem !important; font-size:.6875rem !important; font-weight:600 !important; }
.badge-opacity-info    { background:rgba(6,182,212,.15)  !important; color:#0891b2 !important; border-radius:9999px !important; padding:.25rem .625rem !important; font-size:.6875rem !important; font-weight:600 !important; }

/* ═══════════════════════════════════════════════════════════
   FORMS
═══════════════════════════════════════════════════════════ */
.form-control, .form-select, select.form-control {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-size:.875rem !important;
    border:1px solid var(--clr-border) !important;
    border-radius: var(--radius-input) !important;
    padding:.55rem .875rem !important;
    background: var(--clr-surface) !important;
    color: var(--clr-text) !important;
    transition: border-color .2s, box-shadow .2s !important;
    line-height:1.5; width:100%;
    appearance:none; -webkit-appearance:none;
}
.form-control:focus, .form-select:focus, select.form-control:focus {
    border-color:#6366f1 !important;
    box-shadow:0 0 0 3px rgba(99,102,241,.15) !important;
    background: var(--clr-surface) !important;
    outline:none !important;
}
.form-control.is-invalid, select.form-control.is-invalid { border-color:#ef4444 !important; }
.form-control[readonly], .form-control:disabled {
    background: var(--clr-bg) !important; cursor:default;
}
.form-control-lg { padding:.65rem 1rem !important; font-size:.9375rem !important; }

.form-label { display:block !important; }
.form-label, .col-form-label {
    font-size:.8125rem !important; font-weight:600 !important;
    color: var(--clr-muted) !important; margin-bottom:.375rem !important;
}
.form-text, .text-muted {
    font-size:.75rem !important; color: var(--clr-muted) !important;
}

/* form-group spacing */
.form-group { margin-bottom:1.25rem !important; }
.form-group.row { align-items:flex-start; }

/* Textarea */
textarea.form-control { resize:vertical; min-height:100px; }

/* input-group */
.input-group { display:flex; align-items:stretch; position:relative; }
.input-group .form-control { border-radius: var(--radius-input) !important; }
.input-group > :not(:last-child) > .form-control { border-top-right-radius:0 !important; border-bottom-right-radius:0 !important; }
.input-group > :not(:first-child) > .form-control { border-top-left-radius:0 !important; border-bottom-left-radius:0 !important; margin-left:-1px; }
.input-group-text {
    display:flex; align-items:center; padding:.5rem .75rem;
    background: var(--clr-bg); border:1px solid var(--clr-border);
    border-radius: var(--radius-input); color: var(--clr-muted); font-size:.875rem;
}
.btn-outline-secondary {
    background: var(--clr-surface) !important; color: var(--clr-muted) !important;
    border:1px solid var(--clr-border) !important; border-radius: var(--radius-btn) !important;
    padding:.45rem .75rem !important; transition:all .2s !important;
}
.btn-outline-secondary:hover { background: var(--clr-bg) !important; color: var(--clr-text) !important; }

/* ═══════════════════════════════════════════════════════════
   CHECKBOX & RADIO — Premium Style
═══════════════════════════════════════════════════════════ */
.form-check {
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    padding-left: 0 !important;
    margin-bottom: 0.375rem;
}
.form-check-input {
    flex-shrink: 0 !important;
    width: 1.1rem !important;
    height: 1.1rem !important;
    margin-top: 0 !important;
    margin-left: 0 !important;
    border: 1.5px solid var(--clr-border) !important;
    border-radius: 0.25rem !important;
    cursor: pointer !important;
    transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease !important;
}
.form-check-input:checked {
    background-color: #4f46e5 !important;
    border-color: #4f46e5 !important;
}
.form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.18) !important;
    outline: none !important;
    border-color: #4f46e5 !important;
}
.form-check-label {
    font-size: 0.875rem !important;
    color: var(--clr-text) !important;
    cursor: pointer !important;
    margin-bottom: 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    padding-left: 0 !important;
    line-height: 1.4 !important;
}
/* Support legacy: input inside label */
.form-check-label > .form-check-input { margin-left: 0 !important; }

/* ═══════════════════════════════════════════════════════════
   TOGGLE SWITCH — iOS-style, Bulletproof
   Uses background shorthand to override Bootstrap vendor CSS completely
═══════════════════════════════════════════════════════════ */
.form-switch {
    padding-left: 0 !important;
    gap: 0.6rem !important;
}
/* The knob SVG - white circle */
:root {
    --switch-knob: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3E%3Ccircle r='3' fill='%23ffffff'/%3E%3C/svg%3E");
    --switch-off-color: #94a3b8;
    --switch-on-color: #10b981;
}
/* Override bootstrap vendor with explicit background shorthand */
.form-switch .form-check-input,
.form-switch .form-check-input[type="checkbox"] {
    width: 2.75rem !important;
    height: 1.4rem !important;
    border-radius: 999px !important;
    border: none !important;
    cursor: pointer !important;
    padding: 0 !important;
    /* background shorthand: image position/size repeat attachment origin clip color */
    background: var(--switch-knob) left 2px center / calc(1.4rem - 4px) no-repeat var(--switch-off-color) !important;
    transition: background-color 0.25s ease, background-position 0.25s ease !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    flex-shrink: 0 !important;
    /* reset checkbox size overrides */
    margin-left: 0 !important;
    margin-top: 0 !important;
}
.form-switch .form-check-input:checked,
.form-switch .form-check-input[type="checkbox"]:checked {
    background: var(--switch-knob) right 2px center / calc(1.4rem - 4px) no-repeat var(--switch-on-color) !important;
}
.form-switch .form-check-input:focus,
.form-switch .form-check-input[type="checkbox"]:focus {
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25) !important;
    outline: none !important;
}

/* ═══════════════════════════════════════════════════════════
   ALERT
═══════════════════════════════════════════════════════════ */
.alert {
    font-size:.8125rem !important; border-radius:.625rem !important;
    border:none !important; padding:.75rem 1rem !important; font-weight:500;
    display:flex; align-items:flex-start; gap:.5rem;
}
.alert-success { background:#d1fae5 !important; color:#065f46 !important; }
.alert-danger  { background:#fee2e2 !important; color:#991b1b !important; }
.alert-warning { background:#fef3c7 !important; color:#92400e !important; }
.alert-info    { background:#cffafe !important; color:#164e63 !important; }

/* ═══════════════════════════════════════════════════════════
   NAV TABS (in-content)
═══════════════════════════════════════════════════════════ */
.nav-tabs { 
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 1.5rem !important;
    list-style: none !important;
    padding-left: 0 !important;
    border-bottom: 1px solid var(--clr-border) !important; 
    margin-bottom: 1.5rem !important; 
}
.nav-tabs .nav-item { margin-bottom: -1px !important; }
.nav-tabs .nav-link {
    font-size: .875rem !important; 
    font-weight: 600 !important;
    color: var(--clr-muted) !important; 
    border: none !important;
    border-bottom: 2px solid transparent !important; 
    border-radius: 0 !important;
    padding: .75rem 0 !important; 
    transition: all .2s cubic-bezier(.4,0,.2,1) !important; 
    background: transparent !important;
    display: flex !important;
    align-items: center !important;
    gap: .5rem !important;
}
.nav-tabs .nav-link:hover { color: var(--clr-text) !important; border-bottom-color: var(--clr-border) !important; }
.nav-tabs .nav-link.active {
    color: #4f46e5 !important; 
    border-bottom-color: #4f46e5 !important;
    font-weight: 700 !important; 
}

/* Tab content */
.tab-content > .tab-pane { display:none; }
.tab-content > .active    { display:block; }

/* ═══════════════════════════════════════════════════════════
   DATATABLES — FULL RESTYLE
═══════════════════════════════════════════════════════════ */
/* Wrapper */
.dataTables_wrapper {
    font-size:.8125rem !important;
    color: var(--clr-text) !important;
}

/* Bootstrap 5 DataTables Row Flex Layout Fix */
.dataTables_wrapper .row:first-child {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    margin-bottom: 1.25rem !important;
    row-gap: 0.75rem !important;
}

.dataTables_wrapper .row:last-child {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    margin-top: 1rem !important;
    row-gap: 0.75rem !important;
}

.dataTables_wrapper .dataTables_filter {
    text-align: right !important;
    float: right !important;
    margin-bottom: 0 !important;
}

.dataTables_wrapper .dataTables_length {
    float: left !important;
    margin-bottom: 0 !important;
}

.dataTables_wrapper .dataTables_filter label {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    font-weight: 600 !important;
    color: var(--clr-muted) !important;
    font-size: 0.8125rem !important;
    margin-bottom: 0 !important;
}

.dataTables_wrapper .dataTables_length label {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    font-weight: 600 !important;
    color: var(--clr-muted) !important;
    font-size: 0.8125rem !important;
    margin-bottom: 0 !important;
}

.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-size: 0.875rem !important;
    border: 1px solid var(--clr-border) !important;
    border-radius: var(--radius-input) !important;
    padding: 0.45rem 0.85rem !important;
    background: var(--clr-bg) !important;
    color: var(--clr-text) !important;
    transition: border-color .2s, box-shadow .2s !important;
    outline: none !important;
}

.dataTables_wrapper .dataTables_filter input:focus,
.dataTables_wrapper .dataTables_length select:focus {
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, .12) !important;
}


/* Info */
.dataTables_wrapper .dataTables_info {
    font-size:.8125rem !important; color: var(--clr-muted) !important; padding-top:.5rem; font-weight:500;
}

/* Pagination */
.dataTables_wrapper .dataTables_paginate { padding-top:.5rem; }
.dataTables_wrapper .pagination { 
    display:flex !important; 
    flex-wrap:wrap !important; 
    gap:.35rem !important; 
    margin-bottom:0 !important; 
    padding-left:0 !important; 
    list-style:none !important; 
}
.dataTables_wrapper .pagination .page-link {
    font-size:.8125rem !important; border-radius:6px !important;
    border:1px solid transparent !important;
    color: var(--clr-text) !important; background: transparent !important;
    padding:.35rem .7rem !important; font-weight:600 !important;
    transition:all .2s cubic-bezier(.4,0,.2,1) !important;
    min-width:32px; text-align:center; display:inline-flex; align-items:center; justify-content:center;
}
.dataTables_wrapper .pagination .page-item { margin:0 !important; padding:0 !important; }
.dataTables_wrapper .pagination .page-link:hover {
    background: var(--clr-bg) !important; color: var(--clr-text) !important;
    transform:translateY(-1px);
}
.dataTables_wrapper .pagination .page-item.active .page-link {
    background:#4f46e5 !important; border-color:#4f46e5 !important; color:#fff !important;
    box-shadow:0 4px 12px -3px rgba(79,70,229,.4) !important;
    transform:translateY(-1px);
}
.dataTables_wrapper .pagination .page-item.disabled .page-link { 
    opacity:.4; background:transparent !important; color: var(--clr-muted) !important; 
    transform:none; cursor:not-allowed;
}

/* Sorting icons override (fix invisible icons in dark mode) */
table.dataTable>thead>tr>th.sorting, 
table.dataTable>thead>tr>th.sorting_asc, 
table.dataTable>thead>tr>th.sorting_desc {
    padding-right: 1.5rem !important;
}
table.dataTable>thead>tr>th.sorting::before,
table.dataTable>thead>tr>th.sorting::after,
table.dataTable>thead>tr>th.sorting_asc::before,
table.dataTable>thead>tr>th.sorting_asc::after,
table.dataTable>thead>tr>th.sorting_desc::before,
table.dataTable>thead>tr>th.sorting_desc::after {
    display: none !important; /* Disable bootstrap 5 built-in arrows */
}

table.dataTable thead th { position:relative; cursor:pointer; }
table.dataTable thead th.sorting::after { content:"\2195"; position:absolute; right:10px; opacity:0.3; }
table.dataTable thead th.sorting_asc::after { content:"\2191"; position:absolute; right:10px; opacity:0.8; color:#6366f1; }
table.dataTable thead th.sorting_desc::after { content:"\2193"; position:absolute; right:10px; opacity:0.8; color:#6366f1; }

/* Table borders */
.table-responsive {
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
}
.table { margin-bottom: 0 !important; width: 100% !important; border-collapse: collapse !important; }
.table thead th {
    background: transparent !important;
    border-bottom: 1px solid var(--clr-border) !important;
    color: var(--clr-muted) !important;
    font-size: .75rem !important; 
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: .05em !important;
    padding: 1rem 1.25rem !important;
}
.table tbody td {
    border-bottom: 1px solid var(--clr-border) !important;
}
.table tbody tr:last-child td { border-bottom: none !important; }

/* ═══════════════════════════════════════════════════════════
   SELECT2 — LIGHT THEME
═══════════════════════════════════════════════════════════ */
.select2-container .select2-selection--single {
    height:44px !important;
    border:1px solid var(--clr-border) !important;
    border-radius: var(--radius-input) !important;
    background: var(--clr-surface) !important;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--clr-text) !important; line-height:44px !important;
    padding-left:1rem !important; font-size:.875rem !important;
}
.select2-container--default .select2-selection--single .select2-selection__arrow { height:42px !important; }
.select2-container--default.select2-container--focus .select2-selection--single {
    border-color:#6366f1 !important; box-shadow:0 0 0 3px rgba(99,102,241,.15) !important;
}
.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: var(--clr-muted) !important;
}
.select2-dropdown {
    border:1px solid var(--clr-border) !important;
    border-radius: var(--radius-card) !important;
    box-shadow: var(--shadow-card-h) !important;
    background: var(--clr-surface) !important;
    overflow:hidden;
}
.select2-results__option { color: var(--clr-text) !important; font-size:.875rem !important; padding:.5rem 1rem !important; }
.select2-container--default .select2-results__option--highlighted {
    background:#6366f1 !important; color:#fff !important;
}
.select2-search__field {
    border:1px solid var(--clr-border) !important;
    border-radius: var(--radius-input) !important;
    padding:.4rem .75rem !important; font-size:.875rem !important;
    background: var(--clr-bg) !important; color: var(--clr-text) !important;
}
.select2-search__field:focus { outline:none !important; border-color:#6366f1 !important; }

/* ═══════════════════════════════════════════════════════════
   UTILITY CLASSES (Bootstrap compat)
═══════════════════════════════════════════════════════════ */
.d-flex        { display:flex !important; }
.d-inline      { display:inline !important; }
.d-inline-flex { display:inline-flex !important; }
.d-block       { display:block !important; }
.d-none        { display:none !important; }
.d-grid        { display:grid !important; }
.gap-2         { gap:.5rem !important; }
.gap-3         { gap:.75rem !important; }
.gap-4         { gap:1rem !important; }
.align-items-center   { align-items:center !important; }
.align-items-start    { align-items:flex-start !important; }
.justify-content-between { justify-content:space-between !important; }
.justify-content-center  { justify-content:center !important; }
.justify-content-end     { justify-content:flex-end !important; }
.flex-grow     { flex:1 1 auto !important; }
.flex-column   { flex-direction:column !important; }
.w-100         { width:100% !important; }
.h-100         { height:100% !important; }
.ms-auto       { margin-left:auto !important; }
.me-auto       { margin-right:auto !important; }
.mx-auto       { margin-left:auto !important; margin-right:auto !important; }
.mx-0          { margin-left:0 !important; margin-right:0 !important; }
.mb-0          { margin-bottom:0 !important; }
.mb-1          { margin-bottom:.25rem !important; }
.mb-2          { margin-bottom:.5rem !important; }
.mb-3          { margin-bottom:.75rem !important; }
.mb-4          { margin-bottom:1rem !important; }
.mb-5          { margin-bottom:1.5rem !important; }
.mt-1          { margin-top:.25rem !important; }
.mt-2          { margin-top:.5rem !important; }
.mt-3          { margin-top:.75rem !important; }
.mt-4          { margin-top:1rem !important; }
.mt-5          { margin-top:1.5rem !important; }
.me-0          { margin-right:0 !important; }
.me-1          { margin-right:.25rem !important; }
.me-2          { margin-right:.5rem !important; }
.me-3          { margin-right:.75rem !important; }
.me-4          { margin-right:1rem !important; }
.ms-1          { margin-left:.25rem !important; }
.ms-2          { margin-left:.5rem !important; }
.ms-3          { margin-left:.75rem !important; }
.pb-4          { padding-bottom:1rem !important; }
.pt-3          { padding-top:.75rem !important; }
.pt-4          { padding-top:1rem !important; }
.ps-0          { padding-left:0 !important; }
.ps-4          { padding-left:1rem !important; }
.px-0          { padding-left:0 !important; padding-right:0 !important; }
.py-2          { padding-top:.5rem !important; padding-bottom:.5rem !important; }
.p-0           { padding:0 !important; }
.p-2           { padding:.5rem !important; }
.p-3           { padding:.75rem !important; }
.p-4           { padding:1rem !important; }
.text-center   { text-align:center !important; }
.text-start    { text-align:left !important; }
.text-end      { text-align:right !important; }
.text-muted    { color: var(--clr-muted) !important; }
.text-dark     { color: var(--clr-text) !important; }
.text-white    { color:#fff !important; }
.text-primary  { color:#6366f1 !important; }
.text-success  { color:#059669 !important; }
.text-danger   { color:#ef4444 !important; }
.text-warning  { color:#d97706 !important; }
.text-info     { color:#0891b2 !important; }
.text-small,.small { font-size:.75rem !important; }
.fw-bold       { font-weight:700 !important; }
.fw-semibold   { font-weight:600 !important; }
.fw-medium     { font-weight:500 !important; }
.fw-light      { font-weight:300 !important; }
.fs-3          { font-size:1.5rem !important; }
.border-bottom { border-bottom:1px solid var(--clr-border) !important; }
.border-top    { border-top:1px solid var(--clr-border) !important; }
.border-0      { border:none !important; }
.rounded       { border-radius: var(--radius-btn) !important; }
.rounded-circle { border-radius:9999px !important; }
.shadow-sm     { box-shadow:0 1px 4px rgba(0,0,0,.07) !important; }
.shadow        { box-shadow:0 4px 12px rgba(0,0,0,.09) !important; }
.bg-light      { background: var(--clr-bg) !important; }
.bg-white      { background:#fff !important; }
.overflow-hidden { overflow:hidden !important; }
.position-relative { position:relative !important; }
.position-absolute { position:absolute !important; }
.min-vh-100 { min-height:100vh !important; }
.vh-100 { height:100vh !important; }
.text-decoration-none { text-decoration:none !important; }
.cursor-pointer { cursor:pointer !important; }
.max-width-progress-wrap { max-width:140px; }

/* Progress bar */
.progress { height:.5rem; background: var(--clr-bg); border-radius:9999px; overflow:hidden; }
.progress-bar { height:100%; border-radius:9999px; transition:width .4s ease; }
.bg-success .progress-bar, .progress-bar.bg-success { background:#10b981 !important; }
.progress-bar.bg-warning { background:#f59e0b !important; }
.progress-bar.bg-danger  { background:#ef4444 !important; }

/* Dropdown */
.dropdown { position:relative; }
.dropdown-menu {
    position:absolute; top:calc(100% + .25rem); right:0; z-index:1000;
    min-width:160px; background: var(--clr-surface);
    border:1px solid var(--clr-border); border-radius: var(--radius-card);
    box-shadow: var(--shadow-card-h); padding:.5rem 0;
    display:none; font-size:.8125rem;
}
.dropdown-menu.show { display:block; animation:fadeDown .2s ease; }
@keyframes fadeDown { from{opacity:0;transform:translateY(-6px)} to{opacity:1;transform:translateY(0)} }
.dropdown-item {
    display:block; padding:.5rem 1rem; color: var(--clr-text) !important;
    text-decoration:none; transition:background .15s;
}
.dropdown-item:hover { background: var(--clr-bg) !important; }
.dropdown-header { font-size:.6875rem; font-weight:700; text-transform:uppercase; letter-spacing:.05em; color: var(--clr-muted) !important; padding:.5rem 1rem; }
.dropdown-divider { border-top:1px solid var(--clr-border); margin:.25rem 0; }

/* toggle btn */
.toggle-dark, .btn-light.dropdown-toggle {
    background: var(--clr-bg) !important; border:1px solid var(--clr-border) !important;
    color: var(--clr-text) !important; border-radius: var(--radius-btn) !important;
    font-size:.8125rem !important; font-weight:600 !important;
    padding:.45rem .9rem !important;
}

/* invalid-feedback */
.invalid-feedback { font-size:.75rem !important; color:#ef4444 !important; display:block; margin-top:.25rem; }
.is-invalid ~ .invalid-feedback { display:block; }

/* ═══════════════════════════════════════════════════════════
   SELECT2 — GLOBAL OVERRIDES
═══════════════════════════════════════════════════════════ */
.select2-container .select2-selection--single {
    height: auto !important;
    min-height: 42px !important;
    padding: .35rem .875rem !important;
    font-size: .875rem !important;
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    border: 1px solid var(--clr-border) !important;
    border-radius: var(--radius-input) !important;
    background: var(--clr-surface) !important;
    color: var(--clr-text) !important;
    display: flex !important;
    align-items: center !important;
    transition: border-color .2s, box-shadow .2s !important;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 1.5 !important;
    padding: 0 !important;
    color: var(--clr-text) !important;
    font-weight: 500;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 100% !important;
    right: 12px !important;
    display: flex !important;
    align-items: center !important;
}
.select2-dropdown {
    border: 1px solid var(--clr-border) !important;
    border-radius: var(--radius-input) !important;
    background: var(--clr-surface) !important;
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.1) !important;
    padding: .25rem 0 !important;
    overflow: hidden;
}
.select2-search__field {
    border: 1px solid var(--clr-border) !important;
    border-radius: 4px !important;
    background: var(--clr-bg) !important;
    color: var(--clr-text) !important;
    padding: .4rem .75rem !important;
    outline: none !important;
}
.select2-search__field:focus {
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,.15) !important;
}
.select2-results__option {
    padding: .5rem 1rem !important;
    font-size: .875rem !important;
    color: var(--clr-text) !important;
    transition: background .15s !important;
}
.select2-container--default .select2-results__option--highlighted[aria-selected],
.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
    background-color: #4f46e5 !important;
    color: white !important;
}
.select2-container--default .select2-results__option[aria-selected="true"] {
    background-color: var(--clr-bg) !important;
    color: var(--clr-text) !important;
    font-weight: 600 !important;
}

/* ═══════════════════════════════════════════════════════════
   DARK MODE — CONTENT OVERRIDES
═══════════════════════════════════════════════════════════ */
.dark .card             { background: var(--clr-surface) !important; border-color: var(--clr-border) !important; }
.dark .card-header, .dark .card-footer { background: var(--clr-bg) !important; border-color: var(--clr-border) !important; }
.dark .card-title       { color: var(--clr-text) !important; }
.dark .card-description { color: var(--clr-muted) !important; }
.dark .table thead tr   { background: transparent !important; }
.dark .table thead th   { color: var(--clr-muted) !important; border-bottom: 1px solid var(--clr-border) !important; background: transparent !important; }
.dark .table tbody tr   { background: transparent !important; }
.dark .table tbody tr:hover { background: color-mix(in srgb, var(--clr-text) 5%, transparent) !important; }
.dark .table tbody td   { border-color: var(--clr-border) !important; color: var(--clr-text) !important; border-bottom: 1px solid var(--clr-border) !important; }
.dark .table-responsive { border: none !important; box-shadow: none !important; }
.dark .form-control, .dark .form-select, .dark select.form-control {
    background: var(--clr-bg) !important; border-color: var(--clr-border) !important; color: var(--clr-text) !important;
}
.dark .form-control:focus, .dark .form-select:focus { background: var(--clr-surface) !important; }
.dark .form-label, .dark .col-form-label { color: var(--clr-muted) !important; }
.dark .alert-success { background:rgba(6,95,70,.3) !important;  color:#6ee7b7 !important; }
.dark .alert-danger  { background:rgba(153,27,27,.3) !important; color:#fca5a5 !important; }
.dark .btn-light, .dark .btn-otline-dark { background: var(--clr-bg) !important; color: var(--clr-text) !important; border-color: var(--clr-border) !important; }
.dark .bg-light { background: var(--clr-bg) !important; }
.dark .bg-white { background: var(--clr-surface) !important; }
.dark .dropdown-menu  { background: var(--clr-surface) !important; border-color: var(--clr-border) !important; }
.dark .dropdown-item:hover { background: var(--clr-bg) !important; }
.dark .nav-tabs       { border-color: var(--clr-border) !important; }
.dark .nav-tabs .nav-link.active { color: #818cf8 !important; border-bottom-color: #818cf8 !important; }
.dark .border-bottom, .dark .border-top { border-color: var(--clr-border) !important; }
.dark .dataTables_wrapper .dataTables_filter input,
.dark .dataTables_wrapper .dataTables_length select {
    background: var(--clr-bg) !important; border-color: var(--clr-border) !important; color: var(--clr-text) !important;
}
.dark .dataTables_wrapper .pagination .page-link:hover {
    background: var(--clr-bg) !important; color: var(--clr-text) !important;
}
.dark .dataTables_wrapper .pagination .page-item.active .page-link {
    background:#4f46e5 !important; border-color:#4f46e5 !important; color:#fff !important;
    box-shadow:0 4px 12px -3px rgba(79,70,229,.6) !important;
}
.dark .select2-container .select2-selection--single {
    background: var(--clr-bg) !important; border-color: var(--clr-border) !important;
}
.dark .select2-container--default .select2-selection--single .select2-selection__rendered { color: var(--clr-text) !important; }
.dark .select2-dropdown { background: var(--clr-surface) !important; border-color: var(--clr-border) !important; }
.dark .select2-results__option { color: var(--clr-text) !important; }
.dark .select2-search__field { background: var(--clr-bg) !important; color: var(--clr-text) !important; border-color: var(--clr-border) !important; }
.dark .form-check-input:not(.form-switch .form-check-input) { background-color: rgba(30,41,59,0.8) !important; border-color: var(--clr-border) !important; }
/* Dark mode: switch unchecked uses slate-600, checked stays green */
.dark .form-switch .form-check-input,
.dark .form-switch .form-check-input[type="checkbox"] {
    background: var(--switch-knob) left 2px center / calc(1.4rem - 4px) no-repeat #475569 !important;
}
.dark .form-switch .form-check-input:checked,
.dark .form-switch .form-check-input[type="checkbox"]:checked {
    background: var(--switch-knob) right 2px center / calc(1.4rem - 4px) no-repeat #10b981 !important;
}
.dark .toggle-dark, .dark .btn-light.dropdown-toggle {
    background: var(--clr-surface) !important; border-color: var(--clr-border) !important; color: var(--clr-text) !important;
}
.dark .input-group-text { background: var(--clr-bg) !important; border-color: var(--clr-border) !important; color: var(--clr-muted) !important; }

/* ═══════════════════════════════════════════════════════════
   AUTH PAGES SPECIAL OVERRIDES
   (app_auth / blank layout — dark backgrounds)
═══════════════════════════════════════════════════════════ */
.auth-form-light { /* legacy StarAdmin class — neutralize */ }

/* ═══════════════════════════════════════════════════════════
   GLASSMORPHISM UTILS
═══════════════════════════════════════════════════════════ */
.glass-card {
    background: rgba(255,255,255,.08) !important;
    backdrop-filter:blur(12px); -webkit-backdrop-filter:blur(12px);
    border:1px solid rgba(255,255,255,.12) !important;
}
.glass-header {
    background: rgba(255,255,255,.85);
    backdrop-filter:blur(12px); -webkit-backdrop-filter:blur(12px);
}
.dark .glass-header { background: rgba(15,23,42,.88); }

/* ═══════════════════════════════════════════════════════════
   GRID MARGIN (StarAdmin compat)
═══════════════════════════════════════════════════════════ */
.grid-margin        { margin-bottom:1.5rem; }
.grid-margin-sm-0   { margin-bottom:0; }
.stretch-card       { display:flex; flex-direction:column; }
.stretch-card > .card { flex:1; }

/* ═══════════════════════════════════════════════════════════
   NAVBAR — NOTIFICATION HOVER POLISH
═══════════════════════════════════════════════════════════ */

/* Notification trigger button ring on hover */
.notif-trigger:hover {
    box-shadow: 0 0 0 6px rgba(99,102,241,.08);
}

/* Notification item: smooth left-border reveal */
.notif-item {
    position: relative;
}
.notif-item:hover {
    padding-left: calc(1rem - 2px); /* compensate for border-left showing */
}

/* ═══════════════════════════════════════════════════════════
   NAVBAR — THEME TOGGLE PILL POLISH
═══════════════════════════════════════════════════════════ */

/* Pill focus ring glow */
.theme-toggle-pill:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(99,102,241,.35);
}

/* Icon transition inside the pill */
.theme-toggle-pill .material-symbols-outlined {
    transition: transform 0.4s cubic-bezier(.34,1.56,.64,1), opacity 0.25s ease;
}

/* Subtle scale on button hover */
.theme-toggle-pill:hover .material-symbols-outlined {
    transform: scale(1.15);
}

