/* ==========================================================================
   SefrYak RMS — interface styles

   Palette taken directly from the Sefr Yak mark: #0091FE azure against
   black, split on a diagonal. That diagonal is the signature device and
   reappears in the app mark, the hero sweep and the login card.

   The surface is dark because glass needs something behind it to refract;
   on a pale background a frosted card is just a grey rectangle. Every
   glass surface has an opaque fallback for browsers without backdrop-filter.
   ========================================================================== */

@import url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/Vazirmatn-font-face.css');

:root {
  /* brand */
  --azure:       #0091FE;
  --azure-lift:  #38ADFF;
  --azure-deep:  #0068B8;

  /* surface */
  --void:        #05070B;
  --glass:       rgba(255, 255, 255, .055);
  --glass-hi:    rgba(255, 255, 255, .085);
  --edge:        rgba(255, 255, 255, .10);

  /* text */
  --text:        #E9EEF6;
  --text-2:      #9FADC2;
  --text-3:      #66768F;

  /* semantic — kept off the brand hue so an alert can never read as a heading */
  --good:        #2ED598;
  --warn:        #F5B33C;
  --bad:         #FF6B5E;
  --gold:        #FFC64D;

  --radius:      16px;
  --radius-sm:   11px;
  --blur:        18px;

  --sidebar-w:   250px;
  --font: 'Vazirmatn', 'Segoe UI', Tahoma, 'Iranian Sans', sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

/* ==========================================================================
   The `hidden` attribute must actually hide.

   [hidden] is only a weak `display: none` from the browser stylesheet, so
   ANY author rule that sets display beats it. That silently broke the modal
   (.modal-veil is display:grid), the table pill (.pill is inline-block) and
   the payment reference field. One rule fixes the whole class of bug.
   ========================================================================== */

[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--void);
  -webkit-font-smoothing: antialiased;
}

/* ambient field — this is what the glass actually refracts */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(52rem 34rem at 82% -8%,  rgba(0, 145, 254, .26), transparent 62%),
    radial-gradient(40rem 30rem at 6% 12%,   rgba(0, 145, 254, .13), transparent 60%),
    radial-gradient(46rem 36rem at 42% 108%, rgba(0, 104, 184, .16), transparent 62%),
    var(--void);
}

a { color: var(--azure-lift); text-decoration: none; }
a:hover { color: #6FC4FF; }

.num, .kpi-value, .delta, td.num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

:focus-visible {
  outline: 2px solid var(--azure);
  outline-offset: 3px;
  border-radius: 5px;
}

/* ==========================================================================
   GLASS
   ========================================================================== */

.glass {
  background: var(--glass);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  box-shadow:
    0 1px 0 0 rgba(255,255,255,.05) inset,
    0 24px 48px -28px rgba(0,0,0,.9);
}

@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
  .glass {
    -webkit-backdrop-filter: blur(var(--blur)) saturate(150%);
    backdrop-filter: blur(var(--blur)) saturate(150%);
  }
}

/* older Android WebView: no blur, so use an opaque panel instead of a
   washed-out transparent one that would make the text unreadable */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass { background: #121824; }
}

/* ==========================================================================
   THE MARK — the logo's counter-form and diagonal split
   ========================================================================== */

.mark {
  position: relative;
  border-radius: 30%;
  overflow: hidden;
  flex-shrink: 0;
  background: #000;
}
.mark::before {                       /* the azure half, cut on the diagonal */
  content: '';
  position: absolute;
  inset: 0;
  background: var(--azure);
  clip-path: polygon(0 0, 100% 0, 100% 34%, 0 78%);
}
.mark::after {                        /* the white counter */
  content: '';
  position: absolute;
  inset: 26%;
  border-radius: 26%;
  background: #fff;
}

.mark-lg { width: 52px; height: 52px; }
.mark-sm { width: 36px; height: 36px; }

/* ==========================================================================
   LOGIN
   ========================================================================== */

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 410px;
  padding: 34px 30px 26px;
  position: relative;
  overflow: hidden;
}

/* diagonal light sweep, echoing the mark */
.auth-card::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(196deg, rgba(0,145,254,.16) 0%, transparent 46%);
}
.auth-card > * { position: relative; z-index: 1; }

.auth-card h1 {
  margin: 18px 0 4px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.01em;
}
.auth-card .sub { margin: 0 0 24px; color: var(--text-3); font-size: 13.5px; }

