/* =====================================================================
   LORD — Salon Management
   ===================================================================== */
:root {
    --lord-black: #111113;
    --lord-charcoal: #1b1b1f;
    --lord-charcoal-2: #26262b;
    --lord-gold: #c9a45c;
    --lord-gold-dark: #a8843f;
    --lord-gold-soft: #f4ecdb;
    --lord-bg: #f7f4ee;
    --lord-surface: #ffffff;
    --lord-text: #1d1d1f;
    --lord-muted: #80796e;
    --lord-border: #ebe5da;
    --lord-green: #1e9e64;
    --lord-green-soft: #e3f5ec;
    --lord-red: #d64545;
    --lord-red-soft: #fbe7e7;
    --lord-orange: #d98a26;
    --lord-orange-soft: #fcefdc;
    --lord-radius: 18px;
    --lord-radius-sm: 12px;
    --lord-shadow: 0 1px 2px rgba(17, 17, 19, .04), 0 8px 24px rgba(17, 17, 19, .06);
    --lord-shadow-lg: 0 12px 40px rgba(17, 17, 19, .14);
    --sidebar-w: 260px;
    --bottomnav-h: 68px;
    --bs-body-font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --bs-body-bg: var(--lord-bg);
    --bs-body-color: var(--lord-text);
    --bs-border-color: var(--lord-border);
    --bs-primary: var(--lord-gold);
    --bs-primary-rgb: 201, 164, 92;
    --bs-link-color: var(--lord-gold-dark);
    --bs-link-hover-color: var(--lord-black);
}

body {
    background: var(--lord-bg);
    font-family: var(--bs-body-font-family);
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; }

.brand-word {
    font-family: 'Cinzel', 'Times New Roman', serif;
    font-weight: 700;
    letter-spacing: .28em;
    color: var(--lord-gold);
}

.text-income, .text-positive { color: var(--lord-green) !important; }
.text-expense, .text-negative { color: var(--lord-red) !important; }
.text-withdrawal, .text-pending { color: var(--lord-orange) !important; }
.text-muted { color: var(--lord-muted) !important; }
.tnum { font-variant-numeric: tabular-nums; }

/* ---------- App shell ---------- */
.lord-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-w);
    background: linear-gradient(180deg, var(--lord-black), var(--lord-charcoal));
    color: #d9d4ca;
    display: flex;
    flex-direction: column;
    z-index: 1030;
    padding: 28px 18px 18px;
}
.lord-sidebar .brand { padding: 0 12px 28px; }
.lord-sidebar .brand .brand-word { font-size: 28px; display: block; }
.lord-sidebar .brand small {
    color: #8e887d;
    font-size: 11px;
    letter-spacing: .22em;
    text-transform: uppercase;
}
.lord-nav { list-style: none; margin: 0; padding: 0; }
.lord-nav a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    margin-bottom: 4px;
    border-radius: var(--lord-radius-sm);
    color: #b9b3a8;
    font-weight: 600;
    font-size: 14.5px;
    transition: background .15s, color .15s;
}
.lord-nav a i { font-size: 18px; width: 22px; text-align: center; }
.lord-nav a:hover { background: rgba(255, 255, 255, .05); color: #fff; }
.lord-nav a.active {
    background: linear-gradient(90deg, rgba(201, 164, 92, .22), rgba(201, 164, 92, .04));
    color: var(--lord-gold);
    box-shadow: inset 3px 0 0 var(--lord-gold);
}
.lord-sidebar .sidebar-footer {
    margin-top: 0;
    border-top: 1px solid rgba(255, 255, 255, .07);
    padding: 16px 12px 0;
    font-size: 13px;
}
.avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--lord-gold-soft);
    color: var(--lord-gold-dark);
    font-weight: 800;
    flex-shrink: 0;
}
.lord-sidebar .avatar { background: rgba(201, 164, 92, .18); color: var(--lord-gold); }

.lord-main { min-height: 100vh; }
@media (min-width: 992px) {
    .lord-main { margin-left: var(--sidebar-w); }
}

