:root{
  --navy:#0B2B4B; --navy-2:#0A5A75; --ocean:#0D6F91; --gold:#2CA4C7;
  --ink:#10242F; --muted:#64707A; --line:#E1E7EA; --paper:#F7F9FA; --white:#FFFFFF;
  --danger:#B3471C; --ok:#1E7A4C; --radius:12px;
  --shadow:0 8px 24px rgba(11,43,75,.10);
}
*{ box-sizing:border-box }
body{
  margin:0; font-family:-apple-system,"Segoe UI",Roboto,Arial,sans-serif;
  background:var(--paper); color:var(--ink); -webkit-font-smoothing:antialiased;
}
.hidden{ display:none !important }
a{ color:var(--ocean) }

/* ---------- Login / registro ---------- */
.auth-wrap{
  min-height:100vh; display:flex; align-items:center; justify-content:center; padding:24px;
}
.auth-card{
  width:100%; max-width:380px; background:var(--white); border-radius:var(--radius);
  box-shadow:var(--shadow); padding:32px 28px; border:1px solid var(--line);
}
.auth-brand{ text-align:center; margin-bottom:22px }
.auth-brand h1{ font-size:19px; margin:10px 0 2px; color:var(--navy) }
.auth-brand p{ margin:0; font-size:13px; color:var(--muted) }
.auth-brand .dot{
  width:44px; height:44px; border-radius:50%; background:var(--navy); color:#fff;
  display:flex; align-items:center; justify-content:center; margin:0 auto 10px; font-size:20px;
}
.field{ margin-bottom:14px }
.field label{ display:block; font-size:13px; font-weight:600; color:var(--navy); margin-bottom:5px }
.field input{
  width:100%; padding:11px 12px; border:1px solid var(--line); border-radius:9px;
  font-size:15px; background:#fff;
}
.field input:focus{ outline:2px solid var(--ocean); outline-offset:1px }
.otp-input{ letter-spacing:8px; font-size:22px; text-align:center; font-weight:700 }
.btn{
  width:100%; padding:12px; border:0; border-radius:9px; background:var(--navy); color:#fff;
  font-weight:700; font-size:15px; cursor:pointer; transition:background .15s;
}
.btn:hover{ background:var(--navy-2) }
.btn:disabled{ background:var(--line); color:var(--muted); cursor:not-allowed }
.btn-link{
  width:100%; background:none; border:0; color:var(--ocean); font-size:13px; padding:10px; cursor:pointer;
}
.msg{ font-size:13px; padding:10px 12px; border-radius:8px; margin-bottom:14px; display:none }
.msg.show{ display:block }
.msg.error{ background:#FBE7E0; color:var(--danger) }
.msg.ok{ background:#E3F3EA; color:var(--ok) }
.msg.info{ background:#E6F2F6; color:var(--navy-2) }

/* ---------- Panel ---------- */
.topbar{
  background:var(--navy); color:#fff; padding:14px 20px; display:flex; align-items:center;
  justify-content:space-between; gap:12px; position:sticky; top:0; z-index:5;
}
.topbar .who{ font-size:13px; opacity:.85 }
.topbar h1{ font-size:16px; margin:0 }
.topbar-left{ display:flex; align-items:center; gap:10px }
.logout-btn{ background:rgba(255,255,255,.12); border:0; color:#fff; padding:8px 12px; border-radius:8px; font-size:13px; cursor:pointer }
.logout-btn:hover{ background:rgba(255,255,255,.22) }

.container{ max-width:1000px; margin:0 auto; padding:20px 16px 60px }
.panel-header{ display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:16px; flex-wrap:wrap }
.panel-header h2{ margin:0; font-size:20px; color:var(--navy) }

.table-wrap{ background:#fff; border:1px solid var(--line); border-radius:var(--radius); overflow:hidden; box-shadow:var(--shadow) }
table{ width:100%; border-collapse:collapse; font-size:14px }
thead th{ text-align:left; background:var(--paper); color:var(--navy); font-size:12px; text-transform:uppercase; letter-spacing:.04em; padding:12px; border-bottom:1px solid var(--line) }
tbody td{ padding:10px 12px; border-bottom:1px solid var(--line); vertical-align:middle }
tbody tr:last-child td{ border-bottom:0 }
tbody tr:hover{ background:#FAFBFC }
.thumb{ width:44px; height:44px; border-radius:8px; object-fit:cover; background:var(--line) }
.thumb-empty{ width:44px; height:44px; border-radius:8px; background:var(--line); display:flex; align-items:center; justify-content:center; font-size:18px }
.badge{ font-size:11px; font-weight:700; padding:3px 9px; border-radius:999px; white-space:nowrap }
.badge-disponible{ background:#E3F3EA; color:var(--ok) }
.badge-agotado{ background:#FDF0DC; color:#8A5A00 }
.badge-oculto{ background:#EDEFF1; color:var(--muted) }
.edit-link{ background:none; border:1px solid var(--line); border-radius:7px; padding:6px 12px; font-size:13px; cursor:pointer; color:var(--navy) }
.edit-link:hover{ background:var(--paper) }

/* ---------- Modal / formulario de plato ---------- */
.modal-overlay{
  position:fixed; inset:0; background:rgba(10,20,30,.5); display:flex; align-items:flex-start;
  justify-content:center; padding:30px 16px; overflow-y:auto; z-index:20;
}
.modal{
  width:100%; max-width:480px; background:#fff; border-radius:var(--radius); padding:24px;
  box-shadow:var(--shadow);
}
.modal h3{ margin:0 0 16px; color:var(--navy) }
.field textarea{ width:100%; padding:11px 12px; border:1px solid var(--line); border-radius:9px; font-size:14px; font-family:inherit; min-height:70px; resize:vertical }
.field select{ width:100%; padding:11px 12px; border:1px solid var(--line); border-radius:9px; font-size:15px; background:#fff }
.radio-row{ display:flex; gap:16px; flex-wrap:wrap }
.radio-row label{ display:flex; align-items:center; gap:6px; font-size:14px; cursor:pointer }
.photo-row{ display:flex; align-items:center; gap:12px; margin-bottom:14px }
.photo-row img{ width:64px; height:64px; border-radius:9px; object-fit:cover; border:1px solid var(--line); background:var(--paper) }
.photo-row input[type=file]{ font-size:13px }
.modal-actions{ display:flex; gap:10px; margin-top:18px }
.modal-actions .btn-secondary{ background:var(--paper); color:var(--navy); border:1px solid var(--line) }
.modal-actions .btn-secondary:hover{ background:var(--line) }

.empty-state{ text-align:center; padding:40px 20px; color:var(--muted) }
.loading{ text-align:center; padding:40px 20px; color:var(--muted) }

@media (max-width: 640px){
  thead{ display:none }
  table, tbody, tr, td{ display:block; width:100% }
  tbody tr{ border-bottom:1px solid var(--line); padding:12px; display:flex; flex-wrap:wrap; align-items:center; gap:8px }
  tbody td{ border:0; padding:2px 0 }
  tbody td.col-edit{ margin-left:auto }
}
