:root {
  --bg: #f7f3ec;
  --bg-glow: #fff4e4;
  --surface: #ffffff;
  --surface-soft: #fff8f0;
  --surface-deep: #f2e9dd;
  --ink: #181818;
  --ink-soft: #3d3934;
  --muted: #746c62;
  --muted-2: #9b9185;
  --line: #eadfd2;
  --line-strong: #d6c6b4;
  --orange: #ff8100;
  --orange-deep: #bc5c00;
  --red: #e6000e;
  --red-deep: #b5000b;
  --accent: #ff8100;
  --accent-deep: #e6000e;
  --accent-soft: #fff0df;
  --online: #2f7d32;
  --online-soft: #e9f6e8;
  --offline: #e6000e;
  --offline-soft: #ffecec;
  --error: #d96600;
  --error-soft: #fff1df;
  --maintenance: #a96b00;
  --maintenance-soft: #fff5d6;
  --unknown: #8d8377;
  --unknown-soft: #f2ece4;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(74, 45, 20, 0.04), 0 8px 28px rgba(74, 45, 20, 0.05);
  --sans: "Montserrat", "Segoe UI", ui-sans-serif, -apple-system, Roboto, Arial, sans-serif;
  --serif: "Montserrat", "Segoe UI", ui-sans-serif, -apple-system, Roboto, Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1000px 480px at 91% -10%, rgba(255, 129, 0, 0.11) 0%, transparent 62%),
    radial-gradient(760px 420px at -12% 18%, rgba(230, 0, 14, 0.055) 0%, transparent 66%),
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

img {
  max-width: 100%;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.shell {
  width: min(1280px, 100%);
  margin-inline: auto;
  padding-inline: 34px;
}

.mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.nowrap {
  white-space: nowrap;
}

.muted {
  color: var(--muted-2);
  font-weight: 500;
}

/* ---------- Top bar ---------- */

.topbar {
  background: var(--surface);
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  position: relative;
}

.brand-strip {
  height: 4px;
  background: linear-gradient(
    90deg,
    var(--orange) 0%,
    var(--orange) 49.8%,
    var(--red) 50.2%,
    var(--red) 100%
  );
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 74px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.partner-lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand-qummy {
  display: block;
  width: auto;
  height: 21px;
}

.brand-magnit {
  display: block;
  width: auto;
  height: 22px;
}

.brand-times {
  color: #a39688;
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
  transform: translateY(-1px);
}

.brand-rule {
  width: 1px;
  height: 30px;
  background: var(--line);
}

.brand-product {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.05;
}

.brand-product-name {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.brand-product-sub {
  color: var(--muted);
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 500;
}

.demo-badge {
  padding: 3px 8px;
  border: 1px solid rgba(230, 0, 14, 0.22);
  border-radius: 999px;
  background: #fff5f5;
  color: var(--red);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.sync-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.sync-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #b6a99a;
}

.sync-success {
  background: var(--online);
  box-shadow: 0 0 0 3px rgba(47, 125, 50, 0.12);
}

.sync-failed {
  background: var(--red);
  box-shadow: 0 0 0 3px rgba(230, 0, 14, 0.13);
}

.sync-running {
  background: var(--orange);
  animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse {
  50% { opacity: 0.35; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------- Layout ---------- */

.main {
  padding-block: 42px 76px;
}

.eyebrow {
  margin-bottom: 9px;
  color: var(--red);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 28px;
}

.page-head-copy {
  max-width: 860px;
}

.page-head h1 {
  font-family: var(--serif);
  font-size: clamp(2.1rem, 4.2vw, 3.35rem);
  font-weight: 800;
  line-height: 1.03;
  letter-spacing: -0.05em;
}

.detail-head h1 {
  font-size: clamp(1.75rem, 3.2vw, 2.7rem);
  line-height: 1.08;
}

.page-sub {
  margin-top: 12px;
  color: var(--muted);
  font-size: 14.5px;
  max-width: 64ch;
}

.head-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 11px;
  flex-shrink: 0;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 12.5px;
}

.breadcrumbs a:hover {
  color: var(--red);
}

.breadcrumbs span:last-child {
  color: var(--ink-soft);
}

/* ---------- Controls ---------- */

.segmented {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 1px 1px rgba(49, 39, 25, 0.03);
}

.segmented a {
  padding: 6px 11px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  transition: color 0.15s ease, background 0.15s ease;
}

.segmented a:hover {
  color: var(--red);
}

.segmented a.is-active {
  background: var(--red);
  color: #ffffff;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.btn:hover {
  border-color: var(--red);
  color: var(--red);
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  cursor: wait;
  opacity: 0.7;
}

.btn svg {
  width: 16px;
  height: 16px;
}

.btn-sync {
  border-color: var(--red);
  background: var(--red);
  color: #ffffff;
  box-shadow: 0 5px 14px rgba(230, 0, 14, 0.16);
}

.btn-sync:hover {
  border-color: var(--red-deep);
  background: var(--red-deep);
  color: #ffffff;
}

.btn-sync.is-loading svg {
  animation: spin 0.9s linear infinite;
}

.btn-sync.is-failed {
  border-color: var(--offline);
  background: var(--offline);
}

/* ---------- KPI ---------- */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}

.kpi {
  position: relative;
  padding: 19px 20px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.kpi::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--orange), var(--red));
}

.kpi:hover::before {
  opacity: 1;
}

.kpi-label {
  display: block;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.kpi-value {
  display: block;
  font-size: clamp(1.65rem, 2.6vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 1.02;
  font-variant-numeric: tabular-nums;
}

.kpi-unit {
  margin-left: 4px;
  color: var(--muted);
  font-size: 0.55em;
  font-weight: 600;
  letter-spacing: 0;
}

.kpi-divider {
  margin-inline: 4px;
  color: var(--line-strong);
  font-weight: 400;
}

.accent-online {
  color: var(--online);
}

.kpi-note {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.4;
}

.mono-value {
  font-family: var(--mono);
  font-size: clamp(1.3rem, 2.1vw, 1.75rem);
  letter-spacing: -0.03em;
}

/* ---------- Notices ---------- */

.notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 20px;
  padding: 12px 16px;
  border: 1px solid rgba(254, 182, 34, 0.45);
  border-radius: 12px;
  background: #fff8e3;
  color: #6e4a00;
  font-size: 12.5px;
  font-weight: 500;
}

.notice svg {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 1px;
}

.notice-error {
  border-color: rgba(230, 0, 14, 0.2);
  background: var(--offline-soft);
  color: var(--red-deep);
}

/* ---------- Sections ---------- */

.section {
  margin-bottom: 30px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}

.section-head h2,
.panel-head h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.15;
}

.section-head h2::before,
.panel-head h2::before {
  content: "";
  width: 18px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--orange), var(--red));
  flex-shrink: 0;
}

