/* ============================================================================
   Oz POS — platform console
   Direction: "modern SaaS console", the same system as the vendor portal so the
   two read as one product — but ink-navy where the portal is herb-green, so you
   can tell at a glance which side of the platform you are looking at. Denser
   than the portal on purpose: this screen answers "who owes us money" fast.

   Token names mirror portal/assets/css/style.css; only the accent differs.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  /* Spacing, in one place. Every gap on every admin screen is one of these
     three, so "the padding is inconsistent" stops being possible to introduce. */
  --pad-page: 22px;    /* the page's own breathing room */
  --gap-block: 18px;   /* between top-level blocks on a page */
  --pad-card: 16px;    /* inside a card */

  --paper:      #F6F7F8;
  --surface:    #FFFFFF;
  --surface-2:  #F1F2F4;
  --surface-3:  #E9EBEE;
  --ink:        #15181D;
  --ink-2:      #464C56;
  --muted:      #7E858F;
  --line:       #E4E6EA;
  --line-2:     #D2D6DC;
  --row-hover:  #F8F9FA;

  --navy:       #49316B;   /* primary accent — OZ POS brand purple (brand kit 2026-11-15; token name kept) */
  --navy-soft:  #EFEBF5;
  --navy-deep:  #3A2756;
  --navy-line:  #D6CDE3;
  --good:       #1F6B47;
  --good-soft:  #E8F3EC;
  --good-line:  #C6E0D1;
  --warn:       #B7791F;
  --warn-soft:  #FBF4E4;
  --warn-line:  #EADFC0;
  --bad:        #C0344E;
  --bad-soft:   #FCEAEE;
  --bad-line:   #F3CFD8;
  --info:       #2A6F97;
  --info-soft:  #E9F2F8;
  --info-line:  #CBDEEB;
  /* Every other colour the console uses — one source, never a literal below :root. */
  --on-accent:    #FFFFFF;   /* text / knob on a filled accent (buttons, switch, spinner) */
  --topbar-glass: rgba(255, 255, 255, .82);
  --line-hover:   #BFC5CD;   /* control / ghost-button border on hover */
  --switch-hover: #C3C9D1;
  --bad-tint:     #FFFCFD;   /* a suspended shop's card */
  --bad-soft-h:   #F8DDE3;   /* soft danger button, hover */
  --bad-deep:     #A62A41;   /* danger button, hover */
  --warn-ink:     #6B4A0C;   /* text on --warn-soft (impersonation bar) */

  --r-sm: 6px;
  --r:    9px;
  --r-lg: 14px;

  --shadow-sm: 0 1px 1px rgba(19, 22, 28, .03), 0 1px 2px rgba(19, 22, 28, .05);
  --shadow:    0 1px 2px rgba(19, 22, 28, .04), 0 6px 18px -4px rgba(19, 22, 28, .10);
  --shadow-lg: 0 2px 4px rgba(19, 22, 28, .04), 0 18px 44px -10px rgba(19, 22, 28, .18);
  --shadow-btn: 0 1px 1px rgba(19, 22, 28, .06), 0 1px 2px rgba(19, 22, 28, .08);
  --shadow-btn-h: 0 2px 3px rgba(19, 22, 28, .08), 0 6px 14px -3px rgba(73, 49, 107, .32);

  --ring: 0 0 0 3px rgba(73, 49, 107, .16);
  --ring-bad: 0 0 0 3px rgba(192, 52, 78, .14);   /* invalid field */
  --shadow-inset: 0 1px 1px rgba(19, 22, 28, .02) inset;
  --shadow-knob: 0 1px 2px rgba(19, 22, 28, .3), 0 0 0 1px rgba(19, 22, 28, .04);

  --sidebar-w: 252px;   /* roomier, like the Lume admin (owner 2026-10-25: "sidebar items are very squeezed") */
  --topbar-h:  52px;
  /* A rendered .form-control here is 41px (14px/1.5 text + 9px×2 padding +
     1px×2 border), so every control is built to that and a row of mixed
     fields shares one centre line. Re-derive it if the input changes. */
  --control-h: 41px;

  --ease: cubic-bezier(.2, .7, .3, 1);

  /* Display IS the body sans — 700/800, tight. No serif in the chrome. */
  --font-body: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: var(--font-body);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .display {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.022em;
  margin: 0;
}

a { color: var(--navy); text-decoration: none; }
a:hover { color: var(--navy-deep); }
.muted { color: var(--muted); }

/* Text utilities — so captions and sub-text stop being one-off inline font-size
   styles scattered through the PHP. `.hint` is the muted caption (matches the
   portal's .form-hint scale); `.fs-sm` is secondary body text. */
.hint  { font-size: 12px; color: var(--muted); }
.fs-sm { font-size: 13.5px; }

/* ------------------------------------------------------------------ login */
/* Split sign-in (owner 2026-11-04, client demo): the logo centred on a light panel beside the form; one column on a
   phone. Logical properties only, so Arabic mirrors itself. Motion stops under reduced motion. */

