[hidden] { display: none !important; }

/* Nepali Rupee glyph, used in place of FontAwesome's fa-indian-rupee-sign
   everywhere a currency icon is shown. Reuses <i> (not <span>) so it inherits
   every context's existing ".x i { font-size: … }" icon-sizing rule for free. */
.rupee-glyph { font-family: "Nirmala UI", "Noto Sans Devanagari", "Mangal", Arial, sans-serif; font-weight: 800; font-style: normal; }

/* Momentary highlight applied by dashboard.js to any live-region row whose
   markup changed on the last background refresh, so staff notice what moved
   without a jarring full-page reload. */
[data-live-region] tr.just-updated,
[data-live-region] .order-row.just-updated,
[data-live-region] .table-card.just-updated,
[data-live-region] .billing-record-tile.just-updated {
  background-color: var(--surface-2);
  transition: background-color 1.4s ease;
}

/* display:flex here (not just position:relative) matters once there's more
   than one .icon-btn child (sound toggle + bell) — .icon-btn uses
   display:grid, which is block-level, so without an explicit flex row on
   the wrapper, siblings stack vertically instead of sitting inline. */
.notification-wrap { position: relative; display: flex; align-items: center; gap: 8px; }
.notification-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  animation: notification-badge-pop .32s cubic-bezier(.34, 1.56, .64, 1);
}
@keyframes notification-badge-pop {
  from { transform: scale(.4); opacity: 0; }
}
#notificationBell.has-unread i { color: var(--brand); }
.notification-panel {
  position: absolute;
  z-index: 60;
  top: calc(100% + 10px);
  right: 0;
  width: min(360px, calc(100vw - 32px));
  max-height: 420px;
  overflow: hidden auto;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow);
  transform-origin: top right;
  animation: notification-panel-in .18s cubic-bezier(.2, .7, .3, 1);
}
@keyframes notification-panel-in {
  from { opacity: 0; transform: scale(.96) translateY(-4px); }
}
.notification-panel-head {
  position: sticky;
  top: 0;
  padding: 12px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  font-size: 11px;
}
.notification-push-toggle {
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--brand);
  cursor: pointer;
  font-size: 9px;
  font-weight: 750;
  white-space: nowrap;
}
.notification-push-toggle:hover { background: var(--surface-2); }
.notification-list { margin: 0; padding: 0; list-style: none; }
.notification-item {
  padding: 11px 15px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  border-bottom: 1px solid #f0f3f1;
  font-size: 11px;
}
.notification-item:last-child { border-bottom: 0; }
.notification-item.notification-warning .notification-text { color: var(--warning); }
.notification-text { flex: 1; min-width: 0; }
.notification-time { flex: 0 0 auto; color: var(--muted); font-size: 9px; white-space: nowrap; }
.notification-empty { padding: 22px 15px; text-align: center; color: var(--muted); font-size: 10px; }
.notification-item.notification-clickable { padding: 0; }
.notification-item.notification-clickable a,
.notification-item.notification-clickable button {
  width: 100%;
  padding: 11px 15px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .14s ease;
}
.notification-item.notification-clickable a:hover,
.notification-item.notification-clickable a:focus-visible,
.notification-item.notification-clickable button:hover,
.notification-item.notification-clickable button:focus-visible {
  background: var(--surface-2);
}

.logout-form { margin: 0; }
.role-switch-button { width: 100%; border: 0; background: transparent; cursor: pointer; text-align: left; }
.table-primary-popup { padding: 0; display: inline-grid; gap: 2px; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.table-primary-popup:hover strong, .table-primary-popup:focus-visible strong { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }
.table-primary-popup:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 24%, transparent); outline-offset: 4px; border-radius: 4px; }
.popup-form-intro { display: grid; gap: 5px; }
.popup-form-intro h2 { margin: 0; }
.popup-form-intro p { margin: 0; color: var(--muted); }
.popup-form-actions.modal-foot {
  margin: 4px -18px -18px;
  padding-bottom: calc(13px + env(safe-area-inset-bottom));
}
.nav-icon { font-size: 17px; font-weight: 800; }
.static-row { cursor: default; }
.compact-icon { width: 34px; height: 34px; font-size: 14px; }
.stat-text { font-size: 19px; }
.w-full { width: 100%; }
.muted { color: var(--muted); }
.table-subtext { display: block; margin-top: 4px; font-size: 9px; }
.csrf-source { display: none; }

