/* =====================================================================
   GST RECOVERY REDESIGN — base layout & component library
   ===================================================================== */

* { margin: 0; padding: 0; box-sizing: border-box; }

/* Bakes in the "80% browser zoom" density as the default — the whole
   page (fonts, padding, layout) scales down uniformly, same as the
   officer manually zooming out, so 100% zoom already looks like what
   used to need 80%. All sizing in this app is px-based (no rem/em), so
   zoom is the one CSS property that scales everything together without
   re-tuning every size by hand. */
html { zoom: 0.8; }
html, body { height: 100%; }
button, input, select, textarea { font-family: inherit; }

body {
  background: var(--page-background);
  color: var(--navy-text);
  font-family: var(--font-ui);
  font-variant-numeric: tabular-nums;
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: var(--radius-sm); }
::-webkit-scrollbar-thumb:hover { background: var(--ink3); }

/* ===== LAYOUT — dark sidebar (full height) + light header/content column =====
   height:100% (not 100vh) deliberately — vh is tied to the raw physical
   viewport and doesn't scale with the page's zoom:0.8 above, which left a
   gap of unstyled background below the sidebar/content. % chains through
   html/body's own height:100% instead, which scales correctly with zoom. */
.layout { display: flex; height: 100%; overflow: hidden; } /* never let the document scroll sideways (it drags the sidebar off-screen) */
.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; height: 100%; }
.main { flex: 1; overflow-y: auto; }

