:root {
  --bg: #f1eee8;
  --bg-alt: #e6edf0;
  --panel: rgba(255, 252, 247, 0.92);
  --panel-strong: #fffaf3;
  --ink: #2d261f;
  --muted: #70665c;
  --line: rgba(64, 47, 34, 0.12);
  --accent: #b84f31;
  --accent-strong: #7d301f;
  --cool: #2b6f7f;
  --success: #2b7f63;
  --warning: #d9922e;
  --danger: #a33d33;
  --shadow: 0 18px 42px rgba(54, 45, 38, 0.12);
  --radius-xl: 26px;
  --radius-lg: 20px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Outfit", sans-serif;
  color: var(--ink);
  overflow-x: hidden;
  background:
    radial-gradient(circle at top left, rgba(184, 79, 49, 0.16), transparent 28%),
    radial-gradient(circle at bottom right, rgba(43, 111, 127, 0.16), transparent 24%),
    linear-gradient(135deg, var(--bg), var(--bg-alt));
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 20px;
  min-height: 100vh;
  padding: 20px;
}

.panel {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  border-radius: var(--radius-xl);
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 20px;
  align-self: start;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding-right: 4px;
}

.brand-card,
.dark-panel,
.nav,
.section-view,
.hero {
  padding: 18px;
}

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

.brand-logo {
  width: 58px;
  height: 58px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: #fffaf3;
  box-shadow: 0 14px 28px rgba(184, 79, 49, 0.2);
  overflow: hidden;
}

.brand-logo img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.brand-copy {
  min-width: 0;
}

.brand-card h1,
.hero h2,
.section-header h3 {
  margin: 8px 0;
  font-family: "Sora", sans-serif;
  letter-spacing: 0;
}

.brand-card h1 {
  max-width: 100%;
  font-size: clamp(1.16rem, 1vw + 0.88rem, 1.25rem);
  line-height: 1.08;
  white-space: nowrap;
  overflow-wrap: normal;
}

.brand-card .eyebrow {
  max-width: 100%;
  white-space: normal;
  text-align: center;
  font-size: 0.72rem;
}

.brand-card p {
  max-width: 100%;
  line-height: 1.35;
  overflow-wrap: break-word;
}

.brand-card p,
.hero p,
.section-header p,
.muted,
.card p,
.ticket-card p,
.table-card p,
small {
  color: var(--muted);
}

.eyebrow {
  display: inline-flex;
  width: fit-content;
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(184, 79, 49, 0.12);
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

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

.nav-link,
.action-btn,
.chip-btn {
  border: 0;
  border-radius: 14px;
  padding: 12px 14px;
  font-weight: 700;
  transition: 0.2s ease;
}

.nav-link {
  text-align: left;
  background: transparent;
  color: var(--muted);
}

.nav-link:hover,
.nav-link.active,
.chip-btn.active {
  background: var(--panel-strong);
  color: var(--accent-strong);
  box-shadow: inset 0 0 0 1px rgba(184, 79, 49, 0.16);
}

.mobile-section-jump {
  display: none;
}

.dark-panel {
  margin-top: auto;
  background: linear-gradient(180deg, rgba(125, 48, 31, 0.98), rgba(55, 45, 35, 0.96));
  color: #fffaf2;
}

.dark-panel p {
  color: rgba(255, 250, 242, 0.78);
}

.main-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  background:
    linear-gradient(135deg, rgba(255, 250, 242, 0.96), rgba(235, 240, 239, 0.9)),
    linear-gradient(135deg, rgba(184, 79, 49, 0.12), rgba(43, 111, 127, 0.1));
}

.hero-stack {
  display: grid;
  gap: 12px;
  min-width: 230px;
}

.hero-stack article {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 252, 247, 0.85);
}

.hero-stack span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.section-view {
  display: none;
}

.section-view.active {
  display: block;
}

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

.section-header h3,
.section-header p {
  margin: 6px 0 0;
}

.action-btn {
  background: var(--accent);
  color: white;
  box-shadow: 0 12px 24px rgba(184, 79, 49, 0.22);
}

.action-btn.secondary {
  background: var(--ink);
}

