/* ====================================================
   Daily Closure System — Frontend Styles
   Aesthetic: Refined financial dashboard
   Navy + gold accent on warm paper background
   ==================================================== */

:root {
  --navy: #1F3864;
  --navy-deep: #142646;
  --navy-soft: #2D4D88;
  --ink: #0B1426;
  --paper: #FAFAF7;
  --paper-warm: #F4F2EC;
  --rule: #E5E2D9;
  --rule-soft: #EFEDE6;
  --muted: #6B6F76;
  --muted-soft: #9BA0A8;
  --gold: #B8964A;
  --gold-soft: #F0E6C8;
  --green: #2F7D5B;
  --green-soft: #DCE9DF;
  --amber: #B8731F;
  --amber-soft: #F4E4C8;
  --red: #A8332E;
  --red-soft: #F4D8D6;
  --shadow-soft: 0 1px 2px rgba(11, 20, 38, 0.04), 0 4px 12px rgba(11, 20, 38, 0.04);
  --shadow-card: 0 1px 3px rgba(11, 20, 38, 0.06), 0 8px 24px rgba(11, 20, 38, 0.05);
}

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

html, body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'IBM Plex Sans Arabic', sans-serif;
  font-weight: 400;
  line-height: 1.55;
  font-feature-settings: "kern", "liga";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

/* ========= LOGIN SCREEN ========= */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--navy-deep) 0%, var(--navy) 100%);
  padding: 20px;
}
.login-card {
  background: var(--paper);
  border-radius: 6px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
}
.login-brand {
  text-align: center;
  margin-bottom: 32px;
}
.login-brand .brand-mark {
  width: 56px; height: 56px;
  border: 2px solid var(--gold);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: 'Fraunces', serif;
  font-weight: 600;
  color: var(--gold);
  font-size: 28px;
  margin-bottom: 16px;
}
.login-brand h1 {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: 24px;
  color: var(--navy-deep);
  margin-bottom: 4px;
}
.login-brand p {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 1.2px;
  text-transform: uppercase;
}
#login-form .field { margin-bottom: 16px; }
#login-form button { width: 100%; margin-top: 8px; }
.login-error {
  background: var(--red-soft);
  color: var(--red);
  padding: 10px 14px;
  border-radius: 3px;
  font-size: 13px;
  margin-bottom: 12px;
}

/* ========= TOP BAR ========= */
.topbar {
  background: var(--navy-deep);
  color: var(--paper);
  padding: 18px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
.brand-mark {
  width: 36px; height: 36px;
  border: 1.5px solid var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Fraunces', serif;
  font-weight: 600;
  color: var(--gold);
  font-size: 18px;
}
.brand-text { display: flex; flex-direction: column; }
.brand-title {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: 17px;
}
.brand-sub {
  font-size: 11px;
  color: var(--muted-soft);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  margin-top: 2px;
}
.topbar-meta {
  display: flex;
  gap: 28px;
  align-items: center;
  font-size: 13px;
  color: rgba(255,255,255,0.7);
}
.topbar-meta strong { color: var(--paper); font-weight: 500; }
.topbar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 10px 6px 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 999px;
}
.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), #8C6A2E);
  color: var(--navy-deep);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
}
.logout-btn {
  background: transparent;
  border: none;
  color: var(--muted-soft);
  cursor: pointer;
  padding: 4px 8px;
  font-size: 16px;
  border-radius: 3px;
}
.logout-btn:hover { color: white; background: rgba(255,255,255,0.1); }

/* ========= TABS ========= */
.tabs {
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  padding: 0 40px;
  display: flex;
  gap: 4px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.tab {
  padding: 18px 24px 16px;
  cursor: pointer;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
  user-select: none;
  display: flex; align-items: center; gap: 8px;
  white-space: nowrap;
}
.tab:hover { color: var(--ink); }
.tab.active {
  color: var(--navy);
  border-bottom-color: var(--gold);
}
.tab-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--muted-soft);
  font-weight: 400;
}
.tab.active .tab-num { color: var(--gold); }

