/* css/styles.css — Lorencini's Pizza V2
   Aesthetic: wood-fired / warm dark. Charcoal base, tomato-ember accent,
   cream text. Fraunces (display) + Manrope (body). Mobile-first. */

:root {
  --bg:        #161210;
  --bg-2:      #1f1813;
  --ember:     #e2552e;   /* tomato ember accent */
  --ember-dim: #b8421f;
  --cream:     #f4ece1;
  --muted:     #b6a795;
  --line:      rgba(244, 236, 225, 0.10);
  --danger:    #ff8a6b;
  --radius:    16px;
  --shadow:    0 24px 60px -20px rgba(0, 0, 0, 0.7);
  --font-disp: "Fraunces", Georgia, serif;
  --font-body: "Manrope", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--cream);
  background:
    radial-gradient(120% 90% at 50% -10%, rgba(226, 85, 46, 0.18), transparent 60%),
    radial-gradient(80% 60% at 90% 110%, rgba(226, 85, 46, 0.08), transparent 55%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* ---------- Brand ---------- */
.brand { text-align: center; margin-bottom: 1.75rem; }
.brand__mark {
  display: inline-block;
  color: var(--ember);
  font-size: 0.8rem;
  margin-bottom: 0.5rem;
  filter: drop-shadow(0 0 10px rgba(226, 85, 46, 0.6));
}
.brand__name {
  font-family: var(--font-disp);
  font-weight: 600;
  font-size: 1.9rem;
  line-height: 1.05;
  margin: 0;
  letter-spacing: -0.01em;
}
.brand__name em { color: var(--ember); font-style: italic; }
.brand__tag {
  margin: 0.4rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.brand--inline { display: flex; align-items: center; gap: 0.55rem; margin: 0; }
.brand--inline .brand__mark { margin: 0; }
.brand--inline em { color: var(--ember); font-style: italic; }
.brand--inline strong { font-family: var(--font-disp); font-weight: 600; font-size: 1.15rem; }

/* ---------- Auth layout ---------- */
.auth {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  grid-template-rows: 1fr auto;
}
.auth__card {
  width: 100%;
  max-width: 380px;
  align-self: center;
  background: linear-gradient(180deg, var(--bg-2), #19130f);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem 1.6rem 1.8rem;
  animation: rise 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.auth__error {
  margin: 0 0 0.9rem;
  color: var(--danger);
  font-size: 0.88rem;
  background: rgba(255, 138, 107, 0.08);
  border: 1px solid rgba(255, 138, 107, 0.25);
  border-radius: 10px;
  padding: 0.6rem 0.75rem;
}
.auth__foot {
  align-self: end;
  text-align: center;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  margin: 1.5rem 0 0;
}

/* ---------- Fields ---------- */
.field { margin-bottom: 1rem; }
.field label {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.4rem;
}
.field input {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--cream);
  background: #120e0b;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 0.8rem 0.9rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field input::placeholder { color: #6f6253; }
.field input:focus {
  outline: none;
  border-color: var(--ember-dim);
  box-shadow: 0 0 0 3px rgba(226, 85, 46, 0.18);
}

/* ---------- Buttons ---------- */
.btn {
  width: 100%;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  border: none;
  border-radius: 11px;
  padding: 0.85rem 1rem;
  cursor: pointer;
  transition: transform 0.08s ease, filter 0.2s, background 0.2s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.6; cursor: default; }
.btn--primary {
  color: #fff;
  background: linear-gradient(180deg, var(--ember), var(--ember-dim));
  box-shadow: 0 10px 24px -10px rgba(226, 85, 46, 0.7);
}
.btn--primary:hover:not(:disabled) { filter: brightness(1.05); }
.btn--ghost {
  width: auto;
  color: var(--cream);
  background: transparent;
  border: 1px solid var(--line);
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}
.btn--ghost:hover { border-color: var(--ember-dim); color: var(--ember); }

/* ---------- App shell (placeholder admin) ---------- */
.shell { min-height: 100dvh; padding: 1.25rem; max-width: 720px; margin: 0 auto; }
.shell__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--line);
}
.panel {
  margin-top: 1.5rem;
  background: linear-gradient(180deg, var(--bg-2), #19130f);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.6rem;
  animation: rise 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.panel h2 { font-family: var(--font-disp); font-weight: 600; margin: 0 0 0.4rem; }
.meta { display: grid; grid-template-columns: auto 1fr; gap: 0.4rem 1rem; margin: 1.2rem 0; }
.meta dt { color: var(--muted); font-size: 0.85rem; }
.meta dd { margin: 0; font-weight: 600; }
.muted { color: var(--muted); font-size: 0.9rem; }

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; }
}

/* ====================== Fase 2 — Admin read-only ====================== */
.layout { min-height: 100dvh; max-width: 980px; margin: 0 auto; padding: 1rem 1rem 3rem; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 0.9rem; border-bottom: 1px solid var(--line);
}
.tabs { display: flex; gap: 0.3rem; overflow-x: auto; padding: 0.8rem 0; border-bottom: 1px solid var(--line); }
.tab {
  flex: 0 0 auto; text-decoration: none; color: var(--muted);
  font-weight: 600; font-size: 0.92rem; padding: 0.5rem 0.9rem; border-radius: 999px;
  border: 1px solid transparent; transition: color .2s, border-color .2s, background .2s;
}
.tab:hover { color: var(--cream); }
.tab--active { color: #fff; background: rgba(226,85,46,0.14); border-color: var(--ember-dim); }
.view { padding-top: 1.2rem; }
.page-title { font-family: var(--font-disp); font-weight: 600; font-size: 1.5rem; margin: 0 0 1rem; }
.hint { margin-top: 1rem; font-size: 0.8rem; }
.hint code { color: var(--ember); }

/* Cards do dashboard */
.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.8rem; }
@media (min-width: 720px) { .cards { grid-template-columns: repeat(4, 1fr); } }
.card {
  background: linear-gradient(180deg, var(--bg-2), #19130f);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.1rem; display: flex; flex-direction: column; gap: 0.25rem;
  animation: rise .4s ease both;
}
.card__label { color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; }
.card__value { font-family: var(--font-disp); font-size: 1.7rem; line-height: 1; }
.card__sub { color: var(--muted); font-size: 0.8rem; }

/* Toolbar / inputs */
.toolbar { display: flex; gap: 0.6rem; margin-bottom: 1rem; flex-wrap: wrap; }
.search, .select {
  font-family: var(--font-body); font-size: 0.95rem; color: var(--cream);
  background: #120e0b; border: 1px solid var(--line); border-radius: 11px; padding: 0.65rem 0.8rem;
}
.search { flex: 1 1 220px; }
.search:focus, .select:focus { outline: none; border-color: var(--ember-dim); box-shadow: 0 0 0 3px rgba(226,85,46,0.18); }

/* Listas / linhas */
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.row {
  display: flex; align-items: center; justify-content: space-between; gap: 0.8rem;
  background: linear-gradient(180deg, var(--bg-2), #19130f);
  border: 1px solid var(--line); border-radius: 12px; padding: 0.8rem 0.95rem;
}
.row--clickable { cursor: pointer; transition: border-color .15s, transform .08s; }
.row--clickable:hover { border-color: var(--ember-dim); }
.row--clickable:active { transform: translateY(1px); }
.row__main { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.row__main strong { font-size: 0.98rem; }
.row__sub { color: var(--muted); font-size: 0.85rem; }
.row__meta { display: flex; flex-direction: column; align-items: flex-end; gap: 0.2rem; text-align: right; font-size: 0.85rem; white-space: nowrap; }

/* Badges de status */
.badge { font-size: 0.72rem; padding: 0.15rem 0.5rem; border-radius: 999px; border: 1px solid var(--line); color: var(--cream); }
.badge--pending, .badge--novo { background: rgba(226,85,46,0.16); border-color: var(--ember-dim); }
.badge--delivered, .badge--entregue { background: rgba(120,200,120,0.14); border-color: rgba(120,200,120,0.4); }
.badge--cancelled, .badge--cancelado { background: rgba(255,138,107,0.12); border-color: rgba(255,138,107,0.35); }

/* Paginação */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; margin-top: 1rem; }
.pager__info { color: var(--muted); font-size: 0.82rem; text-align: center; }

/* Estados */
.state { text-align: center; color: var(--muted); padding: 2.5rem 1rem; }
.state__detail { font-size: 0.78rem; opacity: 0.7; margin-top: 0.4rem; }
.state--error { color: var(--danger); }
.spinner {
  display: inline-block; width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid var(--line); border-top-color: var(--ember);
  animation: spin .8s linear infinite; margin-bottom: 0.6rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Kanban */
.kanban-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.rt { font-size: 0.78rem; }
.rt--connecting { color: var(--muted); }
.rt--on { color: #7fd18a; }
.rt--off { color: var(--danger); }
.kanban { display: flex; gap: 0.8rem; overflow-x: auto; padding-bottom: 0.5rem; }
.col { flex: 0 0 240px; background: rgba(255,255,255,0.02); border: 1px solid var(--line); border-radius: 12px; }
.col__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.7rem 0.85rem; font-weight: 600; font-size: 0.85rem;
  border-bottom: 1px solid var(--line); text-transform: capitalize;
}
.col__count { color: var(--muted); font-size: 0.8rem; }
.col__body { padding: 0.6rem; display: flex; flex-direction: column; gap: 0.5rem; max-height: 65dvh; overflow-y: auto; }
.kcard { background: linear-gradient(180deg, var(--bg-2), #19130f); border: 1px solid var(--line); border-radius: 10px; padding: 0.6rem 0.7rem; }
.kcard__top { font-weight: 700; font-size: 0.85rem; color: var(--ember); }
.kcard__name { font-size: 0.92rem; margin-top: 0.1rem; }
.kcard__sub { color: var(--muted); font-size: 0.8rem; }
.kcard__time { color: var(--muted); font-size: 0.72rem; margin-top: 0.25rem; }

/* Modal / sheet de detalhe */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.55); display: grid; place-items: end center; z-index: 50; backdrop-filter: blur(2px); }
.sheet {
  width: 100%; max-width: 520px; max-height: 88dvh; overflow-y: auto;
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 18px 18px 0 0; padding: 1.2rem 1.2rem 2rem;
  animation: rise .25s ease both;
}
@media (min-width: 600px) { .overlay { place-items: center; } .sheet { border-radius: 18px; } }
.sheet__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.8rem; }
.sheet__head h2 { font-family: var(--font-disp); margin: 0; }
.detail { display: grid; grid-template-columns: auto 1fr; gap: 0.5rem 1rem; }
.detail dt { color: var(--muted); font-size: 0.82rem; }
.detail dd { margin: 0; }

/* ====================== Fase 3 — CRUD ====================== */
.actions { display: flex; gap: 0.6rem; margin-top: 1.2rem; }
.actions--end { justify-content: flex-end; }
.actions .btn { width: auto; flex: 1; }
.actions--end .btn { flex: 0 0 auto; }
.btn--auto { width: auto; }
.btn--danger { color: #fff; background: linear-gradient(180deg, #c0392b, #962d22); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 0.7rem; }
@media (max-width: 460px) { .grid2 { grid-template-columns: 1fr; } }

.toggle { display: inline-flex; align-items: center; gap: 0.5rem; margin: 0.6rem 0; font-size: 0.92rem; color: var(--cream); cursor: pointer; }
.toggle input { width: 18px; height: 18px; accent-color: var(--ember); }
.toggle--sm { font-size: 0.82rem; color: var(--muted); margin: 0; }

textarea.search { resize: vertical; font-family: var(--font-body); }

.cat-title { font-family: var(--font-disp); font-weight: 600; font-size: 1.05rem; margin: 1.4rem 0 0.6rem; color: var(--cream); }
.row--off { opacity: 0.55; }

.fs { border-top: 1px solid var(--line); padding-top: 0.4rem; margin-top: 1rem; }
.fs:first-of-type { border-top: none; }

.hours { display: flex; flex-direction: column; gap: 0.5rem; }
.hours__row { display: grid; grid-template-columns: 42px auto 1fr 1fr; align-items: center; gap: 0.5rem; }
.hours__day { font-weight: 600; font-size: 0.85rem; }
.hours .search { padding: 0.45rem 0.5rem; }

.status-actions { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 1rem; }
.status-actions .btn { width: 100%; }

/* Kanban DnD */
.kcard { cursor: pointer; }
.kcard.drag { opacity: 0.5; }
.col--over { outline: 2px dashed var(--ember-dim); outline-offset: -4px; }

/* Toast */
#toast-host { position: fixed; left: 0; right: 0; bottom: 1rem; display: flex; flex-direction: column; align-items: center; gap: 0.4rem; z-index: 80; pointer-events: none; }
.toast { background: #2a201a; color: var(--cream); border: 1px solid var(--line); border-radius: 999px; padding: 0.55rem 1rem; font-size: 0.88rem; box-shadow: var(--shadow); transition: opacity .3s, transform .3s; }
.toast--err { border-color: rgba(255,138,107,0.5); color: var(--danger); }
.toast--out { opacity: 0; transform: translateY(8px); }

/* ====================== Fase 4 — Storefront público ====================== */
.hidden { display: none !important; }
.sf { max-width: 560px; margin: 0 auto; padding: 1.2rem 1rem 3rem; }
.sf__brand { display: flex; align-items: center; gap: 0.5rem; justify-content: center; padding: 0.5rem 0 1.2rem; }
.sf__brand .brand__name { font-size: 1.6rem; }
.sf__sec { border-top: 1px solid var(--line); padding-top: 1rem; margin-top: 1rem; }
.sf__sec h3 { font-family: var(--font-disp); font-weight: 600; font-size: 1.1rem; margin: 0 0 0.7rem; }
.sf__menu { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin-bottom: 0.6rem; }
@media (max-width: 420px) { .sf__menu { grid-template-columns: 1fr; } }
.sf__item {
  display: flex; flex-direction: column; align-items: flex-start; gap: 0.2rem;
  text-align: left; cursor: pointer;
  background: linear-gradient(180deg, var(--bg-2), #19130f);
  border: 1px solid var(--line); border-radius: 12px; padding: 0.7rem 0.8rem;
  color: var(--cream); font-family: var(--font-body); transition: border-color .15s, transform .08s;
}
.sf__item:hover { border-color: var(--ember-dim); }
.sf__item:active { transform: translateY(1px); }
.sf__item--on { border-color: var(--ember); background: rgba(226,85,46,0.14); }
.sf__item-name { font-weight: 600; font-size: 0.95rem; }
.sf__item-price { color: var(--ember); font-size: 0.85rem; }

.sf__summary { border-top: 1px solid var(--line); margin-top: 1.2rem; padding-top: 1rem; }
.sf__line { display: flex; justify-content: space-between; padding: 0.25rem 0; color: var(--muted); }
.sf__line strong { color: var(--cream); }
.sf__line--total { font-size: 1.15rem; padding-top: 0.5rem; margin-top: 0.3rem; border-top: 1px dashed var(--line); }
.sf__line--total span, .sf__line--total strong { color: var(--cream); }
.sf__warn { color: var(--danger); font-size: 0.85rem; margin: 0.5rem 0 0; }
.sf #sf-submit { margin-top: 1.2rem; }
.sf__admin { text-align: center; margin-top: 1.6rem; }
.sf__admin a { color: var(--muted); font-size: 0.8rem; text-decoration: none; }
.sf__admin a:hover { color: var(--ember); }
.sf__closed, .sf__done { text-align: center; padding: 2.5rem 1rem; }
.sf__closed h2, .sf__done h2 { font-family: var(--font-disp); }

.sf__tbc { font-style: italic; color: var(--muted); font-weight: 500; }
