/* ============================================================================
   Oz POS — merchant portal
   Direction: "modern SaaS console" (Linear / Stripe dashboard).
   Neutral greys, one strong accent (POS blue — the brand), 8px-family radii,
   solid buttons that lift on hover, crisp tables. Manrope throughout: the
   headings are the body sans at 700/800 with tight tracking, not a serif.
   Light by design — kitchen staff work in daylight, on phones, at speed.

   Token NAMES are a contract (cards.css, ops.css, studio.css and inline page
   styles all read them). Values changed; names did not.
   ========================================================================== */

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

:root {
  /* ---- ground & ink: true neutrals, no warmth ---------------------------- */
  --paper:      #F6F7F8;
  --surface:    #FFFFFF;
  --surface-2:  #F1F2F4;
  --surface-3:  #E9EBEE;   /* pressed / track */
  --ink:        #15181D;
  --ink-2:      #464C56;
  --muted:      #7E858F;
  --line:       #E4E6EA;
  --line-2:     #D2D6DC;
  --line-3:     #BFC5CD;   /* hovered control / pill border */
  --surface-4:  #C3C9D1;   /* hovered switch track */
  --on-accent:  #FFFFFF;   /* text / icons on a solid accent or dark fill */
  --shade:      #13161C;   /* base of shadows and scrims (alpha via color-mix) */

  /* ---- the one strong accent -------------------------------------------- */
  --herb:       #49316B;   /* primary accent — OZ POS brand purple (brand kit 2026-11-15) */
  --herb-soft:  #EFEBF5;
  --herb-deep:  #3A2756;
  --herb-line:  #D6CDE3;
  --herb-ink:   #2A1B40;

  /* ---- semantic only (no longer decorative) ------------------------------ */
  --citrus:     #D2691A;   /* warning / attention */
  --citrus-soft:#FCF1E6;
  --citrus-line:#F1DAC2;
  --citrus-ink: #9A4C10;
  --berry:      #C0344E;   /* destructive */
  --berry-soft: #FCEAEE;
  --berry-line: #F3CFD8;
  --berry-deep: #A62A41;   /* destructive button, hovered */
  --info:       #2A6F97;
  --info-soft:  #E9F2F8;
  --info-line:  #CBDEEB;
  --info-ink:   #1D5273;
  --gold:       #B8891F;   /* "the system chose this" / default marker */
  --gold-soft:  #FBF4E4;
  --gold-line:  #EADFC0;
  --gold-ink:   #7A6120;

  --row-hover:  #F8F9FA;

  /* ---- shape ------------------------------------------------------------- */
  --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);

  /* ---- density ----------------------------------------------------------- */
  --sidebar-w: 232px;
  --topbar-h:  54px;
  /* One control height portal-wide. 40px, not Bootstrap's 38: a rendered
     .form-control is 40.25px tall (13.5px/1.5 text + 9px×2 padding + 1px×2
     border), so anything built to 38 sat 1.1px above the input beside it.
     At 40 every control in a row shares a centre line to within 0.13px. */
  --control-h: 40px;

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

  /* Display IS the body sans now — 700/800, tight. Fraunces is retired from
     the portal chrome; nothing here should read "editorial". */
  --font-body: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: var(--font-body);
  --font-mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
}

* { 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;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'tnum' 0;
}

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

a { color: var(--herb); text-decoration: none; transition: color .14s var(--ease); }
a:hover { color: var(--herb-deep); }
.muted { color: var(--muted); }
.mono, .tnum { font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ 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(--herb);
  --login-deep:   var(--herb-ink);
  --login-soft:   var(--herb-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);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  background: color-mix(in srgb, var(--on-accent) 82%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
  z-index: 40;
}

.topbar .brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 14.5px;
  letter-spacing: -0.022em;
}

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

.topbar .dropdown-toggle { color: var(--ink); font-weight: 600; font-size: 13px; }
.topbar .dropdown-toggle::after { margin-inline-start: .4rem; opacity: .45; }

/* Topbar pills (language switch, role tag) read as quiet chrome, not buttons. */
.topbar .btn,
.topbar .badge {
  border-radius: var(--r-sm);
  font-size: 12px;
  font-weight: 700;
}

.dropdown-menu {
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-lg);
  padding: 5px;
  font-size: 13.5px;
}
.dropdown-item { border-radius: var(--r-sm); padding: 7px 10px; font-weight: 600; color: var(--ink-2); }
.dropdown-item:hover, .dropdown-item:focus { background: var(--surface-2); color: var(--ink); }
.dropdown-divider { border-color: var(--line); margin: 5px 0; }

.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;
  transition: transform .22s var(--ease);
  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::-webkit-scrollbar-track { background: transparent; }

.sidebar-inner { padding: 12px 10px 32px; }

