/* ============================================================
   CRV RESTAURANTE — Estilos compartilhados
   ============================================================ */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --brand: #E8642A;
  --brand-dark: #C04E1A;
  --brand-light: #FFF0E8;
  --sidebar-bg: #1A1208;
  --sidebar-text: #C8B89A;
  --bg: #FAF7F2;
  --card-bg: #FFFFFF;
  --surface: #F5F2EC;
  --border: rgba(0,0,0,0.08);
  --text: #1A1208;
  --muted: #6B5E47;
  --success: #2D7A3A;
  --success-bg: #EAF5EC;
  --danger: #A32D2D;
  --danger-bg: #FCEBEB;
  --warning: #854F0B;
  --warning-bg: #FAEEDA;
  --info: #185FA5;
  --info-bg: #E6F1FB;
  --font: 'Georgia', 'Times New Roman', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --radius: 10px;
  --radius-lg: 14px;
}

body {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

/* ============== BOTÕES ============== */
.btn {
  padding: 8px 16px; border-radius: 8px; font-size: 13px;
  border: 1px solid var(--border); background: var(--card-bg);
  color: var(--text); display: inline-flex; align-items: center;
  gap: 6px; transition: all 0.15s; font-weight: 500;
}
.btn:hover { background: var(--surface); }
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn-primary:hover { background: var(--brand-dark); }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 12px 20px; font-size: 15px; }
.btn-block { width: 100%; justify-content: center; }
.btn-icon { padding: 7px; width: 32px; height: 32px; justify-content: center; }

/* ============== FORM ============== */
.form-group { margin-bottom: 14px; }
.form-label {
  display: block; font-size: 12px; font-weight: 500;
  color: var(--muted); margin-bottom: 5px;
}
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 8px; font-size: 14px; background: var(--card-bg);
  color: var(--text); transition: border-color 0.15s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(232,100,42,0.12);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-textarea { resize: vertical; min-height: 70px; }

/* ============== CARDS ============== */
.card {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 18px;
}

/* ============== BADGES ============== */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 20px;
  font-size: 11px; font-weight: 600;
}
.badge-green { background: var(--success-bg); color: var(--success); }
.badge-orange { background: var(--brand-light); color: var(--brand-dark); }
.badge-red { background: var(--danger-bg); color: var(--danger); }
.badge-blue { background: var(--info-bg); color: var(--info); }
.badge-gray { background: var(--surface); color: var(--muted); }
.badge-amber { background: #FAEEDA; color: var(--warning); }
.badge-purple { background: #EEEDFE; color: #534AB7; }

/* ============== UTIL ============== */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; }
.text-muted { color: var(--muted); }
.text-sm { font-size: 12px; } .text-xs { font-size: 11px; }
.text-lg { font-size: 16px; } .text-xl { font-size: 20px; } .text-2xl { font-size: 24px; }
.font-bold { font-weight: 600; } .font-semibold { font-weight: 500; }
.text-center { text-align: center; }
.hidden { display: none !important; }

/* ============== MODAL ============== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 16px; backdrop-filter: blur(2px);
}
.modal {
  background: var(--card-bg); border-radius: var(--radius-lg);
  padding: 24px; max-width: 480px; width: 100%; max-height: 90vh;
  overflow-y: auto; position: relative;
}
.modal-title { font-size: 17px; font-weight: 600; margin-bottom: 16px; }
.modal-close {
  position: absolute; top: 14px; right: 14px;
  background: none; border: none; color: var(--muted);
  font-size: 22px; line-height: 1; padding: 4px;
}
.modal-footer {
  display: flex; gap: 8px; justify-content: flex-end;
  margin-top: 20px; padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* ============== TOAST ============== */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  background: var(--text); color: #fff; padding: 12px 20px;
  border-radius: 8px; font-size: 13px; z-index: 2000;
  animation: toastIn 0.3s ease; max-width: 300px;
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
@keyframes toastIn { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ============== SCROLL ============== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.25); }

/* ============== TOGGLE SWITCH ============== */
.toggle {
  position: relative; width: 38px; height: 22px;
  background: #ccc; border-radius: 11px; cursor: pointer;
  border: none; transition: background 0.2s; flex-shrink: 0;
}
.toggle.on { background: var(--brand); }
.toggle::after {
  content: ''; position: absolute; width: 18px; height: 18px;
  background: #fff; border-radius: 50%; top: 2px; left: 2px;
  transition: left 0.2s; box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle.on::after { left: 18px; }

/* ============== LOADING ============== */
.loading {
  display: inline-block; width: 18px; height: 18px;
  border: 2px solid rgba(232,100,42,0.2);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============== RESPONSIVO ============== */
@media (max-width: 768px) {
  .form-row { grid-template-columns: 1fr; }
}
