/* BOBPEY Billing: one stylesheet for every screen.
   Design source: designs/ (Teal Blue palette, dark teal sidebar, white header, Roboto).
   Design rules (17 Nov 2026 clean-up): white surfaces with thin borders, one accent (teal),
   colour only where it means something (status), one spacing scale (4/8/12/16/20/24),
   four text sizes (page title, section title, body, small). */

:root {
  --teal-900: #082f33;
  --teal-800: #0b3a3e;
  --teal-700: #0e4a4f;
  --teal-600: #0f766e;
  --teal-500: #14857c;
  --teal-400: #2bb3a6;
  --teal-100: #ddf1ed;
  --teal-50: #f0f8f6;

  --bg: #f5f7f9;
  --surface: #ffffff;
  --subtle: #f7f9fa;
  --text: #1b2530;
  --muted: #667380;
  --line: #e6eaee;
  --line-strong: #d3dae0;
  --focus: #0ea5a0;

  --green: #15803d;   --green-bg: #e8f6ed;
  --blue: #1d4ed8;    --blue-bg: #eaf1fe;
  --amber: #b45309;   --amber-bg: #fdf3e3;
  --purple: #6d28d9;  --purple-bg: #f1ebfd;
  --red: #c62828;     --red-bg: #fcebeb;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-pop: 0 12px 32px rgba(16, 24, 40, .14);
  --sidebar-w: 240px;
  --topbar-h: 60px;
  --font: "Roboto", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 14px; line-height: 1.5; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; }