.login-body {
  --login-accent: var(--navy);
  --login-deep:   var(--navy-deep);
  --login-soft:   var(--navy-soft);
  min-height: 100vh;
  margin: 0;
  background: var(--surface);
}

.login-split { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); }

/* ---- brand panel: the logo, centred */
.login-panel {
  display: flex;
  flex-direction: column;
  padding: 40px 48px 32px;
  background: var(--paper);
  border-inline-end: 1px solid var(--line);
}
.login-logo-wrap { margin: auto; display: flex; flex-direction: column; align-items: center; gap: 22px; animation: login-rise .6s var(--ease) both; }
.login-logo { width: min(240px, 55%); height: auto; }   /* the stacked brand logo (taller than wide) */
.login-tagline { margin: 0; color: var(--muted); font-size: 13px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.login-panel-foot { margin: 0; text-align: center; color: var(--muted); font-size: 12px; }

/* ---- form side */
.login-main { display: flex; flex-direction: column; padding: 26px 40px; background: var(--surface); }
.login-top { display: flex; justify-content: flex-end; }
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
  transition: border-color .14s var(--ease), color .14s var(--ease);
}
.lang-switch:hover { border-color: var(--login-accent); color: var(--login-accent); }
.lang-switch:focus-visible { outline: 2px solid var(--login-accent); outline-offset: 2px; }

.login-form-wrap { width: 100%; max-width: 380px; margin: auto; padding: 28px 0; }
.login-form-wrap > * { animation: login-rise .55s var(--ease) both; }
.login-form-wrap > :nth-child(2) { animation-delay: .06s; }
.login-form-wrap > :nth-child(3) { animation-delay: .12s; }
.login-form-wrap > :nth-child(4) { animation-delay: .18s; }
.login-form-wrap h1 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.025em;
}
.login-sub { margin-bottom: 30px; color: var(--muted); font-size: 14px; }
.login-field { position: relative; margin-bottom: 18px; }
.login-field .form-label { font-weight: 600; font-size: 13px; color: var(--ink-2); }
.login-field .form-control { height: var(--control-h); padding-inline-start: 42px; }
.login-field .form-control:focus { border-color: var(--login-accent); box-shadow: 0 0 0 3px var(--login-soft); }
.login-field .field-ic {
  position: absolute;
  inset-inline-start: 15px;
  bottom: calc(var(--control-h) / 2);
  translate: 0 50%;
  color: var(--muted);
  font-size: 14px;
  pointer-events: none;
}
.login-field.has-eye .form-control { padding-inline-end: 46px; }
.login-eye {
  position: absolute;
  inset-inline-end: 5px;
  bottom: 5px;
  width: 36px;
  height: calc(var(--control-h) - 10px);
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
}
.login-eye:hover { color: var(--ink); background: var(--surface-2); }
.login-eye:focus-visible { outline: 2px solid var(--login-accent); outline-offset: 1px; }
.login-submit { height: var(--control-h); margin-top: 8px; display: flex; align-items: center; justify-content: center; gap: 9px; font-weight: 700; }
.login-submit .spinner-border { display: none; width: 16px; height: 16px; border-width: 2px; }
.login-submit.is-busy .spinner-border { display: inline-block; }
.login-error { border-radius: 10px; font-size: 13.5px; }
.login-foot { margin: 0; text-align: center; color: var(--muted); font-size: 12px; letter-spacing: .01em; }

@keyframes login-rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

@media (max-width: 900px) {
  .login-split { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .login-panel { padding: 22px 16px; border-inline-end: 0; border-bottom: 1px solid var(--line); }
  .login-logo-wrap { gap: 10px; }
  .login-logo { width: 96px; }
  .login-panel-foot { display: none; }
  .login-main { padding: 16px 16px 24px; }
  .login-form-wrap { padding-top: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .login-logo-wrap, .login-form-wrap > * { animation: none; }
}

/* ----------------------------------------------------------------- shell */

.topbar {
  position: fixed; inset: 0 0 auto 0; height: var(--topbar-h); z-index: 40;
  display: flex; align-items: center; gap: 12px;
  padding: 0 16px;
  background: var(--topbar-glass);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}

.topbar .brand {
  display: flex; align-items: center; gap: 9px;
  font-family: var(--font-display); font-weight: 800; font-size: 14.5px;
  letter-spacing: -0.022em;
}
.topbar .brand .brand-logo { height: 24px; width: auto; flex: none; }
.brand-tag {
  font-family: var(--font-body); font-size: 10px; font-weight: 800;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--navy); background: var(--navy-soft);
  border: 1px solid var(--navy-line);
  padding: 2px 7px; border-radius: 999px;
}

.topbar .quick {
  width: 30px; height: 30px; display: grid; place-items: center;
  border-radius: var(--r-sm); color: var(--ink-2); background: var(--surface-2);
  transition: background .13s var(--ease), color .13s var(--ease), transform .1s var(--ease);
}
.topbar .quick:hover { background: var(--navy-soft); color: var(--navy); transform: translateY(-1px); }
.topbar .quick:active { transform: none; background: var(--surface-3); }
.topbar .quick:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }

