:root {
  --orange: #f26419;
  --orange-2: #ff8a3d;
  --orange-soft: #fff1e8;
  --blue: #2563eb;
  --blue-2: #3b82f6;
  --blue-soft: #e8f0fe;
  --green: #16a34a;
  --green-2: #15803d;
  --green-soft: #e7f7ed;
  --red: #e5383b;
  --red-soft: #fdecec;
  --navy: #182235;
  --navy-2: #0f1828;
  --bg: #f1f3f7;
  --panel: #fff;
  --panel-2: #f5f6f9;
  --line: #e5e7ec;
  --ink: #1d2230;
  --muted: #6b7180;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .04);
  --sidebar: 250px;
  --font: "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }
input, select { font: inherit; color: inherit; }
.icon { width: 1.25em; height: 1.25em; flex-shrink: 0; }
.muted { color: var(--muted); }
.orange { color: var(--orange); }
code { background: var(--panel-2); padding: 1px 5px; border-radius: 4px; font-size: .92em; }

/* ---------- Logo ---------- */
.logo { display: flex; align-items: center; gap: 12px; color: #fff; }
.logo-mark { width: 44px; height: 44px; stroke-width: 1.6; }
.logo-tile { border-radius: 11px; box-shadow: 0 4px 14px rgba(242, 100, 25, .35); }
.login-card .logo-tile { box-shadow: 0 4px 14px rgba(16, 24, 40, .15); }
.logo-text { display: flex; flex-direction: column; line-height: 1.05; }
.logo-text strong { font-size: 22px; font-weight: 900; text-transform: uppercase; white-space: nowrap; }
.logo-text em { font-style: normal; color: var(--orange); }
.logo-text small { font-size: 13px; color: rgba(255, 255, 255, .6); margin-top: 4px; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  background: var(--navy);
  color: #fff;
  padding: 22px 10px 14px;
  z-index: 40;
}
.sidebar .logo { padding: 0 12px 24px; }
.side-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; overflow-y: auto; }
.side-nav a, .side-logout button {
  display: flex; align-items: center; gap: 16px;
  width: 100%;
  padding: 13px 16px;
  border-radius: 10px;
  font-size: 16px;
  color: rgba(255, 255, 255, .88);
  transition: background .15s;
}
.side-nav .icon, .side-logout .icon { width: 24px; height: 24px; stroke-width: 1.7; }
.side-nav a:hover, .side-logout button:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.side-nav a.active {
  background: linear-gradient(135deg, var(--orange-2), var(--orange));
  color: #fff;
  box-shadow: 0 6px 16px rgba(242, 100, 25, .35);
}
.side-logout { padding-bottom: 4px; }
.side-home {
  display: flex; align-items: center; gap: 16px;
  padding: 13px 16px; margin-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, .1);
  font-size: 16px; color: rgba(255, 255, 255, .88);
}
.side-home .icon { width: 24px; height: 24px; stroke-width: 1.7; }
.side-home:hover { color: #fff; }
.login-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.forgot-link { color: var(--blue); font-size: 14px; font-weight: 500; margin: 6px 0 16px; }
.auth-flash { padding: 10px 14px; border-radius: 10px; margin-bottom: 16px; font-size: 14px; }
.auth-flash.ok { background: var(--green-soft); color: var(--green-2); }
.auth-flash.err { background: var(--red-soft); color: var(--red); }
.auth-hint { color: var(--muted); font-size: 14px; margin-bottom: 14px; }
.auth-note { color: var(--muted); font-size: 12.5px; margin-top: 14px; text-align: center; }
.back-home { display: inline-flex; align-items: center; gap: 4px; margin: -12px 0 12px -6px; color: var(--muted); font-size: 14px; font-weight: 500; }
.back-home .icon { width: 18px; height: 18px; }
.back-home:hover { color: var(--blue); }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 100vh; }
.admin-top {
  display: flex; align-items: center; gap: 24px;
  padding: 14px 24px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.menu-btn { display: none; }
.top-slot { flex: 1; min-width: 0; }
.top-slot h1 { font-size: 22px; font-weight: 700; }
.top-search {
  display: flex; align-items: center; gap: 12px;
  max-width: 720px; height: 50px; padding: 0 18px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--panel); color: var(--muted);
}
.top-search:focus-within { border-color: var(--orange); }
.top-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 16px; color: var(--ink); }
.clock { display: flex; gap: 14px; font-size: 17px; white-space: nowrap; }
.clock [data-day] { color: var(--ink); }
.user { display: flex; align-items: center; gap: 10px; padding-left: 18px; border-left: 1px solid var(--line); }
.user-avatar { width: 40px; height: 40px; stroke-width: 1.5; color: var(--navy); }
.user span { display: flex; flex-direction: column; line-height: 1.2; }
.user small { color: var(--muted); font-size: 13px; }

