/* ==========================================================================
   Vebzaa Real Estate ERP - Theme
   Single source of truth for the app shell, forms, tables and components.
   All original tokens/class names are preserved so every existing view keeps
   working; this file only upgrades how they look and feel.
   ========================================================================== */

:root {
    /* Chakra UI palette (gray / teal / orange / green / red / blue) */
    --ink: #1A202C;
    --ink-2: #2D3748;
    --canvas: #F7FAFC;
    --surface: #FFFFFF;
    --line: #E2E8F0;
    --line-soft: #EDF2F7;
    --line-strong: #CBD5E0;

    --teal: #319795;
    --teal-600: #2C7A7B;
    --teal-700: #285E61;
    --teal-400: #38B2AC;
    --teal-tint: #E6FFFA;
    --teal-glow: rgba(49, 151, 149, .35);

    --gold: #DD6B20;
    --gold-300: #F6AD55;
    --gold-tint: #FFFAF0;

    --text: #2D3748;
    --text-muted: #718096;
    --text-faint: #A0AEC0;

    --success: #38A169;
    --success-tint: #F0FFF4;
    --danger: #E53E3E;
    --danger-tint: #FFF5F5;
    --warning-tint: #FFFAF0;
    --info: #3182CE;

    --radius: 15px;
    --radius-sm: 8px;
    --radius-xs: 6px;
    --shadow-sm: 0 3.5px 5.5px rgba(0, 0, 0, .02);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, .1), 0 2px 4px -1px rgba(0, 0, 0, .06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, .1), 0 4px 6px -2px rgba(0, 0, 0, .05);
    --ring: 0 0 0 1px var(--teal);

    --font-display: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'IBM Plex Mono', ui-monospace, monospace;

    --sidebar-width: 264px;
    --header-height: 64px;
    --ease: cubic-bezier(.16, 1, .3, 1);
    --spring: cubic-bezier(.34, 1.56, .64, 1);

    --bs-primary: var(--teal);
    --bs-primary-rgb: 49, 151, 149;
    --bs-link-color: var(--teal);
    --bs-body-font-family: var(--font-body);
    --bs-border-color: var(--line);
}

* { -webkit-font-smoothing: antialiased; }
html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    color: var(--text);
    font-size: .875rem;
    background: var(--canvas);
    color: var(--text);
}
::selection { background: var(--teal-tint); color: var(--teal-600); }

h1, h2, h3, h4, h5, .font-display { font-family: var(--font-display); letter-spacing: -.01em; color: var(--ink); font-weight: 600; }
.font-mono, .money, .code-num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
a { color: var(--teal); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--teal-600); }
.text-muted { color: var(--text-muted) !important; }
hr { border-color: var(--line); opacity: 1; }

@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(12px) } to { opacity: 1; transform: none } }
@keyframes slideInLeft { from { opacity: 0; transform: translateX(-14px) } to { opacity: 1; transform: none } }
@keyframes float { 0%, 100% { transform: translate(0, 0) } 50% { transform: translate(-18px, 14px) } }
@keyframes progressShine { 0% { background-position: 0 0 } 100% { background-position: -200% 0 } }
@keyframes pulseGlow { 0%, 100% { box-shadow: 0 0 0 0 rgba(192, 64, 47, .35) } 50% { box-shadow: 0 0 0 5px rgba(192, 64, 47, 0) } }
@keyframes spin { to { transform: rotate(360deg) } }
@keyframes panBg { from { background-position: 0 100% } to { background-position: -300px 100% } }
@keyframes kenburns { from { transform: scale(1) translate(0, 0) } to { transform: scale(1.12) translate(-1.5%, -1%) } }
@keyframes shimmer { 0% { transform: translateX(-100%) } 100% { transform: translateX(100%) } }

/* ==========================================================================
   SIDEBAR  - light, quiet; groups collapse (built by erp-ui.js)
   ========================================================================== */
.app-accent-strip { display: none; }

.sidebar {
    width: var(--sidebar-width); height: 100vh; position: fixed; inset: 0 auto 0 0; z-index: 1000;
    display: flex; flex-direction: column; overflow: hidden;
    background: var(--surface); border-right: 1px solid var(--line);
    transition: transform .25s var(--ease);
}

.sidebar-brand { flex: none; height: var(--header-height); display: flex; align-items: center; border-bottom: 1px solid var(--line); }
.sidebar-logo { padding: 0 1.15rem; display: flex; align-items: center; gap: .65rem; width: 100%; }
.sidebar-logo .mark { width: 28px; height: 28px; border-radius: 6px; flex: none; display: grid; place-items: center; background: var(--teal); }
.sidebar-logo .mark svg { width: 17px; height: 17px; }
.sidebar-logo .wordmark { font-weight: 600; font-size: .98rem; color: var(--ink); line-height: 1.1; letter-spacing: -.01em; }
.sidebar-logo .tag { font-size: .7rem; color: var(--text-muted); display: block; margin-top: 1px; }