.message-stack {
  position: fixed;
  z-index: 150;
  top: 88px;
  right: 20px;
  width: min(390px, calc(100vw - 30px));
  display: grid;
  gap: 9px;
}
.app-message {
  min-height: 52px;
  padding: 12px 14px;
  border: 1px solid #cce5d8;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #f1fbf6;
  color: #236647;
  box-shadow: 0 15px 38px rgba(24, 58, 42, .14);
  font-size: 12px;
}
.app-message.error { border-color: #f0c9c5; background: #fff4f3; color: var(--danger); }
.app-message.warning { border-color: #eedcaf; background: #fff9e9; color: #956011; }
.app-message button { border: 0; background: transparent; cursor: pointer; font-size: 20px; color: inherit; }

.form-alert {
  padding: 11px 13px;
  border: 1px solid #f0c9c5;
  border-radius: 10px;
  background: #fff4f3;
  color: #a73e39;
  font-size: 11px;
  line-height: 1.5;
}
.form-alert ul { margin: 0; padding-left: 18px; }
.field-error { color: var(--danger); font-size: 10px; line-height: 1.45; }
.form-help { color: var(--muted); font-size: 9px; line-height: 1.45; }
.form-card { padding: 20px; }
.form-card .card-head { margin: -20px -20px 18px; }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; padding-top: 8px; }
.narrow-page { max-width: 820px; margin: 0 auto; }
.compact-form { padding: 17px; }
.checkbox { width: 18px; height: 18px; accent-color: var(--brand); }
.form-group ul { margin: 7px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 7px; list-style: none; }
.form-group ul label { min-height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; display: flex; align-items: center; gap: 7px; font-size: 10px; }

/* Cafe theme: warm espresso/caramel palette, scoped to auth pages only
   so the rest of the app (which uses --brand for role dashboards) is unaffected. */
body.auth-page {
  --brand: #8a4b2c;
  --brand-2: #b0652f;
  --surface-2: #fbe9d9;
  --line: #ecdac6;
  --canvas: #fff8f0;
}
.auth-page { min-height: 100dvh; background: var(--canvas); }
.auth-shell { min-height: 100dvh; display: grid; grid-template-columns: minmax(420px, 1.05fr) minmax(470px, .95fr); }
.auth-page .field, .auth-page .select { height: 50px; border-radius: 14px; border-color: #ecdac6; background: #fffaf5; transition: border-color .18s ease, box-shadow .18s ease, transform .15s ease, background .18s ease; }
.auth-page .field:hover, .auth-page .select:hover { border-color: #dbb98c; }
.auth-page .field:focus, .auth-page .select:focus, .auth-page .textarea:focus { border-color: #cf9c66; background: #fff; box-shadow: 0 0 0 3px rgba(138,75,44,.14); }
.auth-page .btn-primary { box-shadow: 0 8px 18px rgba(138,75,44,.22); }

@keyframes auth-drift {
  0%, 100% { transform: translate(0, 0) scale(1) rotate(var(--bean-rot, 0deg)); }
  50% { transform: translate(16px, -18px) scale(1.08) rotate(var(--bean-rot, 0deg)); }
}
@keyframes auth-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes auth-fade-up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes auth-pop { from { opacity: 0; transform: scale(.96) translateY(10px); } to { opacity: 1; transform: scale(1) translateY(0); } }
@keyframes auth-glow {
  0%, 100% { box-shadow: 0 8px 18px rgba(232,132,77,.25); }
  50% { box-shadow: 0 10px 28px rgba(232,132,77,.5); }
}
@keyframes auth-shimmer { to { background-position: -200% 0; } }
@keyframes steam-rise {
  0% { opacity: 0; transform: translateY(6px) scaleY(.85); }
  30% { opacity: 1; }
  80% { opacity: 0; }
  100% { opacity: 0; transform: translateY(-16px) scaleY(1.2); }
}

.auth-illustration { align-self: center; position: relative; z-index: 1; filter: drop-shadow(0 14px 24px rgba(0,0,0,.18)); }
.auth-illustration .steam { opacity: 0; transform-origin: center bottom; animation: steam-rise 4s ease-in-out infinite; }
.auth-illustration .steam-1 { animation-delay: .2s; }
.auth-illustration .steam-2 { animation-delay: .9s; }
.auth-illustration .steam-3 { animation-delay: 1.5s; }

.bean { position: absolute; z-index: 0; width: 22px; height: 15px; border-radius: 50%; background: rgba(255,255,255,.13); animation: auth-drift 10s ease-in-out infinite; }
.bean::after { content: ""; position: absolute; inset: 0; margin: auto; width: 1.5px; height: 68%; border-radius: 2px; background: rgba(255,255,255,.4); }
.bean-1 { --bean-rot: -18deg; top: 20%; right: 16%; }
.bean-2 { --bean-rot: 22deg; top: 60%; left: 9%; animation-duration: 13s; animation-direction: reverse; }
.bean-3 { --bean-rot: -8deg; bottom: 14%; right: 30%; animation-duration: 16s; }

.tea-float { position: absolute; z-index: 0; color: rgba(255,255,255,.24); animation: auth-drift 11s ease-in-out infinite; }
.tea-float-1 { top: 14%; left: 12%; font-size: 18px; animation-duration: 9s; animation-delay: .4s; }
.tea-float-2 { bottom: 22%; right: 11%; font-size: 13px; animation-duration: 14s; animation-direction: reverse; animation-delay: 1.1s; }

.leaf-fall {
  position: absolute;
  top: -8%;
  z-index: 0;
  color: rgba(240, 199, 147, .4);
  animation: leaf-fall linear infinite;
}
.leaf-fall-1 { left: 8%; font-size: 15px; animation-duration: 13s; animation-delay: 0s; --leaf-drift: 24px; --leaf-spin: 220deg; }
.leaf-fall-2 { left: 27%; font-size: 11px; animation-duration: 10s; animation-delay: 3.2s; --leaf-drift: -30px; --leaf-spin: -260deg; color: rgba(255,255,255,.3); }
.leaf-fall-3 { left: 52%; font-size: 17px; animation-duration: 16s; animation-delay: 1.4s; --leaf-drift: 34px; --leaf-spin: 200deg; }
.leaf-fall-4 { left: 71%; font-size: 12px; animation-duration: 11.5s; animation-delay: 5.6s; --leaf-drift: -22px; --leaf-spin: -240deg; color: rgba(255,255,255,.28); }
.leaf-fall-5 { left: 89%; font-size: 14px; animation-duration: 14.5s; animation-delay: 2.5s; --leaf-drift: 26px; --leaf-spin: 260deg; }

/* A handful of "Chuski" marks drifting slowly down the sign-in panel —
   deliberately sparse and unhurried (long duration, no rotation, gentle
   fade+scale in/out) rather than many small pieces tumbling across the
   whole panel, which read as cluttered instead of premium. */
.chuski-float {
  position: absolute;
  top: -12%;
  z-index: 0;
  font-weight: 700;
  font-style: italic;
  letter-spacing: .01em;
  color: rgba(138,75,44,.1);
  pointer-events: none;
  animation: chuski-fall linear infinite;
}
.chuski-float-1 { left: 10%; font-size: 30px; animation-duration: 22s; animation-delay: 0s; --chuski-drift: 14px; }
.chuski-float-2 { left: 62%; font-size: 20px; animation-duration: 18s; animation-delay: 7s; --chuski-drift: -12px; color: rgba(138,75,44,.08); }
.chuski-float-3 { left: 38%; font-size: 24px; animation-duration: 26s; animation-delay: 14s; --chuski-drift: 10px; }

@keyframes chuski-fall {
  0% { transform: translate(0, 0) scale(.9); opacity: 0; }
  10% { opacity: 1; transform: translate(0, 0) scale(1); }
  82% { opacity: 1; }
  100% { transform: translate(var(--chuski-drift, 14px), 118vh) scale(1.06); opacity: 0; }
}

@keyframes leaf-fall {
  0% { transform: translate(0, 0) rotate(0deg); opacity: 0; }
  8% { opacity: 1; }
  92% { opacity: 1; }
  100% { transform: translate(var(--leaf-drift, 20px), 118vh) rotate(var(--leaf-spin, 220deg)); opacity: 0; }
}

.auth-visual {
  min-height: 100%;
  padding: 48px clamp(32px, 6vw, 92px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  color: #fff;
  background:
    linear-gradient(145deg, rgba(58, 30, 17, .96), rgba(138, 75, 44, .9)),
    url("../../assets/images/auth-bg.67a0a8b4e152.png") center/cover;
}
.auth-visual::before {
  content: "";
  position: absolute;
  z-index: 0;
  width: 320px;
  height: 320px;
  left: -110px;
  top: -90px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.16), transparent 70%);
  animation: auth-drift 13s ease-in-out infinite;
}
.auth-visual::after {
  content: "";
  position: absolute;
  z-index: 0;
  width: 440px;
  height: 440px;
  right: -210px;
  bottom: -230px;
  border: 72px solid rgba(255,255,255,.06);
  border-radius: 50%;
  animation: auth-spin 70s linear infinite;
}
.auth-register-visual { background: linear-gradient(145deg, rgba(21, 57, 79, .96), rgba(48, 113, 151, .93)), url("../../assets/images/auth-bg.67a0a8b4e152.png") center/cover; }
/* The brand mark pins to the top of the panel; the calendar + copy group
   (".auth-visual-stack") shares the remaining height and centers itself
   as a unit, so the panel looks balanced at any viewport height instead
   of leaving a dead gap below shorter content on tall screens. */
.auth-shell-login .auth-visual { justify-content: flex-start; gap: clamp(20px, 3vh, 34px); }
.auth-brand { display: flex; align-items: center; gap: 13px; position: relative; z-index: 1; animation: auth-fade-up .55s ease both; }
.auth-brand .brand-mark { animation: auth-glow 3.6s ease-in-out infinite; }
.auth-brand strong { font-size: 21px; letter-spacing: -.02em; }
.auth-visual-stack {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(24px, 4vh, 46px);
}
.auth-visual-copy { max-width: 620px; position: relative; z-index: 1; }
.auth-visual-copy > * { animation: auth-fade-up .55s ease both; }
.auth-visual-copy > *:nth-child(1) { animation-delay: .32s; }
.auth-visual-copy > *:nth-child(2) { animation-delay: .4s; }
.auth-visual-copy > *:nth-child(3) { animation-delay: .48s; }
.auth-visual-copy > *:nth-child(4) { animation-delay: .56s; }
.auth-kicker { color: var(--brand); font-size: 10px; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
.auth-visual .auth-kicker { color: #f0c793; }
.auth-visual-copy h1 { margin: 10px 0 15px; font-size: clamp(36px, 5vw, 62px); line-height: .98; letter-spacing: -.055em; text-shadow: 0 4px 30px rgba(0,0,0,.28); }
.auth-visual-copy p { max-width: 560px; color: rgba(255,255,255,.76); font-size: 14px; line-height: 1.7; }
.auth-feature-grid { margin-top: 30px; display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; position: relative; z-index: 1; }
.auth-feature-grid span {
  padding: 12px; border: 1px solid rgba(255,255,255,.14); border-radius: 13px;
  background: rgba(255,255,255,.06); font-size: 11px; font-weight: 700;
  display: flex; align-items: center; gap: 10px;
  animation: auth-fade-up .5s ease both;
  transition: transform .2s ease, background .2s ease, border-color .2s ease;
}
.auth-feature-grid span i {
  flex: 0 0 auto;
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border-radius: 8px;
  background: rgba(240,199,147,.16);
  color: #f0c793;
  font-size: 11px; font-style: normal;
}
.auth-feature-grid span:hover { transform: translateY(-2px); background: rgba(255,255,255,.11); border-color: rgba(255,255,255,.26); }
.auth-feature-grid span:hover i { background: rgba(240,199,147,.3); }
.auth-feature-grid span:nth-child(1) { animation-delay: .64s; }
.auth-feature-grid span:nth-child(2) { animation-delay: .7s; }
.auth-feature-grid span:nth-child(3) { animation-delay: .76s; }
.auth-feature-grid span:nth-child(4) { animation-delay: .82s; }

.auth-calendar {
  width: 100%;
  max-width: 620px;
  border-radius: 20px;
  overflow: hidden;
  position: relative;
  z-index: 1;
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 24px 54px rgba(6,20,14,.42);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  animation: auth-fade-up .55s ease both;
  animation-delay: .12s;
}
@keyframes auth-calendar-glow-pulse {
  0%, 100% { opacity: .5; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: .9; transform: translate(-50%, -50%) scale(1.15); }
}
.auth-calendar-body { display: flex; flex-wrap: wrap; }
.auth-calendar-grid-side {
  flex: 1 1 250px;
  padding: 18px 20px;
  background: rgba(255,255,255,.94);
}
.auth-calendar-today-side {
  flex: 1 1 150px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 3px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(160deg, rgba(58,30,17,.94), rgba(138,75,44,.88));
  color: #fff;
}
.auth-calendar-today-side::before {
  content: "";
  position: absolute;
  z-index: 0;
  width: 130px;
  height: 130px;
  right: -40px;
  bottom: -50px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(240,199,147,.22), transparent 72%);
  animation: auth-calendar-glow-pulse 4.2s ease-in-out infinite;
}
.auth-calendar-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 11px; }
.auth-calendar-month { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 800; color: var(--ink); letter-spacing: -.01em; text-transform: capitalize; }
.auth-calendar-month i { color: #8a4b2c; font-size: 11px; }
.auth-calendar-nav {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: #8a4b2c;
  font-size: 9px;
  cursor: pointer;
  transition: background .15s ease, transform .15s ease;
}
.auth-calendar-nav:hover { background: #fbeee4; }
.auth-calendar-nav:active { transform: scale(.92); }
.auth-calendar-nav:disabled { opacity: .4; cursor: not-allowed; }
.auth-calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin-bottom: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}
.auth-calendar-weekdays span {
  text-align: center;
  color: var(--muted);
  font-size: 7.5px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.auth-calendar-weekdays span:last-child { color: #8a4b2c; }
.auth-calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.auth-calendar-day, .auth-calendar-pad { aspect-ratio: 1; }
.auth-calendar-day {
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: var(--ink);
  font-size: 9.5px;
  font-weight: 650;
  animation: auth-calendar-cell-in .32s ease backwards;
  transition: background .15s ease;
}
.auth-calendar-day:nth-child(7n) { color: #8a4b2c; font-weight: 800; }
.auth-calendar-day.today {
  background: linear-gradient(135deg, #d9a441, #f0c793);
  color: #3a2408;
  font-weight: 900;
  animation: auth-calendar-cell-in .32s ease backwards, auth-calendar-today-pulse 2.4s ease-in-out .8s infinite;
}
.auth-calendar-loading { grid-column: 1 / -1; padding: 10px 0; text-align: center; color: var(--muted); font-size: 9.5px; }
.auth-calendar-today-label {
  position: relative; z-index: 1;
  display: flex; align-items: center; gap: 5px;
  color: rgba(255,255,255,.8); font-size: 9.5px; font-weight: 800;
  letter-spacing: .06em; text-transform: uppercase;
}
.auth-calendar-today-day { position: relative; z-index: 1; font-size: 34px; font-weight: 900; line-height: 1; letter-spacing: -.02em; }
.auth-calendar-today-weekday { position: relative; z-index: 1; font-size: 12px; font-weight: 750; color: rgba(255,255,255,.92); }
.auth-calendar-today-sub { position: relative; z-index: 1; margin-top: 4px; font-size: 9.5px; font-weight: 650; color: rgba(255,255,255,.75); }
.auth-calendar-clock {
  position: relative; z-index: 1;
  margin-top: 9px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.18);
  color: #fff;
  font-size: 10.5px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}
@keyframes auth-calendar-cell-in { from { opacity: 0; transform: scale(.6); } }
@keyframes auth-calendar-today-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,255,255,.45); }
  50% { box-shadow: 0 0 0 6px rgba(255,255,255,0); }
}

.auth-panel {
  padding: 35px;
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle, rgba(74,42,26,.05) 1px, transparent 1px) 0 0/22px 22px,
    var(--canvas);
}
.auth-panel::before {
  content: "";
  position: absolute;
  z-index: 0;
  width: min(640px, 90vw);
  height: min(640px, 90vw);
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232,132,77,.16), transparent 70%);
  pointer-events: none;
}
.auth-card {
  width: min(430px, 100%);
  padding: 40px;
  position: relative;
  z-index: 1;
  border: 1px solid rgba(255,255,255,.6);
  border-radius: 28px;
  /* Frosted glass: translucent instead of solid white so the falling
     Chuski text and dotted backdrop show through, softly blurred. */
  background: rgba(255,255,255,.78);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  box-shadow: 0 32px 64px -24px rgba(58,30,17,.32), 0 10px 26px rgba(58,30,17,.07), inset 0 1px 0 rgba(255,255,255,.5);
  animation: auth-pop .5s cubic-bezier(.2,.9,.3,1.08) both;
}
.auth-card::before {
  content: "";
  position: absolute;
  z-index: 1;
  top: 0; left: 32px; right: 32px;
  height: 3px;
  border-radius: 0 0 6px 6px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2), var(--brand));
  background-size: 200% 100%;
  animation: auth-shimmer 3.5s linear infinite;
}
.auth-card-badge {
  width: 56px; height: 56px; margin-bottom: 16px;
  position: relative;
  z-index: 1;
  display: grid; place-items: center;
  border-radius: 18px;
  background: linear-gradient(145deg, var(--brand-2), var(--brand));
  color: #fff; font-size: 22px;
  box-shadow: 0 12px 26px rgba(138,75,44,.32), 0 0 0 6px rgba(138,75,44,.08);
  animation: auth-glow 3.6s ease-in-out infinite;
}
.badge-steam { position: absolute; top: -5px; width: 3px; height: 11px; border-radius: 2px; background: rgba(255,255,255,.85); opacity: 0; animation: steam-rise 3.2s ease-in-out infinite; }
.badge-steam.s1 { left: 19px; animation-delay: .1s; }
.badge-steam.s2 { left: 29px; animation-delay: .9s; }
.auth-card-wide { width: min(620px, 100%); }
.auth-card > * { animation: auth-fade-up .45s ease both; }
.auth-card > *:nth-child(1) { animation-delay: .08s; }
.auth-card > *:nth-child(2) { animation-delay: .13s; }
.auth-card > *:nth-child(3) { animation-delay: .18s; }
.auth-card > *:nth-child(4) { animation-delay: .23s; }
.auth-card > *:nth-child(5) { animation-delay: .28s; }
.auth-card > *:nth-child(6) { animation-delay: .33s; }
.auth-card > *:nth-child(7) { animation-delay: .38s; }
.auth-card > *:nth-child(8) { animation-delay: .43s; }
.auth-card h2 { margin: 8px 0 7px; font-size: clamp(29px, 4vw, 40px); letter-spacing: -.045em; }
.auth-card > p { margin: 0 0 24px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.auth-form { display: grid; gap: 15px; }
.auth-form-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
.auth-form .full { grid-column: 1 / -1; }
.auth-form .field, .auth-form .select { transition: border-color .18s ease, box-shadow .18s ease, transform .15s ease; }
.auth-form .field:focus, .auth-form .select:focus { transform: translateY(-1px); }
.auth-submit {
  width: 100%; min-height: 52px; margin-top: 3px; border-radius: 16px; letter-spacing: .01em;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  transition: transform .17s ease, box-shadow .17s ease, background .17s ease;
}
.auth-submit i { transition: transform .2s ease; }
.auth-submit:hover { box-shadow: 0 14px 28px rgba(138,75,44,.32); }
.auth-submit:hover i { transform: translateX(3px); }
.auth-submit:active { transform: scale(.98); }
.auth-switch { margin-top: 21px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; text-align: center; }
.auth-switch a { color: var(--brand); font-weight: 800; transition: color .15s ease; }
.auth-switch a:hover { color: var(--brand-2); }
.auth-security-note { margin-top: 14px !important; padding: 10px; border-radius: 9px; background: var(--surface-2); font-size: 9px !important; text-align: center; }
.password-field { display: block; position: relative; }
.password-field .field { padding-right: 58px; }
.password-field button { position: absolute; right: 8px; top: 8px; height: 30px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: var(--brand); cursor: pointer; font-size: 10px; font-weight: 800; transition: background .15s ease; }
.password-field button:hover { background: var(--surface-2); }
.input-icon-field { display: block; position: relative; }
.input-icon-field i { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 13px; pointer-events: none; transition: color .15s ease; }
.input-icon-field .field { padding-left: 41px; }
.input-icon-field:focus-within i { color: var(--brand); }
.auth-pwa-install {
  width: 100%; min-height: 46px; margin-top: 14px; border-radius: 14px; border-color: #b9ccc1;
  color: var(--brand); background: #f2f8f4; font-weight: 750;
  animation: pwa-invite-pulse 2.4s ease-in-out infinite;
}
/* Installing a home-screen app is a mobile concept — on a wide desktop
   viewport (the two-column login layout) it just adds noise. */
@media (min-width: 921px) {
  .auth-pwa-install { display: none; }
}
.auth-pwa-install:hover { background: #e6f2ea; }
@keyframes pwa-invite-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(36,92,69,.14); } 50% { box-shadow: 0 0 0 6px rgba(36,92,69,0); } }
.auth-footnote {
  margin-top: 21px; padding-top: 18px; border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; gap: 7px;
  color: var(--muted); font-size: 11px; text-align: center;
}
.auth-footnote i { color: var(--brand); font-size: 12px; }
.auth-powered-by {
  margin-top: 18px; position: relative; z-index: 1;
  color: var(--muted); font-size: 11px; text-align: center;
  animation: auth-fade-up .45s ease .48s both;
}
.auth-powered-by a { color: var(--brand); font-weight: 800; text-decoration: none; }
.auth-powered-by a:hover { color: var(--brand-2); text-decoration: underline; }