.field { margin-bottom: 15px; }

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 6px;
}

.field input {
  width: 100%;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 15px;
  color: var(--text);
  background: rgba(255,255,255,.045);
  border: 1px solid var(--edge);
  border-radius: var(--radius-sm);
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.field input::placeholder { color: var(--text-3); }
.field input:focus {
  outline: none;
  border-color: var(--azure);
  background: rgba(255,255,255,.07);
  box-shadow: 0 0 0 3px rgba(0,145,254,.20);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 18px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  background: var(--azure);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .15s, transform .06s, box-shadow .15s;
  box-shadow: 0 8px 22px -10px rgba(0,145,254,.85);
}
.btn:hover { background: var(--azure-lift); }
.btn:active { transform: translateY(1px); }

.btn-quiet {
  width: auto;
  background: var(--glass-hi);
  color: var(--text-2);
  border: 1px solid var(--edge);
  font-weight: 600;
  padding: 8px 15px;
  font-size: 13.5px;
  box-shadow: none;
}
.btn-quiet:hover { background: rgba(255,255,255,.13); color: var(--text); }

.alert {
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  margin-bottom: 18px;
  border: 1px solid transparent;
}
.alert-bad  { background: rgba(255,107,94,.13);  color: #FFA79E; border-color: rgba(255,107,94,.32); }
.alert-warn { background: rgba(245,179,60,.13);  color: #F7CB7C; border-color: rgba(245,179,60,.32); }
.alert-info { background: rgba(0,145,254,.13);   color: #7CC5FF; border-color: rgba(0,145,254,.32); }

.lang-switch {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--edge);
}
.lang-switch a {
  font-size: 13px;
  padding: 5px 13px;
  border-radius: 20px;
  color: var(--text-3);
}
.lang-switch a:hover { color: var(--text); }
.lang-switch a.on { background: rgba(0,145,254,.18); color: var(--azure-lift); font-weight: 700; }

/* ==========================================================================
   BUILT BY — the credit line
   ========================================================================== */

.built-by {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 18px;
  font-size: 11.5px;
  color: var(--text-3);
}
.built-by .mark { width: 15px; height: 15px; opacity: .9; }
.built-by b { color: var(--text-2); font-weight: 700; }

.sidebar .built-by {
  justify-content: flex-start;
  margin: 12px 12px 2px;
  font-size: 11px;
}

/* ==========================================================================
   APP SHELL
   ========================================================================== */

.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  padding: 20px 14px 16px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  background: rgba(255,255,255,.035);
  border-inline-end: 1px solid var(--edge);
}
@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
  .sidebar {
    -webkit-backdrop-filter: blur(24px) saturate(150%);
    backdrop-filter: blur(24px) saturate(150%);
  }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .sidebar { background: #0A0F17; }
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 8px 18px;
  border-bottom: 1px solid var(--edge);
  margin-bottom: 14px;
}
.brand-name { font-weight: 800; color: #fff; font-size: 15px; line-height: 1.25; }
.brand-sub  { font-size: 11.5px; color: var(--text-3); }

.nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 2px;
  border: 1px solid transparent;
}
.nav a:hover { background: rgba(255,255,255,.06); color: var(--text); }
.nav a.on {
  background: rgba(0,145,254,.16);
  border-color: rgba(0,145,254,.34);
  color: #fff;
  font-weight: 700;
}
.nav .ico { width: 17px; text-align: center; opacity: .8; }

.sidebar-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--edge); }
.who { padding: 8px 12px; }
.who-name { color: #fff; font-weight: 600; font-size: 13.5px; }
.who-role { color: var(--text-3); font-size: 11.5px; }

.main { flex: 1; min-width: 0; padding: 24px 26px 44px; }

.topbar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.topbar h1 { margin: 0; font-size: 24px; font-weight: 800; letter-spacing: -.015em; }
.topbar .date { color: var(--text-3); font-size: 13.5px; margin-top: 2px; }

/* ==========================================================================
   BANNER
   ========================================================================== */

.banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 17px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-size: 14px;
  border: 1px solid transparent;
}
.banner-critical { background: rgba(255,107,94,.12); border-color: rgba(255,107,94,.30); color: #FFA79E; }
.banner-warning  { background: rgba(245,179,60,.12); border-color: rgba(245,179,60,.30); color: #F7CB7C; }
.banner .spacer  { margin-inline-start: auto; }

/* ==========================================================================
   HERO
   ========================================================================== */

.hero {
  overflow: hidden;
  margin-bottom: 18px;
  position: relative;
}
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(196deg, rgba(0,145,254,.20) 0%, transparent 44%);
}
.hero > * { position: relative; z-index: 1; }

.hero-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 30px;
  padding: 24px 26px 20px;
}

