/* ================================================================
   StayAudit  -  Medishine-style admin theme  (Phase 8.2 refresh)
   Layered on Tabler / Bootstrap 5
   ================================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --sa-primary:       #2563eb;
    --sa-primary-dark:  #1d4ed8;
    --sa-primary-soft:  #dbeafe;
    --sa-success:       #10b981;
    --sa-warning:       #f59e0b;
    --sa-danger:        #ef4444;
    --sa-info:          #06b6d4;
    --sa-violet:        #8b5cf6;

    --sa-bg:            #f4f6fb;
    --sa-surface:       #ffffff;
    --sa-border:        #e6e8ee;
    --sa-border-soft:   #eef0f5;
    --sa-muted:         #64748b;
    --sa-ink:           #0f172a;
    --sa-ink-soft:      #1e293b;

    --r-sm: 8px;  --r-md: 12px;  --r-lg: 16px;  --r-xl: 20px;

    --sh-1: 0 1px 2px rgba(15, 23, 42, .04), 0 1px 3px rgba(15, 23, 42, .06);
    --sh-2: 0 4px 6px -1px rgba(15, 23, 42, .07), 0 2px 4px -2px rgba(15, 23, 42, .05);
    --sh-3: 0 10px 25px -3px rgba(15, 23, 42, .08), 0 4px 6px -4px rgba(15, 23, 42, .05);
    --sh-brand: 0 4px 14px rgba(37, 99, 235, .25);
}

html, body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    background: var(--sa-bg);
    color: var(--sa-ink-soft);
    -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar             { width: 10px; height: 10px; }
::-webkit-scrollbar-track       { background: transparent; }
::-webkit-scrollbar-thumb       { background: #d4d8e0; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #b0b6c2; }

/* ================================================================
   PAGE LAYOUT
   ================================================================ */
.page, .page-wrapper            { background: var(--sa-bg); }
.page-body                      { padding: .35rem 0 1.5rem; }
.page-header                    { background: transparent !important; padding: .65rem 0 .65rem; border: 0; margin: 0; }
.page-header .page-pretitle {
    font-size: .68rem; text-transform: uppercase;
    letter-spacing: .08em; color: #94a3b8; font-weight: 700; margin-bottom: .15rem;
}
.page-title { font-weight: 700; font-size: 1.5rem; color: var(--sa-ink); letter-spacing: -.5px; line-height: 1.2; margin: 0; }
.page-subtitle { font-size: .85rem; color: var(--sa-muted); margin-top: .15rem; max-width: 720px; }
.container-xl { max-width: 1480px; padding-left: 1.75rem; padding-right: 1.75rem; }

/* ================================================================
   TOP HEADER
   ================================================================ */
