:root {
  color: #111723;
  background: #eef1f5;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --page: #eef1f5;
  --page-warm: #f7f3ea;
  --ink: #111723;
  --muted: rgba(17, 23, 35, .62);
  --line: rgba(17, 23, 35, .10);
  --panel: rgba(255, 255, 255, .76);
  --panel-strong: #ffffff;
  --brand: #d9ff6f;
  --brand-strong: #bff64a;
  --accent: #2763ff;
  --accent-soft: #e7efff;
  --danger: #d85749;
  --danger-soft: #ffe9e4;
  --warning: #a56a00;
  --warning-soft: #fff1dd;
  --ok: #0f8f67;
  --ok-soft: #e8f7ef;
  --shadow: 0 22px 70px rgba(17, 23, 35, .12);
  --shadow-soft: 0 12px 28px rgba(17, 23, 35, .08);
  --radius-xl: 34px;
  --radius-lg: 28px;
  --radius-md: 22px;
  --radius-sm: 18px;
  font-synthesis-weight: none;
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 14% 10%, rgba(39, 99, 255, .16), transparent 26%),
    radial-gradient(circle at 86% 8%, rgba(26, 163, 122, .12), transparent 24%),
    radial-gradient(circle at 74% 76%, rgba(217, 122, 43, .12), transparent 24%),
    linear-gradient(180deg, #f8f4ec 0%, #edf1f7 100%);
}
button, input, select, textarea { font: inherit; }
button {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 11px 17px;
  background: linear-gradient(135deg, #111723, #182235);
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 850;
  box-shadow: var(--shadow-soft);
  transition: transform .14s ease, box-shadow .14s ease, opacity .14s ease, background .14s ease;
}
button:hover { transform: translateY(-1px); box-shadow: 0 16px 34px rgba(17, 23, 35, .12); }
button:active { transform: scale(.98); transition-duration: 90ms; }
button:disabled { opacity: .52; cursor: not-allowed; transform: none; box-shadow: none; }
button.secondary {
  background: rgba(255, 255, 255, .72);
  color: var(--ink);
  border-color: rgba(17, 23, 35, .10);
  backdrop-filter: blur(12px) saturate(160%);
}
button.danger {
  background: var(--danger-soft);
  color: #b63125;
  border-color: rgba(216, 87, 73, .16);
}
input, select, textarea {
  width: 100%;
  border: 1px solid rgba(17, 23, 35, .12);
  border-radius: var(--radius-sm);
  padding: 12px 13px;
  background: rgba(255, 255, 255, .82);
  color: var(--ink);
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8);
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
textarea { min-height: 104px; resize: vertical; line-height: 1.55; }
input:focus, select:focus, textarea:focus {
  border-color: rgba(39, 99, 255, .45);
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 0 0 5px rgba(39, 99, 255, .12), inset 0 1px 0 rgba(255, 255, 255, .9);
}
h1, h2, p { margin-top: 0; }
.hidden { display: none !important; }
.eyebrow {
  color: rgba(17, 23, 35, .46);
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: 12px;
  font-weight: 900;
}

.login-view {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 430px;
  gap: 36px;
  align-items: center;
  width: min(1160px, calc(100vw - 48px));
  margin: 0 auto;
  padding: 48px 0;
}
.login-hero {
  padding: 34px;
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 18% 18%, rgba(39, 99, 255, .11), transparent 28%),
    radial-gradient(circle at 88% 20%, rgba(217, 122, 43, .10), transparent 24%),
    linear-gradient(180deg, rgba(255, 255, 255, .62), rgba(255, 255, 255, .32));
  border: 1px solid rgba(255, 255, 255, .70);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px) saturate(170%);
}
.login-hero h1 {
  margin: 12px 0 18px;
  font-size: clamp(48px, 7vw, 86px);
  line-height: .92;
  letter-spacing: -.08em;
  max-width: 8ch;
}
.login-hero p { max-width: 620px; color: var(--muted); font-size: 18px; line-height: 1.75; }
.login-card {
  display: grid;
  gap: 16px;
  padding: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .88), rgba(255, 255, 255, .70));
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px) saturate(170%);
}
.login-card h2 { margin-bottom: 6px; font-size: 27px; letter-spacing: -.05em; }
.login-card p { color: var(--muted); margin-bottom: 0; line-height: 1.6; }
.advanced-field { opacity: .72; }