.nav-group { margin-bottom: 16px; }

.nav-group-title {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 10px;
  margin-bottom: 5px;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: var(--r-sm);
  color: var(--ink-2);
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 1px;
  transition: background .14s var(--ease), color .14s var(--ease);
}

.nav-item i { width: 16px; text-align: center; font-size: 13px; 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); }

/* Active = a solid herb rail plus a tint. Reads at a glance in a long list. */
.nav-item.active {
  background: var(--herb-soft);
  color: var(--herb-ink);
  font-weight: 700;
}
.nav-item.active i { color: var(--herb); }
.nav-item.active::before {
  content: '';
  position: absolute;
  inset-block: 6px;
  inset-inline-start: -10px;
  width: 3px;
  border-start-end-radius: 3px;
  border-end-end-radius: 3px;
  background: var(--herb);
}

/* Attention pill: rendered by navLink() when navAlerts() has a count, kept live
   by app.js. Citrus = today's work; .urgent (berry) = money waiting on a reply. */
.nav-badge {
  margin-inline-start: auto;
  min-width: 19px;
  height: 19px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--citrus);
  color: var(--on-accent);
  font-size: 10.5px;
  font-weight: 800;
  line-height: 19px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 0 var(--citrus);
  animation: nav-pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;
  --pulse: var(--citrus);
}
.nav-badge.urgent { background: var(--berry); --pulse: var(--berry); }

@keyframes nav-pulse {
  0%   { transform: scale(1);    box-shadow: 0 0 0 0   color-mix(in srgb, var(--pulse) 42%, transparent); }
  60%  { transform: scale(1.05); box-shadow: 0 0 0 5px color-mix(in srgb, var(--pulse) 0%, transparent); }
  100% { transform: scale(1);    box-shadow: 0 0 0 0   color-mix(in srgb, var(--pulse) 0%, transparent); }
}

.content {
  margin-inline-start: var(--sidebar-w);
  padding: calc(var(--topbar-h) + 24px) 24px 56px;
  min-height: 100vh;
  width: auto;   /* fill the viewport — no artificial max-width letterboxing */
}

/* ------------------------------------------------------------ page head */

.page-head {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  animation: rise .35s var(--ease) both;
}

.page-head h1 {
  font-size: 23px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.026em;
}

.page-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
}

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

.card-x {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
}

