/* ==========================
   RESET E BASE
========================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Arial, sans-serif;
  background: #fff8f0;
  color: #333;
  line-height: 1.4;
}

/* Links */
a { color: inherit; text-decoration: none; cursor: pointer; }
a:hover { opacity: .85; }

/* ==========================
   HEADER E NAV
========================== */
header {
  background: #fff3e0;
  color: #d32f2f;
  padding: 1rem;
  display: flex;
  align-items: center;
  border-bottom: 1px solid #ccc;
  position: relative;
  z-index: 2;
}
.menu-btn {
  font-size: 28px;
  background: none;
  border: none;
  color: #d32f2f;
  cursor: pointer;
  margin-right: 1rem;
}
.logo { height: 64px; margin-right: 1rem; }
h1 { margin: 0; font-size: 1.6rem; }
.right {
  margin-left: auto;
  display: flex;
  gap: .75rem;
  align-items: center;
}
.pill {
  background: #fff;
  border: 1px solid #ffd6c9;
  color: #c62828;
  padding: .35rem .6rem;
  border-radius: 999px;
  font-weight: bold;
  font-size: 0.9rem;
}

/* ==========================
   SIDEBAR
========================== */
#sidebar {
  position: fixed;
  top: 0;
  left: -250px;
  width: 220px;
  height: 100%;
  background: #fff3e0;
  box-shadow: 2px 0 5px rgba(0,0,0,.2);
  padding: 1rem;
  transition: left .3s;
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
#sidebar.open { left: 0; }
#overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  display: none;
  z-index: 2;
}
#sidebar.open ~ #overlay { display: block; }
#sidebar ul { list-style: none; padding: 0; margin: 0; }
#sidebar li { margin: 1rem 0; }
#sidebar a { color: #d32f2f; font-weight: bold; }

/* ==========================
   RODAPÉ LATERAL
========================== */
.rodape {
  font-size: .75rem;
  color: #000;
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid #ccc;
}
.rodape img { width: 30px; margin-bottom: .5rem; }
.rodape span { font-weight: bold; color: #d32f2f; }

/* ==========================
   MAIN / CARDÁPIO
========================== */
main { padding: 1rem; }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill,minmax(220px,1fr));
  gap: 12px;
}
.card {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 10px;
  overflow: hidden;
  transition: transform .2s;
}
.card:hover { transform: translateY(-3px); }
.card img { width: 100%; height: 140px; object-fit: cover; }
.card .info { padding: .75rem; }
.card .name { font-weight: bold; }
.card .price {
  color: #d32f2f;
  font-weight: bold;
  margin-top: .25rem;
}
.btn {
  background: #d32f2f;
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: .5rem .8rem;
  cursor: pointer;
  font-weight: 500;
}
.btn:hover { opacity: .9; }

/* ==========================
   BOAS-VINDAS
========================== */
.welcome-box {
  text-align:center;
  padding:2rem;
  color:#444;
  background:#fff;
  border-radius:12px;
  margin:1rem auto;
  max-width:700px;
}
.welcome-box h2 { margin-bottom:1rem; }

/* ==========================
   BADGES / ESTADOS
========================== */
.mode-badge {
  display:inline-block;
  margin:.2rem auto 0;
  padding:.15rem .5rem;
  border-radius:999px;
  border:1px solid #ffd6c9;
  color:#c62828;
  background:#fff;
  font-weight:bold;
  font-size:.85rem;
}
.user-badge {
  background:#c62828;
  color:#fff;
  font-weight:bold;
  border-radius:50%;
  width:32px;
  height:32px;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
}

/* ==========================
   ADMIN: CARDS / FORMULÁRIOS
========================== */
.row { display:flex; gap:16px; flex-wrap:wrap; }
.card-admin {
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:12px;
  box-shadow:0 1px 2px rgba(0,0,0,.05);
  padding:16px;
  flex:1;
  min-width:280px;
}
.card-admin h2 { font-size:16px; margin:0 0 12px; }
label { display:block; font-size:12px; color:#4b5563; margin:8px 0 4px; }
input,select,textarea {
  width:100%;
  border:1px solid #d1d5db;
  border-radius:10px;
  padding:10px;
  font:inherit;
  outline:none;
}
input:focus,select:focus,textarea:focus {
  border-color:#6366f1;
  box-shadow:0 0 0 3px rgba(99,102,241,.15);
}
.actions { display:flex; gap:8px; margin-top:12px; flex-wrap:wrap; }
.btn-primary { background:#111827; color:#fff; }
.btn-secondary { background:#e5e7eb; }
.btn-danger { background:#ef4444; color:#fff; }

/* ==========================
   ADMIN: TABELAS
========================== */
table { width:100%; border-collapse:collapse; }
th,td {
  padding:10px;
  border-bottom:1px solid #eee;
  text-align:left;
  font-size:14px;
}
th { background:#f9fafb; font-weight:600; }
.right { display:flex; justify-content:flex-end; }

.pill.ok {
  background:#dcfce7;
  color:#166534;
  border:1px solid #86efac;
}
.pill.off {
  background:#fee2e2;
  color:#991b1b;
  border:1px solid #fecaca;
}

/* ==========================
   ADMIN: MODAL
========================== */
.modal-backdrop {
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.5);
  display:none;
  align-items:center;
  justify-content:center;
  padding:16px;
  z-index:50;
}
.modal {
  background:#fff;
  border-radius:12px;
  max-width:400px;
  width:100%;
  padding:16px;
  border:1px solid #e5e7eb;
}
.modal h3 { margin:0 0 8px; }
.err { color:#b91c1c; font-size:13px; margin-top:6px; }
.okmsg { color:#065f46; font-size:13px; margin-top:6px; }

/* ==========================
   RESPONSIVIDADE
========================== */
@media (max-width: 1024px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(180px,1fr)); }
  .logo { height: 56px; }
}
@media (max-width: 768px) {
  header { flex-wrap: wrap; justify-content: center; text-align: center; }
  .logo { height: 48px; margin: 0 auto; }
  .right { margin-left: 0; flex-wrap: wrap; justify-content: center; }
  h1 { font-size: 1.2rem; }
  .row { flex-direction: column; }
}
@media (max-width: 480px) {
  .pill, .btn { font-size: 0.8rem; padding: 0.4rem 0.6rem; }
  h1 { font-size: 1rem; }
}
