:root {
  --ink: #201b16;
  --muted: #74695e;
  --paper: #fffaf1;
  --cream: #efe4d3;
  --line: rgba(32, 27, 22, 0.13);
  --charcoal: #14110f;
  --charcoal-2: #201b16;
  --amber: #d89b50;
  --tomato: #b95447;
  --herb: #657f55;
  --blue: #486174;
  --warn: #a66b20;
  --danger: #993b34;
  --shadow: 0 20px 58px rgba(20, 17, 15, 0.13);
  font-family: Inter, "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
  letter-spacing: 0;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(216, 155, 80, 0.18), transparent 34%),
    linear-gradient(180deg, #14110f 0 330px, #ece2d3 330px 100%);
}

button,
input,
select {
  font: inherit;
}

button,
a,
select {
  cursor: pointer;
}

a {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

:focus-visible {
  outline: 3px solid rgba(216, 155, 80, 0.34);
  outline-offset: 3px;
}

.admin-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
}

.admin-rail {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  align-content: start;
  gap: 22px;
  padding: 22px;
  color: #fffaf1;
  background: #11100e;
  border-right: 1px solid rgba(255, 250, 241, 0.1);
}

.admin-brand {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  text-decoration: none;
}

.admin-brand span {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 8px;
  color: #21150c;
  background: var(--amber);
  font-weight: 950;
}

.admin-brand strong,
.admin-brand small {
  grid-column: 2;
}

.admin-brand strong {
  font-size: 18px;
}

.admin-brand small {
  color: rgba(255, 250, 241, 0.62);
  font-weight: 800;
}

.admin-nav {
  display: grid;
  gap: 8px;
}

.admin-nav a {
  min-height: 42px;
  display: flex;
  align-items: center;
  border-radius: 8px;
  padding: 0 12px;
  color: rgba(255, 250, 241, 0.72);
  text-decoration: none;
  font-weight: 900;
}

.admin-nav a:hover,
.admin-nav a.is-active {
  color: #fffaf1;
  background: rgba(255, 250, 241, 0.12);
}

.shop-card {
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 250, 241, 0.12);
  border-radius: 8px;
  background: rgba(255, 250, 241, 0.08);
}

.shop-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.shop-card figcaption {
  display: grid;
  gap: 5px;
  padding: 14px;
}

.shop-card span,
.eyebrow {
  color: var(--amber);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

.shop-card strong {
  font-size: 20px;
  line-height: 1.35;
}

.admin-main {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 20px;
  padding: 28px clamp(16px, 2.4vw, 30px) 42px;
}

.admin-topbar {
  min-height: 96px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  color: #fffaf1;
}

.eyebrow {
  margin: 0;
}

.admin-topbar h1,
.panel-head h2 {
  margin: 7px 0 0;
  font-size: clamp(28px, 3vw, 46px);
  line-height: 1.08;
  letter-spacing: 0;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.top-actions time,
.top-actions button,
.filter-group button,
.admin-form button,
.reservation-actions button,
.seat-control button,
.menu-card button,
.stock-actions button {
  min-height: 40px;
  border-radius: 999px;
  padding: 0 13px;
  font-weight: 950;
}

.top-actions time {
  color: rgba(255, 250, 241, 0.78);
  background: rgba(255, 250, 241, 0.1);
}

.top-actions button,
.admin-form button {
  border: 1px solid rgba(216, 155, 80, 0.74);
  color: #21150c;
  background: var(--amber);
  box-shadow: 0 14px 34px rgba(216, 155, 80, 0.2);
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.metric-strip article,
.reservations-panel,
.quick-panel,
.menu-panel,
.stock-panel,
.waitlist-panel,
.tasks-panel,
.revenue-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 241, 0.96);
  box-shadow: var(--shadow);
}

.metric-strip article {
  min-height: 112px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 18px;
}

.metric-strip span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
}

.metric-strip strong {
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1;
}

.metric-strip .accent strong {
  color: var(--tomato);
}

.metric-strip .warning strong {
  color: var(--warn);
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(560px, 1fr) minmax(300px, 390px);
  gap: 20px;
  align-items: start;
}

.revenue-panel {
  display: grid;
  gap: 16px;
}

.revenue-chart {
  min-height: 280px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(216, 155, 80, 0.1), transparent 48%),
    #fffdf8;
}

.revenue-chart svg {
  display: block;
  width: 100%;
  height: 280px;
}

.chart-grid {
  stroke: rgba(32, 27, 22, 0.1);
  stroke-width: 1;
}

.chart-area {
  fill: rgba(216, 155, 80, 0.14);
}