.card-x .card-x-head {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-x .card-x-head h3 { font-size: 14px; font-weight: 800; letter-spacing: -0.015em; }
.card-x .card-x-body { padding: 16px; }

/* Staggered entrance — content lands in reading order, not all at once. */
.stagger > * { animation: rise .38s var(--ease) both; }
.stagger > *:nth-child(1) { animation-delay: .01s; }
.stagger > *:nth-child(2) { animation-delay: .04s; }
.stagger > *:nth-child(3) { animation-delay: .07s; }
.stagger > *:nth-child(4) { animation-delay: .10s; }
.stagger > *:nth-child(5) { animation-delay: .13s; }
.stagger > *:nth-child(6) { animation-delay: .16s; }

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

/* ------------------------------------------------------------ stat tile */

.stat {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 14px 16px 15px;
  height: 100%;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .16s var(--ease), border-color .16s var(--ease);
}

.stat:hover { box-shadow: var(--shadow); border-color: var(--line-2); }

.stat .label {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 7px;
}
.stat .label i { color: var(--line-2); font-size: 11px; }

.stat .value {
  font-family: var(--font-display);
  font-size: 27px;
  font-weight: 800;
  line-height: 1.1;
  margin-top: 7px;
  letter-spacing: -0.032em;
  font-variant-numeric: tabular-nums;
}

.stat .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* Tone variants earn their colour: accent = good, warn = needs a human. */
.stat.accent { background: var(--herb-soft); border-color: var(--herb-line); }
.stat.accent .value { color: var(--herb-ink); }
.stat.accent .label { color: var(--herb-deep); }
.stat.accent .label i { color: var(--herb); }
.stat.warn { background: var(--citrus-soft); border-color: var(--citrus-line); }
.stat.warn .value { color: var(--citrus-ink); }
.stat.warn .label { color: var(--citrus-ink); }
.stat.warn .label i { color: var(--citrus); }

/* --------------------------------------------------------------- tables */

/* The DataTables wrapper is the card: one border, rounded, with the toolbar
   and the footer inside it rather than floating on the page ground. */
.dataTables_wrapper {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.dataTables_wrapper > .row:first-child {
  margin: 0;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  align-items: center;
}
.dataTables_wrapper > .row:last-child {
  margin: 0;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  align-items: center;
}
.dataTables_wrapper > .row > [class*="col-"] { padding-inline: 0; }
.card-x .dataTables_wrapper { border: 0; border-radius: 0; box-shadow: none; }

table.dataTable {
  border-collapse: separate !important;
  border-spacing: 0;
  width: 100% !important;
  margin: 0 !important;
}

table.dataTable thead th {
  background: var(--surface-2);
  border-bottom: 1px solid var(--line) !important;
  border-top: 0 !important;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 9px 14px !important;
  white-space: nowrap;
}
table.dataTable thead th.sorting,
table.dataTable thead th.sorting_asc,
table.dataTable thead th.sorting_desc { cursor: pointer; }
table.dataTable thead th:focus-visible { outline-offset: -2px; }

table.dataTable tbody td {
  padding: 10px 14px !important;
  border-bottom: 1px solid var(--line) !important;
  vertical-align: middle;
  font-size: 13px;
  color: var(--ink-2);
}
table.dataTable tbody tr:last-child td { border-bottom: 0 !important; }

table.dataTable tbody tr { transition: background .12s var(--ease); }
table.dataTable tbody tr:hover { background: var(--row-hover); }
table.dataTable tbody tr:hover .btn-icon { border-color: var(--line-2); }

.table-thumb {
  width: 38px;
  height: 38px;
  border-radius: var(--r-sm);
  object-fit: cover;
  background: var(--surface-2);
  border: 1px solid var(--line);
  display: block;
}

.row-title { font-weight: 700; color: var(--ink); letter-spacing: -0.008em; }

.dataTables_wrapper .dataTables_filter { margin: 0; }
.dataTables_wrapper .dataTables_filter label { margin: 0; width: 100%; max-width: 300px; }
.dataTables_wrapper .dataTables_filter input {
  width: 100%;
  margin: 0;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  padding: 7px 11px;
  font-size: 13px;
  background-color: var(--surface);
  color: var(--ink);
  outline: none;
  transition: border-color .14s var(--ease), box-shadow .14s var(--ease);
}
.dataTables_wrapper .dataTables_filter input::placeholder { color: var(--muted); }
.dataTables_wrapper .dataTables_filter input:focus { border-color: var(--herb); box-shadow: var(--ring); }
.dataTables_wrapper .dataTables_length { margin: 0; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.dataTables_wrapper .dataTables_length label { margin: 0; display: inline-flex; align-items: center; gap: 7px; }
.dataTables_wrapper .dataTables_length select {
  border-radius: var(--r-sm);
  border: 1px solid var(--line-2);
  background-color: var(--surface);
  color: var(--ink);
  padding: 5px 24px 5px 9px;
  font-size: 12.5px;
  font-weight: 700;
  background-repeat: no-repeat;
  /* A toolbar control, not a form field: it must not inherit --control-h. */
  width: auto;
  min-height: 30px;
  height: 30px;
  background-size: 13px 13px;
  background-position: right 7px center;
}
[dir="rtl"] .dataTables_wrapper .dataTables_length select { background-position: left 7px center; padding: 5px 9px 5px 24px; }
.dataTables_wrapper .dataTables_info { color: var(--muted); font-size: 12.5px; padding: 0 !important; font-variant-numeric: tabular-nums; }
.dataTables_wrapper .dataTables_paginate { margin: 0 !important; padding: 0 !important; }

.pagination { margin: 0; gap: 3px; }
.page-link {
  color: var(--ink-2);
  border: 1px solid transparent;
  border-radius: var(--r-sm) !important;
  background: transparent;
  font-size: 12.5px;
  font-weight: 700;
  min-width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .14s var(--ease), color .14s var(--ease);
}
.page-link:hover { background: var(--surface-2); color: var(--ink); border-color: transparent; }
.page-link:focus { box-shadow: var(--ring); }
.page-item.active .page-link { background: var(--herb); border-color: var(--herb); color: var(--on-accent); }
.page-item.disabled .page-link { color: var(--line-2); background: transparent; }

/* ---------------------------------------------------------------- chips */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: -0.005em;
  background: var(--surface-2);
  color: var(--ink-2);
  border: 1px solid var(--line);
  white-space: nowrap;
  line-height: 1.5;
}

.chip.ok     { background: var(--herb-soft);   color: var(--herb-ink);   border-color: var(--herb-line); }
.chip.warn   { background: var(--citrus-soft); color: var(--citrus-ink); border-color: var(--citrus-line); }
.chip.off    { background: var(--surface-2);   color: var(--muted);      border-color: var(--line); }
.chip.danger { background: var(--berry-soft);  color: var(--berry);      border-color: var(--berry-line); }
.chip.info   { background: var(--info-soft);   color: var(--info-ink);   border-color: var(--info-line); }

/* A status dot is the quietest state marker there is — use it in dense rows. */
.sdot {
  width: 7px; height: 7px; border-radius: 50%; flex: none;
  display: inline-block; background: var(--line-2);
}
.sdot.ok     { background: var(--herb);   box-shadow: 0 0 0 2.5px var(--herb-soft); }
.sdot.warn   { background: var(--citrus); box-shadow: 0 0 0 2.5px var(--citrus-soft); }
.sdot.danger { background: var(--berry);  box-shadow: 0 0 0 2.5px var(--berry-soft); }
.sdot.off    { background: var(--line-2); box-shadow: 0 0 0 2.5px var(--surface-2); }

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

/* Block, always. Without this an inline-flex control (.stepper) sits BESIDE its
   label while a .form-control sits under it, so a row of mixed fields staggers. */
.form-label {
  display: block;
  font-weight: 700;
  font-size: 12px;
  color: var(--ink-2);
  letter-spacing: -0.005em;
  margin-bottom: 5px;
}

/* Every field column starts at the same y and its control shares one centre
   line, whatever the control is (input, stepper, time, colour, switch). */
.form-page .row > [class*="col-"] { display: flex; flex-direction: column; }
.form-page .row > [class*="col-"] > .form-hint:last-child { margin-top: auto; padding-top: 4px; }

/* Control geometry is a contract with .oz-switch-box below — 13.5px/1.5 text,
   9px+9px padding and 1px+1px border resolve to 40.25px. Do not "tidy" these
   numbers without re-deriving the switch spacer, or form rows stagger again. */
.form-control, .form-select {
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  padding: 9px 12px;
  font-size: 13.5px;
  color: var(--ink);
  /* background-COLOR, never the `background` shorthand: the shorthand resets
     background-repeat, which tiles the .form-select chevron across the box. */
  background-color: var(--surface);
  box-shadow: 0 1px 1px color-mix(in srgb, var(--shade) 2%, transparent) 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-3); }

.form-control:focus, .form-select:focus {
  border-color: var(--herb);
  box-shadow: var(--ring);
  background-color: var(--surface);
}

.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; padding-inline: 12px 34px; }

