@font-face {
  font-family: 'Noto Sans Arabic';
  src: url('../fonts/NotoSansArabic-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Noto Sans Arabic';
  src: url('../fonts/NotoSansArabic-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Noto Sans Arabic';
  src: url('../fonts/NotoSansArabic-SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Noto Sans Arabic';
  src: url('../fonts/NotoSansArabic-Bold.ttf') format('truetype');
  font-weight: 700 900;
  font-style: normal;
  font-display: swap;
}

/* ===== Mezan design tokens =====
   Brand: ARIX navy / blue / cyan. The ميزان logo uses the same palette so
   the installed app icon, authentication, dashboard and all screens share
   one visual identity. */
:root {
  /* ARIX brand palette */
  --navy:      #081F44;  /* primary */
  --navy-700:  #0d2c5c;
  --blue:      #2563EB;  /* secondary — main interactive color */
  --blue-600:  #1d4ed8;
  --teal:      #06B6D4;  /* accent */
  --lightgray: #E5E7EB;  /* background */
  --charcoal:  #1F2937;  /* text */

  --brand-50:  #EEF3FF;
  --brand-100: #D8E4FE;
  --brand-500: #2563EB;
  --brand-600: #1d4ed8;
  --brand-700: #081F44;
  --brand-teal: #06B6D4;

  --amber-500: #f59e0b;
  --amber-100: #fef3c7;
  --red-500:   #dc2626;
  --red-100:   #fee2e2;

  --bg: #F3F4F6;
  --surface: #ffffff;
  --surface-2: #EDEFF2;
  --border: #E2E5EA;
  --text: #1F2937;
  --text-muted: #6b7280;
  --text-faint: #9aa3ae;

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-1: 0 1px 2px rgba(8,31,68,0.06), 0 1px 1px rgba(8,31,68,0.04);
  --shadow-2: 0 8px 24px rgba(8,31,68,0.16);

  --font-ar: 'Noto Sans Arabic', 'Tajawal', 'Inter', 'Segoe UI', system-ui, sans-serif;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

[data-theme="dark"] {
  --bg: #0a0f1a;
  --surface: #101828;
  --surface-2: #162033;
  --border: #223049;
  --text: #eef2f6;
  --text-muted: #97a3b8;
  --text-faint: #647085;
  --brand-50: #0e1f3d;
  --brand-100: #14294f;
  --amber-100: #3a2c0d;
  --red-100: #3a1414;
  --shadow-2: 0 8px 28px rgba(0,0,0,0.5);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ar);
  direction: rtl;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: contain;
}
#app {
  max-width: 520px;
  margin: 0 auto;
  min-height: 100dvh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  position: relative;
}
button, input, select, textarea { font-family: inherit; }
button { cursor: pointer; }
a { text-decoration: none; color: inherit; }

.hidden { display: none !important; }
.muted { color: var(--text-muted); }
.small { font-size: 12.5px; }
.center { text-align: center; }
.grow { flex: 1; }

/* ---------- App shell ---------- */
.view-outlet {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  /* --nav-h is the bottom nav's *real, measured* height (set in router.js),
     so the last interactive element on every screen always clears it,
     on any device, without relying on a guessed pixel value. */
  padding-bottom: calc(var(--nav-h, 96px) + 24px);
  scroll-padding-bottom: calc(var(--nav-h, 96px) + 24px);
  -webkit-overflow-scrolling: touch;
}
.screen { display: flex; flex-direction: column; min-height: 100%; }
.screen-body { padding: 14px 16px 24px; display: flex; flex-direction: column; gap: 10px; }
.section { padding: 4px 0 10px; }
.section-title { font-size: 13px; font-weight: 700; color: var(--text-muted); margin: 14px 2px 4px; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(14px + var(--safe-top)) 16px 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 5;
}
.topbar-title { font-size: 19px; font-weight: 800; min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-inline-end: 4px; }
.topbar-sub { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
.topbar-date { font-size: 12.5px; color: var(--text-muted); }

/* Brand presence: the Mezan logo is visible throughout the authenticated app. */
.topbar { padding-inline-start: 86px; position: sticky; }
.topbar > * { min-width: 0; }
.topbar::before {
  content: ''; position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
  width: 58px; height: 42px; background-color: #fff; border-radius: 10px; background-image: url('../icons/mezan-logo.png'); background-position: center; background-size: contain; background-repeat: no-repeat;
  pointer-events: none;
}
.app-logo { width: 126px; height: auto; display: block; object-fit: contain; }
.app-logo-small { width: 82px; height: auto; display: block; object-fit: contain; }
.brand-mark-image { width: 118px; height: 118px; object-fit: contain; display: block; background: #fff; border-radius: 20px; padding: 6px; box-shadow: 0 8px 22px rgba(8,31,68,.12); }

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(37,99,235,.45); outline-offset: 2px;
}

/* ---------- Product icon (thumbnail from a product's photo) ---------- */
.product-icon {
  flex-shrink: 0; width: 40px; height: 40px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border);
}
.product-icon.sm { width: 34px; height: 34px; }
.product-icon.lg { width: 64px; height: 64px; border-radius: var(--radius-md); }
.product-icon.placeholder { display: flex; align-items: center; justify-content: center; font-size: 18px; }
.product-icon.lg.placeholder { font-size: 26px; }

/* ---------- Buttons ---------- */
.btn {
  border: none; border-radius: var(--radius-md);
  padding: 13px 18px; font-size: 15px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: transform .06s ease, opacity .15s ease;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: var(--radius-sm); }
.btn-primary { background: var(--brand-600); color: #fff; }
.btn-outline { background: var(--surface); color: var(--brand-600); border: 1.5px solid var(--brand-600); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-danger { background: var(--red-500); color: #fff; }
.btn-danger-outline { background: var(--surface); color: var(--red-500); border: 1.5px solid var(--red-500); }
.btn-icon { padding: 12px; }

/* ---------- Inputs ---------- */
.input {
  width: 100%; padding: 12px 14px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border); background: var(--surface); color: var(--text);
  font-size: 15px; outline: none;
}
.input:focus { border-color: var(--brand-500); }
.input.big { font-size: 22px; font-weight: 800; text-align: center; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 4px; }
.field-label { font-size: 12.5px; font-weight: 700; color: var(--text-muted); }
.field-inline { display: flex; align-items: center; gap: 8px; font-size: 14px; margin: 6px 0; }

/* ---------- Dashboard (wallet-app style home screen) ---------- */
.dash-header {
  background: linear-gradient(135deg, var(--navy) 0%, var(--blue) 100%);
  padding: calc(18px + var(--safe-top)) 18px 46px;
  color: #fff;
  display: flex; align-items: center; justify-content: space-between;
}
.dash-greeting-name { font-size: 17px; font-weight: 800; }
.dash-greeting-sub { font-size: 12.5px; opacity: .82; margin-top: 2px; }
.dash-avatar-btn { background: none; border: none; padding: 0; line-height: 0; }
.avatar.md { width: 42px; height: 42px; font-size: 16px; }
.dash-body { padding: 0 16px 24px; margin-top: -32px; display: flex; flex-direction: column; gap: 10px; }

.hero-card {
  border-radius: var(--radius-lg);
  background: linear-gradient(120deg, var(--navy) 0%, var(--blue) 62%, var(--teal) 130%);
  color: #fff; padding: 20px; box-shadow: var(--shadow-2);
  display: flex; flex-direction: column; gap: 10px;
}
.hero-label { font-size: 12.5px; opacity: .85; font-weight: 700; }
.hero-top-row { display: flex; justify-content: space-between; align-items: center; }
.hero-eye-btn { background: rgba(255,255,255,0.18); border: none; color: #fff; border-radius: 999px; width: 30px; height: 30px; font-size: 14px; display: flex; align-items: center; justify-content: center; padding: 0; }
.hero-value { font-size: 30px; font-weight: 800; }
.hero-footer { display: flex; justify-content: space-between; align-items: center; font-size: 12px; opacity: .9; padding-top: 6px; border-top: 1px solid rgba(255,255,255,0.22); }
.hero-badge { background: rgba(255,255,255,0.18); padding: 4px 10px; border-radius: 999px; font-weight: 700; }

.pill-row { display: flex; gap: 10px; }
.pill-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
  padding: 10px 6px; font-size: 11.5px; font-weight: 700; color: var(--text);
  box-shadow: var(--shadow-1);
}
.pill-icon { font-size: 17px; }
.pill-btn .pill-badge {
  position: relative; top: -14px; right: -14px; background: var(--red-500); color: #fff;
  font-size: 9.5px; font-weight: 800; border-radius: 999px; padding: 1px 5px; margin-bottom: -14px;
}

.quick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.quick-tile {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 14px 6px; display: flex; flex-direction: column; align-items: center; gap: 8px;
  box-shadow: var(--shadow-1);
}
.quick-tile-icon {
  width: 40px; height: 40px; border-radius: 12px; background: var(--brand-50);
  display: flex; align-items: center; justify-content: center; font-size: 19px;
}
.quick-tile-label { font-size: 11.5px; font-weight: 700; color: var(--text); text-align: center; }
.section-header-row { display: flex; justify-content: space-between; align-items: center; margin: 14px 2px 4px; }
.section-link { font-size: 12.5px; font-weight: 700; color: var(--blue); }

/* ---------- KPI (used on Reports) ---------- */
.kpi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kpi-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 14px; display: flex; align-items: center; gap: 10px; box-shadow: var(--shadow-1);
}
.kpi-icon { font-size: 20px; }
.kpi-value { font-size: 18px; font-weight: 800; }
.kpi-label { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.quick-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.quick-action {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 12px 4px; display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.quick-icon { font-size: 20px; }
.quick-label { font-size: 11px; font-weight: 700; color: var(--text-muted); }

.alert-card {
  border-radius: var(--radius-md); padding: 14px; display: flex; flex-direction: column; gap: 3px;
  border: 1px solid var(--border);
}
.alert-card.ok { background: var(--brand-50); border-color: var(--brand-100); }
.alert-card.warn { background: var(--amber-100); border-color: #f3d38a; }
.alert-title { font-weight: 800; font-size: 14.5px; }
.alert-desc { font-size: 12.5px; color: var(--text-muted); }

.list-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 13px 14px;
}
.row-title { font-weight: 700; font-size: 14.5px; }
.row-icon { font-size: 18px; }
.chevron { color: var(--text-faint); font-size: 18px; transform: scaleX(-1); }
.badge { font-size: 11.5px; font-weight: 800; padding: 4px 9px; border-radius: 999px; }
.badge.warn { background: var(--amber-100); color: #92620a; }
.badge.danger { background: var(--red-100); color: var(--red-500); }

.tabs { display: flex; gap: 6px; padding: 10px 16px; overflow-x: auto; background: var(--surface); border-bottom: 1px solid var(--border); }
.tabs.sub { padding: 0 0 10px; border: none; background: transparent; }
.tab {
  flex-shrink: 0; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text-muted); font-size: 13px; font-weight: 700;
}
.tab.active { background: var(--brand-600); color: #fff; border-color: var(--brand-600); }

/* ---------- Auth screens ---------- */
.auth-screen { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; gap: 18px; }
.brand-header { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-bottom: 4px; }
.brand-mark {
  width: 56px; height: 56px; border-radius: 16px; background: var(--brand-600); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 800;
}
.brand-name { font-size: 20px; font-weight: 800; margin-top: 6px; }
.brand-sub { font-size: 12px; color: var(--text-muted); }
.auth-card { width: 100%; max-width: 360px; background: var(--surface); border-radius: var(--radius-lg); padding: 22px; box-shadow: var(--shadow-1); border: 1px solid var(--border); }
.auth-card h2 { margin: 0 0 4px; font-size: 19px; }
.hint-center { text-align: center; font-size: 12px; color: var(--text-faint); margin-top: 10px; }
.error-text { color: var(--red-500); font-size: 13px; text-align: center; font-weight: 700; }
.user-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.user-chip {
  display: flex; align-items: center; gap: 10px; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 10px 12px; font-weight: 700;
}
.avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--brand-100); color: var(--brand-700);
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 15px;
}
.avatar.lg { width: 56px; height: 56px; font-size: 22px; margin: 0 auto; }
.avatar-edit-wrap { position: relative; width: 56px; margin: 0 auto; }
.avatar-edit-badge {
  position: absolute; bottom: -2px; left: -6px; width: 26px; height: 26px; border-radius: 50%;
  background: var(--blue); color: #fff; border: 2px solid var(--surface); font-size: 12px;
  display: flex; align-items: center; justify-content: center; padding: 0;
}

/* ---------- PIN pad ---------- */
.pinpad-wrap { display: flex; flex-direction: column; align-items: center; gap: 20px; margin-top: 10px; }
.pin-dots { display: flex; gap: 10px; }
.pin-dot { width: 13px; height: 13px; border-radius: 50%; border: 2px solid var(--border); }
.pin-dot.filled { background: var(--brand-600); border-color: var(--brand-600); }
.pin-pad {
  display: grid;
  grid-template-columns: repeat(3, 64px);
  gap: 12px;
  /* Arabic page is RTL, but numeric keypads must retain the universal
     calculator/phone layout: 1-2-3 / 4-5-6 / 7-8-9. */
  direction: ltr;
}
.pin-key {
  width: 64px; height: 64px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface-2);
  font-size: 22px; font-weight: 700; color: var(--text);
}
.pin-key:active { background: var(--brand-100); }
.pin-key-text { font-size: 14px; font-weight: 700; color: var(--text-muted); }

/* ---------- Modals / sheets ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(10,14,12,0.45); z-index: 50;
  display: flex; align-items: flex-end; justify-content: center;
}
.modal-card {
  width: 100%; max-width: 520px; background: var(--surface); border-radius: 22px 22px 0 0;
  padding: 20px 18px calc(20px + var(--safe-bottom)); max-height: 88vh; overflow-y: auto;
  box-shadow: var(--shadow-2); display: flex; flex-direction: column; gap: 10px;
  animation: sheet-up .18s ease-out;
}
@keyframes sheet-up { from { transform: translateY(24px); opacity: 0 } to { transform: translateY(0); opacity: 1 } }
.modal-card h3 { margin: 0 0 2px; font-size: 17px; }
.modal-msg { font-size: 14px; color: var(--text-muted); margin: 0; }
.modal-actions { display: flex; gap: 10px; margin-top: 8px; }
.modal-actions .btn { flex: 1; }

/* ---------- POS ---------- */
.pos-search { display: flex; gap: 8px; padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--border); }
.pos-results { padding: 0 16px; display: flex; flex-direction: column; gap: 8px; max-height: 40vh; overflow-y: auto; }
.product-row {
  display: flex; justify-content: space-between; align-items: center; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-md); padding: 12px 14px;
}
.product-row-name { font-weight: 700; font-size: 14.5px; }
.product-row-price { color: var(--brand-600); font-weight: 800; }

.cart-bar {
  position: sticky; bottom: var(--nav-h, 96px); background: var(--surface); border-top: 1px solid var(--border);
  padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; margin-top: auto;
  box-shadow: 0 -2px 10px rgba(8,31,68,0.08);
}
.cart-summary { display: flex; justify-content: space-between; align-items: center; padding: 4px 2px; }
.cart-count { font-size: 13px; color: var(--text-muted); font-weight: 700; }
.cart-total { font-size: 19px; font-weight: 800; }

.unit-list { display: flex; flex-direction: column; gap: 8px; margin: 6px 0; }
.unit-option {
  display: flex; justify-content: space-between; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 14px; font-weight: 700;
}
.cart-line { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.cart-line-main { flex: 1; }
.qty-stepper { display: flex; align-items: center; gap: 8px; }
.qty-input { width: 56px; text-align: center; padding: 6px 2px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2); font-weight: 700; font-size: 14px; }
.step-btn { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2); font-size: 18px; font-weight: 800; }
.icon-btn { border: none; background: transparent; font-size: 17px; padding: 6px; }
.icon-btn.danger { color: var(--red-500); }

