:root {
  --bg: #eef3f7;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-strong: rgba(255, 255, 255, 0.88);
  --ink: #15202b;
  --muted: #5f6d7b;
  --line: rgba(139, 156, 171, 0.24);
  --nav: rgba(13, 31, 49, 0.78);
  --accent: #0f766e;
  --accent-2: #2c9c92;
  --danger: #b42318;
  --warn: #b7791f;
  --shadow: 0 18px 50px rgba(14, 24, 34, 0.12);
  --glass-border: 1px solid rgba(255, 255, 255, 0.28);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(44, 156, 146, 0.18), transparent 32%),
    radial-gradient(circle at 85% 10%, rgba(15, 118, 110, 0.12), transparent 24%),
    linear-gradient(180deg, #f8fbfd 0%, #edf3f8 100%);
  color: var(--ink);
  font-family: Tahoma, Arial, sans-serif;
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(135deg, rgba(255,255,255,.24), transparent 38%),
    linear-gradient(315deg, rgba(255,255,255,.18), transparent 28%);
  mix-blend-mode: screen;
  opacity: .45;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 272px;
  background:
    linear-gradient(180deg, rgba(18, 35, 54, 0.92), rgba(10, 22, 35, 0.84)),
    var(--nav);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  box-shadow: 18px 0 50px rgba(12, 22, 32, 0.18);
  color: #fff;
  padding: 22px 16px;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  margin-bottom: 26px;
}

.brand-mark {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255,255,255,.85), rgba(216, 247, 242, .55));
  border: 1px solid rgba(255,255,255,.42);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 8px 18px rgba(0,0,0,.18);
  backdrop-filter: blur(14px);
  color: var(--accent);
}

.brand-mark svg {
  width: 32px;
  height: 32px;
  display: block;
  filter: drop-shadow(0 2px 4px rgba(15, 118, 110, 0.18));
}

.logo-cross {
  fill: #0f766e;
}

.logo-hands,
.logo-bowl {
  fill: none;
  stroke: rgba(18, 35, 54, 0.75);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.brand-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.brand-copy strong {
  color: #fff;
  font-size: 15px;
  line-height: 1.15;
}

.brand-copy small,
.brand-description {
  color: #b8c9d8;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
}

.nav-shell {
  display: grid;
  gap: 16px;
}

.nav-section {
  display: grid;
  gap: 5px;
}

.nav-section > span {
  padding: 0 12px 4px;
  color: #8fb0cc;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.nav-section a {
  color: #dce8f2;
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 11px;
  font-size: 14px;
}
.nav-section a:hover {
  background: rgba(255,255,255,.14);
  color: #fff;
  backdrop-filter: blur(10px);
}

.nav-footer {
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,.12);
}

.logout-form, .language-form { margin: 10px 0 0; }
.logout-form button,
.language-form button {
  width: 100%;
  min-height: 40px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 12px;
  background: rgba(255,255,255,.09);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.logout-form button:hover,
.language-form button:hover { background: rgba(255,255,255,.16); }

.auth-language {
  margin: -8px 0 16px;
}

.auth-language button {
  border-color: var(--line);
  background: #f8fafb;
  color: var(--ink);
}

.auth-language button:hover {
  background: #eef4f7;
}

.main {
  margin-left: 272px;
  padding: 28px;
}

[dir="rtl"] .sidebar {
  inset: 0 0 0 auto;
}

[dir="rtl"] .main {
  margin-left: 0;
  margin-right: 272px;
}

[dir="rtl"] th,
[dir="rtl"] td {
  text-align: right;
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 22px;
}

.dashboard-head {
  align-items: flex-start;
}

.dashboard-head h1 {
  max-width: 760px;
}

.actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.header-filter {
  display: inline-flex;
  align-items: center;
}

.header-filter label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 999px;
  background: rgba(255,255,255,.56);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.header-filter span {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.header-filter select {
  width: auto;
  min-width: 140px;
  min-height: 34px;
  padding: 7px 34px 7px 12px;
  border: 1px solid rgba(15,118,110,.14);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.9), rgba(245,250,252,.78));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.75);
}