.section-note {
  color: var(--muted);
  font-size: 11.5px;
  white-space: nowrap;
}

/* ---------- Corner cards ---------- */

.corner-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(355px, 1fr));
  gap: 15px;
}

.corner-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.corner-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--orange), var(--red));
  opacity: 0;
  transition: opacity 0.18s ease;
}

.corner-card:hover {
  transform: translateY(-2px);
  border-color: rgba(230, 0, 14, 0.24);
  box-shadow: 0 2px 4px rgba(49, 39, 25, 0.04), 0 18px 38px rgba(90, 34, 9, 0.08);
}

.corner-card:hover::before {
  opacity: 1;
}

.corner-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.corner-kicker {
  display: block;
  margin-bottom: 5px;
  color: var(--orange-deep);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.corner-address {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.035em;
}

.arrow-link {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 33px;
  height: 33px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  font-size: 15px;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.corner-card:hover .arrow-link {
  border-color: var(--red);
  background: var(--red);
  color: #ffffff;
}

.corner-stats {
  display: grid;
  grid-template-columns: 0.8fr 1fr 1.25fr;
  gap: 12px;
  margin: 18px 0;
  padding: 14px 0;
  border-block: 1px solid var(--line);
}

.corner-stat > span {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.corner-stat strong {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.corner-stat strong .muted {
  font-size: 0.65em;
  letter-spacing: 0;
  display: inline;
}

.oven-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 27px;
}

.oven-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.02em;
}

.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-bg-online { background: var(--online); }
.status-bg-offline { background: var(--offline); }
.status-bg-error { background: var(--error); }
.status-bg-maintenance { background: var(--maintenance); }
.status-bg-unknown { background: var(--unknown); }

.corner-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 17px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.top-dish-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-dish-label svg {
  width: 14px;
  height: 14px;
  color: var(--orange);
  flex-shrink: 0;
}

.customer-tag {
  flex-shrink: 0;
  max-width: 150px;
  overflow: hidden;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- Badges and tracks ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.badge .dot {
  width: 6px;
  height: 6px;
}

.badge-online { color: #226b27; background: var(--online-soft); }
.badge-offline { color: var(--red-deep); background: var(--offline-soft); }
.badge-error { color: #a34e00; background: var(--error-soft); }
.badge-maintenance { color: #795000; background: var(--maintenance-soft); }
.badge-unknown { color: #615b51; background: var(--unknown-soft); }

.status-track {
  display: flex;
  width: 100%;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface-deep);
}

.status-track-sm {
  height: 6px;
}

.status-seg {
  height: 100%;
  min-width: 1px;
  transition: opacity 0.15s ease;
}

.status-seg:hover {
  opacity: 0.75;
}

/* ---------- Corner detail ---------- */

.summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.summary-item {
  padding: 16px 20px;
  border-right: 1px solid var(--line);
}

.summary-item:last-child {
  border-right: 0;
}

.summary-item span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.summary-item strong {
  display: block;
  margin-top: 4px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.summary-item small {
  display: block;
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 10.5px;
}

.title-with-status {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.mono-title {
  font-family: var(--mono);
  font-size: clamp(1.6rem, 3vw, 2.4rem) !important;
  letter-spacing: -0.045em !important;
}

.inline-link {
  color: var(--ink-soft);
  border-bottom: 1px solid var(--line-strong);
}

.inline-link:hover {
  color: var(--red);
  border-color: var(--red);
}

.oven-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 15px;
}

.oven-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.oven-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 13px;
}

.oven-kicker {
  display: block;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.oven-serial {
  font-family: var(--mono);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.04em;
}

.oven-meta-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 11px 0 12px;
  color: var(--muted);
  font-size: 11.5px;
}

.oven-meta-row strong {
  color: var(--ink);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.oven-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.oven-stat {
  padding: 9px 11px;
  border-radius: 9px;
  background: var(--surface-soft);
}

.oven-stat span {
  display: block;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.oven-stat strong {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
}

.oven-stat strong small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.oven-stat .small-value {
  font-size: 12.5px;
  font-weight: 550;
  letter-spacing: 0;
}

.oven-card-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}

.oven-card-foot .legend {
  min-width: 0;
}

.text-link {
  flex-shrink: 0;
  color: var(--red);
  font-size: 12px;
  font-weight: 700;
}

.text-link:hover {
  color: var(--orange-deep);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 11px;
  font-size: 10.5px;
  color: var(--muted);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.legend-item b {
  color: var(--ink-soft);
  font-weight: 600;
}

.legend-item .dot {
  width: 6px;
  height: 6px;
}

/* ---------- Panels ---------- */

.panel {
  margin-bottom: 18px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.panel-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11.5px;
}

.panel-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 15px;
}

.panel-grid .panel {
  margin-bottom: 18px;
}

.status-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 17px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11.5px;
}

.status-facts b {
  color: var(--ink-soft);
  font-weight: 600;
}

.coverage-hint {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: #7a4a12;
  font-size: 10.5px;
  line-height: 1.5;
}

.sparkline-wrap {
  padding: 10px 0 2px;
  border-bottom: 1px solid var(--line);
  background-image: linear-gradient(to bottom, transparent 49%, rgba(120, 107, 89, 0.09) 50%, transparent 51%);
  background-size: 100% 26px;
}

.sparkline {
  display: block;
  width: 100%;
  height: 108px;
  overflow: visible;
}

.sparkline path {
  vector-effect: non-scaling-stroke;
}

.voltage-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 13px;
}

.voltage-row span {
  display: block;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.voltage-row strong {
  font-size: 16px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

/* ---------- Top dishes ---------- */

.dish-rank-list {
  display: grid;
  gap: 13px;
}

.dish-rank-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 5px;
}

.dish-rank-name {
  display: inline-flex;
  align-items: baseline;
  min-width: 0;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
}

.rank-index {
  display: inline-block;
  width: 22px;
  color: var(--muted-2);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.dish-rank-value {
  flex-shrink: 0;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.dish-rank-value span {
  color: var(--muted);
  font-weight: 500;
}

.bar {
  height: 6px;
  margin-left: 22px;
  border-radius: 999px;
  background: var(--surface-deep);
  overflow: hidden;
}

.bar span {
  display: block;
  height: 100%;
  min-width: 2px;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--orange), var(--red));
}

/* ---------- Table ---------- */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.data-table {
  width: 100%;
  min-width: 940px;
  border-collapse: collapse;
  font-size: 12.5px;
}

.data-table th {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #f2eae0;
  vertical-align: middle;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr:hover {
  background: #fff9f1;
}

.serial-link {
  color: var(--red);
  font-family: var(--mono);
  font-size: 11.5px;
  white-space: nowrap;
}

.serial-link:hover {
  text-decoration: underline;
}

.dish-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 280px;
  max-width: 470px;
}

.dish-thumb {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--surface-deep);
  flex-shrink: 0;
}

.dish-thumb-empty {
  display: block;
}

.dish-copy {
  min-width: 0;
  max-width: 420px;
}

.dish-name {
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.3;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.dish-sub {
  display: -webkit-box;
  overflow: hidden;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.dish-sub-label {
  color: var(--muted-2);
  font-weight: 600;
}

.cell-main {
  display: block;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.cell-sub {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.table-note {
  margin-top: 13px;
  color: var(--muted);
  font-size: 11.5px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 15px;
}

.page-btn {
  display: inline-flex;
  align-items: center;
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.page-btn:hover {
  border-color: var(--red);
  color: var(--red);
}

.page-btn.is-disabled {
  opacity: 0.35;
  pointer-events: none;
}

.page-position {
  color: var(--ink-soft);
  font-size: 11.5px;
  text-align: center;
}

.page-position span {
  color: var(--muted);
}

/* ---------- Empty and misc ---------- */

.empty-note {
  color: var(--muted);
  font-size: 13px;
  padding: 8px 0;
}

.empty-state {
  padding: 54px 28px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.62);
  text-align: center;
}

.empty-state h1,
.empty-state h3 {
  font-family: var(--serif);
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.empty-state p {
  max-width: 55ch;
  margin: 8px auto 20px;
  color: var(--muted);
  font-size: 13px;
}

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 18px 30px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink-soft);
}

.footer-brand b {
  font-weight: 800;
  color: var(--ink);
}

.footer-partners {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.footer-partners img {
  width: auto;
  height: 14px;
}

.footer-partners span {
  color: var(--muted-2);
  font-size: 10px;
}

.footer-muted {
  color: var(--muted-2);
}

/* ---------- Responsive ---------- */

@media (max-width: 1080px) {
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .panel-grid {
    grid-template-columns: 1fr;
  }

  .panel-grid .panel {
    margin-bottom: 0;
  }

  .panel-grid {
    margin-bottom: 18px;
  }
}

@media (max-width: 860px) {
  .shell {
    padding-inline: 20px;
  }

  .main {
    padding-top: 30px;
  }

  .topbar-inner {
    height: 68px;
  }

  .brand {
    gap: 13px;
  }

  .brand-product-sub {
    display: none;
  }

  .page-head {
    flex-direction: column;
    gap: 20px;
  }

  .head-actions {
    align-items: flex-start;
    width: 100%;
  }

  .head-actions .segmented {
    max-width: 100%;
    flex-wrap: wrap;
  }

  .corner-grid,
  .oven-grid {
    grid-template-columns: 1fr;
  }

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

  .summary-item:nth-child(2) {
    border-right: 0;
  }

  .summary-item:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }
}

@media (max-width: 560px) {
  .shell {
    padding-inline: 15px;
  }

  .topbar-inner {
    height: 62px;
    gap: 8px;
  }

  .brand {
    gap: 9px;
  }

  .partner-lockup {
    gap: 6px;
  }

  .brand-qummy {
    height: 18px;
  }

  .brand-magnit {
    height: 19px;
  }

  .brand-times {
    font-size: 13px;
  }

  .brand-rule {
    display: none;
  }

  .brand-product-name {
    font-size: 12.5px;
  }

  .demo-badge {
    display: none;
  }

  .topbar-right .sync-state {
    display: none;
  }

  .page-head h1 {
    font-size: 2rem;
  }

  .kpi {
    padding: 15px 16px;
  }

  .kpi-value {
    font-size: 1.55rem;
  }

  .corner-card,
  .panel,
  .oven-card {
    padding: 17px;
  }

  .corner-address {
    font-size: 20px;
  }

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

  .corner-stat-wide {
    grid-column: 1 / -1;
  }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .panel-head {
    flex-direction: column;
    gap: 8px;
  }

  .oven-card-foot {
    flex-direction: column;
    align-items: flex-start;
  }

  .pagination {
    flex-wrap: wrap;
    justify-content: center;
  }

  .page-position {
    order: -1;
    width: 100%;
  }

  .voltage-row {
    gap: 8px;
  }

  .voltage-row strong {
    font-size: 14px;
  }

  .footer {
    padding-bottom: 22px;
  }

  .footer-brand {
    flex-wrap: wrap;
    row-gap: 6px;
  }
}

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