textarea.form-control { min-height: 84px; line-height: 1.55; resize: vertical; }

/* ---- file input: the browser's own control, replaced ------------------- */
/* A raw "Choose File / No file chosen" is the single ugliest thing in the
   portal. Style the shadow button into a real secondary control and let the
   rest of the field read as the drop target. No markup change needed. */
.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-3); }
.form-control[type="file"]:hover::file-selector-button { background: var(--surface-3); color: var(--ink); }
.form-control[type="file"]:focus { border-color: var(--herb); box-shadow: var(--ring); }
.form-control[type="file"]:focus::file-selector-button { background: var(--herb-soft); color: var(--herb-ink); }
.form-control[type="file"]:disabled { cursor: not-allowed; }
.form-control-sm[type="file"] { line-height: calc(var(--control-h) - 2px); }

/* The image field is a composite: a 72px preview beside the picker and its
   hint. Bootstrap centres that flex row, which drops the picker ~28px below
   the plain control in the next column. Top-align it instead, so the picker
   still shares the row's control line and the preview simply hangs below. */
.form-page .row > [class*="col-"] > .d-flex:has(> img.table-thumb) { align-items: flex-start !important; }

input[type="color"].form-control {
  padding: 3px;
  height: var(--control-h);
  cursor: pointer;
}
input[type="color"].form-control::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"].form-control::-webkit-color-swatch { border: 0; border-radius: 3px; }

input[type="time"].form-control::-webkit-calendar-picker-indicator,
input[type="date"].form-control::-webkit-calendar-picker-indicator { opacity: .45; cursor: pointer; }
input[type="time"].form-control:hover::-webkit-calendar-picker-indicator,
input[type="date"].form-control:hover::-webkit-calendar-picker-indicator { opacity: .8; }

.input-group-text {
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-inline-end: 0;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 700;
  border-start-start-radius: var(--r-sm);
  border-end-start-radius: var(--r-sm);
  border-start-end-radius: 0;
  border-end-end-radius: 0;
}

.form-hint { font-size: 11.5px; color: var(--muted); margin-top: 4px; line-height: 1.45; }

.form-check-input { border-color: var(--line-2); }
.form-check-input:checked { background-color: var(--herb); border-color: var(--herb); }
.form-check-input:focus { box-shadow: var(--ring); border-color: var(--herb); }

/* ---- inline validation ------------------------------------------------- */
/* app.js marks the offending field and scrolls to it; a toast alone leaves the
   user hunting. The message is injected as .field-error next to the control. */
