/* =====================================================================
   FleetAstro — application styles (Bootstrap 5.3 + Hind Siliguri)
   Navy road-sign palette: deep navy sidebar, amber accent.
   ===================================================================== */
:root {
    --fa-navy: #0b2545;
    --fa-navy-2: #13315c;
    --fa-blue: #1f5fa8;
    --fa-amber: #f4a300;
    --fa-amber-soft: #fff6e0;
    --fa-bg: #f3f5f9;
    --fa-card: #ffffff;
    --fa-text: #17233a;
    --fa-muted: #66718a;
    --fa-line: #e3e7ef;
    --fa-green: #15803d;
    --fa-red: #c2261d;
    --fa-radius: 14px;
    --fa-side-w: 256px;
    --bs-primary: #1f5fa8;
    --bs-primary-rgb: 31, 95, 168;
    --bs-body-font-family: "Hind Siliguri", system-ui, -apple-system, "Segoe UI", sans-serif;
    --bs-link-color: #1f5fa8;
    --bs-link-color-rgb: 31, 95, 168;
}

html, body { font-family: var(--bs-body-font-family); }
body.fa-body { background: var(--fa-bg); color: var(--fa-text); overflow-x: hidden; }
.btn-primary { --bs-btn-bg: var(--fa-blue); --bs-btn-border-color: var(--fa-blue); --bs-btn-hover-bg: var(--fa-navy-2); --bs-btn-hover-border-color: var(--fa-navy-2); }
.btn-amber { background: var(--fa-amber); border-color: var(--fa-amber); color: #1f1300; font-weight: 600; }
.btn-amber:hover { background: #dd9300; border-color: #dd9300; color: #1f1300; }
.form-label { font-weight: 600; font-size: .9rem; margin-bottom: .3rem; }
.form-control, .form-select { border-radius: 10px; border-color: #d5dbe6; }
.form-control:focus, .form-select:focus { border-color: var(--fa-blue); box-shadow: 0 0 0 .2rem rgba(31, 95, 168, .15); }
.req::after { content: " *"; color: var(--fa-red); }

/* ---------- loading bar ---------- */
.fa-loadbar { position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 3000; opacity: 0; pointer-events: none;
    background: linear-gradient(90deg, var(--fa-amber), #ffd166); transition: opacity .15s; }
.fa-loadbar.on { opacity: 1; animation: faLoad 1.1s ease-in-out infinite; }
@keyframes faLoad { 0% { width: 0; left: 0; } 50% { width: 55%; left: 20%; } 100% { width: 0; left: 100%; } }

/* ---------- shell ---------- */
.fa-shell { display: flex; min-height: 100vh; }
.fa-side { width: var(--fa-side-w); flex-shrink: 0; background: linear-gradient(180deg, var(--fa-navy) 0%, #0e2f57 100%);
    color: rgba(255, 255, 255, .82); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 1040; }
.fa-brand { display: flex; align-items: center; gap: .65rem; padding: 1.1rem 1.1rem .9rem; color: #fff; text-decoration: none; }
.fa-brand b { display: block; font-size: 1.3rem; letter-spacing: .2px; line-height: 1.1; }
.fa-brand em { font-style: normal; color: var(--fa-amber); }
.fa-brand small { display: block; font-size: .72rem; color: rgba(255, 255, 255, .55); }
.fa-menu { flex: 1; overflow-y: auto; padding: .25rem .7rem 1rem; }
.fa-menu-h { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: rgba(255, 255, 255, .45); margin: 1rem .6rem .35rem; }
.fa-menu a { display: flex; align-items: center; gap: .7rem; padding: .55rem .75rem; border-radius: 10px; color: rgba(255, 255, 255, .82);
    text-decoration: none; font-size: .95rem; margin-bottom: 2px; }
.fa-menu a i { font-size: 1.05rem; width: 20px; text-align: center; }
.fa-menu a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.fa-menu a.active { background: var(--fa-amber); color: #1f1300; font-weight: 600; }
.fa-side-foot { padding: .9rem 1.1rem; border-top: 1px solid rgba(255, 255, 255, .1); font-size: .85rem; }
.fa-side-foot small { color: rgba(255, 255, 255, .55); }
.fa-backdrop { display: none; }

.fa-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fa-top { position: sticky; top: 0; z-index: 1020; display: flex; align-items: center; gap: .75rem; padding: .65rem 1.25rem;
    background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--fa-line); }
.fa-top-title { min-width: 0; line-height: 1.2; }
.fa-icon-btn { border: 1px solid var(--fa-line); background: #fff; width: 40px; height: 40px; border-radius: 10px; font-size: 1.3rem; }
.fa-net { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .7rem; border-radius: 999px; font-size: .82rem;
    background: #e8f6ee; color: var(--fa-green); text-decoration: none; font-weight: 600; }
.fa-net.off { background: #fdecec; color: var(--fa-red); }
.fa-sync { background: var(--fa-amber-soft); color: #8a5a00; }
.fa-user { display: flex; align-items: center; gap: .55rem; border: 1px solid var(--fa-line); background: #fff; border-radius: 12px; padding: .3rem .6rem .3rem .3rem; }
.fa-avatar { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--fa-navy); color: #fff; font-weight: 700; }
.fa-content { padding: 1.25rem; flex: 1; }
.fa-foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; padding: .9rem 1.25rem; color: var(--fa-muted);
    font-size: .82rem; border-top: 1px solid var(--fa-line); background: #fff; }

@media (max-width: 991.98px) {
    .fa-side { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .2s; }
    .fa-shell.drawer .fa-side { transform: none; }
    .fa-shell.drawer .fa-backdrop { display: block; position: fixed; inset: 0; background: rgba(5, 15, 30, .45); z-index: 1035; }
    .fa-content { padding: .9rem; }
    .fa-top { padding: .55rem .9rem; }
}

/* ---------- page parts ---------- */
.fa-page-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .75rem; margin-bottom: 1rem; }
.fa-page-head h1 { font-size: 1.35rem; font-weight: 700; margin: 0; }
.fa-page-head p { margin: .15rem 0 0; color: var(--fa-muted); font-size: .9rem; }
.fa-card { background: var(--fa-card); border: 1px solid var(--fa-line); border-radius: var(--fa-radius); box-shadow: 0 1px 2px rgba(16, 33, 64, .04); }
.fa-card-h { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .85rem 1.1rem; border-bottom: 1px solid var(--fa-line); }
.fa-card-h h6 { margin: 0; font-weight: 700; }
.fa-card-b { padding: 1.1rem; }

.fa-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .9rem; margin-bottom: 1rem; }
.fa-stat { background: #fff; border: 1px solid var(--fa-line); border-radius: var(--fa-radius); padding: 1rem 1.1rem; position: relative; overflow: hidden; }
.fa-stat .lbl { color: var(--fa-muted); font-size: .85rem; }
.fa-stat .val { font-size: 1.45rem; font-weight: 700; margin-top: .15rem; white-space: nowrap; }
.fa-stat .ic { position: absolute; right: .9rem; top: .9rem; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 1.2rem; }
.fa-stat.blue .ic { background: #e7f0fb; color: var(--fa-blue); }
.fa-stat.green .ic { background: #e8f6ee; color: var(--fa-green); }
.fa-stat.red .ic { background: #fdecec; color: var(--fa-red); }
.fa-stat.amber .ic { background: var(--fa-amber-soft); color: #a06a00; }
.fa-stat .val.pos { color: var(--fa-green); } .fa-stat .val.neg { color: var(--fa-red); }

.fa-filter { display: flex; flex-wrap: wrap; gap: .6rem; align-items: flex-end; padding: .9rem 1.1rem; border-bottom: 1px solid var(--fa-line); }
.fa-filter > div { min-width: 140px; flex: 1 1 140px; }
.fa-filter .form-label { font-size: .78rem; color: var(--fa-muted); }

.fa-table { width: 100%; margin: 0; }
.fa-table thead th { background: #f6f8fc; color: #4a5672; font-size: .8rem; font-weight: 600; white-space: nowrap; padding: .6rem .75rem; border-bottom: 1px solid var(--fa-line); }
.fa-table td { padding: .6rem .75rem; border-bottom: 1px solid #eef1f6; vertical-align: middle; font-size: .92rem; }
.fa-table tbody tr:hover { background: #fafbfe; }
.fa-table tfoot td { font-weight: 700; background: #f6f8fc; }
.fa-table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.fa-table-wrap { overflow-x: auto; }
.fa-empty { text-align: center; padding: 2.5rem 1rem; color: var(--fa-muted); }
.fa-empty i { font-size: 2.2rem; display: block; margin-bottom: .4rem; opacity: .6; }

.fa-badge { display: inline-block; padding: .2rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 600; white-space: nowrap; }
.fa-badge.paid, .fa-badge.ok { background: #e8f6ee; color: var(--fa-green); }
.fa-badge.partial, .fa-badge.warn { background: var(--fa-amber-soft); color: #8a5a00; }
.fa-badge.due, .fa-badge.danger { background: #fdecec; color: var(--fa-red); }
.fa-badge.muted { background: #eef1f6; color: var(--fa-muted); }
.fa-actions { display: flex; gap: .3rem; justify-content: flex-end; }
.fa-actions .btn { padding: .2rem .5rem; }

.fa-kv { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; font-size: .93rem; }
.fa-kv dt { color: var(--fa-muted); font-weight: 500; } .fa-kv dd { margin: 0; font-weight: 600; }

.fa-confirm-icon { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto .8rem; background: #fdecec; color: var(--fa-red); font-size: 1.5rem; }

/* dashboard mini chart */
.fa-bars { display: flex; align-items: flex-end; gap: 6px; height: 140px; padding-top: .5rem; }
.fa-bars .day { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 2px; min-width: 0; height: 100%; }
.fa-bars .pair { display: flex; align-items: flex-end; gap: 2px; width: 100%; justify-content: center; flex: 1; }
.fa-bars .b { width: 45%; max-width: 12px; border-radius: 3px 3px 0 0; min-height: 2px; }
.fa-bars .b.in { background: var(--fa-blue); } .fa-bars .b.out { background: var(--fa-amber); }
.fa-bars small { font-size: .65rem; color: var(--fa-muted); }
.fa-legend { display: flex; gap: 1rem; font-size: .8rem; color: var(--fa-muted); }
.fa-legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
.fa-legend .in::before { background: var(--fa-blue); } .fa-legend .out::before { background: var(--fa-amber); }

/* voucher lines */
.fa-lines td { padding: .35rem .4rem; }
.fa-lines .form-control, .fa-lines .form-select { padding: .35rem .5rem; font-size: .9rem; }

/* auth / public pages */
.fa-auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; background: #fff; }
.fa-auth-art { background: radial-gradient(1000px 500px at 10% 0%, #1f5fa8 0%, var(--fa-navy) 55%); color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between; }
.fa-auth-art h2 { font-weight: 700; font-size: 2rem; }
.fa-auth-art ul { list-style: none; padding: 0; margin: 1.5rem 0 0; }
.fa-auth-art li { display: flex; gap: .6rem; margin-bottom: .7rem; color: rgba(255, 255, 255, .85); }
.fa-auth-art li i { color: var(--fa-amber); }
.fa-auth-form { display: flex; align-items: center; justify-content: center; padding: 2rem 1.25rem; }
.fa-auth-form .box { width: 100%; max-width: 420px; }
@media (max-width: 860px) { .fa-auth { grid-template-columns: 1fr; } .fa-auth-art { display: none; } }

/* ---------- language switch & notification bell ---------- */
.fa-lang { display: inline-grid; place-items: center; font-weight: 700; font-size: .85rem; color: var(--fa-navy); text-decoration: none; }
.fa-lang:hover { background: var(--fa-amber-soft); }
.fa-bell .fa-icon-btn { font-size: 1.15rem; }
.fa-bell-count { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px;
    background: var(--fa-red); color: #fff; font-size: .7rem; font-weight: 700; line-height: 18px; text-align: center; }
.fa-bell-menu { width: 340px; max-width: calc(100vw - 24px); padding: 0; }
.fa-bell-item { display: flex; gap: .65rem; width: 100%; text-align: left; border: 0; background: #fff; padding: .65rem .9rem; border-bottom: 1px solid #eef1f6; }
.fa-bell-item:hover { background: #f6f8fc; }
.fa-bell-item.unread { background: #f2f7ff; }
.fa-bell-item > i { font-size: 1.1rem; color: var(--fa-blue); margin-top: .1rem; }
.fa-bell-item span { min-width: 0; display: flex; flex-direction: column; }
.fa-bell-item b { font-size: .88rem; } .fa-bell-item small { color: var(--fa-muted); white-space: pre-line; max-height: 3.2em; overflow: hidden; }
.fa-bell-item em { font-style: normal; font-size: .72rem; color: var(--fa-muted); }
.fa-notif { display: flex; gap: .8rem; padding: .85rem 1.1rem; border-bottom: 1px solid #eef1f6; }
.fa-notif.unread { background: #f6f9ff; }
.fa-notif .ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: #e7f0fb; color: var(--fa-blue); flex-shrink: 0; }
.fa-switch-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem 0; border-bottom: 1px dashed var(--fa-line); }
.fa-switch-row:last-child { border-bottom: 0; }
.fa-switch-row .form-check { margin: 0; }
.fa-google { display: flex; align-items: center; justify-content: center; gap: .6rem; border: 1px solid #d5dbe6; background: #fff; color: #17233a; font-weight: 600; }
.fa-google:hover { background: #f6f8fc; }
.fa-or { display: flex; align-items: center; gap: .75rem; color: var(--fa-muted); font-size: .85rem; margin: 1rem 0; }
.fa-or::before, .fa-or::after { content: ""; flex: 1; border-top: 1px solid var(--fa-line); }