.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  display: inline-grid; place-items: center;
  background: var(--navy); color: var(--on-accent);
  font-weight: 800; font-size: 12px; letter-spacing: -0.01em;
}

.sidebar {
  position: fixed; top: var(--topbar-h); bottom: 0; inset-inline-start: 0; width: var(--sidebar-w);
  background: var(--surface); border-inline-end: 1px solid var(--line);
  overflow-y: auto; overscroll-behavior: contain; z-index: 30;
  scrollbar-width: thin; scrollbar-color: var(--line-2) transparent;
}
.sidebar::-webkit-scrollbar { width: 8px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 99px; border: 2px solid var(--surface); }
.sidebar-inner { padding: 14px 12px 28px; }

.nav-group { margin-bottom: 18px; }
.nav-group-title {
  font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); padding: 0 14px 7px;
}
.nav-item {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; margin-bottom: 2px; border-radius: var(--r-sm);   /* Lume: .75rem 1.5rem, 24px icon column */
  color: var(--ink-2); font-weight: 600; font-size: 14px;
  transition: background .14s var(--ease), color .14s var(--ease);
}
.nav-item i { width: 20px; text-align: center; font-size: 15px; color: var(--muted); transition: color .14s var(--ease); }
.nav-item:hover { background: var(--surface-2); color: var(--ink); }
.nav-item:hover i { color: var(--ink-2); }
.nav-item:active { background: var(--surface-3); }
.nav-item.active { background: var(--navy-soft); color: var(--navy-deep); font-weight: 700; }
.nav-item.active i { color: var(--navy); }
/* A solid navy rail so the current page reads at a glance in a long list. */
.nav-item.active::before {
  content: ''; position: absolute; inset-block: 8px; inset-inline-start: -12px;
  width: 3px; border-start-end-radius: 3px; border-end-end-radius: 3px;
  background: var(--navy);
}

.content {
  margin-top: var(--topbar-h); margin-inline-start: var(--sidebar-w);
  padding: var(--pad-page) var(--pad-page) 56px;
  min-height: calc(100vh - var(--topbar-h));
}

/* ONE VERTICAL RHYTHM FOR EVERY PAGE.
   Spacing used to come from Bootstrap utilities sprinkled per page — mb-3 here,
   nothing there — on top of a `.card-oz + .card-oz` margin. So two stacked cards
   got 32px, a card under a stat grid got 0, and no two admin screens agreed.
   The LAYOUT owns the gap now: every top-level block on a page is separated by
   the same amount, whatever it happens to be. Pages stopped carrying mb-* for
   this, and adding a new block needs no spacing class at all. */
.content > * + * { margin-top: var(--gap-block); }
/* A modal is position:fixed and is not part of the page's stack, so it must not
   claim a gap — pages that keep their modal markup at the end of .content would
   otherwise get a phantom 18px of trailing space. */
.content > .modal + *, .content > .modal { margin-top: 0; }

@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); transition: transform .22s var(--ease); }
  [dir="rtl"] .sidebar { transform: translateX(100%); }
  .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .content { margin-inline-start: 0; padding: 16px 14px 48px; --gap-block: 14px; }
  .page-head h1 { font-size: 21px; }
}

/* ------------------------------------------------------------ page header */

.page-head {
  display: flex; align-items: flex-start; gap: 16px;
  flex-wrap: wrap;
}
.page-head h1 { font-size: 23px; font-weight: 800; letter-spacing: -0.026em; line-height: 1.15; }
.page-head p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }

/* ------------------------------------------------------------------ cards */

.card-oz {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: var(--shadow-sm);
}
/* Deliberately NOT `.card-oz + .card-oz { margin-top }`. A card is not
   responsible for what sits above it; `.content > * + *` is, and one rule
   cannot disagree with itself the way two did. */
.card-oz .card-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px var(--pad-card); border-bottom: 1px solid var(--line);
}
.card-oz .card-head h2 { font-size: 14px; font-weight: 800; letter-spacing: -0.015em; }
.card-oz .card-body { padding: var(--pad-card); }
.card-oz .card-body.tight { padding: 0; }

/* ------------------------------------------------------------------ stats */

.stat-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  margin-bottom: 20px;
}
.stat {
  display: flex; align-items: center; gap: 13px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: 13px 15px;
  box-shadow: var(--shadow-sm);
  animation: rise .35s var(--ease) both;
  transition: box-shadow .16s var(--ease), border-color .16s var(--ease);
}
.stat:hover { box-shadow: var(--shadow); border-color: var(--line-2); }

