/* ── Reset ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Login Page ────────────────────────────────────────────────── */
.auth-layout { background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%); min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-page  { width: 100%; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card  { background: #fff; border-radius: 12px; padding: 40px; width: 100%; max-width: 400px; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.login-logo  { text-align: center; margin-bottom: 28px; }
.login-logo h1 { font-size: 22px; font-weight: 800; letter-spacing: 0.04em; margin-top: 8px; }
.login-logo p  { font-size: 13px; color: #718096; margin-top: 4px; }

/* ── App Layout (top-nav) ─────────────────────────────────────── */
.app-layout { display: flex; flex-direction: column; min-height: 100vh; }

/* ── Top Navigation ───────────────────────────────────────────── */
.topnav { background: #1a202c; position: sticky; top: 0; z-index: 200; box-shadow: 0 2px 8px rgba(0,0,0,0.25); }
.topnav-inner { max-width: 1400px; margin: 0 auto; padding: 0 20px; display: flex; align-items: center; height: 56px; gap: 4px; }

.topnav-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; margin-right: 16px; flex-shrink: 0; }
.topnav-brand:hover { text-decoration: none; }
.topnav-logo { height: 32px; width: auto; object-fit: contain; }
.topnav-name { color: #fff; font-size: 15px; font-weight: 800; letter-spacing: 0.06em; white-space: nowrap; }

.topnav-links { display: flex; align-items: center; gap: 2px; flex: 1; }

.topnav-item { color: rgba(255,255,255,0.75); font-size: 13px; font-weight: 500; padding: 6px 12px; border-radius: 6px; cursor: pointer; background: none; border: none; text-decoration: none; display: flex; align-items: center; gap: 4px; transition: all 0.15s; white-space: nowrap; }
.topnav-item:hover, .topnav-item:focus { background: rgba(255,255,255,0.1); color: #fff; text-decoration: none; }
.topnav-active { background: rgba(255,255,255,0.12); color: #fff; }
.topnav-trigger { cursor: pointer; }
.nav-caret { font-size: 10px; opacity: 0.6; }

/* Dropdown */
.topnav-group { position: relative; }
.topnav-dropdown { display: none; position: absolute; top: calc(100% + 6px); left: 0; background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; box-shadow: 0 8px 32px rgba(0,0,0,0.12); min-width: 260px; padding: 6px; z-index: 300; }
.topnav-dropdown.open { display: block; }
.topnav-dropdown-right { left: auto; right: 0; }

.topnav-dd-item { display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px; border-radius: 6px; cursor: pointer; background: none; border: none; width: 100%; text-decoration: none; color: #2d3748; transition: background 0.1s; }
.topnav-dd-item:hover { background: #f7fafc; text-decoration: none; color: #1a202c; }
.topnav-dd-item strong { font-size: 13px; font-weight: 600; display: block; }
.topnav-dd-item small { font-size: 11px; color: #718096; display: block; margin-top: 1px; }
.dd-icon { font-size: 18px; width: 28px; text-align: center; flex-shrink: 0; margin-top: 2px; }
.dd-divider { height: 1px; background: #f0f4f8; margin: 4px 0; }

/* Right side */
.topnav-right { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-shrink: 0; }
.topnav-cta { background: #1a56db; color: #fff; padding: 6px 14px; border-radius: 6px; font-size: 13px; font-weight: 600; text-decoration: none; transition: background 0.15s; white-space: nowrap; }
.topnav-cta:hover { background: #1e429f; color: #fff; text-decoration: none; }

.topnav-user { display: flex; align-items: center; gap: 8px; background: none; border: none; cursor: pointer; padding: 4px 8px; border-radius: 6px; color: rgba(255,255,255,0.75); font-size: 13px; transition: background 0.15s; }
.topnav-user:hover { background: rgba(255,255,255,0.1); color: #fff; }
.topnav-avatar { width: 28px; height: 28px; border-radius: 50%; background: #4299e1; color: #fff; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.topnav-username { font-weight: 500; }

/* Flash */
.flash-wrap { position: sticky; top: 56px; z-index: 150; }

:root {
  --bg:        #f4f6f9;
  --surface:   #ffffff;
  --border:    #e2e8f0;
  --text:      #1a202c;
  --mid:       #4a5568;
  --light:     #718096;
  --primary:   #1a56db;
  --primary-h: #1e429f;
  --danger:    #e53e3e;
  --gold:      #b7791f;
  --radius:    6px;
  --shadow:    0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Flash ─────────────────────────────────────────────────────── */
.flash { padding: 10px 24px; font-size: 13px; font-weight: 500; display: flex; align-items: center; justify-content: space-between; }
.flash-notice { background: #d4edda; color: #155724; border-bottom: 1px solid #c3e6cb; }
.flash-alert  { background: #f8d7da; color: #721c24; border-bottom: 1px solid #f5c6cb; }

/* ── Main content ──────────────────────────────────────────────── */
.main-content { max-width: 1280px; margin: 0 auto; padding: 28px 24px 80px; }

/* ── Dashboard ─────────────────────────────────────────────────── */
.dash-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; }
.dash-greeting { font-size: 24px; font-weight: 800; color: #1a202c; }
.dash-date { font-size: 13px; color: #718096; margin-top: 2px; }
.dash-header-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.dash-alert-banner { display: flex; align-items: center; gap: 14px; background: #fffbeb; border: 1px solid #f6ad55; border-radius: 8px; padding: 12px 18px; margin-bottom: 20px; }
.dash-alert-icon { font-size: 20px; flex-shrink: 0; }

.dash-metrics { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 20px; }
@media (max-width: 1100px) { .dash-metrics { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px) { .dash-metrics { grid-template-columns: repeat(2, 1fr); } }

.metric-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; padding: 18px 16px; border-left: 4px solid #e2e8f0; }
.metric-revenue    { border-left-color: #1a56db; }
.metric-receivable { border-left-color: #e2e8f0; }
.metric-payable    { border-left-color: #ed8936; }
.metric-bank       { border-left-color: #38a169; }
.metric-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: #718096; margin-bottom: 8px; }
.metric-value { font-size: 20px; font-weight: 800; color: #1a202c; line-height: 1.3; }
.metric-value div { font-size: 18px; }
.metric-sub { font-size: 11px; color: #a0aec0; margin-top: 3px; font-weight: 400; }

.dash-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.dash-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
@media (max-width: 900px) { .dash-grid-3, .dash-grid-2 { grid-template-columns: 1fr; } }

.dash-panel { background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; padding: 0; overflow: hidden; }
.dash-panel-header { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid #f0f4f8; }
.dash-panel-header h3 { font-size: 13px; font-weight: 700; color: #2d3748; }
.dash-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; border-bottom: 1px solid #f7fafc; }
.dash-row:last-child { border-bottom: none; }
.dash-row-title { font-size: 13px; font-weight: 600; }
.dash-row-sub { font-size: 11px; color: #718096; margin-top: 2px; display: flex; gap: 6px; align-items: center; }
.dash-empty { padding: 24px 16px; text-align: center; font-size: 13px; color: #a0aec0; }
.dash-link { font-size: 12px; color: var(--primary); text-decoration: none; }
.dash-link:hover { text-decoration: underline; }

.dash-stock-row { display: flex; align-items: center; gap: 10px; padding: 8px 16px; border-bottom: 1px solid #f7fafc; }
.dash-stock-row:last-child { border-bottom: none; }
.dash-stock-name { font-size: 12px; font-weight: 600; width: 140px; flex-shrink: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-stock-bar-wrap { flex: 1; background: #f0f4f8; border-radius: 4px; height: 8px; overflow: hidden; }
.dash-stock-bar { height: 100%; border-radius: 4px; transition: width 0.4s; }
.stock-bar-good     { background: #38a169; }
.stock-bar-low      { background: #ed8936; }
.stock-bar-critical { background: #e53e3e; }
.dash-stock-val { font-size: 12px; font-weight: 700; width: 70px; text-align: right; flex-shrink: 0; }
.stock-text-good     { color: #276749; }
.stock-text-low      { color: #c05621; }
.stock-text-critical { color: #c53030; }

/* ── Buttons ───────────────────────────────────────────────────── */
.btn {
  display: inline-block; padding: 9px 18px; border-radius: var(--radius);
  font-size: 13px; font-weight: 600; cursor: pointer; border: none;
  text-decoration: none; white-space: nowrap; transition: background 0.15s;
}
.btn-primary   { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-h); color: #fff; text-decoration: none; }
.btn-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--bg); text-decoration: none; }
.btn-danger    { background: var(--danger); color: #fff; }
.btn-add       { background: #ebf4ff; color: var(--primary); border: 1.5px dashed var(--primary); padding: 7px 14px; }
.btn-remove    { background: #fff5f5; color: var(--danger); border: 1px solid #fed7d7; padding: 4px 10px; font-size: 12px; border-radius: var(--radius); cursor: pointer; }

.inline-form { display: inline; }
.action-link {
  font-size: 12px; color: var(--primary); background: none; border: none;
  cursor: pointer; padding: 4px 8px; border-radius: 4px; font-weight: 500;
  text-decoration: none;
}
.action-link:hover { background: #ebf4ff; }
.action-link.danger { color: var(--danger); }
.action-link.danger:hover { background: #fff5f5; }

/* ── Page header ───────────────────────────────────────────────── */
.page-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 24px;
}
.page-header h1 { font-size: 24px; font-weight: 700; }
.sub { color: var(--light); font-size: 13px; margin-top: 2px; }
.header-actions { display: flex; gap: 10px; align-items: center; }

/* ── Stats row ─────────────────────────────────────────────────── */
.stats-row { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-bottom: 20px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.stat-label { font-size: 11px; color: var(--light); text-transform: uppercase; letter-spacing: 0.06em; }
.stat-value { font-size: 28px; font-weight: 700; margin-top: 4px; }

/* ── Filter bar ────────────────────────────────────────────────── */
.filter-bar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; }
.search-input {
  flex: 1; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 13px; background: var(--surface); outline: none;
}
.search-input:focus { border-color: var(--primary); }
.filter-select { padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 13px; background: var(--surface); }

/* ── Invoice list ──────────────────────────────────────────────── */
.invoice-list { display: flex; flex-direction: column; gap: 6px; }
.invoice-row {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 18px; display: flex; align-items: center; gap: 20px;
  transition: box-shadow 0.15s, border-color 0.15s;
}
.invoice-row:hover { box-shadow: var(--shadow-md); border-color: #c3dafe; }

.inv-num { min-width: 160px; }
.inv-num a { font-weight: 700; font-size: 15px; }
.badges { display: flex; gap: 5px; margin-top: 4px; }

.badge { padding: 2px 8px; border-radius: 12px; font-size: 11px; font-weight: 600; }
.badge-commercial { background: #ebf4ff; color: var(--primary); }
.badge-proforma   { background: #fffbeb; color: var(--gold); }
.badge-draft      { background: #fff3cd; color: #856404; }
.badge-final      { background: #d4edda; color: #155724; }
.badge-converted  { background: #e9ecef; color: #6c757d; }

.inv-buyer { flex: 1; }
.inv-buyer strong { display: block; font-weight: 600; }
.inv-buyer span   { font-size: 12px; color: var(--light); }
.inv-meta { min-width: 110px; font-size: 13px; color: var(--mid); }
.inv-meta .date { font-size: 12px; color: var(--light); }
.inv-amount { min-width: 130px; font-size: 16px; font-weight: 700; text-align: right; }
.inv-actions { display: flex; gap: 4px; align-items: center; }

.empty-state {
  text-align: center; padding: 60px 20px; background: var(--surface);
  border: 1px dashed var(--border); border-radius: var(--radius);
}
.empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state h3 { font-size: 18px; margin-bottom: 6px; }
.empty-state p  { color: var(--light); margin-bottom: 20px; }

/* ── Buyers grid ───────────────────────────────────────────────── */
.buyers-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px,1fr)); gap: 16px; }
.buyer-card  { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.buyer-name    { font-weight: 700; font-size: 15px; margin-bottom: 2px; }
.buyer-country { font-size: 12px; color: var(--primary); font-weight: 600; margin-bottom: 6px; }
.buyer-address { font-size: 13px; color: var(--mid); margin-bottom: 8px; white-space: pre-line; }
.buyer-contact { font-size: 12px; color: var(--light); margin-bottom: 2px; }
.buyer-actions { display: flex; gap: 8px; margin-top: 12px; border-top: 1px solid var(--border); padding-top: 12px; }

/* ── Forms ─────────────────────────────────────────────────────── */
.form-section {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; margin-bottom: 16px;
}
.section-title {
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--light); margin-bottom: 16px; padding-bottom: 10px; border-bottom: 1px solid var(--border);
}
.section-title-row {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px; padding-bottom: 10px; border-bottom: 1px solid var(--border);
}

.form-row   { display: flex; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.form-group { display: flex; flex-direction: column; gap: 5px; flex: 1; min-width: 130px; }
.form-group label { font-size: 12px; font-weight: 600; color: var(--mid); }
.flex-2 { flex: 2; }
.flex-3 { flex: 3; }

input[type=text], input[type=email], input[type=tel], input[type=number],
input[type=date], select, textarea {
  padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 13px; background: var(--surface); color: var(--text);
  outline: none; font-family: inherit; width: 100%; transition: border-color 0.15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); }
.form-control { padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 13px; background: var(--surface); color: var(--text); outline: none; font-family: inherit; width: 100%; transition: border-color 0.15s; }
.form-control:focus { border-color: var(--primary); }
.form-control[readonly] { background: var(--bg); color: var(--mid); cursor: default; }

.form-errors { background: #fff5f5; border: 1px solid #fed7d7; border-radius: var(--radius); padding: 12px 16px; margin-bottom: 16px; color: var(--danger); font-size: 13px; }

/* Line items */
.line-item-card {
  background: #f8faff; border: 1px solid #c3dafe;
  border-radius: var(--radius); padding: 16px; margin-bottom: 12px;
}
.line-item-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.line-num { font-weight: 700; color: var(--primary); font-size: 13px; }
.packing-summary { background: #e8f0fe; border-radius: 4px; padding: 8px 12px; font-size: 13px; color: var(--primary); margin-top: 8px; }

.totals-bar {
  background: var(--text); color: #fff; border-radius: var(--radius);
  padding: 16px 20px; display: flex; margin-top: 4px;
}
.total-cell { flex: 1; border-right: 1px solid rgba(255,255,255,0.12); padding: 0 16px; }
.total-cell:first-child { padding-left: 0; }
.total-cell:last-child  { border-right: none; }
.total-cell span   { display: block; font-size: 11px; color: rgba(255,255,255,0.55); text-transform: uppercase; letter-spacing: 0.05em; }
.total-cell strong { font-size: 16px; }
.total-amount strong { color: #68d391; font-size: 18px; }

.amount-words { background: #fffbeb; border: 1px solid #f6e05e; border-radius: var(--radius); padding: 10px 14px; font-size: 13px; margin-top: 10px; }

.form-footer {
  position: fixed; bottom: 0; left: 0; right: 0; background: var(--surface);
  border-top: 1px solid var(--border); padding: 14px 28px;
  display: flex; justify-content: flex-end; gap: 10px;
  z-index: 50; box-shadow: 0 -2px 8px rgba(0,0,0,0.06);
}
.form-footer-static { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }

/* ── View / Print page ─────────────────────────────────────────── */
.view-toolbar {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 20px;
}

/* ── Document (invoice & packing list) ────────────────────────── */
.document {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 40px 48px; box-shadow: var(--shadow-md);
}

.doc-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 24px; padding-bottom: 16px; border-bottom: 2.5px solid var(--text);
}
.doc-company  { font-size: 20px; font-weight: 800; letter-spacing: 0.02em; margin-bottom: 4px; }
.doc-address  { font-size: 12px; color: var(--mid); line-height: 1.65; }
.doc-exporter { font-size: 12px; line-height: 1.7; }

.doc-title-block { text-align: right; }
.doc-title { font-size: 17px; font-weight: 800; letter-spacing: 0.05em; color: var(--primary); margin-bottom: 10px; }

.doc-meta-table { margin-left: auto; border-collapse: collapse; }
.doc-meta-table td { padding: 2px 8px; font-size: 12px; }
.doc-meta-table td:first-child { color: var(--light); text-align: right; }

.doc-parties { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; margin-bottom: 18px; }
.party-box   { border: 1px solid var(--border); border-radius: 4px; padding: 12px 14px; font-size: 12px; }
.party-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--primary); font-weight: 700; margin-bottom: 5px; }
.party-name  { font-weight: 700; font-size: 13px; }
.party-address { color: var(--mid); margin-top: 2px; line-height: 1.5; white-space: pre-line; }

.doc-shipping { display: flex; flex-wrap: wrap; background: #f7f9fc; border: 1px solid var(--border); border-radius: 4px; margin-bottom: 18px; }
.ship-cell { flex: 1; min-width: 140px; padding: 10px 14px; border-right: 1px solid var(--border); font-size: 12px; }
.ship-cell:last-child { border-right: none; }
.ship-cell span   { display: block; color: var(--light); font-size: 10px; text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 2px; }
.ship-cell strong { font-size: 12px; }

.doc-table { width: 100%; border-collapse: collapse; margin-bottom: 14px; font-size: 13px; }
.doc-table th {
  background: var(--text); color: #fff; padding: 9px 10px;
  font-size: 11px; font-weight: 600; text-align: left; letter-spacing: 0.03em;
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.doc-table td    { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.doc-table .tc   { text-align: center; }
.doc-table .tr   { text-align: right; }
.item-name       { font-weight: 600; }
.item-packing    { font-size: 11px; color: var(--light); margin-top: 2px; }
.total-row td    { background: #f7f9fc; font-weight: 600; border-top: 2px solid var(--text); -webkit-print-color-adjust: exact; print-color-adjust: exact; }

.amount-in-words { background: #fffbeb; border: 1px solid #f6e05e; border-radius: 4px; padding: 10px 14px; font-size: 12.5px; margin-bottom: 14px; }

.weight-summary {
  display: flex; flex-wrap: wrap; gap: 24px; background: #f0fff4;
  border: 1px solid #c6f6d5; border-radius: 4px; padding: 12px 16px; margin-bottom: 14px; font-size: 13px;
}
.weight-summary span { color: var(--light); margin-right: 4px; }

.marks-section { border: 1px solid var(--border); border-radius: 4px; padding: 12px 14px; margin-bottom: 14px; font-size: 12px; }
.marks-label   { font-weight: 700; font-size: 11px; color: var(--light); text-transform: uppercase; margin-bottom: 4px; }
.marks-content { white-space: pre-line; }

.bank-section { border: 1px solid #bee3f8; background: #ebf8ff; border-radius: 4px; padding: 14px 16px; margin-bottom: 14px; }
.bank-label   { font-weight: 700; font-size: 11px; color: #2b6cb0; text-transform: uppercase; margin-bottom: 8px; }
.bank-grid    { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; font-size: 12px; }
.bank-grid span { color: var(--light); margin-right: 4px; }

.declaration { border-top: 1px solid var(--border); padding-top: 14px; font-size: 12px; color: var(--mid); margin-bottom: 24px; line-height: 1.7; }

.signature-block { display: flex; justify-content: flex-end; margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--border); }
.sig-left { text-align: center; font-size: 12px; }
.sig-line { width: 180px; border-top: 1.5px solid var(--text); margin-bottom: 6px; }

/* ── Print ─────────────────────────────────────────────────────── */
@media print {
  body, .print-body { background: #fff; }
  .no-print { display: none !important; }
  .document { border: none; box-shadow: none; padding: 0; }
  .navbar, .flash, .main-content > *:not(.document) { display: none !important; }
  .doc-table th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ── New Invoice Document Layout ───────────────────────────────── */
.inv-doc { font-size: 12px; line-height: 1.5; }

.inv-top { display: flex; align-items: center; margin-bottom: 8px; }
.inv-logo { width: 90px; flex-shrink: 0; }
.logo-img { max-width: 80px; max-height: 70px; object-fit: contain; }
.inv-logo-right { width: 90px; }
.inv-title-block { flex: 1; text-align: center; }
.inv-doc-title { font-size: 14px; font-weight: 800; letter-spacing: 0.03em; }
.inv-gstin { font-size: 11px; color: var(--mid); margin-top: 3px; }

.inv-company-block { text-align: center; border-top: 1.5px solid var(--text); border-bottom: 1.5px solid var(--text); padding: 10px 0; margin-bottom: 14px; }
.inv-company-name { font-size: 22px; font-weight: 800; letter-spacing: 0.04em; }
.inv-company-tag  { font-size: 13px; font-style: italic; color: var(--mid); margin-top: 2px; }
.inv-company-sub  { font-size: 11px; color: var(--light); margin-top: 4px; }

.inv-info-grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 0; border: 1px solid var(--border); margin-bottom: 8px; }
.inv-info-col  { padding: 10px 12px; border-right: 1px solid var(--border); font-size: 12px; }
.inv-info-col:last-child { border-right: none; }
.inv-info-label { font-weight: 700; font-size: 11px; text-transform: uppercase; color: var(--light); margin-bottom: 4px; }
.inv-info-val   { margin-bottom: 2px; }

.inv-field-row  { display: flex; gap: 6px; margin-bottom: 3px; font-size: 12px; }
.inv-field-row span { color: var(--mid); white-space: nowrap; }

.inv-ship-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 0 12px; border: 1px solid var(--border); border-top: 2px solid var(--text); padding: 8px 12px; margin-bottom: 8px; }

.inv-table th { font-size: 11px; }
.inv-table td  { font-size: 12px; }

.inv-summary-row { display: flex; gap: 0; border: 1px solid var(--border); margin-bottom: 8px; }
.inv-summary-left  { flex: 1; padding: 10px 14px; border-right: 1px solid var(--border); }
.inv-summary-right { flex: 1; padding: 10px 14px; }
.inv-total-line { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.inv-words { font-size: 11px; color: var(--mid); font-style: italic; }

.inv-bank { border: 1px solid var(--border); padding: 10px 14px; margin-bottom: 8px; }
.inv-bank-title { font-weight: 700; font-size: 11px; text-transform: uppercase; margin-bottom: 6px; }
.inv-bank-grid  { display: grid; grid-template-columns: repeat(3,1fr); gap: 4px 12px; font-size: 11px; }

.inv-terms { border-top: 1px solid var(--border); padding: 8px 0; margin-bottom: 8px; }
.inv-terms-title { font-weight: 700; font-size: 11px; margin-bottom: 4px; }

.inv-sign-block { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); }
.inv-sign-left  { font-size: 11px; color: var(--mid); max-width: 55%; }
.inv-sign-right { text-align: center; min-width: 200px; }
.inv-stamp-area { min-height: 70px; display: flex; align-items: center; justify-content: center; margin-bottom: 4px; }
.stamp-img      { max-height: 80px; max-width: 160px; object-fit: contain; }
.inv-sign-name  { font-size: 12px; font-weight: 600; }
.inv-sign-line  { border-top: 1px solid var(--text); width: 160px; margin: 6px auto 4px; }
.inv-sign-role  { font-size: 11px; color: var(--mid); }

.inv-qr-block   { display: inline-block; text-align: center; }
.inv-qr-block svg { width: 72px; height: 72px; display: block; }
.inv-qr-label   { font-size: 9px; color: var(--mid); margin-top: 3px; letter-spacing: 0.03em; }

/* ── Shipment Documents ────────────────────────────────────────── */
.docs-section        { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-top: 20px; overflow: hidden; }
.docs-header         { display: flex; justify-content: space-between; align-items: flex-start; padding: 18px 22px 14px; border-bottom: 1px solid var(--border); }
.docs-title          { font-size: 16px; font-weight: 700; }
.docs-sub            { font-size: 12px; color: var(--light); margin-top: 2px; }
.docs-empty          { padding: 18px 22px; color: var(--light); font-size: 13px; }

.docs-grid           { padding: 16px 22px; display: flex; flex-direction: column; gap: 10px; }
.doc-card            { display: flex; align-items: flex-start; gap: 14px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.doc-card-icon       { font-size: 28px; flex-shrink: 0; margin-top: 2px; }
.doc-card-body       { flex: 1; min-width: 0; }
.doc-card-type       { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--primary); margin-bottom: 2px; }
.doc-card-name       { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-card-meta       { font-size: 11px; color: var(--light); }
.doc-card-notes      { font-size: 12px; color: var(--mid); margin-top: 4px; font-style: italic; }
.doc-card-actions    { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }

.docs-checklist      { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 10px; align-items: center; background: #fafbfc; }
.docs-checklist-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--light); margin-right: 4px; }
.checklist-item      { font-size: 12px; padding: 4px 12px; border-radius: 14px; font-weight: 500; }
.checklist-item.done    { background: #d4edda; color: #155724; }
.checklist-item.missing { background: #f8f9fa; color: var(--light); border: 1px dashed var(--border); }

.docs-upload-form    { padding: 16px 22px; border-top: 2px solid var(--border); background: #f8faff; }
.docs-upload-title   { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 12px; }

/* ── Dashboard ─────────────────────────────────────────────────── */
.dash-stats-5 { grid-template-columns: repeat(5, 1fr) !important; }

/* ── Role badges ───────────────────────────────────────────────── */
.role-badge         { padding: 3px 10px; border-radius: 12px; font-size: 11px; font-weight: 700; }
.role-super_admin   { background: #ebf4ff; color: #1a56db; }
.role-accountant    { background: #f0fff4; color: #276749; }
.role-viewer        { background: #f7fafc; color: #718096; }
.perm-tag           { display: inline-block; font-size: 11px; background: #f0fff4; color: #276749; border-radius: 4px; padding: 1px 7px; margin: 2px 2px 0 0; }
.perm-no            { background: #fff5f5; color: #e53e3e; }

.items-guide {
  background: #eff6ff; border: 1px solid #bfdbfe; border-radius: var(--radius);
  padding: 10px 16px; font-size: 13px; color: #1e40af; margin-bottom: 16px; line-height: 1.7;
}
.items-guide strong { font-weight: 700; }
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 20px; }
.dash-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0; overflow: hidden; }
.dash-card-header { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.dash-card-header h3 { font-size: 14px; font-weight: 700; }
.dash-link { font-size: 12px; color: var(--primary); text-decoration: none; }
.dash-empty { padding: 20px 18px; font-size: 13px; color: var(--light); }
.dash-row { display: flex; justify-content: space-between; align-items: flex-start; padding: 12px 18px; border-bottom: 1px solid var(--border); font-size: 13px; }
.dash-row:last-child { border-bottom: none; }
.dash-row-title { font-weight: 600; }
.dash-row-title a { color: var(--text); text-decoration: none; }
.dash-row-title a:hover { color: var(--primary); }
.dash-row-sub { font-size: 11px; color: var(--light); margin-top: 2px; }
.dash-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.dash-table th { padding: 8px 12px; font-size: 11px; color: var(--light); text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 1px solid var(--border); }
.dash-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); }
.dash-table .tr { text-align: right; }

/* ── Stock Cards ───────────────────────────────────────────────── */
.stock-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap: 14px; }
.stock-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; border-top: 4px solid var(--border); }
.stock-card-good     { border-top-color: #38a169; }
.stock-card-low      { border-top-color: #d69e2e; }
.stock-card-critical { border-top-color: #e53e3e; }
.stock-product  { font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.stock-available { font-size: 32px; font-weight: 800; line-height: 1; }
.stock-available span { font-size: 14px; color: var(--light); font-weight: 400; }
.stock-details { font-size: 12px; color: var(--mid); margin-top: 10px; display: flex; flex-direction: column; gap: 3px; }
.stock-details span { color: var(--light); margin-right: 4px; }
.stock-status-dot { display: inline-block; margin-top: 10px; padding: 2px 8px; border-radius: 12px; font-size: 10px; font-weight: 700; letter-spacing: 0.08em; }
.stock-good     { background: #c6f6d5; color: #276749; }
.stock-low      { background: #fefcbf; color: #7b6002; }
.stock-critical { background: #fed7d7; color: #9b2335; }

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .sidebar    { width: 200px; }
  .app-body   { margin-left: 200px; }
  .dash-grid  { grid-template-columns: 1fr; }
  .stats-row  { grid-template-columns: repeat(2,1fr); }
  .doc-parties { grid-template-columns: 1fr; }
  .doc-shipping, .invoice-row { flex-direction: column; }
  .main-content { padding: 16px; }
  .inv-info-grid, .inv-ship-grid { grid-template-columns: 1fr; }
}
@media print {
  .sidebar, .app-body > .flash { display: none !important; }
  .app-body { margin-left: 0; }
}

/* ── Master Bag ─────────────────────────────────────────────────── */
.master-bag-row { padding: 6px 0 4px; }
.master-bag-toggle { font-size: 13px; color: #2d3748; }
.master-bag-fields { background: #f0fff4; border: 1px solid #c6f6d5; border-radius: 6px; padding: 10px 12px; margin-top: 4px; }

/* ── Products ───────────────────────────────────────────────────── */
.products-table-wrap { background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; overflow: hidden; margin-bottom: 16px; }
.products-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.products-table th { background: #f7fafc; padding: 10px 14px; text-align: left; font-size: 11px; font-weight: 700; color: #718096; text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 2px solid #e2e8f0; }
.products-table td { padding: 12px 14px; border-bottom: 1px solid #f0f4f8; vertical-align: middle; }
.products-table tr:last-child td { border-bottom: none; }
.products-table tr:hover td { background: #f7fafc; }
.product-inactive td { color: #a0aec0; }
.product-name-cell { display: flex; align-items: center; gap: 10px; }
.product-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.product-dot.active { background: #48bb78; }
.product-dot.inactive { background: #cbd5e0; }
.action-buttons { display: flex; gap: 8px; align-items: center; }
.action-link.warning { color: #dd6b20; }
.mono { font-family: monospace; font-size: 12px; }
.products-info-box { background: #ebf8ff; border: 1px solid #bee3f8; border-radius: 8px; padding: 12px 16px; font-size: 13px; color: #2b6cb0; }

/* ── Cost Calculator ────────────────────────────────────────────── */
.rates-bar { background: #1a202c; border-radius: 10px; padding: 16px 24px; margin-bottom: 24px; }
.rates-bar-inner { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.rate-item { display: flex; align-items: center; gap: 12px; }
.rate-flag { font-size: 28px; }
.rate-label { font-size: 11px; color: #718096; text-transform: uppercase; letter-spacing: 0.06em; }
.rate-live-val { font-size: 22px; font-weight: 700; color: #fff; }
.rate-bank-val { font-size: 12px; color: #a0aec0; margin-top: 2px; }
.rate-bank-val strong { color: #68d391; }
.rate-divider { width: 1px; height: 48px; background: rgba(255,255,255,0.1); }
.rate-status { margin-left: auto; text-align: right; }
.rate-live-badge { background: #276749; color: #9ae6b4; font-size: 12px; padding: 3px 10px; border-radius: 20px; font-weight: 600; }
.rate-fallback-badge { background: #744210; color: #fbd38d; font-size: 12px; padding: 3px 10px; border-radius: 20px; font-weight: 600; }
.rate-time { display: block; font-size: 11px; color: #718096; margin-top: 4px; }
.rate-note { font-size: 11px; color: #4a5568; margin-top: 4px; }

.calc-layout { display: grid; grid-template-columns: 420px 1fr; gap: 24px; align-items: start; }
.calc-inputs-panel { background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; padding: 24px; }
.calc-results-panel { background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; padding: 24px; }
.calc-panel-title { font-size: 14px; font-weight: 700; color: #2d3748; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 20px; padding-bottom: 12px; border-bottom: 2px solid #e2e8f0; }
.calc-section-label { font-size: 11px; font-weight: 700; color: #718096; text-transform: uppercase; letter-spacing: 0.08em; margin: 18px 0 8px; }
.calc-hint { display: block; font-size: 11px; color: #a0aec0; margin-top: 4px; }

.gst-toggle-row { display: flex; flex-direction: column; gap: 4px; }
.toggle-label { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; color: #2d3748; }
.toggle-label input[type=checkbox] { display: none; }
.toggle-switch { width: 40px; height: 22px; background: #cbd5e0; border-radius: 11px; position: relative; flex-shrink: 0; transition: background 0.2s; }
.toggle-switch::after { content: ''; position: absolute; width: 16px; height: 16px; background: #fff; border-radius: 50%; top: 3px; left: 3px; transition: left 0.2s; box-shadow: 0 1px 3px rgba(0,0,0,0.2); }
.toggle-label input:checked + .toggle-switch { background: #48bb78; }
.toggle-label input:checked + .toggle-switch::after { left: 21px; }

.calc-breakdown-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 20px; }
.calc-breakdown-table th { background: #f7fafc; padding: 8px 12px; text-align: right; font-size: 11px; font-weight: 700; color: #718096; text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 2px solid #e2e8f0; }
.calc-breakdown-table th:first-child { text-align: left; }
.calc-breakdown-table td { padding: 8px 12px; text-align: right; border-bottom: 1px solid #f0f4f8; color: #4a5568; font-family: monospace; }
.calc-breakdown-table td:first-child { text-align: left; font-family: inherit; color: #2d3748; }
.calc-row-fob td { background: #ebf8ff; font-weight: 700; color: #2b6cb0; border-top: 2px solid #bee3f8; }
.calc-row-cnf td { background: #f0fff4; font-weight: 700; color: #276749; border-top: 2px solid #c6f6d5; }
.calc-row-gst td { color: #744210; background: #fffbeb; }
.calc-row-sf td { color: #553c9a; }

.calc-output-boxes { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.calc-out-box { border-radius: 10px; padding: 20px; text-align: center; }
.fob-box { background: linear-gradient(135deg, #ebf8ff, #bee3f8); border: 1px solid #90cdf4; }
.cnf-box { background: linear-gradient(135deg, #f0fff4, #c6f6d5); border: 1px solid #9ae6b4; }
.out-box-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: #4a5568; margin-bottom: 6px; }
.out-box-main { font-size: 26px; font-weight: 800; color: #1a202c; }
.out-box-main span { font-size: 14px; font-weight: 500; color: #718096; }
.out-box-sub { font-size: 13px; color: #4a5568; margin-top: 4px; }

.calc-summary-bar { background: #f7fafc; border-radius: 8px; padding: 10px 16px; font-size: 12px; color: #718096; }
.calc-summary-bar strong { color: #2d3748; }

.calc-placeholder { text-align: center; padding: 60px 24px; color: #718096; }
.calc-placeholder-icon { font-size: 48px; margin-bottom: 16px; }
.calc-placeholder p { font-size: 14px; line-height: 1.6; }

.cert-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.calc-row-cert td { color: #553c9a; background: #faf5ff; }
.calc-row-note { display: block; font-size: 10px; color: #a0aec0; font-family: inherit; margin-top: 1px; }

/* ── Sale Type Selector ─────────────────────────────────────────── */
.sale-type-row { display: flex; align-items: center; gap: 12px; background: #f7fafc; border: 1px solid #e2e8f0; border-radius: 10px; padding: 14px 16px; margin-bottom: 20px; }
.sale-type-label { font-size: 13px; font-weight: 600; color: #4a5568; white-space: nowrap; }
.sale-type-option { display: flex; align-items: center; gap: 10px; border: 2px solid #e2e8f0; border-radius: 8px; padding: 10px 16px; cursor: pointer; background: #fff; transition: all 0.15s; flex: 1; }
.sale-type-option input { display: none; }
.sale-type-option:hover { border-color: #4299e1; background: #ebf8ff; }
.sale-type-option.selected { border-color: #3182ce; background: #ebf8ff; }
.sale-type-icon { font-size: 24px; }
.sale-type-option strong { font-size: 13px; color: #2d3748; }
.sale-type-option small { font-size: 11px; color: #718096; }

/* ── Reports ────────────────────────────────────────────────────── */
.report-summary { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; margin-bottom: 24px; }
.report-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; padding: 20px; }
.report-card.primary { border-left: 4px solid #3182ce; }
.report-card.warning { border-left: 4px solid #ed8936; }
.rc-label { font-size: 11px; font-weight: 700; text-transform: uppercase; color: #718096; letter-spacing: 0.05em; margin-bottom: 6px; }
.rc-value { font-size: 22px; font-weight: 800; color: #1a202c; }
.rc-sub { font-size: 11px; color: #a0aec0; margin-top: 4px; }

.report-section { background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; padding: 20px; margin-bottom: 20px; }
.report-section-title { font-size: 13px; font-weight: 700; color: #2d3748; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 2px solid #e2e8f0; }
.report-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

.report-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.report-table th { background: #f7fafc; padding: 8px 10px; text-align: left; font-size: 11px; font-weight: 700; color: #718096; text-transform: uppercase; border-bottom: 2px solid #e2e8f0; }
.report-table td { padding: 8px 10px; border-bottom: 1px solid #f0f4f8; color: #2d3748; }
.report-table tr:hover td { background: #f7fafc; }
.report-row-zero td { color: #cbd5e0; }
.report-total-row td { background: #ebf8ff; font-weight: 700; border-top: 2px solid #bee3f8; }
.report-empty { text-align: center; padding: 40px; color: #a0aec0; font-size: 13px; }

.report-bar-wrap { background: #edf2f7; border-radius: 4px; height: 14px; overflow: hidden; }
.report-bar { background: linear-gradient(90deg, #3182ce, #63b3ed); height: 100%; border-radius: 4px; transition: width 0.3s; }

/* ── Buyer / Consignee two-column layout ── */
.party-row { display: flex; gap: 20px; }
.party-col { flex: 1; min-width: 0; }
.party-col-title { font-size: 13px; font-weight: 700; color: #2d3748; border-bottom: 2px solid #e2e8f0; padding-bottom: 6px; margin-bottom: 12px; }

/* ── Quick-add link ── */
.quick-add-link { display: inline-block; font-size: 12px; color: #3182ce; margin-top: 5px; text-decoration: none; }
.quick-add-link:hover { text-decoration: underline; }

/* ── Quick-add panel ── */
.quick-add-panel { background: #f0fff4; border: 1px solid #9ae6b4; border-radius: 8px; padding: 14px 16px; margin-top: 10px; }
.quick-add-panel .quick-add-title { font-size: 12px; font-weight: 700; color: #276749; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 10px; }
.quick-add-actions { display: flex; gap: 8px; margin-top: 10px; }
.btn-sm { font-size: 12px; padding: 5px 14px; }

/* ── Payment Tracking ───────────────────────────────────────────── */
.payment-banner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 20px; border-radius: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.payment-banner-left { flex: 1; min-width: 0; }
.payment-banner-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: #718096; margin-bottom: 4px; }
.payment-banner-status { font-size: 15px; font-weight: 700; color: #2d3748; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.payment-banner-right { display: flex; align-items: center; gap: 8px; }

.payment-unpaid  { background: #fff5f5; border: 1px solid #fed7d7; }
.payment-partial { background: #fffaf0; border: 1px solid #fbd38d; }
.payment-paid    { background: #f0fff4; border: 1px solid #9ae6b4; }

.payment-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.payment-dot-unpaid  { background: #e53e3e; }
.payment-dot-partial { background: #dd6b20; }
.payment-dot-paid    { background: #38a169; }

.payment-badge-unpaid  { background: #fed7d7; color: #c53030; }
.payment-badge-partial { background: #fbd38d; color: #7b341e; }
.payment-badge-paid    { background: #c6f6d5; color: #276749; }

/* ── Bank Transactions ──────────────────────────────────────────── */
.txn-list { display: flex; flex-direction: column; gap: 5px; }
.txn-row  { display: flex; align-items: center; gap: 14px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; }
.txn-date { min-width: 54px; text-align: center; font-size: 13px; line-height: 1.3; }
.txn-date strong { display: block; font-size: 15px; }
.txn-type-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.txn-type-dot.txn-credit { background: #38a169; }
.txn-type-dot.txn-debit  { background: #e53e3e; }
.txn-desc  { flex: 1; }
.txn-desc strong { display: block; font-size: 13px; }
.txn-meta  { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 3px; }
.txn-party { min-width: 140px; font-size: 12px; color: var(--mid); }
.txn-amount { min-width: 130px; text-align: right; font-size: 15px; font-weight: 700; }
.txn-amount.txn-credit { color: #276749; }
.txn-amount.txn-debit  { color: #c53030; }
.txn-cat-sale_receipt     { background: #c6f6d5; color: #276749; }
.txn-cat-purchase_payment { background: #fed7d7; color: #c53030; }
.txn-cat-bank_charge      { background: #e2e8f0; color: #4a5568; }
.txn-cat-other            { background: #e9ecef; color: #6c757d; }

/* ── Tally Export page ──────────────────────────────────────────── */
.tally-export-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
@media (max-width: 900px) { .tally-export-grid { grid-template-columns: 1fr; } }
.tally-includes { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; align-items: center; }
.tally-include-label { font-size: 11px; font-weight: 700; color: #718096; text-transform: uppercase; }
.tally-tag { background: #ebf4ff; color: #2b6cb0; padding: 3px 9px; border-radius: 12px; font-size: 11px; font-weight: 600; }
.tally-note { margin-top: 18px; padding: 12px 14px; background: #f7fafc; border-left: 3px solid #bee3f8; border-radius: 4px; font-size: 12px; color: #4a5568; line-height: 1.7; }

/* ── Bank Accounts ────────────────────────────────────────────── */
.bank-accounts-grid    { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px,1fr)); gap: 16px; margin-top: 8px; }
.bank-account-card     { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.bank-account-bank     { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 4px; }
.bank-account-name     { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.bank-account-meta     { font-size: 12px; color: var(--mid); margin-bottom: 4px; }
.bank-account-stats    { font-size: 12px; color: var(--light); margin-bottom: 10px; }
.bank-account-balance  { font-size: 20px; font-weight: 800; color: #276749; margin: 10px 0 8px; }
.bank-account-actions  { display: flex; gap: 6px; flex-wrap: wrap; border-top: 1px solid var(--border); padding-top: 12px; margin-top: 8px; }
.bank-hdfc             { color: #c53030; }
.bank-axis             { color: #b7791f; }
.bank-cash             { color: #276749; }
.bank-personal         { color: #553c9a; }
.bank-account-tag      { font-size: 10px; padding: 2px 7px; border-radius: 10px; font-weight: 700; }
.bank-account-tag.bank-hdfc     { background: #fff5f5; color: #c53030; }
.bank-account-tag.bank-axis     { background: #fffbeb; color: #b7791f; }
.bank-account-tag.bank-cash     { background: #f0fff4; color: #276749; }
.bank-account-tag.bank-personal { background: #faf5ff; color: #553c9a; }

/* ── Import preview ───────────────────────────────────────────── */
.import-row-dupe { background: #fffaf0; color: #718096; }
.import-row-new  { background: #fff; }

/* ── Reconcile / Match page ───────────────────────────────────── */
.recon-guide { background: #ebf8ff; border: 1px solid #bee3f8; border-radius: var(--radius); padding: 12px 16px; font-size: 13px; color: #2b6cb0; margin-bottom: 20px; }
.recon-card  { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 12px; border-left: 4px solid #cbd5e0; }
.recon-credit { border-left-color: #38a169; }
.recon-debit  { border-left-color: #e53e3e; }
.recon-card-header { margin-bottom: 12px; }
.recon-card-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.recon-date   { font-size: 13px; font-weight: 700; color: #2d3748; white-space: nowrap; }
.recon-type   { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 10px; }
.recon-type.credit { background: #d4edda; color: #276749; }
.recon-type.debit  { background: #f8d7da; color: #721c24; }
.recon-amount { font-size: 15px; font-weight: 800; color: #1a202c; }
.recon-desc   { font-size: 13px; color: #4a5568; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 600px; }
.recon-form-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.recon-transfer-hint { background: #fffbeb; border: 1px solid #f6e05e; border-radius: 6px; padding: 8px 12px; margin-bottom: 10px; font-size: 12px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.recon-transfer-hint span { color: #744210; }

/* ── Ledger ───────────────────────────────────────────────────── */
.ledger-balance-bar { background: #f7fafc; border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 24px; margin-bottom: 20px; display: flex; align-items: center; gap: 20px; }
.ledger-balance-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: #718096; }
.ledger-balance-amount { font-size: 26px; font-weight: 800; margin-top: 4px; }
.ledger-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ledger-table thead th { background: #2d3748; color: #fff; padding: 10px 12px; text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; border: none; }
.ledger-table td { padding: 10px 12px; border-bottom: 1px solid #f0f4f8; vertical-align: top; }
.ledger-table .ledger-row-purchase td { background: #fffaf0; }
.ledger-table .ledger-row-payment td { background: #f0fff4; }
.ledger-table .ledger-row-invoice td { background: #fffaf0; }
.ledger-table .ledger-row-receipt td { background: #f0fff4; }
.ledger-table tfoot td { border-top: 2px solid #2d3748; }

/* ── Transfer form ────────────────────────────────────────────── */
.transfer-flow   { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 8px; }
.transfer-side   { flex: 1; }
.transfer-side-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: #718096; margin-bottom: 6px; }
.transfer-arrow  { flex: 0; text-align: center; padding-bottom: 4px; min-width: 120px; }
.transfer-arrow-icon { font-size: 28px; color: var(--primary); font-weight: 700; margin-bottom: 6px; }
.transfer-amount-wrap { display: flex; flex-direction: column; gap: 4px; }
.transfer-preview { background: #ebf4ff; border: 1px solid #bee3f8; border-radius: var(--radius); padding: 10px 16px; margin-top: 12px; font-size: 14px; font-weight: 700; color: #2b6cb0; text-align: center; }

.rate-kg-row { display:flex; gap:4px; align-items:center; margin-top:4px; }
.rate-kg-row .form-control { height:28px; font-size:12px; color:#4a5568; padding:2px 8px; }
.rate-kg-label { font-size:11px; color:#718096; white-space:nowrap; font-weight:600; }