.content { flex: 1; padding: 24px; min-width: 0; }
.flash { margin: 16px 24px 0; padding: 12px 16px; border-radius: 10px; font-weight: 500; }
.success-flash { background: var(--green-soft); color: var(--green-2); }
.error-flash { background: var(--red-soft); color: var(--red); }
.sidebar-backdrop { display: none; }

/* ---------- Buttons & forms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px;
  border-radius: 10px;
  font-weight: 500; font-size: 15px;
  white-space: nowrap;
  transition: filter .15s, background .15s;
}
.btn:hover:not(:disabled) { filter: brightness(1.05); }
.btn .icon { width: 18px; height: 18px; }
.btn-sm { height: 36px; padding: 0 12px; font-size: 14px; }
.btn-block { width: 100%; }
.btn-primary { background: linear-gradient(135deg, var(--orange-2), var(--orange)); color: #fff; box-shadow: 0 4px 12px rgba(242, 100, 25, .25); }
.btn-secondary { background: var(--blue); color: #fff; }
.btn-light { background: var(--panel); border: 1px solid var(--line); color: var(--ink); }
.btn-light:hover { background: var(--panel-2); }
.btn-danger-soft { background: var(--red-soft); color: var(--red); }
.btn.disabled { opacity: .45; pointer-events: none; }

.card { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line); }
.card-title { display: flex; align-items: center; gap: 10px; font-size: 18px; margin-bottom: 8px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h2 { font-size: 24px; }
.page-head p { margin-top: 4px; }
.head-actions { display: flex; gap: 10px; }

.form-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; flex: 1; }
.form-field > span, .form-label { font-size: 14px; font-weight: 500; color: var(--muted); }
.form-label { display: block; margin-bottom: 8px; }
.form-field textarea { padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; outline: 0; font: inherit; font-size: 15px; resize: vertical; }
.form-field textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.form-field input, .form-field select, .filter-bar input, .filter-bar select, .inline-form input, .table-edit input[type=text] {
  height: 46px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--panel); outline: 0;
  font-size: 15px;
}
.form-field input:focus, .form-field select:focus, .filter-bar input:focus, .inline-form input:focus, .table-edit input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.form-row { display: flex; gap: 16px; flex-wrap: wrap; }
.form-row .form-field { min-width: 160px; }
.field-error { color: var(--red); font-size: 13px; }
.check { display: flex; align-items: center; gap: 10px; margin: 6px 0 16px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--orange); }
.form-card { padding: 24px; }
.narrow-card { max-width: 720px; }
.form-grid { display: grid; grid-template-columns: 1fr 280px; gap: 32px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 16px; margin-top: 8px; border-top: 1px solid var(--line); }

.image-drop {
  position: relative; display: grid; place-items: center;
  aspect-ratio: 4 / 3; margin-bottom: 8px;
  border: 2px dashed var(--line); border-radius: 12px;
  overflow: hidden; cursor: pointer; background: var(--panel-2);
}
.image-drop:hover { border-color: var(--blue); }
.image-drop img { width: 100%; height: 100%; object-fit: cover; }
.image-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.image-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--muted); }
.image-empty .icon { width: 36px; height: 36px; }

.icon-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.icon-picker input { position: absolute; opacity: 0; }
.icon-picker span {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 14px 8px; border: 1.5px solid var(--line); border-radius: 10px;
  font-size: 13px; cursor: pointer; text-align: center;
}
.icon-picker .icon { width: 30px; height: 30px; }
.icon-picker input:checked + span { border-color: var(--orange); background: var(--orange-soft); color: var(--orange); }
.icon-picker input:focus-visible + span { box-shadow: 0 0 0 3px var(--blue-soft); }

.filter-bar { display: flex; gap: 10px; padding: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.filter-bar input[type=search] { flex: 1; min-width: 180px; }
.inline-form { display: flex; gap: 10px; }
.inline-form input { min-width: 240px; }
.inline-form .narrow { min-width: 0; width: 80px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.data-table th { text-align: left; font-weight: 500; font-size: 13px; color: var(--muted); padding: 12px 16px; background: var(--panel-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.data-table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table tbody tr:hover { background: #fafbfc; }
.data-table .num { text-align: right; white-space: nowrap; }
.data-table tfoot td { font-weight: 500; }
.data-table .grand-row td { font-size: 18px; font-weight: 700; color: var(--orange); }
.row-actions { text-align: right; white-space: nowrap; }
.row-actions > * { display: inline-flex; vertical-align: middle; margin-left: 6px; }
.empty-row { text-align: center; color: var(--muted); padding: 40px !important; }
.thumb-cell img, .thumb-cell .placeholder { width: 52px; height: 52px; border-radius: 8px; object-fit: cover; display: grid; place-items: center; }
.icon-cell .icon { width: 28px; height: 28px; color: var(--blue); }

.badge { display: inline-block; padding: 4px 10px; border-radius: 99px; font-size: 13px; font-weight: 500; white-space: nowrap; }
.badge-green { background: var(--green-soft); color: var(--green-2); }
.badge-orange { background: var(--orange-soft); color: var(--orange); }
.badge-gray { background: var(--panel-2); color: var(--muted); }
.badge-blue { background: var(--blue-soft); color: var(--blue); }
.strip-waiter { font-size: 12px; opacity: .8; }

.pagination { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 16px; }

.placeholder {
  display: grid; place-items: center; width: 100%; height: 100%;
  color: rgba(200, 222, 255, .75);
  background: radial-gradient(circle at 50% 35%, rgba(59, 130, 246, .45), transparent 60%), linear-gradient(160deg, #1e3a6e, #0f1b33);
}
.placeholder .icon { width: 42%; height: 42%; stroke-width: 1.4; }

/* ---------- Detail / stats / settings ---------- */
.detail-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; align-items: start; }
.detail-grid .card-title { padding: 16px 16px 4px; }
.info-list { padding: 8px 20px; }
.info-list p { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.info-list p:last-child { border-bottom: 0; }
.info-list span { color: var(--muted); }
.note-box { flex-direction: column; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat { padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; }
.stat span { color: var(--muted); font-size: 14px; }
.stat strong { font-size: 26px; font-weight: 700; }

.segmented { display: flex; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 4px; }
.segmented a { padding: 8px 16px; border-radius: 8px; font-size: 14px; font-weight: 500; color: var(--muted); }
.segmented a.active { background: var(--navy); color: #fff; }

.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 20px; align-items: start; }
.settings-grid .card-title .icon { color: var(--blue); }
.settings-grid .muted { margin-bottom: 18px; font-size: 14px; }
.test-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }
.test-row .plain-input { flex: 1; min-width: 180px; }
.test-row .field-error { flex-basis: 100%; }
.narrow-field { max-width: 150px; min-width: 110px !important; }
.segmented-choice { display: flex; gap: 8px; margin: 14px 0; }
.segmented-choice label { flex: 1; cursor: pointer; }
.segmented-choice input { position: absolute; opacity: 0; }
.segmented-choice span { display: block; padding: 10px; border: 1.5px solid var(--line); border-radius: 10px; text-align: center; font-weight: 500; }
.segmented-choice input:checked + span { border-color: var(--orange); background: var(--orange-soft); color: var(--orange); }
.segmented-choice input:focus-visible + span { box-shadow: 0 0 0 3px var(--blue-soft); }
.sms-status { display: flex; gap: 12px; padding: 14px; border-radius: 10px; background: var(--green-soft); color: var(--green-2); font-size: 14px; line-height: 1.5; }
.sms-status.warn { background: var(--blue-soft); color: #1e40af; }
.sms-status .icon { width: 22px; height: 22px; margin-top: 2px; }

/* ---------- Tables (dining) page ---------- */
.add-tables { display: flex; align-items: center; gap: 16px; padding: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.table-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
.table-card { display: flex; gap: 16px; padding: 16px; }
.table-card.inactive { opacity: .6; }
.qr-box { width: 120px; height: 120px; flex-shrink: 0; padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.qr-box svg { width: 100%; height: 100%; display: block; }
.table-card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.table-edit { display: flex; gap: 8px; align-items: center; }
.table-edit input[type=text] { flex: 1; min-width: 0; height: 38px; font-weight: 700; }
.switch { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); cursor: pointer; }
.switch input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--green); }
.table-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.empty-card { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 48px; color: var(--muted); text-align: center; }
.empty-card .icon { width: 48px; height: 48px; opacity: .5; }

/* ---------- Login ---------- */
.login-page {
  min-height: 100vh; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(600px 320px at 15% 0%, rgba(59, 130, 246, .25), transparent 70%),
              radial-gradient(600px 320px at 90% 10%, rgba(37, 99, 235, .22), transparent 70%), var(--navy-2);
}
.login-card { width: min(400px, 100%); padding: 32px 28px; border-radius: 18px; background: var(--panel); box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
.login-card .logo { color: var(--ink); justify-content: center; margin-bottom: 28px; }
.login-card .logo-text small { color: var(--muted); }
.login-card .btn { height: 50px; font-size: 16px; }

/* ---------- POS ---------- */
.page-pos .main { height: 100vh; min-height: 0; }
.page-pos .content { display: flex; min-height: 0; padding: 16px 16px 12px; overflow: hidden; }
.pos { flex: 1; display: grid; grid-template-columns: 1fr minmax(430px, 38%); gap: 16px; min-height: 0; }

.pos-menu { display: flex; flex-direction: column; gap: 14px; min-height: 0; min-width: 0; }
.pos-cats { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.pos-cat {
  flex: 0 0 auto;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  min-width: 112px; height: 88px; padding: 8px 12px;
  border-radius: 10px;
  background: var(--panel); border: 1px solid var(--line);
  font-size: 14px;
}
.pos-cat .icon { width: 30px; height: 30px; stroke-width: 1.7; }
.pos-cat:hover { border-color: var(--orange-2); }
.pos-cat.active { background: linear-gradient(135deg, var(--orange-2), var(--orange)); border-color: var(--orange); color: #fff; box-shadow: 0 6px 16px rgba(242, 100, 25, .3); }
.pos-cats.searching .pos-cat.active { background: var(--panel); color: var(--ink); box-shadow: none; border-color: var(--line); }

.pos-products {
  flex: 1; min-height: 0; overflow-y: auto;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); grid-auto-rows: max-content; align-content: start; gap: 12px;
  padding: 2px;
}
.pos-product {
  display: flex; flex-direction: column; text-align: left;
  background: var(--panel); border-radius: 10px; overflow: hidden;
  box-shadow: var(--shadow); border: 1px solid var(--line);
  transition: transform .12s, border-color .12s;
}
.pos-product:hover { border-color: var(--orange-2); }
.pos-product:active { transform: scale(.97); }
.pos-product .media { aspect-ratio: 11 / 10; flex-shrink: 0; overflow: hidden; background: var(--navy); }
.pos-product .media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pos-product .name { padding: 8px 10px 0; font-size: 15px; font-weight: 500; line-height: 1.25; }
.pos-product .foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 6px 10px 10px; margin-top: auto; }
.pos-product strong { color: var(--orange); font-size: 16px; }
.pos-option-hint { display: block; font-size: 12px; color: var(--blue); font-weight: 400; }
.pos-product .add { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--orange); color: #fff; }
.pos-product .add .icon { width: 16px; height: 16px; stroke-width: 2.8; }
.pos-empty { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 40px; }
.pos-empty a { color: var(--blue); }

.ticket {
  display: flex; flex-direction: column; min-height: 0;
  background: var(--panel); border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow);
  padding: 16px;
}
.ticket-none { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--muted); text-align: center; }
.ticket-none .icon { width: 56px; height: 56px; opacity: .35; margin-bottom: 8px; }
.ticket-none p { font-size: 20px; font-weight: 700; color: var(--ink); }
.ticket-body { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.ticket-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--panel-2); }
.ticket-head > .icon { width: 26px; height: 26px; }
.ticket-head h2 { font-size: 22px; }
.ticket-since { flex: 1; font-size: 13px; color: var(--muted); }