@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
.stat-icon {
  width: 36px; height: 36px; flex: 0 0 36px; border-radius: var(--r-sm);
  display: grid; place-items: center;
  background: var(--navy-soft); color: var(--navy); font-size: 15px;
}
.stat.good .stat-icon { background: var(--good-soft); color: var(--good); }
.stat.warn .stat-icon { background: var(--warn-soft); color: var(--warn); }
.stat.bad  .stat-icon { background: var(--bad-soft);  color: var(--bad); }
.stat-body { display: flex; flex-direction: column; min-width: 0; }
.stat-label { font-size: 10.5px; font-weight: 800; letter-spacing: .07em;
              text-transform: uppercase; color: var(--muted); }
.stat-value { font-family: var(--font-display); font-size: 21px; font-weight: 800;
              letter-spacing: -0.032em; font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat-note { font-size: 12px; color: var(--muted); }

/* ------------------------------------------------------------------ pills */

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: -0.005em; line-height: 1.5;
  background: var(--surface-2); color: var(--ink-2);
  border: 1px solid var(--line);
}
.pill-good { background: var(--good-soft); color: var(--good); border-color: var(--good-line); }
.pill-warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-line); }
.pill-bad  { background: var(--bad-soft);  color: var(--bad);  border-color: var(--bad-line); }
.pill-info { background: var(--info-soft); color: var(--info); border-color: var(--info-line); }
.pill-muted{ background: var(--surface-2); color: var(--muted); border-color: var(--line); }

/* The quietest state marker there is, for dense rows. */
.sdot { width: 7px; height: 7px; border-radius: 50%; flex: none; display: inline-block; background: var(--line-2); }
.sdot.good { background: var(--good); box-shadow: 0 0 0 2.5px var(--good-soft); }
.sdot.warn { background: var(--warn); box-shadow: 0 0 0 2.5px var(--warn-soft); }
.sdot.bad  { background: var(--bad);  box-shadow: 0 0 0 2.5px var(--bad-soft); }

/* ------------------------------------------------------------------ table */

.table-oz { width: 100%; border-collapse: separate; border-spacing: 0; }
.table-oz thead th {
  font-size: 10.5px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase;
  color: var(--muted); padding: 9px 14px; border-bottom: 1px solid var(--line);
  white-space: nowrap; background: var(--surface-2);
}
.table-oz tbody td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle;
                     font-size: 13px; color: var(--ink-2); }
.table-oz tbody tr:last-child td { border-bottom: 0; }
.table-oz tbody tr { transition: background .12s var(--ease); }
.table-oz tbody tr:hover td { background: var(--row-hover); }
.table-wrap { overflow-x: auto; }

/* DataTables wraps the table in Bootstrap rows, and a .row carries NEGATIVE
   horizontal margins (half the gutter each side). Inside .table-wrap that makes
   the wrapper 12px wider than its own box, so every DataTable showed a
   horizontal scrollbar with nothing to scroll to. Cancel the gutter; the table
   still scrolls when it genuinely is too wide. */
.table-wrap .dataTables_wrapper > .row,
.table-wrap .dataTables_wrapper .dt-row { margin-left: 0; margin-right: 0; }
.table-wrap .dataTables_wrapper > .row > [class^="col-"],
.table-wrap .dataTables_wrapper > .row > [class*=" col-"] { padding-left: 0; padding-right: 0; }

.empty-cell {
  text-align: center; padding: 40px 14px !important; color: var(--muted); font-size: 13px;
}
.empty-cell i {
  font-size: 17px; color: var(--muted);
  margin: 0 auto 12px; display: grid; place-items: center;
  width: 44px; height: 44px; border-radius: var(--r);
  background: var(--surface-2); border: 1px solid var(--line);
}

/* ---------------------------------------------------- action rows (shared)

   A row's controls are ONE line, always — the same promise the vendor portal
   makes with .card-actions (portal/assets/css/cards.css). Three things break
   that on their own, so all three are settled here rather than nine times:

     - the cell wraps when the column is squeezed  -> white-space: nowrap
     - the whitespace between inline-blocks adds a  -> font-size: 0 on the cell,
       ragged, unequal gap                             restored on the children
     - a default-size button next to a btn-sm one  -> one size inside the group

   Applies to the last column of every console table (`td.text-end`) and to the
   explicit `.row-actions` group, which is what to reach for outside a table. */

div.row-actions {
  display: flex; align-items: center; gap: 6px; flex-wrap: nowrap;
  justify-content: flex-end;
}

/* An action cell says so — `font-size: 0` would swallow a cell that holds plain
   text (an amount, a date), so it is never applied by `.text-end` alone. */
.table-oz tbody td.row-actions {
  white-space: nowrap; text-align: end;
  font-size: 0;              /* kills the whitespace text nodes between buttons */
}
.table-oz tbody td.row-actions > * { font-size: 13px; vertical-align: middle; }
.table-oz tbody td.row-actions > .btn + .btn { margin-inline-start: 6px; }