.chart-line-revenue,
.chart-line-profit {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-line-revenue {
  stroke: var(--amber);
}

.chart-line-profit {
  stroke: var(--tomato);
}

.chart-point-revenue,
.chart-point-profit {
  stroke: #fffaf1;
  stroke-width: 3;
}

.chart-point-revenue {
  fill: var(--amber);
}

.chart-point-profit {
  fill: var(--tomato);
}

.chart-label {
  fill: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.chart-value {
  fill: var(--ink);
  font-size: 12px;
  font-weight: 950;
}

.revenue-summary {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr;
  gap: 10px 14px;
  align-items: center;
}

.revenue-summary span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 900;
}

.revenue-summary i {
  display: inline-block;
  width: 26px;
  height: 4px;
  border-radius: 999px;
  background: var(--amber);
}

.legend-profit i {
  background: var(--tomato);
}

.revenue-summary strong {
  font-size: clamp(22px, 2.4vw, 34px);
  line-height: 1;
}

.revenue-summary [data-chart-total] {
  color: var(--amber);
}

.revenue-summary [data-chart-profit] {
  color: var(--tomato);
}

.reservations-panel,
.quick-panel,
.menu-panel,
.stock-panel,
.waitlist-panel,
.tasks-panel,
.revenue-panel {
  min-width: 0;
  padding: 18px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.reservations-panel .panel-head {
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
}

.panel-head.compact {
  margin-bottom: 14px;
}

.panel-head h2 {
  color: var(--ink);
  font-size: clamp(24px, 2.4vw, 34px);
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-group button,
.reservation-actions button,
.seat-control button,
.menu-card button,
.stock-actions button {
  border: 1px solid var(--line);
  color: var(--ink);
  background: #fffaf0;
}

.filter-group button:hover,
.filter-group button.is-active {
  color: #21150c;
  border-color: rgba(216, 155, 80, 0.74);
  background: var(--amber);
  box-shadow: 0 12px 28px rgba(216, 155, 80, 0.18);
}

.reservation-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.reservation-row {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fffdf8;
}

.reservation-row time {
  color: var(--tomato);
  font-size: 20px;
  font-weight: 950;
}

.reservation-main {
  min-width: 0;
}

.reservation-main strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 18px;
}

.reservation-main span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.status-badge {
  justify-self: end;
  min-width: 74px;
  border-radius: 8px;
  padding: 7px 9px;
  color: #fffaf1;
  background: var(--blue);
  font-size: 12px;
  font-style: normal;
  font-weight: 950;
  text-align: center;
}

.status-badge.is-pending {
  background: var(--warn);
}

.status-badge.is-confirmed {
  background: var(--blue);
}

.status-badge.is-seated {
  background: var(--herb);
}

.status-badge.is-done {
  background: var(--muted);
}

.reservation-actions {
  grid-column: 2 / -1;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 8px;
}

.reservation-actions [data-action="confirm"] {
  color: #21150c;
  border-color: rgba(216, 155, 80, 0.74);
  background: var(--amber);
}

.reservation-actions [data-action="seat"] {
  color: #21150c;
  border-color: rgba(216, 155, 80, 0.74);
  background: var(--amber);
}

.reservation-actions [data-action="done"] {
  color: #21150c;
  border-color: rgba(216, 155, 80, 0.74);
  background: var(--amber);
}

.admin-form {
  display: grid;
  gap: 12px;
}

.admin-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.admin-form input,
.admin-form select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: #fffdf8;
  font-weight: 850;
}

.admin-form button {
  min-height: 46px;
  margin-top: 4px;
}

.seat-panel {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.seat-control {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  gap: 8px;
  align-items: center;
}

.seat-control strong {
  display: grid;
  min-height: 52px;
  place-items: center;
  border-radius: 8px;
  color: var(--tomato);
  background: #f7eadf;
  font-size: 32px;
}

.seat-control button {
  padding: 0;
  color: #21150c;
  border-color: rgba(216, 155, 80, 0.74);
  background: var(--amber);
}

.seat-panel p,
.admin-feedback {
  color: var(--muted);
  line-height: 1.6;
}

.admin-feedback {
  min-height: 42px;
  display: flex;
  align-items: center;
  margin: 14px 0 0;
  border-radius: 8px;
  padding: 0 12px;
  background: #f4eadb;
  font-size: 14px;
  font-weight: 850;
}

.lower-grid {
  display: grid;
  grid-template-columns: minmax(560px, 1fr) minmax(300px, 420px);
  gap: 20px;
}

.ops-grid {
  display: grid;
  grid-template-columns: minmax(360px, 0.86fr) minmax(420px, 1fr);
  gap: 20px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border-radius: 999px;
  padding: 0 12px;
  color: #fffaf1;
  background: var(--charcoal-2);
  font-size: 13px;
  font-weight: 950;
}

.pill.muted {
  color: var(--charcoal-2);
  background: #f4eadb;
}

.menu-admin-grid,
.stock-list,
.waitlist,
.task-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.menu-admin-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.menu-card,
.stock-row,
.waitlist-row,
.task-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fffdf8;
}

.menu-card {
  display: grid;
  gap: 12px;
}

.menu-card header,
.stock-row header,
.waitlist-row header,
.task-row header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.menu-card strong,
.stock-row strong,
.waitlist-row strong,
.task-row strong {
  font-size: 18px;
}

.menu-card small,
.stock-row small,
.waitlist-row small,
.task-row small {
  color: var(--muted);
  font-weight: 850;
}

.menu-card.is-soldout {
  opacity: 0.58;
}

.menu-card button {
  justify-self: start;
}

.menu-card.is-soldout button {
  color: #21150c;
  border-color: rgba(216, 155, 80, 0.74);
  background: var(--amber);
}

.waitlist-row,
.task-row {
  display: grid;
  gap: 10px;
}

.waitlist-row p,
.task-row p {
  margin: 0;
  color: var(--muted);
  line-height: 1.58;
}

.waitlist-actions,
.task-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.waitlist-actions button,
.task-actions button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 10px;
  color: var(--ink);
  background: #fffaf0;
  font-weight: 950;
}

