/*
 * QuickBite admin panel - styles.
 * Brand: orange #FF6A13, cream #FFF8F2, dark #1F2430.
 * Change the colours in the :root block below.
 */

:root {
  --orange: #FF6A13;
  --orange-hover: #F25F08;
  --orange-ink: #B84300;      /* orange dark enough for text on cream/white */
  --orange-soft: #FFE8D9;
  --cream: #FFF8F2;
  --dark: #1F2430;
  --muted: #5B6270;
  --line: #EBDFD4;
  --card: #FFFFFF;
  --ok: #167A3E;
  --ok-soft: #DDF4E4;
  --info: #1D4ED8;
  --info-soft: #E0E9FF;
  --warn: #A15C07;
  --warn-soft: #FFF0C9;
  --bad: #B3261E;
  --bad-soft: #FCE4E2;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(31, 36, 48, .06), 0 8px 24px rgba(31, 36, 48, .06);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  color: var(--dark);
  background: var(--cream);
}
h1, h2, h3 { line-height: 1.2; margin: 0; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.muted { color: var(--muted); }
.small { font-size: 13px; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.icon { flex: none; }

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--dark); color: #fff; padding: 10px 14px; border-radius: 8px;
}
.skip-link:focus { top: 12px; }

/* Keyboard focus: always clearly visible */
:focus-visible {
  outline: 3px solid var(--dark);
  outline-offset: 2px;
  box-shadow: 0 0 0 6px rgba(255, 106, 19, .45);
}

/* ------------------------------------------------------------------ brand */
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; letter-spacing: -.2px; }
.brand-mark {
  display: inline-grid; place-items: center; width: 34px; height: 34px;
  border-radius: 10px; background: var(--orange); color: #fff;
}
.brand-name { color: var(--dark); }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 16px; border-radius: 999px; border: 1.5px solid transparent;
  font-weight: 700; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color .15s, border-color .15s, transform .05s;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn-lg { min-height: 48px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--orange); color: var(--dark); }