.form-control.is-invalid, .form-select.is-invalid,
.is-invalid .form-control, .is-invalid .form-select {
  border-color: var(--berry);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--berry) 14%, transparent);
  background-image: none;
}
.form-select.is-invalid { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23C0344E' 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"); }
.field-error {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--berry);
  margin-top: 4px;
  animation: rise .2s var(--ease) both;
}
.field-flash { animation: field-flash .9s var(--ease) both; }
@keyframes field-flash {
  0%, 100% { box-shadow: 0 0 0 3px transparent; }
  25%, 60% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--berry) 22%, transparent); }
}

/* ------------------------------------------------------------ .oz-switch
   The one switch used everywhere (forms, settings, list rows, studio).
     <label class="oz-switch">
       <input type="checkbox" role="switch" name="…" value="1">
       <span class="oz-switch-track"></span>
       <span class="oz-switch-label">Label</span>   (optional)
     </label>
   The input stays a real checkbox, so form posts and `.is(':checked')` /
   `.prop('checked')` keep working; the track is purely visual.
   - In a form grid wrap it in .oz-switch-field: a hidden label line plus a
     --control-h box, so a switch column is exactly as tall as an input column
     and both share the same centre line.
   - Several switches together: .oz-switch-stack (12px apart, labels aligned).
   - A hint under a switch (.oz-switch + .form-hint) indents to the label. */
.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: 0 1px 2px color-mix(in srgb, var(--shade) 30%, transparent), 0 0 0 1px color-mix(in srgb, var(--shade) 4%, transparent);
  transition: transform .16s var(--ease);
}
.oz-switch:hover .oz-switch-track { background: var(--surface-4); }
.oz-switch input:checked ~ .oz-switch-track { background: var(--herb); }
.oz-switch:hover input:checked ~ .oz-switch-track { background: var(--herb-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(--herb);
  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; }
/* A pending toggle (app.js) shows it is talking to the server. */
.oz-switch.is-busy { opacity: .6; pointer-events: none; }

/* The spacer stands in for the field's label, so it must occupy exactly the
   same box a real .form-label does — block, no baseline strut. (As
   inline-block it picked up 3px of strut from its line box and pushed the
   switch 3px below the inputs beside it.) The box under it is as tall as a
   rendered .form-control: 9px+9px padding, 1px+1px border and one 13.5px/1.5
   line (40.25px), never less than --control-h. */
.oz-switch-field .oz-switch-spacer { display: block; visibility: hidden; }
.oz-switch-box {
  display: flex; align-items: center;
  font-size: 13.5px; 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; }

/* --control-h is declared in :root; these are the controls it governs, so a
   row of mixed inputs, steppers, selects, buttons and switches lines up. */
.form-control, .form-select { min-height: var(--control-h); }
.stepper { display: inline-flex; align-items: stretch; gap: 5px; height: var(--control-h); }
.stepper .form-control { width: 76px; text-align: center; font-weight: 800; min-height: 0; height: var(--control-h); font-variant-numeric: tabular-nums; }
.stepper button {
  width: 34px; height: var(--control-h);
  border: 1px solid var(--line-2);
  background: var(--surface);
  border-radius: var(--r-sm);
  color: var(--ink-2);
  font-size: 15px; line-height: 1;
  box-shadow: var(--shadow-sm);
  transition: background .13s var(--ease), color .13s var(--ease), border-color .13s var(--ease), transform .08s var(--ease);
}
.stepper button:hover { background: var(--surface-2); color: var(--ink); border-color: var(--line-3); }
.stepper button:active { transform: scale(.94); background: var(--surface-3); }
.stepper button:focus-visible { outline: 2px solid var(--herb); outline-offset: 1px; }

/* select2 (bootstrap-5 theme) to the same control height, vertically centred. */
.select2-container--bootstrap-5 .select2-selection {
  min-height: var(--control-h) !important;
  display: flex; align-items: center;
  border-color: var(--line-2) !important;
  border-radius: var(--r-sm) !important;
  font-size: 13.5px;
}
.select2-container--bootstrap-5.select2-container--focus .select2-selection,
.select2-container--bootstrap-5.select2-container--open .select2-selection {
  border-color: var(--herb) !important;
  box-shadow: var(--ring) !important;
}
.select2-container--bootstrap-5 .select2-dropdown {
  border-color: var(--line) !important;
  border-radius: var(--r) !important;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.select2-container--bootstrap-5 .select2-results__option--highlighted { background: var(--herb) !important; }
.select2-container--bootstrap-5 .select2-results__option--selected { background: var(--herb-soft) !important; color: var(--herb-ink) !important; }

/* -------------------------------------------------------------- buttons */
/* Solid, confident, one accent. Every button lifts 1px on hover and settles
   on press, so a click always feels 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-3);
  --btn-lift: -1px;
  --btn-shadow-h: var(--shadow);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: -0.008em;
  line-height: 1.25;
  border-radius: var(--r-sm);
  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(--herb); outline-offset: 2px; }
/* Bootstrap's own `.btn:disabled` rule is more specific than `.btn` and would
   repaint a disabled button in Bootstrap blue, so restate the tokens here. A
   disabled control reads as a flat neutral — deliberately off, not a faded
   version of the accent, which looks like a rendering fault. */
.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;
}
/* …except while it is working: a loading button keeps its own colour. */
.btn.is-loading:disabled {
  background: var(--btn-bg);
  color: transparent;
  border-color: var(--btn-bd);
}
.btn i { font-size: .95em; }

.btn-primary, .btn-success {
  --btn-bg: var(--herb);
  --btn-fg: var(--on-accent);
  --btn-bd: var(--herb);
  --btn-bg-h: var(--herb-deep);
  --btn-fg-h: var(--on-accent);
  --btn-bd-h: var(--herb-deep);
  --btn-shadow-h: var(--shadow-btn-h);
}

.btn-danger {
  --btn-bg: var(--berry);
  --btn-fg: var(--on-accent);
  --btn-bd: var(--berry);
  --btn-bg-h: var(--berry-deep);
  --btn-fg-h: var(--on-accent);
  --btn-bd-h: var(--berry-deep);
  --btn-shadow-h: 0 2px 3px color-mix(in srgb, var(--shade) 8%, transparent), 0 6px 14px -3px color-mix(in srgb, var(--berry) 34%, transparent);
}

.btn-warning {
  --btn-bg: var(--citrus);
  --btn-fg: var(--on-accent);
  --btn-bd: var(--citrus);
  --btn-bg-h: var(--citrus-ink);
  --btn-fg-h: var(--on-accent);
  --btn-bd-h: var(--citrus-ink);
}

.btn-secondary, .btn-outline-secondary, .btn-light {
  --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-3);
}