/* ========= PAGE ========= */
.page { display: none; padding: 40px; max-width: 1400px; margin: 0 auto; }
.page.active { display: block; }

.page-head {
  margin-bottom: 36px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 16px;
}
.page-head-left { display: flex; flex-direction: column; gap: 6px; }
.eyebrow {
  font-size: 11px;
  color: var(--gold);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 600;
}
.page-title {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: 32px;
  color: var(--navy-deep);
  line-height: 1.2;
  letter-spacing: -0.3px;
}
.page-sub {
  color: var(--muted);
  font-size: 14px;
  margin-top: 4px;
}

/* ========= FORM ========= */
.form-grid { display: flex; flex-direction: column; gap: 28px; }

.card {
  background: white;
  border: 1px solid var(--rule);
  border-radius: 4px;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}
.card-head {
  padding: 18px 28px;
  border-bottom: 1px solid var(--rule);
  background: var(--paper-warm);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.card-head-title {
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.section-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--gold);
  letter-spacing: 0.5px;
}
.card-title {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: 18px;
  color: var(--navy-deep);
}
.card-hint {
  font-size: 12px;
  color: var(--muted);
}
.card-body { padding: 24px 28px; }

.row { display: flex; gap: 24px; align-items: stretch; }
.row + .row { margin-top: 16px; }

.field { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}
.field label .code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  background: var(--paper-warm);
  color: var(--navy);
  padding: 1px 6px;
  border-radius: 3px;
  margin-right: 6px;
  font-weight: 500;
}
.field input, .field select, .field textarea {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 0 14px;
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  transition: border-color 0.15s, background 0.15s;
}
.field input, .field select { height: 40px; }
.field textarea { padding: 12px 14px; min-height: 80px; resize: vertical; line-height: 1.6; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--navy);
  background: white;
  box-shadow: 0 0 0 3px rgba(31, 56, 100, 0.08);
}
.field input[type="number"], .field input.money {
  font-family: 'JetBrains Mono', monospace;
  text-align: left;
  direction: ltr;
}
.field input[readonly] { background: var(--paper-warm); color: var(--navy-deep); font-weight: 500; cursor: not-allowed; }

/* Sales table */
.sales-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.sales-table th, .sales-table td {
  padding: 12px 16px;
  text-align: right;
  font-size: 13px;
  border-bottom: 1px solid var(--rule-soft);
}
.sales-table th {
  color: var(--muted);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--rule);
}
.sales-table .money-cell {
  font-family: 'JetBrains Mono', monospace;
  text-align: left;
  direction: ltr;
  width: 200px;
}
.sales-table input {
  width: 100%;
  background: transparent;
  border: 1px solid transparent;
  padding: 6px 10px;
  font-family: 'JetBrains Mono', monospace;
  text-align: left;
  direction: ltr;
  font-size: 14px;
  color: var(--ink);
  transition: all 0.15s;
  border-radius: 3px;
}
.sales-table input:hover { border-color: var(--rule); }
.sales-table input:focus {
  outline: none;
  border-color: var(--navy);
  background: white;
  box-shadow: 0 0 0 3px rgba(31, 56, 100, 0.08);
}
.sales-table .row-divider { background: var(--paper-warm); }
.sales-table .row-divider td { padding: 8px 16px; font-size: 11px; color: var(--muted); letter-spacing: 1px; text-transform: uppercase; font-weight: 500; }
.sales-table .row-total td { background: var(--paper-warm); font-weight: 600; color: var(--navy-deep); }
.sales-table .row-total .money-cell { font-size: 15px; }
.sales-table .row-info td { background: rgba(184, 150, 74, 0.06); font-style: italic; color: var(--muted); }
.sales-table .row-deferred td { background: rgba(168, 51, 46, 0.04); }