/* A money column should not break either, but it keeps its type size. */
.table-oz tbody td.text-end { white-space: nowrap; }

/* One size in an action group, whatever the page asked for. */
.table-oz tbody td.row-actions > .btn,
div.row-actions > .btn {
  min-height: 30px; padding: 0 10px; font-size: 12px; gap: 5px;
}

/* An icon is a fixed box, so labels line up down the column even when the
   glyphs are different widths. */
.btn > i[class*="fa-"] { width: 1em; text-align: center; flex: 0 0 auto; }

/* Card footers and header action groups are already flex; stop them breaking
   a button group across two lines when the card gets narrow. */
.page-head .ms-auto, .card-head .ms-auto.d-flex, .tenant-card .foot { flex-wrap: nowrap; }
.page-head .ms-auto > .btn, .tenant-card .foot > .btn { white-space: nowrap; }
/* Below tablet there is no width left to hold a long header group on one line;
   wrapping beats scrolling the page sideways. */
@media (max-width: 640px) {
  .page-head .ms-auto { flex-wrap: wrap; justify-content: flex-end; }
}

.who { display: flex; align-items: center; gap: 10px; }
.who-av {
  width: 32px; height: 32px; flex: 0 0 32px; border-radius: var(--r-sm);
  display: grid; place-items: center;
  background: var(--navy-soft); color: var(--navy-deep);
  font-weight: 800; font-size: 12px;
}
.who-txt { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.who-txt strong { font-size: 13.5px; font-weight: 700; }
.who-txt span { font-size: 12px; color: var(--muted); }

/* ------------------------------------------------------------ kitchen card */

.tenant-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}
.tenant-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 15px; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 11px;
  transition: transform .15s var(--ease), box-shadow .15s var(--ease), border-color .15s var(--ease);
  animation: rise .35s var(--ease) both;
}
.tenant-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--line-2); }
.tenant-card:active { transform: none; }
.tenant-card.is-suspended { border-color: var(--bad-line); background: var(--bad-tint); }
.tenant-card .row-meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.tenant-card .row-meta b { color: var(--ink); font-weight: 700; }
.tenant-card .foot { display: flex; align-items: center; gap: 8px; margin-top: auto; }

/* ------------------------------------------------------------------ forms */

/* Block, always: an inline-flex control beside a block one staggers the row. */
.form-label { display: block; font-size: 12px; font-weight: 700; color: var(--ink-2);
              letter-spacing: -0.005em; margin-bottom: 5px; }

/* background-COLOR, never the `background` shorthand — the shorthand resets
   background-repeat and tiles the .form-select chevron across the control. */
.form-control, .form-select {
  border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 9px 12px; font-size: 14px;
  color: var(--ink); background-color: var(--surface); min-height: var(--control-h);
  box-shadow: var(--shadow-inset);
  transition: border-color .14s var(--ease), box-shadow .14s var(--ease), background-color .14s var(--ease);
}
.form-control::placeholder { color: var(--muted); }
.form-control:hover:not(:focus):not(:disabled),
.form-select:hover:not(:focus):not(:disabled) { border-color: var(--line-hover); }
.form-control:focus, .form-select:focus {
  border-color: var(--navy); box-shadow: var(--ring);
}
.form-control:disabled, .form-select:disabled, .form-control[readonly] {
  background-color: var(--surface-2); color: var(--muted); box-shadow: none;
}
.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%237E858F' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6.5 8 10.5 12 6.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: 15px 15px;
  background-position: right 11px center;
  padding-inline-end: 34px;
  appearance: none; -webkit-appearance: none;
}
[dir="rtl"] .form-select { background-position: left 11px center; }   /* the chevron sits at the END side in Arabic too */
textarea.form-control { min-height: 84px; line-height: 1.55; resize: vertical; }

/* The browser's own "Choose File / No file chosen" is the ugliest control in
   any admin. Style the shadow button into a real secondary control instead. */
.form-control[type="file"] {
  padding: 0; overflow: hidden; cursor: pointer;
  color: var(--muted); font-size: 12.5px;
  line-height: calc(var(--control-h) - 2px);
  background-color: var(--surface); background-image: none;
}
.form-control[type="file"]::file-selector-button {
  height: calc(var(--control-h) - 2px);
  margin: 0; margin-inline-end: 12px; padding: 0 14px;
  border: 0; border-inline-end: 1px solid var(--line); border-radius: 0;
  background: var(--surface-2); color: var(--ink-2);
  font-family: inherit; font-size: 12.5px; font-weight: 700; letter-spacing: -0.005em;
  cursor: pointer;
  transition: background .14s var(--ease), color .14s var(--ease);
}
.form-control[type="file"]:hover { border-color: var(--line-hover); }
.form-control[type="file"]:hover::file-selector-button { background: var(--surface-3); color: var(--ink); }
.form-control[type="file"]:focus::file-selector-button { background: var(--navy-soft); color: var(--navy-deep); }

