:root {
  color-scheme: light;
  --bg: #fff7ed;
  --card: #ffffff;
  --ink: #2f1b0c;
  --muted: #8a5a37;
  --brand: #ea580c;
  --brand-dark: #c2410c;
  --brand-soft: #ffedd5;
  --line: #fed7aa;
  --shadow: 0 18px 45px rgba(120, 53, 15, 0.14);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  margin: 0;
  padding-bottom: 104px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(251, 146, 60, 0.28), transparent 32rem),
    linear-gradient(180deg, #fff7ed 0%, #fffbeb 48%, #fff7ed 100%);
}

button {
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

a {
  color: inherit;
  text-decoration: none;
}

.page-shell {
  width: min(720px, 100%);
  margin: 0 auto;
  padding: 16px 14px 24px;
}

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding: 22px;
  border-radius: 28px;
  background: linear-gradient(135deg, #9a3412 0%, #ea580c 58%, #fb923c 100%);
  color: white;
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}

.hero::after {
  content: "";
  position: absolute;
  right: -44px;
  top: -44px;
  width: 150px;
  height: 150px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
}

.eyebrow {
  margin: 0 0 8px;
  opacity: 0.82;
  font-size: 13px;
  letter-spacing: 0.14em;
}

.hero h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.hero-subtitle {
  margin: 10px 0 0;
  opacity: 0.9;
  font-size: 14px;
}

.table-badge {
  position: relative;
  z-index: 1;
  min-width: 92px;
  height: 92px;
  border-radius: 24px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.94);
  color: var(--brand-dark);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}

.table-badge span {
  display: block;
  font-size: 38px;
  line-height: 0.85;
  font-weight: 900;
}

.table-badge small {
  font-size: 15px;
  font-weight: 800;
}

.panel {
  margin-top: 14px;
  padding: 16px;
  border: 1px solid rgba(254, 215, 170, 0.9);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 10px 26px rgba(120, 53, 15, 0.08);
  backdrop-filter: blur(10px);
}

.home-shell {
  padding-top: 22px;
}

.home-hero {
  min-height: 170px;
}