/* ===== SIDEBAR ===== */
.sidebar {
  width: 224px; min-width: 224px; height: 100%; background: var(--sidebar-navy);
  padding: 0 0 10px; display: flex; flex-direction: column; overflow-y: auto;
}
.sidebar-brand { display: flex; align-items: center; gap: 11px; padding: 18px 20px 16px; border-bottom: 1px solid rgba(255,255,255,0.08); margin-bottom: 6px; }
.sidebar-brand .logo-icon {
  width: 32px; height: 32px; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.18);
  border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 16.5px; flex-shrink: 0;
}
.sidebar-brand .logo-name { color: #fff; font-size: 15px; font-weight: 700; letter-spacing: 0.1px; }
.sidebar-brand .logo-sub { font-size: 10.5px; color: rgba(255,255,255,0.45); margin-top: 1px; font-weight: 400; line-height: 1.3; }

.sb-section { padding: 16px 20px 6px; font-size: 11px; font-weight: 700; color: rgba(255,255,255,0.32); letter-spacing: 1px; text-transform: uppercase; font-family: var(--font-ui); }
.sb-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 13px; cursor: pointer; font-size: 14px;
  color: var(--nav-inactive-text); border-radius: var(--radius-md); transition: background 0.12s, color 0.12s;
  font-weight: 500; margin: 2px 10px;
}
.sb-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.sb-item.active { background: var(--nav-active-blue); color: #fff; font-weight: 600; box-shadow: 0 1px 4px rgba(0,82,255,0.45); }
.sb-icon { font-size: 14px; width: 16px; text-align: center; opacity: 0.85; }
.sb-item.active .sb-icon { opacity: 1; }
.sb-badge { margin-left: auto; background: rgba(255,255,255,0.16); color: #fff; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 9px; font-family: var(--font-ui); }
.sb-item.active .sb-badge { background: rgba(255,255,255,0.28); }
.sb-badge.orange { background: var(--warning); }
.sb-spacer { flex: 1; }
.sb-footer-item { color: rgba(255,255,255,0.4); }
.sb-footer-item:hover { color: #fff; }

/* ===== HEADER (light) ===== */
header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 var(--sp-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 58px;
  flex-shrink: 0;
  gap: 12px;
  min-width: 0;
}
.header-actions { display: flex; gap: 6px; align-items: center; min-width: 0; }

.office-chip {
  display: flex; align-items: center; gap: 7px; background: var(--surface-2);
  border: 1px solid var(--border); color: var(--navy-text); padding: 7px 12px;
  border-radius: 999px; font-size: 12.5px; font-weight: 600; cursor: pointer; transition: background 0.12s, border-color 0.12s;
  min-width: 0; max-width: 280px;
}
.office-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.office-chip:hover { background: var(--surface-3); border-color: var(--border-strong); }
.office-chip i:first-child { font-size: 11.5px; color: var(--primary-blue); }

.hbtn-icon {
  position: relative; flex-shrink: 0;
  width: 32px; height: 32px; border-radius: var(--radius-md); border: 1px solid var(--border);
  background: var(--surface); color: var(--muted-text); cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 13.5px; transition: background 0.12s, border-color 0.12s;
}
.hbtn-icon:hover { background: var(--surface-2); border-color: var(--border-strong); color: var(--navy-text); }
.hbtn-badge {
  position: absolute; top: -4px; right: -4px; background: var(--danger); color: #fff; font-family: var(--font-ui);
  font-size: 10px; font-weight: 700; min-width: 15px; height: 15px; border-radius: 8px; display: flex;
  align-items: center; justify-content: center; padding: 0 3px; border: 1.5px solid var(--surface);
}

.hdr-divider { width: 1px; height: 22px; background: var(--border); margin: 0 2px; }

.hdr-avatar { flex-shrink: 0; display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 3px 8px 3px 3px; border-radius: var(--radius-md); transition: background 0.12s; }
.hdr-avatar:hover { background: var(--surface-2); }
.hdr-avatar-circle {
  width: 30px; height: 30px; border-radius: 50%; background: var(--primary-blue);
  color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0;
  font-family: var(--font-ui); letter-spacing: 0.2px;
}
.hdr-avatar-text { line-height: 1.25; }
.hdr-avatar-name { font-size: 11.5px; font-weight: 700; color: var(--navy-text); max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hdr-avatar-role { font-size: 10px; color: var(--muted-text); max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hdr-avatar i.fa-chevron-down { color: var(--muted-text); }

#global-search {
  background: var(--surface-2); border: 1px solid var(--border); color: var(--navy-text);
  padding: 7px 14px 7px 33px; border-radius: 999px; font-size: 13px; width: 240px; outline: none;
  font-family: var(--font-ui); transition: all 0.15s;
}
#global-search:focus { background: var(--surface); border-color: var(--primary-blue); width: 300px; }
#global-search::placeholder { color: var(--ink3); }
#global-search-wrap { position: relative; }
#global-search-wrap i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--ink3); font-size: 12.5px; }
.gs-results {
  position: absolute; top: calc(100% + 6px); left: 0; width: 100%; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); z-index: 300;
  max-height: 320px; overflow-y: auto; display: none;
}
.gs-results.show { display: block; }
.gs-item { padding: 9px 13px; cursor: pointer; border-bottom: 1px solid var(--border); transition: background 0.1s; color: var(--navy-text); font-size: 13.5px; }
.gs-item:hover { background: var(--surface-2); }
.gs-item:last-child { border-bottom: none; }

/* ===== MAIN / PAGE ===== */
.page { display: none; width: 100%; padding: 24px 32px 40px; }
.page.active { display: block; animation: pagein 0.12s ease; }
@keyframes pagein { from { opacity: 0; } to { opacity: 1; } }

.ph { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: var(--sp-5); flex-wrap: wrap; gap: var(--sp-3); }
.ph-title { font-size: 25px; font-weight: 700; color: var(--navy-text); line-height: 1.25; letter-spacing: -0.3px; }
.ph-title i { color: var(--primary-blue); margin-right: 8px; font-size: 20px; }
.ph-sub { font-size: 13px; color: var(--muted-text); margin-top: 4px; font-family: var(--font-ui); }
.ph-actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; align-items: center; }

/* ===== BUTTONS ===== */
.btn {
  padding: 9px 16px; border-radius: var(--radius-md); border: 1px solid transparent; cursor: pointer;
  font-family: var(--font-ui); font-size: 13.5px; font-weight: 600; transition: background 0.12s, border-color 0.12s, color 0.12s, box-shadow 0.12s, transform 0.12s;
  display: inline-flex; align-items: center; gap: 7px; line-height: 1.2; height: 38px;
}
.btn-red { background: var(--primary-blue); color: #fff; box-shadow: var(--shadow-sm); }
.btn-red:hover { background: var(--primary-blue-dark); box-shadow: 0 4px 10px rgba(0,82,255,0.28); transform: translateY(-1px); }
.btn-red:active { transform: translateY(0); box-shadow: var(--shadow-sm); }
.btn-ink { background: var(--surface-3); color: var(--navy-text); border-color: var(--border-strong); }
.btn-ink:hover { background: var(--border-strong); }
.btn-outline { background: var(--surface); color: var(--navy-text); border-color: var(--border-strong); }
.btn-outline:hover { border-color: var(--primary-blue); color: var(--primary-blue); background: var(--primary-blue-dim); }
.btn-green { background: var(--surface); color: var(--success); border-color: var(--success-border); }
.btn-green:hover { background: var(--success-dim); }
.btn-orange { background: var(--warning); color: #fff; box-shadow: var(--shadow-sm); }
.btn-orange:hover { background: #93450a; }
.btn-blue { background: var(--primary-blue); color: #fff; box-shadow: var(--shadow-sm); }
.btn-blue:hover { background: var(--primary-blue-dark); box-shadow: 0 4px 10px rgba(0,82,255,0.28); transform: translateY(-1px); }
.btn-blue:active { transform: translateY(0); box-shadow: var(--shadow-sm); }
.btn-sm { padding: 6px 12px; font-size: 12.5px; border-radius: var(--radius-sm); height: 32px; }
.btn-xs { padding: 3px 9px; font-size: 11.5px; border-radius: var(--radius-sm); gap: 5px; height: 25px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===== STAT CARDS (also used by Dashboard KPI grid) ===== */
.stats { display: grid; grid-template-columns: repeat(5,1fr); gap: var(--sp-3); margin-bottom: var(--sp-5); }
.scard { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px 20px; position: relative; overflow: hidden; transition: border-color 0.15s, box-shadow 0.15s; box-shadow: var(--shadow-sm); }
.scard::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; }
.scard.red::before { background: var(--danger); }
.scard.orange::before { background: var(--warning); }
.scard.green::before { background: var(--success); }
.scard.blue::before { background: var(--primary-blue); }
.scard.gold::before { background: var(--gold); }
.scard.purple::before { background: var(--purple); }
.scard:hover { box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.slabel { font-size: 11px; font-weight: 700; color: var(--ink3); letter-spacing: 0.4px; text-transform: uppercase; margin-bottom: 7px; font-family: var(--font-ui); }
.sval { font-family: var(--font-mono); font-size: 19.5px; font-weight: 600; line-height: 1; letter-spacing: -0.2px; }
.sval.red { color: var(--danger); } .sval.orange { color: var(--warning); }
.sval.green { color: var(--success); } .sval.blue { color: var(--primary-blue); } .sval.gold { color: var(--gold); } .sval.purple { color: var(--purple); }
.ssub { font-size: 11.5px; color: var(--ink3); margin-top: 5px; font-family: var(--font-ui); }

/* ===== UPLOAD ZONE ===== */
.upload-zone { border: 1.5px dashed var(--border-strong); border-radius: var(--radius-lg); background: var(--surface); padding: 32px 28px; text-align: center; cursor: pointer; transition: all 0.15s; margin-bottom: var(--sp-4); }
.upload-zone:hover { border-color: var(--primary-blue); background: var(--primary-blue-dim); }
.upload-zone.dragover { border-color: var(--primary-blue); background: var(--primary-blue-dim); }
.upload-icon { font-size: 28px; margin-bottom: 10px; color: var(--primary-blue); }
.upload-title { font-size: 15px; font-weight: 700; color: var(--navy-text); margin-bottom: 4px; }
.upload-sub { font-size: 12.5px; color: var(--ink3); font-family: var(--font-ui); }
#dcr-file-input { display: none; }

/* ===== TABLE ===== */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); }
.table-scroll { overflow-x: auto; }
.table-toolbar { padding: 10px 16px; border-bottom: 1px solid var(--border); display: flex; gap: var(--sp-2); align-items: center; background: var(--surface-2); flex-wrap: wrap; }
.search-wrap { flex: 1; min-width: 180px; display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0 11px; transition: border-color 0.15s; }
.search-wrap:focus-within { border-color: var(--primary-blue); }
.search-wrap input { border: none; outline: none; padding: 7px 0; font-family: var(--font-ui); font-size: 13.5px; flex: 1; color: var(--navy-text); background: transparent; }
.search-wrap input::placeholder { color: var(--ink3); }
select.fsel, input.fsel { background: var(--surface); border: 1px solid var(--border); color: var(--muted-text); padding: 7px 10px; border-radius: var(--radius-sm); font-family: var(--font-ui); font-size: 13px; cursor: pointer; outline: none; }
select.fsel:focus, input.fsel:focus { border-color: var(--primary-blue); }

/* App-wide compact grid table: Title Case headers, 13px rows, column dividers */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead { background: #F8FAFC; position: sticky; top: 0; z-index: 10; }
th { padding: 9px 12px; text-align: left; font-size: 12.5px; font-weight: 600; color: #334155; letter-spacing: 0; text-transform: none; background: #F8FAFC; border-bottom: 1px solid var(--border); white-space: nowrap; font-family: var(--font-ui); }
td { padding: 7px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; color: #1E293B; }
th + th, td + td { border-left: 1px solid var(--border); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--surface-2); }
tbody tr:has(input[type="checkbox"]:checked) td { background: #EAF2FE; }
td input[type="checkbox"], th input[type="checkbox"] { width: 15px; height: 15px; vertical-align: middle; cursor: pointer; }

/* Right-align any cell holding a monetary value, in every table, without
   touching the JS/HTML that renders the rows. */
td:has(.amount-cell) { text-align: right; }

th.sortable { cursor: pointer; user-select: none; position: relative; padding-right: 22px !important; }
th.sortable::after { content: '↕'; position: absolute; right: 6px; top: 50%; transform: translateY(-50%); opacity: 0.3; font-size: 11px; }
th.sortable.sort-asc::after { content: '↑'; opacity: 0.8; color: var(--primary-blue); }
th.sortable.sort-desc::after { content: '↓'; opacity: 0.8; color: var(--primary-blue); }

.gstin-cell { font-family: var(--font-mono); font-size: 13px; color: var(--primary-blue); font-weight: 500; }
.amount-cell { font-family: var(--font-mono); font-weight: 400; color: var(--navy-text); font-size: 14px; }
.amount-cell.pending { color: var(--danger); font-weight: 500; font-size: 15px; }
.amount-cell.clickable { cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.amount-cell.clickable:hover { color: var(--primary-blue-dark); text-decoration-color: var(--primary-blue-dark); }
.demand-id { font-family: var(--font-mono); font-size: 13px; color: #1E293B; font-weight: 400; }
td .gstin-cell, td.gstin-cell { font-size: 13px; }
td .amount-cell, td .amount-cell.pending { font-size: 13px; font-weight: 600; color: #0F172A; }
td .amount-cell.clickable { text-decoration: none; }
td .amount-cell.clickable:hover { color: var(--primary-blue); text-decoration: underline; }
td .pill { border-radius: 5px; font-size: 12px; font-weight: 500; padding: 2px 9px; }

/* A count that opens something on click (e.g. "8" demands in a notice row) —
   compact, unmistakably a link, same treatment wherever it's used. */
.count-link {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--primary-blue); font-weight: 700; font-family: var(--font-mono);
  text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 2px;
  cursor: pointer; padding: 2px 7px; border-radius: 5px;
  transition: background 0.12s ease, color 0.12s ease;
}
.count-link:hover { background: var(--primary-blue-dim); color: var(--primary-blue-dark); }

/* Excel-style per-column filter/sort — a small button in the header cell
   that opens a popover with sort options and (for categorical columns) a
   searchable checkbox list of unique values. */
th .th-filter-btn { background: none; border: none; color: var(--ink3); cursor: pointer; padding: 2px 5px; margin-left: 5px; border-radius: 4px; font-size: 11px; vertical-align: middle; }
th .th-filter-btn:hover { background: var(--surface-2); color: var(--navy-text); }
th .th-filter-btn.active { color: var(--primary-blue); }
.col-filter-popover { position: absolute; z-index: 600; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); width: 240px; padding: 6px; font-size: 12.5px; text-transform: none; font-weight: 400; }
.cfp-sort-item { padding: 7px 8px; border-radius: 5px; cursor: pointer; display: flex; align-items: center; gap: 8px; color: var(--navy-text); }
.cfp-sort-item:hover { background: var(--surface-2); }
.cfp-divider { height: 1px; background: var(--border); margin: 5px 0; }
.cfp-clear { padding: 7px 8px; border-radius: 5px; cursor: pointer; color: var(--ink4, #9CA3AF); }
.cfp-clear.enabled { color: var(--danger); cursor: pointer; }
.cfp-clear:hover { background: var(--surface-2); }
.cfp-search { width: 100%; box-sizing: border-box; padding: 6px 8px; border: 1px solid var(--border); border-radius: 5px; margin-bottom: 6px; font-size: 12.5px; }
.cfp-list { max-height: 180px; overflow-y: auto; border: 1px solid var(--border); border-radius: 5px; padding: 4px; }
.cfp-item { display: flex; align-items: center; gap: 7px; padding: 4px 5px; border-radius: 4px; }
.cfp-item:hover { background: var(--surface-2); }
.cfp-item label { cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 400; }
.cfp-actions { display: flex; justify-content: flex-end; gap: 6px; margin-top: 8px; }

/* ===== PILLS — soft tinted, no border by default ===== */
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; white-space: nowrap; font-family: var(--font-ui); letter-spacing: 0.1px; border: 1px solid transparent; }
.pill-red { background: var(--danger-dim); color: var(--danger); }
.pill-orange { background: var(--warning-dim); color: var(--warning); }
.pill-green { background: var(--success-dim); color: var(--success); }
.pill-blue { background: var(--primary-blue-dim); color: var(--primary-blue); }
.pill-gold { background: var(--gold-dim); color: var(--gold); }
.pill-purple { background: var(--purple-dim); color: var(--purple); }
.pill-gray { background: var(--surface-2); color: var(--muted-text); }

/* ===== TABS ===== */
.tabs { display: flex; gap: 4px; margin-bottom: var(--sp-4); background: var(--surface); border-radius: 0; padding: 0; border: none; border-bottom: 1px solid var(--border); width: auto; flex-wrap: wrap; }
.tab {
  padding: 12px 14px 11px; border-radius: var(--radius-sm) var(--radius-sm) 0 0; font-size: 14px; font-weight: 600; cursor: pointer;
  color: var(--navy-text); transition: color 0.12s, border-color 0.12s, background 0.12s; white-space: nowrap;
  border-bottom: 3px solid transparent; margin-bottom: -1px; display: inline-flex; align-items: center; gap: 7px;
}
.tab i { font-size: 13.5px; color: var(--muted-text); transition: color 0.12s; }
.tab:hover { background: var(--surface-2); color: var(--navy-text); }
.tab:hover i { color: var(--navy-text); }
.tab.active { background: transparent; color: var(--primary-blue); font-weight: 700; border-bottom-color: var(--primary-blue); box-shadow: none; }
.tab.active i { color: var(--primary-blue); }

/* ===== MODAL ===== */
.overlay { display: none; position: fixed; inset: 0; background: rgba(15,23,42,0.5); backdrop-filter: blur(2px); z-index: 500; align-items: center; justify-content: center; }
.overlay.show { display: flex; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); width: 680px; max-width: 96vw; max-height: 92vh; overflow-y: auto; animation: mup 0.15s ease; box-shadow: var(--shadow-lg); }
.modal.modal-lg { width: 920px; }
@keyframes mup { from{transform:translateY(6px);opacity:0} to{transform:translateY(0);opacity:1} }
.mhead { padding: 18px 22px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: flex-start; }
.mtitle { font-size: 17.5px; font-weight: 700; color: var(--navy-text); }
.msub { font-size: 12.5px; color: var(--ink3); margin-top: 3px; font-family: var(--font-ui); }
.mclose { cursor: pointer; color: var(--ink3); font-size: 19.5px; border: none; background: none; }
.mclose:hover { color: var(--navy-text); }
.mbody { padding: 20px 22px; }
.mfoot { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }

/* ===== FORMS ===== */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
.fg { display: flex; flex-direction: column; gap: 6px; }
.fg.full { grid-column: 1 / -1; }
.fg label { font-size: 13px; font-weight: 600; color: var(--muted-text); letter-spacing: 0.1px; }
.fg input, .fg select, .fg textarea {
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 11px; font-family: var(--font-ui);
  font-size: 14px; color: var(--navy-text); background: var(--surface); outline: none; transition: border-color 0.15s; height: 38px;
}
.fg select { height: 38px; }
.fg textarea { height: auto; }
.fg input:focus, .fg select:focus, .fg textarea:focus { border-color: var(--primary-blue); }
.fg textarea { resize: vertical; min-height: 58px; }

/* ===== MISC ===== */
.info-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(150px,1fr)); gap: var(--sp-3); }
.info-item { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 12px 14px; }
.info-label { font-size: 11px; color: var(--ink3); letter-spacing: 0.4px; text-transform: uppercase; font-family: var(--font-ui); font-weight: 700; margin-bottom: 5px; }
.info-val { font-size: 14.5px; font-weight: 700; color: var(--navy-text); }

.timeline { display: flex; flex-direction: column; gap: 0; }
.tl-item { display: flex; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.tl-item:last-child { border-bottom: none; }
.tl-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--primary-blue); margin-top: 5px; flex-shrink: 0; }
.tl-body { flex: 1; }
.tl-title { font-size: 13.5px; font-weight: 600; color: var(--navy-text); }
.tl-date { font-size: 11.5px; color: var(--ink3); font-family: var(--font-ui); margin-top: 2px; }
.tl-note { font-size: 12.5px; color: var(--muted-text); margin-top: 3px; }

.tp-header { display: flex; align-items: center; gap: 14px; padding: 16px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); margin-bottom: var(--sp-4); box-shadow: var(--shadow-sm); }
.tp-avatar { width: 44px; height: 44px; border-radius: var(--radius-md); background: var(--primary-blue-dim); color: var(--primary-blue); display: flex; align-items: center; justify-content: center; font-size: 18.5px; font-weight: 700; flex-shrink: 0; }
.tp-name { font-size: 16.5px; font-weight: 700; color: var(--navy-text); }
.tp-gstin { font-size: 12px; color: var(--ink3); font-family: var(--font-mono); margin-top: 3px; }
.tp-stats { display: flex; gap: 20px; margin-left: auto; }

.ba-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 15px 18px; margin-bottom: 10px; box-shadow: var(--shadow-sm); }
.ba-card.released { opacity: 0.6; }

.sdiv { border: none; border-top: 1px solid var(--border); margin: var(--sp-4) 0; }

.import-log { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 12px 14px; font-family: var(--font-mono); font-size: 11.5px; max-height: 260px; overflow-y: auto; }
.log-line { padding: 2px 0; }
.log-ok { color: var(--success); }
.log-warn { color: var(--muted-text); }
.log-err { color: var(--danger); }

.empty { text-align: center; padding: 46px 20px; }
.empty-icon { margin-bottom: 11px; }
.empty-title { font-size: 15px; font-weight: 700; color: var(--navy-text); margin-bottom: 5px; }
.empty-sub { font-size: 12.5px; color: var(--ink3); }

.tag-fy { display: inline-block; background: var(--surface-3); color: var(--muted-text); font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: var(--radius-sm); font-family: var(--font-ui); }

#app-footer { text-align: center; padding: 13px; font-size: 11.5px; color: var(--ink3); font-family: var(--font-ui); }

#save-banner {
  position: fixed; bottom: 18px; right: 18px; background: var(--danger); color: #fff; padding: 12px 16px;
  border-radius: var(--radius-md); font-size: 13px; font-weight: 500; box-shadow: var(--shadow-lg); z-index: 600; display: none; align-items: center; gap: 10px; max-width: 420px;
}
#save-banner.show { display: flex; }
#save-banner .mclose { font-size: 18px; line-height: 1; padding: 0 2px; }

.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--navy-text); color: #fff; padding: 10px 18px; border-radius: var(--radius-md); font-size: 13px; box-shadow: var(--shadow-lg); z-index: 700; opacity: 0; transition: opacity 0.2s; pointer-events: none; }
.toast.show { opacity: 1; }

@media (max-width: 1280px) {
  .stats { grid-template-columns: repeat(3,1fr); }
}
@media (max-width: 900px) {
  .stats { grid-template-columns: repeat(2,1fr); }
  .form-grid { grid-template-columns: 1fr; }
}

@media print {
  header, .sidebar, .ph-actions, .table-toolbar, .btn, .hbtn-icon, #save-banner, #app-footer, #global-search-wrap { display: none !important; }
  body { background: #fff; }
}
