/* =====================================================================
   RESTAURANT ERP - Estilos base
   Paleta: Sam Sazón Restaurante (negro carbón + dorado)
   ===================================================================== */

:root {
  --sidebar-w: 260px;
  --sidebar-w-collapsed: 76px;
  --radius: 12px;

  --bg: #f7f5f0;
  --surface: #ffffff;
  --text: #1a1712;
  --text-muted: #78706080;
  --text-muted: #8a7f6a;
  --border: #e8e0d0;
  --primary: #14120f;
  --accent: #c9a227;
  --accent-light: #e3be65;
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --info: #0284c7;
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
}

[data-bs-theme="dark"] {
  --bg: #0d0d0d;
  --surface: #171717;
  --text: #f0e9d8;
  --text-muted: #a89a7a;
  --border: #2b2620;
  --primary: #e3be65;
  --shadow: 0 1px 3px rgba(0,0,0,.5);
}

* { box-sizing: border-box; }

body.app-body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  margin: 0;
}

/* ===================== LOGIN ===================== */
.login-body {
  background: radial-gradient(circle at 50% 20%, #1c1a14 0%, #0d0d0d 60%, #000000 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Inter', sans-serif;
}
.login-wrapper { width: 100%; max-width: 400px; padding: 1rem; }
.login-card {
  background: #171717;
  border: 1px solid #2b2620;
  border-radius: 16px;
  padding: 2.5rem 2rem;
  color: #f0e9d8;
}
.login-card .form-label { color: #d8cba8; }
.login-card .form-control {
  background: #0d0d0d; border: 1px solid #3a3428; color: #f0e9d8;
}
.login-card .form-control:focus {
  background: #0d0d0d; color: #f0e9d8; border-color: #c9a227;
  box-shadow: 0 0 0 .25rem rgba(201,162,39,.25);
}
.login-card .input-group-text { background: #0d0d0d; border: 1px solid #3a3428; color: #c9a227; }
.login-card .text-muted { color: #8a7f6a !important; }
.login-card a { color: #e3be65; }
.login-logo {
  width: 84px; height: 84px; border-radius: 50%;
  overflow: hidden; margin: 0 auto;
  border: 1px solid #3a3428;
}
.login-logo img { width: 100%; height: 100%; object-fit: cover; }
.btn-gold {
  background: linear-gradient(135deg, #e3be65, #c9a227);
  color: #14120f; font-weight: 600; border: none;
}
.btn-gold:hover { background: linear-gradient(135deg, #eecb7f, #d4ad33); color: #14120f; }

/* ===================== SHELL ===================== */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: #14120f;
  border-right: 1px solid #2b2620;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  transition: width .2s ease;
  z-index: 100;
}
.sidebar.collapsed { width: var(--sidebar-w-collapsed); }
.sidebar.collapsed .brand-text,
.sidebar.collapsed .link-text { display: none; }

.sidebar-brand {
  display: flex; align-items: center; gap: .6rem;
  padding: 1rem 1.25rem;
  font-weight: 700;
  border-bottom: 1px solid #2b2620;
  color: #f0e9d8;
}
.sidebar-brand img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; border: 1px solid #3a3428; flex-shrink: 0; }
.sidebar-brand .brand-text { color: #e3be65; }

.sidebar-nav { padding: .75rem; overflow-y: auto; flex: 1; }
.sidebar-link {
  display: flex; align-items: center; gap: .8rem;
  padding: .65rem .85rem;
  border-radius: 10px;
  color: #a89a7a;
  text-decoration: none;
  font-size: .89rem;
  font-weight: 500;
  margin-bottom: .15rem;
  white-space: nowrap;
}
.sidebar-link i { width: 18px; text-align: center; }
.sidebar-link:hover { background: #201c15; color: #f0e9d8; }
.sidebar-link.active { background: linear-gradient(135deg, #c9a227, #a9840f); color: #14120f; font-weight: 600; }

.main-content { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: 64px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1.25rem;
  position: sticky;
  top: 0;
  z-index: 90;
}
.topbar-search {
  align-items: center; gap: .5rem;
  background: var(--bg);
  border-radius: 10px;
  padding: .45rem .9rem;
  width: 320px;
  color: var(--text-muted);
}
.topbar-search input {
  border: none; background: transparent; outline: none;
  width: 100%; color: var(--text); font-size: .85rem;
}
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, #e3be65, #c9a227);
  color: #14120f;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .85rem;
}
.notif-badge { font-size: .6rem; padding: .2em .4em; }
.notif-panel { width: 320px; max-height: 380px; overflow-y: auto; }

.page-content { padding: 1.5rem; flex: 1; }

/* ===================== CARDS / KPI ===================== */
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  height: 100%;
}
.kpi-card .kpi-label { color: var(--text-muted); font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.kpi-card .kpi-value { font-size: 1.7rem; font-weight: 700; margin-top: .25rem; }
.kpi-card .kpi-icon {
  width: 42px; height: 42px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
}
.card-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* Botones y acentos dorados */
.btn-dark {
  background: linear-gradient(135deg, #2a2620, #14120f);
  border: 1px solid #3a3428;
}
.btn-dark:hover { background: linear-gradient(135deg, #3a3428, #201c15); }
a { color: #a9840f; }
a:hover { color: #c9a227; }
.badge.bg-dark { background: #14120f !important; }
::selection { background: #e3be65; color: #14120f; }

/* ===================== MESAS ===================== */
.mesa-plano {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-height: 500px;
  position: relative;
  padding: 1rem;
}
.mesa-item {
  width: 90px; height: 90px;
  border-radius: 14px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: #fff; font-weight: 600; font-size: .8rem;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform .15s;
}
.mesa-item:hover { transform: scale(1.05); }
.mesa-disponible { background: var(--success); }
.mesa-ocupada { background: var(--danger); }
.mesa-preparando { background: var(--warning); }
.mesa-cuenta_solicitada { background: var(--info); }
.mesa-reservada { background: #6b7280; }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 768px) {
  .sidebar { position: fixed; left: -100%; height: 100vh; }
  .sidebar.mobile-open { left: 0; }
  .topbar-search { display: none !important; }
}
