/* =====================================================================
   DhanSetu - Paddy Trading Management System
   Theme: deep green + gold. Works on top of Bootstrap 5.3 (CDN).
   ===================================================================== */
:root {
    --g950: #04301f; --g900: #06412b; --g800: #0a5236; --g700: #0d6b43; --g600: #12804f; --g500: #1a9a5f;
    --g200: #c9e6d5; --g100: #e3f3ea; --g50: #f3faf6;
    --gold: #c8901a; --gold2: #e2ab2f; --gold-soft: #fbf1d8;
    --ink: #1b2a23; --muted: #6a7b72; --line: #e2eae5; --bg: #f2f6f3; --card: #ffffff;
    --surface: #ffffff; --surface-2: #f0f5f2; --hover: var(--g50);
    --nav-active-bg: #e4f4ea;
    --orange: #f0a41c; --red: #e0443f; --blue: #1f6fe5; --purple: #7a55c7;
    --radius: 12px; --shadow: 0 1px 2px rgba(6, 65, 43, .06), 0 4px 14px rgba(6, 65, 43, .05);
    --sidebar-w: 252px;
    --bs-body-font-family: 'Inter', 'Noto Sans Devanagari', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
    --bs-body-color: var(--ink);
    --bs-body-font-size: .9rem;
    --bs-link-color: var(--g700);
    --bs-link-hover-color: var(--g900);
    --bs-primary: #0d6b43;
    --bs-primary-rgb: 13, 107, 67;
}
* { -webkit-font-smoothing: antialiased; }
html, body { min-height: 100%; }
body { background: var(--bg); color: var(--ink); font-family: var(--bs-body-font-family); font-size: .9rem; }
a { text-decoration: none; }
.text-muted { color: var(--muted) !important; }
.text-gold { color: var(--gold) !important; }
.text-g { color: var(--g700) !important; }
.fw-800 { font-weight: 800; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.nowrap { white-space: nowrap; }

/* ---------------------------------------------------------------- sidebar */
.sidebar {
    position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 1040; overflow-y: auto; overflow-x: hidden;
    background: linear-gradient(180deg, var(--g800) 0%, var(--g900) 55%, var(--g950) 100%); color: #e8f5ee;
    display: flex; flex-direction: column; transition: transform .25s ease; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.25) transparent;
}
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 16px 18px 14px; border-bottom: 1px solid rgba(255,255,255,.1); }
.sidebar .brand svg { flex: 0 0 auto; }
.brand-name { font-size: 1.55rem; font-weight: 800; letter-spacing: -.5px; line-height: 1; color: #fff; }
.brand-name b { color: var(--gold2); font-weight: 800; }
.brand-sub { font-size: .62rem; color: rgba(255,255,255,.6); letter-spacing: .3px; margin-top: 3px; }
.sidebar .nav-list { list-style: none; margin: 0; padding: 12px 10px; flex: 1 1 auto; }
.sidebar .nav-list > li { margin-bottom: 2px; }
.sidebar .nav-item-link {
    display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 9px; color: #e8f5ee; font-size: .86rem; font-weight: 500;
    cursor: pointer; transition: background .15s, color .15s; width: 100%; border: 0; background: transparent; text-align: left;
}
.sidebar .nav-item-link i.ico { width: 20px; text-align: center; font-size: .95rem; opacity: .95; }
.sidebar .nav-item-link:hover { background: rgba(255,255,255,.09); color: #fff; }
.sidebar .nav-item-link.active { background: var(--nav-active-bg); color: var(--g800); font-weight: 700; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.sidebar .nav-item-link .chev { margin-left: auto; font-size: .65rem; opacity: .7; transition: transform .2s; }
.sidebar .nav-item-link[aria-expanded="true"] .chev { transform: rotate(90deg); }
.sidebar .sub { list-style: none; margin: 2px 0 6px; padding: 0 0 0 30px; }
.sidebar .sub a { display: block; padding: 6px 10px; border-radius: 7px; color: rgba(255,255,255,.78); font-size: .8rem; }
.sidebar .sub a:hover { color: #fff; background: rgba(255,255,255,.07); }
.sidebar .sub a.active { color: var(--gold2); font-weight: 700; }
.sidebar .lang-box { margin: 8px 12px 14px; padding: 10px 12px; border-radius: 10px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.1); }
.sidebar .lang-box small { display: block; color: rgba(255,255,255,.6); font-size: .68rem; margin-bottom: 6px; }
.lang-pills { display: flex; gap: 5px; }
.lang-pills a { flex: 1; text-align: center; padding: 4px 0; font-size: .74rem; border-radius: 6px; color: #dcefe4; background: rgba(255,255,255,.07); }
.lang-pills a.on, .lang-pills a:hover { background: var(--gold2); color: #3a2a00; font-weight: 700; }
.sidebar-backdrop { display: none; }

/* ---------------------------------------------------------------- main + topbar */
.main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
    position: sticky; top: 0; z-index: 1030; height: 62px; background: var(--surface); border-bottom: 1px solid var(--line);
    display: flex; align-items: center; gap: 14px; padding: 0 22px;
}
.topbar .toggle { display: none; border: 0; background: transparent; font-size: 1.25rem; color: var(--g800); }
/* Brand mark inside the top bar — hidden here because the sidebar layout already shows it in the
   sidebar; the topbar-layout rule below (search "menu layout: top bar") turns it on, since the
   sidebar (and its brand) is fully hidden in that layout and would otherwise vanish entirely. */
.topbar-brand { display: none; align-items: center; gap: 9px; text-decoration: none; flex: 0 0 auto; margin-right: 4px; }
.topbar-brand svg { flex: 0 0 auto; }
.tb-brand-text { line-height: 1.15; }
.tb-name { display: block; font-size: 1.05rem; font-weight: 800; letter-spacing: -.3px; color: var(--g900); }
.tb-name b { color: var(--gold2); font-weight: 800; }
.tb-sub { display: block; font-size: .6rem; color: var(--muted); font-weight: 600; letter-spacing: .2px; white-space: nowrap; }
.topbar .search { position: relative; flex: 0 1 420px; }
.topbar .search input { padding-left: 38px; border-radius: 10px; background: #f5f8f6; border: 1px solid var(--line); height: 38px; font-size: .84rem; }
.topbar .search i { position: absolute; left: 13px; top: 11px; color: var(--muted); font-size: .85rem; }
.topbar .spacer { flex: 1; }
.topbar .today { font-size: .82rem; color: var(--muted); white-space: nowrap; }
.topbar .fy-select { font-size: .8rem; border-radius: 8px; border: 1px solid var(--line); padding: 5px 26px 5px 10px; background-color: #fff; font-weight: 600; color: var(--g800); }
.bell { position: relative; border: 0; background: transparent; font-size: 1.1rem; color: var(--g800); padding: 6px 8px; }
.bell .cnt { position: absolute; top: 0; right: 0; background: var(--red); color: #fff; font-size: .62rem; min-width: 17px; height: 17px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.user-chip { display: flex; align-items: center; gap: 9px; border: 0; background: transparent; padding: 3px 4px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--g700), var(--g500)); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.user-chip .who { text-align: left; line-height: 1.15; }
.user-chip .who b { font-size: .82rem; display: block; color: var(--ink); }
.user-chip .who small { font-size: .7rem; color: var(--muted); }
.notif-menu { width: 340px; max-height: 420px; overflow: auto; padding: 0; }
.notif-menu .n-item { display: flex; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: .8rem; color: var(--ink); }
.notif-menu .n-item:hover { background: var(--hover); }
.notif-menu .n-item i { margin-top: 2px; }
.content { padding: 22px 24px 30px; flex: 1; }
.footer-bar { padding: 12px 24px; font-size: .75rem; color: var(--muted); border-top: 1px solid var(--line); background: var(--surface); }

/* ---------------------------------------------------------------- page header */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.page-title { font-size: 1.55rem; font-weight: 800; color: var(--g900); margin: 0; letter-spacing: -.3px; }
.page-sub { color: var(--muted); font-size: .85rem; margin-top: 2px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------------------------------------------------------------- cards */
.card-ds { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-ds > .card-h { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 10px; font-weight: 700; color: var(--g900); }
.card-ds > .card-b { padding: 18px; }
.card-h .link { font-size: .78rem; font-weight: 600; }
.sec-title { display: flex; align-items: center; gap: 9px; font-weight: 700; color: var(--g900); margin-bottom: 14px; font-size: .95rem; }
.sec-title .ic { width: 26px; height: 26px; border-radius: 50%; background: var(--g100); color: var(--g700); display: inline-flex; align-items: center; justify-content: center; font-size: .72rem; }

/* KPI tiles */
.kpi { border-radius: 14px; padding: 16px 18px; color: #fff; display: flex; align-items: center; gap: 14px; position: relative; overflow: hidden; box-shadow: 0 6px 16px rgba(0,0,0,.12); min-height: 104px; }
.kpi::after { content: ''; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; background: rgba(255,255,255,.1); }
.kpi .ic { width: 52px; height: 52px; border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.35rem; flex: 0 0 auto; }
.kpi .lbl { font-size: .82rem; opacity: .92; font-weight: 500; }
.kpi .val { font-size: 1.45rem; font-weight: 800; line-height: 1.15; letter-spacing: -.4px; white-space: nowrap; }
.kpi .sub { font-size: .78rem; opacity: .92; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.kpi .chg { background: rgba(255,255,255,.22); border-radius: 20px; padding: 0 7px; font-size: .72rem; font-weight: 700; }
/* Compact variant: used where 5 tiles share a row, so numbers still fit without wrapping. */
.kpi.compact { padding: 14px 16px; gap: 12px; min-height: 96px; }
.kpi.compact .ic { width: 44px; height: 44px; font-size: 1.15rem; }
.kpi.compact .val { font-size: 1.22rem; }
.kpi.compact .lbl { font-size: .78rem; }
.kpi.compact .sub { font-size: .72rem; }
.kpi.k-green { background: linear-gradient(135deg, #159a55, #0c7d43); } .kpi.k-green .ic { color: #159a55; }
.kpi.k-orange { background: linear-gradient(135deg, #f5b02a, #e58f0f); } .kpi.k-orange .ic { color: #e58f0f; }
.kpi.k-red { background: linear-gradient(135deg, #ea5348, #d32f33); } .kpi.k-red .ic { color: #d32f33; }
.kpi.k-blue { background: linear-gradient(135deg, #2a7cf0, #1758c9); } .kpi.k-blue .ic { color: #1758c9; }
.kpi.k-purple { background: linear-gradient(135deg, #8a63d2, #6b45b8); } .kpi.k-purple .ic { color: #6b45b8; }
.kpi.k-teal { background: linear-gradient(135deg, #1bb8ce, #128fa1); } .kpi.k-teal .ic { color: #128fa1; }
.kpi.k-gold { background: linear-gradient(135deg, #d4a531, #b3811a); } .kpi.k-gold .ic { color: #b3811a; }
.kpi.k-brown { background: linear-gradient(135deg, #a5714a, #825637); } .kpi.k-brown .ic { color: #825637; }
.kpi.k-indigo { background: linear-gradient(135deg, #6366f1, #4338ca); } .kpi.k-indigo .ic { color: #4338ca; }
a.kpi, a.kpi:visited, a.kpi:hover { color: #fff; text-decoration: none; }
a.kpi { cursor: pointer; transition: transform .15s ease, box-shadow .15s ease; }
a.kpi:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(0,0,0,.2); }
.mini-kpi { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: flex; align-items: center; gap: 12px; box-shadow: var(--shadow); }
.mini-kpi .ic { width: 42px; height: 42px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; }
.mini-kpi .l { font-size: .74rem; color: var(--muted); }
.mini-kpi .v { font-size: 1.2rem; font-weight: 800; color: var(--ink); line-height: 1.2; }

/* ---------------------------------------------------------------- tables */
.table-ds { margin: 0; font-size: .82rem; }
.table-ds thead th { background: var(--surface-2); color: #35463d; font-weight: 700; font-size: .76rem; border-bottom: 1px solid var(--line); padding: 10px 9px; white-space: nowrap; }
.table-ds td { padding: 9px 9px; vertical-align: middle; border-color: var(--line); }
.table-ds tbody tr:hover { background: var(--hover); }
.table-ds tfoot td { background: var(--surface-2); font-weight: 800; border-top: 2px solid var(--g200); }
.table-ds .num, .table-ds th.num { text-align: right; }
.table-wrap { overflow-x: auto; }
.st { display: inline-block; padding: 2px 10px; border-radius: 6px; font-size: .72rem; font-weight: 700; }
.category-badge { margin-left: 6px; vertical-align: 1px; }
.st-completed, .st-closed, .st-active { background: #dcf3e5; color: #0d7a43; }
.st-pending { background: #fdecc8; color: #a86500; }
.st-advance { background: #dde9fb; color: #1758c9; }
.st-inactive, .st-cancelled { background: #ececec; color: #666; }
.icon-btn { width: 30px; height: 30px; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); background: #fff; color: var(--g700); font-size: .8rem; cursor: pointer; }
.icon-btn:hover { background: var(--g100); color: var(--g900); }
.icon-btn.danger { color: var(--red); } .icon-btn.danger:hover { background: #fde8e7; }
.icon-btn.blue { color: var(--blue); } .icon-btn.blue:hover { background: #e3edfd; }
.empty { padding: 34px; text-align: center; color: var(--muted); }
.empty i { font-size: 2rem; color: var(--g200); display: block; margin-bottom: 8px; }

/* ---------------------------------------------------------------- forms & buttons */
.form-label { font-size: .76rem; font-weight: 600; color: #3d4e45; margin-bottom: 4px; }
.form-control, .form-select { font-size: .86rem; border-color: #d7e1db; border-radius: 8px; padding: .42rem .7rem; }
.form-control:focus, .form-select:focus { border-color: var(--g600); box-shadow: 0 0 0 .18rem rgba(18,128,79,.15); }
.form-control[readonly] { background: #f3f7f5; }
.input-group-text { background: #f3f7f5; border-color: #d7e1db; color: var(--muted); font-size: .84rem; }
.form-control.big { font-weight: 800; font-size: 1.05rem; }
.btn { border-radius: 8px; font-weight: 600; font-size: .84rem; }
.btn-ds { background: var(--g700); border-color: var(--g700); color: #fff; }
.btn-ds:hover, .btn-ds:focus { background: var(--g800); border-color: var(--g800); color: #fff; }
.btn-outline-ds { border-color: var(--g700); color: var(--g700); background: #fff; }
.btn-outline-ds:hover { background: var(--g700); color: #fff; }
.btn-blue { background: var(--blue); border-color: var(--blue); color: #fff; } .btn-blue:hover { background: #1758c9; color: #fff; }
.btn-wa { background: #25a768; border-color: #25a768; color: #fff; } .btn-wa:hover { background: #1c8d55; color: #fff; }
.btn-gold { background: var(--gold2); border-color: var(--gold2); color: #3a2a00; } .btn-gold:hover { background: var(--gold); color: #fff; }
.btn-soft { background: #fff; border: 1px solid var(--line); color: var(--ink); } .btn-soft:hover { background: var(--g50); }
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.filter-bar .f { display: flex; flex-direction: column; }
.filter-bar .f label { font-size: .7rem; font-weight: 600; color: var(--muted); margin-bottom: 3px; }
.filter-bar .form-control, .filter-bar .form-select { min-width: 130px; height: 36px; }
.flash { border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; font-size: .86rem; display: flex; gap: 10px; align-items: center; }
.flash.ok { background: #dcf3e5; color: #0b6b3b; border: 1px solid #b9e4c9; }
.flash.warn { background: #fff3d6; color: #8a5a00; border: 1px solid #f3dc9d; }
.flash.err { background: #fde8e7; color: #a5211c; border: 1px solid #f5c2bf; }
.amount-box { background: var(--hover); border: 1px solid var(--g200); border-radius: 10px; padding: 12px 14px; }
.amount-line { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 5px 0; font-size: .86rem; }
.amount-line.total { border-top: 2px solid var(--g200); margin-top: 6px; padding-top: 10px; font-weight: 800; font-size: 1rem; color: var(--g900); }
.amount-line .form-control { max-width: 130px; text-align: right; padding: .25rem .5rem; height: 30px; }
.bar-sticky { position: sticky; bottom: 0; background: var(--surface); border-top: 1px solid var(--line); padding: 12px 18px; display: flex; gap: 10px; flex-wrap: wrap; border-radius: 0 0 var(--radius) var(--radius); }
.pagination { margin: 0; } .page-link { color: var(--g700); font-size: .8rem; } .page-item.active .page-link { background: var(--g700); border-color: var(--g700); }
.list-foot { padding: 12px 18px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; font-size: .8rem; color: var(--muted); border-top: 1px solid var(--line); }

/* quick actions */
.qa { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); font-weight: 600; font-size: .84rem; margin-bottom: 8px; transition: all .15s; }
.qa:hover { background: var(--hover); border-color: var(--g200); color: var(--g800); transform: translateX(2px); }
.qa .ic { width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: .85rem; }

/* dashboard: dhan stock variety list */
.stock-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px 10px; max-height: 190px; overflow-y: auto; padding-right: 4px; }
.stock-row { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: .78rem; padding: 4px 6px; border-radius: 6px; color: var(--ink); text-decoration: none; transition: background .15s; }
.stock-row:hover { background: var(--hover); color: var(--g800); }
.stock-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stock-row b { flex-shrink: 0; }
.stock-grid::-webkit-scrollbar { width: 5px; }
.stock-grid::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }
@media (max-width: 420px) { .stock-grid { grid-template-columns: 1fr; max-height: 260px; } }

/* settings side menu */
.set-menu a { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 9px; color: var(--ink); font-weight: 600; font-size: .85rem; margin-bottom: 3px; }
.set-menu a i { width: 18px; text-align: center; color: var(--g700); }
.set-menu a:hover { background: var(--hover); }
.set-menu a.active { background: var(--g700); color: #fff; } .set-menu a.active i { color: #fff; }
.switch-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); }

/* reports index */
.rep-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; height: 100%; box-shadow: var(--shadow); }
.rep-card h6 { margin: 0; padding: 12px 16px; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--g800), var(--g700)); font-size: .9rem; }
.rep-card a { display: flex; align-items: center; gap: 10px; padding: 9px 16px; color: var(--ink); font-size: .84rem; border-bottom: 1px solid var(--line); }
.rep-card a:last-child { border-bottom: 0; }
.rep-card a:hover { background: var(--hover); color: var(--g800); }
.rep-card a i { width: 18px; color: var(--gold); text-align: center; }
.rep-card a .go { margin-left: auto; color: var(--g200); font-size: .7rem; }

/* ledger header */
.party-head { display: flex; align-items: center; gap: 14px; }
.party-head .pic { width: 46px; height: 46px; border-radius: 50%; background: var(--g100); color: var(--g700); display: flex; align-items: center; justify-content: center; font-size: 1.2rem; }

/* ---------------------------------------------------------------- login */
.login-page { min-height: 100vh; display: flex; flex-direction: column; position: relative; overflow: hidden; background: #f4f0dd; }
.login-bg { position: absolute; inset: 0; z-index: 0; }
.login-bg svg { width: 100%; height: 100%; display: block; }
.login-top-curve { position: absolute; top: 0; left: 0; z-index: 1; }
.login-inner { position: relative; z-index: 2; flex: 1; display: flex; padding: 34px 5vw 24px; gap: 30px; align-items: stretch; }
.login-left { flex: 1 1 58%; min-width: 0; display: flex; flex-direction: column; padding-right: 2vw; }
.login-right { flex: 0 0 min(470px, 100%); display: flex; align-items: center; justify-content: center; position: relative; }
.logo-lockup { display: flex; align-items: center; gap: 10px; }
.logo-word { font-size: clamp(3rem, 5.4vw, 5rem); font-weight: 900; letter-spacing: -2px; line-height: .95; color: var(--g900); }
.logo-word b { background: linear-gradient(180deg, #e8b53a, #b87a0c); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 900; }
.logo-word sup { font-size: .8rem; letter-spacing: 0; color: var(--g900); font-weight: 700; top: -2.2em; }
.logo-tag { font-size: 1.2rem; font-weight: 500; color: var(--g900); letter-spacing: .2px; margin-left: 4px; }
.tagline-mr { font-size: clamp(1.15rem, 2vw, 1.6rem); font-weight: 800; color: var(--g900); margin: 12px 0 2px; }
.tagline-en { font-size: 1.15rem; font-style: italic; font-weight: 600; color: var(--g800); }
.stat-strip { display: flex; gap: 26px; margin: 22px 0 16px; align-items: center; background: rgba(255,255,255,.72); backdrop-filter: blur(3px); border-radius: 14px; padding: 12px 22px; width: fit-content; max-width: 100%; flex-wrap: wrap; }
.stat-strip .st-i { text-align: center; }
.stat-strip .st-i i { font-size: 1.5rem; color: var(--g800); }
.stat-strip .st-i b { display: block; font-size: 1.35rem; color: var(--g900); font-weight: 800; line-height: 1.1; }
.stat-strip .st-i small { color: #445; font-size: .8rem; }
.check-list { list-style: none; padding: 0; margin: 0; background: rgba(255,255,255,.55); border-radius: 12px; width: fit-content; padding: 10px 18px 10px 12px; }
.check-list li { display: flex; align-items: center; gap: 12px; padding: 5px 0; font-size: .98rem; color: #1e3a2c; }
.check-list li i { color: var(--g700); font-size: 1.15rem; }
.script-tag { position: absolute; left: 44%; top: 32%; font-family: 'Brush Script MT', 'Segoe Script', 'Lucida Handwriting', cursive; font-size: 1.9rem; color: var(--g900); transform: rotate(-9deg); line-height: 1.05; opacity: .95; }
.script-tag::after { content: ''; display: block; height: 3px; width: 85%; margin: 4px 0 0 30px; border-radius: 3px; background: linear-gradient(90deg, transparent, var(--gold2)); transform: rotate(-3deg); }
.login-card { width: 100%; background: #fff; border-radius: 16px; padding: 30px 34px 22px; box-shadow: 0 18px 50px rgba(6,65,43,.28); position: relative; }
.login-card .shield { width: 62px; height: 68px; margin: -50px auto 6px; display: block; }
.login-card h2 { text-align: center; font-weight: 800; color: var(--g950); margin: 0; font-size: 2rem; letter-spacing: -.5px; }
.login-card .sub { text-align: center; color: #48594f; margin-bottom: 20px; }
.login-card .input-icon { position: relative; margin-bottom: 14px; }
.login-card .input-icon > i.l { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: #6b7a72; z-index: 2; }
.login-card .input-icon .form-control { padding-left: 44px; height: 50px; background: #eef3fb; border: 1px solid #dfe7f3; font-size: 1rem; border-radius: 10px; }
.login-card .input-icon .eye { position: absolute; right: 13px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: #55655d; z-index: 2; }
.login-btn { width: 100%; height: 48px; border-radius: 9px; background: linear-gradient(180deg, var(--g700), var(--g900)); color: #fff; font-weight: 700; font-size: 1.05rem; border: 0; display: flex; align-items: center; justify-content: center; gap: 12px; }
.login-btn:hover { filter: brightness(1.12); color: #fff; }
.or-line { display: flex; align-items: center; gap: 12px; color: #55655d; font-size: .8rem; margin: 12px 0; } .or-line::before, .or-line::after { content: ''; flex: 1; height: 1px; background: #dde5e0; }
.qr-btn { width: 100%; height: 44px; border-radius: 9px; background: #eef3fb; border: 1px solid #dfe7f3; color: #1b2a23; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 12px; }
.qr-btn:hover { background: #e2ebf8; }
.login-quote { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 16px; color: #48594f; font-size: .85rem; text-align: center; line-height: 1.3; }
.lang-drop { position: absolute; top: 26px; right: 5vw; z-index: 6; }
.lang-drop .btn-lang { background: rgba(6,65,43,.94); color: #fff; border: 1px solid rgba(255,255,255,.25); border-radius: 9px; padding: 8px 14px; min-width: 182px; display: flex; align-items: center; justify-content: space-between; gap: 10px; font-weight: 500; }
.lang-drop .menu { position: absolute; top: 44px; right: 0; background: #fff; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.2); min-width: 150px; padding: 6px; display: none; }
.lang-drop.open .menu { display: block; }
.lang-drop .menu a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 7px; color: var(--ink); }
.lang-drop .menu a:hover, .lang-drop .menu a.on { background: var(--g50); }
.module-tiles { position: relative; z-index: 2; display: grid; grid-template-columns: repeat(10, 1fr); gap: 10px; padding: 0 5vw 18px; }
.module-tiles .t { background: rgba(255,255,255,.96); border-radius: 10px; padding: 12px 6px 9px; text-align: center; box-shadow: 0 3px 10px rgba(0,0,0,.1); }
.module-tiles .t i { font-size: 1.65rem; color: var(--g800); display: block; margin-bottom: 4px; }
.module-tiles .t b { display: block; font-size: .78rem; color: var(--g950); line-height: 1.15; }
.module-tiles .t span { font-size: .75rem; color: #3a4a41; }
.login-footer { position: relative; z-index: 2; background: var(--g900); color: #d5eadf; padding: 13px 5vw; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; font-size: .82rem; }
.login-footer a { color: #d5eadf; } .login-footer a:hover { color: #fff; }
.login-footer .links { display: flex; align-items: center; gap: 12px; }
.login-footer .links .sep { opacity: .4; }
.login-footer .soc { display: flex; gap: 14px; font-size: 1.25rem; margin-left: 10px; }

/* QR modal */
#qrBox { display: flex; align-items: center; justify-content: center; min-height: 230px; }
#qrBox canvas, #qrBox img { border: 8px solid #fff; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,.15); }

/* ---------------------------------------------------------------- print docs */
.doc { background: #fff; max-width: 820px; margin: 0 auto; border: 1px solid var(--line); border-radius: 10px; padding: 30px 36px; }
.doc-head { display: flex; justify-content: space-between; gap: 20px; border-bottom: 3px double var(--g700); padding-bottom: 14px; margin-bottom: 16px; }
.doc-head h1 { font-size: 1.6rem; font-weight: 800; margin: 0; color: var(--g900); }
.doc .doc-title { text-align: center; font-weight: 800; letter-spacing: 1px; font-size: 1.05rem; text-transform: uppercase; margin: 6px 0 14px; color: var(--g800); }
.doc table.t { width: 100%; border-collapse: collapse; font-size: .85rem; }
.doc table.t th, .doc table.t td { border: 1px solid #cfd9d3; padding: 7px 10px; }
.doc table.t th { background: #eef4f0; }
.sign-row { display: flex; justify-content: space-between; margin-top: 60px; font-size: .8rem; color: #555; }
.sign-row div { border-top: 1px solid #999; padding-top: 4px; min-width: 150px; text-align: center; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1199px) { .module-tiles { grid-template-columns: repeat(5, 1fr); } .script-tag { display: none; } }
@media (max-width: 991px) {
    .sidebar { transform: translateX(-100%); }
    body.sb-open .sidebar { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.4); }
    body.sb-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 1035; }
    .main { margin-left: 0; }
    .topbar .toggle { display: inline-block; }
    .topbar .today, .topbar .who { display: none; }
    .topbar .search { flex: 1 1 auto; }
    .content { padding: 16px 12px 24px; }
    .login-inner { flex-direction: column; padding-top: 70px; }
    .login-right { flex: none; margin-top: 30px; }
    .login-card .shield { margin-top: -50px; }
}
@media (max-width: 575px) { .module-tiles { grid-template-columns: repeat(2, 1fr); } .stat-strip { gap: 14px; } }

@media print {
    body { background: #fff !important; }
    .sidebar, .topbar, .no-print, .footer-bar, .flash, .filter-bar, .page-actions, .list-foot .pagination { display: none !important; }
    .main { margin: 0 !important; }
    .content { padding: 0 !important; }
    .card-ds, .doc { box-shadow: none !important; border: 0 !important; }
    .doc { max-width: 100%; padding: 0; }
    .table-ds thead th { background: #eee !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    a { color: inherit !important; }
}

/* compact tables inside half-width cards */
.table-ds.compact th, .table-ds.compact td { padding: 9px 7px; font-size: .82rem; }

.list-foot nav p.small { display: none; }
.list-foot nav > div:first-child.d-sm-none { display: none !important; }
.list-foot nav > div.d-sm-flex { justify-content: flex-end !important; }

/* =====================================================================
   THEME SYSTEM — mode (light/dark/auto), color themes, menu layout
   Toggled via data-mode-resolved / data-theme / data-layout on <html>.
   Driven by public/js/theme.js + partials/theme-preload + theme-panel.
   ===================================================================== */

/* ---------------------------------------------------------------- named color themes (override the g-ramp + gold + nav-active-bg) */
html[data-theme="sunset"] {
    --g950: #3d1608; --g900: #5c210c; --g800: #7c2e10; --g700: #a83f16; --g600: #cf521e; --g500: #f26b28;
    --g200: #fbd9c2; --g100: #fdeadb; --g50: #fff6ee;
    --gold: #c96a1a; --gold2: #e8a23a; --gold-soft: #fdf0dc; --nav-active-bg: #ffe6d2;
    --bs-primary: #a83f16; --bs-primary-rgb: 168, 63, 22;
}
html[data-theme="ocean"] {
    --g950: #04283d; --g900: #05375a; --g800: #094a73; --g700: #0d6493; --g600: #1180b8; --g500: #1a9cdc;
    --g200: #c9e6f6; --g100: #e3f3fb; --g50: #f3fafd;
    --gold: #c8901a; --gold2: #e2ab2f; --gold-soft: #fbf1d8; --nav-active-bg: #dcefff;
    --bs-primary: #0d6493; --bs-primary-rgb: 13, 100, 147;
}
html[data-theme="forest"] {
    --g950: #12200c; --g900: #1a2e12; --g800: #24401a; --g700: #305622; --g600: #3d6b2c; --g500: #4c8237;
    --g200: #d9e8cd; --g100: #eaf3e2; --g50: #f6faf2;
    --gold: #96851c; --gold2: #b8a52a; --gold-soft: #f4f0d6; --nav-active-bg: #e6f0da;
    --bs-primary: #305622; --bs-primary-rgb: 48, 86, 34;
}
html[data-theme="royal"] {
    --g950: #160a2b; --g900: #1c0f3d; --g800: #281559; --g700: #351d78; --g600: #452699; --g500: #5731bd;
    --g200: #ddd0f7; --g100: #ebe3fa; --g50: #f7f3fd;
    --gold: #c8901a; --gold2: #e2ab2f; --gold-soft: #fbf1d8; --nav-active-bg: #ece1fb;
    --bs-primary: #351d78; --bs-primary-rgb: 53, 29, 120;
}
html[data-theme="ruby"] {
    --g950: #2b030c; --g900: #3d0410; --g800: #590616; --g700: #7a0a1f; --g600: #a30f29; --g500: #c91634;
    --g200: #f6c9d2; --g100: #fbe3e8; --g50: #fdf3f5;
    --gold: #c17a3a; --gold2: #d99a5c; --gold-soft: #f8e9db; --nav-active-bg: #fbdde3;
    --bs-primary: #7a0a1f; --bs-primary-rgb: 122, 10, 31;
}
html[data-theme="midnight"] {
    --g950: #03060f; --g900: #050a1a; --g800: #0a1530; --g700: #0f2247; --g600: #16315f; --g500: #1e4378;
    --g200: #cdd8ec; --g100: #e2e9f5; --g50: #f4f7fb;
    --gold: #7a8ba8; --gold2: #9aabc7; --gold-soft: #eef1f6; --nav-active-bg: #e0e7f5;
    --bs-primary: #0f2247; --bs-primary-rgb: 15, 34, 71;
}
html[data-theme="golden"] {
    --g950: #2b1c03; --g900: #3d2905; --g800: #5c3d08; --g700: #7a4f0a; --g600: #a3690f; --g500: #c98416;
    --g200: #f6e3bf; --g100: #fbefd9; --g50: #fdf8ee;
    --gold: #a35c0a; --gold2: #e89f1f; --gold-soft: #fdf0d8; --nav-active-bg: #f7e8c8;
    --bs-primary: #7a4f0a; --bs-primary-rgb: 122, 79, 10;
}
html[data-theme="teal"] {
    --g950: #021f1c; --g900: #032e2b; --g800: #054540; --g700: #075a54; --g600: #0a756c; --g500: #0e9184;
    --g200: #c5ece6; --g100: #def6f1; --g50: #f2fcfa;
    --gold: #b3791c; --gold2: #d9971c; --gold-soft: #f8ecd4; --nav-active-bg: #d7f3ed;
    --bs-primary: #075a54; --bs-primary-rgb: 7, 90, 84;
}
html[data-theme="rose"] {
    --g950: #2b0313; --g900: #3d0521; --g800: #590a30; --g700: #7a0f41; --g600: #a31555; --g500: #c91b69;
    --g200: #f6c9de; --g100: #fbe3ee; --g50: #fdf3f8;
    --gold: #c8901a; --gold2: #e2ab2f; --gold-soft: #fbf1d8; --nav-active-bg: #fbdcea;
    --bs-primary: #7a0f41; --bs-primary-rgb: 122, 15, 65;
}
html[data-theme="slate"] {
    --g950: #12161a; --g900: #1c2126; --g800: #262c33; --g700: #333b44; --g600: #434d58; --g500: #54606d;
    --g200: #dde1e5; --g100: #e9ecef; --g50: #f5f6f8;
    --gold: #a3791c; --gold2: #d9971c; --gold-soft: #f6ecd6; --nav-active-bg: #e4e8ec;
    --bs-primary: #333b44; --bs-primary-rgb: 51, 59, 68;
}

/* ---------------------------------------------------------------- dark mode (comes after theme blocks so these tint overrides win) */
html[data-mode-resolved="dark"] {
    --bg: #0e1512; --card: #16211c; --surface: #16211c; --surface-2: #1c2921;
    --ink: #e7f0ea; --muted: #93a89c; --line: #28362e;
    --g50: rgba(255,255,255,.04); --g100: rgba(255,255,255,.07); --g200: rgba(255,255,255,.14);
    --hover: rgba(255,255,255,.05);
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 14px rgba(0,0,0,.25);
}
html[data-mode-resolved="dark"] .topbar .search input,
html[data-mode-resolved="dark"] .filter-bar .form-control,
html[data-mode-resolved="dark"] .form-control,
html[data-mode-resolved="dark"] .form-select,
html[data-mode-resolved="dark"] .input-group-text,
html[data-mode-resolved="dark"] .topbar .fy-select { background-color: var(--surface-2); border-color: var(--line); color: var(--ink); }
html[data-mode-resolved="dark"] .form-control[readonly] { background-color: rgba(255,255,255,.03); }
html[data-mode-resolved="dark"] .btn-soft { background: var(--card); border-color: var(--line); color: var(--ink); }
html[data-mode-resolved="dark"] .doc,
html[data-mode-resolved="dark"] .doc table.t th { background: var(--card); border-color: var(--line); }
html[data-mode-resolved="dark"] .doc table.t th { background: var(--surface-2); }
html[data-mode-resolved="dark"] ::-webkit-scrollbar-track { background: transparent; }

/* bootstrap dropdown/offcanvas/modal surfaces follow theme everywhere (harmless in light mode, matches existing #fff) */
.dropdown-menu { --bs-dropdown-bg: var(--card); --bs-dropdown-color: var(--ink); --bs-dropdown-link-color: var(--ink); --bs-dropdown-link-hover-bg: var(--hover); --bs-dropdown-link-hover-color: var(--ink); --bs-dropdown-border-color: var(--line); --bs-dropdown-divider-bg: var(--line); }
.modal-content { --bs-modal-bg: var(--card); --bs-modal-color: var(--ink); }
.offcanvas { --bs-offcanvas-bg: var(--card); --bs-offcanvas-color: var(--ink); }

/* login page — form card + inputs follow dark mode; decorative art scene stays as designed */
html[data-mode-resolved="dark"] .login-card { background: var(--card); }
html[data-mode-resolved="dark"] .login-card h2 { color: var(--ink); }
html[data-mode-resolved="dark"] .login-card .sub,
html[data-mode-resolved="dark"] .or-line { color: var(--muted); }
html[data-mode-resolved="dark"] .login-card .input-icon .form-control { background: var(--surface-2); border-color: var(--line); color: var(--ink); }
html[data-mode-resolved="dark"] .login-card .input-icon .form-control::placeholder { color: var(--muted); }
html[data-mode-resolved="dark"] .qr-btn { background: var(--surface-2); border-color: var(--line); color: var(--ink); }

/* ---------------------------------------------------------------- menu layout: top bar */
.topmenu-wrap { display: none; }
html[data-layout="topbar"] .sidebar,
html[data-layout="topbar"] .sidebar-backdrop,
html[data-layout="topbar"] .topbar .toggle { display: none !important; }
html[data-layout="topbar"] .main { margin-left: 0; }
html[data-layout="topbar"] .topbar-brand { display: flex; }
@media (max-width: 575px) {
    html[data-layout="topbar"] .tb-sub { display: none; }
}
html[data-layout="topbar"] .topmenu-wrap {
    /* Wrap holds the scrolling nav plus two overlay scroll buttons, so the buttons stay fixed at
       the edges no matter how far the nav underneath has scrolled. With 18+ top-level modules the
       row never fits one screen — these buttons (and the fade hints below) are the visible sign
       that more menu exists, instead of leaving items silently scrolled off with no affordance. */
    display: flex; align-items: stretch; position: sticky; top: 62px; z-index: 1025;
    background: linear-gradient(180deg, var(--g800) 0%, var(--g900) 100%);
}
html[data-layout="topbar"] .topmenu {
    /* Single scrolling row (not flex-wrap) — matches a standard horizontal admin nav. Scrolling
       needs overflow-x non-visible, and CSS forces overflow-y to match whenever overflow-x isn't
       visible, so this box WILL clip anything positioned relative to it. That's fine here because
       the dropdown menus are positioned by Popper with strategy:"fixed" (see theme.js) — a
       position:fixed element's containing block is the viewport, not this scroll container, so it
       is never clipped by this box's overflow no matter how the menu bar is scrolled. */
    display: flex; flex-wrap: nowrap; align-items: center; gap: 2px; flex: 1 1 auto; min-width: 0; position: relative;
    padding: 0 6px; scroll-behavior: smooth;
    overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.3) transparent;
}
html[data-layout="topbar"] .topmenu::-webkit-scrollbar { height: 5px; }
html[data-layout="topbar"] .topmenu::-webkit-scrollbar-track { background: transparent; }
html[data-layout="topbar"] .topmenu::-webkit-scrollbar-thumb { background: rgba(255,255,255,.28); border-radius: 4px; }
.topmenu .tm-item {
    color: #e8f5ee; font-size: .82rem; font-weight: 600; padding: 12px 13px; display: flex; align-items: center; gap: 7px;
    white-space: nowrap; border: 0; background: transparent; flex: 0 0 auto;
}
.topmenu .tm-item i { font-size: .85rem; opacity: .9; }
.topmenu .tm-item:hover { background: rgba(255,255,255,.1); color: #fff; }
.topmenu .tm-item.active { background: rgba(255,255,255,.14); color: #fff; box-shadow: inset 0 -3px 0 var(--gold2); }
.topmenu .dropdown-toggle::after { margin-left: 4px; }
/* Popper (strategy:"fixed", set in theme.js) positions this via inline style at runtime — only
   cosmetic/z-index rules belong here, nothing that fights Popper's inline position/transform. */
.topmenu .dropdown-menu { z-index: 1055; }
.topmenu .dropdown-menu a.active { color: var(--g700); font-weight: 700; background: var(--hover); }

/* Left/right scroll buttons + fade hint. theme.js toggles .can-l / .can-r on the wrap based on
   actual scroll position, so a button (and its fade) only shows when there is really more menu in
   that direction — never a dead-end control. */
.tm-nav {
    display: none; flex: 0 0 auto; width: 30px; border: 0; align-items: center; justify-content: center;
    color: #e8f5ee; font-size: .8rem; cursor: pointer; position: relative; z-index: 2;
}
html[data-layout="topbar"] .topmenu-wrap.can-l .tm-nav-l,
html[data-layout="topbar"] .topmenu-wrap.can-r .tm-nav-r { display: flex; }
.tm-nav-l { background: linear-gradient(90deg, var(--g900) 55%, transparent); }
.tm-nav-r { background: linear-gradient(270deg, var(--g900) 55%, transparent); }
.tm-nav:hover { color: #fff; }

@media (max-width: 991px) {
    html[data-layout="topbar"] .topmenu-wrap { top: 62px; }
}

/* ---------------------------------------------------------------- theme customizer trigger + panel */
.theme-trigger { position: relative; border: 0; background: transparent; font-size: 1.1rem; color: var(--g800); padding: 6px 8px; }
.theme-trigger:hover { color: var(--gold); }
.theme-trigger-login {
    width: 40px; height: 40px; border-radius: 9px; background: rgba(6,65,43,.94); color: #fff;
    border: 1px solid rgba(255,255,255,.25); font-size: 1.05rem; display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
.theme-trigger-login:hover { background: var(--g800); }
.top-controls { position: absolute; top: 26px; right: 5vw; z-index: 6; display: flex; align-items: center; gap: 10px; }
.top-controls .lang-drop { position: relative; top: auto; right: auto; z-index: auto; }

.theme-offcanvas { width: 328px; --bs-offcanvas-bg: var(--card); --bs-offcanvas-color: var(--ink); }
.theme-offcanvas .offcanvas-header { border-bottom: 1px solid var(--line); }
.theme-offcanvas .offcanvas-title { color: var(--g900); font-weight: 800; font-size: 1.05rem; }
html[data-mode-resolved="dark"] .theme-offcanvas .offcanvas-title { color: var(--ink); }
.tp-section { margin-bottom: 22px; }
.tp-label { font-size: .72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 9px; }
.tp-pills { display: flex; gap: 8px; }
.tp-pills button {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 11px 6px;
    border: 1.5px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink);
    font-size: .72rem; font-weight: 600; cursor: pointer; transition: all .15s;
}
.tp-pills button i { font-size: 1.05rem; color: var(--muted); }
.tp-pills button:hover { border-color: var(--g500); }
.tp-pills button.sel { border-color: var(--g700); background: var(--hover); color: var(--g800); }
.tp-pills button.sel i { color: var(--g700); }
html[data-mode-resolved="dark"] .tp-pills button.sel { color: var(--ink); }

.tp-swatches { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tp-swatches button {
    display: flex; flex-direction: column; align-items: center; gap: 6px; border: 1.5px solid var(--line); border-radius: 10px;
    padding: 10px 4px; background: var(--card); cursor: pointer; transition: border-color .15s;
}
.tp-swatches button:hover { border-color: var(--g500); }
.tp-swatches button .prev { width: 28px; height: 28px; border-radius: 50%; box-shadow: 0 0 0 2px var(--card); }
.tp-swatches button.sel { border-color: var(--g700); }
.tp-swatches button.sel .prev { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--g700); }
.tp-swatches button span.nm { font-size: .68rem; font-weight: 600; color: var(--ink); text-align: center; line-height: 1.15; }
.tp-swatches button.sel span.nm { color: var(--g800); font-weight: 700; }
html[data-mode-resolved="dark"] .tp-swatches button.sel span.nm { color: var(--ink); }