.error-page { min-height: 100dvh; padding: 28px; display: grid; place-items: center; background: radial-gradient(circle at 20% 10%, #e8f1ec, transparent 35%), var(--canvas); }
.error-card { width: min(620px, 100%); padding: 42px; border: 1px solid var(--line); border-radius: 24px; background: #fff; box-shadow: var(--shadow); text-align: center; }
.error-card > span { color: var(--accent); font-size: 68px; font-weight: 900; letter-spacing: -.07em; }
.error-card h1 { margin: 5px 0 10px; font-size: 30px; }
.error-card p { margin: 0 auto 24px; max-width: 470px; color: var(--muted); line-height: 1.6; }
.success-panel { max-width: 620px; margin: 10vh auto 0; padding: 42px; text-align: center; }
.success-mark { width: 62px; height: 62px; margin: 0 auto 17px; border-radius: 50%; display: grid; place-items: center; background: #e5f6ed; color: var(--success); font-size: 28px; }

.filter-toolbar { display: flex; gap: 10px; align-items: center; }
.filter-toolbar .toolbar-search { flex: 1; }
.compact-select { width: auto; min-width: 190px; }
.compact-date { width: 145px; min-width: 145px; }
.bill-filter { flex-wrap: wrap; }
.bill-filter .toolbar-search { min-width: 260px; }
.category-strip { padding: 12px 16px; border-top: 1px solid var(--line); display: flex; gap: 8px; overflow-x: auto; }
.category-chip { min-width: 130px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.category-chip strong, .category-chip span { display: block; }
.category-chip strong { font-size: 11px; }
.category-chip span { margin-top: 3px; color: var(--muted); font-size: 8px; }
.cell-image { width: 40px; height: 40px; border-radius: 11px; object-fit: cover; }
.alert-banner { margin-bottom: 18px; padding: 13px 15px; border: 1px solid #cadfd3; border-radius: 13px; display: flex; align-items: center; gap: 12px; background: #f3faf6; color: #295e47; font-size: 11px; }
.alert-banner strong, .alert-banner span { display: block; }
.alert-banner.warning { border-color: #efdeb0; background: #fff9e8; color: #90600f; }
.inventory-sections { align-items: start; }
.settings-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.settings-help { padding: 22px; position: sticky; top: 98px; }
.settings-help h3 { margin: 16px 0 7px; }
.settings-help p { color: var(--muted); font-size: 11px; line-height: 1.6; }
.report-filter { margin-bottom: 18px; padding: 14px; display: grid; grid-template-columns: repeat(3, minmax(150px, 1fr)) auto; gap: 10px; align-items: end; }
.pagination { min-height: 56px; padding: 10px 16px; border-top: 1px solid var(--line); display: flex; justify-content: center; align-items: center; gap: 12px; color: var(--muted); font-size: 10px; }
.status-filter { display: flex; gap: 7px; flex-wrap: wrap; flex: 1 1 100%; }
.status-check input { position: absolute; opacity: 0; pointer-events: none; }
.status-check span { min-height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; display: inline-flex; align-items: center; cursor: pointer; color: var(--muted); font-size: 9px; font-weight: 700; transition: border-color .15s ease, background .15s ease, color .15s ease; }
.status-check input:checked + span { border-color: var(--brand); background: var(--surface-2); color: var(--brand); }
.order-filter-toolbar { align-items: center; }
.date-range-fields { display: inline-flex; align-items: center; gap: 6px; }
.date-range-fields .field { width: 140px; }
.date-range-sep { color: var(--muted); font-size: 11px; }
.order-filter-clear { margin-left: auto; }
.order-view-tabs { display: flex; gap: 6px; padding: 14px 16px 0; }
.order-view-tab { min-height: 34px; padding: 0 14px; border: 1px solid var(--line); border-radius: 9px; display: inline-flex; align-items: center; color: var(--muted); font-size: 10px; font-weight: 700; text-decoration: none; transition: border-color .15s ease, background .15s ease, color .15s ease; }
.order-view-tab:hover { border-color: var(--brand); color: var(--brand); }
.order-view-tab.active { border-color: var(--brand); background: var(--surface-2); color: var(--brand); }

.table-floor { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; }
.table-card { min-height: 170px; padding: 17px; border: 1px solid var(--line); border-top: 4px solid #98a69e; border-radius: 17px; background: #fff; box-shadow: var(--shadow); }
.table-card.free { border-top-color: var(--success); }
.table-card.occupied { border-top-color: var(--accent); }
.table-card.ready, .table-card.served { border-top-color: var(--success); background: #fbfffc; }
.table-card.reserved { border-top-color: var(--info); }
.table-card.out-of-service { opacity: .65; }
.table-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.table-number { font-size: 24px; font-weight: 850; }
.table-capacity { margin-top: 12px; color: var(--brand); font-size: 11px; font-weight: 800; }
.table-card p { min-height: 32px; margin: 7px 0 15px; color: var(--muted); font-size: 9px; line-height: 1.5; }

.order-detail-grid { align-items: start; }
.order-detail-lines { display: grid; }
.detail-line { padding: 14px 16px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 36px minmax(0,1fr) auto; gap: 10px; align-items: center; }
.detail-line:last-child { border-bottom: 0; }
.detail-line.cancelled { opacity: .5; text-decoration: line-through; }
.detail-qty { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-2); color: var(--brand); font-size: 10px; font-weight: 850; }
.line-price { display: block; margin-top: 6px; text-align: right; font-size: 10px; }
.line-remove { display: block; margin: 7px 0 0 auto; }
.danger-zone { margin-top: 18px; padding: 16px; border: 1px solid #f0d0cd; border-radius: 14px; display: flex; justify-content: space-between; align-items: center; gap: 14px; background: #fff7f6; }
.danger-zone strong, .danger-zone span { display: block; }
.danger-zone span { margin-top: 3px; color: var(--muted); font-size: 10px; }

.billing-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(330px, .8fr); gap: 18px; align-items: start; }
.billing-layout-solo { grid-template-columns: 1fr; }
.billing-side { display: grid; gap: 18px; }
.receipt-preview { overflow: hidden; }
.receipt-lines { padding: 10px 18px; }
.receipt-lines > div, .receipt-totals > div { min-height: 36px; display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 11px; }
.receipt-lines > div + div { border-top: 1px dashed var(--line); }
.receipt-totals { padding: 14px 18px; border-top: 1px solid var(--line); background: #f8faf9; }
.receipt-totals .total { margin-top: 6px; padding-top: 9px; border-top: 1px solid var(--line); font-size: 15px; }

.django-pos { min-height: 55vh; }
.django-pos .modal-backdrop { z-index: 140; }
.django-pos .modal { width: min(720px, calc(100vw - 24px)); max-height: min(880px, calc(100dvh - 24px)); }
.django-pos .modal-body { overflow-y: auto; }
.customize-modal { width: min(640px, calc(100vw - 24px)) !important; }
.customize-product { margin-bottom: 15px; padding: 14px; border-radius: 13px; display: flex; align-items: center; gap: 12px; background: var(--surface-2); }
.customize-product-icon { width: 54px; height: 54px; border-radius: 15px; display: grid; place-items: center; background: #fff; color: var(--brand); font-size: 17px; font-weight: 900; }
.customize-product strong, .customize-product small { display: block; }
.customize-product small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.customizer-grid { display: grid; gap: 14px; }
.custom-group { display: grid; gap: 7px; }
.custom-options { display: flex; flex-wrap: wrap; gap: 7px; }
.custom-option { min-height: 38px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; font-size: 10px; }
.custom-option.active { border-color: var(--brand); background: var(--surface-2); color: var(--brand); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 10%, transparent); }
.custom-option small { display: block; margin-top: 2px; color: var(--muted); font-size: 8px; }
.customizer-footer-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 13px; align-items: end; }
.customizer-quantity { display: flex; align-items: center; gap: 8px; }
.menu-card { text-align: left; }
.menu-card .menu-visual { font-size: 15px; font-weight: 900; }
.menu-card .menu-visual img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.menu-count { position: absolute; z-index: 2; top: 8px; right: 8px; min-width: 26px; min-height: 22px; padding: 0 7px; border-radius: 999px; display: grid; place-items: center; background: var(--success); color: #fff; font-size: 8px; font-weight: 850; }
.cart-line-actions { display: flex; align-items: center; justify-content: flex-end; gap: 7px; }
.cart-remove { border: 0; background: transparent; color: var(--danger); cursor: pointer; font-size: 9px; font-weight: 800; }
.submit-loading { pointer-events: none; opacity: .65; }
.mobile-amount-card > small { display: block; margin-top: 10px; color: var(--muted); font-size: 8px; line-height: 1.5; }

.kitchen-quick-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1180px) { .kitchen-quick-stats { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width: 700px) {
  .kitchen-quick-stats, .cashier-quick-stats { display: none; }
}
.kitchen-toolbar { margin-bottom: 15px; display: flex; flex-wrap: wrap; gap: 7px; align-items: center; overflow-x: auto; }
.kitchen-toolbar .sync-indicator { margin-left: auto; }
.kot-lines { display: grid; }
.kot-line { padding: 12px 15px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 30px minmax(0,1fr) auto; align-items: start; gap: 10px; }
.kot-line > strong { color: var(--brand); font-size: 14px; }
.kot-line b, .kot-line small { display: block; }
.kot-line b { font-size: 12px; }
.kot-line small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.kot-line.cancelled { opacity: .45; text-decoration: line-through; }
.kot-line-action { flex: 0 0 auto; }
.kot-line-status { flex: 0 0 auto; }
.kot-quantity-change { color: var(--warning) !important; font-weight: 700; }
.kot-adjustment { padding: 5px 7px; margin-top: 5px !important; border-radius: 7px; background: #fff4f3; color: #a73e39 !important; }
.kot-adjustment strong { color: inherit; }
.kot-order-note { margin: 10px 12px 0; padding: 10px; border-radius: 10px; background: #fff8df; color: #805b19; }
.kot-order-note strong, .kot-order-note span { display: block; }
.kot-order-note strong { font-size: 9px; text-transform: uppercase; }
.kot-order-note span { margin-top: 3px; font-size: 10px; }
.kot-panel-foot { flex-direction: column; align-items: stretch; gap: 10px; }
.kitchen-empty { grid-column: 1 / -1; min-height: 300px; }

.receipt-page { background: #fff; }
.print-receipt { width: min(80mm, calc(100vw - 24px)); margin: 20px auto; padding: 18px; border: 1px solid #dfe5e1; background: #fff; color: #111; font-family: "Segoe UI", sans-serif; }
.print-receipt.paper-58mm { width: min(58mm, calc(100vw - 24px)); padding: 12px; }
.print-receipt.paper-a4 { width: min(190mm, calc(100vw - 24px)); padding: 24px; }
.print-receipt header { text-align: center; }
.print-receipt header .brand-mark { margin: 0 auto 9px; }
.print-receipt header h1 { margin: 0; font-size: 22px; }
.print-receipt header p { margin: 5px 0 15px; color: #555; font-size: 9px; line-height: 1.5; }
.receipt-meta { padding: 10px 0; border-block: 1px dashed #bbb; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; }
.receipt-meta span, .receipt-meta strong { display: block; }
.receipt-meta span { color: #777; font-size: 7px; text-transform: uppercase; }
.receipt-meta strong { margin-top: 2px; font-size: 9px; }
.print-receipt table { width: 100%; margin-top: 10px; border-collapse: collapse; font-size: 8px; }
.print-receipt th, .print-receipt td { padding: 6px 3px; border-bottom: 1px dashed #ddd; text-align: right; }
.print-receipt th:first-child, .print-receipt td:first-child { text-align: left; }
.print-receipt td small { display: block; margin-top: 2px; color: #777; }
.print-receipt .receipt-adjustment-row td { text-align: left; }
.print-totals { padding-top: 8px; }
.print-totals > div { min-height: 24px; display: flex; justify-content: space-between; align-items: center; font-size: 9px; }
.print-totals .total { margin-block: 5px; padding-block: 7px; border-block: 1px solid #111; font-size: 13px; }
.print-receipt footer { margin-top: 14px; font-size: 8px; text-align: center; }
.print-actions { margin-top: 18px; display: flex; gap: 7px; justify-content: center; }

/* Receipt / Scan-to-Pay toggle — screen-only chrome above the receipt body;
   whichever view is visible when "Print receipt" is pressed is what prints,
   since the print pipeline clones .print-receipt's outerHTML as-is. */
.receipt-tabs { display: flex; gap: 6px; margin-bottom: 14px; padding: 3px; border-radius: 10px; background: #f1f4f2; }
.receipt-tab { flex: 1; border: 0; border-radius: 8px; padding: 8px 10px; background: transparent; color: #55625a; font-size: 10px; font-weight: 700; cursor: pointer; }
.receipt-tab.active { background: #fff; color: #111; box-shadow: 0 1px 3px rgba(7,25,16,.14); }
.qr-pay-amount { margin: 4px 0 16px; padding: 14px; border-radius: 10px; background: #f6f8f6; text-align: center; }
.qr-pay-amount span { display: block; color: #777; font-size: 8px; text-transform: uppercase; letter-spacing: .04em; }
.qr-pay-amount strong { display: block; margin-top: 4px; font-size: 20px; }
.qr-pay-accounts { display: flex; flex-direction: column; gap: 12px; }
.qr-pay-account { display: flex; align-items: center; gap: 12px; padding: 10px; border: 1px solid #e4e8e5; border-radius: 10px; }
.qr-pay-account img { width: 76px; height: 76px; object-fit: contain; border-radius: 6px; background: #fff; flex: 0 0 auto; }
.qr-pay-account-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.qr-pay-account-info strong { font-size: 11px; }
.qr-pay-account-info span { font-size: 9px; color: #666; word-break: break-word; }
.qr-pay-note { margin-top: 14px; font-size: 9px; color: #666; text-align: center; }

/* 58mm rolls have ~30% less usable width than 80mm — tighten type and
   padding so columns still line up instead of wrapping awkwardly. */
.print-receipt.paper-58mm header h1 { font-size: 17px; }
.print-receipt.paper-58mm .receipt-meta { grid-template-columns: 1fr; gap: 4px; }
.print-receipt.paper-58mm table,
.print-receipt.paper-58mm .print-totals > div { font-size: 7px; }
.print-receipt.paper-58mm .print-totals .total { font-size: 11px; }

/* Kitchen tickets are read at a glance under service pressure — bigger,
   bolder type than a cashier receipt, and no reliance on subtle grey. */
.kot-ticket header h1 { font-size: 26px; letter-spacing: -.01em; }
.kot-ticket header p { color: #333; font-size: 11px; font-weight: 700; }
.kot-ticket .receipt-meta span { color: #444; }
.kot-ticket .receipt-meta strong { font-size: 11px; }
.kot-ticket table { font-size: 12px; }
.kot-ticket th, .kot-ticket td { padding: 9px 4px; font-weight: 700; }
.kot-ticket td:last-child { font-size: 15px; font-weight: 900; }
.kot-ticket td small { color: #333; font-weight: 600; }
.kot-ticket footer { color: #666; }

/* A receipt/ticket preview is a narrow strip — don't show it inside the
   modal's usual 640px-wide dialog with a big empty gutter either side. */
#orderPopupModal .modal:has(.print-receipt) { width: min(360px, 100%); }

@media (max-width: 1100px) {
  .table-floor { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .billing-layout { grid-template-columns: 1fr; }
}

@media (max-width: 920px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-visual { min-height: 340px; padding: 28px 24px; }
  .auth-visual-copy h1 { font-size: 38px; }
  .auth-panel { padding: 28px 18px; }
  .auth-card { padding: 28px; }
  .auth-form-grid { grid-template-columns: 1fr; }
  .auth-form-grid .full { grid-column: auto; }
  .message-stack { top: 72px; right: 10px; }
}

@media (max-width: 760px) {
  .report-filter { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-help { position: static; }
  .table-floor { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .filter-toolbar { align-items: stretch; flex-wrap: wrap; }
  .filter-toolbar .toolbar-search { flex-basis: 100%; }
  .compact-select { width: 100%; min-width: 0; }
  .compact-date { width: calc(50% - 5px); min-width: 135px; flex: 1; }
  .django-pos .modal { width: 100%; max-width: none; max-height: 96dvh; margin-top: auto; border-radius: 23px 23px 0 0; }
}

@media (max-width: 500px) {
  .popup-form-actions.modal-foot { position: sticky; bottom: -18px; background: #fff; }
  .popup-form-actions .btn { flex: 1; min-width: 0; }
  .auth-visual { min-height: 290px; }
  .auth-feature-grid { display: none; }
  .auth-visual-copy h1 { font-size: 31px; }
  .auth-card { padding: 22px; border-radius: var(--radius); }
  .auth-card h2 { font-size: 28px; }
  .table-floor { grid-template-columns: 1fr 1fr; gap: 9px; }
  .table-card { min-height: 158px; padding: 13px; }
  .table-number { font-size: 20px; }
  .report-filter { grid-template-columns: 1fr; }
  .form-card { padding: 15px; }
  .form-card .card-head { margin: -15px -15px 15px; }
  .danger-zone { align-items: stretch; flex-direction: column; }
  .error-card { padding: 28px 18px; }
  .error-card > span { font-size: 52px; }
  .error-card h1 { font-size: 24px; }
  .success-panel { padding: 26px 18px; }
}

/* Login page on phones: one still screen — cup animation on top, form below, nothing scrolls */
@media (max-width: 640px) {
  body.auth-page-login { height: 100dvh; overflow: hidden; }
  .auth-shell-login {
    grid-template-rows: auto minmax(0, 1fr);
    height: 100dvh;
    overflow: hidden;
  }
  .auth-shell-login .auth-visual {
    min-height: 0;
    flex: 0 0 auto;
    justify-content: center;
    padding: max(16px, env(safe-area-inset-top)) 20px 18px;
  }
  .auth-shell-login .auth-visual-copy { display: none; }
  .auth-shell-login .auth-calendar { display: none; }
  .auth-shell-login .auth-illustration svg { width: 78px; height: 78px; }
  .auth-shell-login .auth-panel {
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow-y: auto;
    padding: 14px 18px max(16px, env(safe-area-inset-bottom));
  }
  .auth-shell-login .auth-card { flex: 0 0 auto; width: 100%; max-width: 430px; margin: 0 auto; padding: 22px; box-sizing: border-box; }
  .auth-shell-login .auth-card h2 { font-size: 25px; }
}

@media print {
  .app-shell .sidebar, .app-shell .topbar, .page-actions, .report-filter, .message-stack, .print-actions, .receipt-tabs { display: none !important; }
  .main-shell { margin: 0 !important; }
  .content { padding: 0 !important; }
  .card, .stat-card { box-shadow: none !important; break-inside: avoid; }
  .receipt-page .print-receipt, .modal-backdrop.open .print-receipt { width: 76mm; margin: 0; padding: 3mm; border: 0; }
  .receipt-page .print-receipt.paper-58mm, .modal-backdrop.open .print-receipt.paper-58mm { width: 54mm; padding: 2mm; }
  .receipt-page .print-receipt.paper-a4, .modal-backdrop.open .print-receipt.paper-a4 { width: 100%; padding: 10mm; }
  .modal-backdrop.open .modal-head { display: none !important; }
  .modal-backdrop.open .modal-body { max-height: none !important; overflow: visible !important; }
}

/* Component integration overrides: these pages layer on the generic cards. */
.table-floor.table-map-grid { grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); }
.table-card.table-map-card { min-height: 310px; padding: 15px; display: flex; border-top-width: 1px; }
.table-card.table-map-card.available { border-color: #bfe0ce; background: linear-gradient(180deg, #fbfffc, #fff 34%); }
.table-card.table-map-card.occupied { border-color: #edd6af; background: linear-gradient(180deg, #fffaf2, #fff 34%); }
.table-card.table-map-card.ready { border-color: #9fd1b5; background: linear-gradient(180deg, #f2fcf6, #fff 38%); }
.table-card.table-map-card.reserved { border-color: #bed7eb; background: linear-gradient(180deg, #f6faff, #fff 34%); }
.table-card.table-map-card.out-of-service { border-color: #d9dfdc; background: #f7f8f7; opacity: .8; }
.table-card.table-map-card p { min-height: 0; margin: 4px 0 0; font-size: 10px; }
.detail-line.order-adjust-line { grid-template-columns: 34px minmax(0, 1fr) auto; align-items: start; }
.detail-line.order-adjust-line.cancelled { text-decoration: none; }
.receipt-lines > .bill-adjustment-line { min-height: 0; padding: 7px 9px; display: block; }
.form-card.bill-issue-form { padding: 0; }

@media (max-width: 700px) {
  .table-floor.table-map-grid { grid-template-columns: 1fr; }
  .detail-line.order-adjust-line { grid-template-columns: 28px minmax(0, 1fr); }
}

@media (max-width: 500px) {
  .table-card.table-map-card { min-height: 290px; padding: 15px; }
}

/* Manage Staff (mobile): the stat cards eat the screen before you reach
   the roster, and the generic data-table stack buries name/role/status
   under Username/Phone in reading order — reorder and drop the stats
   instead of scrolling past them on a phone. */
@media (max-width: 760px) {
  body[data-page="admin-staff"] .stats-grid { display: none; }

  body[data-page="admin-staff"] .staff-roster-table tbody tr { border-left: 3px solid var(--line); }
  body[data-page="admin-staff"] .staff-roster-table tbody tr:has(.badge-offline) { border-left-color: var(--danger); }
  body[data-page="admin-staff"] .staff-roster-table td:nth-child(1) { grid-column: 1 / -1; order: -3; }
  body[data-page="admin-staff"] .staff-roster-table td:nth-child(4),
  body[data-page="admin-staff"] .staff-roster-table td:nth-child(5) { order: -2; }
  body[data-page="admin-staff"] .staff-roster-table td:nth-child(2),
  body[data-page="admin-staff"] .staff-roster-table td:nth-child(3),
  body[data-page="admin-staff"] .staff-roster-table td:nth-child(6) { order: -1; }
  body[data-page="admin-staff"] .staff-roster-table td:nth-child(7) { grid-column: 1 / -1; order: 1; }
  body[data-page="admin-staff"] .staff-roster-table .row-actions { display: flex; gap: 8px; }
  body[data-page="admin-staff"] .staff-roster-table .row-actions form { flex: 1; }
  body[data-page="admin-staff"] .staff-roster-table .row-actions form .btn { width: 100%; }
  body[data-page="admin-staff"] .staff-roster-table .row-actions > button { flex: 0 0 44px; width: 44px; padding: 0; }

  body[data-page="admin-staff"] .attendance-table td:nth-child(2) { grid-column: 1 / -1; order: -3; }
  body[data-page="admin-staff"] .attendance-table td:nth-child(1),
  body[data-page="admin-staff"] .attendance-table td:nth-child(3) { order: -2; }
  body[data-page="admin-staff"] .attendance-table td:nth-child(4),
  body[data-page="admin-staff"] .attendance-table td:nth-child(5),
  body[data-page="admin-staff"] .attendance-table td:nth-child(6) { order: -1; }
  body[data-page="admin-staff"] .attendance-table td:nth-child(7) { grid-column: 1 / -1; order: 1; }
  body[data-page="admin-staff"] .attendance-table .row-actions { display: flex; gap: 8px; }
  body[data-page="admin-staff"] .attendance-table .row-actions .btn { flex: 0 0 44px; width: 44px; padding: 0; }
}

.branch-switch-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  margin-bottom: 10px;
  border-radius: 12px;
  background: var(--surface-2, rgba(255, 255, 255, 0.04));
}
.branch-switch-label {
  font-size: 12px;
  font-weight: 600;
  opacity: 0.75;
  display: flex;
  align-items: center;
  gap: 6px;
}
.branch-switch-select { width: 100%; }
.branch-switch-submit { width: 100%; }

.branch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.branch-card { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.branch-card.card-inactive { opacity: 0.6; }
.branch-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.branch-card-head .cell-copy { display: flex; flex-direction: column; gap: 2px; }
.branch-card-head .cell-copy code { opacity: 0.7; font-size: 12px; }
.branch-card-meta { display: flex; flex-direction: column; gap: 4px; font-size: 13px; opacity: 0.85; }
.branch-card-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; text-align: center; padding: 10px 0; border-top: 1px solid var(--border, rgba(255, 255, 255, 0.08)); border-bottom: 1px solid var(--border, rgba(255, 255, 255, 0.08)); }
.branch-card-stats strong { display: block; font-size: 15px; }
.branch-card-stats small { opacity: 0.65; font-size: 11px; }
.branch-card-actions { display: flex; gap: 8px; }
.branch-card-actions .btn { flex: 1; }

.password-hint { font-size: 13px; opacity: 0.8; margin-bottom: 14px; }
.password-reveal-row { display: flex; gap: 8px; margin-bottom: 10px; }
.password-reveal-row .field { flex: 1; font-family: monospace; }

.ledger-note { font-size: 13px; opacity: 0.75; margin: 4px 0 16px; display: flex; gap: 8px; align-items: flex-start; }
.ledger-table td { vertical-align: middle; }
.ledger-amount { font-weight: 600; white-space: nowrap; }
.ledger-amount.positive { color: var(--success, #16794c); }
.ledger-amount.negative { color: var(--danger, #c0392b); }
.ledger-row.ledger-void { opacity: 0.6; }