.navbar.navbar-expand-md {
    background: var(--sa-surface) !important;
    border-bottom: 1px solid var(--sa-border-soft);
    height: 68px; padding: 0 1.75rem;
}
.topbar-search { flex: 1; max-width: 380px; position: relative; }
.topbar-search input {
    width: 100%; padding: .6rem .85rem .6rem 2.5rem;
    border-radius: 10px; border: 1px solid transparent;
    background: #f4f6fb; font-size: .9rem; color: var(--sa-ink-soft);
    transition: all .15s ease;
}
.topbar-search input::placeholder { color: #94a3b8; }
.topbar-search input:focus {
    background: var(--sa-surface); border-color: var(--sa-primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .10); outline: none;
}
.topbar-search i {
    position: absolute; left: .9rem; top: 50%; transform: translateY(-50%);
    color: #94a3b8; font-size: 1.05rem; pointer-events: none;
}

.topbar-btn {
    width: 40px; height: 40px; border-radius: 10px;
    display: inline-flex; align-items: center; justify-content: center;
    color: #64748b; position: relative; cursor: pointer;
    transition: all .15s ease; text-decoration: none;
    background: transparent; border: 0;
}
.topbar-btn:hover { background: #f1f5f9; color: var(--sa-primary); }
.topbar-btn i { font-size: 1.2rem; }
.topbar-btn .dot {
    position: absolute; top: 9px; right: 9px;
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--sa-danger); border: 2px solid var(--sa-surface);
}
.topbar-divider { width: 1px; height: 28px; background: var(--sa-border-soft); margin: 0 .25rem; }

.topbar-user {
    display: flex; align-items: center; gap: .75rem;
    padding: .25rem .55rem .25rem .25rem; border-radius: 12px;
    cursor: pointer; transition: all .15s ease;
}
.topbar-user:hover { background: #f1f5f9; }
.topbar-user .avatar {
    width: 38px; height: 38px; border-radius: 10px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: #fff; font-weight: 600; font-size: 1.05rem;
    display: inline-flex; align-items: center; justify-content: center;
    box-shadow: var(--sh-1);
}
.topbar-user .name { font-weight: 600; color: var(--sa-ink); font-size: .92rem; line-height: 1.1; }
.topbar-user .role { font-size: .75rem; color: var(--sa-muted); margin-top: .15rem; }
.topbar-user i.ti-chevron-down { color: #94a3b8; font-size: 1rem; }

/* ================================================================
   SIDEBAR  (Medishine: white bg, colored icon tiles, section labels)
   ================================================================ */
.navbar-vertical {
    background: var(--sa-surface) !important;
    border-right: 1px solid var(--sa-border-soft);
    width: 260px;
}
.navbar-vertical .navbar-brand {
    padding: 1.15rem 1.25rem 1.05rem !important;
    border-bottom: 1px solid var(--sa-border-soft);
    margin: 0;
}
.navbar-vertical .navbar-brand a,
.navbar-vertical .navbar-brand a:hover { color: var(--sa-ink) !important; }

.navbar-vertical .navbar-nav { padding: .75rem .75rem 2rem; }

/* Section divider */
.navbar-vertical .nav-section {
    padding: 1rem .65rem .35rem;
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: #94a3b8;
    font-weight: 700;
    list-style: none;
}
.navbar-vertical .nav-section:first-child { padding-top: .25rem; }

.navbar-vertical .nav-item                    { margin: 1px 0; list-style: none; }
.navbar-vertical .nav-link {
    color: #475569 !important;
    font-weight: 500;
    font-size: .92rem;
    padding: .55rem .65rem !important;
    border-radius: 10px;
    transition: background .15s, color .15s;
    display: flex; align-items: center; gap: .65rem;
    position: relative;
}

/* Colored icon tile - the Medishine signature */
.navbar-vertical .nav-link-icon {
    width: 36px; height: 36px;
    border-radius: 10px;
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    margin: 0 !important;
    transition: all .2s ease;
    background: #f1f5f9;
    color: #64748b !important;
}
.navbar-vertical .nav-link-icon i { font-size: 1.05rem; line-height: 1; }
.navbar-vertical .nav-link-title  { font-weight: 500; }

/* Per-menu icon tone classes */
.icon-tone-blue    { background: #dbeafe !important; color: #1d4ed8 !important; }
.icon-tone-emerald { background: #d1fae5 !important; color: #047857 !important; }
.icon-tone-violet  { background: #ede9fe !important; color: #6d28d9 !important; }
.icon-tone-teal    { background: #ccfbf1 !important; color: #0f766e !important; }
.icon-tone-amber   { background: #fef3c7 !important; color: #b45309 !important; }
.icon-tone-rose    { background: #ffe4e6 !important; color: #be123c !important; }
.icon-tone-cyan    { background: #cffafe !important; color: #0e7490 !important; }
.icon-tone-slate   { background: #e2e8f0 !important; color: #334155 !important; }

/* Hover */
.navbar-vertical .nav-link:hover {
    background: #f8fafc;
    color: var(--sa-ink) !important;
}
.navbar-vertical .nav-link:hover .nav-link-icon { transform: scale(1.05); }

/* Active state - soft tinted bg + filled icon + left accent bar */
.navbar-vertical .nav-link.active,
.navbar-vertical .nav-item.active > .nav-link {
    background: linear-gradient(90deg, rgba(37,99,235,.08), rgba(37,99,235,.03));
    color: var(--sa-primary-dark) !important;
    font-weight: 600;
}
.navbar-vertical .nav-link.active::before,
.navbar-vertical .nav-item.active > .nav-link::before {
    content: '';
    position: absolute; left: -3px; top: 7px; bottom: 7px; width: 4px;
    border-radius: 4px;
    background: linear-gradient(180deg, #3b82f6, var(--sa-primary-dark));
}
.navbar-vertical .nav-link.active .nav-link-icon,
.navbar-vertical .nav-item.active > .nav-link .nav-link-icon {
    background: linear-gradient(135deg, #3b82f6, var(--sa-primary-dark)) !important;
    color: #fff !important;
    box-shadow: 0 4px 10px rgba(37, 99, 235, .35);
}

/* Dropdown menu inside sidebar */
.navbar-vertical .dropdown-toggle::after {
    margin-left: auto; color: #94a3b8;
    transition: transform .2s ease;
}
.navbar-vertical .show > .dropdown-toggle::after { transform: rotate(180deg); }
.navbar-vertical .dropdown-menu {
    position: relative !important; transform: none !important; top: 0 !important; left: 0 !important;
    border: 0; background: transparent;
    border-radius: 0; box-shadow: none;
    padding: .15rem 0 .15rem 3rem;
}
.navbar-vertical .dropdown-item {
    border-radius: 8px;
    padding: .45rem .75rem; font-weight: 500; font-size: .88rem;
    color: #64748b; transition: all .15s ease;
    display: flex; align-items: center; gap: .5rem;
    margin: 1px 0;
}
.navbar-vertical .dropdown-item:hover { background: #f1f5f9; color: var(--sa-ink); }
.navbar-vertical .dropdown-item.active { background: var(--sa-primary-soft); color: var(--sa-primary-dark); font-weight: 600; }
.navbar-vertical .dropdown-item .ti { font-size: .9rem; color: #94a3b8; }

/* ================================================================
   USER DROPDOWN MENU
   ================================================================ */
.dropdown-menu-end {
    border: 1px solid var(--sa-border-soft);
    border-radius: var(--r-md);
    box-shadow: var(--sh-3);
    padding: .35rem;
    margin-top: .35rem; min-width: 220px;
}
.dropdown-menu-end .dropdown-item {
    border-radius: var(--r-sm);
    font-weight: 500; padding: .55rem .75rem;
}

/* ================================================================
   CARDS
   ================================================================ */
.card {
    border: 1px solid var(--sa-border-soft);
    border-radius: var(--r-md);
    background: var(--sa-surface);
    box-shadow: var(--sh-1);
}
.card-header {
    background: transparent;
    border-bottom: 1px solid var(--sa-border-soft);
    padding: .9rem 1.25rem; min-height: auto;
}
.card-title { font-weight: 700; font-size: 1rem; color: var(--sa-ink); margin: 0; }
.card-body  { padding: 1.25rem; }
.card-footer{ background: transparent; border-top: 1px solid var(--sa-border-soft); padding: .85rem 1.25rem; }

/* KPI cards */
.kpi-card               { transition: transform .2s, box-shadow .2s; height: 100%; }
.kpi-card:hover         { transform: translateY(-3px); box-shadow: var(--sh-3); }
.kpi-card .card-body    {
    display: flex; align-items: center; gap: .9rem;
    padding: 1rem 1.2rem; min-height: 96px;
}
.kpi-icon {
    width: 50px; height: 50px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; flex-shrink: 0;
}
.kpi-icon i             { line-height: 1; font-size: 22px; }
.kpi-text               { flex: 1; min-width: 0; }
.kpi-label {
    font-size: .7rem; text-transform: uppercase; letter-spacing: .06em;
    color: var(--sa-muted); font-weight: 600; margin-bottom: .15rem;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; line-height: 1.2; min-height: 1.7em;
}
.kpi-value {
    font-size: 1.5rem; font-weight: 700; color: var(--sa-ink);
    line-height: 1.15; letter-spacing: -.5px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* Long currency values get a smaller font so they fit on one line */
#skpi-hotelspend, #kpi-hotelspend { font-size: 1.2rem; letter-spacing: -.3px; }

.kpi-icon.kpi-emerald { background: linear-gradient(135deg, #d1fae5, #a7f3d0); color: #047857; }
.kpi-icon.kpi-blue    { background: linear-gradient(135deg, #dbeafe, #bfdbfe); color: #1d4ed8; }
.kpi-icon.kpi-cyan    { background: linear-gradient(135deg, #cffafe, #a5f3fc); color: #0e7490; }
.kpi-icon.kpi-amber   { background: linear-gradient(135deg, #fef3c7, #fde68a); color: #b45309; }
.kpi-icon.kpi-rose    { background: linear-gradient(135deg, #ffe4e6, #fecdd3); color: #be123c; }
.kpi-icon.kpi-violet  { background: linear-gradient(135deg, #ede9fe, #ddd6fe); color: #6d28d9; }
.kpi-icon.kpi-teal    { background: linear-gradient(135deg, #ccfbf1, #99f6e4); color: #0f766e; }
.kpi-icon.kpi-slate   { background: linear-gradient(135deg, #e2e8f0, #cbd5e1); color: #334155; }

/* ================================================================
   BUTTONS
   ================================================================ */
.btn {
    border-radius: var(--r-sm);
    font-weight: 500; padding: .55rem 1.15rem;
    transition: all .15s ease; box-shadow: var(--sh-1);
}
.btn:hover { transform: translateY(-1px); }
.btn-sm    { padding: .35rem .75rem; font-size: .825rem; border-radius: 7px; }
.btn-lg    { padding: .8rem 1.5rem; font-size: 1.05rem; border-radius: var(--r-md); }
.btn-primary {
    background: linear-gradient(135deg, #3b82f6, var(--sa-primary-dark)) !important;
    border: 0 !important; color: #fff !important; box-shadow: var(--sh-brand);
}
.btn-primary:hover { box-shadow: 0 6px 18px rgba(37, 99, 235, .35); }
.btn-success { background: linear-gradient(135deg, #34d399, var(--sa-success)) !important; border: 0 !important; }
.btn-danger  { background: linear-gradient(135deg, #fb7185, var(--sa-danger))  !important; border: 0 !important; }
.btn-outline-primary { border: 1px solid #cbd5e1 !important; background: var(--sa-surface) !important; color: var(--sa-ink-soft) !important; }
.btn-outline-primary:hover { background: var(--sa-primary-soft) !important; border-color: var(--sa-primary) !important; color: var(--sa-primary-dark) !important; }
.btn-outline-secondary, .btn-outline-success, .btn-outline-danger { background: var(--sa-surface) !important; box-shadow: var(--sh-1); }
.btn-outline-secondary { border: 1px solid #cbd5e1 !important; color: #475569 !important; }
.btn-outline-secondary:hover, .btn-outline-secondary:focus, .btn-outline-secondary.active {
    background: #f1f5f9 !important;
    border-color: #94a3b8 !important;
    color: #1e293b !important;
}
.btn-outline-success { border: 1px solid #a7f3d0 !important; color: #047857 !important; }
.btn-outline-success:hover, .btn-outline-success:focus, .btn-outline-success.active {
    background: #d1fae5 !important;
    border-color: #6ee7b7 !important;
    color: #047857 !important;
}
.btn-outline-danger  { border: 1px solid #fecdd3 !important; color: #be123c !important; }
.btn-outline-danger:hover, .btn-outline-danger:focus, .btn-outline-danger.active {
    background: #ffe4e6 !important;
    border-color: #fda4af !important;
    color: #be123c !important;
}
.btn-link { box-shadow: none; color: var(--sa-primary); }
.btn-link:hover { color: var(--sa-primary-dark); transform: none; }

/* ================================================================
   ICON / SOFT BUTTONS  (in-table actions - compact)
   ================================================================ */
.btn-icon {
    width: 30px; height: 30px; padding: 0 !important;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 7px; box-shadow: none !important;
    border: 0 !important;
}
.btn-icon i { font-size: .85rem; line-height: 1; }
.btn-icon:hover { transform: translateY(-1px) scale(1.05); }

.btn-action-group {
    display: inline-flex; gap: .3rem; align-items: center;
    justify-content: flex-end;
}
.btn-action-group form { display: inline-flex; }

.btn-soft-primary { background: #dbeafe !important; color: #1d4ed8 !important; }
.btn-soft-primary:hover { background: #bfdbfe !important; }
.btn-soft-amber   { background: #fef3c7 !important; color: #b45309 !important; }
.btn-soft-amber:hover { background: #fde68a !important; }
.btn-soft-danger  { background: #fee2e2 !important; color: #be123c !important; }
.btn-soft-danger:hover { background: #fecdd3 !important; }
.btn-soft-success { background: #dcfce7 !important; color: #047857 !important; }
.btn-soft-success:hover { background: #bbf7d0 !important; }
.btn-soft-violet  { background: #ede9fe !important; color: #6d28d9 !important; }
.btn-soft-violet:hover { background: #ddd6fe !important; }
.btn-soft-slate   { background: #f1f5f9 !important; color: #334155 !important; }
.btn-soft-slate:hover { background: #e2e8f0 !important; }

/* List-page action bar (legacy - now actions ride inside .page-header instead) */
.list-page-actions {
    display: flex; justify-content: flex-end; align-items: center;
    gap: .5rem; margin-bottom: .5rem;
}

/* ================================================================
   FILTER STRIP  (Reports / Capacity / Detail)
   ================================================================ */
.filter-strip {
    background: var(--sa-surface);
    border: 1px solid var(--sa-border-soft);
    border-left: 4px solid var(--sa-primary);
    border-radius: var(--r-md);
    box-shadow: var(--sh-1);
    padding: .85rem 1.1rem;
    margin-bottom: 1rem;
}
.filter-strip-row {
    display: flex; flex-wrap: wrap; align-items: end; gap: .85rem;
}
.filter-strip-tag {
    display: inline-flex; align-items: center; gap: .4rem;
    color: var(--sa-primary); font-weight: 700; font-size: .9rem;
    padding-bottom: .55rem; white-space: nowrap;
}
.filter-strip-tag i { font-size: 1rem; }
.filter-field { display: flex; flex-direction: column; min-width: 130px; }
.filter-field.grow { flex: 1 1 220px; min-width: 200px; }
.filter-field label {
    font-size: .68rem; text-transform: uppercase; letter-spacing: .06em;
    color: var(--sa-muted); font-weight: 700; margin-bottom: .25rem;
}
.filter-field select, .filter-field input {
    height: 38px; font-size: .88rem; padding: .35rem .7rem;
}
.filter-actions {
    display: flex; align-items: end; gap: .5rem; margin-left: auto;
}
.filter-actions .btn { height: 38px; }
@@media (max-width: 768px) {
    .filter-actions { margin-left: 0; width: 100%; }
    .filter-actions .btn { flex: 1; }
}

/* Standard form-actions row at bottom of an entry form */
.form-actions {
    display: flex;
    gap: .5rem;
    align-items: center;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--sa-border-soft);
}

/* Compact info box - used on ResetPassword to show whose pwd is being reset */
.info-pill {
    display: inline-flex; align-items: center; gap: .65rem;
    background: linear-gradient(135deg, #dbeafe, #ede9fe);
    border: 1px solid #c7d2fe;
    border-radius: 12px;
    padding: .65rem .9rem;
    font-size: .9rem;
    color: var(--sa-ink-soft);
}
.info-pill .avatar {
    width: 36px; height: 36px; border-radius: 9px;
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    color: #fff; font-weight: 600;
    display: inline-flex; align-items: center; justify-content: center;
}

/* ================================================================
   FORMS
   ================================================================ */
.form-label { font-weight: 500; font-size: .87rem; color: var(--sa-ink-soft); margin-bottom: .35rem; }
.form-control, .form-select {
    border: 1px solid var(--sa-border); border-radius: var(--r-sm);
    padding: .6rem .85rem; font-size: .92rem; color: var(--sa-ink-soft);
    transition: border-color .15s, box-shadow .15s;
}
.form-control:focus, .form-select:focus {
    border-color: var(--sa-primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .12);
    outline: none;
}
.form-check-input:checked { background-color: var(--sa-primary); border-color: var(--sa-primary); }
.form-check-input:focus   { border-color: var(--sa-primary); box-shadow: 0 0 0 4px rgba(37, 99, 235, .12); }
.form-floating > label    { color: var(--sa-muted); font-weight: 500; }
.form-floating > .form-control { height: calc(3.25rem + 2px); padding: 1.1rem .85rem .25rem; }
.invalid-feedback.d-block { color: var(--sa-danger); font-size: .8rem; }

/* File-type radio cards (Upload page) */
.filetype-card { display: block; cursor: pointer; margin: 0; }
.filetype-card input { position: absolute; opacity: 0; pointer-events: none; }
.filetype-card-body {
    border: 2px solid var(--sa-border);
    border-radius: var(--r-md);
    padding: 1.2rem 1rem; text-align: center;
    transition: all .15s ease; background: var(--sa-surface);
}
.filetype-card-body i { font-size: 1.65rem; color: #94a3b8; margin-bottom: .4rem; display: block; transition: color .15s; }
.filetype-card-body div { font-weight: 600; font-size: .95rem; color: var(--sa-ink-soft); }
.filetype-card:hover .filetype-card-body { border-color: var(--sa-primary); background: #f8faff; }
.filetype-card input:checked + .filetype-card-body {
    border-color: var(--sa-primary); background: #eff6ff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, .15);
}
.filetype-card input:checked + .filetype-card-body i { color: var(--sa-primary); }

/* ================================================================
   TABLES  (compact)
   ================================================================ */
.table {
    color: var(--sa-ink-soft);
    --bs-table-bg: transparent;
    margin: 0;
    font-size: .91rem;
}
.table > :not(caption) > * > * { padding: .6rem 1rem; vertical-align: middle; }
.table thead th {
    background: #f8fafc; color: var(--sa-muted);
    font-weight: 600; font-size: .7rem;
    text-transform: uppercase; letter-spacing: .06em;
    border-bottom: 1px solid var(--sa-border-soft);
    padding: .6rem 1rem; white-space: nowrap;
}
.table tbody tr           { border-bottom: 1px solid var(--sa-border-soft); }
.table tbody tr:last-child{ border-bottom: 0; }
.table-hover tbody tr:hover { background: #f8faff; }
.card-table thead th:first-child, .card-table tbody td:first-child { padding-left: 1.25rem; }
.card-table thead th:last-child,  .card-table tbody td:last-child  { padding-right: 1.25rem; }
.table .badge { font-size: .68rem; padding: .3em .55em; }
.table code { font-size: .82rem; padding: .15rem .4rem; background: #f1f5f9; border-radius: 5px; color: #475569; }

/* ================================================================
   BADGES / ALERTS
   ================================================================ */
.badge {
    font-weight: 500; padding: .4em .7em; border-radius: 6px;
    font-size: .72rem; letter-spacing: .02em;
}
.badge.bg-success   { background: #dcfce7 !important; color: #14532d !important; }
.badge.bg-danger    { background: #fee2e2 !important; color: #991b1b !important; }
.badge.bg-warning   { background: #fef3c7 !important; color: #92400e !important; }
.badge.bg-info      { background: #cffafe !important; color: #155e75 !important; }
.badge.bg-secondary { background: #f1f5f9 !important; color: #475569 !important; }
.badge.bg-primary   { background: #dbeafe !important; color: #1e40af !important; }

.alert { border: 0; border-radius: var(--r-md); padding: .9rem 1.15rem; box-shadow: var(--sh-1); }
.alert-success { background: #dcfce7; color: #14532d; }
.alert-danger  { background: #fee2e2; color: #991b1b; }
.alert-warning { background: #fef3c7; color: #92400e; }
.alert-info    { background: #cffafe; color: #155e75; }

/* ================================================================
   Cleanup of DataTables artifacts (underlines / weird borders)
   ================================================================ */
table.dataTable, table.dataTable.no-footer { border-collapse: collapse !important; }
table.dataTable.dtr-inline.collapsed > tbody > tr.parent > td.dtr-control:before { display: none !important; }
/* Kill the dotted "click to expand" underlines that the Responsive plugin adds */
table.dataTable.dtr-inline.collapsed > tbody > tr > td.child,
table.dataTable.dtr-inline.collapsed > tbody > tr > th.child { padding: 0 !important; }
table.dataTable tbody td, table.dataTable tbody th {
    border-bottom: 0 !important;
    text-decoration: none !important;
    border-top: 0 !important;
}
table.dataTable tbody tr {
    border-bottom: 1px solid var(--sa-border-soft) !important;
}
table.dataTable tbody tr:last-child { border-bottom: 0 !important; }

/* Sort indicator: a chevron icon, not the default arrow */
table.dataTable thead th.sorting,
table.dataTable thead th.sorting_asc,
table.dataTable thead th.sorting_desc { cursor: pointer; padding-right: 1.6rem !important; position: relative; }
table.dataTable thead th.sorting:before,
table.dataTable thead th.sorting:after,
table.dataTable thead th.sorting_asc:before,
table.dataTable thead th.sorting_desc:before,
table.dataTable thead th.sorting_asc:after,
table.dataTable thead th.sorting_desc:after { display: none !important; }
table.dataTable thead th.sorting:after {
    display: inline-block !important;
    content: '\F282'; /* bi-chevron-expand */
    font-family: "bootstrap-icons" !important;
    position: absolute; right: .65rem; top: 50%;
    transform: translateY(-50%);
    font-size: .75rem; opacity: .35; color: var(--sa-muted);
}
table.dataTable thead th.sorting_asc:after {
    display: inline-block !important;
    content: '\F284'; /* bi-chevron-up */
    font-family: "bootstrap-icons" !important;
    position: absolute; right: .65rem; top: 50%;
    transform: translateY(-50%);
    font-size: .75rem; opacity: .85; color: var(--sa-primary);
}
table.dataTable thead th.sorting_desc:after {
    display: inline-block !important;
    content: '\F282'; /* bi-chevron-down */
    font-family: "bootstrap-icons" !important;
    position: absolute; right: .65rem; top: 50%;
    transform: translateY(-50%);
    font-size: .75rem; opacity: .85; color: var(--sa-primary);
}

/* ================================================================
   DataTables  (compact)
   ================================================================ */
table.dataTable { width: 100% !important; }
table.dataTable thead th { border-bottom: 1px solid var(--sa-border-soft) !important; }
.dataTables_wrapper { padding: .85rem 1rem .25rem; }
.dataTables_wrapper .dataTables_filter input {
    border-radius: 7px; border: 1px solid var(--sa-border);
    padding: .35rem .75rem .35rem 2rem; min-width: 200px;
    font-size: .86rem; height: 32px;
    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%2364748b' stroke-width='2' viewBox='0 0 24 24'><circle cx='11' cy='11' r='7'/><path d='m21 21-4.3-4.3'/></svg>") no-repeat .5rem center;
    background-size: 1rem;
}
.dataTables_wrapper .dataTables_filter input:focus { outline: none; border-color: var(--sa-primary); box-shadow: 0 0 0 4px rgba(37, 99, 235, .12); }
.dataTables_wrapper .dataTables_filter label { font-size: 0; }
.dataTables_wrapper .dataTables_length select {
    border-radius: 7px; border: 1px solid var(--sa-border);
    padding: .25rem 1.4rem .25rem .55rem; font-size: .82rem; height: 32px;
}
.dataTables_wrapper .dataTables_length label { color: var(--sa-muted); font-size: .82rem; }
.dataTables_wrapper .dt-buttons { gap: .3rem; display: inline-flex; }
.dataTables_wrapper .dt-buttons .btn {
    box-shadow: var(--sh-1); padding: .3rem .65rem; font-size: .8rem;
}
.dataTables_wrapper .dt-buttons .btn i { font-size: .82rem; }
/* DataTables Bootstrap 5 pagination — targets .page-link (the visible <a>) */
.dataTables_wrapper .dataTables_paginate { padding-top: .55rem; }
.dataTables_wrapper .pagination {
    margin: 0 !important;
    gap: 2px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.dataTables_wrapper .pagination .page-item { margin: 0 !important; }
.dataTables_wrapper .pagination .page-item .page-link,
.dataTables_wrapper .dataTables_paginate .paginate_button .page-link,
.dataTables_wrapper .dataTables_paginate .page-link {
    border: 1px solid var(--sa-border-soft) !important;
    border-radius: 6px !important;
    background: var(--sa-surface) !important;
    color: var(--sa-ink-soft) !important;
    font-size: .78rem !important;
    font-weight: 500 !important;
    min-width: 28px !important;
    height: 28px !important;
    padding: 0 .55rem !important;
    margin: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
    box-sizing: border-box !important;
    text-decoration: none !important;
}
.dataTables_wrapper .pagination .page-item.active .page-link,
.dataTables_wrapper .pagination .page-item.active .page-link:hover {
    background: linear-gradient(135deg, var(--sa-primary), var(--sa-primary-dark)) !important;
    border-color: var(--sa-primary-dark) !important;
    color: #fff !important;
    font-weight: 600 !important;
    box-shadow: 0 2px 6px rgba(37,99,235,.25);
}
.dataTables_wrapper .pagination .page-item .page-link:hover {
    background: var(--sa-primary-soft) !important;
    border-color: var(--sa-primary) !important;
    color: var(--sa-primary-dark) !important;
}
.dataTables_wrapper .pagination .page-item.disabled .page-link,
.dataTables_wrapper .pagination .page-item.disabled .page-link:hover {
    background: var(--sa-surface) !important;
    color: #cbd5e1 !important;
    cursor: not-allowed !important;
    opacity: 1 !important;
}
.dataTables_wrapper .pagination .page-item.previous .page-link,
.dataTables_wrapper .pagination .page-item.next .page-link,
.dataTables_wrapper .pagination .page-item.first .page-link,
.dataTables_wrapper .pagination .page-item.last .page-link {
    width: 28px !important;
    padding: 0 !important;
    color: var(--sa-muted) !important;
}
.dataTables_wrapper .dataTables_info {
    color: var(--sa-muted);
    font-size: .78rem;
    padding-top: .55rem;
}

/* ================================================================
   AVATARS / SUBHEADERS / EMPTY / DATAGRID
   ================================================================ */
.subheader { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--sa-muted); font-weight: 600; }
.empty { background: var(--sa-surface); border-radius: var(--r-md); padding: 2rem 1rem; border: 1px dashed var(--sa-border); }
.empty-title { font-weight: 700; color: var(--sa-ink); }
.datagrid-item       { padding: .85rem 1rem; }
.datagrid-title      { color: var(--sa-muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.datagrid-content    { color: var(--sa-ink); font-weight: 600; margin-top: .15rem; }

/* In-table empty state */
.empty-row {
    text-align: center; padding: 1.75rem 1rem !important; color: var(--sa-muted);
}
.empty-row .empty-icon {
    width: 50px; height: 50px; border-radius: 12px;
    background: #f1f5f9; color: #94a3b8;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.5rem; margin-bottom: .65rem;
}
.empty-row .empty-heading { font-weight: 600; color: var(--sa-ink); }
.empty-row .empty-sub     { font-size: .82rem; color: var(--sa-muted); margin-top: .15rem; }

/* ================================================================
   TOAST / PROGRESS / PAGE TRANSITIONS / LOGIN
   ================================================================ */
.toast { border-radius: var(--r-md); box-shadow: var(--sh-3); border: 0; }
.toast .toast-body { padding: .9rem 1rem; font-weight: 500; }

.progress { background: #eef0f5; border-radius: 999px; height: 8px; }
.progress-bar { border-radius: 999px; }

.page-body > .container-xl > * { animation: fadeUp .35s ease both; }
@keyframes fadeUp { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:none; } }

.login-bg {
    background:
        radial-gradient(at 20% 0%, rgba(37, 99, 235, .12) 0, transparent 50%),
        radial-gradient(at 80% 80%, rgba(16, 185, 129, .10) 0, transparent 50%),
        linear-gradient(135deg, #f5f7fb 0%, #e7ecf5 100%);
    min-height: 100vh;
}
.login-card { border: 0; border-radius: var(--r-xl); box-shadow: 0 20px 50px -10px rgba(15, 23, 42, .15); }

/* ================================================================
   COMPACT TABLE / BUTTON OVERRIDES  (highest specificity, last in file)
   These !important rules guarantee compact tables regardless of any
   Tabler / Bootstrap default that might be loaded later.
   ================================================================ */
.card .table > :not(caption) > * > *,
.card .table-vcenter > :not(caption) > * > *,
.card-table > :not(caption) > * > *,
table.dataTable > :not(caption) > * > * {
    padding: .5rem 1rem !important;
    vertical-align: middle !important;
    line-height: 1.4 !important;
}
.card .table thead th,
.card-table thead th,
table.dataTable thead th {
    padding: .55rem 1rem !important;
    line-height: 1.4 !important;
    background: #f8fafc !important;
}
.card .card-table > thead > tr > th:first-child,
.card .card-table > tbody > tr > td:first-child { padding-left: 1.25rem !important; }
.card .card-table > thead > tr > th:last-child,
.card .card-table > tbody > tr > td:last-child  { padding-right: 1.25rem !important; }

.card .table tbody tr td,
table.dataTable tbody tr td { font-size: .89rem !important; }

/* Action buttons - hard-clamp size */
a.btn.btn-icon,
button.btn.btn-icon,
.btn.btn-icon {
    width: 28px !important;  height: 28px !important;
    min-width: 28px !important; min-height: 28px !important;
    max-width: 28px; max-height: 28px;
    padding: 0 !important;
    border-radius: 6px !important;
    box-shadow: none !important;
    border: 0 !important;
    line-height: 1 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    transform: none !important;
}
.btn-icon i, .btn-icon .bi { font-size: .78rem !important; line-height: 1 !important; }
.btn-icon:hover { transform: scale(1.08) !important; }
.btn-action-group { gap: .25rem !important; }

/* DataTables sort indicator nudge so chevron doesn't add extra padding */
table.dataTable thead th.sorting,
table.dataTable thead th.sorting_asc,
table.dataTable thead th.sorting_desc { padding-right: 1.4rem !important; }

/* ================================================================
   UTILITIES
   ================================================================ */
.text-muted-2 { color: var(--sa-muted); }
.fw-700       { font-weight: 700; }
.fw-600       { font-weight: 600; }
.section-divider { border: 0; height: 1px; background: var(--sa-border-soft); margin: 2rem 0; }
.shadow-sa-1 { box-shadow: var(--sh-1) !important; }
.shadow-sa-2 { box-shadow: var(--sh-2) !important; }
.shadow-sa-3 { box-shadow: var(--sh-3) !important; }

/* ----------------------------------------------------------------
   Sticky table header (and footer) inside a scrolling container.
   Add  class="sticky-thead"  to the <table>, and wrap it in a
   scrolling div (e.g. table-responsive with max-height + overflow-y).
   ---------------------------------------------------------------- */
.sticky-thead thead th {
    position: sticky;
    top: 0;
    z-index: 5;
    background: #f8fafc;          /* match Tabler card-table thead bg */
    box-shadow: inset 0 -1px 0 var(--sa-border-soft);
}
.sticky-thead tfoot th,
.sticky-thead tfoot td {
    position: sticky;
    bottom: 0;
    z-index: 4;
    background: #f1f5f9;          /* matches table-light footer band */
    box-shadow: inset 0 1px 0 var(--sa-border-soft);
}

/* Subtle scrollbar styling for the city-breakdown scroll area */
.city-breakdown-scroll::-webkit-scrollbar        { width: 8px; height: 8px; }
.city-breakdown-scroll::-webkit-scrollbar-thumb  { background: #cbd5e1; border-radius: 4px; }
.city-breakdown-scroll::-webkit-scrollbar-track  { background: transparent; }