.btn-primary:hover:not(:disabled) { background: var(--orange-hover); }
.btn-ghost { background: var(--card); border-color: var(--line); color: var(--dark); }
.btn-ghost:hover:not(:disabled) { border-color: var(--dark); }
.btn-danger { background: var(--bad); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #98201A; }
.btn-danger-ghost { background: var(--card); border-color: #F0B8B4; color: var(--bad); }
.btn-danger-ghost:hover:not(:disabled) { background: var(--bad-soft); border-color: var(--bad); }
.btn.is-busy { position: relative; }
.btn.is-busy::after {
  content: ""; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; padding: 0;
  border-radius: 50%; border: 1.5px solid transparent; background: transparent; cursor: pointer; color: var(--dark);
}
.icon-btn:hover:not(:disabled) { background: var(--orange-soft); }
.icon-btn:disabled { opacity: .35; cursor: not-allowed; }
.icon-btn-danger { color: var(--bad); }
.icon-btn-danger:hover:not(:disabled) { background: var(--bad-soft); }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.btn-row.nowrap { flex-wrap: nowrap; gap: 2px; }

/* ----------------------------------------------------------------- forms */
.form-grid { display: grid; gap: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 700; font-size: 14px; }
.field-hint { font-size: 13px; color: var(--muted); }
.field-error, .form-error { font-size: 13px; font-weight: 600; color: var(--bad); }
.form-error { background: var(--bad-soft); padding: 10px 12px; border-radius: var(--radius-sm); }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="search"], select, textarea {
  width: 100%; min-height: 44px; padding: 9px 12px;
  border: 1.5px solid #D8CBBE; border-radius: var(--radius-sm); background: #fff;
}
textarea { resize: vertical; min-height: 84px; }
input:hover, select:hover, textarea:hover { border-color: #B9A998; }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--dark); }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--bad); background: #FFF8F7; }
.select-sm { min-height: 40px; width: auto; padding-right: 30px; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; min-height: 40px; }
.check input { width: 20px; height: 20px; accent-color: var(--orange); flex: none; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.form-actions { display: flex; justify-content: flex-start; padding-top: 4px; }
.inline-label { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--muted); }
.inline-label select { color: var(--dark); }

/* switch (on/off) */
.switch {
  position: relative; width: 46px; height: 26px; padding: 0; border-radius: 999px;
  border: 0; background: #C9BFB5; cursor: pointer; transition: background-color .15s; flex: none;
}
.switch-knob {
  position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .15s;
}
.switch[aria-checked="true"] { background: var(--ok); }
.switch[aria-checked="true"] .switch-knob { transform: translateX(20px); }
.switch:disabled { opacity: .6; cursor: progress; }

/* ---------------------------------------------------------------- layout */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px;
}
.card h3 { font-size: 17px; margin-bottom: 14px; }

.center-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 420px; display: grid; gap: 14px; }
.auth-card h1 { font-size: 26px; }
.setup-card { max-width: 560px; }
.steps { margin: 0; padding-left: 22px; display: grid; gap: 8px; }
.code {
  margin: 0; padding: 14px; background: var(--dark); color: #FFE9DB; border-radius: var(--radius-sm);
  overflow-x: auto; font-size: 13px; line-height: 1.5;
}
.form-ok { font-size: 14px; font-weight: 600; color: var(--ok); background: var(--ok-soft); padding: 10px 12px; border-radius: var(--radius-sm); }
.link-btn {
  justify-self: center; background: none; border: 0; padding: 6px 8px; min-height: 36px;
  color: #B54400; font-weight: 700; text-decoration: underline; cursor: pointer; border-radius: var(--radius-sm);
}
.link-btn:hover { color: var(--dark); }
.demo-hint { font-size: 13px; background: var(--orange-soft); padding: 10px 12px; border-radius: var(--radius-sm); }
.loading { color: var(--muted); padding: 24px 4px; }
.center-loading { text-align: center; padding-top: 30vh; }
.noscript { padding: 24px; text-align: center; }

