/* ============================================================
   DESIGN SYSTEM — VyaparBook ERP
   Clean white professional, deep navy accents, crisp data-first
   ============================================================ */
:root {
  --bg:       #f4f5f8;
  --surface:  #ffffff;
  --surface2: #f8f9fb;
  --border:   #e2e5ec;
  --border2:  #c8cdd8;
  --navy:     #1a2340;
  --navy2:    #243055;
  --accent:   #2563eb;
  --accent-l: #dbeafe;
  --accent-d: #1d4ed8;
  --green:    #059669;
  --green-l:  #d1fae5;
  --red:      #dc2626;
  --red-l:    #fee2e2;
  --amber:    #d97706;
  --amber-l:  #fef3c7;
  --purple:   #7c3aed;
  --purple-l: #ede9fe;
  --text:     #111827;
  --text2:    #4b5563;
  --text3:    #9ca3af;
  --mono:     'JetBrains Mono', monospace;
  --sans:     'Plus Jakarta Sans', sans-serif;
  --r:        8px;
  --r-sm:     5px;
  --r-lg:     12px;
  --shadow:   0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:0 4px 12px rgba(0,0,0,.10), 0 2px 4px rgba(0,0,0,.06);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { font-family: var(--sans); background: var(--bg); color: var(--text); font-size: 13px; }

/* ─── LAYOUT ─── */
.app      { display: flex; min-height: 100vh; }
.sidebar  { width: 230px; background: var(--navy); display: flex; flex-direction: column; flex-shrink: 0; overflow-y: auto; position: sticky; top: 0; height: 100vh; }
.main     { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
.topbar   { background: var(--surface); border-bottom: 1px solid var(--border); padding: 0 24px; height: 52px; display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; position: sticky; top: 0; z-index: 100; }
.content  { flex: 1; padding: 20px 24px; overflow-y: auto; }

/* ─── SIDEBAR ─── */
.sb-header { padding: 18px 16px 14px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sb-logo   { display: flex; align-items: center; gap: 9px; }
.sb-logo-icon { width: 30px; height: 30px; background: var(--accent); border-radius: 7px; display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 700; color: #fff; flex-shrink: 0; }
.sb-logo-text { font-size: 15px; font-weight: 700; color: #fff; }
.sb-logo-sub  { font-size: 10px; color: rgba(255,255,255,.4); font-weight: 400; }

.co-picker { margin: 10px 12px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); border-radius: var(--r); padding: 9px 11px; position: relative; cursor: pointer; }
.co-picker:hover { background: rgba(255,255,255,.09); }
.co-name { font-size: 12px; font-weight: 600; color: #fff; display: flex; justify-content: space-between; align-items: center; }
.co-gstin { font-size: 10px; color: rgba(255,255,255,.4); font-family: var(--mono); margin-top: 1px; }
.co-menu { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: #243055; border: 1px solid rgba(255,255,255,.12); border-radius: var(--r); z-index: 200; box-shadow: var(--shadow-md); display: none; max-height: 260px; overflow-y: auto; }
.co-menu.open { display: block; }
.co-opt { padding: 9px 12px; font-size: 12px; color: rgba(255,255,255,.8); cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.co-opt:hover { background: rgba(255,255,255,.06); }
.co-opt.sel { color: #60a5fa; font-weight: 600; }

.client-list { margin-top: 8px; display: grid; gap: 3px; }
.client-list form { margin: 0; }
.client-switch { width: 100%; border: 0; background: transparent; color: rgba(255,255,255,.65); text-align: left; padding: 6px 8px; border-radius: 5px; cursor: pointer; font-size: 11px; font-family: var(--sans); }
.client-switch:hover { background: rgba(255,255,255,.07); color: #fff; }
.client-switch.active { background: rgba(37,99,235,.3); color: #fff; font-weight: 600; }
.co-add { padding: 7px 8px; font-size: 11px; color: #60a5fa; cursor: pointer; margin-top: 4px; display: block; }
.co-add:hover { text-decoration: underline; }

.nav-sec  { padding: 14px 14px 4px; font-size: 9px; font-weight: 700; color: rgba(255,255,255,.3); text-transform: uppercase; letter-spacing: .1em; }
.nav-item { display: flex; align-items: center; gap: 9px; padding: 8px 14px; font-size: 12px; color: rgba(255,255,255,.55); text-decoration: none; border-left: 2px solid transparent; transition: .12s; }
.nav-item:hover { background: rgba(255,255,255,.05); color: rgba(255,255,255,.85); }
.nav-item.active { color: #fff; background: rgba(37,99,235,.25); border-left-color: var(--accent); font-weight: 600; }
.nav-icon { width: 16px; text-align: center; flex-shrink: 0; }
.nav-badge { margin-left: auto; background: var(--red); color: #fff; font-size: 9px; font-weight: 700; padding: 1px 5px; border-radius: 99px; }

.sb-footer { margin-top: auto; padding: 12px 14px; border-top: 1px solid rgba(255,255,255,.08); }
.user-row  { display: flex; align-items: center; gap: 9px; }
.user-av   { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: #fff; flex-shrink: 0; }
.user-name { font-size: 12px; color: rgba(255,255,255,.8); font-weight: 500; }
.user-role { font-size: 10px; color: rgba(255,255,255,.35); }

/* ─── TOPBAR ─── */
.page-title { font-size: 15px; font-weight: 700; color: var(--text); }
.tb-right   { display: flex; align-items: center; gap: 8px; }
.fy-tag     { background: var(--accent-l); color: var(--accent-d); font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 99px; }

/* ─── BUTTONS ─── */
.btn { font-family: var(--sans); font-size: 12px; font-weight: 500; padding: 7px 14px; border-radius: var(--r-sm); border: 1px solid var(--border2); background: var(--surface); color: var(--text2); cursor: pointer; transition: .12s; white-space: nowrap; text-decoration: none; display: inline-flex; align-items: center; gap: 5px; }
.btn:hover { background: var(--surface2); border-color: var(--border2); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-d); }
.btn-success { background: var(--green); border-color: var(--green); color: #fff; }
.btn-success:hover { background: #047857; }
.btn-danger  { background: var(--red-l); border-color: var(--red); color: var(--red); }
.btn-sm { padding: 4px 10px; font-size: 11px; }
.btn-xs { padding: 3px 8px; font-size: 10px; }

/* ─── STAT CARDS ─── */
.stats-grid { display: grid; gap: 14px; margin-bottom: 20px; }
.g4 { grid-template-columns: repeat(4, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g2 { grid-template-columns: repeat(2, 1fr); }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 16px 18px; box-shadow: var(--shadow); }
.sc-label  { font-size: 10px; font-weight: 600; color: var(--text3); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 8px; }
.sc-val    { font-size: 22px; font-weight: 700; font-family: var(--mono); }
.sc-sub    { font-size: 11px; color: var(--text3); margin-top: 4px; }
.up { color: var(--green); } .dn { color: var(--red); }

/* ─── TABLE CARDS ─── */
.tcard { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow); margin-bottom: 16px; }
.tcard-head { padding: 12px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; background: var(--surface2); }
.tcard-title { font-size: 12px; font-weight: 700; color: var(--text); }
.tcard-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th { background: var(--surface2); padding: 8px 14px; text-align: left; font-size: 10px; font-weight: 700; color: var(--text3); text-transform: uppercase; letter-spacing: .06em; border-bottom: 1px solid var(--border); white-space: nowrap; }
tbody td { padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 12px; color: var(--text2); }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #f9fafb; }
tfoot td { padding: 10px 14px; font-size: 12px; font-weight: 700; background: var(--surface2); border-top: 2px solid var(--border); }
.mono { font-family: var(--mono); }
.cr { color: var(--green); font-family: var(--mono); }
.dr { color: var(--red); font-family: var(--mono); }
.right { text-align: right; }

/* ─── BADGE ─── */
.badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 99px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.bg-green  { background: var(--green-l); color: var(--green); }
.bg-red    { background: var(--red-l);   color: var(--red); }
.bg-amber  { background: var(--amber-l); color: var(--amber); }
.bg-blue   { background: var(--accent-l); color: var(--accent-d); }
.bg-purple { background: var(--purple-l); color: var(--purple); }
.bg-navy   { background: #e0e7ff; color: var(--navy); }

/* ─── FORM ─── */
.fcard { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 20px; box-shadow: var(--shadow); margin-bottom: 16px; }
.fcard-title { font-size: 13px; font-weight: 700; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 8px; }
.frow { display: grid; gap: 14px; margin-bottom: 14px; }
.fc2 { grid-template-columns: 1fr 1fr; }
.fc3 { grid-template-columns: 1fr 1fr 1fr; }
.fc4 { grid-template-columns: 1fr 1fr 1fr 1fr; }
.field label { font-size: 10px; font-weight: 700; color: var(--text3); text-transform: uppercase; letter-spacing: .05em; display: block; margin-bottom: 5px; }
.field input,
.field select,
.field textarea { width: 100%; background: var(--surface2); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 8px 11px; font-size: 12px; color: var(--text); font-family: var(--sans); outline: none; transition: border-color .12s; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.field textarea { resize: vertical; min-height: 64px; }
.factions { display: flex; gap: 10px; margin-top: 4px; flex-wrap: wrap; }

/* ─── INVOICE BUILDER ─── */
.inv-table { width: 100%; border-collapse: collapse; margin-bottom: 12px; }
.inv-table th { background: var(--surface2); padding: 7px 8px; font-size: 10px; color: var(--text3); font-weight: 700; text-align: left; border-bottom: 1px solid var(--border); }
.inv-table td { padding: 5px 6px; border-bottom: 1px solid var(--border); }
.inv-table td input, .inv-table td select { background: var(--surface2); border: 1px solid transparent; border-radius: 4px; padding: 5px 7px; font-size: 12px; width: 100%; color: var(--text); font-family: var(--sans); outline: none; }
.inv-table td input:focus, .inv-table td select:focus { border-color: var(--accent); background: #fff; }
.del-btn { background: none; border: none; color: var(--red); cursor: pointer; font-size: 16px; padding: 0 4px; font-weight: 700; }

/* ─── TOTALS BOX ─── */
.tot-box { background: var(--navy); color: #fff; border-radius: var(--r-lg); padding: 16px 20px; min-width: 300px; }
.tot-row { display: flex; justify-content: space-between; padding: 4px 0; font-size: 12px; color: rgba(255,255,255,.65); }
.tot-row .mono { color: rgba(255,255,255,.9); }
.tot-sep { border-top: 1px solid rgba(255,255,255,.15); margin: 8px 0; }
.tot-grand { font-size: 15px; font-weight: 700; color: #fff; display: flex; justify-content: space-between; padding: 4px 0; }
.tot-grand .mono { color: #86efac; }

/* ─── LEDGER ─── */
.ledger-section { margin-bottom: 20px; }
.led-acct-hd { background: var(--navy); color: #fff; border-radius: var(--r-lg) var(--r-lg) 0 0; padding: 11px 16px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.led-acct-name { font-size: 13px; font-weight: 700; }
.led-acct-stats { display: flex; gap: 18px; flex-wrap: wrap; }
.led-stat { font-size: 11px; color: rgba(255,255,255,.55); }
.led-stat strong { color: #fff; }
.ledger-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow); }
.ledger-section .ledger-wrap { border-radius: 0 0 var(--r-lg) var(--r-lg); border-top: none; }
.ledger-grid { display: grid; grid-template-columns: 110px 120px 1fr 90px 130px 130px 130px; }
.lg-head .lg-cell { background: rgba(15,23,42,.06); color: var(--text3); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 9px 12px; border-right: 1px solid var(--border); }
.lg-row { display: contents; }
.lg-row:hover .lg-cell { background: #f9fafb; }
.lg-cell { padding: 9px 12px; font-size: 12px; color: var(--text2); border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); }
.lg-cell:last-child { border-right: none; }
.bal-pos { font-family: var(--mono); font-weight: 600; color: var(--green); }
.bal-neg { font-family: var(--mono); font-weight: 600; color: var(--red); }

/* ─── GST ─── */
.gst-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 16px; box-shadow: var(--shadow); }
.gst-period { font-size: 13px; font-weight: 700; margin-bottom: 2px; }
.gst-due { font-size: 11px; }
.prog-track { height: 5px; background: var(--border); border-radius: 99px; margin: 10px 0 5px; overflow: hidden; }
.prog-fill { height: 100%; border-radius: 99px; transition: width .4s; }

/* ─── PAYROLL SLIP ─── */
.payslip-wrap { background: var(--surface); border: 2px solid var(--navy); border-radius: var(--r-lg); overflow: hidden; max-width: 680px; margin: 0 auto; }
.ps-header { background: var(--navy); color: #fff; padding: 20px 24px; display: flex; justify-content: space-between; align-items: center; }
.ps-company { font-size: 16px; font-weight: 700; }
.ps-sub { font-size: 11px; color: rgba(255,255,255,.5); margin-top: 2px; }
.ps-period { text-align: right; }
.ps-period-lbl { font-size: 10px; color: rgba(255,255,255,.5); }
.ps-period-val { font-size: 14px; font-weight: 700; }
.ps-emp { padding: 14px 24px; background: #f8faff; border-bottom: 1px solid var(--border); display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.ps-emp-field label { font-size: 10px; font-weight: 700; color: var(--text3); text-transform: uppercase; }
.ps-emp-field value { display: block; font-size: 13px; font-weight: 600; color: var(--text); margin-top: 2px; }
.ps-body { display: grid; grid-template-columns: 1fr 1fr; }
.ps-col { padding: 16px 24px; }
.ps-col:first-child { border-right: 1px solid var(--border); }
.ps-col-title { font-size: 11px; font-weight: 700; color: var(--text3); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.ps-line { display: flex; justify-content: space-between; padding: 5px 0; font-size: 12px; border-bottom: 1px solid #f3f4f6; }
.ps-line:last-child { border-bottom: none; }
.ps-line span:last-child { font-family: var(--mono); font-weight: 500; }
.ps-footer { background: var(--navy); padding: 14px 24px; display: flex; justify-content: space-between; align-items: center; }
.ps-net-lbl { font-size: 12px; color: rgba(255,255,255,.6); font-weight: 500; }
.ps-net-val { font-size: 20px; font-weight: 700; color: #86efac; font-family: var(--mono); }
.ps-inwords { font-size: 11px; color: rgba(255,255,255,.45); margin-top: 2px; }

/* ─── BANK RECON ─── */
.bank-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 16px 20px; box-shadow: var(--shadow); margin-bottom: 12px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.bank-icon { width: 42px; height: 42px; border-radius: 10px; background: var(--navy); display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.bank-info { flex: 1; }
.bank-name { font-size: 14px; font-weight: 700; }
.bank-acc  { font-size: 11px; color: var(--text3); font-family: var(--mono); }
.bank-diff { padding: 0 12px; text-align: right; }
.bank-diff-lbl { font-size: 10px; color: var(--text3); text-transform: uppercase; }
.bank-diff-val { font-size: 15px; font-weight: 700; font-family: var(--mono); }

/* ─── MODAL ─── */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: none; align-items: center; justify-content: center; z-index: 300; backdrop-filter: blur(2px); }
.overlay.open { display: flex; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 24px; width: 520px; max-width: 95vw; max-height: 88vh; overflow-y: auto; box-shadow: var(--shadow-md); }
.modal-title { font-size: 15px; font-weight: 700; margin-bottom: 18px; display: flex; justify-content: space-between; align-items: center; }
.close-btn { background: none; border: none; font-size: 20px; color: var(--text3); cursor: pointer; padding: 0; }
.close-btn:hover { color: var(--text); }

/* ─── PDF PREVIEW ─── */
.pdf-invoice { background: #fff; max-width: 700px; margin: 0 auto; border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-md); font-family: var(--sans); }
.pdf-header { background: var(--navy); color: #fff; padding: 24px 28px; display: flex; justify-content: space-between; }
.pdf-company { font-size: 18px; font-weight: 700; }
.pdf-company-info { font-size: 11px; color: rgba(255,255,255,.5); line-height: 1.7; margin-top: 4px; }
.pdf-inv-title { text-align: right; }
.pdf-inv-no { font-size: 22px; font-weight: 700; }
.pdf-inv-lbl { font-size: 11px; color: rgba(255,255,255,.5); }
.pdf-inv-date { font-size: 12px; margin-top: 6px; color: rgba(255,255,255,.7); }
.pdf-parties { display: grid; grid-template-columns: 1fr 1fr; }
.pdf-party { padding: 16px 28px; }
.pdf-party:first-child { border-right: 1px solid var(--border); }
.pdf-party-lbl { font-size: 10px; font-weight: 700; color: var(--text3); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
.pdf-party-name { font-size: 14px; font-weight: 700; }
.pdf-party-info { font-size: 11px; color: var(--text3); line-height: 1.7; margin-top: 2px; }
.pdf-items table { margin: 0; }
.pdf-items thead th { background: #f1f5f9; padding: 9px 14px; font-size: 10px; }
.pdf-items tbody td { padding: 10px 14px; font-size: 12px; }
.pdf-totals { padding: 16px 28px; display: flex; justify-content: flex-end; }
.pdf-tot-inner { width: 280px; }
.pdf-tot-row { display: flex; justify-content: space-between; padding: 5px 0; font-size: 12px; border-bottom: 1px solid var(--border); }
.pdf-tot-row:last-child { border-bottom: none; }
.pdf-tot-grand { background: var(--navy); color: #fff; padding: 10px 14px; border-radius: var(--r-sm); display: flex; justify-content: space-between; margin-top: 6px; font-weight: 700; }
.pdf-footer { background: var(--surface2); padding: 12px 28px; font-size: 11px; color: var(--text3); border-top: 1px solid var(--border); display: flex; justify-content: space-between; }

/* ─── CHART ─── */
.chart-bars { display: flex; align-items: flex-end; gap: 6px; height: 100px; padding: 0 4px; }
.chart-bar-g { flex: 1; display: flex; align-items: flex-end; gap: 2px; height: 100%; }
.chart-bar { flex: 1; border-radius: 3px 3px 0 0; min-height: 3px; transition: height .4s; }
.chart-xlbl { display: flex; gap: 6px; padding: 4px 4px 0; }
.chart-xlbl span { flex: 1; text-align: center; font-size: 10px; color: var(--text3); }
.chart-legend { display: flex; gap: 14px; padding: 6px 4px 10px; }
.chart-legend span { font-size: 11px; color: var(--text3); display: flex; align-items: center; gap: 5px; }
.chart-legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }

/* ─── DOUBLE ENTRY ─── */
.de-check { padding: 10px 14px; background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: var(--r); font-size: 12px; color: var(--green); font-weight: 600; display: flex; align-items: center; gap: 8px; }
.de-check.error { background: #fef2f2; border-color: #fecaca; color: var(--red); }

/* ─── TWO-COL LAYOUT ─── */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.three-col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }

/* ─── SEARCH + FILTER BAR ─── */
.filter-bar { display: flex; gap: 8px; margin-bottom: 14px; align-items: center; flex-wrap: wrap; }
.search-in { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 7px 12px; font-size: 12px; color: var(--text); font-family: var(--sans); outline: none; min-width: 200px; }
.search-in:focus { border-color: var(--accent); }
.filter-bar select { font-family: var(--sans); font-size: 12px; padding: 7px 10px; border: 1px solid var(--border2); border-radius: var(--r-sm); background: var(--surface); color: var(--text2); outline: none; }

/* ─── REPORT BLOCK ─── */
.rep-block { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow); }
.rep-head { background: var(--navy); color: rgba(255,255,255,.7); padding: 9px 16px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.rep-section { background: var(--surface2); padding: 6px 16px; font-size: 10px; font-weight: 700; color: var(--text3); text-transform: uppercase; letter-spacing: .06em; border-bottom: 1px solid var(--border); }
.rep-row { display: flex; justify-content: space-between; padding: 9px 16px; border-bottom: 1px solid var(--border); font-size: 12px; color: var(--text2); }
.rep-row:last-child { border-bottom: none; }
.rep-row.subtot { font-weight: 700; color: var(--text); background: var(--surface2); }
.rep-row.grand  { font-size: 14px; font-weight: 700; background: var(--navy); color: #fff; }
.rep-row.grand .mono { color: #86efac; }
.rep-amnt { font-family: var(--mono); }

/* ─── ALERT / TOAST ─── */
.alert { padding: 11px 16px; border-radius: var(--r); margin-bottom: 14px; font-size: 12px; font-weight: 500; }
.alert-success { background: var(--green-l); color: var(--green); border: 1px solid #6ee7b7; }
.alert-error   { background: var(--red-l); color: var(--red); border: 1px solid #fca5a5; }
.alert-info    { background: var(--accent-l); color: var(--accent-d); border: 1px solid #93c5fd; }

.toast { position: fixed; bottom: 20px; right: 20px; padding: 11px 16px; border-radius: var(--r); font-size: 12px; font-weight: 500; z-index: 9999; transform: translateY(60px); opacity: 0; transition: all .25s; max-width: 300px; box-shadow: var(--shadow-md); }
.toast.show { transform: none; opacity: 1; }
.toast-success { background: var(--green); color: #fff; }
.toast-error   { background: var(--red); color: #fff; }
.toast-info    { background: var(--navy); color: #fff; }

/* ─── LOGIN ─── */
.login-wrap { min-height: 100vh; background: var(--navy); display: flex; align-items: center; justify-content: center; }
.login-box { background: #fff; border-radius: 16px; padding: 36px 40px; width: 400px; max-width: 95vw; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.login-logo { text-align: center; margin-bottom: 24px; }
.login-logo-icon { width: 52px; height: 52px; background: var(--accent); border-radius: 13px; display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 700; color: #fff; margin: 0 auto 10px; }
.login-logo h1 { font-size: 20px; font-weight: 700; }
.login-logo p { font-size: 12px; color: var(--text3); }
.login-tabs { display: flex; background: var(--surface2); border-radius: var(--r-sm); padding: 3px; margin-bottom: 20px; border: 1px solid var(--border); }
.ltab { flex: 1; text-align: center; padding: 7px; font-size: 12px; font-weight: 600; border-radius: 4px; text-decoration: none; color: var(--text3); }
.ltab.active { background: #fff; color: var(--accent); box-shadow: var(--shadow); }
.login-users { margin-bottom: 16px; }
.login-user-card { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r); margin-bottom: 8px; cursor: pointer; transition: .12s; width: 100%; background: #fff; text-align: left; }
.login-user-card:hover { border-color: var(--accent); background: var(--accent-l); }
.login-user-card.selected { border-color: var(--accent); background: var(--accent-l); }
.luc-av { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: #fff; flex-shrink: 0; }
.luc-name { font-size: 13px; font-weight: 600; color: var(--text); }
.luc-role { font-size: 11px; color: var(--text3); }
.tick { margin-left: auto; color: var(--accent); font-size: 16px; opacity: 0; }
.login-user-card.selected .tick { opacity: 1; }
.login-pw { margin-bottom: 16px; }
.login-pw label { font-size: 11px; font-weight: 700; color: var(--text3); display: block; margin-bottom: 5px; text-transform: uppercase; }
.login-pw input { width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--r-sm); font-size: 13px; outline: none; font-family: var(--sans); }
.login-pw input:focus { border-color: var(--accent); }
.login-btn { width: 100%; padding: 11px; background: var(--accent); color: #fff; border: none; border-radius: var(--r); font-size: 14px; font-weight: 700; cursor: pointer; font-family: var(--sans); }
.login-btn:hover { background: var(--accent-d); }
.login-hint { text-align: center; font-size: 11px; color: var(--text3); margin-top: 12px; }
.remember { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text3); margin-bottom: 14px; cursor: pointer; }
.links { display: flex; justify-content: space-between; margin-top: 12px; }
.links a { font-size: 11px; color: var(--accent); text-decoration: none; }
.links a:hover { text-decoration: underline; }
.field { margin-bottom: 14px; }
.field label { font-size: 11px; font-weight: 700; color: var(--text3); text-transform: uppercase; display: block; margin-bottom: 5px; }
.field input, .field select { width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--r-sm); font-size: 13px; outline: none; font-family: var(--sans); background: #fff; }
.field input:focus, .field select:focus { border-color: var(--accent); }

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 99px; }

/* ─── RESPONSIVE ─── */
.sb-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 199; }
.sb-backdrop.open { display: block; }
.hamburger-btn { display: none; align-items: center; justify-content: center; background: none; border: none; cursor: pointer; padding: 6px; color: var(--text); border-radius: var(--r-sm); margin-right: 8px; }
.hamburger-btn:hover { background: var(--surface2); }
.hamburger-btn svg { width: 20px; height: 20px; }

@media (max-width: 900px) {
  .hamburger-btn { display: flex; }
  .sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 200;
    transform: translateX(-100%);
    transition: transform .25s ease;
    width: 240px;
    height: 100vh;
    height: 100dvh;
  }
  .sidebar.open { transform: translateX(0); }
  .main { width: 100%; }
  .topbar { padding: 0 14px; }
  .g4, .g3 { grid-template-columns: 1fr 1fr; }
  .two-col, .three-col { grid-template-columns: 1fr; }
  .fc2, .fc3, .fc4 { grid-template-columns: 1fr; }
  .content { padding: 14px; }
  .tcard-wrap { -webkit-overflow-scrolling: touch; }
  .filter-bar { flex-wrap: wrap; }
  .filter-bar .search-in { min-width: 100%; }
  .tot-box { min-width: 100%; }
  .factions { flex-wrap: wrap; }
  .btn { font-size: 11px; }
}
@media (max-width: 600px) {
  .g4, .g3, .g2 { grid-template-columns: 1fr; }
  .tb-right .fy-tag { display: none; }
  .page-title { font-size: 13px; }
  .content { padding: 10px; }
  .fcard { padding: 14px; }
  .stat-card { padding: 12px 14px; }
  .sc-val { font-size: 18px; }
}
