/* Painel Admin - Portal do Sabor */
:root {
  --bg: #0e1524;
  --panel: #ffffff;
  --ink: #1c2430;
  --muted: #6b7684;
  --line: #e3e7ee;
  --brand: #071a3b;
  --accent: #2563a8;
  --accent-2: #3b82f6;
  --ok: #17924b;
  --danger: #d64545;
  --soft: #f4f6fa;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--soft);
  color: var(--ink);
  min-height: 100vh;
}

/* ---------- Login ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 50% -10%, rgba(58,108,172,.35) 0%, rgba(7,26,59,0) 46%),
    linear-gradient(180deg, #0b2148 0%, #071a3b 55%, #061532 100%);
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--panel);
  border-radius: 16px;
  padding: 28px 26px;
  box-shadow: 0 24px 60px rgba(0,0,0,.35);
}
.login-card .brand { margin-bottom: 22px; }

.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  color: #fff; flex: none;
}
.brand-title { font-weight: 800; font-size: 17px; letter-spacing: .2px; }
.brand-sub { font-size: 12px; color: var(--muted); }

.fld { display: block; margin: 0 0 14px; }
.fld > span { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.fld input[type="text"], .fld input[type="password"] {
  width: 100%; padding: 11px 12px; border: 1.5px solid var(--line); border-radius: 10px;
  font-size: 15px; color: var(--ink); background: #fff; outline: none;
}
.fld input:focus { border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(59,130,246,.15); }
.fld.inline { display: flex; align-items: center; gap: 12px; margin: 0; }
.fld.inline > span { margin: 0; white-space: nowrap; }
.fld.inline input { max-width: 340px; }

.pwd { display: flex; gap: 8px; }
.pwd input { flex: 1; }
.eye {
  border: 1.5px solid var(--line); background: #fff; border-radius: 10px;
  padding: 0 12px; font-size: 13px; color: var(--accent); cursor: pointer; font-weight: 600;
}
.erro { color: var(--danger); font-size: 13px; margin-bottom: 12px; font-weight: 600; }
.hint { margin-top: 14px; font-size: 12px; color: var(--muted); line-height: 1.5; }
.hint code { background: var(--soft); padding: 1px 6px; border-radius: 5px; }

/* ---------- Botoes ---------- */
.btn {
  border: 1.5px solid var(--line); background: #fff; color: var(--ink);
  padding: 10px 16px; border-radius: 10px; font-size: 14px; font-weight: 700;
  cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
}
.btn:hover { border-color: #cfd6e2; }
.btn.primary { background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%); color: #fff; border: none; }
.btn.primary:hover { filter: brightness(1.05); }
.btn.ghost { background: transparent; }
.btn.big { padding: 14px 26px; font-size: 16px; }
.btn.mini { padding: 6px 10px; font-size: 12px; border-radius: 8px; }
.btn.danger { color: var(--danger); border-color: #f0cccc; }
.btn.danger:hover { background: #fdf3f3; }
.btn.nilton-btn { background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%); color: #fff; border: none; }
.btn.nilton-btn:hover { filter: brightness(1.06); }

/* ---------- Topbar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 22px; background: var(--panel); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.top-actions { display: flex; align-items: center; gap: 10px; }
.save-state { font-size: 13px; color: var(--muted); }

/* ---------- Editor ---------- */
.editor { max-width: 980px; margin: 0 auto; padding: 22px; }
.tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.tab {
  border: 1.5px solid var(--line); background: #fff; color: var(--muted);
  padding: 10px 20px; border-radius: 10px; font-weight: 800; font-size: 15px; cursor: pointer;
}
.tab.active { background: var(--brand); color: #fff; border-color: var(--brand); }

.tv-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 16px;
  flex-wrap: wrap;
}
.tv-head-actions { display: flex; gap: 8px; }

.secao {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; margin-bottom: 16px;
}
.secao-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.secao-head input {
  flex: 1; font-size: 16px; font-weight: 800; color: var(--brand);
  border: none; border-bottom: 2px solid var(--line); padding: 6px 2px; outline: none; background: transparent;
}
.secao-head input:focus { border-color: var(--accent-2); }

.itens { display: flex; flex-direction: column; gap: 8px; }
.linha {
  display: grid; grid-template-columns: 1fr 130px 36px; gap: 10px; align-items: center;
}
.linha input {
  width: 100%; padding: 9px 11px; border: 1.5px solid var(--line); border-radius: 9px; font-size: 14px; outline: none;
}
.linha input:focus { border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(59,130,246,.12); }
.linha .preco { text-align: right; font-weight: 700; }
.rm {
  width: 34px; height: 34px; border-radius: 9px; border: 1.5px solid #f0cccc; background: #fff;
  color: var(--danger); font-size: 18px; line-height: 1; cursor: pointer;
}
.rm:hover { background: #fdf3f3; }
.linha-head { font-size: 12px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }

.secao-foot { margin-top: 12px; display: flex; justify-content: space-between; align-items: center; }

.save-bar {
  position: sticky; bottom: 0; background: linear-gradient(180deg, rgba(244,246,250,0), var(--soft) 40%);
  padding: 18px 0 24px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.save-note { font-size: 13px; color: var(--muted); }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; background: rgba(6,12,26,.55); display: flex; align-items: center; justify-content: center; z-index: 50; }
.modal[hidden] { display: none; }
.modal-card { background: #fff; border-radius: 14px; padding: 22px; width: 100%; max-width: 360px; box-shadow: 0 24px 60px rgba(0,0,0,.35); }
.modal-card h3 { margin: 0 0 16px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 10px; font-weight: 600; font-size: 14px;
  opacity: 0; pointer-events: none; transition: all .3s ease; z-index: 60;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.ok { background: var(--ok); }
.toast.err { background: var(--danger); }

@media (max-width: 560px) {
  .linha { grid-template-columns: 1fr 100px 34px; }
  .fld.inline { flex-direction: column; align-items: stretch; }
  .fld.inline input { max-width: none; }
}