.form-hint { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* Inline validation, to match the portal: mark the field, say why beside it. */
.form-control.is-invalid, .form-select.is-invalid {
  border-color: var(--bad); box-shadow: var(--ring-bad);
}
.field-error {
  display: flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 700; color: var(--bad); margin-top: 4px;
}

/* .oz-switch — same component as the portal (portal/assets/css/style.css),
   navy accent. Real checkbox inside, visual track beside it. --control-h is
   declared with the other density tokens at the top of this file. */
.oz-switch {
  position: relative; display: inline-flex; align-items: center; gap: 10px;
  margin: 0; min-height: 22px; cursor: pointer; user-select: none; vertical-align: middle;
  font-size: 13.5px; font-weight: 600; line-height: 1.3; color: var(--ink);
}
.oz-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.oz-switch-track {
  position: relative; flex: none; width: 38px; height: 22px; border-radius: 999px;
  background: var(--line-2); transition: background-color .16s var(--ease);
}
.oz-switch-track::after {
  content: ''; position: absolute; top: 3px; inset-inline-start: 3px;
  width: 16px; height: 16px; border-radius: 50%; background: var(--on-accent);
  box-shadow: var(--shadow-knob);
  transition: transform .16s var(--ease);
}
.oz-switch:hover .oz-switch-track { background: var(--switch-hover); }
.oz-switch input:checked ~ .oz-switch-track { background: var(--navy); }
.oz-switch:hover input:checked ~ .oz-switch-track { background: var(--navy-deep); }
.oz-switch input:checked ~ .oz-switch-track::after { transform: translateX(16px); }
[dir="rtl"] .oz-switch input:checked ~ .oz-switch-track::after { transform: translateX(-16px); }
.oz-switch:active .oz-switch-track::after { width: 18px; }
.oz-switch input:focus-visible ~ .oz-switch-track {
  outline: 2px solid var(--navy); outline-offset: 2px;
}
.oz-switch input:disabled ~ .oz-switch-track, .oz-switch input:disabled ~ .oz-switch-label { opacity: .5; }
.oz-switch:has(input:disabled) { cursor: not-allowed; }
.oz-switch-label { flex: 1 1 auto; }
.oz-switch-field .oz-switch-spacer { display: block; visibility: hidden; }
.oz-switch-box {   /* as tall as a rendered .form-control here: 14px/1.5 line + 9px+9px + 1px+1px */
  display: flex; align-items: center;
  font-size: 14px; line-height: 1.5;
  min-height: max(var(--control-h), calc(1.5em + 20px));
}
.oz-switch-stack { display: flex; flex-direction: column; gap: 12px; }
.oz-switch-stack.inline { flex-direction: row; flex-wrap: wrap; gap: 10px 24px; }
.oz-switch + .form-hint, .oz-switch-box + .form-hint { padding-inline-start: 48px; }
td .oz-switch { vertical-align: middle; }
@media (prefers-reduced-motion: reduce) {
  .oz-switch-track, .oz-switch-track::after { transition: none; }
}

/* .oz-check — a tidy multi-select checkbox list (plan entitlements). Not a
   toggle: several can be on at once, so it stays a square box. */
.oz-check-list { display: flex; flex-direction: column; gap: 2px; }
.oz-check {
  display: flex; align-items: center; gap: 9px; margin: 0; padding: 5px 0;
  font-size: 13.5px; font-weight: 600; color: var(--ink); cursor: pointer; user-select: none;
}
.oz-check input { flex: none; width: 16px; height: 16px; margin: 0; accent-color: var(--navy); cursor: pointer; }
.oz-check input:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }

/* Solid, confident, one accent. Every button lifts 1px on hover and settles on
   press, so a click is acknowledged before the network answers. */
.btn {
  --btn-bg: var(--surface); --btn-fg: var(--ink-2); --btn-bd: var(--line-2);
  --btn-bg-h: var(--surface-2); --btn-fg-h: var(--ink); --btn-bd-h: var(--line-hover);
  --btn-lift: -1px; --btn-shadow-h: var(--shadow);
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: var(--r-sm); font-weight: 700; font-size: 13px;
  letter-spacing: -0.008em; line-height: 1.25;
  padding: 0 14px; min-height: var(--control-h);
  background: var(--btn-bg); color: var(--btn-fg); border: 1px solid var(--btn-bd);
  box-shadow: var(--shadow-btn);
  transition: background .14s var(--ease), color .14s var(--ease),
              border-color .14s var(--ease), box-shadow .16s var(--ease),
              transform .1s var(--ease);
}
.btn:hover {
  background: var(--btn-bg-h); color: var(--btn-fg-h); border-color: var(--btn-bd-h);
  box-shadow: var(--btn-shadow-h); transform: translateY(var(--btn-lift));
}
.btn:active { transform: translateY(0) scale(.985); box-shadow: var(--shadow-sm); }
.btn:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }
/* Bootstrap's `.btn:disabled` outweighs `.btn`, so restate the tokens — and a
   disabled control reads as flat neutral, not a faded accent. */
