/* CAPPELEN | paper — design system, copied verbatim from the prototype
   (samples/paper-crm.html, original <style> block) for a 1:1 brand match.
   App-shell helpers for the logged-in topbar are appended at the end. */
/* ==========================================================================
   CAPPELEN | paper — Brand System
   Primary navy #21447A  ·  Wordmark-gray #8FA8C4  ·  Paper gold #C19A5E
   Tweak these four variables to retune the whole UI.
   ========================================================================== */
:root{
  color-scheme: light;
  --cap-navy:      #21447A;
  --cap-navy-2:    #1A3965;
  --cap-navy-3:    #173258;
  --cap-navy-soft: #E8EEF6;
  --cap-navy-rim:  #C9D4E5;
  --cap-wordmark-gray: #8FA8C4;
  --cap-gold:      #C19A5E;
  --cap-gold-2:    #A4814C;
  --cap-gold-soft: #F3EBDB;
  --cap-ink:       #21447A;          /* body copy is navy, per PPT */
  --cap-ink-2:     #43608A;
  --cap-muted:     #6F85A4;
  --cap-rule:      #DBE3EF;
  --cap-page:      #FFFFFF;
  --cap-panel:     #F6F8FC;
  --cap-card:      #FFFFFF;
  --cap-good:      #2E7D4F;
  --cap-good-bg:   #E8F2EC;
  --cap-bad:       #B5413A;
  --cap-bad-bg:    #FBEDEC;
  --cap-warn:      #A57C2A;
  --cap-warn-bg:   #FAF2DE;
  --serif: "Georgia", "Times New Roman", ui-serif, serif;
  --sans:  "Calibri", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*,*::before,*::after{ box-sizing:border-box; }
html,body{ height:100%; margin:0; }
body{
  font-family: var(--sans);
  color: var(--cap-ink);
  background: var(--cap-page);
  font-size: 14px;
  line-height: 1.45;
}
a{ color: var(--cap-navy); text-decoration:none; }

/* ---------- Wordmark ---------- */
.wordmark{
  font-family: var(--serif);
  letter-spacing: 0.04em;
  display:inline-flex; align-items:baseline; gap:0;
  line-height: 1;
}
.wordmark .cap{ font-weight:600; letter-spacing:0.08em; }
.wordmark .bar{
  display:inline-block; width:1px; height:0.9em;
  margin: 0 0.30em 0 0.30em; background: currentColor; opacity:0.55;
  transform: translateY(0.02em);
}
.wordmark .sub{ font-family: var(--serif); font-weight:400; letter-spacing:0.03em; font-style: normal; }

/* ---------- App shell ---------- */
.app{ display:flex; min-height:100vh; }
.sidebar{
  width: 240px; flex-shrink:0;
  background: var(--cap-navy); color:#fff;
  display:flex; flex-direction:column;
  border-right: 1px solid var(--cap-navy-3);
}
.sidebar__brand{
  padding: 24px 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.10);
}
.sidebar__brand .wordmark{ color:#fff; font-size: 22px; }
.sidebar__brand .wordmark .sub{ color: var(--cap-gold); font-size: 20px; }
/* Logo images — Cappelen Paper / Cappelen Group  */
.wordmark-img{ display:block; height: auto; max-width: 100%; }
.sidebar__brand .wordmark-img{ width: 175px; max-width: 100%; filter: brightness(0) invert(1); }
.login-brand .wordmark-img{ width: 220px; }
.page__foot .wordmark-img{ width: 130px; filter: brightness(0) invert(1); }
.sidebar__tagline{
  font-family: var(--serif); color: var(--cap-wordmark-gray);
  font-size: 11px; letter-spacing:0.16em; text-transform: uppercase;
  margin-top: 12px;
}
.sidebar__nav{ padding: 12px 10px; flex:1; overflow:auto; }
.nav-item{
  display:flex; align-items:center; gap:10px;
  padding: 9px 12px; border-radius: 3px;
  font-size: 13px; color: #D8E2EF;
  cursor:pointer; user-select:none;
  border-left: 3px solid transparent;
  transition: background .12s;
}
.nav-item:hover{ background: var(--cap-navy-2); color:#fff; }
.nav-item.active{
  background: var(--cap-navy-2); color:#fff;
  border-left-color: var(--cap-gold);
}
.nav-item svg{ width:16px; height:16px; opacity:0.9; }
/* Sub-item under a parent (e.g. Settings → User Role Mapping). */
.nav-item--sub{ padding-left: 30px; font-size: 12px; color: #B9C6D8; }
.nav-item--sub svg{ width:14px; height:14px; }
.sidebar__foot{
  padding: 14px 20px 18px;
  font-size: 11px; color: var(--cap-wordmark-gray);
  border-top: 1px solid rgba(255,255,255,0.10);
  font-family: var(--serif); letter-spacing: 0.08em;
}
.sidebar__foot .imprint{
  font-family: var(--sans); letter-spacing: 0; margin-top: 6px; color:#B0C0D6;
}

/* ---------- Main column ---------- */
.main{ flex:1; display:flex; flex-direction:column; min-width:0; background: var(--cap-page); }
.topbar{
  display:flex; align-items:center; justify-content:space-between;
  padding: 14px 32px; border-bottom: 1px solid var(--cap-rule); background: #fff;
}
.topbar__left .eyebrow{
  font-size: 10px; color: var(--cap-gold); text-transform: uppercase; letter-spacing: 0.22em;
}
.topbar__left .role-line{
  font-family: var(--serif); font-size: 15px; color: var(--cap-navy);
  display:flex; align-items:center; gap:8px; margin-top: 2px;
}
.topbar__right{ display:flex; gap:16px; align-items:flex-end; }
.topbar__right label{ display:block; font-size:11px; text-transform:uppercase; letter-spacing:0.08em; color: var(--cap-navy); font-weight:600; margin-bottom:3px; }

/* ---------- Login screen ---------- */
.login-shell{
  min-height:100vh; width:100%;
  display:flex; align-items:center; justify-content:center;
  background: linear-gradient(135deg, #0b1e44 0%, #21447A 55%, #1a3565 100%);
  padding: 40px 20px;
}
.login-card{
  background: #fff; border: 1px solid var(--cap-rule);
  border-radius: 4px; box-shadow: 0 30px 80px rgba(0,0,0,0.35);
  width: 100%; max-width: 420px; padding: 36px 36px 30px;
}
.login-brand{
  border-bottom: 1px solid var(--cap-rule);
  padding-bottom: 14px; margin-bottom: 6px;
  display:flex; align-items:baseline; justify-content:space-between; gap:12px;
}
.login-brand .wordmark{ color: var(--cap-navy); font-size: 26px; }
.login-brand .wordmark .sub{ color: var(--cap-gold); font-size: 24px; }
.login-tag{
  font-family: var(--serif); font-style: italic;
  color: var(--cap-ink-2); font-size: 13px;
}
.login-seed{
  margin-top: 22px; padding-top: 16px;
  border-top: 1px solid var(--cap-rule);
}
.login-seed ul.chev{ margin: 0; padding: 0; list-style: none; }
.login-seed ul.chev li{
  font-size: 12px; color: var(--cap-ink-2);
  padding: 3px 0 3px 14px; position: relative;
}
.login-seed ul.chev li::before{
  content: "›"; position: absolute; left: 0; color: var(--cap-gold); font-weight: 600;
}
.login-seed strong{ color: var(--cap-navy); font-weight: 600; }

/* ---------- Chip row (multi-select toggles) ---------- */
.chip-row{ display:flex; flex-wrap:wrap; gap:6px; }
.chip-btn{
  font: inherit; font-size: 12px;
  padding: 5px 10px; border-radius: 999px;
  border: 1px solid var(--cap-rule); background:#fff; color: var(--cap-ink-2);
  cursor: pointer; transition: all 0.15s;
}
.chip-btn:hover:not(:disabled){ border-color: var(--cap-navy); color: var(--cap-navy); }
.chip-btn.active{
  background: var(--cap-navy); color: #fff; border-color: var(--cap-navy); font-weight: 600;
}
.chip-btn:disabled{ opacity: 0.6; cursor: default; }

/* ---------- Inline button used in tables ---------- */
.link-btn{
  background: none; border: none; padding: 0; margin: 0;
  font: inherit; color: var(--cap-navy); cursor: pointer;
  text-align: left;
}
.link-btn:hover{ text-decoration: underline; color: var(--cap-gold); }

/* ---------- Structured visit fields layout ---------- */
.visit-grid{
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px 24px;
}
.visit-block{
  border-left: 3px solid var(--cap-gold);
  padding: 4px 0 4px 12px;
}

/* ---------- Customer-detail summary list ---------- */
.summary-dl{
  display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px;
  margin: 0; padding: 0;
}
.summary-dl dt{
  color: var(--cap-muted); font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600;
}
.summary-dl dd{
  margin: 0; color: var(--cap-navy); font-weight: 500; font-size: 14px;
}
@media (max-width: 720px){
  .visit-grid{ grid-template-columns: 1fr; }
}

/* Page area with bottom footer bar (per PPT) */
.page{ flex:1; display:flex; flex-direction:column; min-height:0; }
.page__body{ flex:1; overflow:auto; padding: 28px 32px 30px; }
.page__foot{
  background: var(--cap-navy); color:#fff;
  display:flex; align-items:center; justify-content:space-between;
  padding: 10px 24px; font-size: 12px;
}
.page__foot .wordmark{ color:#fff; font-size: 15px; }
.page__foot .wordmark .sub{ color: var(--cap-wordmark-gray); }
.page__foot .pg{ font-family: var(--serif); font-size: 14px; }

/* ---------- Typography ---------- */
h1.page-title{
  font-family: var(--serif); font-weight: 400;
  color: var(--cap-navy); font-size: 30px; margin: 0 0 4px;
  letter-spacing: -0.005em;
}
.page-subtitle{ color: var(--cap-ink-2); font-size: 13.5px; margin: 0 0 18px; }
h2.section-title{
  font-family: var(--serif); font-weight: 500; font-size: 18px;
  color: var(--cap-navy); margin: 0 0 10px;
}
h3.section-subtitle{
  font-family: var(--sans); font-weight: 600; font-size: 13px;
  color: var(--cap-navy); margin: 0 0 8px; text-transform: uppercase; letter-spacing: 0.06em;
}

/* Chevron bullets, like the ">" marker on every slide */
ul.chev{ list-style:none; padding:0; margin:0; }
ul.chev > li{ position:relative; padding-left: 18px; margin-bottom: 6px; }
ul.chev > li::before{
  content: ">"; position:absolute; left:0; top:0;
  color: var(--cap-navy); font-family: var(--sans); font-weight: 600;
}

/* ---------- Cards (org-chart slide style) ---------- */
.card{
  background: var(--cap-card); border: 1px solid var(--cap-gold);
  border-radius: 3px;
  box-shadow: 0 1px 0 rgba(33,68,122,0.03);
  padding: 18px 20px;
}
.card--soft{
  background: var(--cap-navy-soft); border-color: var(--cap-gold);
}
.card--plain{
  background: #fff; border: 1px solid var(--cap-rule); box-shadow:none;
}
.card h3.section-subtitle{ margin-bottom: 4px; }

/* Stat tiles */
.stat-grid{ display:grid; gap: 14px; grid-template-columns: repeat(4, minmax(0,1fr)); }
.stat{
  background: var(--cap-navy-soft); border: 1px solid var(--cap-gold);
  border-radius: 3px; padding: 14px 16px;
}
.stat .label{ font-size: 10px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--cap-navy); font-weight:600; }
.stat .val{ font-family: var(--serif); font-size: 24px; color: var(--cap-navy); margin-top: 4px; }
.stat .sub{ font-size: 11px; color: var(--cap-ink-2); margin-top: 2px; }
.stat.good  .val{ color: var(--cap-good); }
.stat.bad   .val{ color: var(--cap-bad); }

/* ---------- Forms ---------- */
label.fld{ display:block; font-size:11px; text-transform:uppercase; letter-spacing:0.08em; color: var(--cap-navy); font-weight:600; margin-bottom:4px; }
/* Required-field marker: a red asterisk after the label. Symfony adds the
   `required` class to labels of required fields automatically; hand-written
   labels of required fields carry the `required` class explicitly. */
label.required::after, .fld.required::after{ content:" *"; color: var(--cap-bad); font-weight:700; }
input, select, textarea{
  width:100%; padding: 8px 10px;
  font: 13px var(--sans); color: var(--cap-ink);
  background:#fff; border: 1px solid var(--cap-rule); border-radius: 2px;
  outline: none;
}
input:focus, select:focus, textarea:focus{
  border-color: var(--cap-navy); box-shadow: 0 0 0 3px rgba(33,68,122,0.10);
}
input[type="number"]{ text-align:right; -moz-appearance: textfield; appearance: textfield; }
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type="checkbox"], input[type="radio"]{ width:auto; }

.row{ display:flex; gap:14px; flex-wrap: wrap; align-items: flex-end; }
.row > *{ min-width: 0; }
.row .w32{ width:32%; min-width: 180px; }
.row .w24{ width:23%; min-width: 160px; }
.row .w18{ width:17%; min-width: 130px; }
.row .w12{ width:11.5%; min-width: 110px; }

/* ---------- Buttons ---------- */
.btn{
  display:inline-flex; align-items:center; gap:6px;
  padding: 8px 14px; font: 12.5px/1 var(--sans); font-weight:600;
  border: 1px solid transparent; border-radius: 2px;
  text-transform: uppercase; letter-spacing: 0.06em;
  cursor:pointer; user-select:none;
}
.btn:disabled{ opacity:0.5; cursor:not-allowed; }
.btn--primary{ background: var(--cap-navy); color:#fff; }
.btn--primary:hover:not(:disabled){ background: var(--cap-navy-2); }
.btn--gold{ background: var(--cap-gold); color:#fff; }
.btn--gold:hover:not(:disabled){ background: var(--cap-gold-2); }
.btn--ghost{ background: transparent; color: var(--cap-navy); }
.btn--ghost:hover{ background: var(--cap-navy-soft); }
.btn--outline{ background:#fff; color: var(--cap-navy); border-color: var(--cap-navy); }
.btn--outline:hover{ background: var(--cap-navy-soft); }
.btn--danger{ background:#fbeceb; color: var(--cap-bad); border-color:#e7c7c4; }
.btn--danger:hover{ background:#f8dcd9; }
.btn--sm{ padding: 5px 9px; font-size: 11px; }
.btn--icon{ padding: 6px; min-width: auto; }
.btn svg{ width: 14px; height:14px; }

/* ---------- Tables ---------- */
table.data{
  width:100%; border-collapse: collapse; background:#fff;
}
table.data th, table.data td{
  padding: 9px 12px; text-align: left; vertical-align: top;
  border-bottom: 1px solid var(--cap-rule); font-size: 13px;
}
table.data th{
  font-family: var(--sans); font-weight:600; font-size: 11px;
  color: var(--cap-navy); background: var(--cap-navy-soft);
  text-transform: uppercase; letter-spacing: 0.06em;
  border-top: 1px solid var(--cap-gold);
  border-bottom: 2px solid var(--cap-gold);
  position: sticky; top: 0; z-index: 1;
}
table.data td.r, table.data th.r{ text-align: right; font-variant-numeric: tabular-nums; }
table.data tbody tr:hover{ background: var(--cap-panel); }
table.data tbody tr.clickable{ cursor: pointer; }
table.data .empty{ text-align:center; color: var(--cap-muted); padding: 34px 0; }
table.data input, table.data select{ padding: 4px 6px; font-size: 12px; }
table.data input.cell{ width: 110px; text-align:right; border:1px solid var(--cap-rule); }

.card.table-wrap{ padding:0; overflow: hidden; }
.table-scroll{ max-height: 62vh; overflow:auto; }

/* ---------- Chips ---------- */
.chip{
  display:inline-flex; align-items:center; padding: 2px 8px; border-radius: 2px;
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.06em; font-weight:600;
}
.chip--navy{ background: var(--cap-navy); color:#fff; }
.chip--gold{ background: var(--cap-gold); color:#fff; }
.chip--soft{ background: var(--cap-navy-soft); color: var(--cap-navy); }
.chip--good{ background: var(--cap-good-bg); color: var(--cap-good); }
.chip--bad { background: var(--cap-bad-bg);  color: var(--cap-bad);  }
.chip--warn{ background: var(--cap-warn-bg); color: var(--cap-warn); }

/* cell backgrounds for monthly beat/miss */
.cell-beat{ background: var(--cap-good-bg) !important; }
.cell-miss{ background: var(--cap-bad-bg)  !important; }
.cell-flat{ background: var(--cap-warn-bg) !important; }

/* ---------- Modal ---------- */
.modal-back{
  position: fixed; inset: 0; background: rgba(23,50,88,0.55);
  display:flex; align-items:flex-start; justify-content:center;
  padding: 40px 16px; overflow:auto; z-index: 50;
}
.modal{
  background:#fff; width:100%; max-width: 720px;
  border-top: 3px solid var(--cap-gold); border-radius: 4px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.28);
}
.modal__head{
  display:flex; align-items:center; justify-content:space-between;
  padding: 16px 22px; border-bottom: 1px solid var(--cap-rule);
}
.modal__head h2{ margin:0; font-family: var(--serif); font-weight:400; color: var(--cap-navy); font-size: 20px; }
.modal__body{ padding: 18px 22px; }
.modal__foot{ padding: 14px 22px; border-top: 1px solid var(--cap-rule); display:flex; justify-content:flex-end; gap: 8px; }

/* ---------- Utility ---------- */
.flex{ display:flex; } .flex-1{ flex:1; }
.items-center{ align-items:center; } .items-end{ align-items:flex-end; }
.justify-between{ justify-content: space-between; }
.gap-8{ gap:8px; } .gap-12{ gap:12px; } .gap-16{ gap:16px; } .gap-24{ gap:24px; }
.mt-4{ margin-top:4px; } .mt-8{ margin-top:8px; } .mt-12{ margin-top:12px; } .mt-16{ margin-top:16px; } .mt-20{ margin-top:20px; } .mt-24{ margin-top: 24px; }
.mb-4{ margin-bottom:4px; } .mb-8{ margin-bottom:8px; } .mb-12{ margin-bottom:12px; } .mb-16{ margin-bottom:16px; }
.grid{ display:grid; }
.grid-2{ grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.grid-3{ grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
.grid-4{ grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; }
.text-muted{ color: var(--cap-muted); }
.text-ink-2{ color: var(--cap-ink-2); }
.text-sm{ font-size: 12px; }
.text-xs{ font-size: 11px; }
.text-good{ color: var(--cap-good); }
.text-bad { color: var(--cap-bad);  }
.text-warn{ color: var(--cap-warn); }
.fw-600{ font-weight: 600; }
.bold{ font-weight: 700; }
.nowrap{ white-space: nowrap; }
.truncate{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
hr.rule{ border:0; border-top: 1px solid var(--cap-rule); margin: 16px 0; }

/* Section header — title + action button */
.section-head{
  display:flex; align-items:center; justify-content:space-between;
  margin-bottom: 16px; gap:12px;
}
.section-head .actions{ display:flex; gap:8px; }

/* Tiny link-looking button */
.lnk{ color: var(--cap-navy); text-decoration: underline; cursor: pointer; background:none; border:0; font: inherit; padding:0; }

/* Scrollbar */
*::-webkit-scrollbar{ width:10px; height:10px; }
*::-webkit-scrollbar-thumb{ background: var(--cap-navy-rim); border-radius: 4px; }
*::-webkit-scrollbar-track{ background: transparent; }

/* Banner (e.g., PDF attached) */
.banner{
  display:flex; align-items:center; gap: 12px;
  padding: 12px 16px; border-radius: 3px;
  background: var(--cap-gold-soft); border: 1px solid var(--cap-gold);
  color: var(--cap-navy); font-size: 13px;
  margin-bottom: 16px;
}
.banner svg{ width:18px; height:18px; color: var(--cap-gold-2); }

/* Dashboard list blocks */
.list-dot{ list-style:none; padding:0; margin:0; }
.list-dot li{ display:flex; gap:10px; padding: 8px 0; border-bottom: 1px solid var(--cap-rule); }
.list-dot li:last-child{ border-bottom:0; }
.list-dot li .dot{ width: 6px; height:6px; border-radius:50%; background: var(--cap-gold); margin-top: 8px; flex-shrink:0; }

/* Tab bar (Reports) */
.tabs{ display:flex; border-bottom: 1px solid var(--cap-rule); margin-bottom: 16px; }
.tab{
  padding: 9px 16px; font-size: 13px; font-weight:600;
  color: var(--cap-muted); cursor:pointer; border-bottom: 2px solid transparent;
}
.tab.active{ color: var(--cap-navy); border-bottom-color: var(--cap-gold); }

.pipe-bar{ display:flex; height: 10px; border-radius: 2px; overflow:hidden; background: var(--cap-panel); margin: 4px 0 12px; }
.pipe-bar > div{ height: 100%; }
.legend-sw{ width: 10px; height: 10px; border-radius: 2px; display:inline-block; margin-right: 6px; }

.cal-grid{ display: flex; flex-direction: column; border:1px solid var(--cap-rule); border-radius: 4px; overflow:hidden; background:#fff; }
.cal-row{ display:grid; grid-template-columns: repeat(7, 1fr); border-top:1px solid var(--cap-rule); }
.cal-row:first-child{ border-top:0; }
.cal-row.cal-head{ background: var(--cap-panel); font-weight:600; color: var(--cap-navy); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.cal-row.cal-head .cal-cell{ padding: 6px 8px; min-height: auto; }
.cal-cell{ border-left:1px solid var(--cap-rule); min-height: 92px; padding: 4px 6px; display:flex; flex-direction:column; gap:2px; cursor:pointer; }
.cal-cell:first-child{ border-left:0; }
.cal-cell--out{ background: #fafafa; color: var(--cap-muted); }
.cal-cell--today{ background: #fff8e5; }
.cal-num{ font-size: 12px; font-weight: 600; color: var(--cap-navy); }
.cal-cell--out .cal-num{ color: var(--cap-muted); font-weight: 400; }
.cal-event{ display:flex; gap:4px; font-size: 11px; padding:2px 4px; background: var(--cap-navy); color:#fff; border-radius: 2px; cursor:pointer; align-items:center; overflow:hidden; }
.cal-event__time{ font-weight: 600; flex: 0 0 auto; }
.cal-event__txt{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; flex: 1 1 auto; }
.cal-event--more{ background: var(--cap-panel); color: var(--cap-navy); justify-content:center; font-weight:600; }

/* ---------- App-shell helpers (logged-in topbar; brand-consistent) ---------- */
.app-header{ display:flex; align-items:center; justify-content:space-between; gap:16px; padding:14px 32px; background:#fff; border-bottom:1px solid var(--cap-rule); }
.app-brand{ text-decoration:none; }
.app-brand .wordmark{ color:var(--cap-navy); font-size:22px; }
.app-brand .wordmark .sub{ color:var(--cap-gold); }
.app-header-right{ display:flex; align-items:center; gap:18px; }
.app-locales{ display:flex; gap:6px; font-size:13px; }
.app-locale{ color:var(--cap-ink-2); padding:3px 8px; border-radius:3px; }
.app-locale.is-active{ color:var(--cap-navy); font-weight:600; background:var(--cap-navy-soft); }
.app-user{ display:flex; align-items:center; gap:12px; font-size:13px; color:var(--cap-ink-2); }
.app-user-name{ font-weight:600; color:var(--cap-navy); }
.app-logout{ color:var(--cap-navy); border:1px solid var(--cap-navy-rim); padding:5px 12px; border-radius:2px; text-transform:uppercase; letter-spacing:.06em; font-size:11px; font-weight:600; }
.app-logout:hover{ background:var(--cap-navy-soft); }
.app-main{ max-width:1100px; margin:28px auto; padding:0 32px; }
.home{ background:var(--cap-card); border:1px solid var(--cap-rule); border-radius:4px; padding:24px 26px; }

/* Language switcher on the full-screen login (top-right, on the gradient). */
.login-shell{ position:relative; }
.login-locales{ position:absolute; top:18px; right:24px; display:flex; gap:6px; font-size:13px; }
.login-locales a, .login-locales span{ color:#CDD9EE; text-decoration:none; padding:3px 9px; border-radius:3px; }
.login-locales a:hover{ background:rgba(255,255,255,0.10); color:#fff; }
.login-locales .is-active{ color:#fff; font-weight:600; background:rgba(255,255,255,0.14); }

/* ---------- Customer contacts editor ---------- */
.contact-line{ display:flex; align-items:flex-start; gap:10px; padding:8px 10px; border:1px solid var(--cap-rule); border-radius:3px; margin-bottom:6px; background:#fff; }

/* ============================================================
   Mobile / tablet — off-canvas sidebar. Desktop layout untouched
   (these rules only apply at <= 860px; the toggle/overlay are
   hidden above that width).
   ============================================================ */
.nav-toggle{ display:none; }
.nav-overlay{ display:none; }

@media (max-width: 860px){
  /* Sidebar slides in from the left instead of taking a fixed column. */
  .sidebar{
    position: fixed; top:0; left:0; bottom:0; height:100vh;
    width: 250px; max-width: 82vw;
    transform: translateX(-100%);
    transition: transform .2s ease;
    z-index: 80;
  }
  .app.nav-open .sidebar{ transform: translateX(0); box-shadow: 0 0 28px rgba(0,0,0,0.40); }

  .app.nav-open .nav-overlay{
    display:block; position: fixed; inset:0;
    background: rgba(0,0,0,0.45); z-index: 70;
  }

  /* Hamburger toggle in the topbar. */
  .nav-toggle{
    display:inline-flex; align-items:center; justify-content:center;
    width:40px; height:40px; flex-shrink:0;
    background:#fff; border:1px solid var(--cap-rule); border-radius:4px;
    color: var(--cap-navy); cursor:pointer;
  }
  .nav-toggle svg{ width:20px; height:20px; }

  /* Topbar wraps; the right-hand block drops onto its own line. */
  .topbar{ padding: 10px 14px; gap:10px; flex-wrap:wrap; justify-content:flex-start; align-items:center; }
  .topbar__left{ flex:1 1 auto; min-width:0; }
  .topbar__right{ width:100%; gap:10px; align-items:center; justify-content:space-between; }

  /* Tighter content padding so the page is usable on a phone. */
  .page__body{ padding: 16px 14px 22px; }
  .page__foot{ padding: 10px 14px; }
  h1.page-title{ font-size: 24px; }

  /* Stack the grids. */
  .stat-grid{ grid-template-columns: repeat(2, minmax(0,1fr)); }
  .grid-2, .grid-3, .grid-4{ grid-template-columns: 1fr; }

  /* Section headers and filter rows wrap; filter fields go full width. */
  .section-head{ flex-wrap: wrap; }
  .section-head .actions{ flex-wrap: wrap; }
  .row .w32, .row .w24, .row .w18, .row .w12{ width:100%; }
}

@media (max-width: 480px){
  .stat-grid{ grid-template-columns: 1fr; }
}

/* Voice dictation: highlight the mic button while recording. */
.is-listening .btn[data-dictation-target="button"]{ color: var(--cap-bad); }

/* Opportunity assistant: big tap-friendly option lists (listbox) + invalid shake. */
.listbox{ display:flex; flex-direction:column; gap:8px; }
.listbox-item{
  display:flex; align-items:center; gap:10px;
  padding:12px 14px; border:1px solid #e5e7eb; border-radius:6px;
  cursor:pointer; user-select:none; transition:border-color .12s, background .12s;
}
.listbox-item:hover{ border-color:var(--cap-navy); }
.listbox-item:has(input:checked){ border-color:var(--cap-navy); background:#eef3fb; }
.listbox-item input{ flex:0 0 auto; width:auto; }
.listbox-item span{ flex:1 1 auto; min-width:0; }
@keyframes cap-shake{ 0%,100%{transform:translateX(0)} 25%{transform:translateX(-5px)} 75%{transform:translateX(5px)} }
.shake{ animation:cap-shake .3s; }
.is-recording{ outline:2px solid var(--cap-bad); outline-offset:2px; border-radius:6px; }

/* Opportunity assistant wizard: only one step visible; robust against [hidden]
   being overridden. Step 1 is marked is-active server-side as a no-JS fallback. */
.wiz-pane{ display:none; }
.wiz-pane.is-active{ display:block; }
/* Show an element only on mobile/tablet (matches the app's 860px breakpoint). */
.only-mobile{ display:none; }
@media (max-width:860px){ .only-mobile{ display:inline-flex; } }