.badge-code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: 500;
  margin-right: 6px;
  background: var(--paper-warm);
  color: var(--navy);
}
.badge-code.info { background: var(--gold-soft); color: var(--amber); }
.badge-code.deferred { background: var(--red-soft); color: var(--red); }

/* Repeater */
.repeater { display: flex; flex-direction: column; gap: 8px; }
.repeater-row {
  display: grid;
  grid-template-columns: 2fr 1.4fr 1.2fr auto;
  gap: 12px;
  align-items: center;
}
.repeater-row.cust-row { grid-template-columns: 2fr 1.4fr auto; }
.repeater-row input, .repeater-row select {
  height: 36px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 0 12px;
  font-size: 13px;
  font-family: inherit;
}
.repeater-row input.money {
  font-family: 'JetBrains Mono', monospace;
  direction: ltr;
  text-align: left;
}
.repeater-row input:focus, .repeater-row select:focus {
  outline: none; border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(31, 56, 100, 0.08);
  background: white;
}
.btn-icon {
  width: 36px; height: 36px;
  border: 1px solid var(--rule);
  background: var(--paper);
  border-radius: 3px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted);
  transition: all 0.15s;
}
.btn-icon:hover { color: var(--red); border-color: var(--red); background: white; }
.add-row-btn {
  align-self: flex-start;
  background: transparent;
  border: 1px dashed var(--rule);
  color: var(--muted);
  padding: 8px 14px;
  font-size: 12px;
  border-radius: 3px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
  margin-top: 4px;
}
.add-row-btn:hover { border-color: var(--navy); color: var(--navy); border-style: solid; }

.subtotal-bar {
  margin-top: 16px;
  padding: 14px 18px;
  background: var(--paper-warm);
  border-radius: 3px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.subtotal-bar .label { font-size: 13px; color: var(--navy-deep); font-weight: 500; }
.subtotal-bar .label .code-inline {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--gold);
  margin-left: 6px;
}
.subtotal-bar .value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 16px;
  font-weight: 600;
  color: var(--navy-deep);
  direction: ltr;
}

/* Reconciliation */
.recon-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.recon-table td {
  padding: 11px 18px;
  font-size: 13px;
  border-bottom: 1px solid var(--rule-soft);
}
.recon-table td:last-child {
  font-family: 'JetBrains Mono', monospace;
  text-align: left;
  direction: ltr;
  width: 200px;
  font-weight: 500;
}
.recon-table tr.total td { background: var(--paper-warm); font-weight: 600; }
.recon-table tr.total td:last-child { font-size: 15px; color: var(--navy-deep); }
.recon-table tr.real-cash td { background: var(--navy-deep); color: white; }
.recon-table tr.real-cash td:last-child { font-size: 17px; color: var(--gold); }
.recon-table .input-cell input {
  background: transparent;
  border: 1px solid transparent;
  padding: 6px 10px;
  font-family: 'JetBrains Mono', monospace;
  text-align: left;
  direction: ltr;
  font-size: 14px;
  width: 100%;
  border-radius: 3px;
  transition: all 0.15s;
}
.recon-table .input-cell input:hover { border-color: var(--rule); }
.recon-table .input-cell input:focus {
  outline: none; border-color: var(--navy); background: white;
  box-shadow: 0 0 0 3px rgba(31, 56, 100, 0.08);
}

/* Checks */
.checks-grid { display: grid; grid-template-columns: 1fr; gap: 8px; }
.check-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 3px;
  border-right: 3px solid var(--rule);
  transition: all 0.2s;
}
.check-row.pass { border-right-color: var(--green); background: var(--green-soft); }
.check-row.fail { border-right-color: var(--red); background: var(--red-soft); }
.check-label { font-size: 13px; color: var(--ink); }
.check-label strong { font-family: 'JetBrains Mono', monospace; font-weight: 600; color: var(--navy); margin-left: 8px; }
.check-status {
  font-size: 12px;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  padding: 4px 10px;
  border-radius: 3px;
}
.check-row.pass .check-status { background: var(--green); color: white; }
.check-row.fail .check-status { background: var(--red); color: white; }
.check-row.pending .check-status { background: var(--rule); color: var(--muted); }