.ticket-table { flex: 1; min-height: 120px; display: flex; flex-direction: column; margin-top: 10px; }
.ticket-items { overflow-y: auto; min-height: 0; flex: 1; }
.ticket-row {
  display: grid; grid-template-columns: minmax(0, 1fr) 96px 56px 66px 28px;
  align-items: center; gap: 6px;
  padding: 8px 6px; border-bottom: 1px solid var(--line);
  font-size: 15px;
}
.ticket-row-head { font-size: 14px; font-weight: 500; color: var(--muted); background: var(--panel-2); border-radius: 8px; border: 0; padding: 10px 6px; }
.ticket-row-head span:nth-child(n+3), .t-price, .t-total { text-align: right; }
.ticket-row-head span:nth-child(2) { text-align: center; }
.t-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.t-label { overflow: hidden; text-overflow: ellipsis; line-height: 1.25; }
.thumb { width: 36px; height: 36px; border-radius: 8px; overflow: hidden; flex-shrink: 0; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.t-total { font-weight: 500; }
.ticket-placeholder { text-align: center; color: var(--muted); padding: 30px 10px; font-size: 14px; }

.stepper { display: flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.stepper button { width: 32px; height: 32px; display: grid; place-items: center; background: var(--panel-2); }
.stepper button:hover { background: var(--line); }
.stepper .icon { width: 15px; height: 15px; stroke-width: 2.4; }
.stepper .qty { min-width: 36px; text-align: center; font-weight: 500; }
.icon-link { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; }
.icon-link:hover { background: var(--panel-2); }
.icon-link .icon { width: 20px; height: 20px; }
.danger { color: var(--red); }

.ticket-note { display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 14px; margin-top: 10px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); }
.ticket-note:focus-within { border-color: var(--blue); }
.ticket-note input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 15px; color: var(--ink); }
.ticket-sums { padding: 10px 4px 0; }
.ticket-sums p { display: flex; justify-content: space-between; align-items: center; padding: 4px 0; font-size: 16px; }
.ticket-sums small { color: var(--muted); font-size: 13px; }
.discount-ctrl { display: flex; gap: 8px; }
.discount-type { width: 42px; height: 38px; border: 1px solid var(--line); border-radius: 8px; font-weight: 700; background: var(--panel-2); }
.discount-ctrl input { width: 120px; height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; text-align: right; outline: 0; background: var(--panel-2); }
.discount-ctrl input:focus { border-color: var(--blue); background: #fff; }
.ticket-sums .grand { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 10px; font-size: 22px; font-weight: 700; }
.ticket-sums .grand strong { font-size: 32px; color: var(--orange); font-weight: 900; }

.pay-buttons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.pay { display: flex; align-items: center; justify-content: center; gap: 8px; height: 60px; padding: 0 6px; border-radius: 10px; color: #fff; font-size: 16px; font-weight: 700; white-space: nowrap; }
.pay .icon { width: 22px; height: 22px; }
.pay-cash { background: linear-gradient(180deg, #22b357, var(--green)); }
.pay-card { background: linear-gradient(180deg, var(--blue-2), var(--blue)); }
.pay-other { background: linear-gradient(180deg, var(--orange-2), var(--orange)); }
.ticket-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.ticket-actions .btn { font-size: 14px; padding: 0 8px; }

.open-tickets {
  display: flex; align-items: center; gap: 16px;
  padding: 12px 16px; margin: 0 16px 16px;
  background: var(--panel); border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.open-title { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 700; white-space: nowrap; }
.open-title .icon { width: 26px; height: 26px; }
.table-strip { flex: 1; display: flex; gap: 10px; overflow-x: auto; padding: 2px; scrollbar-width: thin; }
.table-strip.pulse { animation: pulse .3s 3; }
.strip-table {
  flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 4px;
  min-width: 118px; padding: 10px 14px;
  border: 1.5px solid var(--line); border-radius: 10px; background: var(--panel);
  font-size: 14px;
}
.strip-table strong { font-size: 16px; }
.strip-name { display: flex; align-items: center; gap: 4px; }
.strip-name .icon { width: 15px; height: 15px; }
.strip-table.free { background: var(--green-soft); border-color: #c9ecd5; color: var(--green-2); }
.strip-table.busy { background: var(--panel); }
.strip-table.selected { border-color: var(--orange); background: var(--orange-soft); color: var(--orange); box-shadow: 0 0 0 1px var(--orange); }
.strip-table.attention { background: var(--orange); border-color: var(--orange); color: #fff; animation: glow 1.4s infinite; }
.strip-empty { color: var(--blue); font-weight: 500; }
@keyframes glow { 50% { box-shadow: 0 0 0 5px rgba(242, 100, 25, .25); } }
@keyframes pulse { 50% { transform: translateY(-3px); } }

.modal { margin: auto; width: min(520px, calc(100% - 32px)); padding: 24px; border: 0; border-radius: 16px; }
.modal::backdrop { background: rgba(15, 24, 40, .55); }
.modal h3 { font-size: 20px; margin-bottom: 4px; }
.modal p { color: var(--muted); margin-bottom: 16px; }
.move-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; margin-bottom: 16px; }

.toast {
  position: fixed; left: 50%; bottom: 110px; transform: translateX(-50%); z-index: 100;
  padding: 14px 22px; border-radius: 12px;
  font-weight: 500; color: #fff; background: var(--navy);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
  animation: rise .2s ease;
}
.toast-ok { background: var(--green-2); }
.toast-error { background: var(--red); }
.toast-info { background: var(--orange); }
@keyframes rise { from { opacity: 0; transform: translate(-50%, 10px); } }

/* ---------- No photo, profit, credit, misc ---------- */
.no-photo { display: flex !important; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.no-photo .icon { width: 30% !important; height: 30% !important; }
.no-photo small { font-size: 12px; font-weight: 600; letter-spacing: .02em; }
.thumb .no-photo small, .thumb-cell .no-photo small, .w-product .no-photo small { display: none; }
.profit { color: var(--green-2); font-weight: 700; white-space: nowrap; }
.profit small { display: block; font-size: 12px; font-weight: 500; opacity: .8; }
.profit.is-loss { color: var(--red); }
.side-signature { margin: 10px 8px 2px; }
.login-signature { display: flex; width: fit-content; margin: 18px auto 0; }
.green { color: var(--green-2); }
.blue { color: var(--blue); }
.is-neg { color: var(--red) !important; }
.is-pos { color: var(--blue) !important; }
.plain-input { height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); outline: 0; font-size: 15px; min-width: 0; }
.plain-input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.section-title { font-size: 18px; margin: 28px 0 12px; }
.inline-flash { margin: 0 0 16px; }
.btn-big { height: 54px; padding: 0 28px; font-size: 17px; }

.ads-preview { padding: 16px; margin-bottom: 16px; }
.snow-card { display: flex; align-items: center; gap: 14px; padding: 14px 18px; margin-bottom: 20px; }
.snow-card > div { flex: 1; display: flex; flex-direction: column; }
.snow-card strong { font-size: 17px; }
.snow-emoji { font-size: 30px; }
.snow-switch {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 14px 6px 6px; border-radius: 99px;
  background: var(--panel-2); border: 1px solid var(--line); font-weight: 700; color: var(--muted);
}
.snow-switch span { width: 40px; height: 24px; border-radius: 99px; background: #cfd3da; position: relative; transition: background .2s; }
.snow-switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; }
.snow-switch.on { color: var(--blue); border-color: #bfd3fb; background: var(--blue-soft); }
.snow-switch.on span { background: var(--blue); }
.snow-switch.on span::after { transform: translateX(16px); }
.options-editor { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px 16px; margin: 4px 0 16px; }
.options-editor legend { padding: 0 6px; font-weight: 700; }
.options-editor > .muted { font-size: 13px; margin-bottom: 12px; }
.option-rows { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.option-row { display: grid; grid-template-columns: 1fr 110px 40px; gap: 8px; }
.options-summary { color: var(--blue); }
.location-editor legend { display: flex; align-items: center; gap: 6px; }
.location-editor legend .icon { width: 18px; height: 18px; color: var(--orange); }
.location-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.hint-line { font-size: 12.5px; margin: 6px 0 0 !important; }
.location-preview { width: 100%; height: 220px; margin-top: 12px; border: 1px solid var(--line); border-radius: 10px; }
.photo-upload label { position: relative; overflow: hidden; cursor: pointer; }
.photo-upload input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.staff-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.staff-card { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.staff-card.inactive { opacity: .6; }
.staff-head { display: flex; align-items: center; gap: 12px; }
.staff-head > div { flex: 1; display: flex; flex-direction: column; }
.staff-avatar { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: var(--blue-soft); color: var(--blue); font-weight: 900; font-size: 18px; }
.staff-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.staff-stats p { display: flex; flex-direction: column; padding: 10px; border-radius: 10px; background: var(--panel-2); }
.staff-stats span { font-size: 12px; color: var(--muted); }
.staff-stats strong { font-size: 17px; }
.staff-form { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: center; }
.add-tables .plain-input { flex: 1; min-width: 160px; }

.cash-form { margin-bottom: 8px; }
.cash-expected { display: flex; flex-direction: column; gap: 2px; padding: 16px; margin-bottom: 18px; border-radius: 12px; background: var(--navy); color: #fff; }
.cash-expected span { opacity: .75; }
.cash-expected strong { font-size: 32px; font-weight: 900; color: var(--orange-2); }
.cash-expected small { color: rgba(255, 255, 255, .6); }
.cash-diff { font-size: 18px; font-weight: 700; margin: -4px 0 14px; }
.cash-diff.ok { color: var(--green-2); }
.z-report { max-width: 560px; }
.z-title { justify-content: center !important; font-size: 18px; }
.z-total strong { font-size: 20px; color: var(--orange); }

.sound-toggle { display: grid; place-items: center; color: var(--green); }
.sound-toggle .icon { width: 22px; height: 22px; }
.sound-toggle.muted { color: var(--orange); animation: glow 1.6s infinite; }
.top-sound { width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 10px; flex-shrink: 0; }
.w-icon-btn.sound-toggle { color: #4ade80; }
.w-icon-btn.sound-toggle.muted { color: var(--orange-2); border-color: var(--orange-2); }

@media print {
  .sidebar, .admin-top, .page-head .head-actions, .flash { display: none !important; }
  .shell { display: block; }
  .content { padding: 0; }
}

/* ---------- Full-screen new order alert ---------- */
.alert-open { overflow: hidden; }
.order-alert {
  position: fixed; inset: 0; z-index: 1000;
  display: grid; place-items: center; padding: 16px;
  background: radial-gradient(circle at 50% 40%, var(--orange-2), var(--orange) 55%, #c94a0c);
  animation: alert-flash 1.2s ease-in-out infinite;
}
@keyframes alert-flash { 50% { filter: brightness(1.15); } }
.order-alert-card {
  width: min(640px, 100%); max-height: calc(100vh - 32px); overflow-y: auto;
  padding: 36px 36px 28px; border-radius: 28px;
  background: #fff; text-align: center;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .35);
  animation: alert-pop .35s cubic-bezier(.2, 1.4, .4, 1);
}
@keyframes alert-pop { from { transform: scale(.85); opacity: 0; } }
.order-alert-bell {
  width: 96px; height: 96px; margin: 0 auto 12px;
  display: grid; place-items: center; border-radius: 50%;
  background: var(--orange-soft); color: var(--orange);
  animation: ring 1s ease-in-out infinite;
}
.order-alert-bell .icon { width: 52px; height: 52px; stroke-width: 2.2; }
@keyframes ring { 0%, 100% { transform: rotate(0); } 15% { transform: rotate(14deg); } 30% { transform: rotate(-12deg); } 45% { transform: rotate(8deg); } 60% { transform: rotate(-4deg); } }
.order-alert-kicker { font-size: 18px; font-weight: 900; letter-spacing: .2em; text-transform: uppercase; color: var(--orange); }
.order-alert-table { font-size: clamp(48px, 9vw, 76px); font-weight: 900; line-height: 1.05; color: var(--navy); margin: 4px 0; }
.order-alert-time { color: var(--muted); font-size: 16px; }
.order-alert-items {
  list-style: none; margin: 22px 0 0; padding: 8px 20px;
  border-radius: 16px; background: var(--panel-2); text-align: left;
}
.order-alert-items li { padding: 10px 0; font-size: 24px; font-weight: 500; border-bottom: 1px solid var(--line); }
.order-alert-items li:last-child { border-bottom: 0; }
.order-alert-items strong { display: inline-block; min-width: 56px; color: var(--orange); font-weight: 900; }
.order-alert-note { margin-top: 14px; padding: 12px 16px; border-radius: 12px; background: var(--blue-soft); color: #1e40af; font-size: 20px; font-weight: 500; text-align: left; }
.order-alert-ack {
  width: 100%; height: 76px; margin-top: 24px;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  border-radius: 16px;
  background: linear-gradient(180deg, #22b357, var(--green)); color: #fff;
  font-size: 24px; font-weight: 900;
  box-shadow: 0 10px 24px rgba(22, 163, 74, .35);
}
.order-alert-ack .icon { width: 32px; height: 32px; stroke-width: 3; }
.order-alert-ack:hover { filter: brightness(1.06); }
.order-alert-more { margin-top: 14px; font-size: 17px; font-weight: 700; color: var(--orange); }

/* ---------- Responsive ---------- */
@media (max-width: 1400px) {
  .clock [data-date] { display: none; }
  .pos { grid-template-columns: 1fr 410px; }
  .ticket-row { font-size: 14px; }
  .ticket-row .thumb { display: none; }
  .pay .icon { display: none; }
}

@media (max-width: 1100px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; width: 260px; transform: translateX(-100%); transition: transform .25s; }
  .menu-open .sidebar { transform: none; }
  .menu-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 30; }
  .menu-btn { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 10px; }
  .clock, .user span { display: none; }
  .user { padding-left: 0; border-left: 0; }
  .detail-grid, .form-grid { grid-template-columns: 1fr; }

  .page-pos .main { height: auto; min-height: 100vh; }
  .page-pos .content { overflow: visible; }
  .pos { grid-template-columns: 1fr; }
  .pos-products { max-height: 60vh; }
  .open-tickets { position: sticky; bottom: 0; margin: 0; border-radius: 0; flex-direction: column; align-items: stretch; gap: 8px; }
}

@media (max-width: 640px) {
  .admin-top { padding: 10px 12px; gap: 12px; }
  .content { padding: 16px 12px; }
  .inline-form input { min-width: 0; flex: 1; }
  .inline-form { flex: 1; }
  .table-card { flex-direction: column; }
  .qr-box { width: 140px; height: 140px; }
  .ticket-row { grid-template-columns: minmax(0, 1fr) 96px 64px 28px; }
  .ticket-row .t-price, .ticket-row-head span:nth-child(3) { display: none; }
  .pay { font-size: 15px; height: 54px; }
  .ticket-actions .btn .icon { display: none; }
}