.sidebar-nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: .6rem .65rem 1rem; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.sidebar-nav::-webkit-scrollbar { width: 5px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 3px; }

.sidebar .nav-section { font-size: .75rem; color: var(--text-faint); font-weight: 600; padding: .85rem .6rem .35rem; margin: 0; }

.nav-group { margin-top: .1rem; }
.nav-group-toggle {
    width: 100%; display: flex; align-items: center; gap: .5rem; background: none; border: 0; cursor: pointer;
    padding: .5rem .6rem; margin-top: .35rem; border-radius: var(--radius-sm); color: var(--text-muted);
    font-size: .78rem; font-weight: 600; text-align: left; transition: background .12s ease, color .12s ease;
}
.nav-group-toggle .gi, .nav-group .count { display: none; }
.nav-group-toggle .chev { order: -1; font-size: .62rem; width: 12px; color: var(--text-faint); transition: transform .2s var(--ease); }
.nav-group-toggle:hover { color: var(--ink); background: var(--canvas); }
.nav-group.collapsed .chev { transform: rotate(-90deg); }
.nav-group.has-active > .nav-group-toggle { color: var(--ink); }
.nav-group-items { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .22s var(--ease); }
.nav-group-items > .inner { overflow: hidden; min-height: 0; }
.nav-group.collapsed .nav-group-items { grid-template-rows: 0fr; }

.sidebar .nav-link {
    color: var(--ink-2); padding: .46rem .7rem .46rem 1.55rem; font-size: .855rem; border-radius: var(--radius-sm);
    display: flex; align-items: center; gap: .65rem; margin: 1px 0; position: relative; transition: background .12s ease, color .12s ease;
}
.nav-group-items .nav-link { padding-left: 1.55rem; }
.nav-group > .nav-link, .nav-group > .nav-section + .nav-link { padding-left: .7rem; }
.sidebar .nav-link i { width: 16px; text-align: center; font-size: .95rem; color: var(--text-muted); flex: none; }
.sidebar .nav-link:hover { background: var(--canvas); color: var(--ink); }
.sidebar .nav-link.active { background: var(--teal-tint); color: var(--teal-700); font-weight: 600; }
.sidebar .nav-link.active::before { content: ''; position: absolute; left: 0; top: 7px; bottom: 7px; width: 3px; border-radius: 0 3px 3px 0; background: var(--teal); }
.sidebar .nav-link.active i { color: var(--teal); }
.sidebar .nav-link:focus-visible, .nav-group-toggle:focus-visible { outline: 2px solid var(--teal); outline-offset: -2px; }

.sidebar-foot { flex: none; padding: .7rem .8rem; border-top: 1px solid var(--line); }
.side-user { display: flex; align-items: center; gap: .65rem; }
.side-user .av { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: .8rem; color: var(--teal-700); background: var(--teal-tint); flex: none; }
.side-user .nm { font-size: .82rem; color: var(--ink); font-weight: 600; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px; }
.side-user .rl { font-size: .72rem; color: var(--text-muted); }
.side-user form { margin-left: auto; }
.side-user button { background: transparent; border: 0; color: var(--text-muted); width: 30px; height: 30px; border-radius: var(--radius-sm); transition: background .12s ease, color .12s ease; }
.side-user button:hover { background: var(--danger-tint); color: var(--danger); }

.sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(27, 39, 51, .45); z-index: 999; }
.sidebar-backdrop.show { display: block; }

/* ==========================================================================
   TOPBAR + LAYOUT
   ========================================================================== */
.main-content { margin-left: var(--sidebar-width); min-height: 100vh; }
.top-header {
    height: var(--header-height); position: sticky; top: 0; z-index: 998; padding: 0 1.75rem;
    display: flex; align-items: center; justify-content: space-between;
    background: var(--surface); border-bottom: 1px solid var(--line);
}
.top-header .breadcrumb { --bs-breadcrumb-divider-color: var(--text-faint); }
.top-header .breadcrumb-item a { color: var(--text-muted); } .top-header .breadcrumb-item a:hover { color: var(--teal); }
.top-header .breadcrumb-item.active { color: var(--ink); font-weight: 600; }
.topbar-search {
    display: flex; align-items: center; gap: .55rem; width: 260px; padding: .45rem .5rem .45rem .8rem; cursor: pointer;
    background: var(--canvas); border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--text-muted); font-size: .82rem;
    transition: border-color .18s ease, box-shadow .18s ease;
}
.topbar-search:hover { border-color: var(--teal); box-shadow: var(--ring); }
.topbar-search kbd { margin-left: auto; font-family: var(--font-mono); font-size: .66rem; background: var(--canvas); color: var(--text-muted); border: 1px solid var(--line); border-radius: 6px; padding: .1rem .4rem; }
.top-icon-btn { position: relative; width: 36px; height: 36px; border-radius: var(--radius-sm); display: grid; place-items: center; background: transparent; border: 1px solid transparent; color: var(--text-muted); transition: all .18s ease; }
.top-icon-btn:hover { background: var(--surface); border-color: var(--line); color: var(--teal); }
.top-icon-btn .dot { position: absolute; top: 9px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); border: 2px solid var(--surface); }
.avatar-circle { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: .8rem; color: var(--teal-700); background: var(--teal-tint); }
.date-chip { font-size: .78rem; color: var(--text-muted); padding: .32rem .5rem; }
.date-chip i { color: var(--teal); }