.lord-topbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    background: rgba(247, 244, 238, .88);
    backdrop-filter: saturate(160%) blur(12px);
    -webkit-backdrop-filter: saturate(160%) blur(12px);
    border-bottom: 1px solid var(--lord-border);
    padding: 14px 28px;
    display: flex;
    align-items: center;
    gap: 16px;
}
.lord-topbar h1 { font-size: 22px; font-weight: 800; margin: 0; letter-spacing: -.01em; }
.lord-topbar .subtitle { color: var(--lord-muted); font-size: 13px; }
.lord-topbar-mobile {
    display: none;
    background: var(--lord-black);
    color: #fff;
    padding: 12px 16px;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1025;
}
.lord-topbar-mobile .brand-word { font-size: 20px; }
.lord-topbar-mobile .icon-btn { color: #d9d4ca; }

.lord-content { padding: 28px; padding-bottom: 48px; max-width: 1480px; }

@media (max-width: 991.98px) {
    .lord-topbar-mobile { display: flex; }
    .lord-topbar { position: static; padding: 16px 16px 8px; border: 0; background: transparent; backdrop-filter: none; }
    .lord-topbar h1 { font-size: 20px; }
    .lord-content { padding: 8px 16px calc(var(--bottomnav-h) + 36px); }
}

.icon-btn {
    border: 0;
    background: transparent;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--lord-text);
}
.icon-btn:hover { background: rgba(0, 0, 0, .05); }

/* ---------- Bottom nav (mobile) ---------- */
.lord-bottomnav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: calc(var(--bottomnav-h) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--lord-black);
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    z-index: 1030;
    box-shadow: 0 -6px 24px rgba(0, 0, 0, .18);
}
.lord-bottomnav a, .lord-bottomnav button {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: #8e887d;
    font-size: 11px;
    font-weight: 600;
    background: none;
    border: 0;
}
.lord-bottomnav a i { font-size: 21px; }
.lord-bottomnav a.active { color: var(--lord-gold); }
.lord-bottomnav .fab-wrap { position: relative; }
.lord-fab {
    width: 58px !important;
    height: 58px;
    flex: none !important;
    margin-top: -22px;
    border-radius: 50% !important;
    background: linear-gradient(145deg, #d8b774, var(--lord-gold-dark)) !important;
    color: var(--lord-black) !important;
    font-size: 28px !important;
    box-shadow: 0 8px 22px rgba(201, 164, 92, .45);
    border: 4px solid var(--lord-black) !important;
}

/* ---------- Quick actions sheet ---------- */
.quick-sheet { border-radius: 24px 24px 0 0 !important; height: auto !important; }
.quick-action {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border-radius: var(--lord-radius-sm);
    background: var(--lord-bg);
    color: var(--lord-text);
    font-weight: 700;
    margin-bottom: 10px;
    border: 1px solid var(--lord-border);
    width: 100%;
    text-align: left;
}
.quick-action .qa-icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}
.quick-action small { display: block; font-weight: 500; color: var(--lord-muted); }
.qa-income .qa-icon { background: var(--lord-green-soft); color: var(--lord-green); }
.qa-expense .qa-icon { background: var(--lord-red-soft); color: var(--lord-red); }
.qa-withdrawal .qa-icon { background: var(--lord-orange-soft); color: var(--lord-orange); }