.table-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.table-link {
  min-height: 118px;
  display: grid;
  place-items: center;
  gap: 6px;
  border-radius: 20px;
  background: linear-gradient(135deg, #fff7ed, #ffedd5);
  border: 1px solid var(--line);
  box-shadow: 0 8px 20px rgba(120, 53, 15, 0.08);
}

.table-link strong {
  display: block;
  color: var(--brand-dark);
  font-size: 42px;
  line-height: 0.9;
}

.table-link span {
  color: var(--muted);
  font-weight: 900;
}

.note-panel h2 {
  margin: 0 0 10px;
  font-size: 18px;
}

.note-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.note-panel code {
  padding: 2px 6px;
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.recent-orders {
  display: grid;
  gap: 10px;
}

.empty-state {
  padding: 14px;
  border-radius: 16px;
  background: #fff7ed;
  color: var(--muted);
  line-height: 1.6;
}

.recent-order-card {
  padding: 13px;
  border: 1px solid #ffedd5;
  border-radius: 18px;
  background: white;
}

.recent-order-head,
.recent-order-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.recent-order-head span,
.recent-order-items {
  color: var(--muted);
  font-size: 13px;
}

.recent-order-items {
  margin: 8px 0;
  line-height: 1.5;
}

.mini-status {
  display: inline-block;
  margin-left: 5px;
  padding: 3px 7px;
  border-radius: 999px;
  background: #64748b;
  color: white;
  font-size: 11px;
  font-weight: 800;
}

.mini-status.paid,
.mini-status.printed {
  background: #16a34a;
}

.mini-status.unpaid,
.mini-status.pending,
.mini-status.printing {
  background: #f59e0b;
}

.mini-status.print_failed,
.mini-status.closed {
  background: #dc2626;
}

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-title h2 {
  margin: 0;
  font-size: 20px;
}

.section-title span,
.muted {
  color: var(--muted);
  font-size: 13px;
}

.flavor-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.flavor-btn {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 13px 8px;
  background: white;
  color: var(--ink);
  font-weight: 800;
}

.flavor-btn.active {
  border-color: var(--brand);
  color: white;
  background: linear-gradient(135deg, var(--brand), #f97316);
  box-shadow: 0 8px 18px rgba(234, 88, 12, 0.25);
}

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

.category-title {
  margin: 10px 2px 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.dish-card {
  display: grid;
  gap: 12px;
  padding: 15px;
  border: 1px solid #ffedd5;
  border-radius: 18px;
  background: #fff;
}

.dish-main-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
}

.dish-flavors {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}

.dish-flavor-btn {
  padding: 10px 6px;
  border-radius: 14px;
  font-size: 14px;
}

.dish-name {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 900;
}

.dish-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.price {
  color: var(--brand-dark);
  font-size: 18px;
  font-weight: 900;
}

.tag {
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.qty-control {
  display: grid;
  grid-template-columns: 38px 34px 38px;
  align-items: center;
  gap: 4px;
}

.qty-control button {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 14px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 22px;
  font-weight: 900;
}

.qty-control button.plus {
  background: var(--brand);
  color: white;
}

.qty-control button:disabled {
  opacity: 0.45;
}

.qty {
  text-align: center;
  font-size: 18px;
  font-weight: 900;
}

.checkout-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 12px max(14px, env(safe-area-inset-left)) calc(12px + env(safe-area-inset-bottom));
  background: rgba(255, 247, 237, 0.92);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.checkout-bar > div,
.checkout-bar button {
  width: min(350px, calc(50% - 6px));
}

.checkout-bar > div {
  padding: 10px 14px;
  border-radius: 18px;
  background: white;
  box-shadow: 0 8px 24px rgba(120, 53, 15, 0.08);
}

.checkout-bar strong {
  display: block;
  margin-top: 2px;
  color: var(--brand-dark);
  font-size: 24px;
  line-height: 1;
}

.checkout-bar button {
  border: 0;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--brand), #f97316);
  color: white;
  font-size: 17px;
  font-weight: 900;
  box-shadow: 0 12px 24px rgba(234, 88, 12, 0.28);
}

.checkout-bar button:disabled {
  background: #d6d3d1;
  box-shadow: none;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 112px;
  z-index: 20;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 12px 16px;
  border-radius: 999px;
  background: rgba(47, 27, 12, 0.92);
  color: white;
  font-weight: 800;
  box-shadow: var(--shadow);
}

.success-mask {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(47, 27, 12, 0.48);
  backdrop-filter: blur(8px);
}

.success-card {
  width: min(360px, 100%);
  padding: 28px 22px 22px;
  border-radius: 28px;
  background: white;
  text-align: center;
  box-shadow: var(--shadow);
}

.success-icon {
  width: 66px;
  height: 66px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #dcfce7;
  color: #16a34a;
  font-size: 36px;
  font-weight: 900;
}

.wechat-icon {
  background: #dcfce7;
  color: #16a34a;
}

.success-card h2 {
  margin: 0 0 8px;
}

.success-card p {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.6;
}

.success-card button {
  width: 100%;
  border: 0;
  border-radius: 16px;
  padding: 13px;
  background: var(--brand);
  color: white;
  font-weight: 900;
}

.success-card button + button {
  margin-top: 10px;
}

.success-card .secondary-btn {
  background: #ffedd5;
  color: var(--brand-dark);
}

.admin-body {
  padding-bottom: 0;
}

.admin-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 18px 14px 32px;
}

.admin-super-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  padding: 14px;
  border: 2px solid rgba(234, 88, 12, 0.28);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 16px 36px rgba(120, 53, 15, 0.16);
  backdrop-filter: blur(18px);
}

.admin-super-nav-title {
  display: grid;
  gap: 4px;
  min-width: 150px;
}

.admin-super-nav-title strong {
  color: var(--brand-dark);
  font-size: 20px;
  line-height: 1;
}

.admin-super-nav-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.admin-super-nav-links {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.admin-super-nav-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff7ed;
  color: var(--brand-dark);
  font-size: 16px;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(120, 53, 15, 0.08);
}

.admin-super-nav-links a.active {
  border-color: transparent;
  background: linear-gradient(135deg, var(--brand), #f97316);
  color: white;
  box-shadow: 0 12px 24px rgba(234, 88, 12, 0.28);
}

.admin-hero {
  margin-bottom: 16px;
  padding: 24px;
  border-radius: 28px;
  background: linear-gradient(135deg, #9a3412 0%, #ea580c 58%, #fb923c 100%);
  color: white;
  box-shadow: var(--shadow);
}

.admin-hero h1,
.admin-hero p {
  margin: 0;
}

.admin-hero p:last-child {
  margin-top: 8px;
  opacity: 0.9;
}

.admin-hero a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.admin-home-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.admin-home-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 20px;
  border: 1px solid rgba(254, 215, 170, 0.9);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 26px rgba(120, 53, 15, 0.08);
}

.admin-home-card h2,
.admin-home-card p {
  margin: 0;
}

.admin-home-card p {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.6;
}

.admin-home-card > span {
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-weight: 900;
}

.admin-home-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: linear-gradient(135deg, #ffedd5, #fff7ed);
  font-size: 28px;
}

.admin-panel {
  margin-top: 14px;
  padding: 16px;
  border: 1px solid rgba(254, 215, 170, 0.9);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 10px 26px rgba(120, 53, 15, 0.08);
}

.admin-section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.admin-section-title h2 {
  margin: 0;
}

.admin-section-title span {
  color: var(--muted);
  font-size: 13px;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 10px;
  align-items: end;
}

.filter-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.filter-grid input,
.filter-grid select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: white;
  color: var(--ink);
  font: inherit;
}

.filter-grid button,
.quick-row button,
.admin-table button {
  border: 0;
  border-radius: 12px;
  padding: 11px 14px;
  background: var(--brand);
  color: white;
  font-weight: 900;
}

.quick-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.quick-row button {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.filter-grid input:focus-visible,
.filter-grid select:focus-visible,
.inline-form input:focus-visible,
.expense-form input:focus-visible,
.expense-form select:focus-visible {
  outline: 3px solid rgba(234, 88, 12, 0.22);
  border-color: var(--brand);
}

.filter-grid button:disabled,
.inline-form button:disabled,
.expense-form button:disabled,
.admin-table button:disabled {
  background: #d6d3d1;
  color: #78716c;
  box-shadow: none;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 14px;
}

.kpi-card {
  padding: 16px;
  border-radius: 20px;
  background: white;
  border: 1px solid #ffedd5;
  box-shadow: 0 8px 20px rgba(120, 53, 15, 0.08);
}

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

.kpi-card strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
  color: var(--brand-dark);
}

.analytics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.bar-list {
  display: grid;
  gap: 12px;
}

.bar-row {
  display: grid;
  gap: 7px;
}

.bar-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}