.page-content { padding: 1.6rem 1.75rem 3rem; max-width: 1480px; }

/* page headings used across views */
.page-eyebrow, .section-eyebrow { font-size: .78rem; color: var(--text-muted); font-weight: 500; }
.page-title { font-size: 1.35rem; font-weight: 600; margin-bottom: 0; }
.page-content h5.font-display, .page-content h4.font-display { font-weight: 600; font-size: 1.15rem; display: flex; align-items: center; }
.page-content h5.font-display > i:first-child { display: inline-block !important; font-size: 1.05rem; margin-right: .55rem !important; color: var(--teal) !important; }
.section-eyebrow { display: flex; align-items: center; gap: .75rem; }
.section-eyebrow::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.divider-dashed { border-top: 1px dashed var(--line); margin: 1.2rem 0; }
.required::after { content: ' *'; color: var(--danger); }
.text-gradient { color: var(--ink); }

/* ==========================================================================
   CARDS + STAT CARDS
   ========================================================================== */
.card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: none; }
.card-header {
    background: transparent; border-bottom: 1px solid var(--line-soft); padding: .85rem 1.15rem;
    font-weight: 600; font-size: .9rem; color: var(--ink); display: flex; align-items: center; gap: .5rem;
}
.card > .card-header:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.card-header > i:first-child { color: var(--text-muted); }
.card-footer { background: transparent; border-top: 1px solid var(--line-soft); }
.card-body { padding: 1.15rem; }
.card > .table-responsive, .card > .table { border-radius: 0 0 var(--radius) var(--radius); }

.stat-card { background: var(--surface); border-radius: var(--radius); padding: 1rem 1.15rem; border: 1px solid var(--line); }
.stat-card .label { font-size: .78rem; color: var(--text-muted); font-weight: 500; margin-bottom: .3rem; }
.stat-card .value { font-family: var(--font-mono); font-size: 1.5rem; font-weight: 600; color: var(--ink); line-height: 1.15; }
.stat-card .icon-badge { width: 36px; height: 36px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 1rem; background: var(--teal-tint); color: var(--teal-600); }