.filter-bar {
  display: flex;
  align-items: end;
  gap: 12px;
  margin-bottom: 18px;
  padding: 14px;
  border: var(--glass-border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.filter-bar label {
  width: min(280px, 100%);
}

.command-filter {
  justify-content: space-between;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

.subtle {
  margin: 7px 0 0;
  color: var(--muted);
}

h1, h2 { margin: 0; }
h1 { font-size: 30px; }
h2 { font-size: 18px; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 17px;
  border: 1px solid rgba(255,255,255,.34);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,255,255,.82), rgba(245,249,252,.7));
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(14,24,34,.08);
  backdrop-filter: blur(12px);
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.button:hover {
  border-color: rgba(15,118,110,.28);
  box-shadow: 0 12px 28px rgba(24,32,42,.12);
  transform: translateY(-1px);
}
.button.primary {
  background: linear-gradient(180deg, #18a092, var(--accent));
  border-color: var(--accent);
  color: #fff;
}
.button.danger {
  background: linear-gradient(180deg, #c33127, var(--danger));
  border-color: var(--danger);
  color: #fff;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metrics article, .panel {
  background: var(--surface);
  border: var(--glass-border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.metrics article { padding: 18px; }
.metrics span { display: block; font-size: 27px; font-weight: 800; }
.metrics p { margin: 5px 0 0; color: var(--muted); }

.executive-metrics article {
  position: relative;
  overflow: hidden;
}

.executive-metrics article::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--accent);
}

[dir="rtl"] .executive-metrics article::before {
  inset: 0 0 0 auto;
}

.executive-metrics .metric-danger::before {
  background: var(--danger);
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  margin: 22px 0 12px;
}

.grid.two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

.panel {
  padding: 18px;
  overflow-x: auto;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-head a { color: var(--accent); font-weight: 700; text-decoration: none; }

.item-link {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.item-link:hover {
  text-decoration: underline;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

.compact-table {
  min-width: 640px;
}

th, td {
  border-bottom: 1px solid var(--line);
  padding: 11px 10px;
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--muted);
  font-size: 13px;
  background: rgba(248, 251, 253, 0.82);
  backdrop-filter: blur(8px);
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.55);
}

td small {
  display: block;
  color: var(--warn);
  margin-top: 3px;
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 28px;
}

.tag {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  background: #edf7f6;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.risk-dot {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.risk-dot.red { background: var(--danger); }
.risk-dot.orange { background: var(--warn); }
.risk-dot.green { background: var(--accent); }

.form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  max-width: 860px;
}

label span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-weight: 700;
}

input, select {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(139, 156, 171, 0.28);
  border-radius: 12px;
  padding: 8px 10px;
  font: inherit;
  background:
    linear-gradient(180deg, rgba(255,255,255,.9), rgba(247,250,252,.78));
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6);
  backdrop-filter: blur(12px);
}

select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 34px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%),
    linear-gradient(180deg, rgba(255,255,255,.9), rgba(247,250,252,.78));
  background-position:
    calc(100% - 18px) 18px,
    calc(100% - 13px) 18px,
    0 0;
  background-size: 5px 5px, 5px 5px, 100% 100%;
  background-repeat: no-repeat;
}

.wide { grid-column: 1 / -1; }
.narrow-form { max-width: 560px; }
.danger-grid {
  align-items: start;
}
.danger-panel {
  border-color: #f4b7b2;
}
.checkbox-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
}
.checkbox-row input {
  width: 18px;
  min-height: 18px;
  margin-top: 2px;
}
.checkbox-row span {
  margin: 0;
  line-height: 1.45;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chips span { background: #f0f4f7; border: 1px solid var(--line); padding: 8px 10px; border-radius: 999px; }
.file-row input { padding: 9px; }
.path-list { display: grid; gap: 8px; margin-top: 14px; }
.helper-text {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.5;
}
.muted-note {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.comparison-table {
  min-width: 1180px;
}
.change-cell {
  display: grid;
  gap: 5px;
}
.change-cell strong {
  font-size: 15px;
}
.change-cell em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}
.change-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef4f7;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.change-pill.up { background: #fff1f0; color: var(--danger); }
.change-pill.down { background: #ecfdf3; color: #05603a; }
.change-pill.flat { background: #eef4f7; color: var(--muted); }
.text-up { color: var(--danger); }
.text-down { color: #05603a; }
.text-flat { color: var(--muted); }
.path-list code {
  display: block;
  padding: 10px 12px;
  border: 1px solid rgba(139, 156, 171, 0.22);
  border-radius: 12px;
  background: rgba(248, 251, 253, 0.75);
  white-space: normal;
}

.bar-list {
  display: grid;
  gap: 12px;
}

.bar-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  overflow: hidden;
  text-decoration: none;
}

.bar-row span,
.bar-row strong {
  position: relative;
  z-index: 1;
}

.bar-row i {
  position: absolute;
  inset: auto auto 0 0;
  height: 4px;
  background: var(--accent);
}

.inline-bar {
  position: relative;
  min-width: 110px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef4f7;
  overflow: hidden;
}

.inline-bar i {
  position: absolute;
  inset: 0 auto 0 0;
  background: rgba(15,118,110,.18);
}

.inline-bar span {
  position: relative;
  z-index: 1;
  font-weight: 700;
}

.insight-card p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.chart-grid {
  align-items: stretch;
}

.chart-panel {
  min-height: 430px;
}

.chart-box {
  position: relative;
  min-height: 320px;
}

.chart-box svg {
  width: 100%;
  height: auto;
  display: block;
}

.split-chart {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(180px, .75fr);
  align-items: center;
  gap: 12px;
}

.segmented {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fafc;
}

.segmented button {
  min-height: 32px;
  border: 0;
  border-radius: 6px;
  padding: 0 10px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.segmented button.active {
  background: #fff;
  color: var(--accent);
  box-shadow: 0 1px 4px rgba(24,32,42,.08);
}

.chart-tip {
  position: absolute;
  z-index: 5;
  max-width: 240px;
  padding: 8px 10px;
  border-radius: 7px;
  background: rgba(24,32,42,.94);
  color: #fff;
  font-size: 12px;
  pointer-events: none;
  opacity: 0;
  transition: opacity .12s ease;
}

.chart-grid-line {
  stroke: #e7edf3;
  stroke-width: 1;
}

.axis-label {
  fill: var(--muted);
  font-size: 12px;
}

.bar-fill {
  cursor: pointer;
}

.donut-slice {
  cursor: pointer;
  stroke: #fff;
  stroke-width: 2;
}

.donut-hole {
  fill: #fff;
}

.donut-center {
  fill: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.donut-value {
  fill: var(--ink);
  font-size: 15px;
  font-weight: 800;
}

.chart-legend {
  display: grid;
  gap: 9px;
}

.chart-legend div {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.chart-legend span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.chart-legend strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-legend em {
  color: var(--muted);
  font-style: normal;
  font-weight: 700;
}

.trend-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
}

.trend-dot {
  fill: #fff;
  stroke: var(--accent);
  stroke-width: 3;
  cursor: pointer;
}

.chart-empty {
  fill: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.messages { margin-bottom: 16px; }
.message {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(236, 253, 243, 0.78);
  color: #05603a;
  border: 1px solid rgba(5, 96, 58, 0.14);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}
.message.error {
  background: rgba(255, 241, 240, 0.82);
  color: var(--danger);
  border-color: rgba(180, 35, 24, 0.16);
}

.decision-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.decision-strip a {
  display: grid;
  gap: 5px;
  min-height: 94px;
  padding: 16px;
  border: var(--glass-border);
  border-radius: 18px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.decision-strip strong {
  color: var(--accent);
  font-size: 15px;
}

.decision-strip span {
  color: var(--muted);
  line-height: 1.35;
}

.decision-cards {
  align-items: stretch;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.decision-card {
  position: relative;
  overflow: hidden;
}

.decision-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--accent);
}

[dir="rtl"] .decision-card::before {
  inset: 0 0 0 auto;
}

.decision-card.danger::before { background: var(--danger); }
.decision-card.warn::before { background: var(--warn); }
.decision-card.calm::before { background: var(--accent); }

.decision-kicker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-width: 38px;
  min-height: 30px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(238, 244, 247, 0.72);
  color: var(--ink) !important;
  font-size: 13px;
  font-weight: 800;
}

.decision-card.danger .decision-kicker {
  background: #fff1f0;
  color: var(--danger) !important;
}

.decision-card.warn .decision-kicker {
  background: #fff7e6;
  color: var(--warn) !important;
}

.priority-panel {
  padding-bottom: 10px;
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at top left, rgba(44, 156, 146, 0.16), transparent 35%),
    linear-gradient(180deg, #f8fbfd 0%, #edf3f8 100%);
}

.auth-shell {
  width: min(440px, calc(100vw - 32px));
}

.auth-card {
  background: var(--surface-strong);
  border: var(--glass-border);
  border-radius: 20px;
  padding: 26px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

.auth-brand .brand-mark {
  width: 52px;
  height: 52px;
}

.auth-brand .brand-mark svg {
  width: 38px;
  height: 38px;
}

.auth-brand .brand-description {
  margin: 0 0 10px;
  color: var(--muted);
  max-width: 310px;
}

.auth-form {
  display: grid;
  gap: 16px;
}

.auth-form select { width: 100%; }
.auth-switch { margin: 0; text-align: center; color: var(--muted); }
.honeypot { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; opacity: 0; pointer-events: none; }
.status-pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; background: #ecfdf3; color: #05603a; }
.status-pill.suspended { background: #fef3f2; color: #b42318; }

/* ---- Smart import + profit & loss ---- */
h3 { margin: 14px 0 8px; font-size: 15px; }
.nav-section a.nav-highlight { background: rgba(44, 156, 146, .28); font-weight: 700; }
.plain-list { margin: 10px 0 0; padding-inline-start: 20px; line-height: 1.8; color: var(--muted); }
.dropzone input[type="file"] {
  padding: 26px 14px;
  border: 2px dashed rgba(15, 118, 110, .35);
  background: rgba(15, 118, 110, .04);
  cursor: pointer;
}
.dropzone small { color: var(--muted); }
.chip { background: #eef4f7; border: 1px solid var(--line); padding: 4px 10px; border-radius: 999px; font-size: 12px; }
.chip.ok { background: #ecfdf3; color: #05603a; }
.table-review { margin-bottom: 18px; }
.table-review h2 small { color: var(--muted); font-weight: 400; }
.table-review.unusable { opacity: .75; }
.mapping-table { min-width: 640px; }
.mapping-table select { min-width: 190px; }
.mapping-table tr.unmapped td:first-child { color: var(--muted); }
.mapping-table td small { display: block; color: var(--muted); }
.samples code, .issue code, .path-list code {
  display: inline-block;
  margin: 2px;
  padding: 2px 6px;
  border-radius: 6px;
  background: #f0f4f7;
  font-size: 12px;
}
.confidence { display: inline-block; padding: 2px 8px; border-radius: 999px; font-weight: 700; font-size: 12px; }
.confidence.high { background: #ecfdf3; color: #05603a; }
.confidence.mid { background: #fff7e6; color: var(--warn); }
.confidence.low { background: #fff1f0; color: var(--danger); }
.needs-input input { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(180, 35, 24, .12); }
.review-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.quality-score.good span { color: #05603a; }
.quality-score.mid span { color: var(--warn); }
.quality-score.bad span { color: var(--danger); }
.issue-list, .coverage-list, .headline-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.issue { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; border-inline-start: 4px solid var(--accent); }
.issue.warn { border-inline-start-color: var(--warn); }
.issue.danger { border-inline-start-color: var(--danger); }
.issue strong { margin-inline-end: 8px; }
.issue details { margin-top: 6px; color: var(--muted); }
.coverage-list li { padding: 8px 12px; border-radius: 10px; background: #ecfdf3; }
.coverage-list li.no { background: #fff7e6; }
.coverage-list li.yes strong::before { content: "✓ "; color: #05603a; }
.coverage-list li.no strong::before { content: "✗ "; color: var(--warn); }
.coverage-list small { display: block; color: var(--muted); margin-top: 3px; }
.headline-list li, .story li { line-height: 1.8; }
.story { margin-bottom: 18px; border-inline-start: 5px solid var(--accent); }
.story ol { margin: 10px 0 0; padding-inline-start: 22px; font-size: 15px; }
.story-link { display: block; color: var(--ink); text-decoration: none; }
.story-link:hover { box-shadow: 0 18px 50px rgba(14, 24, 34, .2); }
.executive-metrics .metric-good::before { background: #12a150; }
.executive-metrics .metric-warn::before { background: var(--warn); }
.metrics span small { font-size: 14px; color: var(--muted); font-weight: 400; }
.driver-list { display: grid; gap: 14px; margin-bottom: 18px; }
.driver-card {
  background: var(--surface);
  border: var(--glass-border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 18px;
  border-inline-start: 5px solid var(--danger);
  overflow-x: auto;
}
.driver-card.frozen { border-inline-start-color: var(--warn); }
.driver-card.info { border-inline-start-color: var(--accent); }
.driver-card header { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; }
.driver-card h3 { margin: 0 0 6px; font-size: 18px; }
.driver-card header p { margin: 0; color: var(--muted); line-height: 1.6; }
.driver-amount { text-align: end; white-space: nowrap; }
.driver-amount strong { display: block; font-size: 26px; }
.driver-card.loss .driver-amount strong { color: var(--danger); }
.driver-card.frozen .driver-amount strong { color: var(--warn); }
.driver-amount small { color: var(--muted); }
.share-bar { height: 6px; border-radius: 999px; background: #eef4f7; margin: 12px 0; overflow: hidden; }
.share-bar i { display: block; height: 100%; background: currentColor; color: var(--danger); }
.driver-card.frozen .share-bar i { color: var(--warn); }
.driver-action { margin: 8px 0; }
.driver-card details summary { cursor: pointer; color: var(--accent); font-weight: 700; margin: 6px 0; }
.see-all { display: inline-block; margin-top: 8px; color: var(--accent); font-weight: 700; text-decoration: none; }
td small { display: block; }
.fit-table { min-width: 0; }
.change-pill.better { background: #ecfdf3; color: #05603a; }
.change-pill.worse { background: #fff1f0; color: var(--danger); }
.mover-panel { border-inline-start: 5px solid var(--accent); }
.mover-panel.worse { border-inline-start-color: var(--danger); }
.trend.up { color: #05603a; }
.trend.down { color: var(--danger); }
.rate-explain { line-height: 1.8; }
.profile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.profile-option { display: grid; gap: 4px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.profile-option.selected, .profile-option:has(input:checked) { border-color: var(--accent); background: rgba(15, 118, 110, .06); }
.profile-option input[type="radio"] { width: 18px; height: 18px; padding: 0; margin: 0; box-shadow: none; justify-self: start; accent-color: var(--accent); }
.profile-option small { color: var(--muted); line-height: 1.5; }
.ask-form { display: flex; gap: 12px; align-items: center; margin-bottom: 18px; }
.ask-form input { flex: 1; font-size: 16px; padding: 14px 16px; }
.answer-text { font-size: 17px; line-height: 1.8; margin: 12px 0; white-space: pre-wrap; }
.example-chip { text-decoration: none; color: var(--ink); }
.example-chip:hover { border-color: var(--accent); color: var(--accent); }
.nav-section a.active {
  background: rgba(255, 255, 255, .16);
  color: #fff;
  font-weight: 700;
  box-shadow: inset 3px 0 0 #5eead4;
}
[dir="rtl"] .nav-section a.active { box-shadow: inset -3px 0 0 #5eead4; }
.mobile-bar, .menu-close, .nav-backdrop { display: none; }
.nav-user { margin: 0 0 6px; color: rgba(255,255,255,.75); font-size: 13px; }
.branch-checks { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.branch-checks .checkbox-row { margin: 0; }
.user-form { max-width: none; margin-top: 10px; align-items: end; }
.button.whatsapp { background: #128c4a; color: #fff; border-color: #128c4a; }
.digest { margin-bottom: 18px; }
.digest summary { cursor: pointer; font-weight: 700; color: var(--accent); }
.digest pre { white-space: pre-wrap; font-family: inherit; line-height: 1.8; margin: 10px 0 0; }
.danger-chip { background: #fff1f0; color: var(--danger); }
.priority { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.priority.urgent { background: #fff1f0; color: var(--danger); }
.priority.soon { background: #fff7e6; color: var(--warn); }
.priority.planned { background: #eef4f7; color: var(--muted); }
.abc-badge { display: inline-block; min-width: 20px; padding: 1px 6px; border-radius: 6px; font-size: 11px; font-weight: 800; text-align: center; color: #fff; background: var(--muted); }
.abc-badge.abc-A { background: #12a150; }
.abc-badge.abc-B { background: var(--accent); }
.abc-badge.abc-C { background: var(--warn); }
.abc-matrix { min-width: 560px; }
.abc-matrix th { white-space: nowrap; }
.abc-cell small { display: block; color: var(--muted); }
.abc-cell.empty-cell { color: var(--muted); }
.settings-group { max-width: none; margin-bottom: 18px; }
.settings-group h2 { margin-bottom: 4px; }
.settings-group label small { font-weight: 400; }
.checkbox-row small { display: block; }
.fit-table th, .fit-table td { padding-inline: 8px; }

@media (max-width: 920px) {
  /* Mobile: a slim sticky bar with a menu button; the navigation is a drawer, closed by default,
     so tapping a link shows the page content immediately instead of the menu again. */
  .mobile-bar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 56px;
    padding: 8px 12px;
    padding-top: max(8px, env(safe-area-inset-top));
    background: linear-gradient(180deg, rgba(18, 35, 54, 0.97), rgba(10, 22, 35, 0.95));
    color: #fff;
    box-shadow: 0 6px 20px rgba(12, 22, 32, 0.18);
  }
  .menu-toggle, .mobile-home {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 12px;
    background: rgba(255, 255, 255, .1);
    color: #fff;
    cursor: pointer;
    flex: none;
  }
  .menu-toggle svg { width: 24px; height: 24px; stroke: currentColor; stroke-width: 2; stroke-linecap: round; fill: none; }
  .mobile-home svg { width: 26px; height: 26px; }
  .mobile-home .logo-cross { fill: #5eead4; }
  .mobile-title { flex: 1; font-weight: 700; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    width: min(86vw, 320px);
    transform: translateX(-105%);
    transition: transform .22s ease;
    padding-top: max(22px, env(safe-area-inset-top));
    overscroll-behavior: contain;
  }
  [dir="rtl"] .sidebar { inset: 0 0 0 auto; transform: translateX(105%); }
  .sidebar.open, [dir="rtl"] .sidebar.open { transform: none; }
  .menu-close {
    display: block;
    margin-inline-start: auto;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 12px;
    background: rgba(255, 255, 255, .1);
    color: #fff;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
  }
  .nav-backdrop { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(8, 16, 26, .45); }
  .nav-backdrop[hidden] { display: none; }
  body.nav-open { overflow: hidden; }
  .nav-section a { padding: 12px; font-size: 15px; }
  .main { margin-left: 0; padding: 18px; }
  [dir="rtl"] .main { margin-right: 0; }
  .brand { align-items: flex-start; }
  .nav-shell { gap: 12px; }
  .metrics, .grid.two, .form { grid-template-columns: 1fr; }
  .decision-strip { grid-template-columns: 1fr; }
  .filter-bar { align-items: stretch; flex-direction: column; }
  .split-chart { grid-template-columns: 1fr; }
  .panel-head { align-items: flex-start; flex-direction: column; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .driver-card header, .review-actions { flex-direction: column; }
  .driver-amount { text-align: start; }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar { transition: none; }
}

/* demo banner */
.demo-banner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  background: #fff7e0; border: 1px solid #f0d58a; color: #6b4e00;
  border-radius: 14px; padding: 12px 16px; margin-bottom: 18px;
}

/* one-page report */
.one-pager { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 28px; max-width: 900px; margin: 0 auto; box-shadow: var(--shadow); }
.one-pager h3 { margin: 18px 0 8px; font-size: 1.05rem; }
.op-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; border-bottom: 2px solid var(--accent); padding-bottom: 12px; }
.op-head h2 { margin: 0 0 4px; }
.op-head p { margin: 0; color: var(--muted); font-size: .9rem; }
.op-brand { color: var(--accent); white-space: nowrap; }
.op-hero { margin: 18px 0; padding: 18px; border-radius: 14px; background: linear-gradient(135deg, #102a3d, #0f766e); color: #fff; }
.op-hero span { opacity: .85; }
.op-hero strong { display: block; font-size: 2.3rem; margin: 4px 0; }
.op-hero p { margin: 0; opacity: .85; font-size: .92rem; }
.op-drivers { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.op-driver { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: grid; gap: 2px; }
.op-driver.loss { border-inline-start: 4px solid var(--danger); }
.op-driver.frozen { border-inline-start: 4px solid #3b6fb6; }
.op-driver span { font-size: .88rem; color: var(--muted); }
.op-driver b { font-size: 1.25rem; }
.op-driver small { color: var(--muted); }
.op-story ol, .op-actions ul { margin: 0; padding-inline-start: 20px; }
.op-story li, .op-actions li { margin-bottom: 4px; }
.op-actions ul { list-style: none; padding: 0; }
.op-foot { margin-top: 20px; padding-top: 12px; border-top: 1px dashed var(--line); color: var(--muted); font-size: .92rem; }
.op-foot p { margin: 4px 0; }

@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff !important; }
  body::before, .sidebar, .mobile-bar, .nav-backdrop, .messages, .no-print { display: none !important; }
  .main { margin: 0 !important; padding: 0 !important; }
  .one-pager { box-shadow: none; border: 0; padding: 0; max-width: none; }
  .op-hero, .op-driver { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .one-pager { font-size: 11.5px; line-height: 1.45; }
  .one-pager h3 { margin: 8px 0 4px; font-size: 13px; }
  .op-head h2 { font-size: 17px; }
  .op-hero { margin: 8px 0; padding: 10px 14px; }
  .op-hero strong { font-size: 24px; margin: 0; }
  .op-drivers { gap: 6px; }
  .op-driver { padding: 6px 8px; }
  .op-driver b { font-size: 14px; }
  .op-story li, .op-actions li { margin-bottom: 1px; }
  .op-table { font-size: 11px; }
  .op-table td, .op-table th { padding: 3px 6px; }
  .op-foot { margin-top: 8px; padding-top: 6px; }
}
.table-wrap { overflow-x: auto; }
.inline-form { display: inline-block; margin-inline-start: 8px; }

.big-number { font-size: 2.6rem; font-weight: 800; line-height: 1.1; margin: 0.2rem 0 0.6rem; color: var(--accent); font-variant-numeric: tabular-nums; }
.segment-table td:first-child { white-space: normal; min-width: 14rem; }
.segment-note { display: block; color: var(--muted); font-size: 0.85rem; font-weight: 400; margin-top: 0.15rem; }
.gmroi-card .big-number { color: var(--accent); }
@media (max-width: 700px) { .segment-table td:first-child { min-width: 0; } .segment-note { display: none; } .segment-table th, .segment-table td { padding-inline: 0.3rem; } }
.button-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.plan-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem; align-items: end; }
.plan-form .wide { grid-column: 1 / -1; }
.good-news { color: var(--accent); font-weight: 700; }
.branch-map { height: 380px; border-radius: 14px; overflow: hidden; z-index: 0; }
.branch-map.picking { outline: 3px solid var(--accent); cursor: crosshair; }
.location-cell { display: flex; gap: 0.4rem; align-items: center; }
.location-cell input { flex: 1; min-width: 12rem; }
.located { color: var(--accent); font-weight: 700; margin-inline-start: 0.35rem; }
.button.small { padding: 0.35rem 0.7rem; font-size: 0.85rem; }
.table-scroll { overflow-x: auto; }
.distance-matrix td, .distance-matrix th { white-space: nowrap; text-align: center; }
.distance-matrix td small { display: block; color: var(--muted); }
.distance-matrix td.measured { background: rgba(15, 118, 110, 0.12); font-weight: 700; }
@media (max-width: 700px) { .location-cell { flex-direction: column; align-items: stretch; } }
.trip-stops { list-style: none; padding: 0; margin: 0 0 1.5rem; display: grid; gap: 0.75rem; }
.trip-stop { background: var(--surface-strong); border: 1px solid var(--line); border-radius: 14px; padding: 0.9rem 1.1rem; box-shadow: var(--shadow); }
.trip-stop.base { background: rgba(15, 118, 110, 0.07); }
.trip-stop header { display: flex; gap: 0.8rem; align-items: center; margin-bottom: 0.3rem; }
.trip-stop h3 { margin: 0; font-size: 1.05rem; }
.trip-stop p { margin: 0.25rem 0; }
.trip-stop small { color: var(--muted); }
.stop-number { display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 800; flex: none; }
.stop-group { margin: 0.3rem 0; }
.stop-group summary { cursor: pointer; }
.stop-group ul { margin: 0.3rem 0 0.5rem; padding-inline-start: 1.4rem; columns: 2; color: var(--muted); font-size: 0.9rem; }
@media (max-width: 700px) { .stop-group ul { columns: 1; } }