.checkout-total { font-size: 26px; font-weight: 800; text-align: center; padding: 6px 0; color: var(--brand-600); }
.change-line { text-align: center; font-size: 13.5px; font-weight: 700; color: var(--text-muted); margin-top: -4px; }

.invoice-preview {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow-2);
  max-height: 58vh;
  overflow-y: auto;
}
.invoice-preview canvas { max-width: 100%; }
.invoice-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.invoice-actions .btn:first-child { grid-column: 1 / -1; }
.invoice-preview canvas { display: block; width: 100%; height: auto; }
.success-icon { font-size: 40px; text-align: center; }

/* ---------- Scanner ---------- */
.scanner-overlay { align-items: stretch; background: #000; }
.scanner-overlay video { width: 100%; height: 100%; object-fit: cover; }
.scanner-close { position: absolute; top: calc(20px + var(--safe-top)); left: 20px; background: rgba(255,255,255,0.15); color: #fff; border-radius: 999px; padding: 10px 18px; }
.scanner-hint { position: absolute; top: calc(20px + var(--safe-top)); right: 20px; left: 140px; color: #fff; background: rgba(0,0,0,0.35); border-radius: 999px; padding: 10px 16px; text-align: center; font-size: 14px; }
.scanner-manual { position: absolute; bottom: calc(24px + var(--safe-bottom)); right: 20px; left: 20px; background: rgba(255,255,255,0.15); color: #fff; border-color: rgba(255,255,255,0.4); }

/* ---------- Units editor / stock-in ---------- */
.units-editor { display: flex; flex-direction: column; gap: 8px; }
.unit-row-card { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 12px; display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; background: var(--surface); }
.stockin-line { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 10px; display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; background: var(--surface); }
.stockin-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: center; }
.batch-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }

.statement-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.amount-debit { color: var(--red-500); font-weight: 800; }
.amount-credit { color: var(--brand-600); font-weight: 800; }

.user-card { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 14px; }
.about-card { background: var(--surface-2); border-radius: var(--radius-md); padding: 14px; font-size: 13.5px; }

/* ---------- Misc ---------- */
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 44px 20px; color: var(--text-muted); text-align: center; }
.empty-state.small { padding: 20px; font-size: 13px; }
.empty-icon { font-size: 30px; }
.skeleton-block { height: 120px; border-radius: var(--radius-md); background: linear-gradient(90deg, var(--surface-2) 25%, var(--border) 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { 0% { background-position: 100% 0 } 100% { background-position: 0 0 } }

.spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid var(--border); border-top-color: var(--brand-600);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

#toast-host { position: fixed; top: calc(14px + var(--safe-top)); left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px); }
.toast {
  background: var(--text); color: var(--bg); padding: 12px 16px; border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 700; opacity: 0; transform: translateY(-8px); transition: all .2s ease; text-align: center;
  box-shadow: var(--shadow-2);
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-success { background: var(--brand-teal); color: #06222b; }
.toast-error { background: var(--red-500); color: #fff; }
.toast-info { background: var(--text); }

/* ---------- Management reporting hub ---------- */
.reports-body { gap: 12px; padding-bottom: 30px; }
.report-tabs { position: sticky; top: 0; z-index: 6; }
.report-range { display:flex; gap:6px; overflow-x:auto; padding-bottom:2px; }
.report-range .tab { font-size:12px; padding:7px 12px; }
.report-kpi-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:10px; }
.report-kpi { min-height:86px; padding:13px; border:1px solid var(--border); border-radius:18px; background:var(--surface); box-shadow:var(--shadow-1); display:flex; align-items:center; gap:10px; }
.report-kpi.hero-kpi { background:linear-gradient(135deg,var(--navy),var(--brand-600)); color:#fff; border-color:transparent; }
.report-kpi.hero-kpi .report-kpi-label { color:rgba(255,255,255,.75); }
.report-kpi.profit-kpi { border-color:var(--brand-100); }
.report-kpi.debt-kpi { border-color:#e9caca; }
.report-kpi-icon { font-size:21px; }
.report-kpi-value { font-size:17px; font-weight:900; line-height:1.2; }
.report-kpi-label { margin-top:5px; color:var(--text-muted); font-size:11.5px; font-weight:700; }
.report-insight { border:1px solid var(--brand-100); background:var(--brand-50); border-radius:16px; padding:13px 14px; display:flex; gap:8px; align-items:center; font-size:12.5px; }
.report-section { display:flex; flex-direction:column; gap:8px; }
.report-section-head { display:flex; justify-content:space-between; align-items:center; }
.report-section .section-title { margin:8px 2px 2px; }
.mini-chart { display:flex; align-items:flex-end; gap:5px; height:170px; padding:14px 8px 8px; border:1px solid var(--border); border-radius:18px; background:var(--surface); overflow-x:auto; }
.chart-col { min-width:28px; height:100%; display:flex; flex-direction:column; justify-content:flex-end; align-items:center; gap:4px; }
.chart-bar-wrap { width:18px; height:105px; display:flex; align-items:flex-end; }
.chart-bar { width:100%; min-height:4px; border-radius:7px 7px 3px 3px; background:var(--brand-600); }
.chart-label { font-size:9px; color:var(--text-faint); }
.chart-value { font-size:7px; color:var(--text-faint); max-width:38px; overflow:hidden; white-space:nowrap; }
.report-mix { background:var(--surface); border:1px solid var(--border); border-radius:18px; padding:12px 14px; display:flex; flex-direction:column; gap:13px; }
.mix-head { display:flex; justify-content:space-between; gap:8px; font-size:12px; }
.mix-track { height:8px; border-radius:99px; background:var(--surface-2); overflow:hidden; margin-top:6px; }
.mix-fill { height:100%; border-radius:99px; background:var(--teal); }
.report-two-col { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.report-mini-card { min-width:0; border:1px solid var(--border); border-radius:18px; background:var(--surface); padding:12px; }
.report-mini-title { font-weight:800; font-size:13px; margin-bottom:8px; }
.report-list { display:flex; flex-direction:column; gap:7px; }
.report-row { display:flex; justify-content:space-between; align-items:center; gap:8px; padding:11px 12px; border:1px solid var(--border); border-radius:13px; background:var(--surface); }
.report-mini-card .report-row { padding:9px 0; border:0; border-bottom:1px solid var(--border); border-radius:0; }
.report-mini-card .report-row:last-child { border-bottom:0; }
.report-row-value { font-size:12px; font-weight:800; text-align:left; color:var(--text-muted); }
.report-alert-grid { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.report-alert { border:1px solid var(--border); background:var(--surface); border-radius:16px; padding:12px; }
.report-alert:last-child { grid-column:1/-1; }
.report-alert.warn { background:var(--amber-100); border-color:#f3d38a; }
.report-alert.ok { background:var(--brand-50); border-color:var(--brand-100); }
.report-alert-title { font-size:13px; font-weight:800; margin-bottom:4px; }
.report-cash-banner { display:flex; justify-content:space-between; align-items:center; gap:10px; padding:14px; border-radius:17px; background:var(--navy); color:#fff; font-size:12.5px; }
.report-cash-banner .muted { color:#b8c5d8; }
@media (max-width:390px){.report-two-col{grid-template-columns:1fr}.report-kpi-value{font-size:15px}.report-alert-grid{grid-template-columns:1fr}.report-alert:last-child{grid-column:auto}}
/* ---------- Decision-center reports ---------- */
.reports-body { gap: 13px; padding-bottom: 34px; }
.report-tabs { position: sticky; top: 0; z-index: 6; background: var(--bg); padding: 4px 0; }
.report-range { display:flex; gap:6px; overflow-x:auto; padding:2px 0 3px; scrollbar-width:none; }
.report-range::-webkit-scrollbar{display:none}
.report-range .tab { font-size:12px; padding:7px 12px; white-space:nowrap; }
.report-kpi-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; }
.report-kpi { min-height:88px; padding:12px; border:1px solid var(--border); border-radius:18px; background:var(--surface); box-shadow:var(--shadow-1); display:flex; align-items:center; gap:9px; min-width:0; }
.report-kpi.hero-kpi { background:linear-gradient(135deg,var(--navy),var(--brand-600)); color:#fff; border-color:transparent; }
.report-kpi.hero-kpi .report-kpi-label,.report-kpi.hero-kpi .report-kpi-sub{color:rgba(255,255,255,.72)}
.report-kpi.profit-kpi { border-color:var(--brand-100); }
.report-kpi.debt-kpi { border-color:#e9caca; }
.report-kpi-icon { font-size:21px; flex:0 0 auto; }
.report-kpi-value { font-size:16px; font-weight:900; line-height:1.15; overflow-wrap:anywhere; }
.report-kpi-label { margin-top:5px; color:var(--text-muted); font-size:11px; font-weight:800; }
.report-kpi-sub { margin-top:3px; color:var(--text-faint); font-size:9.5px; font-weight:700; }
.owner-hero { border-radius:25px; padding:18px; color:#fff; background:linear-gradient(145deg,var(--navy) 0%,var(--brand-600) 62%,var(--teal) 150%); box-shadow:0 12px 30px rgba(8,31,68,.24); overflow:hidden; position:relative; }
.owner-hero:after { content:''; position:absolute; width:150px;height:150px;border-radius:50%; border:1px solid rgba(255,255,255,.12); left:-45px;bottom:-70px; }
.owner-hero-top { display:flex;justify-content:space-between;align-items:center;position:relative;z-index:1 }
.owner-kicker { font-size:11px;color:rgba(255,255,255,.68);font-weight:800 }
.owner-title { font-size:20px;font-weight:900;margin-top:3px }
.owner-orb { width:48px;height:48px;border-radius:16px;display:grid;place-items:center;background:rgba(255,255,255,.13);font-size:24px }
.owner-main-number { font-size:31px;font-weight:950;letter-spacing:-.5px;margin-top:19px;direction:ltr;text-align:right;position:relative;z-index:1 }
.owner-main-label { font-size:11px;color:rgba(255,255,255,.68);position:relative;z-index:1 }
.owner-hero-grid { display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:16px;position:relative;z-index:1 }
.owner-hero-grid>div { padding:10px;border:1px solid rgba(255,255,255,.13);border-radius:14px;background:rgba(255,255,255,.08);font-size:10px;display:flex;justify-content:space-between;align-items:center;gap:5px }
.owner-hero-grid b { font-size:11px }
.change-pill { display:inline-flex;align-items:center;justify-content:center;padding:5px 8px;border-radius:99px;font-size:10px;font-weight:900;white-space:nowrap }
.change-pill.good { background:#d1fae5;color:#065f46 }.change-pill.bad {background:#fee2e2;color:#991b1b}.change-pill.neutral{background:var(--surface-2);color:var(--text-muted)}
.owner-insight { display:flex;gap:10px;align-items:flex-start;padding:12px;border:1px solid var(--border);border-radius:16px;background:var(--surface) }
.owner-insight-icon { width:27px;height:27px;flex:0 0 27px;border-radius:50%;display:grid;place-items:center;font-weight:900;background:var(--brand-50);color:var(--brand-600) }
.owner-insight.warn .owner-insight-icon{background:var(--amber-100);color:#92400e}.owner-insight.danger .owner-insight-icon{background:var(--red-100);color:var(--red-500)}.owner-insight b{display:block;font-size:12px;margin-bottom:3px}.owner-insight .small{line-height:1.6}
.insights-grid { display:flex;flex-direction:column;gap:7px }
.report-section { display:flex; flex-direction:column; gap:8px; }
.report-section-head { display:flex; justify-content:space-between; align-items:center; gap:8px; }
.report-section .section-title { margin:8px 2px 2px; }
.report-badge { font-size:9px;color:var(--text-muted);background:var(--surface-2);padding:5px 8px;border-radius:99px }
.mini-chart { display:flex; align-items:flex-end; gap:5px; height:176px; padding:14px 8px 8px; border:1px solid var(--border); border-radius:20px; background:var(--surface); overflow-x:auto; }
.chart-col { min-width:29px; height:100%; display:flex; flex-direction:column; justify-content:flex-end; align-items:center; gap:4px; }.chart-bar-wrap{width:18px;height:106px;display:flex;align-items:flex-end}.chart-bar{width:100%;min-height:4px;border-radius:7px 7px 3px 3px;background:linear-gradient(180deg,var(--teal),var(--brand-600))}.chart-label{font-size:9px;color:var(--text-faint)}.chart-value{font-size:7px;color:var(--text-faint);max-width:38px;overflow:hidden;white-space:nowrap}
.report-mix { background:var(--surface);border:1px solid var(--border);border-radius:20px;padding:13px 14px;display:flex;flex-direction:column;gap:13px }.mix-head{display:flex;justify-content:space-between;gap:8px;font-size:12px}.mix-track{height:8px;border-radius:99px;background:var(--surface-2);overflow:hidden;margin-top:6px}.mix-fill{height:100%;border-radius:99px;background:linear-gradient(90deg,var(--teal),var(--brand-600))}
.report-two-col { display:grid;grid-template-columns:1fr 1fr;gap:9px }.report-mini-card{min-width:0;border:1px solid var(--border);border-radius:18px;background:var(--surface);padding:12px}.report-mini-title{font-weight:900;font-size:12px;margin-bottom:8px}.report-list{display:flex;flex-direction:column;gap:6px}.report-row{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:10px 11px;border:1px solid var(--border);border-radius:13px;background:var(--surface)}.report-mini-card .report-row{padding:8px 0;border:0;border-bottom:1px solid var(--border);border-radius:0}.report-mini-card .report-row:last-child{border-bottom:0}.row-title{font-size:12px;font-weight:800}.report-row-value{font-size:11px;font-weight:900;text-align:left;color:var(--text-muted);white-space:nowrap}.owner-alerts{display:grid;grid-template-columns:1fr 1fr;gap:8px}.owner-alert{display:flex;gap:9px;align-items:center;padding:12px;border-radius:17px;background:var(--surface);border:1px solid var(--border)}.owner-alert:last-child{grid-column:1/-1}.owner-alert.warn{background:var(--amber-100);border-color:#f3d38a}.owner-alert-icon{font-size:21px}.owner-alert-title{font-size:11px;font-weight:800}.owner-alert-value{font-size:16px;font-weight:950;margin-top:2px}.recommend-list{display:flex;flex-direction:column;gap:7px}.recommend-row{display:flex;gap:9px;align-items:center;padding:11px 12px;border-radius:15px;background:var(--surface);border:1px solid var(--border);font-size:12px;line-height:1.5}.recommend-num{width:24px;height:24px;flex:0 0 24px;border-radius:8px;display:grid;place-items:center;background:var(--brand-50);color:var(--brand-600);font-weight:900}.report-cash-banner{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:14px;border-radius:17px;background:var(--navy);color:#fff;font-size:12px}.report-cash-banner .muted{color:#b8c5d8}
@media (max-width:390px){.report-two-col{grid-template-columns:1fr}.owner-hero-grid{grid-template-columns:1fr}.owner-alerts{grid-template-columns:1fr}.owner-alert:last-child{grid-column:auto}.report-kpi-value{font-size:14px}}

/* Dashboard brand lockup */
.dash-brand-logo { width: 82px; height: 46px; object-fit: contain; flex: 0 0 auto; background: #fff; border-radius: 10px; padding: 3px; }
.dash-header { gap: 10px; }
.dash-header-main { min-width: 0; flex: 1; }