.btn-outline-primary {
  --btn-bg: var(--surface);
  --btn-fg: var(--herb);
  --btn-bd: var(--herb-line);
  --btn-bg-h: var(--herb-soft);
  --btn-fg-h: var(--herb-deep);
  --btn-bd-h: var(--herb);
}

.btn-outline-danger {
  --btn-bg: var(--surface);
  --btn-fg: var(--berry);
  --btn-bd: var(--berry-line);
  --btn-bg-h: var(--berry-soft);
  --btn-fg-h: var(--berry);
  --btn-bd-h: var(--berry);
}

/* Ghost = a link that happens to be button-shaped. No border, no shadow. */
.btn-ghost, .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(--herb); --btn-fg-h: var(--herb-deep); }

.btn-sm { min-height: 30px; padding: 0 10px; font-size: 12px; border-radius: var(--r-sm); gap: 5px; }
.btn-lg { min-height: 44px; padding: 0 22px; font-size: 14.5px; border-radius: var(--r-sm); }

/* Loading: the label stays in place (no width jump) and a spinner replaces it,
   so the button cannot be clicked twice and the page does not reflow. */
.btn.is-loading { color: transparent !important; pointer-events: none; position: relative; }
.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 currentColor;
  border-color: var(--btn-fg) transparent var(--btn-fg) transparent;
  color: var(--btn-fg);
  animation: btn-spin .62s linear infinite;
}
.btn-primary.is-loading::after, .btn-danger.is-loading::after,
.btn-success.is-loading::after, .btn-warning.is-loading::after {
  border-color: var(--on-accent) transparent var(--on-accent) transparent;
}
@keyframes btn-spin { to { transform: rotate(1turn); } }

.btn-icon {
  width: 32px; height: 32px;
  display: inline-grid; place-items: center;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  box-shadow: var(--shadow-sm);
  transition: background .13s var(--ease), color .13s var(--ease),
              border-color .13s var(--ease), transform .1s var(--ease), box-shadow .13s var(--ease);
}
.btn-icon:hover { background: var(--surface-2); color: var(--ink); border-color: var(--line-2); transform: translateY(-1px); }
.btn-icon:active { transform: none; background: var(--surface-3); }
.btn-icon:focus-visible { outline: 2px solid var(--herb); outline-offset: 2px; }
.btn-icon.danger:hover { background: var(--berry-soft); color: var(--berry); border-color: var(--berry-line); }
.btn-icon.is-loading { color: transparent; pointer-events: none; }
.btn-icon.is-loading > * { visibility: hidden; }
.btn-icon.is-loading::after {
  content: ''; position: absolute; width: 13px; height: 13px; border-radius: 50%;
  border: 2px solid var(--line-2); border-top-color: var(--herb);
  animation: btn-spin .62s linear infinite;
}
.btn-icon { position: relative; }

/* --------------------------------------------------------------- modal */