.bar-label span {
  color: var(--muted);
}

.bar-track {
  height: 12px;
  border-radius: 999px;
  background: #ffedd5;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #ea580c, #fb923c);
}

.hour-bars-wrap {
  overflow-x: auto;
  padding-bottom: 4px;
}

.hour-bars {
  min-width: 620px;
  height: 230px;
  display: grid;
  grid-template-columns: repeat(24, 1fr);
  gap: 5px;
  align-items: end;
  padding-top: 10px;
}

.hour-bar {
  height: 100%;
  display: grid;
  grid-template-rows: 1fr auto;
  align-items: end;
  gap: 6px;
}

.hour-bar span {
  display: block;
  min-height: 4px;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, #fb923c, #ea580c);
}

.hour-bar small {
  min-height: 14px;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

.hour-table {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  margin-top: 12px;
}

.hour-table div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 10px;
  background: #fff7ed;
  color: var(--muted);
  font-size: 12px;
}

.hour-table strong {
  color: var(--ink);
}

.admin-table-wrap {
  overflow-x: auto;
}

.order-history-panel .admin-table-wrap {
  max-height: 560px;
  overflow: auto;
  border: 1px solid #ffedd5;
  border-radius: 16px;
  background: white;
}

.order-history-panel .admin-table th {
  position: sticky;
  top: 0;
  z-index: 4;
}

