/* ============================================================
   Dani Rent A Car · Premium Admin Theme v2
   Deep navy · champagne gold · warm porcelain surfaces
   ============================================================ */

:root {
    --ink: #0b1526;
    --ink-2: #122036;
    --ink-3: #1b2c46;
    --gold: #c8a24a;
    --gold-deep: #9c772b;
    --gold-light: #e8d196;
    --gold-wash: #faf5e8;
    --bg: #f2f4f8;
    --card: #ffffff;
    --text: #1a2537;
    --muted: #6f7b8d;
    --line: #e4e9f1;
    --line-soft: #eef1f6;
    --green: #178a5f;
    --green-wash: #e7f6ef;
    --blue: #2a63d4;
    --blue-wash: #eaf0fd;
    --amber: #a9680c;
    --amber-wash: #fcf2e0;
    --red: #c23f3f;
    --red-wash: #fdecec;
    --radius: 16px;
    --radius-sm: 11px;
    --shadow-sm: 0 1px 2px rgba(11, 21, 38, .04), 0 4px 14px -8px rgba(11, 21, 38, .10);
    --shadow: 0 1px 2px rgba(11, 21, 38, .04), 0 16px 36px -24px rgba(11, 21, 38, .22);
    --shadow-lg: 0 30px 70px -28px rgba(11, 21, 38, .34);
    --sidebar-w: 264px;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-display: 'Plus Jakarta Sans', 'Inter', sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
    font-family: var(--font-body);
    color: var(--text);
    background:
        radial-gradient(1100px 520px at 88% -8%, rgba(200, 162, 74, .07), transparent 62%),
        var(--bg);
    font-size: 13.5px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6, .page-title, .brand-text strong, .stat-value {
    font-family: var(--font-display);
    letter-spacing: -0.018em;
}

a { text-decoration: none; color: var(--gold-deep); }
a:hover { color: var(--ink); }

::selection { background: rgba(200, 162, 74, .28); }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #c7cfdb; border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #aeb8c8; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------- Shell ---------------- */

.app-body { min-height: 100vh; }

.app-shell { display: flex; min-height: 100vh; }

.app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-w);
    background:
        radial-gradient(760px 380px at -18% -12%, rgba(200, 162, 74, .20), transparent 62%),
        radial-gradient(520px 320px at 120% 108%, rgba(46, 99, 212, .10), transparent 60%),
        linear-gradient(180deg, #0c1728 0%, #0a1322 58%, #0b1729 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    padding: 20px 14px 16px;
    z-index: 1040;
    border-right: 1px solid rgba(255, 255, 255, .045);
}

.app-sidebar::after {
    content: "";
    position: absolute;
    right: -1px;
    top: 0;
    bottom: 0;
    width: 1px;
    background: linear-gradient(180deg, transparent, rgba(200, 162, 74, .32), transparent);
    pointer-events: none;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 10px 20px;
    margin-bottom: 4px;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.brand:hover { color: #fff; }

.brand-mark {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: linear-gradient(145deg, #f3e2ae, #c8a24a 56%, #9a7226);
    color: #0a1220;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 24px;
    font-weight: 700;
    box-shadow: 0 8px 20px rgba(200, 162, 74, .28), inset 0 1px 0 rgba(255, 255, 255, .55);
}

.brand-logo {
    width: 42px;
    height: 42px;
    object-fit: contain;
    border-radius: 11px;
    background: #fff;
    padding: 4px;
}

.brand-text { display: flex; flex-direction: column; gap: 2px; line-height: 1.25; min-width: 0; }
.brand-text strong {
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.brand-text small {
    color: rgba(232, 209, 150, .66);
    font-size: 8.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .12em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 2px 4px 0 0;
    margin-right: -4px;
}
.sidebar-scroll::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .16); background-clip: content-box; }

.nav-caption {
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .30);
    margin: 14px 12px 6px;
}
.nav-caption:first-child { margin-top: 10px; }

.sidebar-nav { gap: 2px; }

.sidebar-nav .nav-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 11px;
    color: rgba(255, 255, 255, .66);
    font-size: 13px;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 9px;
    transition: background .16s ease, color .16s ease;
}

.sidebar-nav .nav-link i {
    font-size: 15.5px;
    opacity: .8;
    width: 19px;
    text-align: center;
    transition: color .16s ease, opacity .16s ease;
}

.sidebar-nav .nav-link:hover {
    background: rgba(255, 255, 255, .05);
    color: #fff;
}

.sidebar-nav .nav-link.active {
    background: linear-gradient(90deg, rgba(200, 162, 74, .18), rgba(200, 162, 74, .035));
    color: #f6e9c4;
    font-weight: 600;
}

.sidebar-nav .nav-link.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 0 4px 4px 0;
    background: linear-gradient(180deg, var(--gold-light), var(--gold));
    box-shadow: 0 0 12px rgba(200, 162, 74, .55);
}

.sidebar-nav .nav-link.active i { color: var(--gold-light); opacity: 1; }

.sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, .07);
    padding-top: 14px;
    margin-top: 12px;
}