/* Overall status */
.overall {
  margin-top: 24px;
  padding: 24px 28px;
  border-radius: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--paper-warm);
  color: var(--muted);
}
.overall.ready {
  background: linear-gradient(135deg, var(--green) 0%, #246548 100%);
  color: white;
}
.overall.notready {
  background: linear-gradient(135deg, var(--red) 0%, #8C2A26 100%);
  color: white;
}
.overall-title { display: flex; flex-direction: column; gap: 4px; }
.overall-title .label { font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; opacity: 0.85; }
.overall-title .status {
  font-family: 'Fraunces', serif;
  font-size: 24px;
  font-weight: 500;
}
.overall-icon {
  width: 56px; height: 56px;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
}
.overall:not(.ready):not(.notready) .overall-icon { border-color: var(--rule); }

.declaration {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 18px;
  padding: 14px 18px;
  background: var(--paper-warm);
  border-radius: 3px;
}

.submit-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  border-top: 1px solid var(--rule);
  margin-top: 12px;
}
.btn-primary {
  background: var(--navy-deep);
  color: white;
  padding: 12px 28px;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  transition: background 0.15s;
}
.btn-primary:hover:not(:disabled) { background: var(--navy); }
.btn-primary:disabled { background: var(--muted-soft); cursor: not-allowed; }
.btn-secondary {
  background: transparent;
  color: var(--navy-deep);
  padding: 12px 24px;
  border: 1px solid var(--rule);
  border-radius: 3px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
}
.btn-secondary:hover { border-color: var(--navy); }

.submit-message {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 3px;
  font-size: 13px;
}
.submit-message.success { background: var(--green-soft); color: var(--green); }
.submit-message.error { background: var(--red-soft); color: var(--red); }

/* ========= MATRIX ========= */
.matrix-wrap { overflow-x: auto; background: white; border: 1px solid var(--rule); border-radius: 4px; box-shadow: var(--shadow-soft); }
.matrix { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 900px; }
.matrix th, .matrix td {
  padding: 0; text-align: center; border-bottom: 1px solid var(--rule-soft);
}
.matrix th {
  background: var(--paper-warm);
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.3px;
  padding: 14px 8px;
  border-bottom: 1px solid var(--rule);
  white-space: nowrap;
}
.matrix th.branch-col {
  text-align: right; padding-right: 20px; width: 140px;
  position: sticky; right: 0; background: var(--paper-warm); z-index: 2;
  text-transform: uppercase; letter-spacing: 1px;
}
.matrix th .date-day {
  font-family: 'Fraunces', serif; font-weight: 500; font-size: 14px;
  color: var(--navy-deep); display: block; text-transform: none;
  letter-spacing: 0; line-height: 1; margin-bottom: 2px;
}
.matrix th .date-mon {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px; color: var(--muted); letter-spacing: 0.5px;
}
.matrix th.today { background: var(--navy-deep); }
.matrix th.today .date-day { color: white; }
.matrix th.today .date-mon { color: var(--gold); }

.matrix td.branch-cell {
  text-align: right; padding: 14px 20px;
  font-weight: 500; font-size: 13px; color: var(--navy-deep);
  background: white; position: sticky; right: 0;
  border-left: 1px solid var(--rule); z-index: 1;
}
.matrix td.cell { padding: 6px; cursor: pointer; position: relative; }
.matrix .dot {
  width: 24px; height: 24px;
  border-radius: 2px;
  margin: 0 auto;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.15s, box-shadow 0.15s;
  cursor: pointer;
}
.matrix .dot:hover {
  transform: scale(1.15);
  box-shadow: 0 4px 12px rgba(11, 20, 38, 0.15);
  z-index: 5;
}
.dot.clean { background: var(--green); }
.dot.variance { background: var(--amber); }
.dot.missing { background: var(--red-soft); border: 1px dashed var(--red); }
.dot.future { background: var(--rule-soft); }

.legend {
  display: flex; gap: 20px; align-items: center;
  margin-top: 20px; font-size: 12px; color: var(--muted);
  flex-wrap: wrap;
}
.legend-item { display: flex; align-items: center; gap: 8px; }
.legend-item .dot { width: 14px; height: 14px; cursor: default; }
.legend-item .dot:hover { transform: none; box-shadow: none; }

/* ========= REPORT 2 ========= */
.hero-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px;
  margin-bottom: 32px;
}
.hero-card {
  background: white;
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 24px 28px;
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
}
.hero-card.dark {
  background: linear-gradient(135deg, var(--navy-deep) 0%, #0F1E37 100%);
  color: white;
  border-color: var(--navy-deep);
}
.hero-card .label {
  font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--muted); font-weight: 500; margin-bottom: 12px;
}
.hero-card.dark .label { color: var(--gold); }
.hero-card .value {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: 38px;
  color: var(--navy-deep);
  direction: ltr;
  text-align: left;
  line-height: 1.1;
  letter-spacing: -0.5px;
}
.hero-card.dark .value { color: white; }
.hero-card .unit { font-size: 14px; color: var(--muted); margin-right: 6px; font-weight: 400; }
.hero-card .delta {
  margin-top: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px; color: var(--muted);
  direction: ltr; text-align: left;
}
.hero-card .delta.pos { color: var(--green); }
.hero-card .delta.neg { color: var(--red); }
.hero-card.dark .delta { color: rgba(255,255,255,0.7); }