.admin-table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.admin-table th {
  background: #ffedd5;
}

.empty-cell {
  color: var(--muted);
  text-align: center !important;
}

.expense-panel {
  margin-top: 18px;
}

.expense-total-card {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 8px;
  margin: 4px 0 16px;
  padding: 22px;
  border-radius: 24px;
  background: linear-gradient(135deg, #9a3412 0%, #ea580c 58%, #fb923c 100%);
  color: white;
  box-shadow: 0 16px 34px rgba(234, 88, 12, 0.24);
}

.expense-total-card::after {
  content: "";
  position: absolute;
  right: -38px;
  top: -46px;
  width: 130px;
  height: 130px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.17);
}

.expense-total-card span,
.expense-total-card strong,
.expense-total-card em {
  position: relative;
  z-index: 1;
}

.expense-total-card span {
  opacity: 0.9;
  font-size: 15px;
  font-weight: 900;
}

.expense-total-card strong {
  font-size: clamp(38px, 9vw, 58px);
  line-height: 1;
  letter-spacing: -0.04em;
}

.expense-total-card em {
  width: max-content;
  max-width: 100%;
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  font-style: normal;
  font-weight: 900;
}

.expense-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 14px;
}

.expense-card {
  padding: 14px;
  border: 1px solid #ffedd5;
  border-radius: 18px;
  background: white;
}

.expense-entry-card {
  grid-column: span 1;
}

.expense-category-card {
  align-self: start;
}

.expense-card h3,
.expense-query-title h3 {
  margin: 0 0 12px;
}

.expense-category-manager {
  border-radius: 16px;
  background: #fff7ed;
}

.expense-category-manager summary {
  cursor: pointer;
  padding: 10px 12px;
  color: var(--brand-dark);
  font-size: 14px;
  font-weight: 900;
  list-style-position: inside;
}

.expense-category-manager[open] {
  padding: 0 10px 10px;
}

.expense-category-manager[open] summary {
  margin: 0 -10px 10px;
}

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

.expense-form {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  align-items: end;
}

.inline-form input,
.expense-form input,
.expense-form select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: white;
  color: var(--ink);
  font: inherit;
}

.expense-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.inline-form button,
.expense-form button,
.expense-filter-grid button {
  border: 0;
  border-radius: 12px;
  padding: 11px 14px;
  background: var(--brand);
  color: white;
  font-weight: 900;
}

.expense-form-actions,
.expense-row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.expense-form-actions button {
  flex: 1 1 120px;
}

.expense-row-actions button {
  min-height: 38px;
  padding: 8px 11px;
  border: 0;
  border-radius: 10px;
  font-weight: 900;
}

.secondary-btn,
.admin-table button.secondary-btn {
  background: #ffedd5;
  color: var(--brand-dark);
  box-shadow: none;
}

.danger-btn,
.admin-table button.danger-btn {
  background: #fee2e2;
  color: #b91c1c;
  box-shadow: none;
}

.expense-category-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.expense-category-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.expense-category-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 9px;
  border: 1px solid #ffedd5;
  border-radius: 14px;
  background: #fff7ed;
}

