* { box-sizing: border-box; }
body {
  font-family: -apple-system, Segoe UI, Roboto, sans-serif;
  background: #f4f4f6;
  color: #222;
  margin: 0;
}
nav {
  background: #1f2937;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 20px;
}
nav a {
  color: #cbd5e1;
  text-decoration: none;
  font-weight: 600;
}
nav a.active, nav a:hover {
  color: #fff;
}
nav .logout-form { margin-left: auto; }
/* El selector de perfil va siempre pegado a la derecha, justo antes de Salir,
   sin importar cuántos links tenga el menú de cada perfil. */
nav .role-switcher { margin-left: auto; }
nav .role-switcher ~ .logout-form { margin-left: 0; }
.consultas-badge {
  display: inline-flex; align-items: center; gap: 5px; color: #cbd5e1 !important;
  padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; text-decoration: none;
}
.consultas-badge:hover { color: #fff !important; background: #374151; }
.consultas-badge.has-pending { background: #7f1d1d; color: #fff !important; font-weight: 700; }
.consultas-badge.has-pending:hover { background: #991b1b; }
.consultas-badge .badge-count { background: #fff; color: #7f1d1d; border-radius: 999px; padding: 0 6px; font-size: 11px; }
.quejas-badge.has-pending { background: #9a3412; }
.quejas-badge.has-pending:hover { background: #c2410c; }
.quejas-badge .badge-count { color: #9a3412; }
.reservas-badge.has-pending { background: #1d4ed8; }
.reservas-badge.has-pending:hover { background: #1e40af; }
.reservas-badge .badge-count { color: #1d4ed8; }
.role-switcher { display: flex; gap: 4px; background: #111827; padding: 3px; border-radius: 6px; }
.role-switcher form.inline { margin: 0; }
.role-btn { background: transparent; color: #cbd5e1; padding: 5px 10px; font-size: 12px; font-weight: 600; border-radius: 4px; }
.role-btn:hover { background: #374151; }
.role-btn.active { background: #2563eb; color: #fff; }
main {
  max-width: 1000px;
  margin: 32px auto;
  padding: 0 16px;
}
h1 { margin-top: 0; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-scroll table { min-width: 680px; }
table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
th, td {
  padding: 10px 12px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
  vertical-align: middle;
}
th { background: #eef0f3; font-size: 13px; text-transform: uppercase; color: #555; }
input[type=text], input[type=number], input[type=password], select {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font: inherit;
}
td .detail { white-space: pre-wrap; max-width: 320px; }
td.actions { white-space: nowrap; }
td.center { text-align: center; }
form.inline { display: inline; margin-left: 6px; }
button {
  background: #2563eb;
  color: #fff;
  border: none;
  padding: 7px 14px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
}
button:hover { background: #1d4ed8; }
button.danger { background: #dc2626; }
button.danger:hover { background: #b91c1c; }
.add-form {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  background: #fff;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.add-form input { flex: 1; }
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}
.badge-confirmado { background: #fef3c7; color: #92400e; }
.badge-listo { background: #dbeafe; color: #1e40af; }
.badge-entregado { background: #d1fae5; color: #065f46; }
.row-done { opacity: 0.6; }
.kitchen-queue {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.kitchen-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  padding: 16px;
  border-left: 6px solid #f59e0b;
}
.kitchen-card-head {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  font-size: 15px;
  color: #444;
  margin-bottom: 8px;
}
.kitchen-detail {
  white-space: pre-wrap;
  font-size: 18px;
  line-height: 1.4;
  margin-bottom: 14px;
}
.kitchen-card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.kitchen-total { font-weight: 700; font-size: 16px; }
.kitchen-card-foot button { font-size: 15px; padding: 10px 20px; }
.kitchen-empty { color: #777; font-size: 16px; }
.kitchen-card-listo { border-left-color: #2563eb; }
.kitchen-card-done { border-left-color: #10b981; opacity: 0.7; }
.board {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}
.board-column {
  flex: 1;
  min-width: 0;
}
.board-column h2 {
  font-size: 14px;
  text-transform: uppercase;
  color: #555;
  margin: 0 0 12px;
}
.board-column .kitchen-card { margin-bottom: 12px; }
@media (max-width: 800px) {
  .board { flex-direction: column; }
  .board-column { width: 100%; }
}
.login-box {
  max-width: 340px;
  margin: 80px auto;
  background: #fff;
  padding: 32px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.login-box form { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.error { color: #dc2626; font-weight: 600; }
.login-signup-link { margin-top: 16px; font-size: 13px; text-align: center; }
.login-signup-link a { color: #2563eb; }
