/*!
 * NHSAA Pesa — admin theme
 * Sits on top of Bootstrap 4.6 (grid, modal, dropdown, utilities).
 */

/* ------------------------------------------------------------------
 * Tokens
 * ------------------------------------------------------------------ */
:root {
    --ink-900: #0b1a17;
    --ink-800: #12261f;
    --ink-700: #1b342c;
    --ink-600: #2a4a40;

    --brand-700: #0a5c4a;
    --brand-600: #0d7a5f;
    --brand-500: #12936f;
    --brand-100: #d9f2e9;
    --brand-50:  #eef9f4;

    --accent-500: #e3a12f;
    --accent-100: #fbefd6;

    --bg:        #f4f6f5;
    --surface:   #ffffff;
    --surface-2: #f8faf9;
    --line:      #e3e8e6;
    --line-2:    #edf1ef;

    --text:      #15211d;
    --text-2:    #4c5c56;
    --text-3:    #7d8b86;

    --success:   #138a5b;
    --success-bg:#e2f5ec;
    --warning:   #a8660a;
    --warning-bg:#fdf1dc;
    --danger:    #c0352b;
    --danger-bg: #fce7e5;
    --info:      #1f6fb2;
    --info-bg:   #e3f0fb;

    --radius-sm: 8px;
    --radius:    12px;
    --radius-lg: 16px;

    --shadow-sm: 0 1px 2px rgba(16, 33, 28, .06);
    --shadow:    0 1px 3px rgba(16, 33, 28, .06), 0 6px 16px -6px rgba(16, 33, 28, .10);
    --shadow-lg: 0 20px 48px -12px rgba(16, 33, 28, .28);

    --sidebar-w: 264px;
    --topbar-h:  68px;

    --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ------------------------------------------------------------------
 * Base
 * ------------------------------------------------------------------ */
html { -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--font);
    font-size: 14.5px;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4, h5, h6 { color: var(--text); font-weight: 700; letter-spacing: -.01em; }
a { color: var(--brand-600); }
a:hover { color: var(--brand-700); text-decoration: none; }
code {
    font-family: var(--mono);
    font-size: .82em;
    color: var(--brand-700);
    background: var(--brand-50);
    padding: .1em .4em;
    border-radius: 5px;
}
hr { border-color: var(--line); }
.mono { font-family: var(--mono); font-size: .86em; letter-spacing: -.01em; }
.tabular { font-variant-numeric: tabular-nums; }
.text-muted, .text-3 { color: var(--text-3) !important; }
.text-2 { color: var(--text-2) !important; }
::selection { background: var(--brand-100); }

/* ------------------------------------------------------------------
 * Shell: sidebar + topbar + content
 * ------------------------------------------------------------------ */
.shell { min-height: 100vh; }

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-w);
    background: var(--ink-900);
    color: #c9d6d1;
    display: flex;
    flex-direction: column;
    z-index: 1040;
    transition: transform .25s ease;
}
.sidebar__brand {
    display: flex;
    align-items: center;
    gap: 12px;
    height: var(--topbar-h);
    padding: 0 22px;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
    flex-shrink: 0;
}
.sidebar__brand:hover { color: #fff; }
.brand-mark {
    width: 38px; height: 38px;
    border-radius: 10px;
    display: grid; place-items: center;
    background: var(--brand-600);
    color: #fff;
    font-weight: 800;
    font-size: 17px;
    flex-shrink: 0;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 15.5px; font-weight: 800; letter-spacing: -.01em; }
.brand-text small { font-size: 11.5px; color: #8fa59d; font-weight: 500; }

.sidebar__nav {
    flex: 1;
    overflow-y: auto;
    padding: 14px 14px 20px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.15) transparent;
}
.nav-section {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: #6f877e;
    padding: 18px 12px 8px;
}
.nav-section:first-child { padding-top: 6px; }
.nav-link-x {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    margin: 2px 0;
    border-radius: 9px;
    color: #c9d6d1;
    font-weight: 500;
    font-size: 14px;
    position: relative;
    transition: background .15s, color .15s;
}
.nav-link-x i { font-size: 17px; width: 20px; text-align: center; color: #8fa59d; transition: color .15s; }
.nav-link-x:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-link-x:hover i { color: #fff; }
.nav-link-x.active {
    background: rgba(18, 147, 111, .22);
    color: #fff;
}
.nav-link-x.active i { color: #5fd4a8; }
.nav-link-x.active::before {
    content: "";
    position: absolute;
    left: -14px; top: 8px; bottom: 8px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: #5fd4a8;
}

.sidebar__user {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 14px 18px;
    border-top: 1px solid rgba(255, 255, 255, .06);
    flex-shrink: 0;
}
.sidebar__user .who { flex: 1; min-width: 0; line-height: 1.25; }
.sidebar__user .who strong { display: block; color: #fff; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar__user .who small { color: #8fa59d; font-size: 12px; }
.sidebar__user .logout {
    width: 34px; height: 34px;
    display: grid; place-items: center;
    border-radius: 8px;
    color: #8fa59d;
    transition: background .15s, color .15s;
}
.sidebar__user .logout:hover { background: rgba(255,255,255,.08); color: #fff; }

.sidebar-overlay {
    position: fixed; inset: 0;
    background: rgba(8, 20, 17, .5);
    backdrop-filter: blur(2px);
    z-index: 1035;
    opacity: 0; visibility: hidden;
    transition: opacity .2s, visibility .2s;
}

.main {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 32px;
    background: rgba(244, 246, 245, .82);
    backdrop-filter: saturate(160%) blur(10px);
    -webkit-backdrop-filter: saturate(160%) blur(10px);
    border-bottom: 1px solid var(--line);
}
.topbar__toggle {
    display: none;
    width: 40px; height: 40px;
    border: 1px solid var(--line);
    background: var(--surface);
    border-radius: 10px;
    color: var(--text);
    font-size: 20px;
    align-items: center; justify-content: center;
}
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-3); min-width: 0; }
.crumbs a { color: var(--text-3); }
.crumbs a:hover { color: var(--text); }
.crumbs .sep { opacity: .5; }
.crumbs .current { color: var(--text); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar__right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.topbar__date { font-size: 13px; color: var(--text-3); padding-right: 6px; }

.user-chip {
    display: flex; align-items: center; gap: 10px;
    padding: 4px 10px 4px 4px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s;
}
.user-chip:hover, .user-chip[aria-expanded="true"] { border-color: #cfd8d4; box-shadow: var(--shadow-sm); color: var(--text); }
.user-chip .name { font-size: 13.5px; font-weight: 600; }
.user-chip .bi-chevron-down { font-size: 11px; color: var(--text-3); }

.avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    display: inline-grid; place-items: center;
    font-size: 12.5px; font-weight: 700;
    color: var(--brand-700);
    background: var(--brand-100);
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: .02em;
}
.avatar-sm { width: 30px; height: 30px; font-size: 11px; }
.avatar-lg { width: 72px; height: 72px; font-size: 24px; }
.avatar.dark { background: rgba(95, 212, 168, .16); color: #5fd4a8; }
.avatar.tone-1 { background: #e3f0fb; color: #1f6fb2; }
.avatar.tone-2 { background: #fbefd6; color: #a8660a; }
.avatar.tone-3 { background: #f1e6fb; color: #7a3fb0; }
.avatar.tone-4 { background: #fce7e5; color: #b0372d; }

.content {
    flex: 1;
    padding: 28px 32px 40px;
    max-width: 1440px;
    width: 100%;
}
.footer-x {
    padding: 18px 32px 26px;
    font-size: 12.5px;
    color: var(--text-3);
    display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}

/* ------------------------------------------------------------------
 * Page header
 * ------------------------------------------------------------------ */
.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}
.page-head h1 { font-size: 26px; font-weight: 800; margin: 0; letter-spacing: -.02em; }
.page-head p { margin: 4px 0 0; color: var(--text-2); }
.page-head .actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ------------------------------------------------------------------
 * Cards
 * ------------------------------------------------------------------ */
.card-x {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
}
.card-x__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 18px 22px;
    border-bottom: 1px solid var(--line-2);
}
.card-x__head h2, .card-x__head h3 { font-size: 16px; font-weight: 700; margin: 0; }
.card-x__head p { margin: 2px 0 0; font-size: 13px; color: var(--text-3); }
.card-x__body { padding: 22px; }
.card-x__foot {
    padding: 14px 22px;
    border-top: 1px solid var(--line-2);
    background: var(--surface-2);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap;
}
.card-x__body.flush { padding: 0; }

/* KPI tiles */
.kpi {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 20px 22px;
    box-shadow: var(--shadow-sm);
    height: 100%;
    overflow: hidden;
}
.kpi__icon {
    width: 42px; height: 42px;
    border-radius: 11px;
    display: grid; place-items: center;
    font-size: 20px;
    margin-bottom: 16px;
}
.kpi__label { font-size: 13px; font-weight: 600; color: var(--text-2); margin: 0; }
.kpi__value { font-size: 30px; font-weight: 800; letter-spacing: -.03em; line-height: 1.15; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.kpi__value small { font-size: 15px; font-weight: 700; color: var(--text-3); margin-right: 4px; letter-spacing: 0; }
.kpi__meta { font-size: 12.5px; color: var(--text-3); }
.kpi--hero {
    background: var(--brand-700);
    border-color: var(--brand-700);
    color: #fff;
}
.kpi--hero .kpi__label { color: #cfe9df; }
.kpi--hero .kpi__value { color: #fff; }
.kpi--hero .kpi__value small, .kpi--hero .kpi__meta { color: #a9d6c6; }
.kpi--hero .kpi__icon { background: rgba(255,255,255,.12); color: #fff; }

.tone-brand  { background: var(--brand-50);  color: var(--brand-600); }
.tone-info   { background: var(--info-bg);   color: var(--info); }
.tone-accent { background: var(--accent-100); color: var(--warning); }

/* Balance list */
.balance-list { list-style: none; margin: 0; padding: 0; }
.balance-list li {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 22px;
    border-bottom: 1px solid var(--line-2);
}
.balance-list li:last-child { border-bottom: 0; }
.balance-list .b-icon {
    width: 36px; height: 36px; border-radius: 10px;
    display: grid; place-items: center;
    background: var(--surface-2); border: 1px solid var(--line);
    color: var(--text-2); font-size: 16px; flex-shrink: 0;
}
.balance-list .b-name { flex: 1; min-width: 0; font-weight: 600; font-size: 13.5px; }
.balance-list .b-amt { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.balance-list .b-amt small { color: var(--text-3); font-weight: 600; margin-right: 3px; }
.stamp { font-size: 12.5px; color: var(--text-3); display: inline-flex; align-items: center; gap: 6px; }

/* Empty state */
.empty {
    text-align: center;
    padding: 44px 24px;
    color: var(--text-3);
}
.empty i {
    display: inline-grid; place-items: center;
    width: 56px; height: 56px;
    border-radius: 16px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    font-size: 24px;
    color: var(--text-3);
    margin-bottom: 14px;
}
.empty h4 { font-size: 15px; margin: 0 0 4px; color: var(--text); }
.empty p { margin: 0; font-size: 13.5px; }
.empty.compact { padding: 26px 22px; }

/* ------------------------------------------------------------------
 * Buttons
 * ------------------------------------------------------------------ */
.btn {
    font-weight: 600;
    font-size: 14px;
    border-radius: 10px;
    padding: .55rem 1rem;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn i { font-size: 1.05em; line-height: 1; }
.btn-sm { font-size: 13px; padding: .38rem .75rem; border-radius: 8px; }
.btn-lg { font-size: 15px; padding: .75rem 1.25rem; border-radius: 12px; }
.btn:focus, .btn.focus { box-shadow: 0 0 0 3px rgba(18, 147, 111, .25); }
.btn-primary {
    background: var(--brand-600); border-color: var(--brand-600); color: #fff;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 1px 2px rgba(10,92,74,.3);
}
.btn-primary:hover, .btn-primary:focus { background: var(--brand-700); border-color: var(--brand-700); color: #fff; }
.btn-primary:not(:disabled):not(.disabled):active { background: var(--brand-700); border-color: var(--brand-700); }
.btn-light, .btn-secondary, .btn-outline {
    background: var(--surface); border: 1px solid var(--line); color: var(--text);
    box-shadow: var(--shadow-sm);
}
.btn-light:hover, .btn-secondary:hover, .btn-outline:hover,
.btn-light:focus, .btn-secondary:focus, .btn-outline:focus { background: var(--surface-2); border-color: #cfd8d4; color: var(--text); }
.btn-secondary:not(:disabled):not(.disabled):active { background: var(--line-2); border-color: #cfd8d4; color: var(--text); }
.btn-ghost { background: transparent; border: 1px solid transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--line-2); color: var(--text); }
.btn-danger { background: var(--danger); border-color: var(--danger); }
.btn-soft-danger { background: var(--danger-bg); border: 1px solid transparent; color: var(--danger); }
.btn-soft-danger:hover { background: #f9d4d0; color: #9f2a21; }
.btn-icon { width: 34px; height: 34px; padding: 0; border-radius: 9px; }
.btn-icon.btn-sm { width: 30px; height: 30px; }

/* ------------------------------------------------------------------
 * Forms
 * ------------------------------------------------------------------ */
label, .form-label { font-size: 13.5px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.form-control, .custom-select {
    font-size: 14px;
    height: calc(1.5em + 1.25rem + 2px);
    padding: .6rem .85rem;
    border: 1px solid #d5ddd9;
    border-radius: 10px;
    color: var(--text);
    background-color: var(--surface);
    box-shadow: 0 1px 1px rgba(16,33,28,.03);
    transition: border-color .15s, box-shadow .15s;
}
textarea.form-control { height: auto; min-height: 96px; line-height: 1.5; }
.form-control::placeholder { color: #a0ada8; }
.form-control:focus, .custom-select:focus {
    border-color: var(--brand-500);
    box-shadow: 0 0 0 3px rgba(18, 147, 111, .16);
    color: var(--text);
}
select.form-control {
    -webkit-appearance: none; -moz-appearance: none; appearance: none;
    padding-right: 2.2rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%234c5c56' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .8rem center;
}
.form-group { margin-bottom: 18px; }
.form-hint, .form-text, .form-group > small {
    display: block;
    font-size: 12.5px;
    color: var(--text-3);
    margin-top: 6px;
    line-height: 1.5;
}
.input-icon { position: relative; }
.input-icon > i {
    position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
    color: var(--text-3); font-size: 15px; pointer-events: none;
}
.input-icon > .form-control { padding-left: 2.4rem; }
.input-reveal { position: relative; }
.input-reveal .form-control { padding-right: 2.75rem; }
.input-reveal .reveal {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    width: 32px; height: 32px; border: 0; background: transparent;
    color: var(--text-3); border-radius: 8px; display: grid; place-items: center;
}
.input-reveal .reveal:hover { background: var(--line-2); color: var(--text); }
.input-prefix { display: flex; }
.input-prefix span {
    display: flex; align-items: center;
    padding: 0 .8rem;
    border: 1px solid #d5ddd9; border-right: 0;
    border-radius: 10px 0 0 10px;
    background: var(--surface-2);
    color: var(--text-2); font-weight: 600; font-size: 13px;
}
.input-prefix .form-control { border-radius: 0 10px 10px 0; }

/* Settings sections: label column + fields column */
.form-section {
    display: grid;
    grid-template-columns: minmax(200px, 300px) 1fr;
    gap: 28px;
    padding: 24px 22px;
    border-bottom: 1px solid var(--line-2);
}
.form-section:last-of-type { border-bottom: 0; }
.form-section__intro h3 { font-size: 15px; margin: 0 0 4px; }
.form-section__intro p { font-size: 13px; color: var(--text-3); margin: 0; }
.form-section__fields { max-width: 640px; }
.form-section__fields .form-group:last-child { margin-bottom: 0; }

.placeholders { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.placeholders code { cursor: pointer; border: 1px solid var(--brand-100); }
.placeholders code:hover { background: var(--brand-100); }

/* Switch */
.switch-row {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 18px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-2);
    margin-bottom: 18px;
}
.switch-row strong { display: block; font-size: 14px; }
.switch-row span { font-size: 12.5px; color: var(--text-3); }
.switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; margin: 2px 0 0; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch .track {
    position: absolute; inset: 0; cursor: pointer;
    background: #cdd6d2; border-radius: 999px;
    transition: background .2s;
}
.switch .track::before {
    content: ""; position: absolute; left: 3px; top: 3px;
    width: 18px; height: 18px; border-radius: 50%;
    background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2);
    transition: transform .2s;
}
.switch input:checked + .track { background: var(--brand-500); }
.switch input:checked + .track::before { transform: translateX(20px); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 3px rgba(18,147,111,.25); }

/* Segmented tabs (settings nav) */
.seg {
    display: inline-flex; gap: 4px; padding: 4px;
    background: #e8edeb; border-radius: 12px;
    margin-bottom: 22px;
    max-width: 100%; overflow-x: auto;
}
.seg a {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 14px; border-radius: 9px;
    color: var(--text-2); font-weight: 600; font-size: 13.5px;
    white-space: nowrap;
}
.seg a:hover { color: var(--text); }
.seg a.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.seg a.active i { color: var(--brand-600); }

/* Toolbar (filters + search) */
.toolbar {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    padding: 14px 22px;
    border-bottom: 1px solid var(--line-2);
    background: var(--surface-2);
}
.toolbar form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0; }
.toolbar .search { flex: 1 1 320px; max-width: 460px; }
.toolbar .search .input-icon { flex: 1; }
.toolbar .filters { margin-left: auto; }
.toolbar .form-control { height: 38px; padding-top: .4rem; padding-bottom: .4rem; font-size: 13.5px; }
.toolbar select.form-control { min-width: 140px; }
.chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 6px 4px 10px; border-radius: 999px;
    background: var(--brand-50); color: var(--brand-700);
    font-size: 12.5px; font-weight: 600;
    border: 1px solid var(--brand-100);
}
.chip a { color: var(--brand-700); display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; }
.chip a:hover { background: var(--brand-100); }

/* ------------------------------------------------------------------
 * Tables
 * ------------------------------------------------------------------ */
.table-x { width: 100%; margin: 0; border-collapse: separate; border-spacing: 0; }
.table-x thead th {
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-3);
    background: var(--surface-2);
    padding: 11px 16px;
    border-bottom: 1px solid var(--line);
    border-top: 0;
    white-space: nowrap;
    vertical-align: middle;
}
.table-x tbody td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--line-2);
    border-top: 0;
    vertical-align: middle;
    font-size: 13.5px;
}
.table-x tbody tr:last-child td { border-bottom: 0; }
.table-x tbody tr { transition: background .12s; }
.table-x tbody tr:hover { background: #fafcfb; }
.table-x th:first-child, .table-x td:first-child { padding-left: 22px; }
.table-x th:last-child, .table-x td:last-child { padding-right: 22px; }
.table-x .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table-x .idx { color: var(--text-3); width: 48px; font-variant-numeric: tabular-nums; }
.table-x .nowrap { white-space: nowrap; }
.table-x .amount { font-weight: 700; }
.table-x .amount small { color: var(--text-3); font-weight: 600; font-size: 11px; margin-right: 3px; }
.person { display: flex; align-items: center; gap: 11px; min-width: 150px; }
.person strong { font-weight: 600; display: block; line-height: 1.25; }
.person small { color: var(--text-3); font-size: 12px; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Status pills */
.pill {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 12px; font-weight: 600;
    padding: 3px 10px 3px 8px;
    border-radius: 999px;
    white-space: nowrap;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-success { background: var(--success-bg); color: var(--success); }
.pill-warning { background: var(--warning-bg); color: var(--warning); }
.pill-danger  { background: var(--danger-bg);  color: var(--danger); }
.pill-info    { background: var(--info-bg);    color: var(--info); }
.pill-neutral { background: var(--line-2); color: var(--text-2); }

/* Alerts */
.alert {
    border-radius: 12px; border: 1px solid transparent;
    font-size: 13.5px; padding: 12px 16px;
    display: flex; gap: 10px; align-items: flex-start;
}
.alert i { font-size: 16px; line-height: 1.3; }
.alert-success { background: var(--success-bg); color: #0d6a45; border-color: #c4e9d7; }
.alert-danger  { background: var(--danger-bg);  color: #9f2a21; border-color: #f6cbc6; }
.alert-warning { background: var(--warning-bg); color: #8a5306; border-color: #f6dfb2; }
.alert-info    { background: var(--info-bg);    color: #175a91; border-color: #c7dff3; }

/* Pager */
.pager-x { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 22px; border-top: 1px solid var(--line-2); }
.pagination { margin: 0; gap: 4px; flex-wrap: wrap; }
.pagination .page-item .page-link {
    border: 1px solid var(--line);
    border-radius: 8px !important;
    min-width: 34px; height: 34px;
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0 10px;
    color: var(--text-2);
    font-weight: 600; font-size: 13px;
    background: var(--surface);
}
.pagination .page-item .page-link:hover { background: var(--surface-2); color: var(--text); }
.pagination .page-item.active .page-link { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }

/* ------------------------------------------------------------------
 * DataTables (export buttons + client search on the tables)
 * ------------------------------------------------------------------ */
.dataTables_wrapper { padding: 0; }
.dataTables_wrapper .dt-top {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    padding: 12px 22px;
    border-bottom: 1px solid var(--line-2);
}
.dataTables_wrapper .dt-bottom {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    padding: 12px 22px;
    border-top: 1px solid var(--line-2);
}
.dataTables_wrapper .dataTables_filter { margin: 0; }
.dataTables_wrapper .dataTables_filter label { font-weight: 500; color: var(--text-3); font-size: 13px; margin: 0; display: flex; align-items: center; gap: 8px; }
.dataTables_wrapper .dataTables_filter input {
    height: 34px; border: 1px solid #d5ddd9; border-radius: 9px;
    padding: 0 .75rem; font-size: 13px; outline: none; margin: 0;
}
.dataTables_wrapper .dataTables_filter input:focus { border-color: var(--brand-500); box-shadow: 0 0 0 3px rgba(18,147,111,.16); }
.dataTables_wrapper .dataTables_info { font-size: 12.5px; color: var(--text-3); padding: 0 !important; }
.dt-buttons { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.dt-buttons .dt-button, div.dt-buttons > .dt-button {
    margin: 0 !important;
    background: var(--surface) !important;
    border: 1px solid var(--line) !important;
    border-radius: 8px !important;
    color: var(--text-2) !important;
    font-size: 12.5px !important;
    font-weight: 600 !important;
    padding: 6px 12px !important;
    line-height: 1.4 !important;
    box-shadow: none !important;
    background-image: none !important;
}
.dt-buttons .dt-button:hover { background: var(--surface-2) !important; color: var(--text) !important; border-color: #cfd8d4 !important; }
.dataTables_wrapper .dataTables_paginate { padding: 0 !important; }
.dataTables_wrapper .dataTables_paginate .paginate_button {
    border: 1px solid var(--line) !important;
    background: var(--surface) !important;
    border-radius: 8px !important;
    padding: 5px 11px !important;
    margin-left: 4px !important;
    font-size: 12.5px; font-weight: 600;
    color: var(--text-2) !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: var(--brand-600) !important; border-color: var(--brand-600) !important; color: #fff !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button:hover { background: var(--surface-2) !important; color: var(--text) !important; }
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled { opacity: .45; }
table.dataTable { border-collapse: separate !important; }
table.dataTable thead th, table.dataTable thead td { border-bottom: 1px solid var(--line) !important; }
table.dataTable.no-footer { border-bottom: 0 !important; }
table.dataTable thead .sorting, table.dataTable thead .sorting_asc, table.dataTable thead .sorting_desc { cursor: pointer; }

/* ------------------------------------------------------------------
 * Modal + dropdown
 * ------------------------------------------------------------------ */
.modal-backdrop.show { opacity: .45; background: #08140f; }
.modal-content {
    border: 0;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}
.modal-header { border-bottom: 1px solid var(--line-2); padding: 20px 24px; align-items: center; }
.modal-header .modal-title { font-size: 17px; font-weight: 700; }
.modal-header p { margin: 2px 0 0; font-size: 13px; color: var(--text-3); }
.modal-header .close {
    margin: -6px -8px -6px auto; padding: 0;
    width: 34px; height: 34px; border-radius: 9px;
    display: grid; place-items: center;
    font-size: 22px; font-weight: 400; color: var(--text-3); opacity: 1; text-shadow: none;
}
.modal-header .close:hover { background: var(--line-2); color: var(--text); }
.modal-body { padding: 22px 24px 6px; }
.modal-footer {
    border-top: 1px solid var(--line-2);
    padding: 14px 24px;
    background: var(--surface-2);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.modal-footer > * { margin: 0 0 0 8px; }

.dropdown-menu {
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    padding: 6px;
    min-width: 230px;
    font-size: 13.5px;
}
.dropdown-header-x { padding: 10px 12px 12px; border-bottom: 1px solid var(--line-2); margin-bottom: 6px; }
.dropdown-header-x strong { display: block; font-size: 14px; }
.dropdown-header-x small { color: var(--text-3); }
.dropdown-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 12px; border-radius: 8px; color: var(--text); font-weight: 500;
}
.dropdown-item i { color: var(--text-3); font-size: 15px; }
.dropdown-item:hover, .dropdown-item:focus { background: var(--surface-2); color: var(--text); }
.dropdown-item.danger { color: var(--danger); }
.dropdown-item.danger i { color: var(--danger); }
.dropdown-divider { border-color: var(--line-2); margin: 6px 0; }

/* Toastr */
#toast-container > div {
    border-radius: 12px !important;
    box-shadow: var(--shadow-lg) !important;
    opacity: 1 !important;
    padding: 14px 16px 14px 50px !important;
    font-family: var(--font);
    font-size: 13.5px;
    width: 340px !important;
    background-position: 16px center !important;
}
#toast-container > div:hover { box-shadow: var(--shadow-lg) !important; }
#toast-container > .toast-success { background-color: #0f5f4c !important; }
#toast-container > .toast-error { background-color: #9f2a21 !important; }
#toast-container > .toast-info { background-color: #1a5b91 !important; }
#toast-container > .toast-warning { background-color: #8a5306 !important; }
#toast-container .toast-title { font-weight: 700; margin-bottom: 2px; }

/* Profile */
.profile-card { text-align: center; padding: 30px 22px 22px; }
.profile-card h2 { font-size: 18px; margin: 14px 0 2px; }
.profile-card .handle { color: var(--text-3); font-size: 13.5px; }
.profile-meta { list-style: none; margin: 22px 0 0; padding: 0; text-align: left; border-top: 1px solid var(--line-2); }
.profile-meta li { display: flex; gap: 12px; align-items: center; padding: 12px 2px; border-bottom: 1px solid var(--line-2); font-size: 13.5px; min-width: 0; }
.profile-meta li:last-child { border-bottom: 0; }
.profile-meta i { color: var(--text-3); font-size: 15px; width: 18px; }
.profile-meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-banner {
    height: 86px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    background: var(--brand-700);
    margin: -30px -22px 0;
}
.profile-card .avatar-lg { margin-top: -36px; border: 4px solid var(--surface); box-shadow: var(--shadow); }

/* ------------------------------------------------------------------
 * Auth screens
 * ------------------------------------------------------------------ */
.auth {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    background: var(--surface);
}
.auth__art {
    position: relative;
    background: var(--ink-900);
    color: #fff;
    padding: 48px 56px;
    display: flex; flex-direction: column; justify-content: space-between;
    overflow: hidden;
}
.auth__art > * { position: relative; z-index: 1; }
.auth__brand { display: flex; align-items: center; gap: 12px; color: #fff; }
.auth__brand .brand-text small { color: #9fb6ad; }
.auth__pitch h1 { color: #fff; font-size: 40px; line-height: 1.12; font-weight: 800; letter-spacing: -.03em; max-width: 520px; margin: 0 0 16px; }
.auth__pitch h1 em { font-style: normal; color: #5fd4a8; }
.auth__pitch p { color: #b5c8c1; font-size: 15.5px; max-width: 460px; margin: 0; }
.auth__stats { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 34px; }
.auth__stats div {
    padding: 12px 16px; border-radius: 12px;
    background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08);
    font-size: 13px; color: #c9d6d1; display: flex; align-items: center; gap: 10px;
}
.auth__stats i { color: #5fd4a8; font-size: 16px; }
.auth__foot { font-size: 12.5px; color: #7f978e; }

.auth__panel { display: flex; align-items: center; justify-content: center; padding: 48px 28px; }
.auth__box { width: 100%; max-width: 400px; }
.auth__box h2 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin: 0 0 6px; }
.auth__box .lead-x { color: var(--text-2); margin: 0 0 28px; }
.auth__box .form-control { height: 46px; }
.auth__box .btn-lg { width: 100%; height: 48px; }
.auth__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 22px; font-size: 13.5px; }
.check { display: inline-flex; align-items: center; gap: 9px; font-weight: 500; color: var(--text-2); cursor: pointer; margin: 0; }
.check input { width: 17px; height: 17px; accent-color: var(--brand-600); margin: 0; }
.auth__mobile-brand { display: none; margin-bottom: 30px; }
.auth-pane { display: none; }
.auth-pane.is-active { display: block; animation: fadeUp .28s ease both; }
.back-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13.5px; margin-top: 22px; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Simple centered page (errors) */
.solo { min-height: 100vh; display: grid; place-items: center; padding: 28px; background: var(--bg); }
.solo__card { max-width: 460px; text-align: center; }
.solo__code { font-size: 84px; font-weight: 800; letter-spacing: -.05em; line-height: 1; color: var(--brand-600); }

/* ------------------------------------------------------------------
 * Responsive
 * ------------------------------------------------------------------ */
@media (max-width: 1199.98px) {
    .form-section { grid-template-columns: 1fr; gap: 14px; }
}
@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
    .main { margin-left: 0; }
    .topbar__toggle { display: inline-flex; }
    .sidebar-open .sidebar { transform: none; }
    .sidebar-open .sidebar-overlay { opacity: 1; visibility: visible; }
    .topbar__date { display: none; }
    .auth { grid-template-columns: 1fr; }
    .auth__art { display: none; }
    .auth__mobile-brand { display: flex; }
}
@media (max-width: 575.98px) {
    .topbar { padding: 0 16px; }
    .content { padding: 20px 16px 32px; }
    .footer-x { padding: 16px; }
    .page-head h1 { font-size: 22px; }
    .user-chip .name, .user-chip .bi-chevron-down { display: none; }
    .user-chip { padding: 3px; }
    .card-x__head, .card-x__body, .toolbar, .pager-x, .card-x__foot { padding-left: 16px; padding-right: 16px; }
    .form-section { padding: 20px 16px; }
    .toolbar .filters { margin-left: 0; width: 100%; }
    .toolbar .filters select.form-control { flex: 1; min-width: 0; }
    .toolbar .search { max-width: none; }
    .table-x th:first-child, .table-x td:first-child { padding-left: 16px; }
    .table-x th:last-child, .table-x td:last-child { padding-right: 16px; }
    .balance-list li { padding: 12px 16px; }
    .dataTables_wrapper .dt-top, .dataTables_wrapper .dt-bottom { padding: 12px 16px; }
    .kpi__value { font-size: 26px; }
}

/* DataTables sort indicators */
table.dataTable thead .sorting,
table.dataTable thead .sorting_asc,
table.dataTable thead .sorting_desc { position: relative; padding-right: 26px !important; background-image: none !important; }
table.dataTable thead .sorting::after,
table.dataTable thead .sorting_asc::after,
table.dataTable thead .sorting_desc::after {
    position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
    font-size: 10px; color: #b4c0bb;
}
table.dataTable thead .sorting::after { content: "↕"; }
table.dataTable thead .sorting_asc::after { content: "↑"; color: var(--brand-600); }
table.dataTable thead .sorting_desc::after { content: "↓"; color: var(--brand-600); }

/* Toolbar controls size to content rather than Bootstrap's 100% width */
.toolbar .filters .form-control { width: auto; }
.toolbar .search .form-control { width: 100%; }
.table-x .wrap-md { min-width: 180px; max-width: 260px; }