a { color: var(--teal-600); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0 0 .5rem; line-height: 1.3; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1rem; }
h3 { font-size: .95rem; }
p { margin: 0 0 1rem; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 100; background: #fff; padding: 8px 12px; border-radius: var(--radius-sm); }
.skip-link:focus { left: 8px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---- Shell: sidebar + header ------------------------------------------------------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 40;
  display: flex; flex-direction: column;
  background: #0a2e32;
  border-right: 1px solid rgba(255, 255, 255, .04);
  color: #c9dedb;
}
/* Logo in its own rounded tile (the outlet logos carry a black background), then the place. */
.sidebar__head { padding: 16px 14px 12px; border-bottom: 1px solid rgba(255, 255, 255, .07); }
.sidebar__brand { display: flex; align-items: center; justify-content: center; height: 76px; padding: 8px 12px; border-radius: 12px; background: #000; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); }
.brand-global .sidebar__brand { background: #fff; }
.sidebar__brand img { max-height: 60px; max-width: 100%; width: auto; object-fit: contain; }
.brand-global .sidebar__brand img { max-height: 44px; }
.brand-cafe .sidebar__brand { height: 92px; }
.brand-cafe .sidebar__brand img { max-height: 78px; }
.sidebar__place { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 10px; font-size: .82rem; color: #9fc0bb; white-space: nowrap; overflow: hidden; }
.sidebar__place span { overflow: hidden; text-overflow: ellipsis; }
.sidebar__place .bi { color: var(--teal-400); font-size: .8rem; }

.sidebar__nav { flex: 1; overflow-y: auto; padding: 8px 10px 12px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .15) transparent; }
.sidebar__nav ul, .sidebar__foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.sidebar__section { margin: 14px 12px 4px; font-size: .7rem; font-weight: 500; letter-spacing: .09em; text-transform: uppercase; color: #6f9893; }
.sidebar__link {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 40px; padding: 8px 12px;
  border: 0; border-radius: var(--radius-sm); background: none; color: #c9dedb; font: inherit; font-weight: 500; font-size: .92rem;
  text-align: left; text-decoration: none; cursor: pointer;
}
.sidebar__link .bi { font-size: 1.05rem; width: 20px; text-align: center; color: #8fb5b0; }
.sidebar__link > span:not(.sidebar__badge) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar__link:hover { background: rgba(255, 255, 255, .06); color: #fff; text-decoration: none; }
.sidebar__link:hover .bi { color: #fff; }
.sidebar__link.is-active { background: rgba(43, 179, 166, .16); color: #fff; }
.sidebar__link.is-active::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--teal-400); }
.sidebar__link.is-active .bi { color: #5fd3c7; }
.sidebar__badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: #f59e0b; color: #1b1300; font-size: .72rem; font-weight: 700; line-height: 20px; text-align: center; }
.sidebar__foot { padding: 8px 10px 12px; border-top: 1px solid rgba(255, 255, 255, .07); }
.sidebar__foot form { margin: 0; }
.sidebar__version { margin: 8px 12px 0; font-size: .72rem; color: #6f9893; }
.sidebar-backdrop { position: fixed; inset: 0; z-index: 30; background: rgba(5, 25, 28, .45); }

.frame { flex: 1; min-width: 0; margin-left: var(--sidebar-w); display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; height: var(--topbar-h);
  display: flex; align-items: center; gap: 16px; padding: 0 24px;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.topbar__menu, .topbar__bell {
  display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px;
  border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text); font-size: 1.3rem; cursor: pointer;
}
.topbar__menu:hover, .topbar__bell:hover { background: var(--bg); }
.topbar__title { display: flex; align-items: baseline; gap: 10px; min-width: 0; white-space: nowrap; overflow: hidden; }
.topbar__title strong { font-size: 1.05rem; font-weight: 700; letter-spacing: .01em; }
.topbar__title span { padding-left: 10px; border-left: 1px solid var(--line-strong); color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.topbar__chip, .topbar__location { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--text); font-weight: 500; white-space: nowrap; }
.topbar__chip .bi, .topbar__location .bi { color: var(--muted); }
.topbar__end { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.topbar__user { display: flex; align-items: center; gap: 10px; padding-left: 12px; border-left: 1px solid var(--line); }
.topbar__who { display: grid; line-height: 1.25; }
.topbar__who strong { font-weight: 500; }
.topbar__who small { color: var(--muted); font-size: .8rem; }
.topbar__location--switch select { border: 0; background: transparent; font: inherit; font-weight: 500; color: var(--text); max-width: 260px; cursor: pointer; }
.usermenu { position: relative; }
.usermenu summary { list-style: none; cursor: pointer; border-radius: var(--radius-sm); padding: 4px 8px 4px 12px; }
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu summary:hover { background: var(--bg); }
.usermenu__caret { color: var(--muted); }
.usermenu__panel {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 200px; z-index: 50; padding: 6px;
  background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-pop);
}
.usermenu__panel a, .usermenu__panel button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border: 0; border-radius: 6px;
  background: none; color: var(--text); font: inherit; text-decoration: none; text-align: left; cursor: pointer;
}
.usermenu__panel a:hover, .usermenu__panel button:hover { background: var(--teal-50); text-decoration: none; }
.usermenu__panel form { margin: 0; }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: var(--teal-700); color: #fff; font-weight: 500; font-size: .85rem; flex: none; }

.main { padding: 24px; width: 100%; max-width: 1440px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin-bottom: 20px; }
.page-head h1 { margin: 0; }
.page-head p { margin: 2px 0 0; color: var(--muted); }
.page-head__actions { display: flex; flex-wrap: wrap; gap: 8px; }

@media (max-width: 1199px) { .topbar__title span, .topbar__chip--date { display: none; } }
@media (max-width: 991px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; }
  .sidebar.is-open { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .35); }
  .frame { margin-left: 0; }
  .topbar { padding: 0 12px; gap: 8px; }
  .topbar__location span { max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
  .main { padding: 16px; }
}
@media (min-width: 992px) { .topbar__menu { display: none; } .sidebar-backdrop { display: none; } }
@media (max-width: 640px) {
  .topbar__who, .topbar__location { display: none; }
  .topbar__user { border-left: 0; padding-left: 0; }
  h1 { font-size: 1.3rem; }
}
@media (prefers-reduced-motion: reduce) { .sidebar { transition: none; } }

/* ---- Cards, stats ------------------------------------------------------------------ */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.card + .card { margin-top: 20px; }
.grid > .card + .card { margin-top: 0; }
.card__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.card__head h2 { margin: 0; }
.card__head a { font-weight: 500; font-size: .9rem; }
.card--flush { padding: 0; overflow: hidden; }
.card--flush > .card__head { padding: 16px 20px 0; }
.grid { display: grid; gap: 20px; }
.grid + .grid, .grid + .card, .card + .grid { margin-top: 20px; }
.grid--stats { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 20px; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); }
.grid--main { grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); align-items: start; }
.grid--main > .stack > .card + .card { margin-top: 0; }
@media (max-width: 991px) { .grid--main { grid-template-columns: 1fr; } }

/* A figure: small icon, short label, big number. Colour only on the icon. */
.stat { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); color: var(--text); }
a.stat:hover { border-color: var(--teal-400); text-decoration: none; }
.stat__icon { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 10px; font-size: 1.2rem; background: var(--teal-50); color: var(--teal-600); flex: none; }
.stat__label { font-size: .85rem; font-weight: 500; color: var(--muted); }
.stat__value { font-size: 1.6rem; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat__hint { font-size: .8rem; color: var(--muted); }
.stat--green .stat__icon { background: var(--green-bg); color: var(--green); }
.stat--blue .stat__icon { background: var(--blue-bg); color: var(--blue); }
.stat--amber .stat__icon { background: var(--amber-bg); color: var(--amber); }
.stat--purple .stat__icon { background: var(--purple-bg); color: var(--purple); }
.stat--red .stat__icon { background: var(--red-bg); color: var(--red); }
@media (max-width: 640px) {
  .grid--stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .stat { flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px; }
  .stat__icon { width: 34px; height: 34px; font-size: 1rem; }
  .stat__value { font-size: 1.35rem; }
  .page-head__actions, .page-head__actions .btn { width: 100%; }
}

/* Quick actions: icon tiles. */
.quick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.quick a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 88px; padding: 12px 8px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); font-weight: 500; text-align: center; line-height: 1.3; }
.quick a:hover { border-color: var(--teal-400); background: var(--teal-50); text-decoration: none; }
.quick .bi { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 10px; background: var(--teal-50); color: var(--teal-600); font-size: 1.2rem; }
.quick a:hover .bi { background: #fff; }
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--red); color: #fff; font-size: .72rem; font-weight: 700; }

/* ---- Buttons, pills, tabs ----------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 16px;
  border: 1px solid var(--teal-600); border-radius: var(--radius-sm); background: var(--teal-600); color: #fff;
  font: inherit; font-weight: 500; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--teal-700); border-color: var(--teal-700); text-decoration: none; }
.btn--ghost { background: #fff; color: var(--text); border-color: var(--line-strong); }
.btn--ghost:hover { background: var(--subtle); color: var(--text); border-color: var(--line-strong); }
.btn--danger { background: var(--red); border-color: var(--red); }
.btn--danger:hover { background: #a61f1f; border-color: #a61f1f; }
.btn--sm { min-height: 32px; padding: 4px 12px; font-size: .875rem; }
.btn--block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--muted); font-size: 1rem; cursor: pointer; }
.icon-btn:hover { background: var(--teal-50); color: var(--teal-600); text-decoration: none; }
.icon-btn--danger:hover { background: var(--red-bg); color: var(--red); }

.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 500; line-height: 1.6; white-space: nowrap; background: #eef2f4; color: #475360; }
.pill--green { background: var(--green-bg); color: var(--green); }
.pill--blue { background: var(--blue-bg); color: var(--blue); }
.pill--amber { background: var(--amber-bg); color: var(--amber); }
.pill--purple { background: var(--purple-bg); color: var(--purple); }
.pill--red { background: var(--red-bg); color: var(--red); }

.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.tab { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 4px 14px; border-radius: 999px; background: #eef2f4; color: #3b4652; text-decoration: none; font-weight: 500; font-size: .9rem; }
.tab:hover { background: #e3e9ec; text-decoration: none; }
.tab.is-active { background: var(--teal-600); color: #fff; }
.tab__n { font-size: .78rem; opacity: .75; }

/* Tabs on the left, search and filters on the right, one row above a table. */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.toolbar .tabs, .toolbar .filters { margin: 0; }
.toolbar .search { min-width: 0; flex: 0 1 300px; }
.card--flush > .toolbar { padding: 16px 20px 0; }
.filters.toolbar { justify-content: flex-start; }
.filters.toolbar .search, .toolbar .filters .search { flex: 1 1 260px; max-width: 420px; }
.toolbar .filters { flex: 1 1 auto; justify-content: flex-end; }

/* ---- Tables ------------------------------------------------------------------------ */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-weight: 500; font-size: .82rem; color: var(--muted); padding: 10px 14px; background: var(--subtle); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fafcfc; }
.table th.num, .table th.actions { text-align: right; }
.table .actions { white-space: nowrap; text-align: right; }
.table td.actions .inline-form, .table td.actions form { display: inline-flex; }
.table--compact td { padding: 10px 14px; }
.card--flush .table th:first-child, .card--flush .table td:first-child { padding-left: 20px; }
.card--flush .table th:last-child, .card--flush .table td:last-child { padding-right: 20px; }
.cell-title { font-weight: 500; color: var(--text); }
a.cell-title:hover { color: var(--teal-600); }
.cell-sub { display: block; font-size: .8rem; color: var(--muted); }

/* Phones: each row becomes a card; cells show their column name from data-label. */
@media (max-width: 640px) {
  .table--stack thead { display: none; }
  .table--stack, .table--stack tbody, .table--stack tr, .table--stack td { display: block; width: 100%; }
  .table--stack tr { border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 12px; padding: 4px 12px; }
  .card--flush .table--stack { padding: 0 12px; }
  .table--stack td, .card--flush .table--stack td:first-child, .card--flush .table--stack td:last-child { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); text-align: right; }
  .table--stack tbody tr:last-child td { border-bottom: 1px solid var(--line); }
  .table--stack td:last-child, .table--stack tbody tr:last-child td:last-child { border-bottom: 0; }
  .table--stack td::before { content: attr(data-label); margin-right: auto; font-weight: 500; color: var(--muted); text-align: left; }
  .table--stack td { justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
  .table--stack td .cell-sub { display: inline; }
  .toolbar .search { flex: 1 1 100%; }
  .table--stack td[data-label=""]::before { content: none; }
}

.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; color: var(--muted); }
.card--flush > .pager { margin: 0; padding: 12px 20px; border-top: 1px solid var(--line); }
.empty { text-align: center; padding: 32px 16px; color: var(--muted); }
.empty .bi { display: block; font-size: 1.8rem; margin-bottom: 6px; color: var(--teal-400); }

