:root {
  --panel: rgba(255, 252, 247, 0.88);
  --stroke: rgba(100, 57, 29, 0.14);
  --text: #3e2416;
  --muted: #7b5a47;
  --accent: #ff7a59;
  --accent-dark: #d94f35;
  --mint: #7fc8a9;
  --danger: #b94a48;
  --shadow: 0 24px 60px rgba(132, 77, 46, 0.16);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 200, 87, 0.3), transparent 30%),
    linear-gradient(135deg, #fff6ea 0%, #ffe5d6 100%);
}

.bg-orb { position: fixed; border-radius: 999px; filter: blur(12px); opacity: 0.5; }
.orb-a { width: 250px; height: 250px; top: 4%; right: -70px; background: rgba(127, 200, 169, 0.45); }
.orb-b { width: 320px; height: 320px; left: -90px; bottom: -100px; background: rgba(255, 122, 89, 0.2); }

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1240px, calc(100% - 24px));
  margin: 0 auto;
  padding: 20px 0 40px;
}

.panel, .hero, .status-bar {
  backdrop-filter: blur(16px);
  background: var(--panel);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 24px;
  border-radius: 28px;
}

.hero-brand {
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand-logo, .login-logo, .admin-logo-preview {
  display: block;
  object-fit: contain;
}

.brand-logo {
  width: 110px;
  height: 110px;
  border-radius: 28px;
  box-shadow: 0 14px 34px rgba(132, 77, 46, 0.18);
}

.login-brand {
  display: grid;
  place-items: center;
  margin-bottom: 12px;
}

.login-logo {
  width: 160px;
  max-width: 100%;
}

.admin-logo-preview {
  width: min(220px, 100%);
  margin-bottom: 10px;
  border-radius: 18px;
  background: rgba(255,255,255,0.7);
}

.eyebrow, .section-kicker {
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  color: var(--accent-dark);
  font-weight: 700;
}

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 10px; font-size: clamp(2rem, 4vw, 3.4rem); }
.hero-copy { max-width: 640px; margin-bottom: 0; color: var(--muted); }

.hero-actions, .role-switcher, .session-box, .admin-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.hero-actions { flex-direction: column; align-items: flex-end; }

.role-pill, .primary-button, .secondary-button, .ghost-button {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font: inherit;
  cursor: pointer;
}

.role-pill { background: rgba(255,255,255,0.82); border: 1px solid rgba(100,57,29,0.12); }
.role-pill.active, .primary-button { background: linear-gradient(135deg, var(--accent), #ff9f68); color: #fff; }
.secondary-button { background: rgba(127, 200, 169, 0.22); color: #225843; }
.ghost-button { background: rgba(62, 36, 22, 0.06); color: var(--text); }

.login-panel { margin-top: 18px; display: grid; place-items: center; }
.login-card { width: min(460px, 100%); }

.status-bar {
  margin-top: 18px;
  padding: 18px;
  border-radius: 22px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.status-bar article, .summary-card {
  background: rgba(255,255,255,0.65);
  border-radius: 18px;
  padding: 14px;
}

.status-bar span, .summary-card span { display: block; color: var(--muted); font-size: 0.9rem; }
.status-bar strong, .summary-card strong { display: block; margin-top: 6px; font-size: 1.5rem; }

.hidden { display: none !important; }
.layout { margin-top: 18px; }
.role-view { display: none; gap: 18px; }
.role-view.active { display: grid; }
#view-mesero.role-view.active { grid-template-columns: 1.2fr 0.8fr; }
#view-cocina.role-view.active, #view-caja.role-view.active, #view-admin.role-view.active { grid-template-columns: 1fr; }

.panel { border-radius: 26px; padding: 22px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 20px; }
.grid { display: grid; gap: 14px; }
.two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 18px; }

label { display: block; font-weight: 600; }
input, textarea, select {
  width: 100%;
  margin-top: 8px;
  border: 1px solid rgba(100, 57, 29, 0.12);
  border-radius: 16px;
  padding: 12px 14px;
  font: inherit;
  color: var(--text);
  background: rgba(255,255,255,0.84);
}

.menu-grid, .cards { display: grid; gap: 14px; }
.menu-grid { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.compact-cards, .credentials-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.compact-cards, .credentials-grid { display: grid; gap: 14px; }

.menu-card, .order-card, .editor-card {
  background: rgba(255,255,255,0.72);
  border: 1px solid rgba(100,57,29,0.12);
  border-radius: 22px;
  padding: 16px;
}

.editor-card-low {
  border-color: rgba(217, 79, 53, 0.35);
  box-shadow: inset 0 0 0 1px rgba(217, 79, 53, 0.12);
}

.menu-actions, .card-actions, .submit-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.quantity-control {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,248,238,0.9);
  border-radius: 999px;
  padding: 8px 12px;
}

.quantity-button {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  background: rgba(255,122,89,0.16);
  color: var(--accent-dark);
  font-size: 1rem;
}

.flavor-block, .admin-section { margin-top: 14px; }
.field-label, .unit-label { margin: 0 0 8px; font-weight: 700; }
.unit-flavor-card { padding: 12px; border-radius: 16px; background: rgba(255,248,238,0.74); border: 1px solid rgba(100,57,29,0.08); }
.submit-row { margin-top: 8px; background: rgba(62,36,22,0.04); border-radius: 20px; padding: 16px; }
.form-warning { margin: 8px 0 0; min-height: 1.2em; color: var(--danger); font-size: 0.92rem; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.chip { display: inline-flex; padding: 6px 10px; border-radius: 999px; font-size: 0.84rem; background: rgba(255,248,238,0.95); border: 1px solid rgba(100,57,29,0.1); }
.chip.pending { background: rgba(255, 200, 87, 0.25); }
.chip.preparing { background: rgba(127, 200, 169, 0.25); }
.chip.ready { background: rgba(255, 122, 89, 0.22); }
.chip.paid { background: rgba(127, 200, 169, 0.35); }
.chip.cash { background: rgba(255, 200, 87, 0.32); }
.chip.nequi { background: rgba(127, 200, 169, 0.35); }
.chip.other { background: rgba(160, 190, 255, 0.35); }
.items-list { display: grid; gap: 8px; padding-left: 18px; }

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  background: #3e2416;
  color: white;
  padding: 12px 16px;
  border-radius: 14px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.visible { opacity: 1; transform: translateY(0); }

@media (max-width: 900px) {
  .hero, .status-bar, #view-mesero.role-view.active, .two-col { grid-template-columns: 1fr; }
  .hero { display: grid; }
  .hero-brand { flex-direction: column; align-items: flex-start; }
  .hero-actions { align-items: stretch; }
  .submit-row, .menu-actions, .card-actions { flex-direction: column; align-items: stretch; }
}