.waitlist-actions [data-waitlist-action="seat"],
.task-actions [data-task-action="done"] {
  color: #21150c;
  border-color: rgba(216, 155, 80, 0.74);
  background: var(--amber);
}

.task-row.is-done {
  opacity: 0.58;
}

.prep-alert {
  display: flex;
  align-items: center;
  min-height: 46px;
  margin-top: 18px;
  border: 1px solid rgba(166, 107, 32, 0.26);
  border-radius: 8px;
  padding: 10px 12px;
  color: #754713;
  background: #fff4dc;
  font-weight: 900;
  line-height: 1.5;
}

.prep-alert.is-clear {
  color: var(--herb);
  border-color: rgba(101, 127, 85, 0.2);
  background: #eef3e9;
}

.stock-row.is-low {
  border-color: rgba(185, 84, 71, 0.32);
  background: #fff8f7;
}

.stock-status {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 9px;
  color: var(--herb);
  background: #eef3e9;
  font-size: 12px;
  font-weight: 950;
}

.stock-row.is-low .stock-status {
  color: #fffaf1;
  background: var(--tomato);
}

.stock-meter {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #ebe0d0;
}

.stock-meter i {
  display: block;
  width: var(--stock);
  height: 100%;
  border-radius: inherit;
  background: var(--herb);
}

.stock-row.is-low .stock-meter i {
  background: var(--tomato);
}

.stock-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

button:hover:not(:disabled) {
  transform: translateY(-2px);
}

button {
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

@media (max-width: 1180px) {
  .admin-shell {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .admin-grid,
  .lower-grid,
  .ops-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  body {
    background:
      linear-gradient(180deg, #14110f 0 430px, #ece2d3 430px 100%);
  }

  .admin-shell {
    display: block;
  }

  .admin-rail {
    position: static;
    height: auto;
    padding: 16px;
  }

  .admin-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .admin-nav a {
    justify-content: center;
    text-align: center;
  }

  .shop-card {
    display: none;
  }

  .admin-main {
    padding: 18px 14px 34px;
  }

  .admin-topbar,
  .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-actions,
  .filter-group {
    width: 100%;
  }

  .top-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .metric-strip,
  .menu-admin-grid {
    grid-template-columns: 1fr;
  }

  .revenue-summary {
    grid-template-columns: 1fr auto;
  }

  .reservation-row {
    grid-template-columns: 70px minmax(0, 1fr);
  }

  .status-badge,
  .reservation-actions {
    grid-column: 1 / -1;
  }

  .reservation-actions {
    justify-content: stretch;
  }

  .reservation-actions button {
    flex: 1 1 0;
  }
}

@media (max-width: 560px) {
  .admin-nav,
  .filter-group,
  .form-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-group {
    display: grid;
  }

  .top-actions {
    grid-template-columns: 1fr;
  }

  .revenue-chart,
  .revenue-chart svg {
    min-height: 240px;
    height: 240px;
  }
}