.branch-list {
  background: white;
  border: 1px solid var(--rule);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}
.branch-list table { width: 100%; border-collapse: separate; border-spacing: 0; }
.branch-list th {
  background: var(--paper-warm);
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: right;
  padding: 14px 24px;
  border-bottom: 1px solid var(--rule);
}
.branch-list th.num { text-align: left; }
.branch-list td {
  padding: 18px 24px;
  border-bottom: 1px solid var(--rule-soft);
  font-size: 14px;
  color: var(--ink);
}
.branch-list tr:last-child td { border-bottom: none; }
.branch-list tr:hover td { background: var(--paper); }
.branch-list td.num {
  font-family: 'JetBrains Mono', monospace;
  text-align: left;
  direction: ltr;
  font-weight: 500;
}
.branch-list .branch-name { font-weight: 500; color: var(--navy-deep); }

.status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 500;
  font-family: 'JetBrains Mono', monospace;
}
.status-pill::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
}
.status-pill.clean { background: var(--green-soft); color: var(--green); }
.status-pill.clean::before { background: var(--green); }
.status-pill.variance { background: var(--amber-soft); color: var(--amber); }
.status-pill.variance::before { background: var(--amber); }
.status-pill.missing { background: var(--red-soft); color: var(--red); }
.status-pill.missing::before { background: var(--red); }