.modal-content {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
}
.modal-header { border-bottom: 1px solid var(--line); padding: 15px 20px; align-items: center; }
.modal-title { font-family: var(--font-display); font-size: 16px; font-weight: 800; letter-spacing: -0.02em; }
.modal-body { padding: 20px; }
.modal-footer { border-top: 1px solid var(--line); padding: 12px 20px; gap: 8px; background: var(--paper); border-end-start-radius: var(--r-lg); border-end-end-radius: var(--r-lg); }
.modal-backdrop.show { opacity: .38; }
.modal .btn-close { --bs-btn-close-opacity: .4; border-radius: var(--r-sm); }
.modal .btn-close:hover { --bs-btn-close-opacity: .8; }
.modal.fade .modal-dialog { transform: translateY(10px) scale(.99); transition: transform .2s var(--ease); }
.modal.show .modal-dialog { transform: none; }

/* ---------------------------------------------------------- empty state */

.empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--muted);
}
.empty i {
  font-size: 18px;
  color: var(--muted);
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  width: 46px; height: 46px;
  border-radius: var(--r);
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.empty h3 { font-size: 15px; font-weight: 800; color: var(--ink); margin-bottom: 4px; letter-spacing: -0.015em; }
.empty p { font-size: 13px; margin: 0 auto; max-width: 380px; }
.empty .btn { margin-top: 16px; }
.empty.page-empty { max-width: 520px; margin: 48px auto; }   /* a whole page that is only this message (noaccess.php) */
.content.no-sidebar { margin-inline-start: 0; }

/* Drag-to-sort (SortableJS) — the only way order is set anywhere in the portal */
.drag-handle { cursor: grab; color: var(--muted); touch-action: none; user-select: none; transition: color .13s var(--ease); }
.drag-handle:hover { color: var(--ink-2); }
.drag-handle:active, .sortable-chosen .drag-handle { cursor: grabbing; }
.card-item { position: relative; }
.card-grid.sorting > * { animation: none; }   /* moving a node would replay the entrance rise */
.card-grip {
  position: absolute; top: 9px; inset-inline-start: 9px; z-index: 3;
  width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--on-accent) 94%, transparent); border: 1px solid var(--line); border-radius: var(--r-sm);
  box-shadow: var(--shadow-sm); font-size: 11px; color: var(--ink-2);
  backdrop-filter: blur(4px);
}
.sort-hint { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.sortable-ghost { opacity: .4; background: var(--herb-soft); border-radius: var(--r-sm); }
.sortable-drag { opacity: .97; box-shadow: var(--shadow-lg); }

/* --------------------------------------------------------------- misc */

.toast-top-right { top: calc(var(--topbar-h) + 12px); inset-inline-end: 16px; inset-inline-start: auto; }
#toast-container > div {
  border-radius: var(--r);
  box-shadow: var(--shadow-lg);
  opacity: 1;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  padding: 13px 16px 13px 46px;
  background-size: 17px;
  background-position: 15px center;
  border: 1px solid color-mix(in srgb, var(--on-accent) 16%, transparent);
}
[dir="rtl"] #toast-container > div { padding: 13px 46px 13px 16px; background-position: right 15px center; }
#toast-container > .toast-success { background-color: var(--herb); }
#toast-container > .toast-error   { background-color: var(--berry); }
#toast-container > .toast-warning { background-color: var(--citrus); }
#toast-container > .toast-info    { background-color: var(--info); }
#toast-container > div:hover { box-shadow: var(--shadow-lg); }
.toast-progress { background: color-mix(in srgb, var(--on-accent) 50%, transparent); opacity: 1; height: 2px; }

.swal2-popup {
  border-radius: var(--r-lg) !important;
  font-family: var(--font-body) !important;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  padding: 26px 24px 20px !important;
}
.swal2-title {
  font-family: var(--font-display) !important;
  font-size: 18px !important;
  font-weight: 800 !important;
  letter-spacing: -0.02em;
  color: var(--ink) !important;
}
.swal2-html-container { font-size: 13.5px !important; color: var(--ink-2) !important; }
.swal2-actions { gap: 8px; margin-top: 20px !important; }
.swal2-styled { border-radius: var(--r-sm) !important; font-weight: 700 !important; font-size: 13px !important;
                padding: 9px 18px !important; box-shadow: var(--shadow-btn) !important; transition: transform .1s var(--ease), box-shadow .16s var(--ease); }
.swal2-styled:hover { transform: translateY(-1px); }
.swal2-styled:focus { box-shadow: var(--ring) !important; }
/* Cancel is the portal's secondary button, not a coloured one. app.js
   deliberately leaves `cancelButtonColor` unset so this rule wins. */