.chip-row,
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-btn {
  background: rgba(45, 38, 31, 0.06);
  color: var(--muted);
}

.chip-btn:disabled,
.menu-item:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.metrics-grid,
.cards-grid,
.tables-grid,
.station-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.metric-card,
.card,
.table-card,
.ticket-card {
  padding: 16px;
  border: 1px solid rgba(64, 47, 34, 0.09);
  border-radius: 20px;
  background: var(--panel-strong);
}

.metric-card {
  display: grid;
  gap: 4px;
}

.metric-card strong {
  font-family: "Sora", sans-serif;
  font-size: 2rem;
}

.card-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.card-title h4 {
  margin: 0;
  font-family: "Sora", sans-serif;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(45, 38, 31, 0.08);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.status-pill.ok {
  background: rgba(43, 127, 99, 0.13);
  color: var(--success);
}

.status-pill.warn {
  background: rgba(217, 146, 46, 0.14);
  color: #8c5d12;
}

.status-pill.active {
  background: rgba(43, 111, 127, 0.13);
  color: var(--cool);
}

.service-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.service-flow article {
  display: grid;
  gap: 5px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(184, 79, 49, 0.08);
  border: 1px solid rgba(184, 79, 49, 0.12);
}

.service-flow span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  font-weight: 700;
}

.table-card {
  display: grid;
  gap: 8px;
}

.table-card.selected {
  outline: 2px solid rgba(184, 79, 49, 0.35);
}

.table-card.libre {
  background: rgba(43, 127, 99, 0.08);
}

.table-card.ocupada {
  background: rgba(43, 111, 127, 0.09);
}

.table-card.reservada {
  background: rgba(217, 146, 46, 0.1);
}

.order-layout {
  display: grid;
  grid-template-columns: minmax(280px, 1.1fr) minmax(260px, 0.9fr);
  gap: 16px;
  align-items: start;
}

.order-panel,
.menu-panel {
  display: grid;
  gap: 14px;
}

.order-lines,
.menu-list,
.timeline {
  display: grid;
  gap: 10px;
}

.order-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border-radius: 16px;
  background: rgba(45, 38, 31, 0.05);
}

.order-line .button-row {
  grid-column: 1 / -1;
}

.total-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(184, 79, 49, 0.1);
}

.menu-item {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  text-align: left;
  border: 1px solid rgba(64, 47, 34, 0.08);
  border-radius: 16px;
  padding: 12px;
  background: rgba(255, 252, 247, 0.78);
  color: var(--ink);
}

.menu-item span {
  display: grid;
  gap: 3px;
}

.ticket-card {
  display: grid;
  gap: 10px;
}

.empty-note {
  padding: 18px;
  border-radius: 18px;
  background: rgba(45, 38, 31, 0.05);
  color: var(--muted);
}

.timeline div {
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(43, 111, 127, 0.08);
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    max-height: none;
    padding-right: 0;
  }
}

@media (max-width: 720px) {
  .app-shell {
    padding: 12px;
    gap: 12px;
  }

  .brand-card,
  .dark-panel,
  .section-view,
  .hero {
    padding: 16px;
  }

  .brand-card p,
  .hero p,
  .hero-stack,
  .dark-panel {
    display: none;
  }

  .brand-logo {
    width: 50px;
    height: 50px;
  }

  .nav.panel {
    display: none;
  }

  .mobile-section-jump {
    display: grid;
    gap: 8px;
    padding: 14px 16px;
    position: sticky;
    top: 10px;
    z-index: 10;
  }

  .mobile-section-jump span {
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 700;
  }

  .mobile-section-jump select {
    min-height: 48px;
    width: 100%;
    border: 1px solid rgba(64, 47, 34, 0.12);
    border-radius: 14px;
    padding: 11px 12px;
    background: var(--panel-strong);
    color: var(--ink);
    font-weight: 700;
  }

  .hero,
  .section-header {
    flex-direction: column;
  }

  .service-flow,
  .order-layout {
    grid-template-columns: 1fr;
  }

  .order-line {
    grid-template-columns: 1fr;
  }

  .action-btn {
    width: 100%;
  }
}