.btn:disabled, .btn.disabled, fieldset:disabled .btn {
  background: var(--surface-2); color: var(--muted); border-color: var(--line);
  opacity: 1; box-shadow: none; transform: none; cursor: not-allowed; pointer-events: none;
}
.btn-sm { padding: 0 14px; font-size: 13px; gap: 5px; }   /* height = --control-h: one-height rule (end of file) */
.btn-lg { min-height: 46px; padding: 0 22px; font-size: 14.5px; }

.btn-oz, .btn-primary {
  --btn-bg: var(--navy); --btn-fg: var(--on-accent); --btn-bd: var(--navy);
  --btn-bg-h: var(--navy-deep); --btn-fg-h: var(--on-accent); --btn-bd-h: var(--navy-deep);
  --btn-shadow-h: var(--shadow-btn-h);
}
.btn-ghost, .btn-outline-secondary, .btn-secondary {
  --btn-bg: var(--surface); --btn-fg: var(--ink-2); --btn-bd: var(--line-2);
  --btn-bg-h: var(--surface-2); --btn-fg-h: var(--ink); --btn-bd-h: var(--line-hover);
}
.btn-danger-soft, .btn-outline-danger {
  --btn-bg: var(--bad-soft); --btn-fg: var(--bad); --btn-bd: var(--bad-line);
  --btn-bg-h: var(--bad-soft-h); --btn-fg-h: var(--bad); --btn-bd-h: var(--bad);
}
.btn-danger {
  --btn-bg: var(--bad); --btn-fg: var(--on-accent); --btn-bd: var(--bad);
  --btn-bg-h: var(--bad-deep); --btn-fg-h: var(--on-accent); --btn-bd-h: var(--bad-deep);
}
/* A link that happens to be button-shaped: no border, no shadow, no lift. */
.btn-quiet, .btn-link {
  --btn-bg: transparent; --btn-fg: var(--ink-2); --btn-bd: transparent;
  --btn-bg-h: var(--surface-2); --btn-fg-h: var(--ink); --btn-bd-h: transparent;
  --btn-lift: 0px; --btn-shadow-h: none;
  box-shadow: none; text-decoration: none;
}
.btn-link { --btn-fg: var(--navy); --btn-fg-h: var(--navy-deep); }

/* Loading: the label stays in place (no width jump), the spinner replaces it,
   and the button cannot be pressed twice. */
.btn.is-loading { color: transparent !important; pointer-events: none; }
.btn.is-loading > * { visibility: hidden; }
.btn.is-loading::after {
  content: ''; position: absolute; inset: 0; margin: auto;
  width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid var(--btn-fg); border-inline-color: transparent;
  animation: btn-spin .62s linear infinite;
}
.btn-oz.is-loading::after, .btn-primary.is-loading::after, .btn-danger.is-loading::after {
  border-color: var(--on-accent); border-inline-color: transparent;
}
.btn.is-loading:disabled { background: var(--btn-bg); color: transparent; border-color: var(--btn-bd); }
@keyframes btn-spin { to { transform: rotate(1turn); } }

/* ---------------------------------------------------------------- details */

.kv { display: grid; grid-template-columns: 130px 1fr; gap: 7px 14px; font-size: 13px; }
.kv dt { color: var(--muted); font-weight: 600; }
.kv dd { margin: 0; font-weight: 600; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li {
  position: relative; padding-bottom: 16px; padding-inline-start: 22px; font-size: 13px; color: var(--ink-2);
  border-inline-start: 2px solid var(--line); margin-inline-start: 6px;
}
.timeline li:last-child { border-inline-start-color: transparent; padding-bottom: 0; }
.timeline li::before {
  content: ''; position: absolute; inset-inline-start: -6px; top: 4px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--line-2);
}
.timeline li.t-bad::before  { border-color: var(--bad); }
.timeline li.t-good::before { border-color: var(--good); }
.timeline li.t-warn::before { border-color: var(--warn); }
.timeline .when { display: block; font-size: 11.5px; color: var(--muted); }
/* A trail entry can carry an unbroken 400-character Stripe URL. Without this it
   stretches the whole page sideways instead of wrapping inside its card. */
.timeline li > div { overflow-wrap: anywhere; word-break: break-word; }

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

/* --------------------------------------------------------- impersonation */

.impersonate-bar {
  position: sticky; top: 0; z-index: 60;
  background: var(--warn-soft); border-bottom: 1px solid var(--warn-line);
  color: var(--warn-ink); font-size: 12.5px; font-weight: 700;
  padding: 7px 16px; display: flex; align-items: center; gap: 10px;
}

