/* ABE Franchise Portal — ported from the approved Claude Design screens (design/*.dc.html). */
:root {
  --ink: #1F1D1A;
  --page: #F7F5F0;
  --card: #FFFFFF;
  --border: #E4E0D8;
  --rule: #EEEAE2;
  --field: #CFC9BE;
  --yolk: #F4B63F;
  --tint: #FCEBC4;
  --tint-row: #FFFBF0;
  --muted: #625D55;
  --nav: #4A4640;
  --head: #FAF8F4;
  --chip: #F2EFE9;
  --link: #7A4E00;
  --link-hover: #4F3200;
  --warn: #8A4B00;
  --ok: #2F6B3A;
  --danger: #9A2B1F;
  --down: #1E5A8A;
  --dark-rule: #3A3631;
  --dark-muted: #D9D4CA;
  --dark-muted2: #CFC9BE;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-family: 'Figtree', system-ui, sans-serif; color: var(--ink); background: var(--page); font-size: 16px; }
a { color: var(--link); }
a:hover { color: var(--link-hover); }
input, select, button, textarea { font: inherit; }
h1, h2, h3 { margin: 0; }
p { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

/* ---------- header ---------- */
.site-header { background: var(--card); border-bottom: 1px solid var(--border); }
.site-header .inner { max-width: 1280px; margin: 0 auto; padding: 14px 32px; display: flex; flex-wrap: wrap; align-items: center; gap: 16px 32px; }
.site-header img { height: 40px; width: auto; }
.main-nav { display: flex; flex-wrap: wrap; gap: 4px; flex: 1 1 auto; }
.main-nav a { padding: 12px 14px; border-radius: 8px; text-decoration: none; font-weight: 600; color: var(--nav); }
.main-nav a[aria-current="page"] { font-weight: 700; color: var(--ink); background: var(--tint); }
/* Admin dropdown (system admin only) */
.nav-menu { position: relative; }
.nav-menu summary { list-style: none; cursor: pointer; padding: 12px 14px; border-radius: 8px; font-weight: 600; color: var(--nav); display: flex; align-items: center; gap: 6px; }
.nav-menu summary::-webkit-details-marker { display: none; }
.nav-menu summary::after { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); }
.nav-menu[open] summary::after { transform: translateY(2px) rotate(-135deg); }
.nav-menu summary.current { font-weight: 700; color: var(--ink); background: var(--tint); }
.nav-menu summary:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.nav-menu .menu { position: absolute; top: calc(100% + 6px); left: 0; z-index: 20; min-width: 210px; display: flex; flex-direction: column; gap: 2px;
                  padding: 6px; background: var(--card); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 24px rgba(31, 29, 26, .14); }
.nav-menu .menu a { padding: 10px 12px; }
.nav-menu .menu a:hover { background: var(--head); }
.who { display: flex; align-items: center; gap: 12px; }
.who .id { display: flex; flex-direction: column; align-items: flex-end; }
.who .id strong { font-size: 14px; }
.who .id span { font-size: 13px; color: var(--muted); }
.link-button { background: none; border: 0; padding: 12px 8px; color: var(--link); text-decoration: underline; cursor: pointer; font-size: 14px; }

/* ---------- page shell ---------- */
.page { max-width: 1280px; margin: 0 auto; padding: 32px 32px 64px; display: flex; flex-direction: column; gap: 24px; }
.page.roomy { padding-top: 40px; gap: 32px; }
.breadcrumb { font-size: 14px; color: var(--muted); }
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; }
.page-head .titles { display: flex; flex-direction: column; gap: 6px; }
.page-head h1 { font-size: 34px; font-weight: 800; letter-spacing: -0.01em; }
.page-head h1.xl { font-size: 36px; }
.page-head .sub { font-size: 16px; color: var(--muted); }
.page > *, .split > * { min-width: 0; }
.title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.split { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.split > .main-col { flex: 999 1 640px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.split > .side-col { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 10px;
       border: 1px solid var(--field); background: var(--card); color: var(--ink); text-decoration: none; font-weight: 600; cursor: pointer; }
.btn:hover { color: var(--ink); border-color: #B8B1A4; }
.btn-primary { border: 0; background: var(--yolk); font-weight: 700; padding: 0 22px; }
.btn-primary:hover { background: #E9A92E; }
.btn-dark { border: 0; background: var(--ink); color: #FFFFFF; font-weight: 700; }
.btn-dark:hover { color: #FFFFFF; background: #34312C; }
.btn-danger { color: var(--danger); }
.btn-ghost-dark { border: 1px solid #5A554D; background: transparent; color: var(--page); }
.btn-ghost-dark:hover { color: #FFFFFF; border-color: #8A847A; }
.btn-tall { min-height: 48px; }
.btn[disabled], .btn:disabled { background: var(--chip); color: var(--muted); border: 1px solid var(--field); cursor: not-allowed; }
.btn-text { border: 0; background: transparent; color: var(--link); font-weight: 600; text-decoration: underline; cursor: pointer; min-height: 44px; padding: 0 12px; }

/* ---------- cards ---------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; }
.card.pad { padding: 28px; display: flex; flex-direction: column; gap: 24px; }
.card.pad-sm { padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.card.clip { overflow: hidden; }
.card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 24px; border-bottom: 1px solid var(--rule); }
.card-head h2 { font-size: 18px; font-weight: 700; }
.card-head h2.lg { font-size: 20px; }
.card-foot { padding: 14px 24px; border-top: 1px solid var(--rule); font-size: 14px; color: var(--muted); }
.section-title { display: flex; flex-direction: column; gap: 4px; }
.section-title h2 { font-size: 20px; font-weight: 700; }
.section-title p { font-size: 15px; color: var(--muted); }
.dark-card { background: var(--ink); color: var(--page); border-radius: 16px; padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.dark-card h2 { font-size: 18px; font-weight: 700; }
.dark-card .line { display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid var(--dark-rule); padding-top: 12px; font-size: 15px; }
.dark-card .line span:first-child { color: var(--dark-muted); }
.dark-card .line span:last-child { font-weight: 700; }
.dark-card .note { font-size: 13px; color: var(--dark-muted2); line-height: 1.5; }

/* ---------- banners & alerts ---------- */
.banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; background: var(--ink); color: var(--page);
          border-radius: 16px; padding: 28px 32px; }
.banner .text { display: flex; flex-direction: column; gap: 6px; }
.banner .eyebrow { font-size: 13px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--yolk); }
.banner .big { font-size: 24px; font-weight: 700; }
.banner .small { font-size: 15px; color: var(--dark-muted); }
.alert { border-radius: 12px; padding: 14px 18px; font-size: 15px; border: 1px solid var(--border); background: var(--card); }
.alert-ok { border-color: #BFD8C3; background: #EEF6EF; color: #1F4D28; }
.alert-error { border-color: #E8C2BC; background: #FBEDEA; color: #7A2216; }
.alert-warn { border-color: #EBD3A6; background: #FFF6E3; color: #6A3A00; }
.alert ul { margin: 6px 0 0; padding-left: 20px; }

/* ---------- stat tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 16px; }
.tile { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 22px; display: flex; flex-direction: column; gap: 6px; }
.tile .label { font-size: 14px; color: var(--muted); font-weight: 600; }
.tile .value { font-size: 34px; font-weight: 800; }
.tile .value.warn { color: var(--warn); }
.tile .value.text { font-size: 22px; line-height: 1.3; padding: 6px 0; }
.tile .hint { font-size: 14px; color: var(--muted); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; font-size: 15px; }
table.grid thead tr { background: var(--head); text-align: left; }
table.grid th[scope="col"] { padding: 12px 16px; font-size: 13px; color: var(--muted); font-weight: 700; }
table.grid th[scope="col"]:first-child, table.grid td:first-child, table.grid th[scope="row"] { padding-left: 24px; }
table.grid th[scope="col"]:last-child, table.grid td:last-child { padding-right: 24px; }
table.grid td { padding: 14px 16px; vertical-align: middle; }
table.grid th[scope="row"] { padding: 10px 16px 10px 24px; text-align: left; font-weight: 600; }
table.grid tbody tr { border-top: 1px solid var(--rule); }
table.grid tbody tr.cat-row td { background: var(--head); font-weight: 700; font-size: 14px; padding-top: 10px; padding-bottom: 10px; }
table.grid tbody tr.changed { background: var(--tint-row); }
table.grid tfoot tr { border-top: 2px solid var(--ink); background: var(--head); }
table.grid tfoot th, table.grid tfoot td { padding: 14px 12px; font-weight: 800; }
table.grid tfoot th { padding-left: 24px; text-align: left; }
table.grid.compact td { padding: 12px 12px; }
table.grid.report { font-size: 14px; }
table.grid.report th[scope="col"] { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; padding: 12px; }
table.grid.report td { padding: 12px; }
.w-900 { min-width: 900px; }
.w-860 { min-width: 860px; }
.w-680 { min-width: 680px; }
.w-760 { min-width: 760px; }
.w-1060 { min-width: 1060px; }
.cell-stack { display: flex; flex-direction: column; gap: 2px; }
.cell-stack .t { font-weight: 700; }
.cell-stack .s { font-size: 13px; color: var(--muted); font-weight: 500; }
.cell-stack .al-note { font-size: 13px; color: #6A3A00; background: #FFF6E3; border: 1px solid #EBD3A6; border-radius: 8px; padding: 4px 8px; margin-top: 2px; }
.chip { display: inline-block; padding: 4px 10px; border-radius: 999px; background: var(--chip); font-weight: 600; font-size: 14px; }
.badge { display: inline-block; padding: 4px 12px; border-radius: 999px; background: var(--tint); font-size: 13px; font-weight: 700; }
.badge.final { background: #DCEBDF; color: #1F4D28; }
.badge.frozen { background: #DDE7F1; color: #163E60; }
.badge.closed { background: var(--chip); color: var(--muted); }
.badge.sm { padding: 2px 8px; font-size: 12px; }
.status { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14px; }
.status.ok { color: var(--ok); }
.status.warn { color: var(--warn); }
.row-link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; font-weight: 600; }
.diff-up { color: var(--link); }
.diff-down { color: var(--down); }
.diff-none { color: var(--muted); }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label, .field .label { font-size: 14px; font-weight: 600; }
.field .opt { font-weight: 400; color: var(--muted); }
.field .help { font-size: 13px; color: var(--muted); }
.input, .select { min-height: 44px; padding: 0 12px; border: 1px solid var(--field); border-radius: 8px; font-size: 15px; background: var(--card); min-width: 0; width: 100%; }
.select { padding: 0 8px; }
.input.sm, .select.sm { min-height: 40px; width: auto; }
.input:focus, .select:focus, .money:focus-within { outline: 2px solid var(--ink); outline-offset: 1px; }
.input-validation-error { border-color: var(--danger); }
.field-validation-error { color: var(--danger); font-size: 13px; }
.addr-row { display: grid; grid-template-columns: 2fr 1fr 1.4fr; gap: 10px; }
.inline-field { display: flex; align-items: center; gap: 8px; }
.inline-field label { font-size: 14px; color: var(--muted); }
.money { display: flex; align-items: center; border: 1px solid var(--field); border-radius: 8px; background: var(--card); width: 120px; padding-left: 10px; }
.money span { color: var(--muted); }
.money input { min-height: 40px; border: 0; padding: 0 8px; width: 100%; font-size: 15px; font-variant-numeric: tabular-nums; background: transparent; outline: none; }
.qty { min-height: 44px; width: 110px; padding: 0 12px; border: 1px solid var(--field); border-radius: 8px; font-size: 15px; font-variant-numeric: tabular-nums; }
.qty:disabled, .money input:disabled { background: var(--chip); color: var(--muted); }

/* tier picker cards */
.tier-menu { border: 0; border-top: 1px solid var(--rule); margin: 0; padding: 20px 0 0; display: flex; flex-direction: column; gap: 12px; }
.tier-menu legend { padding: 0; font-weight: 700; font-size: 16px; float: left; width: 100%; margin-bottom: 4px; }
.tier-menu legend span { font-weight: 500; color: var(--muted); font-size: 14px; }
.tier-options { display: flex; flex-wrap: wrap; gap: 10px; clear: both; }
.tier-option { position: relative; }
.tier-option input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.tier-option .face { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; min-height: 60px; min-width: 120px;
                     padding: 8px 16px; border-radius: 10px; border: 1px solid var(--field); background: var(--card); }
.tier-option .face strong { font-size: 15px; }
.tier-option .face span { font-size: 13px; color: var(--muted); }
.tier-option input:checked + .face { border: 2px solid var(--ink); background: var(--tint); padding: 7px 15px; }
.tier-option input:focus-visible + .face { outline: 2px solid var(--link); outline-offset: 2px; }
.add-custom { display: flex; flex-direction: column; justify-content: center; min-height: 60px; padding: 0 16px; border: 1px dashed #B8B1A4;
              border-radius: 10px; text-decoration: none; font-weight: 600; font-size: 14px; }

/* yes/no segmented control */
.q { border-top: 1px solid var(--rule); padding: 20px 0; display: flex; flex-direction: column; gap: 14px; }
.q:last-child { padding-bottom: 0; }
.q-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.q-row .q-text { font-weight: 600; font-size: 16px; flex: 1 1 320px; }
.q-row .q-text.sm { font-size: 15px; flex-basis: 300px; }
.seg { display: flex; border: 1px solid var(--field); border-radius: 10px; overflow: hidden; background: var(--card); }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span { display: flex; align-items: center; justify-content: center; min-height: 44px; min-width: 64px; padding: 0 16px; font-weight: 700; font-size: 15px; color: var(--nav); cursor: pointer; }
.seg input:checked + span { background: var(--ink); color: #FFFFFF; }
.seg input:focus-visible + span { outline: 2px solid var(--link); outline-offset: -3px; }
.q-more { display: flex; flex-wrap: wrap; gap: 16px; background: var(--head); border-radius: 10px; padding: 16px; }
.q-more.narrow { flex-direction: column; gap: 6px; max-width: 280px; }
.q-more.between { justify-content: space-between; align-items: center; gap: 12px; }
.q-more .field { flex: 1 1 200px; }
[hidden] { display: none !important; }

/* tabs */
.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--border); }
.tabs a { min-height: 48px; display: inline-flex; align-items: center; padding: 0 20px; font-size: 16px; text-decoration: none;
          margin-bottom: -1px; font-weight: 600; color: var(--muted); border-bottom: 3px solid transparent; }
.tabs a[aria-selected="true"] { font-weight: 700; color: var(--ink); border-bottom-color: var(--ink); }

/* check list (apply to cafés) */
.check-row { display: flex; align-items: center; gap: 12px; min-height: 44px; border-top: 1px solid var(--rule); font-size: 15px; }
.check-row input { width: 18px; height: 18px; accent-color: var(--ink); }
.check-row .name { flex: 1; }
.check-row .meta { font-size: 13px; color: var(--muted); }
.history-item { display: flex; flex-direction: column; gap: 2px; border-top: 1px solid var(--rule); padding-top: 10px; }
.history-item strong { font-size: 15px; font-weight: 600; }
.history-item span { font-size: 13px; color: var(--muted); }

/* quick fill & order footer */
.quick { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px; padding: 20px 24px; }
.quick h2 { font-size: 16px; font-weight: 700; flex: 1 1 100%; }
.progress { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--card); border: 1px solid var(--border); border-radius: 12px; }
.progress strong { font-size: 18px; font-weight: 800; }
.order-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; background: var(--ink); color: var(--page);
             border-radius: 16px; padding: 20px 24px; position: sticky; bottom: 12px; }
.order-bar .text { display: flex; flex-direction: column; gap: 4px; }
.order-bar strong { font-size: 18px; }
.order-bar span { font-size: 14px; color: var(--dark-muted2); }

/* report picker */
.report-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 16px; }
.report-card { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 20px 22px; border-radius: 14px; color: var(--ink);
               text-decoration: none; min-height: 96px; border: 1px solid var(--border); background: var(--card); }
.report-card[aria-current="true"] { border: 2px solid var(--ink); background: var(--tint); padding: 19px 21px; }
.report-card strong { font-size: 17px; }
.report-card span { font-size: 14px; color: var(--muted); line-height: 1.45; }
.filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

/* ---------- sign in ---------- */
.signin { min-height: 100vh; display: flex; flex-wrap: wrap; }
.signin .brand { flex: 1 1 520px; background: var(--ink); color: var(--page); padding: 72px 64px; display: flex; flex-direction: column; justify-content: space-between; gap: 48px; }
.signin .brand .intro { display: flex; flex-direction: column; gap: 20px; max-width: 520px; }
.signin .eyebrow { font-size: 14px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--yolk); }
.signin h1 { font-size: 52px; line-height: 1.05; font-weight: 800; letter-spacing: -0.02em; }
.signin .lead { font-size: 18px; line-height: 1.55; color: var(--dark-muted); }
.signin .features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; max-width: 620px; }
.signin .features div { display: flex; flex-direction: column; gap: 6px; border-top: 2px solid var(--yolk); padding-top: 14px; }
.signin .features strong { font-size: 15px; }
.signin .features span { font-size: 14px; color: var(--dark-muted2); line-height: 1.45; }
.signin .panel { flex: 1 1 520px; display: flex; align-items: center; justify-content: center; padding: 64px 32px; }
.signin .box { width: 100%; max-width: 440px; background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 48px 40px;
               display: flex; flex-direction: column; gap: 24px; box-shadow: 0 1px 2px rgba(31,29,26,0.04), 0 12px 32px rgba(31,29,26,0.06); }
.signin .box img { width: 100%; max-width: 340px; height: auto; align-self: center; }
.signin .box .heading { display: flex; flex-direction: column; gap: 8px; text-align: center; }
.signin .box h2 { font-size: 24px; font-weight: 700; }
.signin .box .heading p { font-size: 15px; color: var(--muted); line-height: 1.5; }
.signin .box form { display: flex; flex-direction: column; gap: 16px; }
.signin .go { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; background: var(--yolk); color: var(--ink);
              border: 0; font-weight: 700; font-size: 16px; border-radius: 10px; cursor: pointer; width: 100%; }
.signin .go:hover { background: #E9A92E; }
.signin .fine { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); text-align: center; line-height: 1.5;
                border-top: 1px solid var(--rule); padding-top: 20px; }

/* ---------- responsive ---------- */
@media (max-width: 720px) {
  .site-header .inner, .page { padding-left: 16px; padding-right: 16px; }
  .page-head h1, .page-head h1.xl { font-size: 28px; }
  .banner { padding: 22px 20px; }
  .card.pad { padding: 20px; }
  .signin .brand { padding: 48px 24px; }
  .signin h1 { font-size: 38px; }
  .signin .features { grid-template-columns: 1fr; }
  .signin .panel { padding: 32px 16px; }
  .signin .box { padding: 32px 22px; }
  .addr-row { grid-template-columns: 1fr 1fr; }
  .addr-row .field:first-child { grid-column: 1 / -1; }
  .order-bar { position: static; }
}

/* utilities (inline styles are blocked by the CSP) */
.form-stack { display: flex; flex-direction: column; gap: 24px; }
.card.pad.tight { gap: 4px; }
.mb-12 { margin-bottom: 12px; }
.h-18 { font-size: 18px; font-weight: 700; }
.gap-0 { gap: 0 !important; }
.sub-note { font-weight: 500; font-size: 15px; color: var(--muted); }
.fw-600 { font-weight: 600; }
.fs-14 { font-size: 14px; }
.btn-block { width: 100%; margin-top: 8px; }
.q-more label { font-size: 14px; font-weight: 600; }
.actions.end { justify-content: flex-end; }
.mt-24 { margin-top: 24px; }
.fs-18 { font-size: 18px; }

/* "See where this prints" image panels on the café setup questions */
details.where { font-size: 14px; }
details.where summary { cursor: pointer; color: var(--link); font-weight: 600; min-height: 32px; display: inline-flex; align-items: center; }
details.where img { display: block; max-width: 100%; height: auto; margin-top: 10px; border: 1px solid var(--border); border-radius: 10px; }
.help-text { font-size: 14px; color: var(--muted); line-height: 1.5; }
.tier-option.mismatch .face { border: 2px dashed var(--danger); }
.al-msg { color: var(--danger); font-weight: 600; }
table.grid tbody tr.al-bad { background: #FBEDEA; }

.textarea { min-height: 64px; padding: 10px 12px; resize: vertical; }