.swal2-styled.swal2-cancel {
  background: var(--surface) !important;
  color: var(--ink-2) !important;
  border: 1px solid var(--line-2) !important;
}
.swal2-styled.swal2-cancel:hover { background: var(--surface-2) !important; color: var(--ink) !important; }
.swal2-input, .swal2-textarea {
  border: 1px solid var(--line-2) !important;
  border-radius: var(--r-sm) !important;
  box-shadow: none !important;
  font-size: 13.5px !important;
  font-family: var(--font-body) !important;
}
.swal2-input:focus, .swal2-textarea:focus { border-color: var(--herb) !important; box-shadow: var(--ring) !important; }
.swal2-icon { margin: 4px auto 14px !important; width: 62px !important; height: 62px !important; }
.swal2-icon .swal2-icon-content { font-size: 32px !important; }

/* Progress / meters */
.progress { background: var(--surface-2); border-radius: 999px; height: 6px; }
.progress-bar { background: var(--herb); border-radius: 999px; }

hr { border-color: var(--line); opacity: 1; }
code, kbd, samp { font-family: var(--font-mono); font-size: .92em; }

/* --------------------------------------------------------- responsive */

@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  [dir="rtl"] .sidebar { transform: translateX(100%); }
  .sidebar.open, [dir="rtl"] .sidebar.open { transform: none; }
  .content { margin-inline-start: 0; padding: calc(var(--topbar-h) + 18px) 16px 44px; }
  .page-head h1 { font-size: 21px; }
}

@media (max-width: 575.98px) {
  .content { padding-left: 12px; padding-right: 12px; }
  .card-x .card-x-body { padding: 14px; }
  .stat .value { font-size: 24px; }
  .page-head { align-items: flex-start; }
  .dataTables_wrapper > .row:first-child { display: block; }
  .dataTables_wrapper .dataTables_filter label { max-width: none; }
}

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

:focus-visible {
  outline: 2px solid var(--herb);
  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;
    scroll-behavior: auto !important;
  }
  .nav-badge { animation: none; box-shadow: none; } /* a still pill still reads */
  .btn.is-loading::after { animation: btn-spin 1s linear infinite !important; }
  .btn:hover, .btn-icon:hover, .swal2-styled:hover { transform: none; }
}

/* ------------------------------------------------------------ image crop */
/* Cropper sizes its container to the IMAGE's rendered box, so the image — not
   the modal — is what must be bounded. A fixed stage keeps the header, the
   picture and the footer buttons on one screen at any image ratio. */
.crop-body { padding: 12px; }
.crop-stage {
  height: min(56vh, 420px);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}
.crop-stage > img { display: block; max-width: 100%; max-height: 100%; }
/* Cropper replaces the <img> with this wrapper — hold it to the stage too. */
.crop-stage .cropper-container { max-width: 100%; max-height: 100%; }
.crop-stage .cropper-view-box { outline-color: var(--herb); }
.crop-stage .cropper-point, .crop-stage .cropper-line { background-color: var(--herb); }
#cropModal .modal-footer { position: sticky; bottom: 0; background: var(--surface); }
@media (max-height: 640px) { .crop-stage { height: 46vh; } }

.crop-tools { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.crop-tools .btn-icon { flex: none; }
.crop-sep { width: 1px; height: 20px; background: var(--line); margin: 0 2px; }
.crop-zoom { flex: 1; accent-color: var(--herb); height: 4px; cursor: pointer; }
.crop-zoom:focus-visible { outline: 2px solid var(--herb); outline-offset: 3px; }
.crop-hint { margin: 8px 0 0; font-size: 12px; color: var(--muted); text-align: center; }

/* ---- Oz POS: printing a report/list directly (receipts & invoices use bare print.php pages) ---- */
@media print {
  .sidebar, .topbar, .no-print, .impersonate-bar, .form-bar, .dataTables_length, .dataTables_filter, .dataTables_paginate { display: none !important; }
  .content { margin: 0 !important; padding: 0 !important; }
  .card-x, .stat { box-shadow: none !important; break-inside: avoid; }
  body { background: var(--surface) !important; }
}
/* Money columns: tabular figures so amounts line up; numbers stay LTR inside RTL. */
.num { font-variant-numeric: tabular-nums; white-space: nowrap; text-align: end; }
[dir="rtl"] .num { direction: ltr; unicode-bidi: isolate; }
.vat-note { font-size: 12px; color: var(--muted); }
.tfoot-total td { font-weight: 800; border-top: 2px solid var(--line-2); }

/* Numbers in tiles never wrap or stretch the tile: one line, and fitNumbers() (app.js) shrinks the
   font just enough when a big amount would overflow (owner 2026-10-24: "cards size keep changing"). */
.stat .value, .cstat strong, .cstat .v { white-space: nowrap; overflow: hidden; }