/* ---------- Cards ---------- */
.lord-card {
    background: var(--lord-surface);
    border: 1px solid var(--lord-border);
    border-radius: var(--lord-radius);
    box-shadow: var(--lord-shadow);
}
.lord-card-body { padding: 22px; }
.lord-card-header {
    padding: 18px 22px;
    border-bottom: 1px solid var(--lord-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.lord-card-header h2, .section-title {
    font-size: 16px;
    font-weight: 800;
    margin: 0;
    letter-spacing: -.01em;
}
.section-title { margin: 32px 0 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-title small { font-weight: 600; color: var(--lord-muted); font-size: 13px; }

.stat-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
@media (max-width: 575.98px) {
    .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}
.stat-card {
    background: var(--lord-surface);
    border: 1px solid var(--lord-border);
    border-radius: var(--lord-radius);
    padding: 20px;
    box-shadow: var(--lord-shadow);
    position: relative;
    overflow: hidden;
    min-width: 0;
}
.stat-card .stat-label {
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--lord-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}
.stat-card .stat-icon {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    background: var(--lord-gold-soft);
    color: var(--lord-gold-dark);
    flex-shrink: 0;
}
.stat-card .stat-value {
    font-size: 26px;
    font-weight: 800;
    margin-top: 12px;
    letter-spacing: -.02em;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.stat-card .stat-foot { font-size: 12.5px; color: var(--lord-muted); margin-top: 6px; }
.stat-card.tone-income .stat-icon { background: var(--lord-green-soft); color: var(--lord-green); }
.stat-card.tone-expense .stat-icon { background: var(--lord-red-soft); color: var(--lord-red); }
.stat-card.tone-pending .stat-icon { background: var(--lord-orange-soft); color: var(--lord-orange); }
.stat-card.tone-dark {
    background: linear-gradient(145deg, var(--lord-black), var(--lord-charcoal-2));
    color: #fff;
    border-color: var(--lord-black);
}
.stat-card.tone-dark .stat-label, .stat-card.tone-dark .stat-foot { color: #a8a195; }
.stat-card.tone-dark .stat-icon { background: rgba(201, 164, 92, .18); color: var(--lord-gold); }
@media (max-width: 575.98px) {
    .stat-card { padding: 14px; border-radius: 16px; }
    .stat-card .stat-value { font-size: 19px; margin-top: 8px; }
    .stat-card .stat-label { font-size: 10px; letter-spacing: .06em; }
    .stat-card .stat-icon { width: 26px; height: 26px; font-size: 13px; }
    .stat-card .stat-foot { font-size: 11px; }
}
.delta { font-weight: 700; font-size: 12px; }
.delta.up { color: var(--lord-green); }
.delta.down { color: var(--lord-red); }

/* Branch / partner cards */
.entity-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
@media (max-width: 575.98px) { .entity-grid { grid-template-columns: 1fr; gap: 12px; } }
.entity-card {
    display: block;
    color: inherit;
    background: var(--lord-surface);
    border: 1px solid var(--lord-border);
    border-radius: var(--lord-radius);
    box-shadow: var(--lord-shadow);
    padding: 20px;
    transition: transform .15s, box-shadow .15s, border-color .15s;
}
a.entity-card:hover { transform: translateY(-2px); box-shadow: var(--lord-shadow-lg); border-color: var(--lord-gold); color: inherit; }
.entity-card .entity-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.entity-card .entity-head h3 { font-size: 16px; font-weight: 800; margin: 0; }
.entity-card .entity-head small { color: var(--lord-muted); font-size: 12px; }
.entity-mark {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: var(--lord-black);
    color: var(--lord-gold);
    font-family: 'Cinzel', serif;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
}
.kv { display: flex; justify-content: space-between; align-items: baseline; padding: 6px 0; font-size: 14px; gap: 12px; }
.kv span:first-child { color: var(--lord-muted); }
.kv span:last-child { font-weight: 700; font-variant-numeric: tabular-nums; }
.kv.total { border-top: 1px dashed var(--lord-border); margin-top: 6px; padding-top: 10px; font-size: 15.5px; }
.kv.total span:first-child { color: var(--lord-text); font-weight: 700; }

/* ---------- Filters ---------- */
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filter-bar .form-select, .filter-bar .form-control { width: auto; min-width: 120px; }
@media (max-width: 575.98px) {
    .filter-bar { display: grid; grid-template-columns: 1fr 1fr; }
    .filter-bar .form-select, .filter-bar .form-control { width: 100%; min-width: 0; }
    .filter-bar .span-2 { grid-column: span 2; }
}

/* ---------- Forms & buttons ---------- */
.form-control, .form-select {
    border-radius: var(--lord-radius-sm);
    border-color: var(--lord-border);
    padding: .65rem .9rem;
    background-color: #fff;
}
.form-control:focus, .form-select:focus, .form-check-input:focus {
    border-color: var(--lord-gold);
    box-shadow: 0 0 0 .2rem rgba(201, 164, 92, .2);
}
.form-label { font-weight: 700; font-size: 13px; margin-bottom: 6px; }
.form-check-input:checked { background-color: var(--lord-gold); border-color: var(--lord-gold); }
@media (max-width: 767.98px) {
    .form-control, .form-select { padding: .8rem .95rem; font-size: 16px; }
    .modal .btn, .lord-form .btn-lg-mobile { padding: .8rem 1rem; }
}
.input-money { font-size: 22px !important; font-weight: 800; font-variant-numeric: tabular-nums; }
.input-group-text { border-radius: var(--lord-radius-sm); background: var(--lord-gold-soft); border-color: var(--lord-border); font-weight: 700; }

.btn { border-radius: var(--lord-radius-sm); font-weight: 700; padding: .6rem 1.1rem; }
.btn-sm { padding: .35rem .75rem; border-radius: 10px; }
.btn-gold {
    background: linear-gradient(145deg, #d6b470, var(--lord-gold-dark));
    color: var(--lord-black);
    border: 0;
    box-shadow: 0 4px 14px rgba(201, 164, 92, .35);
}
.btn-gold:hover, .btn-gold:focus { color: var(--lord-black); filter: brightness(1.05); }
.btn-dark { background: var(--lord-black); border-color: var(--lord-black); }
.btn-outline-dark { border-color: var(--lord-border); color: var(--lord-text); background: #fff; }
.btn-outline-dark:hover { background: var(--lord-black); border-color: var(--lord-black); }
.btn-pay { background: var(--lord-black); color: var(--lord-gold); border: 0; letter-spacing: .08em; }
.btn-pay:hover { background: var(--lord-charcoal-2); color: #e7c989; }

/* Segmented radio choice */
.choice-grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.choice-grid input { position: absolute; opacity: 0; pointer-events: none; }
.choice-grid label {
    border: 1.5px solid var(--lord-border);
    background: #fff;
    border-radius: var(--lord-radius-sm);
    padding: 12px;
    font-weight: 700;
    font-size: 13.5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 100%;
    transition: border-color .12s, background .12s;
}
.choice-grid label i { color: var(--lord-muted); font-size: 16px; }
.choice-grid input:checked + label { border-color: var(--lord-gold); background: var(--lord-gold-soft); }
.choice-grid input:checked + label i { color: var(--lord-gold-dark); }
.choice-grid input:focus-visible + label { box-shadow: 0 0 0 .2rem rgba(201, 164, 92, .3); }

.check-list { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.check-list .check-item {
    border: 1px solid var(--lord-border);
    border-radius: var(--lord-radius-sm);
    padding: 10px 12px;
    background: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
}
.check-list .check-item .form-control { padding: .4rem .6rem; font-size: 15px; }

.alloc-summary {
    background: var(--lord-bg);
    border-radius: var(--lord-radius-sm);
    padding: 10px 14px;
    font-size: 13.5px;
    font-weight: 700;
}
.alloc-summary.ok { background: var(--lord-green-soft); color: var(--lord-green); }
.alloc-summary.bad { background: var(--lord-red-soft); color: var(--lord-red); }

/* ---------- Tables ---------- */
.lord-table { width: 100%; margin: 0; font-size: 14px; }
.lord-table th {
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--lord-muted);
    font-weight: 800;
    padding: 12px 16px;
    border-bottom: 1px solid var(--lord-border);
    white-space: nowrap;
    background: #fcfbf8;
}
.lord-table td { padding: 14px 16px; border-bottom: 1px solid var(--lord-border); vertical-align: middle; }
.lord-table tbody tr:last-child td { border-bottom: 0; }
.lord-table tbody tr:hover td { background: #fcfaf6; }
.lord-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lord-table tfoot td { font-weight: 800; border-top: 2px solid var(--lord-border); background: #fcfbf8; }
.lord-table tr.is-reversed td { opacity: .55; }
.lord-table tr.is-reversed td .strike { text-decoration: line-through; }
.cell-title { font-weight: 700; }
.cell-sub { font-size: 12.5px; color: var(--lord-muted); }

/* Stack tables into cards on phones */
@media (max-width: 767.98px) {
    .table-stack thead { display: none; }
    .table-stack, .table-stack tbody, .table-stack tr, .table-stack td, .table-stack tfoot { display: block; width: 100%; }
    .table-stack tr { padding: 12px 16px; border-bottom: 1px solid var(--lord-border); }
    .table-stack tbody tr:last-child { border-bottom: 0; }
    .table-stack td {
        border: 0 !important;
        padding: 3px 0 !important;
        display: flex;
        justify-content: space-between;
        gap: 12px;
        text-align: right !important;
    }
    .table-stack td::before {
        content: attr(data-label);
        font-size: 12px;
        font-weight: 700;
        color: var(--lord-muted);
        text-align: left;
    }
    .table-stack td.stack-head { display: block; text-align: left !important; padding-bottom: 6px !important; }
    .table-stack td.stack-head::before { display: none; }
    .table-stack td.stack-actions { justify-content: flex-end; padding-top: 10px !important; }
    .table-stack td.stack-actions::before { display: none; }
    .table-stack tfoot tr { background: #fcfbf8; }
    .table-stack tbody tr:hover td { background: transparent; }
}

/* ---------- Badges ---------- */
.lord-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
    white-space: nowrap;
}
.badge-paid { background: var(--lord-green-soft); color: var(--lord-green); }
.badge-unpaid { background: var(--lord-red-soft); color: var(--lord-red); }
.badge-partial { background: var(--lord-orange-soft); color: var(--lord-orange); }
.badge-void { background: #eeebe5; color: #7a746b; }
.badge-gold { background: var(--lord-gold-soft); color: var(--lord-gold-dark); }
.badge-overdue { background: var(--lord-red); color: #fff; }

/* Progress (paid ratio) */
.pay-progress { height: 6px; border-radius: 99px; background: var(--lord-red-soft); overflow: hidden; }
.pay-progress > div { height: 100%; background: var(--lord-green); border-radius: 99px; }

/* ---------- Outstanding list ---------- */
.due-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 22px;
    border-bottom: 1px solid var(--lord-border);
}
.due-item:last-child { border-bottom: 0; }
.due-item .due-main { flex: 1; min-width: 0; }
.due-item .due-amounts { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 575.98px) {
    .due-item { flex-wrap: wrap; padding: 14px 16px; gap: 10px; }
    .due-item .due-amounts { text-align: left; flex: 1; }
}

/* ---------- Modals ---------- */
.modal-content { border: 0; border-radius: 22px; box-shadow: var(--lord-shadow-lg); }
.modal-header { border-bottom: 1px solid var(--lord-border); padding: 18px 22px; }
.modal-title { font-weight: 800; font-size: 18px; }
.modal-body { padding: 22px; }
.modal-footer { border-top: 1px solid var(--lord-border); padding: 14px 22px; }
@media (max-width: 575.98px) {
    .modal-dialog { margin: 0; min-height: 100%; display: flex; align-items: flex-end; }
    .modal-dialog .modal-content { border-radius: 22px 22px 0 0; max-height: 94vh; overflow-y: auto; width: 100%; }
    .modal-footer { position: sticky; bottom: 0; background: #fff; }
    .modal-footer .btn { flex: 1; }
}

/* ---------- Misc ---------- */
.empty-state { text-align: center; padding: 48px 20px; color: var(--lord-muted); }
.empty-state i { font-size: 36px; color: var(--lord-gold); display: block; margin-bottom: 10px; }
.lord-toast {
    position: fixed;
    left: 50%;
    top: 20px;
    transform: translateX(-50%) translateY(-20px);
    background: var(--lord-black);
    color: #fff;
    padding: 12px 20px;
    border-radius: 14px;
    box-shadow: var(--lord-shadow-lg);
    z-index: 2000;
    opacity: 0;
    transition: opacity .2s, transform .2s;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: calc(100vw - 32px);
}
.lord-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.lord-toast i { color: var(--lord-gold); }
.lord-toast.error i { color: #ff8a8a; }
.info-note {
    background: var(--lord-gold-soft);
    border-radius: var(--lord-radius-sm);
    padding: 12px 16px;
    font-size: 13.5px;
    color: #6e5a2f;
}
.info-note i { color: var(--lord-gold-dark); }
.nav-pills-lord { gap: 6px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.nav-pills-lord::-webkit-scrollbar { display: none; }
.nav-pills-lord .nav-link {
    border-radius: 999px;
    color: var(--lord-muted);
    font-weight: 700;
    white-space: nowrap;
    background: #fff;
    border: 1px solid var(--lord-border);
    padding: .45rem 1rem;
    font-size: 14px;
}
.nav-pills-lord .nav-link.active { background: var(--lord-black); color: var(--lord-gold); border-color: var(--lord-black); }
.breakdown-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--lord-border); }
.breakdown-row:last-child { border-bottom: 0; }
.breakdown-row.total { font-weight: 800; font-size: 16px; border-top: 2px solid var(--lord-text); border-bottom: 0; margin-top: 4px; }
.breakdown-row.sub { padding-left: 16px; color: var(--lord-muted); font-size: 14px; }
.json-view { font-size: 12px; background: var(--lord-bg); border-radius: 10px; padding: 10px; max-height: 260px; overflow: auto; white-space: pre-wrap; word-break: break-word; }

/* ---------- Login ---------- */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 20% 10%, #2a2620 0, var(--lord-black) 55%);
    padding: 24px;
}
.login-card { width: 100%; max-width: 400px; background: #fff; border-radius: 26px; padding: 40px 32px; box-shadow: 0 30px 80px rgba(0, 0, 0, .45); }
.login-card .brand-word { font-size: 38px; display: block; text-align: center; }

/* ---------- Language switch ---------- */
.lang-switch {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    margin-bottom: 10px;
    border-radius: var(--lord-radius-sm);
    border: 1px solid rgba(255, 255, 255, .08);
    color: #b9b3a8;
    font-weight: 700;
    font-size: 14px;
}
.lang-switch:hover { color: var(--lord-gold); border-color: rgba(201, 164, 92, .4); }

/* ---------- Right-to-left (Arabic) ---------- */
[dir="rtl"] body, [dir="rtl"] .form-control, [dir="rtl"] .form-select, [dir="rtl"] .btn {
    font-family: 'Tajawal', 'Manrope', system-ui, sans-serif;
}
[dir="rtl"] body { font-size: 15.5px; }
[dir="rtl"] .brand-word { letter-spacing: .28em; }
[dir="rtl"] .stat-card .stat-label, [dir="rtl"] .lord-table th, [dir="rtl"] .lord-badge { letter-spacing: 0; }
[dir="rtl"] .lord-sidebar { inset: 0 0 0 auto; }
@media (min-width: 992px) {
    [dir="rtl"] .lord-main { margin-left: 0; margin-right: var(--sidebar-w); }
}
[dir="rtl"] .lord-nav a.active {
    background: linear-gradient(270deg, rgba(201, 164, 92, .22), rgba(201, 164, 92, .04));
    box-shadow: inset -3px 0 0 var(--lord-gold);
}
[dir="rtl"] .quick-action { text-align: right; }
[dir="rtl"] .lord-table .num { text-align: left; }
[dir="rtl"] .due-item .due-amounts { text-align: left; }
[dir="rtl"] .due-item .pay-progress { margin-left: 0 !important; margin-right: auto; }
[dir="rtl"] .bi-chevron-right, [dir="rtl"] .bi-arrow-left, [dir="rtl"] .bi-box-arrow-right,
[dir="rtl"] .bi-arrow-down-left, [dir="rtl"] .bi-arrow-down-left-circle { display: inline-block; transform: scaleX(-1); }
/* Amounts, dates and codes always read left-to-right */
[dir="rtl"] input[type="date"], [dir="rtl"] input[type="month"], [dir="rtl"] input[type="email"],
[dir="rtl"] input[inputmode="decimal"], [dir="rtl"] input[inputmode="tel"] { direction: ltr; text-align: right; }
@media (max-width: 767.98px) {
    [dir="rtl"] .table-stack td { text-align: left !important; }
    [dir="rtl"] .table-stack td::before { text-align: right; }
    [dir="rtl"] .table-stack td.stack-head { text-align: right !important; }
}
@media (max-width: 575.98px) {
    [dir="rtl"] .due-item .due-amounts { text-align: right; }
}

@media print {
    .lord-sidebar, .lord-topbar-mobile, .lord-bottomnav, .no-print, .lord-topbar .btn { display: none !important; }
    .lord-main { margin: 0 !important; }
    .lord-content { padding: 0 !important; }
    .lord-card, .stat-card { box-shadow: none !important; }
    body { background: #fff; }
}