.progress { border-radius: 99px; overflow: hidden; background: var(--line-soft); }
.progress-bar { background: var(--teal); }

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn { border-radius: var(--radius-sm); font-size: .85rem; font-weight: 500; padding: .48rem 1rem; transition: background-color .12s ease, border-color .12s ease, color .12s ease; }
.btn-sm { padding: .32rem .7rem; font-size: .8rem; border-radius: var(--radius-sm); }
.btn-lg { padding: .7rem 1.35rem; font-size: .95rem; }
.btn i { vertical-align: -1px; }
.btn-primary { --bs-btn-border-color: var(--teal); background: var(--teal); border: 1px solid var(--teal); color: #fff; }
.btn-primary:hover, .btn-primary:focus { background: var(--teal-600); border-color: var(--teal-600); color: #fff; }
.btn-primary:active { background: var(--teal-700) !important; border-color: var(--teal-700) !important; }
.btn-success { background: var(--success); border: 1px solid var(--success); }
.btn-success:hover { background: #246649; border-color: #246649; }
.btn-danger { background: var(--danger); border: 1px solid var(--danger); }
.btn-danger:hover { background: #9B3023; border-color: #9B3023; }
.btn-warning { background: var(--gold); border: 1px solid var(--gold); color: #fff; }
.btn-warning:hover { color: #fff; background: #8F6A22; }
.btn-outline-primary { color: var(--teal); border-color: var(--line-strong); background: var(--surface); }
.btn-outline-primary:hover, .btn-outline-primary:active { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn-light { background: var(--surface); border: 1px solid var(--line-strong); color: var(--ink-2); }
.btn-light:hover { background: var(--canvas); border-color: var(--line-strong); color: var(--ink); }
.btn:focus-visible, a:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.btn.is-loading { pointer-events: none; opacity: .85; position: relative; }
.btn.is-loading .spin { display: inline-block; width: .95em; height: .95em; border: 2px solid rgba(255, 255, 255, .45); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; vertical-align: -2px; margin-right: .45rem; }
.btn-light.is-loading .spin, .btn-outline-primary.is-loading .spin { border-color: rgba(14, 107, 99, .3); border-top-color: var(--teal); }

/* ==========================================================================
   FORMS
   ========================================================================== */
.form-label { font-weight: 600; font-size: .78rem; color: #3A3F4C; margin-bottom: .38rem; letter-spacing: .005em; }
.form-control, .form-select {
    min-height: 42px; font-size: .88rem; color: var(--text); background-color: #FDFDFB; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
    padding: .55rem .9rem; transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}
.form-control-sm, .form-select-sm { min-height: 34px; font-size: .82rem; padding: .35rem .7rem; border-radius: 9px; }
.form-control-lg, .form-select-lg { min-height: 50px; font-size: 1rem; }
.form-control::placeholder { color: var(--text-faint); }
.form-control:hover:not(:disabled):not([readonly]), .form-select:hover:not(:disabled) { border-color: var(--line-strong); background-color: #fff; }
.form-control:focus, .form-select:focus { background-color: #fff; border-color: var(--teal); box-shadow: var(--ring); outline: 0; }
.form-control:disabled, .form-control[readonly], .form-select:disabled { background-color: var(--line-soft); color: var(--text-muted); border-style: dashed; cursor: not-allowed; }
textarea.form-control { min-height: 84px; resize: vertical; line-height: 1.5; }
input[type=number].form-control { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
input[type=file].form-control { padding: .45rem .6rem; }
input[type=file].form-control::file-selector-button { background: var(--teal-tint); color: var(--teal-600); border: 0; border-radius: 7px; padding: .35rem .8rem; margin-right: .8rem; font-weight: 500; transition: background .15s ease; }
input[type=file].form-control:hover::file-selector-button { background: #D4EBE6; }
.form-select { background-position: right .8rem center; padding-right: 2.2rem; }
.form-control.is-invalid, .form-select.is-invalid { border-color: var(--danger); background-image: none; }
.form-control.is-invalid:focus, .form-select.is-invalid:focus { box-shadow: 0 0 0 4px rgba(192, 64, 47, .14); }
.form-control.is-valid, .form-select.is-valid { border-color: var(--success); }
.invalid-feedback, .text-danger.small { font-size: .75rem; }
.form-text { font-size: .74rem; color: var(--text-muted); }
.input-group-text { background: var(--teal-tint); border: 1.5px solid var(--line); color: var(--teal-600); font-weight: 600; font-size: .82rem; border-radius: var(--radius-sm); }
.input-group > .form-control:not(:first-child), .input-group > .form-select:not(:first-child) { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.input-group > .form-control:not(:last-child), .input-group > .form-select:not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-group > .input-group-text:not(:last-child) { border-right: 0; } .input-group > .input-group-text:not(:first-child) { border-left: 0; }
.input-group:focus-within { border-radius: var(--radius-sm); box-shadow: var(--ring); }
.input-group:focus-within .form-control, .input-group:focus-within .input-group-text { border-color: var(--teal); box-shadow: none; }

.form-check-input { width: 1.15em; height: 1.15em; border: 1.5px solid var(--line-strong); margin-top: .17em; transition: all .15s ease; }
.form-check-input:checked { background-color: var(--teal); border-color: var(--teal); }
.form-check-input:focus { border-color: var(--teal); box-shadow: var(--ring); }
.form-switch .form-check-input { width: 2.2em; height: 1.2em; border-radius: 2em; }
.form-check-label { font-size: .85rem; }

/* form cards: the typical  .card > .card-header + .card-body > form  */
.card-body > form > .row.g-3, .card-body .row.g-3 { --bs-gutter-y: 1.1rem; }
.card-body .divider-dashed + .section-eyebrow { margin-top: -.4rem; }
.calc-box, .summary-box { background: var(--canvas); border: 1px dashed var(--line-strong) !important; border-radius: var(--radius-sm) !important; }

/* Select2 skin */
.select2-container--bootstrap-5 .select2-selection { min-height: 42px; border: 1.5px solid var(--line) !important; border-radius: var(--radius-sm) !important; background-color: #FDFDFB; font-size: .88rem; transition: border-color .18s ease, box-shadow .18s ease; }
.select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered { padding-top: .1rem; color: var(--text); }
.select2-container--bootstrap-5.select2-container--focus .select2-selection, .select2-container--bootstrap-5.select2-container--open .select2-selection { border-color: var(--teal) !important; box-shadow: var(--ring) !important; background: #fff; }
.select2-container--bootstrap-5 .select2-dropdown { border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); overflow: hidden; animation: fadeInUp .18s var(--ease); }
.select2-container--bootstrap-5 .select2-results__option { font-size: .85rem; padding: .5rem .9rem; }
.select2-container--bootstrap-5 .select2-results__option--highlighted, .select2-container--bootstrap-5 .select2-results__option[aria-selected=true]:hover { background: var(--teal-tint) !important; color: var(--teal-600) !important; }
.select2-container--bootstrap-5 .select2-results__option--selected, .select2-container--bootstrap-5 .select2-results__option[aria-selected=true] { background: var(--teal) !important; color: #fff !important; }
.select2-container--bootstrap-5 .select2-search--dropdown .select2-search__field { border: 1.5px solid var(--line); border-radius: 9px; }
.select2-container--bootstrap-5 .select2-search--dropdown .select2-search__field:focus { border-color: var(--teal); box-shadow: var(--ring); outline: 0; }

/* Flatpickr skin */
.flatpickr-calendar { border-radius: 14px; box-shadow: var(--shadow-lg); border: 1px solid var(--line); font-family: var(--font-body); animation: fadeInUp .18s var(--ease); }
.flatpickr-day.selected, .flatpickr-day.startRange, .flatpickr-day.endRange, .flatpickr-day.selected:hover { background: var(--teal); border-color: var(--teal); }
.flatpickr-day.today { border-color: var(--gold); } .flatpickr-day:hover { background: var(--teal-tint); border-color: var(--teal-tint); }
.flatpickr-months .flatpickr-month, .flatpickr-current-month .flatpickr-monthDropdown-months { font-weight: 600; }
.flatpickr-input.datepicker, input.datepicker { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23319795' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 0a.5.5 0 0 1 .5.5V1h8V.5a.5.5 0 0 1 1 0V1h1a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h1V.5a.5.5 0 0 1 .5-.5zM1 4v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V4H1z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .85rem center; padding-right: 2.4rem; }

/* ==========================================================================
   TABLES
   ========================================================================== */
.table { --bs-table-bg: transparent; margin-bottom: 0; }
.table th { font-size: .78rem; color: var(--text-muted); font-weight: 600; border-bottom: 1px solid var(--line); padding: .65rem 1rem; background: #F8F9FA; white-space: nowrap; }
.table td { vertical-align: middle; font-size: .855rem; padding: .7rem 1rem; border-bottom: 1px solid var(--line-soft); }
.table tbody tr:last-child td { border-bottom: 0; }
.table-hover tbody tr:hover > * { background: #F6F8F9; --bs-table-accent-bg: transparent; }
.table tfoot td, .table tfoot th { background: #F8F9FA; font-weight: 600; border-top: 1px solid var(--line); }
.table-responsive { scrollbar-width: thin; }
tr[onclick] { cursor: pointer; position: relative; }
tr[onclick]::after { content: none; }
.table .btn-sm.btn-light { padding: .28rem .55rem; }

/* pagination */
.pagination { gap: .25rem; margin-bottom: 0; }
.page-link { border: 1px solid var(--line); border-radius: var(--radius-sm) !important; color: var(--text); font-size: .82rem; padding: .38rem .75rem; transition: all .15s ease; }
.page-link:hover { background: var(--canvas); color: var(--ink); }
.page-item.active .page-link { background: var(--teal); border-color: var(--teal); }
.page-item.disabled .page-link { background: var(--canvas); color: var(--text-faint); }

/* ==========================================================================
   BADGES, ALERTS, NAV, MODALS, DROPDOWNS
   ========================================================================== */
.badge { letter-spacing: .02em; font-weight: 600; }
.badge-status { font-size: .7rem; font-weight: 600; padding: .38em .72em; border-radius: 99px; display: inline-flex; align-items: center; gap: .38rem; transition: transform .15s ease; }
.badge-status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge-status:hover { transform: scale(1.05); }
.badge-pulse { }

.alert { border-radius: var(--radius-sm); border: 1px solid transparent; border-left-width: 4px; font-size: .86rem; }
.alert-success { background: var(--success-tint); color: var(--teal-600); border-color: #BFE0CE; border-left-color: var(--success); }
.alert-danger { background: var(--danger-tint); color: #8A2E20; border-color: #F1C9C2; border-left-color: var(--danger); }
.alert-warning { background: var(--warning-tint); color: #7A5A15; border-color: #EFDDB2; border-left-color: var(--gold); }
.alert-info { background: #EAF2F9; color: #214F78; border-color: #C8DDEE; border-left-color: var(--info); }

.list-group-item { border-color: var(--line-soft); font-size: .86rem; }
.nav-tabs { border-bottom: 1px solid var(--line); gap: .25rem; }
.nav-tabs .nav-link { border: 0; border-bottom: 2px solid transparent; color: var(--text-muted); font-weight: 500; font-size: .85rem; padding: .6rem 1rem; transition: all .18s ease; }
.nav-tabs .nav-link:hover { color: var(--teal); background: var(--teal-tint); border-radius: 9px 9px 0 0; }
.nav-tabs .nav-link.active { color: var(--teal-600); border-bottom-color: var(--teal); background: transparent; font-weight: 600; }
.nav-pills .nav-link { color: var(--text-muted); border-radius: 9px; font-size: .84rem; font-weight: 500; }
.nav-pills .nav-link.active { background: var(--teal); }

.dropdown-menu { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-md); padding: .35rem; font-size: .85rem; }
.dropdown-item { border-radius: 9px; padding: .5rem .8rem; transition: all .15s ease; }
.dropdown-item:hover { background: var(--teal-tint); color: var(--teal-600); }
.dropdown-item.text-danger:hover { background: var(--danger-tint); color: var(--danger) !important; }
.dropdown-header { font-size: .78rem; color: var(--text-muted); font-weight: 600; }
.modal-content { border: 0; border-radius: 10px; box-shadow: var(--shadow-lg); overflow: hidden; }
.modal-header { border-bottom: 1px solid var(--line-soft); padding: 1.1rem 1.5rem; background: #fff; }
.modal-title { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; }
.modal-footer { border-top: 1px solid var(--line-soft); background: #FBFAF6; }
.modal.fade .modal-dialog { transform: translateY(8px); transition: transform .2s var(--ease); } .modal.show .modal-dialog { transform: none; }
.modal-backdrop.show { opacity: .5; }
.tooltip-inner { border-radius: 8px; font-size: .74rem; padding: .35rem .65rem; background: var(--ink); }
.accordion-item { border-color: var(--line); } .accordion-button:not(.collapsed) { background: var(--teal-tint); color: var(--teal-600); box-shadow: none; }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #D6D1C5; border-radius: 99px; border: 2px solid var(--canvas); }
::-webkit-scrollbar-thumb:hover { background: #BDB7A8; }

/* ==========================================================================
   COMMAND PALETTE  (Ctrl/Cmd + K)
   ========================================================================== */
.cmdk { position: fixed; inset: 0; z-index: 2000; display: none; align-items: flex-start; justify-content: center; padding-top: 12vh; background: rgba(10, 15, 20, .55); }
.cmdk.show { display: flex; animation: fadeIn .15s ease; }
.cmdk-box { width: min(620px, 92vw); background: var(--surface); border-radius: 10px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .55); overflow: hidden; animation: fadeInUp .25s var(--ease); }
.cmdk-input { display: flex; align-items: center; gap: .75rem; padding: .95rem 1.2rem; border-bottom: 1px solid var(--line); }
.cmdk-input i { color: var(--teal); font-size: 1.1rem; }
.cmdk-input input { flex: 1; border: 0; outline: 0; font-size: 1rem; background: transparent; color: var(--ink); }
.cmdk-list { max-height: 380px; overflow-y: auto; padding: .5rem; }
.cmdk-item { display: flex; align-items: center; gap: .8rem; padding: .6rem .75rem; border-radius: 10px; color: var(--text); font-size: .88rem; cursor: pointer; }
.cmdk-item i { width: 30px; height: 30px; border-radius: 9px; background: var(--teal-tint); color: var(--teal-600); display: grid; place-items: center; font-size: .9rem; }
.cmdk-item small { margin-left: auto; color: var(--text-faint); font-size: .74rem; }
.cmdk-item.sel, .cmdk-item:hover { background: var(--teal-tint); color: var(--teal-600); }
.cmdk-empty { text-align: center; padding: 2rem; color: var(--text-muted); font-size: .85rem; }
.cmdk-foot { display: flex; gap: 1rem; padding: .6rem 1.2rem; border-top: 1px solid var(--line-soft); background: #FBFAF6; font-size: .7rem; color: var(--text-muted); }
.cmdk-foot kbd { font-family: var(--font-mono); color: var(--text); font-weight: 500; background: #fff; border: 1px solid var(--line); border-radius: 5px; padding: 0 .35rem; }

/* ==========================================================================
   RESPONSIVE / PRINT / MOTION
   ========================================================================== */
@media (max-width: 992px) {
    .sidebar { transform: translateX(-100%); box-shadow: none; }
    .sidebar.open { transform: translateX(0); box-shadow: 12px 0 40px rgba(27, 39, 51, .25); }
    .main-content { margin-left: 0; }
    .top-header { padding: 0 1rem; } .page-content { padding: 1.25rem 1rem 3rem; }
}
@media (max-width: 576px) { .page-content h5.font-display { font-size: 1.05rem; } .stat-card .value { font-size: 1.35rem; } }
@media print {
    .sidebar, .top-header, .app-accent-strip, .cmdk, .sidebar-backdrop { display: none !important; }
    .main-content { margin: 0 !important; } .page-content { padding: 0; max-width: none; }
    body { background: #fff; } .card { box-shadow: none; animation: none; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}


/* ==========================================================================
   CHAKRA UI (Purity-style) SKIN
   White borderless cards on a light-gray canvas, soft shadows, teal accent,
   icon-in-a-box navigation, 40px outline inputs with a 1px focus ring.
   ========================================================================== */
body { font-weight: 400; }
h1, h2, h3, h4, h5, .font-display { font-weight: 700; }

/* ---- Sidebar: icon boxes, active item lifts onto a white card ---- */
.sidebar { background: var(--surface); border-right: 0; box-shadow: 0 20px 27px rgba(0, 0, 0, .05); }
.sidebar-brand { height: 72px; border-bottom: 0; position: relative; }
.sidebar-brand::after { content: ''; position: absolute; left: 1.4rem; right: 1.4rem; bottom: 0; height: 1px; background: linear-gradient(90deg, rgba(224, 225, 226, 0), #E0E1E2, rgba(224, 225, 226, 0)); }
.sidebar-logo .mark { width: 34px; height: 34px; border-radius: 12px; background: linear-gradient(135deg, var(--teal-400), var(--teal)); box-shadow: 0 4px 7px -1px rgba(49, 151, 149, .4); }
.sidebar-logo .wordmark { font-size: .95rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink); }
.sidebar-logo .tag { font-size: .66rem; letter-spacing: .02em; color: var(--text-faint); }

.sidebar-nav { padding: .75rem 1rem 1rem; }
.sidebar .nav-section { font-size: .75rem; font-weight: 700; color: var(--ink); padding: 1rem .5rem .4rem; }
.nav-group-toggle { color: var(--ink); font-size: .78rem; font-weight: 700; padding: .55rem .5rem; margin-top: .5rem; }
.nav-group-toggle:hover { background: transparent; color: var(--teal-600); }
.nav-group.has-active > .nav-group-toggle { color: var(--ink); }

.sidebar .nav-link { color: var(--text-muted); font-weight: 600; font-size: .85rem; padding: .55rem .65rem; border-radius: 15px; gap: .8rem; margin: 3px 0; }
.nav-group-items .nav-link, .sidebar .nav-link { padding-left: .65rem; }
.sidebar .nav-link i { width: 30px; height: 30px; border-radius: 12px; display: grid; place-items: center; background: var(--canvas); color: var(--teal); font-size: .95rem; transition: background .15s ease, color .15s ease; }
.sidebar .nav-link:hover { background: transparent; color: var(--ink); }
.sidebar .nav-link:hover i { background: var(--teal-tint); }
.sidebar .nav-link.active { background: var(--surface); color: var(--ink); font-weight: 700; box-shadow: 0 7px 23px rgba(0, 0, 0, .05); }
.sidebar .nav-link.active::before { content: none; }
.sidebar .nav-link.active i { background: var(--teal); color: #fff; box-shadow: 0 4px 6px rgba(49, 151, 149, .35); }
.sidebar-foot { border-top: 0; padding: .8rem 1rem 1rem; }
.side-user { background: var(--canvas); border-radius: 15px; padding: .55rem .65rem; }
.side-user .av { background: linear-gradient(135deg, var(--teal-400), var(--teal)); color: #fff; border-radius: 12px; }

/* ---- Header: transparent bar over the canvas ---- */
.top-header { background: rgba(247, 250, 252, .85); backdrop-filter: blur(10px); border-bottom: 0; height: var(--header-height); }
.top-header .breadcrumb-item.active { font-weight: 700; color: var(--ink); }
.topbar-search { background: var(--surface); border: 1px solid var(--line); border-radius: 15px; box-shadow: var(--shadow-sm); }
.top-icon-btn { border-radius: 12px; }
.top-icon-btn:hover { background: var(--surface); }
.avatar-circle { background: linear-gradient(135deg, var(--teal-400), var(--teal)); color: #fff; border-radius: 12px; }
.date-chip { color: var(--text-muted); }

/* ---- Cards ---- */
.card { border: 0; border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-header { border-bottom: 0; padding: 1.1rem 1.4rem .4rem; font-size: 1rem; font-weight: 700; }
.card-body { padding: 1.1rem 1.4rem 1.4rem; }
.card-header + .table-responsive, .card-header + .table { margin-top: .5rem; }
.stat-card { border: 0; box-shadow: var(--shadow-sm); border-radius: var(--radius); }
.stat-card .label { font-size: .75rem; font-weight: 700; color: var(--text-muted); }
.stat-card .value { font-family: var(--font-body); font-size: 1.15rem; font-weight: 700; }
.stat-card .icon-badge { width: 45px; height: 45px; border-radius: 12px; background: var(--teal); color: #fff; font-size: 1.15rem; }

/* ---- Buttons ---- */
.btn { border-radius: var(--radius-sm); font-weight: 600; font-size: .85rem; padding: .5rem 1.1rem; }
.btn-sm { font-size: .78rem; padding: .35rem .8rem; }
.btn-primary { background: var(--teal); border-color: var(--teal); }
.btn-primary:hover, .btn-primary:focus { background: var(--teal-600); border-color: var(--teal-600); }
.btn-primary:active { background: var(--teal-700) !important; border-color: var(--teal-700) !important; }
.btn-success { background: var(--success); border-color: var(--success); } .btn-success:hover { background: #2F855A; border-color: #2F855A; }
.btn-danger { background: var(--danger); border-color: var(--danger); } .btn-danger:hover { background: #C53030; border-color: #C53030; }
.btn-warning { background: #ED8936; border-color: #ED8936; } .btn-warning:hover { background: #DD6B20; border-color: #DD6B20; }
.btn-light, .btn-outline-primary { background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); }
.btn-light:hover, .btn-outline-primary:hover { background: var(--line-soft); border-color: var(--line-strong); color: var(--ink); }
.btn:focus-visible, a:focus-visible { outline: 0; box-shadow: 0 0 0 3px var(--teal-glow); }

/* ---- Forms: Chakra "outline" inputs ---- */
.form-label { font-size: .875rem; font-weight: 500; color: var(--ink-2); margin-bottom: .5rem; letter-spacing: 0; }
.form-control, .form-select { min-height: 40px; font-size: .9rem; background-color: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .5rem 1rem; transition: border-color .15s ease, box-shadow .15s ease; }
.form-control-sm, .form-select-sm { min-height: 32px; border-radius: var(--radius-xs); padding: .25rem .75rem; }
.form-control-lg, .form-select-lg { min-height: 48px; border-radius: 10px; }
.form-control:hover:not(:disabled):not([readonly]), .form-select:hover:not(:disabled) { border-color: var(--line-strong); background-color: var(--surface); }
.form-control:focus, .form-select:focus { border-color: var(--teal); box-shadow: 0 0 0 1px var(--teal); }
.form-control:disabled, .form-control[readonly], .form-select:disabled { background-color: var(--canvas); border-style: solid; opacity: .8; }
.form-control::placeholder { color: var(--text-faint); }
.form-control.is-invalid, .form-select.is-invalid { border-color: var(--danger); }
.form-control.is-invalid:focus, .form-select.is-invalid:focus { box-shadow: 0 0 0 1px var(--danger); }
.invalid-feedback, .text-danger.small { font-size: .8rem; }
.input-group-text { background: var(--canvas); border: 1px solid var(--line); color: var(--text-muted); font-weight: 500; border-radius: var(--radius-sm); }
.input-group:focus-within { box-shadow: 0 0 0 1px var(--teal); border-radius: var(--radius-sm); }
.form-check-input { border: 1px solid var(--line-strong); border-radius: 4px; width: 1.1em; height: 1.1em; }
.form-check-input:checked { background-color: var(--teal); border-color: var(--teal); }
.form-check-input:focus { box-shadow: 0 0 0 3px var(--teal-glow); border-color: var(--teal); }
.form-switch .form-check-input { width: 2.1em; border-radius: 2em; }
.select2-container--bootstrap-5 .select2-selection { min-height: 40px; border: 1px solid var(--line) !important; border-radius: var(--radius-sm) !important; background-color: var(--surface); }
.select2-container--bootstrap-5.select2-container--focus .select2-selection, .select2-container--bootstrap-5.select2-container--open .select2-selection { border-color: var(--teal) !important; box-shadow: 0 0 0 1px var(--teal) !important; }
.select2-container--bootstrap-5 .select2-dropdown { border: 0; border-radius: 12px; box-shadow: var(--shadow-lg); }
.select2-container--bootstrap-5 .select2-results__option--highlighted, .select2-container--bootstrap-5 .select2-results__option[aria-selected=true]:hover { background: var(--teal-tint) !important; color: var(--teal-700) !important; }
.select2-container--bootstrap-5 .select2-results__option--selected, .select2-container--bootstrap-5 .select2-results__option[aria-selected=true] { background: var(--teal) !important; color: #fff !important; }
.flatpickr-calendar { border: 0; border-radius: 12px; box-shadow: var(--shadow-lg); }

/* ---- Tables ---- */
.table th { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-faint); background: transparent; border-bottom: 1px solid var(--line); padding: .75rem 1.4rem; }
.table td { padding: .85rem 1.4rem; border-bottom: 1px solid var(--line-soft); color: var(--ink-2); }
.table tfoot td, .table tfoot th { background: var(--canvas); }
.table-hover tbody tr:hover > * { background: var(--canvas); }

/* ---- Badges, alerts, modals ---- */
.badge-status { border-radius: 8px; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; padding: .35em .7em; }
.badge-status::before { content: none; }
.alert { border-radius: 12px; border-left-width: 1px; box-shadow: none; }
.modal-content { border-radius: 15px; }
.modal-header { background: transparent; border-bottom: 0; padding: 1.25rem 1.5rem .25rem; }
.modal-footer { border-top: 0; }
.dropdown-menu { border: 0; border-radius: 12px; box-shadow: var(--shadow-lg); }
.page-link { border-radius: 8px !important; }
.page-item.active .page-link { background: var(--teal); border-color: var(--teal); }
.breadcrumb { font-size: .85rem; }
.page-title { font-weight: 700; }