/* ------------------------------------------------------- accessibility */

:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; border-radius: 4px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .btn:hover, .tenant-card:hover, .topbar .quick:hover { transform: none; }
  .btn.is-loading::after { animation: btn-spin 1s linear infinite !important; }
}

/* Drag-to-reorder rows (App themes). The handle is deliberately small and quiet:
   it is a curation tool, not the point of the row. */
.drag-cell { width: 34px; text-align: center; }
.drag-handle { color: var(--muted); cursor: grab; }
.drag-handle:active { cursor: grabbing; }
.sortable-ghost { opacity: .45; }
textarea.mono, code.mono, .mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* Receipt logo (Admin → Settings): the invoice version and the black & white print version, as they come out. */
.logo-box { min-height: 96px; border: 1px dashed var(--line-2); border-radius: var(--r-sm); background: var(--surface); display: grid; place-items: center; padding: 10px; }
.logo-box img { max-width: 100%; max-height: 90px; object-fit: contain; }
.logo-box-print { background: #fff; }
.logo-new { display: block; max-width: 100%; max-height: 60px; margin-top: 8px; object-fit: contain; }

/* Terminal setup code (Admin → Terminals, after assign / key reset) */
.setup-code { font: 800 40px/1.1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .12em; color: var(--navy); direction: ltr; }

/* Numbers in stat cards never wrap or stretch the card: one line; fitNumbers() (admin.js) shrinks the
   font just enough for big amounts (owner 2026-10-24). */
.stat-body { flex: 1 1 auto; }
.stat-value { white-space: nowrap; overflow: hidden; }
.stat-grid { grid-auto-rows: 1fr; }

/* ---------------------------------------------------------------------------
   ONE CONTROL HEIGHT (owner rule 2026-10-25: "all form items height should be the same like the drop-down menu and
   others"). Every input, select, select2 dropdown and button in a form or toolbar is --control-h tall — the -sm
   variants included — so a filter row reads as one line. Only the icon buttons inside table rows stay compact
   (.table-oz … .row-actions above wins: it is more specific); they are row tools, not form fields.
   ------------------------------------------------------------------------- */
.form-control-sm, .form-select-sm { min-height: var(--control-h); padding: 9px 12px; font-size: 14px; border-radius: var(--r-sm); }
.form-select-sm { padding-inline-end: 34px; }
.btn, .btn-sm { min-height: var(--control-h); }
/* The select2 theme sizes a small dropdown through `.form-select-sm ~ .select2-container…` (3 classes) — matched here. */
.select2-container--bootstrap-5 .select2-selection,
.form-select ~ .select2-container--bootstrap-5 .select2-selection,
.form-select-sm ~ .select2-container--bootstrap-5 .select2-selection { min-height: var(--control-h); border-color: var(--line-2); border-radius: var(--r-sm); font-size: 14px; }
.select2-container--bootstrap-5 .select2-selection--single,
.form-select ~ .select2-container--bootstrap-5 .select2-selection--single,
.form-select-sm ~ .select2-container--bootstrap-5 .select2-selection--single { padding-block: 9px; padding-inline: 12px 34px; }
.select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered { line-height: 1.5; padding: 0; }
.select2-container--bootstrap-5.select2-container--focus .select2-selection,
.select2-container--bootstrap-5.select2-container--open .select2-selection { border-color: var(--navy); box-shadow: var(--ring); }

/* ---------------------------------------------------------------------------
   Sizing helpers for page markup (never inline style="…px" in a page).
   ------------------------------------------------------------------------- */
/* Option lists (Admin → Option lists): drag handle column. */
.lk-handle-col { width: 34px; }
.lk-handle { cursor: grab; color: var(--muted); padding: 4px; }
.lk-handle:hover { color: var(--ink); }
.sortable-ghost { opacity: .45; background: var(--navy-soft); }
.w-search { width: 260px; max-width: 100%; }                           /* toolbar search box (never the full row) */
.w-branch { width: 260px; max-width: 100%; }                           /* branch filter in a toolbar (select2 fills it) */
.w-branch-lg { width: 320px; max-width: 100%; }                        /* dashboard branch filter */
.w-file { max-width: 380px; }                                          /* file pickers (statements, bulk import) */
.w-picker { max-width: 360px; }                                        /* a single select beside a button */
.w-code { max-width: 100px; }                                          /* terminal code input */
.col-assign { min-width: 320px; }                                      /* "assign to shop" cell */
.col-key { width: 22%; }                                               /* translations: key column */
.col-min { width: 1%; }                                                /* a column as narrow as its content */
.col-thumb { width: 56px; }
.thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; }
.cell-meta { max-width: 340px; word-break: break-word; }               /* audit details */
.scroll-box { max-height: 420px; overflow: auto; }                     /* a long preview table */
.grant-check { width: 1.4rem; height: 1.4rem; }                        /* roles matrix tick boxes */