.topbar { background: #fff; border-bottom: 1px solid var(--line); }
.topbar-inner {
  max-width: 1440px; margin: 0 auto; padding: 10px 24px;
  display: flex; align-items: center; gap: 14px;
}
.restaurant-name { color: var(--muted); font-weight: 600; padding-left: 14px; border-left: 2px solid var(--line); }
.toolbar-spacer { flex: 1 1 auto; }
.user-email { color: var(--muted); font-size: 14px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.demo-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px;
  background: var(--dark); color: #FFE9DB; padding: 8px 16px; font-size: 14px;
}
.demo-bar .btn { min-height: 32px; }

/* tabs */
.tabs { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.tablist { max-width: 1440px; margin: 0 auto; padding: 0 20px; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.tablist [role="tab"] {
  position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 52px; padding: 0 16px;
  border: 0; background: transparent; cursor: pointer; font-weight: 700; color: var(--muted);
  border-bottom: 3px solid transparent; white-space: nowrap;
}
.tablist [role="tab"]:hover { color: var(--dark); }
.tablist [role="tab"][aria-selected="true"] { color: var(--dark); border-bottom-color: var(--orange); }
.tablist [role="tab"][aria-selected="true"] .icon { color: var(--orange-ink); }
.tab-badge {
  display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: 999px; background: var(--orange); color: var(--dark); font-size: 12px; font-weight: 800;
  animation: pop .35s ease;
}
@keyframes pop { 0% { transform: scale(.6); } 70% { transform: scale(1.2); } 100% { transform: scale(1); } }

.content { max-width: 1440px; margin: 0 auto; padding: 22px 24px 60px; outline: none; }
.panel { display: block; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 18px; }
.search { flex: 1 1 220px; max-width: 340px; }

/* segmented control */
.seg { display: inline-flex; background: #fff; border: 1.5px solid var(--line); border-radius: 999px; padding: 3px; }
.seg-btn { border: 0; background: transparent; min-height: 36px; padding: 0 16px; border-radius: 999px; font-weight: 700; cursor: pointer; color: var(--muted); }
.seg-btn[aria-pressed="true"] { background: var(--dark); color: #fff; }

.live { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--muted); }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: #B0A79E; }
.live.live-live { color: var(--ok); }
.live.live-live .live-dot { background: var(--ok); box-shadow: 0 0 0 0 rgba(22, 122, 62, .5); animation: pulse 2s infinite; }
.live.live-offline { color: var(--bad); }
.live.live-offline .live-dot { background: var(--bad); }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px rgba(22, 122, 62, 0); } 100% { box-shadow: 0 0 0 0 rgba(22, 122, 62, 0); } }

.empty-state { text-align: center; padding: 48px 16px; color: var(--muted); display: grid; gap: 12px; justify-items: center; }

/* ------------------------------------------------------------- orders board */
.board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; align-items: start; }
.column { background: #FDEFE3; border-radius: var(--radius); padding: 12px; min-width: 0; border-top: 5px solid var(--orange); }
.column.col-preparing { border-top-color: #E8A200; }
.column.col-on_the_way { border-top-color: var(--info); }
.column.col-delivered { border-top-color: var(--ok); background: #EEF6EF; }
.column-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 4px 12px; }
.column-head h3 { font-size: 16px; }
.count { min-width: 28px; height: 28px; display: inline-grid; place-items: center; background: #fff; border-radius: 999px; font-weight: 800; font-size: 13px; }
.column-body { display: grid; gap: 10px; }
.empty { color: var(--muted); text-align: center; padding: 22px 8px; font-size: 14px; }

.order-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm);
  box-shadow: 0 1px 2px rgba(31, 36, 48, .05); overflow: hidden;
}
.order-card.is-new { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(255, 106, 19, .28); }
.order-open {
  display: grid; gap: 4px; width: 100%; text-align: left; border: 0; background: transparent;
  padding: 12px 14px; cursor: pointer; border-radius: var(--radius-sm);
}
.order-open:hover { background: #FFFAF6; }
.order-top { display: flex; align-items: center; gap: 8px; }
.order-no { font-size: 16px; }
.order-time { margin-left: auto; font-size: 13px; color: var(--muted); }
.new-pill { background: var(--orange); color: var(--dark); font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 999px; text-transform: uppercase; letter-spacing: .4px; }
.order-customer { font-weight: 600; }
.order-items {
  font-size: 13px; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.order-bottom { display: flex; align-items: center; gap: 10px; margin-top: 4px; flex-wrap: wrap; }
.order-total { font-weight: 800; }
.order-count { font-size: 13px; color: var(--muted); }
.order-actions { padding: 0 12px 12px; }
.cancelled-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.badge-placed { background: var(--orange-soft); color: var(--orange-ink); }
.badge-preparing { background: var(--warn-soft); color: var(--warn); }
.badge-on_the_way { background: var(--info-soft); color: var(--info); }
.badge-delivered { background: var(--ok-soft); color: var(--ok); }
.badge-cancelled { background: var(--bad-soft); color: var(--bad); }

/* ------------------------------------------------------------- order details */
.detail { display: grid; gap: 18px; }
.detail-status { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.kv-list { margin: 0; display: grid; gap: 10px; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 12px; }
.kv dt { color: var(--muted); font-weight: 600; }
.kv dd { margin: 0; min-width: 0; }
.note { background: var(--warn-soft); padding: 6px 10px; border-radius: 8px; display: inline-block; }
.link-phone { display: inline-flex; align-items: center; gap: 4px; color: var(--orange-ink); font-weight: 700; }
.items-table { width: 100%; border-collapse: collapse; }
.items-table th, .items-table td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.items-table th.num, .items-table td.num { text-align: right; }
.items-table thead th { font-size: 13px; color: var(--muted); }
.items-table tfoot td { border-bottom: 0; padding-top: 6px; padding-bottom: 6px; color: var(--muted); }
.items-table tfoot tr.grand td { color: var(--dark); font-weight: 800; font-size: 17px; border-top: 2px solid var(--dark); }
.status-actions-title { font-weight: 700; margin-bottom: 8px; }

/* -------------------------------------------------------------- data tables */
.table-scroll { overflow-x: auto; }
.list-wrap { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.list-wrap > .loading { padding: 24px; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); padding: 12px 14px; background: #FFFAF6; border-bottom: 1px solid var(--line); }
.data-table th.num { text-align: right; }
.data-table td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #FFFBF8; }
.data-table tr.is-off .cell-title, .data-table tr.is-off .col-img { opacity: .55; }
.col-img { width: 76px; }
.col-switch { width: 110px; text-align: center; }
th.col-switch { text-align: center; }
.col-actions { width: 100px; text-align: right; }
.col-actions .btn-row { justify-content: flex-end; }
th.col-actions { text-align: right; }
.col-order { width: 150px; }
.cell-main { min-width: 200px; }
.cell-title { display: block; }
.cell-sub { display: block; font-size: 13px; color: var(--muted); max-width: 520px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.order-num { margin-left: 6px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }

.thumb { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 12px; overflow: hidden; background: var(--orange-soft); flex: none; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-ph { display: grid; place-items: center; width: 100%; height: 100%; color: #B58C70; background: repeating-linear-gradient(45deg, #FFF1E6, #FFF1E6 8px, #FFEADB 8px, #FFEADB 16px); }
.thumb-lg { width: 96px; height: 96px; border-radius: 16px; }
.image-row { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: start; }

/* ---------------------------------------------------------------- dashboard */
.dash { display: grid; gap: 18px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; }
.stat-accent { background: var(--dark); color: #fff; border-color: var(--dark); }
.stat-accent .stat-label, .stat-accent .stat-hint { color: #FFD3B8; }
.stat-label { font-weight: 700; color: var(--muted); font-size: 14px; }
.stat-value { font-size: 34px; font-weight: 800; letter-spacing: -.5px; margin: 4px 0; font-variant-numeric: tabular-nums; }
.stat-hint { font-size: 13px; color: var(--muted); }
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.bar-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 14px; }
.bar-list li { display: grid; grid-template-columns: auto minmax(90px, 1fr) auto; gap: 12px; align-items: center; }
.top-list li { grid-template-columns: 24px minmax(80px, 1.2fr) minmax(60px, 1fr) auto; }
.bar-label { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-list:not(.top-list) .bar-label { width: 96px; }
.bar { display: block; height: 12px; background: #F4EBE2; border-radius: 999px; overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 999px; background: var(--orange); min-width: 4px; }
.fill-preparing { background: #E8A200; }
.fill-on_the_way { background: var(--info); }
.fill-delivered { background: var(--ok); }
.fill-cancelled { background: var(--bad); }
.fill-top { background: var(--orange); }
.bar-value { font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; min-width: 28px; }
.rank { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--orange-soft); color: var(--orange-ink); font-weight: 800; font-size: 12px; }

.settings-card { max-width: 640px; }

/* ------------------------------------------------------------------- modal */
.modal {
  padding: 0; border: 0; border-radius: 18px; width: min(560px, calc(100vw - 24px));
  max-height: calc(100vh - 32px); color: var(--dark); background: #fff;
  box-shadow: 0 24px 64px rgba(31, 36, 48, .35);
}
.modal[open] { display: flex; flex-direction: column; }
.modal-sm { width: min(440px, calc(100vw - 24px)); }
.modal-lg { width: min(680px, calc(100vw - 24px)); }
.modal::backdrop { background: rgba(31, 36, 48, .55); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 16px 12px 24px; border-bottom: 1px solid var(--line); flex: none; }
.modal-head h2 { font-size: 20px; }
.modal-inner { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; }
.modal-body { padding: 20px 24px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; padding: 14px 24px; border-top: 1px solid var(--line); background: #FFFAF6; flex: none; }
.confirm-text { font-size: 16px; }

/* ------------------------------------------------------------------- toasts */
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 1000; display: grid; gap: 10px; width: min(380px, calc(100vw - 32px)); pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: flex-start; gap: 10px; padding: 12px 8px 12px 16px;
  border-radius: var(--radius-sm); background: var(--dark); color: #fff; box-shadow: 0 10px 30px rgba(31, 36, 48, .3);
  border-left: 6px solid var(--orange); animation: slide-in .2s ease-out;
}
.toast-success { border-left-color: #4CC47A; }
.toast-error { border-left-color: #FF6B60; background: #4A1613; }
.toast-msg { flex: 1; padding-top: 4px; overflow-wrap: anywhere; }
.toast-close { background: transparent; border: 0; color: inherit; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; flex: none; }
.toast-close:hover { background: rgba(255, 255, 255, .15); }
.toast :focus-visible { outline-color: #fff; }
@keyframes slide-in { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ================================================================ responsive */
@media (max-width: 1180px) {
  /* Tablet: the board scrolls sideways and each column stays readable. */
  .board { grid-template-columns: repeat(4, minmax(280px, 1fr)); overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: 12px; }
  .column { scroll-snap-align: start; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  body { font-size: 16px; }
  .topbar-inner { padding: 8px 14px; gap: 10px; }
  .restaurant-name { display: none; }
  .user-email { display: none; }
  .btn-label { display: none; }
  .content { padding: 16px 14px 96px; }

  /* Phone: tabs become a bottom bar */
  .tabs { position: fixed; top: auto; bottom: 0; left: 0; right: 0; border-top: 1px solid var(--line); border-bottom: 0; box-shadow: 0 -4px 16px rgba(31, 36, 48, .08); padding-bottom: env(safe-area-inset-bottom); }
  .tablist { padding: 0; gap: 0; overflow: visible; }
  .tablist [role="tab"] { flex: 1 1 0; flex-direction: column; justify-content: center; gap: 2px; min-height: 60px; padding: 6px 2px; font-size: 11.5px; border-bottom: 0; border-top: 3px solid transparent; }
  .tablist [role="tab"][aria-selected="true"] { border-top-color: var(--orange); }
  .tab-badge { position: absolute; top: 4px; left: 50%; margin-left: 6px; }

  .board { grid-template-columns: repeat(4, 84vw); }
  .toolbar { gap: 10px; }
  .search { max-width: none; flex-basis: 100%; }
  .stat-value { font-size: 28px; }
  .stats { gap: 12px; }
  .form-row { grid-template-columns: 1fr; }
  .image-row { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; gap: 2px; }

  /* Phone: tables turn into cards */
  .data-table.responsive thead { display: none; }
  .data-table.responsive, .data-table.responsive tbody, .data-table.responsive tr, .data-table.responsive td { display: block; width: 100%; }
  .data-table.responsive tr { padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .data-table.responsive td { border: 0; padding: 5px 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; text-align: right; width: auto; }
  .data-table.responsive td::before { content: attr(data-label); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); text-align: left; }
  .data-table.responsive td.col-img { justify-content: flex-start; }
  .data-table.responsive td.col-img::before { display: none; }
  .data-table.responsive td.cell-main { display: block; text-align: left; }
  .data-table.responsive td.cell-main::before { display: none; }
  .data-table.responsive .cell-sub { white-space: normal; max-width: none; }
  .data-table.responsive td.col-actions { justify-content: flex-end; }
  .data-table.responsive td.col-actions::before { display: none; }
  .col-img, .col-switch, .col-actions, .col-order { width: auto; }
  .toasts { bottom: 76px; right: 12px; }

  /* Phone: dialogs slide up from the bottom */
  .modal, .modal-sm, .modal-lg { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 18px 18px 0 0; max-height: 92vh; }
  .modal-body { padding: 16px; }
  .modal-head { padding-left: 16px; }
  .modal-foot { padding: 12px 16px; }
  .modal-foot .btn { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