.expense-category-item span {
  min-width: 0;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.expense-category-item button {
  border: 0;
  border-radius: 10px;
  min-height: 38px;
  padding: 8px 12px;
  font-weight: 900;
}

.expense-query-title {
  margin-top: 18px;
}

.expense-records-section {
  margin-top: 16px;
}

.expense-records-section .admin-table-wrap {
  max-height: 520px;
  overflow: auto;
  border: 1px solid #ffedd5;
  border-radius: 16px;
  background: white;
}

.expense-records-section .admin-table th {
  position: sticky;
  top: 0;
  z-index: 2;
}

.expense-records-section .admin-section-title,
.expense-chart-card .admin-section-title {
  margin-bottom: 10px;
}

.expense-chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.expense-chart-card {
  padding: 14px;
  border: 1px solid #ffedd5;
  border-radius: 18px;
  background: white;
}

.money-cell {
  text-align: right !important;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.expense-fill {
  background: linear-gradient(90deg, #1baf7a, #86b6ef);
}

.expense-table {
  min-width: 680px;
}

.err {
  max-width: 260px;
  color: #b91c1c;
  font-size: 12px;
  margin-top: 6px;
  word-break: break-all;
}

@media (max-width: 900px) {
  .admin-body {
    padding-bottom: calc(104px + env(safe-area-inset-bottom));
  }

  .admin-shell {
    padding: 10px 10px calc(118px + env(safe-area-inset-bottom));
  }

  .admin-super-nav {
    position: fixed;
    inset: auto max(10px, env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
    z-index: 80;
    align-items: stretch;
    gap: 0;
    margin-bottom: 0;
    padding: 7px;
    border-radius: 24px;
    box-shadow: 0 -12px 34px rgba(120, 53, 15, 0.2);
  }

  .admin-super-nav-title {
    display: none;
  }

  .admin-super-nav-links {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    justify-content: stretch;
  }

  .admin-super-nav-links a {
    width: 100%;
    min-height: 54px;
    padding: 8px 6px;
    border-radius: 18px;
    font-size: 13px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: none;
  }

  .admin-body .toast {
    bottom: calc(94px + env(safe-area-inset-bottom));
    z-index: 120;
  }

  .admin-hero,
  .admin-panel,
  .expense-card,
  .expense-total-card {
    border-radius: 20px;
  }

  .admin-hero {
    padding: 18px;
  }

  .admin-panel {
    padding: 12px;
  }

  .expense-total-card {
    padding: 20px;
  }

  .filter-grid,
  .analytics-grid,
  .kpi-grid,
  .admin-home-grid,
  .expense-grid,
  .expense-chart-grid,
  .expense-form {
    grid-template-columns: 1fr;
  }

  .order-filter-grid,
  .expense-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .order-filter-grid label:nth-child(3),
  .order-filter-grid label:nth-child(4),
  .order-filter-grid button,
  .expense-filter-grid label:nth-child(3),
  .expense-filter-grid button {
    grid-column: 1 / -1;
  }

  .inline-form {
    grid-template-columns: 1fr;
  }

  .filter-grid input,
  .filter-grid select,
  .inline-form input,
  .expense-form input,
  .expense-form select,
  .filter-grid button,
  .inline-form button,
  .expense-form button,
  .expense-filter-grid button {
    min-height: 50px;
    padding: 12px;
    font-size: 16px;
  }

  .expense-category-item {
    grid-template-columns: 1fr;
  }

  .expense-category-item button,
  .expense-row-actions button {
    width: 100%;
    min-height: 44px;
    font-size: 15px;
  }

  .expense-row-actions {
    display: grid;
  }

  .filter-grid button,
  .inline-form button,
  .expense-form button,
  .expense-filter-grid button {
    width: 100%;
  }

  .order-table th:last-child,
  .order-table td:last-child {
    position: sticky;
    right: 0;
    min-width: 84px;
    background: #fff7ed;
    box-shadow: -10px 0 18px rgba(120, 53, 15, 0.12);
  }

  .order-table th:last-child {
    z-index: 3;
    background: #ffedd5;
  }

  .order-table td:last-child {
    z-index: 2;
  }

  .reprint-form {
    margin: 0;
  }

  .admin-table .reprint-btn {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    white-space: nowrap;
  }

  .order-history-panel .admin-table-wrap,
  .expense-records-section .admin-table-wrap {
    max-height: 420px;
  }

  .expense-chart-grid {
    gap: 12px;
  }
}

@media (max-width: 420px) {
  .hero {
    padding: 18px;
  }

  .hero h1 {
    font-size: 26px;
  }

  .table-badge {
    min-width: 78px;
    height: 78px;
    border-radius: 20px;
  }

  .table-badge span {
    font-size: 32px;
  }

  .dish-card {
    padding: 13px;
  }

  .qty-control {
    grid-template-columns: 34px 30px 34px;
  }

  .qty-control button {
    width: 34px;
    height: 34px;
  }
}