/* ---- Forms ------------------------------------------------------------------------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 500; margin-bottom: 6px; }
.field .req { color: var(--red); }
.input, .select, textarea.input {
  width: 100%; min-height: 40px; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: #fff; color: var(--text); font: inherit;
}
.input::placeholder { color: #98a2ad; }
select.input, select.select { appearance: none; -webkit-appearance: none; padding-right: 36px; cursor: pointer;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23667380' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='m3 6 5 5 5-5'/%3E%3C/svg%3E") no-repeat right 12px center; }
.input:focus, .select:focus { outline: none; border-color: var(--teal-500); box-shadow: 0 0 0 3px rgba(20, 133, 124, .15); }
.input[aria-invalid="true"] { border-color: var(--red); }
.input--sm { min-height: 32px; padding: 4px 10px; }
.hint { font-size: .82rem; color: var(--muted); margin-top: 4px; }
.field-error { font-size: .82rem; color: var(--red); margin-top: 4px; }
.input-icon { position: relative; }
.input-icon > .bi { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 1.05rem; pointer-events: none; }
.input-icon .input { padding-left: 40px; }
.input-icon .reveal { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--teal-600); }
.search { position: relative; min-width: 240px; }
.search .bi { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search .input { padding-left: 36px; }

/* ---- Alerts ------------------------------------------------------------------------ */
.alert { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: 10px; margin-bottom: 16px; border: 1px solid transparent; }
.alert .bi { font-size: 1.05rem; }
.alert a { font-weight: 500; color: inherit; text-decoration: underline; }
.alert--ok { background: var(--green-bg); color: #14532d; border-color: #c9e9d3; }
.alert--info { background: var(--blue-bg); color: #1e3a8a; border-color: #d3e0fb; }
.alert--warn { background: var(--amber-bg); color: #7c2d12; border-color: #f3dcb6; }
.alert--error { background: var(--red-bg); color: #7f1d1d; border-color: #f2caca; }

/* ---- Landing ----------------------------------------------------------------------- */
.landing {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 32px; padding: 32px 16px;
  background:
    radial-gradient(1200px 400px at 50% 115%, rgba(34, 211, 238, .45), transparent 60%),
    radial-gradient(900px 500px at 85% 10%, rgba(20, 133, 124, .35), transparent 60%),
    linear-gradient(180deg, #0a2f35, #0c3c43 60%, #0a3037);
  color: #e6f6f5;
}
.landing h1 { font-size: clamp(1.4rem, 3vw, 2rem); text-align: center; margin: 0; }
.landing__intro { text-align: center; color: #b6d9d6; margin: -20px 0 0; }
.landing__brands { display: flex; flex-wrap: wrap; justify-content: center; gap: 32px; width: 100%; max-width: 980px; }
.brand-tile {
  flex: 1 1 340px; max-width: 420px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  min-height: 170px; padding: 24px; border-radius: 26px; background: #000; color: #fff; text-decoration: none;
  border: 4px solid var(--tile); box-shadow: 0 0 22px var(--tile), inset 0 0 12px rgba(255, 255, 255, .05);
  transition: transform .15s ease, box-shadow .15s ease;
}
.brand-tile:hover, .brand-tile:focus-visible { transform: translateY(-3px); box-shadow: 0 0 36px var(--tile); }
.brand-tile img { max-height: 100px; width: auto; }
.brand-tile span { font-weight: 500; color: #d7e3e2; }
.brand-tile--store { --tile: #22d3ee; }
.brand-tile--cafe { --tile: #f5b301; }
.landing__other { color: #b6d9d6; }
.landing__other a { color: #7ee8e0; font-weight: 500; }

/* ---- Login ------------------------------------------------------------------------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: linear-gradient(135deg, #1fb5ab, #0f8d85); }
.login__hero { position: relative; background-size: cover; background-position: center; clip-path: ellipse(100% 120% at 0% 50%); }
.login__panel { display: flex; align-items: center; justify-content: center; padding: 32px 24px; }
.login__card { width: 100%; max-width: 470px; background: #fff; border-radius: 22px; padding: 36px 36px 28px; box-shadow: 0 20px 50px rgba(5, 40, 40, .25); }
.login__logo { display: flex; justify-content: center; margin-bottom: 18px; }
.login__logo img { max-height: 120px; width: auto; border-radius: 14px; }
.login__logo--global img { max-height: 70px; border-radius: 0; }
.login__card h1 { text-align: center; font-size: 1.15rem; font-weight: 500; margin: 0 0 22px; }
.login__card h1::before { content: ""; display: block; width: 90px; height: 4px; border-radius: 4px; background: var(--teal-500); margin: 0 auto 14px; }
.login__row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin: 4px 0 20px; }
.login__row a { font-weight: 500; }
.login__switch { text-align: center; margin: 18px 0 0; color: var(--muted); font-size: .9rem; }
@media (max-width: 860px) {
  .login { grid-template-columns: 1fr; }
  .login__hero { display: none; }
  .login__card { padding: 28px 20px 22px; }
}

/* ---- Error pages ------------------------------------------------------------------- */
.error-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; text-align: center; }
.error-page .card { max-width: 480px; }
.error-page .card > .bi { font-size: 2.6rem; color: var(--teal-500); }

/* ---- Details lists, staff, link box ---------------------------------------------- */
.facts { display: grid; gap: 10px; margin: 0 0 18px; }
.facts div { display: grid; grid-template-columns: 140px 1fr; gap: 12px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 500; }
/* Details with nothing to act on: one wide card, facts side by side. */
.facts--cols { grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); column-gap: 40px; }
.checklist.checklist--cols { display: block; columns: 3 260px; column-gap: 32px; }
.checklist.checklist--cols li { break-inside: avoid; margin-bottom: 8px; }
.checklist { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.checklist li { display: flex; gap: 8px; align-items: baseline; }
.checklist .bi { color: var(--teal-500); flex: none; }
.form-narrow { max-width: 720px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 8px; }
.form-actions form { margin: 0; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.filters .search { flex: 1 1 260px; }
.filters .select { width: auto; min-width: 160px; flex: 0 1 200px; }
.person { display: inline-flex; align-items: center; gap: 10px; }
.avatar--sm { width: 34px; height: 34px; font-size: .8rem; }
.linkbox { border-color: var(--teal-400); background: var(--teal-50); margin-bottom: 20px; }
.linkbox h2 { display: flex; align-items: center; gap: 8px; }
.linkbox__row { display: flex; gap: 10px; }
.linkbox__row .input { flex: 1; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85rem; }
@media (max-width: 640px) {
  .facts div { grid-template-columns: 1fr; gap: 2px; }
  .linkbox__row { flex-direction: column; }
}

/* ---- Phase 2: forms, line items, totals ------------------------------------------ */
.label { display: block; font-weight: 500; margin-bottom: 6px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.form-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px 4px; margin: 4px 0 16px; }
.fieldset legend { font-weight: 500; padding: 0 6px; }
.segmented { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; margin-bottom: 16px; }
.segmented label { margin: 0; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: inline-flex; align-items: center; gap: 6px; padding: 10px 18px; font-weight: 500; }
.segmented input:checked + span { background: var(--teal-600); color: #fff; }
.segmented input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: -3px; }
.inline-form { display: flex; flex-wrap: wrap; gap: 0 12px; align-items: flex-start; }
.inline-form .field { margin-bottom: 12px; }
.grow { flex: 1 1 200px; }
.field--button { padding-top: 28px; display: flex; gap: 8px; }
form.inline { display: inline; margin: 0; }
.section-title { margin-top: 8px; }
.lines-table td { padding: 8px 6px; vertical-align: middle; }
.lines-table select[data-product] { min-width: 240px; }
.lines-table .input.num { width: 110px; text-align: right; }
.lines-table tr.is-invalid td { background: var(--red-bg); }
.qty-unit { display: inline-flex; align-items: center; gap: 6px; }
.qty-unit .input { width: 110px; text-align: right; }
.purchase-foot { display: grid; grid-template-columns: 1fr 320px; gap: 24px; margin-top: 18px; align-items: start; }
.totals { margin: 0; display: grid; gap: 8px; }
.totals div { display: flex; justify-content: space-between; gap: 12px; }
.totals dt { color: var(--muted); }
.totals dd { margin: 0; font-variant-numeric: tabular-nums; font-weight: 500; }
.totals__grand { padding: 12px 14px; border-radius: var(--radius-sm); background: var(--teal-50); }
.totals__grand dt, .totals__grand dd { color: var(--text); font-weight: 700; font-size: 1.15rem; }
.card > .totals { max-width: 380px; margin: 16px 0 0 auto; }
.reason-form { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.reason-form label { display: block; font-weight: 500; margin-bottom: 6px; }
.grid--card { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.row-muted td { background: #f6f9f9; }
.bi.ok { color: var(--green); }
code { background: var(--bg); padding: 2px 6px; border-radius: 6px; font-size: .85em; }
@media (max-width: 991px) {
  .grid--card, .purchase-foot { grid-template-columns: 1fr; }
  .form-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .form-grid, .form-grid--3 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .field--button { padding-top: 0; }
  .card > .totals { max-width: none; }
}
.stack { display: grid; gap: 20px; align-content: start; }
.stack > .card + .card { margin-top: 0; }