.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 4px 6px; }
.sidebar-user-text { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; flex: 1; }
.sidebar-user-text strong {
    color: #fff;
    font-size: 12.5px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-user-text small { color: rgba(255, 255, 255, .40); font-size: 10.5px; }

.sidebar-logout {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    color: rgba(255, 255, 255, .55);
    background: rgba(255, 255, 255, .05);
    transition: .16s ease;
}
.sidebar-logout:hover { background: rgba(194, 63, 63, .18); color: #ffb4b4; }

.sidebar-version {
    text-align: center;
    color: rgba(255, 255, 255, .24);
    font-size: 9px;
    letter-spacing: .14em;
    text-transform: uppercase;
    margin: 12px 0 0;
}

.avatar {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: linear-gradient(145deg, #f3e2ae, #c8a24a);
    color: #0a1220;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: .02em;
}

.avatar-dark {
    background: rgba(255, 255, 255, .07);
    border: 1px solid rgba(232, 209, 150, .30);
    color: var(--gold-light);
}

.avatar-sm { width: 30px; height: 30px; flex-basis: 30px; font-size: 11px; }

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

/* ---------------- Topbar ---------------- */

.topbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 10px 30px;
    background: rgba(255, 255, 255, .88);
    backdrop-filter: blur(16px) saturate(1.2);
    border-bottom: 1px solid var(--line);
}

.topbar-left { display: flex; align-items: center; gap: 13px; min-width: 0; }
.topbar-left > div { min-width: 0; }

.page-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--ink);
    margin: 0;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.page-subtitle {
    font-size: 11.5px;
    color: var(--muted);
    margin: 3px 0 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-right { display: flex; align-items: center; gap: 9px; flex: 0 0 auto; }

.topbar-date {
    align-items: center;
    gap: 7px;
    font-size: 11.5px;
    font-weight: 500;
    color: var(--muted);
    background: #fbfcfe;
    border: 1px solid var(--line);
    padding: 8px 12px;
    border-radius: 9px;
    white-space: nowrap;
}

.topbar-date i { color: var(--gold-deep); }

.btn-icon {
    width: 38px;
    height: 38px;
    display: inline-grid;
    place-items: center;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: #fff;
    color: #455063;
    font-size: 16px;
    line-height: 1;
    transition: border-color .16s ease, background .16s ease, color .16s ease, box-shadow .16s ease;
}
.btn-icon:hover { border-color: #ccd4e0; background: #fbfcfe; color: var(--ink); box-shadow: var(--shadow-sm); }
.btn-icon:focus-visible { outline: 0; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(200, 162, 74, .18); }

.notif-dot {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--red);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    display: grid;
    place-items: center;
    border: 2px solid #fff;
}

.user-chip { display: flex; align-items: center; gap: 9px; padding-left: 7px; margin-left: 2px; border-left: 1px solid var(--line); }
.user-chip strong { display: block; font-size: 12px; font-weight: 600; color: var(--text); line-height: 1.25; }
.user-chip small { display: block; font-size: 9.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .09em; line-height: 1.3; }

/* ---------------- Page ---------------- */

.page-content {
    flex: 1;
    width: 100%;
    max-width: 1500px;
    margin: 0 auto;
    padding: 26px 30px 42px;
}

.app-footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 30px 20px;
    color: #98a3b3;
    font-size: 11px;
    border-top: 1px solid var(--line-soft);
}

.app-alert {
    border: 1px solid transparent;
    border-radius: 12px;
    font-size: 12.5px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    box-shadow: var(--shadow-sm);
}
.app-alert i { font-size: 16px; }
.app-alert .btn-close { margin-left: auto; font-size: 9px; }
.alert-success { background: var(--green-wash); border-color: #cdeadd; color: #106844; }
.alert-danger { background: var(--red-wash); border-color: #f6d2d2; color: #a12e2e; }
.alert-warning { background: var(--amber-wash); border-color: #f3e0bf; color: #85540a; }
.alert-info { background: var(--blue-wash); border-color: #d5e2fa; color: #1f4fa8; }

/* ---------------- Buttons ---------------- */

.btn {
    border-radius: 10px;
    font-size: 12.5px;
    font-weight: 600;
    padding: 9px 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    line-height: 1.3;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease, color .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn i { font-size: 14px; }
.btn:focus-visible { outline: 0; box-shadow: 0 0 0 3.5px rgba(200, 162, 74, .22); }

.btn-gold {
    background: linear-gradient(135deg, #d8b967 0%, #c8a24a 52%, #b18430 100%);
    color: #131c2b;
    border: 1px solid #bf9942;
    box-shadow: 0 6px 16px -8px rgba(200, 162, 74, .55), inset 0 1px 0 rgba(255, 255, 255, .38);
}
.btn-gold:hover, .btn-gold:focus {
    background: linear-gradient(135deg, #e4c87f 0%, #d2ad55 52%, #be9138 100%);
    color: #0a1220;
    box-shadow: 0 10px 22px -10px rgba(200, 162, 74, .7);
}

.btn-dark {
    background: linear-gradient(135deg, #17253c, #0b1526);
    border: 1px solid #0b1526;
    color: #fff;
    box-shadow: 0 8px 18px -10px rgba(10, 18, 32, .55);
}
.btn-dark:hover { background: #122036; color: #fff; }

.btn-soft {
    background: #f3f5f9;
    border: 1px solid #e5eaf2;
    color: #3c485a;
}
.btn-soft:hover { background: #eaedf4; color: var(--ink); }

.btn-outline-app {
    background: #fff;
    border: 1px solid var(--line);
    color: #455063;
}
.btn-outline-app:hover { border-color: #ccd4e0; background: #fbfcfe; color: var(--ink); }

.btn-danger-soft {
    background: var(--red-wash);
    border: 1px solid #f6cccc;
    color: #b93636;
}
.btn-danger-soft:hover { background: #fbdcdc; color: #a12b2b; }

.btn-sm { padding: 6px 11px; font-size: 11.5px; border-radius: 8px; }
.btn-sm i { font-size: 13px; }
.btn-lg { padding: 12px 21px; font-size: 14px; border-radius: 11px; }

/* ---------------- Panels & cards ---------------- */

.panel {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    padding: 16px 20px;
    border-bottom: 1px solid var(--line-soft);
}

.panel-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--ink);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.panel-title i { color: var(--gold-deep); font-size: 15px; }

.panel-subtitle { font-size: 11px; color: var(--muted); margin: 3px 0 0; }

.panel-body { padding: 20px; }
.panel-body-tight { padding: 0; }

.panel-link {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--gold-deep);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}
.panel-link:hover { color: var(--ink); }

/* ---------------- Stat cards ---------------- */

.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 15px;
    margin-bottom: 22px;
}

.stat-card {
    position: relative;
    background: linear-gradient(180deg, #ffffff 0%, #fdfefe 100%);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px 18px 16px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: flex-start;
    gap: 13px;
    overflow: hidden;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.stat-card::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(200, 162, 74, .5), transparent);
    opacity: 0;
    transition: opacity .18s ease;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: #d8dfe9; }
.stat-card:hover::after { opacity: 1; }

.stat-icon {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-size: 18px;
}
.tone-gold { background: var(--gold-wash); color: var(--gold-deep); }
.tone-green { background: var(--green-wash); color: var(--green); }
.tone-blue { background: var(--blue-wash); color: var(--blue); }
.tone-amber { background: var(--amber-wash); color: var(--amber); }
.tone-red { background: var(--red-wash); color: var(--red); }
.tone-dark { background: #eef1f6; color: var(--ink); }

.stat-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 1px 0 5px;
}

.stat-value {
    font-size: 23px;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.15;
    margin: 0;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.stat-meta { font-size: 10.5px; color: var(--muted); margin: 5px 0 0; line-height: 1.45; }
.stat-meta strong { color: var(--text); font-weight: 600; }

/* Hero */
.hero-card {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    background:
        radial-gradient(620px 300px at 86% -24%, rgba(200, 162, 74, .30), transparent 64%),
        radial-gradient(460px 300px at 110% 120%, rgba(46, 99, 212, .18), transparent 60%),
        linear-gradient(135deg, #0c1728 0%, #0f1c30 58%, #172740 100%);
    color: #fff;
    padding: 30px 32px;
    box-shadow: 0 30px 60px -34px rgba(10, 19, 34, .75);
    margin-bottom: 22px;
}

.hero-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(255, 255, 255, .03) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(255, 255, 255, .03) 1px, transparent 1px);
    background-size: 54px 54px;
    mask-image: radial-gradient(circle at 18% 20%, #000, transparent 68%);
    pointer-events: none;
}

.hero-card::after {
    content: "";
    position: absolute;
    right: -40px;
    bottom: -120px;
    width: 340px;
    height: 340px;
    border-radius: 50%;
    border: 1px solid rgba(232, 209, 150, .16);
    box-shadow: 0 0 0 38px rgba(232, 209, 150, .045), 0 0 0 92px rgba(232, 209, 150, .025);
    pointer-events: none;
}

.hero-eyebrow {
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: var(--gold-light);
    margin-bottom: 10px;
}

.hero-title {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -.028em;
    margin: 0 0 6px;
}
.hero-title span { color: var(--gold-light); }

.hero-text { color: rgba(255, 255, 255, .62); font-size: 12.5px; margin: 0 0 20px; max-width: 520px; line-height: 1.65; }

.hero-stats { display: flex; flex-wrap: wrap; gap: 0; }
.hero-stat { padding-right: 28px; margin-right: 28px; border-right: 1px solid rgba(255, 255, 255, .12); }
.hero-stat:last-child { border-right: 0; padding-right: 0; margin-right: 0; }
.hero-stat span { display: block; font-size: 9.5px; letter-spacing: .11em; text-transform: uppercase; color: rgba(255, 255, 255, .44); margin-bottom: 4px; }
.hero-stat strong { font-size: 17px; font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; }
.hero-actions { position: relative; z-index: 2; display: flex; flex-wrap: wrap; gap: 9px; }
.hero-actions .btn-outline-light {
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 255, 255, .22);
    color: #fff;
}
.hero-actions .btn-outline-light:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.hero-actions .btn-soft { background: rgba(255, 255, 255, .10); border-color: rgba(255, 255, 255, .16); color: #fff; }
.hero-actions .btn-soft:hover { background: rgba(255, 255, 255, .16); color: #fff; }

/* ---------------- Tables ---------------- */

.table-wrap { width: 100%; overflow-x: auto; overscroll-behavior-x: contain; }

.table-app {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 12.5px;
    margin: 0;
    white-space: nowrap;
}

.table-app thead th {
    background: #f8fafc;
    color: #7b8798;
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: .10em;
    text-transform: uppercase;
    padding: 11px 14px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    white-space: nowrap;
}

.table-app tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line-soft);
    vertical-align: middle;
    color: #334052;
}

.table-app tbody tr:last-child td { border-bottom: 0; }
.table-app tbody tr { transition: background .12s ease; }
.table-app tbody tr:hover { background: #fbfcfe; }
.table-app tbody tr:hover td { background: #fbfcfe; }

.table-app .text-end { text-align: right; }
.table-app .text-center { text-align: center; }

.table-ledger tbody td, .table-ledger thead th { white-space: normal; }
.table-ledger tbody td:nth-child(1), .table-ledger thead th:nth-child(1) { white-space: nowrap; }
.table-ledger .cell-mono { white-space: nowrap; }
.table-ledger .ledger-desc { display: block; max-width: 300px; line-height: 1.5; margin-top: 3px; }

.cell-strong { font-weight: 600; color: var(--ink); display: inline-block; }
.table-app td.cell-strong { display: table-cell; font-weight: 600; color: var(--ink); }
.cell-sub { display: block; font-size: 10.5px; color: var(--muted); margin-top: 2px; line-height: 1.45; }
.cell-mono { font-variant-numeric: tabular-nums; font-weight: 600; }

.table-actions { display: inline-flex; align-items: center; gap: 5px; }
.table-actions form { display: inline-flex; margin: 0; }
.table-actions .btn-icon { width: 31px; height: 31px; font-size: 13.5px; border-radius: 8px; }

/* Keep row actions visible when the table scrolls sideways */
.table-app.has-actions thead th:last-child,
.table-app.has-actions tbody td:last-child {
    position: sticky;
    right: 0;
    z-index: 2;
    background: #fff;
    box-shadow: -14px 0 16px -16px rgba(11, 21, 38, .45);
}
.table-app.has-actions thead th:last-child { background: #f8fafc; z-index: 3; }
.table-app.has-actions tbody tr:hover td:last-child { background: #fbfcfe; }
.table-app.has-actions tbody td:last-child::before { display: none; }

.car-thumb {
    width: 44px;
    height: 36px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid var(--line);
    background: #f2f4f8;
    flex: 0 0 44px;
}
.car-thumb-placeholder {
    width: 44px;
    height: 36px;
    flex: 0 0 44px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: var(--gold-wash);
    color: var(--gold-deep);
    font-size: 17px;
}

.doc-badges { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.doc-line { display: inline-flex; align-items: center; gap: 6px; }
.doc-key { font-size: 9.5px; color: var(--muted); width: 34px; flex: 0 0 34px; }
.doc-line .badge-soft { font-size: 9.5px; padding: 2px 7px; }

/* ---------------- Badges ---------------- */

.badge-soft {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .02em;
    line-height: 1.5;
    white-space: nowrap;
}
.badge-soft::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: currentColor; flex: 0 0 4px; }
.badge-success { background: var(--green-wash); color: #13724d; }
.badge-info { background: var(--blue-wash); color: #1f52bd; }
.badge-warning { background: var(--amber-wash); color: #8c5809; }
.badge-danger { background: var(--red-wash); color: #ab3333; }
.badge-muted { background: #f0f2f6; color: #657184; }
.badge-gold { background: var(--gold-wash); color: var(--gold-deep); }

/* ---------------- Forms ---------------- */

.form-label {
    font-size: 11px;
    font-weight: 600;
    color: #435064;
    letter-spacing: .01em;
    margin-bottom: 5px;
}

.form-label .req { color: var(--red); }

.form-control, .form-select {
    min-height: 42px;
    border: 1px solid #dde3ec;
    border-radius: 9px;
    font-size: 12.5px;
    color: var(--text);
    padding: 8px 12px;
    background-color: #fff;
    box-shadow: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}

textarea.form-control { min-height: 94px; resize: vertical; }

.form-control:focus, .form-select:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3.5px rgba(200, 162, 74, .16);
}

.form-control::placeholder { color: #a6afbd; }
.form-control:disabled, .form-select:disabled { background: #f7f8fb; color: #8b95a5; }

.form-text { font-size: 10.5px; color: var(--muted); margin-top: 5px; line-height: 1.5; }

.input-group-text {
    background: #f8f9fc;
    border: 1px solid #dde3ec;
    color: var(--muted);
    font-size: 13px;
    border-radius: 9px;
}

.input-group .form-control { border-left: 0; }
.input-group .input-group-text + .form-control { border-left: 0; }
.input-group .form-control:focus { z-index: 3; }
.input-group .btn { border-radius: 0 9px 9px 0; }

input[type="file"].form-control { padding: 6px 8px; line-height: 1.8; }
input[type="file"]::file-selector-button {
    background: #f3f5f9;
    border: 1px solid #e0e5ee;
    border-radius: 7px;
    color: #435064;
    font-size: 11.5px;
    font-weight: 600;
    padding: 5px 11px;
    margin-right: 10px;
    cursor: pointer;
    transition: background .15s ease;
}
input[type="file"]::file-selector-button:hover { background: #e9edf4; }

input[type="date"], input[type="time"] { color-scheme: light; }

.form-section-title {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .13em;
    text-transform: uppercase;
    color: var(--gold-deep);
    padding-bottom: 9px;
    margin: 4px 0 16px;
    border-bottom: 1px solid var(--line-soft);
    display: flex;
    align-items: center;
    gap: 7px;
}

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }

.form-card { max-width: none; }
.form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
    padding: 15px 20px;
    border-top: 1px solid var(--line-soft);
    background: #fbfcfe;
}

/* Bootstrap switch, rebuilt */
.form-check { min-height: auto; padding-left: 0; margin: 0; display: flex; align-items: center; gap: 9px; }
.form-switch { display: flex; align-items: center; gap: 10px; padding-left: 0; }
.form-switch .form-check-input {
    width: 38px;
    height: 21px;
    flex: 0 0 38px;
    margin: 0;
    cursor: pointer;
    border: 1px solid #c3ccd9;
    border-radius: 999px;
    background-color: #dfe5ee;
    background-image: radial-gradient(circle at 30% 50%, #fff 5px, transparent 5.5px);
    background-size: 18px 18px;
    background-position: 2px 50%;
    background-repeat: no-repeat;
    box-shadow: inset 0 1px 2px rgba(11, 21, 38, .12);
    transition: background-color .18s ease, border-color .18s ease;
    appearance: none;
}
.form-switch .form-check-input:checked {
    background-color: var(--gold);
    border-color: var(--gold);
    background-image: radial-gradient(circle at 70% 50%, #fff 5px, transparent 5.5px);
    background-position: 17px 50%;
}
.form-switch .form-check-input:focus { box-shadow: 0 0 0 3px rgba(200, 162, 74, .18); border-color: var(--gold); }
.form-check-label { font-size: 12px; color: #435064; cursor: pointer; }

.switch-line { display: flex; align-items: center; gap: 10px; }

/* Payment form on booking view */
.payment-form-grid {
    display: grid;
    grid-template-columns: 1.1fr 1fr 1.1fr 1fr;
    gap: 12px;
}
.payment-form-grid .pf-note { grid-column: span 2; }
.payment-form-grid .pf-submit { display: flex; align-items: flex-end; }
.payment-form-grid .pf-submit .btn { min-height: 42px; }
.payment-form .form-label { font-size: 10.5px; }

/* ---------------- Filters & toolbars ---------------- */

.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 14px 18px;
    border-bottom: 1px solid var(--line-soft);
    background: #fff;
}

.toolbar-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.search-box { position: relative; }
.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #96a0b0;
    font-size: 13.5px;
    pointer-events: none;
}
.search-box .form-control { padding-left: 36px; min-width: 300px; }

.select-sm { min-height: 38px; font-size: 12px; padding: 7px 30px 7px 11px; border-radius: 9px; }

.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---------------- Tabs ---------------- */

.tabs-pill {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: #eef1f6;
    padding: 4px;
    border-radius: 11px;
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
}
.tabs-pill::-webkit-scrollbar { display: none; }
.tabs-pill a {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--muted);
    padding: 6px 13px;
    border-radius: 8px;
    white-space: nowrap;
    transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
.tabs-pill a:hover { color: var(--ink); }
.tabs-pill a.active { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }

/* ---------------- Empty state ---------------- */

.empty-state { text-align: center; padding: 48px 24px; }
.empty-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 13px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: var(--gold-wash);
    color: var(--gold-deep);
    font-size: 24px;
    border: 1px solid #f0e5c8;
}
.empty-state h3 { font-size: 14px; font-weight: 700; color: var(--ink); margin: 0 0 5px; }
.empty-state p { font-size: 12px; color: var(--muted); margin: 0 auto 15px; max-width: 380px; }

/* ---------------- Details ---------------- */

.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px 22px; }
.detail-item .detail-label {
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: .10em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 3px;
}
.detail-item .detail-value { font-size: 13px; font-weight: 500; color: var(--text); word-break: break-word; }
.detail-item .detail-value a { color: var(--gold-deep); }

.summary-list { display: flex; flex-direction: column; }
.summary-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 9px 0;
    border-bottom: 1px dashed #e9edf3;
    font-size: 12px;
    color: #566274;
}
.summary-row:last-child { border-bottom: 0; }
.summary-row span:last-child { font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.summary-row.total {
    border-top: 1px solid var(--line);
    border-bottom: 0;
    margin-top: 5px;
    padding-top: 13px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ink);
}
.summary-row.total span:last-child { font-size: 17px; color: var(--ink); }
.summary-row.due span:last-child { color: var(--red); }
.summary-row.paid span:last-child { color: var(--green); }

.money-positive { color: var(--green) !important; }
.money-negative { color: var(--red) !important; }
.text-gold { color: var(--gold-deep) !important; }
.text-muted-app { color: var(--muted) !important; }

/* ---------------- Charts ---------------- */

.chart-box { position: relative; width: 100%; height: 278px; }
.chart-box-sm { position: relative; width: 100%; height: 248px; }

/* ---------------- Login ---------------- */

.login-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.04fr .96fr;
    background: #f5f7fa;
}

.login-visual {
    position: relative;
    overflow: hidden;
    padding: 50px 56px 44px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: #fff;
    background:
        radial-gradient(760px 440px at 10% -4%, rgba(200, 162, 74, .30), transparent 62%),
        radial-gradient(660px 480px at 108% 108%, rgba(42, 99, 212, .18), transparent 60%),
        linear-gradient(148deg, #0c1728 0%, #0a1322 54%, #101d31 100%);
}

.login-visual::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(255, 255, 255, .032) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(255, 255, 255, .032) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(circle at 26% 24%, #000 0%, transparent 72%);
    pointer-events: none;
}

.login-visual::after {
    content: "";
    position: absolute;
    width: 520px;
    height: 520px;
    right: -200px;
    bottom: -240px;
    border-radius: 50%;
    border: 1px solid rgba(232, 209, 150, .18);
    box-shadow: 0 0 0 60px rgba(232, 209, 150, .045), 0 0 0 140px rgba(232, 209, 150, .025);
    pointer-events: none;
}

.login-brand { display: flex; align-items: center; gap: 13px; position: relative; z-index: 2; }
.login-brand .brand-mark { width: 48px; height: 48px; flex-basis: 48px; font-size: 27px; }
.login-brand strong { font-family: var(--font-display); font-size: 18px; display: block; color: #fff; }
.login-brand small { display: block; font-size: 9px; letter-spacing: .20em; text-transform: uppercase; color: rgba(232, 209, 150, .72); margin-top: 3px; }

.login-quote { position: relative; z-index: 2; max-width: 540px; }
.login-eyebrow { font-size: 9.5px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; color: var(--gold-light); margin-bottom: 15px; }
.login-quote h2 {
    font-size: clamp(32px, 3.4vw, 48px);
    line-height: 1.08;
    font-weight: 700;
    letter-spacing: -.038em;
    margin: 0 0 18px;
}
.login-quote h2 span { color: var(--gold-light); }
.login-quote p { color: rgba(255, 255, 255, .56); font-size: 13px; line-height: 1.75; max-width: 420px; margin: 0; }

.login-features { position: relative; z-index: 2; display: flex; flex-wrap: wrap; gap: 10px 24px; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, .09); }
.login-feature { display: flex; align-items: center; gap: 8px; font-size: 11px; color: rgba(255, 255, 255, .58); }
.login-feature i { color: var(--gold-light); font-size: 13.5px; }

.login-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 36px 28px;
    background:
        radial-gradient(680px 360px at 100% 0%, rgba(200, 162, 74, .085), transparent 60%),
        #f5f7fa;
}

.login-card {
    position: relative;
    width: 100%;
    max-width: 400px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 34px 34px 26px;
    box-shadow: 0 34px 80px -36px rgba(10, 19, 34, .35);
    overflow: hidden;
}
.login-card::before {
    content: "";
    position: absolute;
    left: 0; right: 0; top: 0;
    height: 4px;
    background: linear-gradient(90deg, #0b1526 0%, var(--gold) 55%, var(--gold-light) 100%);
}
.login-kicker {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .15em;
    text-transform: uppercase;
    color: var(--gold-deep);
    background: var(--gold-wash);
    border: 1px solid #f0e5c8;
    padding: 4px 9px;
    border-radius: 999px;
    margin-bottom: 14px;
}
.login-card h1 { font-size: 23px; font-weight: 700; color: var(--ink); margin: 0 0 5px; }
.login-card .login-sub { font-size: 12px; color: var(--muted); margin: 0 0 24px; line-height: 1.55; }

.login-card .form-label { font-size: 10.5px; }
.login-card .form-control { min-height: 45px; font-size: 13px; }
.login-card .input-group-text { min-width: 42px; justify-content: center; }
.login-card .btn { min-height: 45px; }

.login-foot { text-align: center; font-size: 10.5px; color: #98a3b3; margin: 20px 0 0; line-height: 1.6; }
.login-foot a { color: var(--gold-deep); font-weight: 600; }

.login-mobile-brand { display: none; align-items: center; gap: 12px; margin-bottom: 20px; }
.login-mobile-brand .brand-mark { width: 44px; height: 44px; flex-basis: 44px; font-size: 24px; border-radius: 12px; }
.login-mobile-brand strong { display: block; font-family: var(--font-display); font-size: 15px; color: var(--ink); }
.login-mobile-brand small { display: block; font-size: 8.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-deep); margin-top: 2px; }

/* ---------------- Print invoice ---------------- */

.invoice-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.invoice-sheet {
    background: #fff;
    max-width: 900px;
    margin: 0 auto;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 42px 46px 32px;
    box-shadow: 0 24px 60px -32px rgba(10, 19, 34, .30);
    position: relative;
    overflow: hidden;
}
.invoice-sheet::before {
    content: "";
    position: absolute;
    left: 0; right: 0; top: 0;
    height: 5px;
    background: linear-gradient(90deg, #0b1526 0%, #c8a24a 55%, #e8d196 100%);
}
.invoice-head { display: flex; justify-content: space-between; gap: 26px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.invoice-company { display: flex; gap: 14px; align-items: flex-start; }
.invoice-company .brand-mark { width: 48px; height: 48px; flex-basis: 48px; font-size: 26px; border-radius: 13px; }
.invoice-company h2 { font-size: 18px; font-weight: 700; color: var(--ink); margin: 0 0 3px; }
.invoice-company p { font-size: 11px; color: var(--muted); margin: 0; line-height: 1.7; }
.invoice-meta { text-align: right; flex: 0 0 auto; }
.invoice-meta .inv-title { font-size: 9.5px; letter-spacing: .20em; text-transform: uppercase; color: var(--gold-deep); font-weight: 700; margin-bottom: 7px; }
.invoice-meta .inv-no { font-size: 17px; font-weight: 700; color: var(--ink); margin-bottom: 8px; }
.invoice-meta p { margin: 0 0 2px; font-size: 11px; color: var(--muted); }
.invoice-meta p strong { color: var(--text); font-weight: 600; }

.invoice-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.invoice-block h4 { font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold-deep); font-weight: 700; margin: 0 0 8px; }
.invoice-block p { font-size: 11.5px; color: var(--muted); margin: 0 0 3px; line-height: 1.65; }
.invoice-block p strong { color: var(--text); font-weight: 600; font-size: 12.5px; }

.invoice-table { width: 100%; border-collapse: collapse; margin: 20px 0 0; }
.invoice-table th {
    text-align: left;
    font-size: 9px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 0 0 9px;
    border-bottom: 1px solid var(--line);
    font-weight: 700;
}
.invoice-table th:last-child, .invoice-table td:last-child { text-align: right; }
.invoice-table td { font-size: 12px; color: var(--text); padding: 12px 0; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.invoice-table td small { display: block; font-size: 10px; color: var(--muted); margin-top: 2px; }
.invoice-table .inv-desc { width: 54%; padding-right: 18px; }
.invoice-table .inv-qty { width: 14%; }
.invoice-table .inv-rate { width: 16%; }
.invoice-table th.inv-qty, .invoice-table td.inv-qty,
.invoice-table th.inv-rate, .invoice-table td.inv-rate { text-align: left; }

.invoice-totals { margin-left: auto; width: 310px; margin-top: 16px; }
.invoice-totals .summary-row { font-size: 11.5px; padding: 8px 0; }
.invoice-totals .summary-row.total span:last-child { font-size: 17px; }

.invoice-note { margin-top: 24px; padding: 13px 15px; border-radius: 10px; background: #fafaf7; border: 1px solid #f0eee5; font-size: 10.5px; color: #6d6a5a; line-height: 1.7; }
.payment-line { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.payment-line + .payment-line { margin-top: 3px; }
.payment-line-amount { font-weight: 600; color: var(--text); white-space: nowrap; }
.invoice-sign { display: flex; justify-content: space-between; gap: 30px; margin-top: 40px; padding-top: 8px; }
.invoice-sign div { flex: 1; border-top: 1px solid var(--line); padding-top: 8px; font-size: 10px; color: var(--muted); text-align: center; }
.invoice-foot { text-align: center; color: #9aa5b4; font-size: 9px; margin: 22px 0 0; line-height: 1.6; }

/* ---------------- Misc ---------------- */

.section-gap { margin-bottom: 22px; }
.row-gap { gap: 22px 0; }

.progress-slim { height: 6px; border-radius: 99px; background: #edf0f5; overflow: hidden; }
.progress-slim span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--gold-deep), var(--gold-light)); }

.mini-note { font-size: 11px; color: var(--muted); line-height: 1.55; }

.car-photo-lg {
    width: 100%;
    height: 210px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #f2f4f8;
}

.reminder-row {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 11px 0;
    border-bottom: 1px dashed #e9edf3;
}
.reminder-row:last-child { border-bottom: 0; }
.reminder-icon { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 9px; display: grid; place-items: center; font-size: 14px; }
.reminder-text { flex: 1; min-width: 0; font-size: 12px; color: var(--text); line-height: 1.45; }
.reminder-text small { display: block; font-size: 10.5px; color: var(--muted); margin-top: 2px; }

.settings-info.detail-grid { grid-template-columns: 1fr; gap: 12px; }
.settings-info .detail-item { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 10px; border-bottom: 1px dashed #e9edf3; }
.settings-info .detail-item:last-child { border-bottom: 0; padding-bottom: 0; }
.settings-info .detail-label { margin: 0; }
.settings-info .detail-value { font-size: 12px; font-weight: 600; text-align: right; word-break: break-word; }

.role-list { display: flex; flex-direction: column; gap: 10px; }
.role-card { border: 1px solid var(--line); border-radius: 11px; padding: 12px 13px; background: #fbfcfe; }
.role-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.role-head strong { font-size: 12px; color: var(--ink); font-weight: 700; }
.role-card .mini-note { font-size: 10.5px; line-height: 1.55; }

/* ---------------- Table → cards (mobile) ---------------- */

@media (max-width: 767.98px) {
    .table-wrap { overflow: visible; }
    .table-cards { display: block; width: 100%; white-space: normal; }
    .table-cards thead { display: none; }
    .table-cards tbody { display: block; width: 100%; }
    .table-cards tr {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 9px 14px;
        padding: 13px 15px;
        border-bottom: 1px solid var(--line-soft);
        position: relative;
    }
    .table-cards tr:last-child { border-bottom: 0; }
    .table-cards tr:hover { background: transparent; }
    /* Higher specificity than the tablet `.table-app tbody td` padding rule so
       card cells collapse to a zero-padding grid item. */
    .table-app.table-cards tbody td,
    .table-app.table-cards.has-actions tbody td:last-child {
        display: block;
        position: static;
        width: auto;
        padding: 0;
        border: 0;
        white-space: normal;
        line-height: 1.45;
        text-align: left !important;
        background: transparent !important;
        box-shadow: none !important;
        overflow-wrap: anywhere;
    }
    .table-cards td::before {
        content: attr(data-label);
        display: block;
        font-size: 8px;
        font-weight: 700;
        letter-spacing: .10em;
        text-transform: uppercase;
        color: #93a0b2;
        margin-bottom: 1px;
    }
    .table-cards td.cell-primary { grid-column: 1 / -1; }
    .table-cards td.cell-primary::before { display: none; }
    .table-cards td.cell-primary .cell-strong { font-size: 14px; }
    .table-cards td.cell-primary { padding-bottom: 2px; }

    /* Ledger: reference first, then date/balance and debit/credit pairs */
    .table-cards.table-ledger tbody td:nth-child(2) { order: 0; grid-column: 1 / -1; }
    .table-cards.table-ledger tbody td:nth-child(1) { order: 1; }
    .table-cards.table-ledger tbody td:nth-child(5) { order: 2; }
    .table-cards.table-ledger tbody td:nth-child(3) { order: 3; }
    .table-cards.table-ledger tbody td:nth-child(4) { order: 4; }
    .table-cards.table-cashbook tbody td:nth-child(3) { grid-column: 1 / -1; }
    .table-cards.table-cashbook tr.row-summary { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
    .table-cards.table-cashbook tr.row-summary td { grid-column: auto; }
    .table-cards.table-cashbook tr.row-summary td:first-child { grid-column: 1 / 2; }
    .table-cards.table-cashbook tr.row-summary td:last-child { grid-column: 2 / 3; }
    .table-cards.table-cashbook tr.row-closing { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .table-cards.table-cashbook tr.row-closing td:first-child { grid-column: 1 / -1; }
    .tabs-pill { display: flex; flex-wrap: wrap; }
    .table-cards.has-actions tbody td.cell-actions,
    .table-cards td.cell-actions {
        grid-column: 1 / -1;
        display: flex;
        justify-content: flex-end;
        margin-top: 3px;
        padding: 10px 0 0;
        border-top: 1px dashed #e9edf3 !important;
    }
    .table-cards.has-actions tbody td.cell-actions::before,
    .table-cards td.cell-actions::before { display: none; }
    .table-cards.has-actions tbody td.cell-actions .table-actions,
    .table-cards td.cell-actions .table-actions { display: flex; justify-content: flex-end; }
    .table-cards td.cell-actions .btn-icon { width: 34px; height: 34px; }
    .table-cards .badge-soft { white-space: normal; }
    .table-cards td.cell-mono { text-align: left !important; }
}

/* ---------------- Responsive ---------------- */

@media (max-width: 1399.98px) {
    .page-content { padding: 24px 24px 38px; }
    .topbar { padding: 10px 24px; }
    .app-footer { padding: 14px 24px 18px; }
    .table-app thead th { padding: 11px 12px; }
    .table-app tbody td { padding: 11px 12px; }
    .doc-key { width: auto; flex: 0 0 auto; font-size: 9px; }
}

@media (max-width: 1199.98px) {
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .table-app thead th { padding: 10px 11px; }
    .table-app tbody td { padding: 10px 11px; }
}

@media (max-width: 991.98px) {
    .app-sidebar {
        transform: translateX(-100%);
        transition: transform .26s cubic-bezier(.22, .8, .28, 1);
        box-shadow: 0 0 70px rgba(0, 0, 0, .4);
        width: 280px;
    }
    .app-sidebar.open { transform: translateX(0); }
    .app-main { margin-left: 0; }
    .sidebar-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(7, 13, 24, .52);
        z-index: 1035;
        backdrop-filter: blur(2px);
    }
    .sidebar-backdrop.show { display: block; }
    .topbar { padding: 10px 18px; min-height: 68px; }
    .page-content { padding: 20px 18px 34px; }
    .app-footer { padding: 14px 18px 18px; }
    .login-page { grid-template-columns: 1fr; }
    .login-visual { display: none; }
    .login-panel { min-height: 100vh; }
    .login-mobile-brand { display: flex; }
    .hero-card { padding: 26px; }
}

@media (max-width: 767.98px) {
    .page-title { font-size: 17px; }
    .page-subtitle { font-size: 10.5px; }
    .user-chip span.d-none { display: none !important; }
    .form-grid, .form-grid-3, .detail-grid { grid-template-columns: 1fr; }
    .span-2, .span-3 { grid-column: span 1; }
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
    .stat-card { padding: 14px 14px 13px; display: block; }
    .stat-icon { width: 30px; height: 30px; font-size: 13px; border-radius: 9px; position: absolute; top: 12px; right: 12px; opacity: .9; }
    .stat-label { padding-right: 36px; font-size: 9px; margin-bottom: 5px; }
    .stat-value { font-size: clamp(17px, 5.2vw, 22px); }
    .stat-meta { font-size: 9.5px; }
    .hero-card { padding: 20px; border-radius: 16px; }
    .hero-title { font-size: 21px; }
    .hero-text { font-size: 12px; margin-bottom: 16px; }
    .hero-stats { gap: 14px 0; }
    .hero-stat { padding-right: 16px; margin-right: 16px; }
    .hero-stat strong { font-size: 14.5px; }
    .hero-actions { display: grid; grid-template-columns: 1fr 1fr; }
    .hero-actions .btn { width: 100%; }
    .hero-actions .btn:first-child { grid-column: 1 / -1; }
    .invoice-sheet { padding: 28px 18px 24px; border-radius: 12px; }
    .invoice-head, .invoice-parties { flex-direction: column; grid-template-columns: 1fr; gap: 18px; }
    .invoice-meta { text-align: left; }
    .invoice-meta .inv-title { margin-top: 4px; }
    .invoice-table .inv-qty, .invoice-table .inv-rate { display: none; }
    .invoice-table .inv-desc { width: auto; padding-right: 12px; }
    .invoice-table th:last-child, .invoice-table td:last-child { white-space: nowrap; }
    .invoice-totals { width: 100%; }
    .invoice-sign { flex-direction: column; gap: 28px; }
    .invoice-toolbar { align-items: stretch; }
    .invoice-toolbar > .btn { width: 100%; }
    .invoice-toolbar .page-actions { display: grid; grid-template-columns: 1fr; width: 100%; }
    .invoice-toolbar .page-actions > * { width: 100%; }
    .payment-form-grid { grid-template-columns: 1fr 1fr; }
    .payment-form-grid .pf-ref, .payment-form-grid .pf-note { grid-column: 1 / -1; }
    .payment-form-grid .pf-submit { grid-column: 1 / -1; }
    .toolbar { padding: 12px 14px; }
    .search-box .form-control { min-width: 0; width: 100%; }
    .search-box { width: 100%; }
    .toolbar-form { width: 100%; }
    .toolbar-form .form-control, .toolbar-form .form-select { flex: 1 1 auto; min-width: 0; }
    .toolbar-form .btn { flex: 0 0 auto; }
    .panel-head { padding: 14px 16px; }
    .panel-body { padding: 16px; }
    .app-footer { flex-direction: column; gap: 4px; }
    .login-card { padding: 28px 22px 22px; }
    .chart-box { height: 240px; }
    .chart-box-sm { height: 230px; }
}

@media (max-width: 479.98px) {
    .page-subtitle { display: none; }
    .topbar { gap: 8px; }
    .topbar-right { gap: 6px; }
    .topbar .user-chip { border-left: 0; padding-left: 0; }
    .btn-icon { width: 36px; height: 36px; }
    .stat-grid { grid-template-columns: 1fr 1fr; }
    .stat-value { font-size: 17px; }
    .hero-actions { grid-template-columns: 1fr; }
    .hero-actions .btn:first-child { grid-column: auto; }
    .tabs-pill { display: flex; width: 100%; }
    .tabs-pill a { flex: 0 0 auto; }
    .page-actions { width: 100%; }
    .page-actions .btn { flex: 1 1 auto; }
}