/* ========= REPORT 3 ========= */
.recv-grid {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 24px;
  margin-bottom: 24px;
}
.recv-summary {
  background: linear-gradient(160deg, var(--navy-deep) 0%, #0F1E37 100%);
  border-radius: 4px;
  padding: 32px;
  color: white;
  box-shadow: var(--shadow-card);
}
.recv-summary .eyebrow { color: var(--gold); }
.recv-summary .value {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: 52px;
  line-height: 1;
  margin: 12px 0 8px;
  direction: ltr; text-align: left;
  letter-spacing: -1px;
}
.recv-summary .unit { font-size: 16px; color: rgba(255,255,255,0.6); margin-right: 8px; font-weight: 400; }
.recv-summary .breakdown {
  margin-top: 28px; padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex; flex-direction: column; gap: 14px;
}
.recv-summary .breakdown-row {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 13px;
}
.recv-summary .breakdown-row .label { color: rgba(255,255,255,0.7); }
.recv-summary .breakdown-row .num {
  font-family: 'JetBrains Mono', monospace;
  direction: ltr; font-weight: 500;
}

.recv-bars {
  background: white;
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 28px;
  box-shadow: var(--shadow-soft);
}
.bar-header {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: 16px;
  color: var(--navy-deep);
  margin-bottom: 20px;
}
.bar-row {
  display: flex; align-items: center;
  gap: 16px; margin-bottom: 14px;
}
.bar-row:last-child { margin-bottom: 0; }
.bar-label { width: 80px; font-size: 13px; color: var(--navy-deep); font-weight: 500; }
.bar-track {
  flex: 1; height: 26px;
  background: var(--paper);
  border-radius: 2px;
  position: relative; overflow: hidden;
  border: 1px solid var(--rule-soft);
}
.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--navy) 0%, var(--navy-soft) 100%);
  transition: width 0.6s ease;
  position: relative;
}
.bar-fill::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(184, 150, 74, 0.4) 100%);
}
.bar-value {
  width: 140px;
  font-family: 'JetBrains Mono', monospace;
  direction: ltr; text-align: left;
  font-size: 13px; font-weight: 500;
  color: var(--navy-deep);
}

.recv-trend {
  background: white;
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 28px;
  box-shadow: var(--shadow-soft);
}
.trend-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  margin-bottom: 20px;
}
.trend-title {
  font-family: 'Fraunces', serif; font-weight: 500;
  font-size: 16px; color: var(--navy-deep);
}
.trend-sub { font-size: 12px; color: var(--muted); }
.sparkline-row {
  display: flex; gap: 16px;
  overflow-x: auto; padding-bottom: 8px;
}
.sparkline-card {
  flex: 0 0 220px;
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 16px 18px;
}
.sparkline-card .name { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.sparkline-card .num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 18px; font-weight: 500;
  color: var(--navy-deep);
  direction: ltr; text-align: left;
  margin-bottom: 10px;
}
.sparkline-svg { width: 100%; height: 40px; }

/* Modal */
.modal-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(11, 20, 38, 0.5);
  backdrop-filter: blur(3px);
  z-index: 100;
  justify-content: center; align-items: center;
}
.modal-backdrop.show { display: flex; }
.modal {
  background: var(--paper);
  border-radius: 4px;
  padding: 36px;
  max-width: 520px;
  width: calc(100% - 40px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.modal h3 {
  font-family: 'Fraunces', serif; font-weight: 500;
  font-size: 20px; color: var(--navy-deep);
  margin-bottom: 6px;
}
.modal .sub { font-size: 13px; color: var(--muted); margin-bottom: 20px; }
.modal-row {
  display: flex; justify-content: space-between;
  padding: 10px 0; font-size: 13px;
  border-bottom: 1px solid var(--rule-soft);
}
.modal-row:last-of-type { border-bottom: none; }
.modal-row .l { color: var(--muted); }
.modal-row .v {
  font-family: 'JetBrains Mono', monospace;
  direction: ltr; color: var(--navy-deep); font-weight: 500;
}
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.modal-status {
  margin: 12px 0 20px;
  padding: 10px 14px;
  border-radius: 3px;
  font-size: 12px;
}
.modal-status.clean { background: var(--green-soft); color: var(--green); }
.modal-status.variance { background: var(--amber-soft); color: var(--amber); }
.modal-status.missing { background: var(--red-soft); color: var(--red); }

/* Responsive */
@media (max-width: 1100px) {
  .hero-row { grid-template-columns: 1fr; }
  .recv-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .topbar, .tabs, .page { padding-left: 20px; padding-right: 20px; }
  .row { flex-direction: column; gap: 16px; }
  .topbar-meta { display: none; }
  .page-title { font-size: 24px; }
  .repeater-row { grid-template-columns: 1fr; gap: 6px; }
  .sales-table th, .sales-table td { padding: 8px 10px; font-size: 12px; }
  .sales-table .money-cell { width: auto; }
}