.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  gap: 20px;
  padding: 24px;
}
.sidebar {
  position: sticky;
  top: 24px;
  height: calc(100vh - 48px);
  padding: 22px;
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 22% 14%, rgba(39, 99, 255, .12), transparent 24%),
    linear-gradient(180deg, rgba(18, 24, 33, .97), rgba(10, 14, 20, .98));
  color: #f6f8fb;
  box-shadow: 0 28px 80px rgba(9, 16, 28, .22);
}
.brand { display: flex; gap: 12px; align-items: center; padding: 0 0 24px; }
.brand-mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: linear-gradient(135deg, #d9ff6f, #95d4ff);
  color: var(--ink);
  font-size: 25px;
  font-weight: 1000;
  box-shadow: 0 12px 28px rgba(217, 255, 111, .18);
}
.brand strong { display: block; font-size: 19px; letter-spacing: -.04em; }
.brand small { display: block; margin-top: 4px; color: rgba(246, 248, 251, .62); font-size: 13px; }
.nav { display: grid; gap: 8px; }
.tab {
  width: 100%;
  text-align: left;
  background: transparent;
  color: rgba(246, 248, 251, .78);
  border-radius: 18px;
  padding: 13px 14px;
  box-shadow: none;
  border-color: transparent;
}
.tab:hover { background: rgba(255, 255, 255, .06); transform: translateY(0); box-shadow: none; }
.tab.active {
  background: var(--brand);
  color: var(--ink);
  border-color: var(--brand);
  box-shadow: 0 10px 26px rgba(217, 255, 111, .18);
}

.workspace { min-width: 0; padding: 8px 2px 0; }
.topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.topbar h1 { margin: 6px 0 0; font-size: clamp(36px, 4vw, 58px); line-height: .92; letter-spacing: -.08em; }
.top-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 10px; }
.user-pill, .busy {
  padding: 11px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .68);
  border: 1px solid rgba(17, 23, 35, .10);
  color: var(--muted);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(12px) saturate(160%);
}
.user-pill strong { color: var(--ink); }
.busy { color: var(--warning); }
.message {
  margin: 0 0 18px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(17, 23, 35, .10);
  background: rgba(255, 255, 255, .78);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(16px) saturate(160%);
}
.message.success { border-color: rgba(15, 143, 103, .20); color: var(--ok); background: rgba(232, 247, 239, .86); }
.message.error { border-color: rgba(216, 87, 73, .20); color: var(--danger); background: rgba(255, 233, 228, .86); }

