/* Panel de Tavola · base, componentes y estructura. Independiente de la piel de cada restaurante. */
:root {
  --ink: #1b120c; --ink-2: #261910; --ink-3: #352418; --paper: #f6ecdf;
  --orange: #e0611c; --orange-2: #ff7a2f; --pine: #d9a066; --basil: #6f8a3a; --tomato: #c8321f;
  --line-dark: rgba(246, 236, 223, .12); --muted-dark: rgba(246, 236, 223, .62);
  --radius: 18px; --radius-sm: 12px;
  --display: 'Fraunces', Georgia, serif; --sans: 'Instrument Sans', system-ui, sans-serif;
  --tabs-h: 68px;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100dvh; background: var(--ink); color: var(--paper); font: 400 16px/1.45 var(--sans); overflow-x: hidden; }
h1, h2, h3, h4, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--orange-2); outline-offset: 2px; }
[hidden] { display: none !important; }
svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--muted-dark); font-size: 14px; }
.stack { display: grid; gap: 14px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.label { font-weight: 600; font-size: 15px; }

/* botones */
.btn {
  --h: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: var(--h); padding: 0 20px;
  border-radius: 999px; font-weight: 600; font-size: 15px; white-space: nowrap; text-decoration: none; transition: transform .2s, background-color .2s, box-shadow .2s;
}
.btn:active { transform: scale(.97); }
.btn--small { --h: 44px; padding: 0 16px; font-size: 14px; }
.btn--big { --h: 56px; font-size: 16px; }
.btn--block { width: 100%; }
.btn--orange { background: var(--orange); color: #fff; box-shadow: 0 10px 28px -12px rgba(224, 97, 28, .8); }
.btn--orange:hover { background: var(--orange-2); }
.btn--line { box-shadow: inset 0 0 0 1.5px var(--line-dark); background: rgba(246, 236, 223, .04); }
.btn--line:hover { box-shadow: inset 0 0 0 1.5px var(--pine); }
.btn--ghost { background: rgba(246, 236, 223, .1); }
.btn--danger { background: rgba(200, 50, 31, .16); color: #ff9a8b; box-shadow: inset 0 0 0 1.5px rgba(200, 50, 31, .5); }
.btn--danger:hover { background: var(--tomato); color: #fff; }
.btn[disabled] { opacity: .4; pointer-events: none; }
.btn small { opacity: .7; font-weight: 500; }
.icon-btn { width: 44px; height: 44px; flex: none; border-radius: 50%; display: inline-grid; place-items: center; background: rgba(246, 236, 223, .06); box-shadow: inset 0 0 0 1px var(--line-dark); }
.icon-btn:hover { background: rgba(246, 236, 223, .14); }

/* chips y pills */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips--wrap { flex-wrap: wrap; overflow: visible; }
.chip {
  flex: none; height: 44px; padding: 0 18px; border-radius: 999px; display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px;
  box-shadow: inset 0 0 0 1.5px var(--line-dark); background: transparent; position: relative;
}
.chip i { font-style: normal; opacity: .6; font-weight: 500; }
.chip.is-on { background: var(--paper); color: var(--ink); box-shadow: none; }
.chip[disabled] { opacity: .3; pointer-events: none; }
.chip svg { width: 18px; height: 18px; }
.dotmark { width: 8px; height: 8px; border-radius: 50%; background: var(--orange-2); }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { display: inline-flex; align-items: center; height: 26px; padding: 0 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: rgba(246, 236, 223, .1); color: var(--paper); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill--gold { background: rgba(217, 160, 102, .2); color: var(--pine); }
.pill--basil { background: rgba(111, 138, 58, .25); color: #b9d680; }
.pill--note { background: rgba(224, 97, 28, .18); color: #ffb287; }
.pill--table { background: var(--ink-3); box-shadow: inset 0 0 0 1px var(--line-dark); }
.pill--muted, .pill--cancelled { background: transparent; color: var(--muted-dark); box-shadow: inset 0 0 0 1px var(--line-dark); }
.pill--no_show { background: rgba(200, 50, 31, .22); color: #ff9a8b; }
.pill--completed { background: rgba(111, 138, 58, .2); color: #b9d680; }

/* formularios */
.field { display: grid; gap: 6px; min-width: 0; }
.field > span { font-size: 13px; font-weight: 600; color: var(--muted-dark); }
input:not([type=checkbox]):not([type=hidden]), select, textarea {
  width: 100%; min-height: 48px; padding: 10px 14px; border-radius: var(--radius-sm); border: 1.5px solid var(--line-dark); background: var(--ink-3); color: var(--paper);
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--orange-2); outline: none; }
.stepper { display: inline-flex; align-items: center; gap: 4px; background: var(--ink-3); border-radius: 999px; padding: 4px; }
.stepper button { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: rgba(246, 236, 223, .08); }
.stepper button:hover { background: var(--orange); }
.stepper output { min-width: 40px; text-align: center; font: 600 22px var(--display); }
.switch { display: inline-flex; align-items: center; gap: 10px; position: relative; min-height: 44px; cursor: pointer; font-size: 14px; font-weight: 600; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch i { width: 48px; height: 28px; border-radius: 999px; background: var(--ink-3); box-shadow: inset 0 0 0 1.5px var(--line-dark); position: relative; transition: background .2s; flex: none; }
.switch i::after { content: ''; position: absolute; top: 4px; left: 4px; width: 20px; height: 20px; border-radius: 50%; background: var(--paper); transition: transform .2s; }
.switch input:checked + i { background: var(--basil); box-shadow: none; }
.switch input:checked + i::after { transform: translateX(20px); }
.switch input:focus-visible + i { outline: 2px solid var(--orange-2); outline-offset: 2px; }

/* modal, toast, estados */
.modal-wrap { position: fixed; inset: 0; z-index: 50; display: grid; place-items: end center; background: rgba(10, 6, 3, .66); backdrop-filter: blur(4px); padding: 0; }
.modal { width: min(520px, 100%); max-height: 92dvh; overflow-y: auto; background: var(--ink-2); border-radius: 26px 26px 0 0; box-shadow: 0 -20px 60px rgba(0, 0, 0, .5), inset 0 0 0 1px var(--line-dark); animation: rise .25s ease; }
.modal__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 6px; position: sticky; top: 0; background: var(--ink-2); z-index: 1; }
.modal__head h3 { font: 600 22px var(--display); }
.modal__body { padding: 10px 20px calc(22px + env(safe-area-inset-bottom)); display: grid; gap: 14px; }
.modal__foot { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.modal__foot .btn--big { width: 100%; }
@keyframes rise { from { transform: translateY(24px); opacity: 0; } }
@media (min-width: 700px) { .modal-wrap { place-items: center; padding: 24px; } .modal { border-radius: 26px; } }
.toast { position: fixed; left: 50%; bottom: calc(var(--tabs-h) + 16px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); z-index: 60; max-width: calc(100vw - 32px); padding: 13px 20px; border-radius: 999px; background: var(--paper); color: var(--ink); font-weight: 600; opacity: 0; pointer-events: none; transition: all .3s; }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.loader { width: 32px; height: 32px; margin: 60px auto; border-radius: 50%; border: 3px solid var(--line-dark); border-top-color: var(--orange-2); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(1turn); } }
.empty { display: grid; justify-items: center; gap: 10px; padding: 48px 16px; color: var(--muted-dark); text-align: center; }
.empty svg { width: 40px; height: 40px; opacity: .5; }

/* acceso */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 20px; }
.login__card { width: min(400px, 100%); display: grid; gap: 16px; padding: 28px; border-radius: 26px; background: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line-dark); }
.login__brand { font: 600 40px var(--display); text-align: center; letter-spacing: -.02em; }
.login__err { min-height: 22px; color: #ff9a8b; font-weight: 600; text-align: center; }

/* estructura */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: rgba(27, 18, 12, .92); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line-dark); }
.top__brand { font: 600 24px var(--display); letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.live { width: 12px; height: 12px; border-radius: 50%; background: #777; flex: none; }
.live.is-on { background: #7fc24a; box-shadow: 0 0 0 4px rgba(127, 194, 74, .2); }
.top__right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.top__user { display: grid; line-height: 1.15; text-align: right; font-size: 14px; }
.top__user small { color: var(--muted-dark); font-size: 12px; }
.tabs { display: flex; gap: 6px; padding: 12px 16px 0; max-width: 1100px; margin: 0 auto; overflow-x: auto; scrollbar-width: none; }
.tab { position: relative; flex: none; height: 44px; padding: 0 16px; border-radius: 999px; display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; color: var(--muted-dark); }
.tab:hover { color: var(--paper); }
.tab.is-on { background: var(--paper); color: var(--ink); }
.tab__badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--orange); color: #fff; font: 700 12px/20px var(--sans); text-align: center; font-style: normal; }
.tab__badge.is-flash { animation: flash .9s ease 3; }
@keyframes flash { 50% { transform: scale(1.35); background: var(--orange-2); } }
.views { max-width: 1100px; margin: 0 auto; padding: 16px 16px 40px; }

@media (max-width: 760px) {
  body { padding-bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom)); }
  .top__user, .btn[data-logout] span { display: none; }
  .btn[data-logout] { padding: 0; width: 44px; }
  .tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; max-width: none; margin: 0; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); gap: 2px; justify-content: space-around; background: rgba(27, 18, 12, .96); backdrop-filter: blur(14px); border-top: 1px solid var(--line-dark); }
  .tab { flex: 1 1 0; min-width: 0; height: var(--tabs-h); max-height: 56px; padding: 0 2px; flex-direction: column; justify-content: center; gap: 2px; font-size: 10.5px; border-radius: 14px; }
  .tab.is-on { background: rgba(246, 236, 223, .12); color: var(--orange-2); }
  .tab__badge { position: absolute; top: 2px; right: 50%; transform: translateX(22px); min-width: 18px; height: 18px; line-height: 18px; }
  .views { padding: 12px 12px 24px; }
  .grid2 { grid-template-columns: 1fr; }
}
.langsel { width: auto; min-height: 44px; padding: 0 12px; border-radius: 999px; font-weight: 700; font-size: 14px; cursor: pointer; }