.hero-headline .label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-3);
  letter-spacing: .04em;
  margin-bottom: 5px;
}
.hero-headline .value {
  font-size: 42px;
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -.025em;
  color: #fff;
}

.hero-side { display: flex; gap: 28px; flex-wrap: wrap; }
.hero-side .item .label { font-size: 12px; color: var(--text-3); font-weight: 600; }
.hero-side .item .value { font-size: 19px; font-weight: 700; margin-top: 2px; }

.hero-chart { padding: 0 10px 6px; }
.hero-chart-caption {
  display: flex;
  justify-content: space-between;
  padding: 0 20px 15px;
  font-size: 11.5px;
  color: var(--text-3);
}

/* ==========================================================================
   CARDS
   ========================================================================== */

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.mb { margin-bottom: 18px; }

.card { padding: 19px 21px; min-width: 0; }

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 15px;
}
.card-head h2 { margin: 0; font-size: 14px; font-weight: 700; color: var(--text); }
.card-head .hint { font-size: 12px; color: var(--text-3); }

.kpi .kpi-label { font-size: 12.5px; color: var(--text-3); font-weight: 600; }
.kpi .kpi-value { font-size: 27px; font-weight: 800; margin: 6px 0 3px; letter-spacing: -.02em; color: #fff; }
.kpi .kpi-foot  { font-size: 12px; color: var(--text-3); display: flex; align-items: center; gap: 7px; }
.kpi.money .kpi-value { color: var(--gold); }

.delta { font-weight: 700; font-size: 12px; }
.delta-up   { color: var(--good); }
.delta-down { color: var(--bad); }
.delta-flat, .delta-none { color: var(--text-3); }

/* ==========================================================================
   TABLES
   ========================================================================== */

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th {
  text-align: start;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-3);
  font-weight: 700;
  padding: 0 0 9px;
  border-bottom: 1px solid var(--edge);
}
td { padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,.055); }
tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: end; }
.muted { color: var(--text-3); }

.pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 700;
}
.pill-out  { background: rgba(255,107,94,.16); color: #FFA79E; }
.pill-low  { background: rgba(245,179,60,.16); color: #F7CB7C; }
.pill-void { background: rgba(255,107,94,.16); color: #FFA79E; }
.pill-disc { background: rgba(0,145,254,.16);  color: #7CC5FF; }

.empty { text-align: center; padding: 28px 12px; color: var(--text-3); font-size: 13.5px; }
.empty .big { font-size: 15px; color: var(--text-2); font-weight: 600; margin-bottom: 3px; }

/* ==========================================================================
   CHARTS
   ========================================================================== */

.chart { width: 100%; display: block; }
.chart-line { fill: none; stroke: var(--azure); stroke-width: 2.4; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.chart-grid { stroke: rgba(255,255,255,.07); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart-dot  { fill: #fff; stroke: var(--azure); stroke-width: 2.5; }
.bar        { fill: var(--azure); opacity: .82; }
.bar-empty  { fill: rgba(255,255,255,.08); opacity: 1; }

.donut { width: 150px; height: 150px; }
.donut circle { fill: none; stroke-width: 15; transform: rotate(-90deg); transform-origin: 50% 50%; }
.donut-track { stroke: rgba(255,255,255,.07); }

.legend { display: flex; flex-direction: column; gap: 9px; font-size: 13px; }
.legend .row { display: flex; align-items: center; gap: 9px; }
.legend .dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.legend .amt { margin-inline-start: auto; font-weight: 700; font-variant-numeric: tabular-nums; }

.split { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 1100px) {
  .grid-4, .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .sidebar {
    width: 100%;
    height: auto;
    position: static;
    padding: 12px;
    border-inline-end: none;
    border-bottom: 1px solid var(--edge);
  }
  .nav { display: flex; gap: 5px; overflow-x: auto; padding-bottom: 4px; }
  .nav a { white-space: nowrap; margin-bottom: 0; }
  .sidebar-foot, .brand-sub, .sidebar .built-by { display: none; }
  .brand { padding-bottom: 12px; margin-bottom: 10px; }
  .main { padding: 16px 14px 38px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .hero-headline .value { font-size: 34px; }
  .hero-top { gap: 20px; padding: 20px 18px 16px; }
  .topbar h1 { font-size: 21px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

@media print {
  body { background: #fff; color: #000; }
  body::before, .sidebar, .banner, .btn { display: none; }
  .glass { background: #fff; border-color: #ccc; box-shadow: none; backdrop-filter: none; break-inside: avoid; }
  .kpi .kpi-value, .hero-headline .value, .card-head h2 { color: #000; }
}

/* ==========================================================================
   PASSWORD VISIBILITY TOGGLE
   The button sits inside the field on the end side, so it flips to the
   correct corner automatically in RTL without a separate rule.
   ========================================================================== */

.pw-wrap { position: relative; display: block; }

.pw-wrap input { padding-inline-end: 46px; }

.pw-toggle {
  position: absolute;
  inset-inline-end: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  transition: color .15s, background .15s;
}
.pw-toggle:hover  { color: var(--text); background: rgba(255,255,255,.07); }
.pw-toggle:active { background: rgba(255,255,255,.12); }

.pw-toggle svg { width: 19px; height: 19px; display: block; }

.pw-toggle[aria-pressed="true"] { color: var(--azure-lift); }

.pw-toggle:focus-visible {
  outline: 2px solid var(--azure);
  outline-offset: 1px;
}

/* ==========================================================================
   POS
   Two columns: catalogue on the start side, the bill pinned on the end side.
   Touch targets are large because this is used standing up, at speed. Each
   tile carries its category colour as a top rule, which is how a cashier
   finds "the drinks" without reading a single word.
   ========================================================================== */

.pos {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 384px;
  gap: 20px;
  align-items: start;
}

.pos-catalogue { min-width: 0; }

/* ---- search + categories ---- */

.pos-searchbar { margin-bottom: 16px; }

.pos-search {
  position: relative;
  margin-bottom: 12px;
}
.pos-search input[type="search"] {
  width: 100%;
  padding: 14px 46px 14px 16px;
  padding-inline-start: 46px;
  padding-inline-end: 16px;
  font-family: inherit;
  font-size: 15px;
  color: var(--text);
  background: rgba(255,255,255,.05);
  border: 1px solid var(--edge);
  border-radius: 13px;
  -webkit-appearance: none;
  appearance: none;
}
.pos-search input::placeholder { color: var(--text-3); }
.pos-search input:focus {
  outline: none;
  border-color: var(--azure);
  background: rgba(255,255,255,.075);
  box-shadow: 0 0 0 3px rgba(0,145,254,.18);
}
.pos-search .ico {
  position: absolute;
  inset-inline-start: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  pointer-events: none;
  font-size: 15px;
}

.pos-cats {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
}
.pos-cats::-webkit-scrollbar { height: 4px; }
.pos-cats::-webkit-scrollbar-thumb { background: var(--edge); border-radius: 4px; }

.cat-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-2);
  background: rgba(255,255,255,.05);
  border: 1px solid var(--edge);
  border-radius: 22px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .14s, color .14s, border-color .14s;
}
.cat-btn:hover { color: var(--text); background: rgba(255,255,255,.09); }
.cat-btn.on {
  background: var(--azure);
  border-color: var(--azure);
  color: #fff;
  box-shadow: 0 6px 18px -8px rgba(0,145,254,.9);
}
.cat-btn .swatch {
  width: 8px; height: 8px; border-radius: 50%;
  background: currentColor; opacity: .55;
}
.cat-btn.on .swatch { opacity: 1; background: #fff; }

/* ---- item tiles ---- */

.pos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: 12px;
}

.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  min-height: 112px;
  padding: 16px 15px 14px;
  font-family: inherit;
  text-align: start;
  color: var(--text);
  background: linear-gradient(158deg, rgba(255,255,255,.085), rgba(255,255,255,.035));
  border: 1px solid var(--edge);
  border-radius: 14px;
  cursor: pointer;
  overflow: hidden;
  transition: border-color .14s, transform .08s, box-shadow .14s;
}

/* category colour rule along the top edge */
.tile::before {
  content: '';
  position: absolute;
  inset-block-start: 0;
  inset-inline: 0;
  height: 3px;
  background: var(--tile-accent, var(--azure));
}

.tile:hover {
  border-color: rgba(0,145,254,.5);
  box-shadow: 0 12px 28px -16px rgba(0,145,254,.8);
}
.tile:active { transform: scale(.97); }

.tile-name {
  font-size: 14.5px;
  font-weight: 650;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tile-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; }

.tile-price {
  font-size: 13px;
  font-weight: 700;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}
.tile-badge {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-3);
  background: rgba(255,255,255,.08);
  border-radius: 5px;
  padding: 2px 6px;
}

.tile-off { opacity: .38; cursor: not-allowed; }
.tile-off:hover { border-color: var(--edge); box-shadow: none; }
.tile-off::before { background: var(--bad); }
.tile-flag {
  position: absolute;
  inset-block-start: 9px;
  inset-inline-end: 10px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .04em;
  color: var(--bad);
}

/* ---- the bill ---- */

.pos-bill {
  position: sticky;
  top: 20px;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 56px);
  padding: 0;
  overflow: hidden;
}

.bill-head { padding: 17px 19px 14px; border-bottom: 1px solid var(--edge); }
.bill-title {
  display: flex; align-items: center; gap: 9px;
  margin-bottom: 12px; font-weight: 700; font-size: 14px;
}

.bill-types { display: flex; gap: 6px; background: rgba(0,0,0,.22); padding: 4px; border-radius: 11px; }
.type-btn {
  flex: 1;
  padding: 9px 6px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--text-3);
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background .14s, color .14s;
}
.type-btn:hover { color: var(--text-2); }
.type-btn.on { background: var(--azure); color: #fff; box-shadow: 0 4px 12px -5px rgba(0,145,254,.9); }

.bill-lines { flex: 1; overflow-y: auto; min-height: 150px; padding: 6px 19px; }

.line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  align-items: start;
  padding: 11px 0;
  border-bottom: 1px solid rgba(255,255,255,.05);
}
.line:last-child { border-bottom: none; }
.line-void { opacity: .38; }
.line-void .line-name { text-decoration: line-through; }

.line-name { font-size: 13.5px; font-weight: 650; line-height: 1.4; }
.line-mods, .line-note { font-size: 11.5px; color: var(--text-3); margin-top: 3px; line-height: 1.45; }
.line-note { color: var(--warn); }
.line-sent {
  font-size: 9.5px; font-weight: 800; letter-spacing: .05em;
  color: var(--good); background: rgba(46,213,152,.14);
  padding: 1px 6px; border-radius: 4px; margin-inline-start: 5px;
}
.line-total {
  grid-column: 2; grid-row: 1;
  font-size: 13.5px; font-weight: 700; white-space: nowrap;
}
.line-qty { grid-column: 2; grid-row: 2; display: flex; align-items: center; gap: 5px; justify-self: end; }

.qty-btn {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  font-family: inherit; font-size: 17px; font-weight: 700; line-height: 1;
  color: var(--text-2);
  background: rgba(255,255,255,.08);
  border: 1px solid var(--edge);
  border-radius: 8px;
  cursor: pointer;
}
.qty-btn:hover { background: rgba(255,255,255,.15); color: var(--text); }
.qty-btn.danger { color: var(--bad); border-color: rgba(255,107,94,.3); }
.qty-btn.danger:hover { background: rgba(255,107,94,.16); }
.qty-num, .qty-fixed {
  min-width: 26px; text-align: center;
  font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums;
}

.bill-totals { padding: 14px 19px; border-top: 1px solid var(--edge); background: rgba(0,0,0,.16); }
.trow { display: flex; justify-content: space-between; font-size: 13px; padding: 3px 0; color: var(--text-2); }
.trow .neg { color: var(--good); }
.trow-grand {
  font-size: 19px; font-weight: 800; color: #fff;
  padding-top: 11px; margin-top: 8px; border-top: 1px solid var(--edge);
}

.bill-actions { display: grid; grid-template-columns: 1fr 1.15fr; gap: 10px; padding: 14px 19px 0; }
.bill-actions .btn { padding: 15px 12px; font-size: 15px; border-radius: 12px; }

.btn-ghost {
  background: rgba(255,255,255,.08);
  color: var(--text);
  border: 1px solid var(--edge);
  box-shadow: none;
}
.btn-ghost:hover { background: rgba(255,255,255,.15); }

.bill-foot {
  display: flex; gap: 16px; justify-content: center;
  padding: 14px 19px 16px;
}
.linkish {
  background: none; border: none; padding: 0;
  font-family: inherit; font-size: 12.5px; font-weight: 650;
  color: var(--text-3); cursor: pointer;
}
.linkish:hover { color: var(--azure-lift); }
.linkish.danger:hover { color: var(--bad); }

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

.modal-veil {
  position: fixed; inset: 0; z-index: 60;
  display: grid; place-items: center;
  padding: 20px;
  background: rgba(3,5,9,.74);
}
@supports (backdrop-filter: blur(1px)) {
  .modal-veil { -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); }
}

.modal { width: 100%; max-width: 470px; max-height: 88vh; display: flex; flex-direction: column; }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 21px 14px; border-bottom: 1px solid var(--edge);
}
.modal-head h2 { margin: 0; font-size: 16.5px; font-weight: 800; }
.modal-x {
  background: none; border: none; font-size: 27px; line-height: 1;
  color: var(--text-3); cursor: pointer; padding: 0 4px;
}
.modal-x:hover { color: var(--text); }
.modal-body { padding: 19px 21px; overflow-y: auto; }
.modal-foot { display: flex; gap: 10px; padding: 15px 21px 19px; border-top: 1px solid var(--edge); }
.modal-foot .btn { flex: 1; }

.opt-group { margin-bottom: 18px; }
.opt-group:last-child { margin-bottom: 0; }
.opt-label { font-size: 12.5px; font-weight: 700; color: var(--text-2); margin-bottom: 9px; }
.opt-label .req { color: var(--bad); font-weight: 600; font-size: 11px; }
.opt-row { display: flex; flex-wrap: wrap; gap: 8px; }

.opt { position: relative; cursor: pointer; }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt span {
  display: block;
  padding: 10px 15px;
  font-size: 13.5px;
  border: 1px solid var(--edge);
  border-radius: 10px;
  background: rgba(255,255,255,.05);
  color: var(--text-2);
  transition: background .12s, border-color .12s, color .12s;
}
.opt span:hover { background: rgba(255,255,255,.09); }
.opt input:checked + span {
  background: rgba(0,145,254,.2);
  border-color: var(--azure);
  color: #fff;
  font-weight: 650;
}
.opt input:focus-visible + span { outline: 2px solid var(--azure); outline-offset: 2px; }
.opt span b { color: var(--gold); font-weight: 700; }

.opt-note {
  width: 100%; padding: 11px 14px;
  font-family: inherit; font-size: 14px; color: var(--text);
  background: rgba(255,255,255,.05);
  border: 1px solid var(--edge); border-radius: 10px;
}
.opt-note:focus { outline: none; border-color: var(--azure); }

.pay-due, .pay-change {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 14px 16px;
  border-radius: 12px;
}
.pay-due {
  margin-bottom: 16px;
  background: rgba(0,145,254,.12); border: 1px solid rgba(0,145,254,.28);
}
.pay-due strong { font-size: 23px; font-weight: 800; color: #fff; }
.pay-change {
  margin-top: 16px;
  background: rgba(46,213,152,.10); border: 1px solid rgba(46,213,152,.28);
}
.pay-change strong { font-size: 20px; font-weight: 800; color: var(--good); }
.pay-methods { margin-bottom: 17px; }

.oo-list { display: flex; flex-direction: column; gap: 8px; }
.oo {
  display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center;
  padding: 13px 15px; font-family: inherit; text-align: start;
  color: var(--text); background: rgba(255,255,255,.05);
  border: 1px solid var(--edge); border-radius: 11px; cursor: pointer;
}
.oo:hover { background: rgba(0,145,254,.14); border-color: rgba(0,145,254,.4); }
.oo-no { font-weight: 700; font-size: 13.5px; }
.oo-meta { color: var(--text-3); font-size: 12.5px; }
.oo-amt { font-weight: 700; color: var(--gold); }

.toast {
  position: fixed; inset-block-end: 24px; inset-inline-start: 50%;
  transform: translateX(50%); z-index: 90;
  padding: 13px 22px; border-radius: 12px;
  font-size: 14px; font-weight: 650; color: #fff;
  background: #143049; border: 1px solid rgba(0,145,254,.45);
  box-shadow: 0 18px 44px -18px rgba(0,0,0,.95);
  max-width: min(440px, 88vw);
}
[dir="ltr"] .toast { transform: translateX(-50%); }
.toast-bad { background: #3B1A18; border-color: rgba(255,107,94,.48); }

@media (max-width: 1080px) {
  .pos { grid-template-columns: 1fr; }
  .pos-bill { position: static; max-height: none; order: -1; }
  .pos-grid { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); }
  .bill-lines { max-height: 300px; }
}

/* ==========================================================================
   MENU MANAGEMENT
   ========================================================================== */

.menu-page {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.menu-cats { padding: 16px 14px; position: sticky; top: 20px; }

.cat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 3px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  text-align: start;
  color: var(--text-2);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 9px;
  cursor: pointer;
}
.cat-row:hover { background: rgba(255,255,255,.06); color: var(--text); }
.cat-row.on {
  background: rgba(0,145,254,.16);
  border-color: rgba(0,145,254,.34);
  color: #fff;
}
.cat-n {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-3);
  background: rgba(255,255,255,.08);
  border-radius: 20px;
  padding: 1px 8px;
  font-variant-numeric: tabular-nums;
}
.cat-row.on .cat-n { background: rgba(255,255,255,.2); color: #fff; }

.menu-table td { vertical-align: middle; }

.item-name {
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 650;
  color: var(--text);
  text-align: start;
  cursor: pointer;
}
.item-name:hover { color: var(--azure-lift); text-decoration: underline; }

/* the sold-out switch: the single most-used control on this screen */
.switch {
  position: relative;
  width: 46px;
  height: 26px;
  padding: 0;
  border: 1px solid var(--edge);
  border-radius: 20px;
  background: rgba(255,107,94,.18);
  cursor: pointer;
  transition: background .16s, border-color .16s;
}
.switch span {
  position: absolute;
  top: 2px;
  inset-inline-start: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bad);
  transition: transform .16s, background .16s;
}
.switch.on { background: rgba(46,213,152,.2); border-color: rgba(46,213,152,.4); }
.switch.on span { background: var(--good); transform: translateX(20px); }
[dir="rtl"] .switch.on span { transform: translateX(-20px); }
.switch:focus-visible { outline: 2px solid var(--azure); outline-offset: 2px; }

.lang-fields {
  display: grid;
  gap: 10px;
  padding: 14px;
  margin-bottom: 16px;
  border-radius: 12px;
  background: rgba(0,145,254,.07);
  border: 1px solid rgba(0,145,254,.2);
}
.lang-fields .field { margin-bottom: 0; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.field-hint { font-size: 11.5px; color: var(--text-3); margin-top: 5px; line-height: 1.45; }

.field select {
  width: 100%;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 14.5px;
  color: var(--text);
  background: rgba(255,255,255,.05);
  border: 1px solid var(--edge);
  border-radius: var(--radius-sm);
}
.field select:focus { outline: none; border-color: var(--azure); }
.field select option { background: #101722; color: var(--text); }
.field input:disabled { opacity: .5; cursor: not-allowed; }

.var-row { display: grid; grid-template-columns: 1fr 120px auto; gap: 8px; margin-bottom: 8px; }
.var-row input {
  padding: 10px 12px;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--text);
  background: rgba(255,255,255,.05);
  border: 1px solid var(--edge);
  border-radius: 9px;
}
.var-row input:focus { outline: none; border-color: var(--azure); }

.btn-danger { background: rgba(255,107,94,.16); color: #FFA79E; border: 1px solid rgba(255,107,94,.34); box-shadow: none; }
.btn-danger:hover { background: rgba(255,107,94,.26); }

@media (max-width: 900px) {
  .menu-page { grid-template-columns: 1fr; }
  .menu-cats { position: static; }
  #catList { display: flex; gap: 6px; overflow-x: auto; }
  .cat-row { width: auto; white-space: nowrap; margin-bottom: 0; }
  .two-col { grid-template-columns: 1fr; }
  .menu-table th:nth-child(2), .menu-table td:nth-child(2) { display: none; }
}

/* ==========================================================================
   KITCHEN DISPLAY
   Read from two metres away, in a hot room, by someone holding a pan. So:
   large type, high contrast, and urgency carried by colour AND a left rule,
   never by colour alone.
   ========================================================================== */

.kds-stations { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 16px; }

.kds-toggle { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.kds-toggle input { width: 16px; height: 16px; accent-color: var(--azure); }

.kds-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 0 0 rgba(46,213,152,.6);
  animation: kdsPulse 2.4s infinite;
}
.kds-dot.lost { background: var(--bad); animation: none; }
@keyframes kdsPulse {
  0%   { box-shadow: 0 0 0 0 rgba(46,213,152,.55); }
  70%  { box-shadow: 0 0 0 9px rgba(46,213,152,0); }
  100% { box-shadow: 0 0 0 0 rgba(46,213,152,0); }
}

.kds-board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  align-items: start;
}

.kds-card {
  display: flex;
  flex-direction: column;
  background: rgba(255,255,255,.055);
  border: 1px solid var(--edge);
  border-inline-start: 4px solid var(--good);
  border-radius: 13px;
  overflow: hidden;
  transition: opacity .15s;
}
@supports (backdrop-filter: blur(1px)) {
  .kds-card { -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
}

.kds-ok   { border-inline-start-color: var(--good); }
.kds-due  { border-inline-start-color: var(--warn); background: rgba(245,179,60,.07); }
.kds-late { border-inline-start-color: var(--bad);  background: rgba(255,107,94,.09); }

.kds-bumped { opacity: .45; }
.kds-card.busy { opacity: .5; pointer-events: none; }

.kds-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 15px 11px;
  border-bottom: 1px solid var(--edge);
}
.kds-no   { font-size: 15.5px; font-weight: 800; color: #fff; letter-spacing: -.01em; }
.kds-meta { font-size: 12px; color: var(--text-3); margin-top: 2px; }

.kds-timer {
  font-size: 20px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--good);
  line-height: 1.1;
}
.kds-due  .kds-timer { color: var(--warn); }
.kds-late .kds-timer { color: var(--bad); }

.kds-lines { list-style: none; margin: 0; padding: 8px 0; flex: 1; }

.kds-line {
  display: flex;
  gap: 10px;
  padding: 9px 15px;
  cursor: pointer;
  border-inline-start: 3px solid transparent;
  transition: background .12s;
}
.kds-line:hover { background: rgba(255,255,255,.05); }
.kds-line.done {
  opacity: .42;
  border-inline-start-color: var(--good);
}
.kds-line.done .kds-item { text-decoration: line-through; }

.kds-q {
  font-size: 15px;
  font-weight: 800;
  color: var(--azure-lift);
  font-variant-numeric: tabular-nums;
  min-width: 26px;
}
.kds-item { font-size: 15px; font-weight: 600; line-height: 1.4; }
.kds-var  { font-size: 13px; color: var(--text-3); font-weight: 500; }

.kds-mods, .kds-note { display: block; font-size: 12.5px; margin-top: 3px; line-height: 1.45; }
.kds-mods { color: var(--text-3); }
.kds-note {
  color: #0B0E14;
  background: var(--warn);
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 5px;
  margin-top: 5px;
  display: inline-block;
}

.kds-actions { display: flex; gap: 8px; padding: 11px 15px 13px; border-top: 1px solid var(--edge); }

.kds-btn {
  flex: 1;
  padding: 12px 10px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  background: rgba(255,255,255,.08);
  border: 1px solid var(--edge);
  border-radius: 10px;
  cursor: pointer;
  transition: background .13s;
}
.kds-btn:hover { background: rgba(255,255,255,.15); }
.kds-primary {
  background: var(--azure);
  border-color: var(--azure);
  color: #fff;
  box-shadow: 0 6px 18px -8px rgba(0,145,254,.85);
}
.kds-primary:hover { background: var(--azure-lift); }
.kds-recall { background: rgba(245,179,60,.16); border-color: rgba(245,179,60,.36); color: #F7CB7C; }

@media (max-width: 700px) {
  .kds-board { grid-template-columns: 1fr; }
  .kds-timer { font-size: 18px; }
}

/* a wall-mounted screen: no sidebar, bigger everything */
@media (min-width: 1600px) {
  .kds-board { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
  .kds-item, .kds-q { font-size: 16.5px; }
  .kds-timer { font-size: 23px; }
}