.tab-panel { display: none; }
.tab-panel.active { display: block; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.section-head h2 { margin-bottom: 6px; font-size: 28px; letter-spacing: -.05em; }
.section-head p { margin-bottom: 0; color: var(--muted); line-height: 1.6; }
.compact { min-width: 220px; }

.dashboard-grid { gap: 18px; }
.tab-panel.active.dashboard-grid { display: grid; }
.dashboard-hero {
  display: grid;
  grid-template-columns: 1.18fr .82fr;
  gap: 18px;
  align-items: stretch;
}
.dashboard-summary {
  padding: 24px;
  min-height: 300px;
  display: grid;
  gap: 18px;
  background:
    radial-gradient(circle at 18% 20%, rgba(39,99,255,.10), transparent 24%),
    radial-gradient(circle at 84% 18%, rgba(217,122,43,.10), transparent 22%),
    linear-gradient(180deg, rgba(255,255,255,.86), rgba(255,255,255,.66));
}
.dashboard-summary-head { display: grid; gap: 12px; }
.dashboard-summary-head h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1;
  letter-spacing: -.08em;
}
.dashboard-summary-head p { margin: 0; max-width: 48ch; color: var(--muted); font-size: 15px; line-height: 1.7; }
.dashboard-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; align-self: end; }
.dashboard-stats .stat {
  min-height: 118px;
  padding: 16px;
  border-radius: 24px;
  background: rgba(255,255,255,.75);
  border: 1px solid rgba(17,23,35,.08);
  display: grid;
  align-content: space-between;
}
.dashboard-stats .stat span { font-size: 12px; letter-spacing: .08em; color: rgba(17,23,35,.50); }
.dashboard-stats .stat strong { font-size: 32px; line-height: 1; letter-spacing: -.08em; }
.dashboard-stats .stat.orders {
  background: linear-gradient(180deg, rgba(18,24,33,.98), rgba(25,31,43,.97));
  color: #f8fafc;
  border-color: rgba(255,255,255,.05);
}
.dashboard-stats .stat.orders span, .dashboard-stats .stat.orders em { color: rgba(248,250,252,.68); }
.dashboard-signal {
  min-height: 300px;
  padding: 20px;
  display: grid;
  gap: 14px;
}
.dashboard-signal-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.dashboard-signal-head h2 { margin: 0; font-size: 18px; letter-spacing: -.04em; }
.dashboard-notes { display: grid; gap: 10px; }
.signal-item {
  padding: 13px 0;
  border-top: 1px solid rgba(17,23,35,.08);
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.signal-item:first-child { border-top: 0; padding-top: 0; }
.signal-icon {
  width: 34px;
  height: 34px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: #eef4f1;
  flex: 0 0 auto;
  font-size: 15px;
  font-weight: 900;
}
.signal-item strong { display: block; margin-bottom: 3px; font-size: 14px; }
.signal-item p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.dashboard-lower {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 18px;
  align-items: start;
}
.dashboard-orders-panel, .dashboard-feed-panel { padding: 22px; }
.dashboard-feed { display: grid; gap: 12px; }
.dashboard-table-head {
  display: grid;
  grid-template-columns: 1.15fr .72fr .62fr .78fr auto;
  gap: 12px;
  padding: 0 14px 4px;
  color: rgba(17,23,35,.48);
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: 11px;
}
.dashboard-table {
  display: grid;
  gap: 10px;
}
.dashboard-table-row {
  display: grid;
  grid-template-columns: 1.15fr .72fr .62fr .78fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px 14px;
  border-radius: 20px;
  background: rgba(255,255,255,.76);
  border: 1px solid rgba(17,23,35,.08);
  font-size: 14px;
}
.dashboard-table-row .order-title { display: grid; gap: 4px; }
.dashboard-table-row .order-title strong { font-size: 15px; }
.dashboard-order-items { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-start; }
.dashboard-order-items span {
  display: inline-flex;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(238,244,241,.92);
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
}
.dashboard-table-row .badge { justify-self: start; }
.dashboard-order-row {
  display: grid;
  grid-template-columns: 1.15fr .95fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px 14px;
  border-radius: 20px;
  background: rgba(255,255,255,.76);
  border: 1px solid rgba(17,23,35,.08);
  font-size: 14px;
}
.dashboard-order-status { justify-self: end; }
.dashboard-order-items { display: flex; flex-wrap: wrap; gap: 8px; }
.dashboard-order-items span {
  display: inline-flex;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(238,244,241,.92);
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
}
.panel, .row, .stat, .empty {
  background: linear-gradient(180deg, rgba(255, 255, 255, .82), rgba(255, 255, 255, .62));
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px) saturate(170%);
}
.menu-toolbar { display: grid; gap: 14px; padding: 18px; margin-bottom: 16px; }
.filters { display: grid; grid-template-columns: minmax(220px, 1.5fr) repeat(4, minmax(130px, 1fr)); gap: 12px; align-items: end; }
.toolbar-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.filter-result { color: var(--muted); font-size: 13px; font-weight: 850; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(185px, 1fr)); gap: 16px; }
.stat { min-height: 122px; padding: 20px; position: relative; overflow: hidden; }
.stat.clickable { cursor: pointer; transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease; }
.stat.clickable:hover { transform: translateY(-3px); border-color: rgba(39, 99, 255, .20); box-shadow: var(--shadow); }
.stat::after {
  content: "";
  position: absolute;
  right: -28px;
  bottom: -32px;
  width: 106px;
  height: 106px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(39, 99, 255, .12), transparent 68%);
}
.stat.orders { background: linear-gradient(180deg, rgba(18, 24, 33, .98), rgba(25, 31, 43, .96)); color: #f8fafc; }
.stat.orders span, .stat.orders::after { color: rgba(248, 250, 252, .68); }
.stat.people::after { background: radial-gradient(circle, rgba(26, 163, 122, .14), transparent 68%); }
.stat.pending::after { background: radial-gradient(circle, rgba(217, 122, 43, .16), transparent 68%); }
.stat.popular::after { background: radial-gradient(circle, rgba(217, 255, 111, .26), transparent 68%); }
.stat span { display: block; color: var(--muted); margin-bottom: 12px; font-size: 12px; font-weight: 900; letter-spacing: .02em; }
.stat strong { display: block; font-size: 32px; line-height: 1.12; letter-spacing: -.05em; }
.stat.popular strong { font-size: 18px; line-height: 1.45; }

.form-grid { display: grid; gap: 14px; padding: 18px; margin-bottom: 16px; align-items: end; }
.category-form { grid-template-columns: minmax(220px, 1fr) 130px 110px auto; }
.menu-form { grid-template-columns: repeat(4, minmax(150px, 1fr)); }
.account-form { grid-template-columns: repeat(2, minmax(180px, 1fr)); }
.field { display: grid; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 850; }
.field.wide, .form-actions.wide { grid-column: span 2; }
.field.full { grid-column: 1 / -1; }
.check { display: flex; gap: 8px; align-items: center; color: var(--ink); font-weight: 850; }
.check input { width: auto; }
.form-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.list { display: grid; gap: 12px; }
.row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 18px; align-items: center; padding: 16px; }
.menu-row { grid-template-columns: 56px minmax(0, 1fr) auto auto; }
.order-row { grid-template-columns: minmax(0, 1fr) auto auto; }
.dish-icon {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  background: rgba(238, 244, 241, .92);
  font-size: 28px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .72);
}
.row-main strong { display: block; margin-bottom: 6px; font-size: 17px; letter-spacing: -.02em; }
.row-main small, .row-main p { color: var(--muted); margin: 0 0 6px; line-height: 1.48; }
.row-meta { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; min-width: 90px; }
.actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; min-width: 220px; }
.actions select { min-width: 128px; }
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  padding: 0 11px;
  border-radius: 999px;
  background: #eef3e9;
  color: #61705a;
  font-size: 12px;
  font-weight: 900;
}
.badge.success { background: var(--ok-soft); color: var(--ok); }
.badge.warning, .badge.pending { background: var(--warning-soft); color: var(--warning); }
.badge.hot { background: #fff0e7; color: #bd4b10; }
.badge.muted { background: #eef1f5; color: #667075; }
.badge.accepted { background: var(--ok-soft); color: var(--ok); }
.badge.preparing { background: var(--accent-soft); color: #3958a6; }
.badge.completed { background: #eef3e9; color: #5d6d56; }
.badge.cancelled { background: var(--danger-soft); color: #c94235; }
.remark { color: #b25e00 !important; }
.order-items { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 6px; }
.order-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px 6px 6px;
  border-radius: 999px;
  background: rgba(238, 244, 241, .92);
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
}
.order-item-img, .order-item-fallback { width: 28px; height: 28px; border-radius: 50%; flex: 0 0 auto; }
.order-item-img { object-fit: cover; display: block; }
.order-item-fallback { display: inline-grid; place-items: center; background: var(--ink); color: var(--brand); font-size: 12px; }
.empty { padding: 32px; text-align: center; color: var(--muted); border-style: dashed; box-shadow: none; }

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  justify-content: flex-end;
  background: rgba(17, 23, 35, .34);
  backdrop-filter: blur(7px) saturate(150%);
}
.drawer {
  width: min(760px, calc(100vw - 32px));
  height: calc(100vh - 28px);
  margin: 14px 14px 14px 0;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 255, 255, .92), rgba(255, 255, 255, .80));
  border: 1px solid rgba(255, 255, 255, .70);
  box-shadow: -24px 0 80px rgba(17, 23, 35, .20);
  backdrop-filter: blur(22px) saturate(170%);
}
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 24px; border-bottom: 1px solid rgba(17, 23, 35, .08); }
.drawer-head h2 { margin: 4px 0 0; font-size: 30px; letter-spacing: -.06em; }
.drawer-body { flex: 1; overflow: auto; padding: 18px 24px 24px; margin-bottom: 0; box-shadow: none; border: 0; border-radius: 0; background: transparent; backdrop-filter: none; }
.drawer-actions { display: flex; gap: 10px; align-items: center; position: sticky; bottom: 0; padding-top: 14px; background: linear-gradient(rgba(255,255,255,.22), rgba(255,255,255,.88) 42%); }

@media (prefers-reduced-transparency: reduce) {
  .login-hero, .login-card, .panel, .row, .stat, .empty, .drawer, .message, .user-pill, .busy, input, select, textarea,
  .dashboard-chip, .dashboard-note, .dashboard-order, .dashboard-action {
    background: #fff;
    backdrop-filter: none;
  }
  .stat.orders {
    background: #111723;
    color: #f8fafc;
  }
}

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

@media (max-width: 1020px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .nav { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
  .topbar, .section-head { flex-direction: column; align-items: stretch; }
  .section-head-inline p { text-align: left; }
  .dashboard-hero, .dashboard-layout { grid-template-columns: 1fr; }

  .dashboard-table-head { display: none; }
  .dashboard-table-row { grid-template-columns: 1fr; }
  .dashboard-table-row .badge, .dashboard-order-items { justify-self: start; }
  .stats, .category-form, .menu-form, .account-form, .filters { grid-template-columns: 1fr 1fr; }
  .row, .menu-row, .order-row { grid-template-columns: 1fr; }
  .row-meta, .actions { justify-content: flex-start; min-width: 0; }
}

@media (max-width: 720px) {
  body { background-attachment: fixed; }
  .login-view { grid-template-columns: 1fr; width: min(100% - 32px, 1120px); }
  .login-hero { padding: 24px; }
  .app { padding: 16px; }
  .workspace { padding: 0; }
  .dashboard-stats, .stats, .category-form, .menu-form, .account-form, .filters, .nav { grid-template-columns: 1fr; }
  .toolbar-foot { align-items: stretch; flex-direction: column; }
  .drawer { width: calc(100vw - 20px); height: calc(100vh - 20px); margin: 10px; }
  .field.wide, .field.full, .form-actions.wide { grid-column: auto; }
}
