/* ═══════════════════════════════════════════════
   BRASSERIE SPORTIVE — iOS-inspired Dark Theme
   ═══════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

:root {
  --bg-0: #070B11;
  --bg-1: #0D1117;
  --bg-2: #161B22;
  --bg-3: #21262D;
  --glass: rgba(255,255,255,0.05);
  --glass-md: rgba(255,255,255,0.08);
  --glass-border: rgba(255,255,255,0.1);
  --glass-border-md: rgba(255,255,255,0.15);
  --accent: #F59E0B;
  --accent-dim: rgba(245,158,11,0.15);
  --accent-glow: rgba(245,158,11,0.4);
  --blue: #3B82F6;
  --blue-dim: rgba(59,130,246,0.15);
  --green: #10B981;
  --green-dim: rgba(16,185,129,0.15);
  --red: #EF4444;
  --red-dim: rgba(239,68,68,0.15);
  --purple: #8B5CF6;
  --purple-dim: rgba(139,92,246,0.15);
  --pink: #EC4899;
  --orange: #F97316;
  --text-1: #F0F6FC;
  --text-2: #C9D1D9;
  --text-3: #8B949E;
  --text-4: #484F58;
  --r-xs: 8px;
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-2xl: 36px;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md: 0 8px 32px rgba(0,0,0,0.4);
  --shadow-lg: 0 20px 60px rgba(0,0,0,0.5);
  --shadow-accent: 0 8px 32px rgba(245,158,11,0.25);
  --sidebar-w: 240px;
  --topbar-h: 60px;
  --mobile-nav-h: 70px;
  --transition: cubic-bezier(0.34, 1.56, 0.64, 1);
  --transition-fast: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'SF Pro Display', sans-serif;
  background: var(--bg-1);
  color: var(--text-1);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ═══ SCROLLBARS ═══ */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-3); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-4); }

/* ═══════════════════════════════════════════════
   LOGIN PAGE
   ═══════════════════════════════════════════════ */

.login-bg {
  position: fixed; inset: 0;
  background: radial-gradient(ellipse 80% 60% at 20% 40%, rgba(245,158,11,0.08) 0%, transparent 60%),
              radial-gradient(ellipse 60% 50% at 80% 70%, rgba(59,130,246,0.08) 0%, transparent 55%),
              var(--bg-0);
  z-index: 0;
}

.login-bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  animation: orbFloat 8s ease-in-out infinite;
  pointer-events: none;
}
.orb1 { width: 400px; height: 400px; background: rgba(245,158,11,0.12); top: -100px; left: -100px; animation-delay: 0s; }
.orb2 { width: 300px; height: 300px; background: rgba(59,130,246,0.1); bottom: -50px; right: -50px; animation-delay: 3s; }
.orb3 { width: 200px; height: 200px; background: rgba(139,92,246,0.1); top: 50%; left: 50%; animation-delay: 5s; }

@keyframes orbFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-30px) scale(1.05); }
}

.login-container {
  position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.login-card {
  width: 100%; max-width: 400px;
  background: rgba(22, 27, 34, 0.8);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-2xl);
  padding: 40px 36px;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255,255,255,0.02) inset;
  animation: cardIn 0.6s var(--transition) both;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(30px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.login-logo { text-align: center; margin-bottom: 32px; }

.logo-icon {
  font-size: 52px; display: block;
  filter: drop-shadow(0 4px 16px rgba(245,158,11,0.4));
  animation: logoBounce 2s var(--transition) infinite;
}
@keyframes logoBounce {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.login-title {
  font-size: 28px; font-weight: 800; line-height: 1.2;
  color: var(--text-1); margin-top: 12px;
}
.login-title span { color: var(--accent); }
.login-subtitle { color: var(--text-3); font-size: 14px; margin-top: 6px; }

.login-form { display: flex; flex-direction: column; gap: 16px; }

.form-group {
  position: relative;
}

.form-group input {
  width: 100%;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-md);
  padding: 14px 44px 14px 16px;
  color: var(--text-1);
  font-size: 15px;
  font-family: inherit;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  outline: none;
}

.form-group input:focus {
  border-color: var(--accent);
  background: rgba(245,158,11,0.06);
  box-shadow: 0 0 0 3px rgba(245,158,11,0.15);
}

.float-label label {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  color: var(--text-3); font-size: 15px;
  transition: all 0.2s ease;
  pointer-events: none;
}
.float-label input:focus ~ label,
.float-label input:not(:placeholder-shown) ~ label {
  top: -8px; transform: none;
  font-size: 11px; font-weight: 600;
  color: var(--accent);
  background: var(--bg-2); padding: 0 6px;
  border-radius: 4px;
}

.form-icon {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  font-size: 18px; cursor: pointer;
  user-select: none;
}

/* ═══ SETUP STEPS ═══ */
.setup-card { max-width: 420px; }
.setup-steps { display: flex; align-items: center; justify-content: center; gap: 0; margin-bottom: 32px; }
.step {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--bg-3); border: 2px solid var(--glass-border);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: var(--text-3);
  transition: all 0.3s var(--transition);
}
.step.active {
  background: var(--accent); border-color: var(--accent);
  color: #000; box-shadow: 0 0 20px var(--accent-glow);
  transform: scale(1.1);
}
.step.done { background: var(--green); border-color: var(--green); color: #fff; }
.step-line { flex: 1; height: 2px; background: var(--bg-3); max-width: 48px; }
.setup-title { font-size: 22px; font-weight: 700; margin-bottom: 8px; text-align: center; }
.setup-desc { color: var(--text-3); font-size: 14px; margin-bottom: 24px; text-align: center; }
.setup-step { display: flex; flex-direction: column; gap: 14px; }
.setup-step.hidden { display: none; }

.password-strength { display: flex; align-items: center; gap: 8px; }
.strength-bars { display: flex; gap: 4px; flex: 1; }
.bar { height: 4px; flex: 1; border-radius: 2px; background: var(--bg-3); transition: all 0.3s; }
.bar.weak { background: var(--red); }
.bar.medium { background: var(--accent); }
.bar.strong { background: var(--green); }
#strengthLabel { font-size: 12px; color: var(--text-3); min-width: 60px; }

.login-footer { text-align: center; margin-top: 24px; color: var(--text-4); font-size: 12px; }

/* ═══════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════ */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: var(--r-md);
  font-size: 15px; font-weight: 600; font-family: inherit;
  border: none; cursor: pointer;
  transition: all 0.2s var(--transition-fast);
  position: relative; overflow: hidden;
  text-decoration: none;
  user-select: none;
}
.btn:active { transform: scale(0.97); }

.btn::before {
  content: ''; position: absolute; inset: 0;
  background: rgba(255,255,255,0.08);
  opacity: 0; transition: opacity 0.15s;
}
.btn:hover::before { opacity: 1; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #E67E22);
  color: #000; font-weight: 700;
  box-shadow: var(--shadow-accent);
}
.btn-primary:hover { box-shadow: 0 12px 40px rgba(245,158,11,0.4); transform: translateY(-1px); }

.btn-secondary {
  background: var(--glass-md); border: 1px solid var(--glass-border);
  color: var(--text-1);
}
.btn-danger { background: rgba(239,68,68,0.15); border: 1px solid rgba(239,68,68,0.3); color: var(--red); }
.btn-success { background: rgba(16,185,129,0.15); border: 1px solid rgba(16,185,129,0.3); color: var(--green); }
.btn-ghost { background: transparent; color: var(--text-3); }
.btn-ghost:hover { background: var(--glass); color: var(--text-1); }
.btn-full { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: var(--r-sm); }
.btn-icon { padding: 10px; min-width: 40px; height: 40px; }

.btn-loader { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════
   APP LAYOUT
   ═══════════════════════════════════════════════ */

#app {
  display: flex; min-height: 100vh;
}

/* ═══ SIDEBAR ═══ */
.sidebar {
  width: var(--sidebar-w);
  height: 100vh; position: fixed; left: 0; top: 0;
  background: rgba(13, 17, 23, 0.95);
  backdrop-filter: blur(24px);
  border-right: 1px solid var(--glass-border);
  display: flex; flex-direction: column;
  z-index: 200;
  transition: width 0.3s var(--transition-fast), transform 0.3s var(--transition-fast);
  overflow: hidden;
}

.sidebar.collapsed { width: 72px; }

.sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 16px 16px;
  border-bottom: 1px solid var(--glass-border);
  min-height: 72px;
}

.sidebar-logo {
  display: flex; align-items: center; gap: 10px;
  overflow: hidden; white-space: nowrap;
}
.sidebar-logo-icon { font-size: 28px; flex-shrink: 0; }
.sidebar-logo-text { display: flex; flex-direction: column; }
.sidebar-brand { font-size: 14px; font-weight: 800; color: var(--text-1); line-height: 1.2; }
.sidebar-sub { font-size: 11px; color: var(--accent); font-weight: 600; letter-spacing: 0.5px; }

.sidebar-toggle {
  background: var(--glass); border: 1px solid var(--glass-border);
  border-radius: var(--r-xs); width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text-3); font-size: 16px;
  flex-shrink: 0;
  transition: all 0.2s;
}
.sidebar-toggle:hover { color: var(--text-1); background: var(--glass-md); }
.sidebar.collapsed .sidebar-toggle { transform: rotate(180deg); }

.nav-group {
  padding: 12px 10px 4px;
  overflow: hidden;
}
.nav-label {
  font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  color: var(--text-4); padding: 0 8px 8px;
  display: block; white-space: nowrap;
  transition: opacity 0.2s;
}
.sidebar.collapsed .nav-label { opacity: 0; }

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--r-sm);
  color: var(--text-3); text-decoration: none;
  transition: all 0.18s;
  cursor: pointer;
  position: relative; white-space: nowrap;
  margin-bottom: 2px;
}
.nav-item:hover { background: var(--glass-md); color: var(--text-1); }
.nav-item.active {
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 600;
  border: 1px solid rgba(245,158,11,0.2);
}
.nav-item.active .nav-icon { filter: drop-shadow(0 0 6px var(--accent)); }

.nav-icon { font-size: 18px; flex-shrink: 0; width: 24px; text-align: center; }
.nav-text { font-size: 14px; overflow: hidden; transition: opacity 0.2s, max-width 0.3s; white-space: nowrap; }
.sidebar.collapsed .nav-text { opacity: 0; max-width: 0; }

.nav-badge {
  margin-left: auto; background: var(--accent); color: #000;
  font-size: 10px; font-weight: 700; padding: 2px 6px;
  border-radius: 99px; min-width: 18px; text-align: center;
}
.nav-badge-red { background: var(--red); color: #fff; }

.sidebar-footer {
  margin-top: auto;
  padding: 12px 10px;
  border-top: 1px solid var(--glass-border);
  display: flex; align-items: center; gap: 8px;
}

.user-card {
  display: flex; align-items: center; gap: 10px; flex: 1;
  padding: 8px 10px; border-radius: var(--r-sm);
  cursor: pointer; overflow: hidden;
  transition: background 0.2s;
}
.user-card:hover { background: var(--glass-md); }

.user-avatar {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: rgba(0,0,0,0.8);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.user-info { overflow: hidden; white-space: nowrap; min-width: 0; }
.user-name { font-size: 13px; font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: var(--text-3); display: block; }

.sidebar.collapsed .user-info { display: none; }

.btn-logout {
  background: transparent; border: none; cursor: pointer;
  color: var(--text-3); font-size: 18px; padding: 8px;
  border-radius: var(--r-xs); flex-shrink: 0;
  transition: all 0.2s;
}
.btn-logout:hover { color: var(--red); background: var(--red-dim); }

/* ═══ MAIN WRAPPER ═══ */
.main-wrapper {
  margin-left: var(--sidebar-w);
  flex: 1; display: flex; flex-direction: column;
  min-height: 100vh;
  transition: margin-left 0.3s var(--transition-fast);
}
.sidebar.collapsed ~ .main-wrapper { margin-left: 72px; }

/* ═══ TOPBAR ═══ */
.topbar {
  height: var(--topbar-h);
  background: rgba(13,17,23,0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  position: sticky; top: 0; z-index: 100;
}

.topbar-left { display: flex; align-items: center; gap: 12px; }
.menu-toggle {
  display: none; background: none; border: none;
  color: var(--text-2); font-size: 22px; cursor: pointer; padding: 4px;
}

.breadcrumb { font-size: 16px; font-weight: 600; color: var(--text-1); }

.topbar-right { display: flex; align-items: center; gap: 8px; }
.topbar-clock { font-size: 13px; color: var(--text-3); font-variant-numeric: tabular-nums; }

.topbar-btn {
  background: var(--glass); border: 1px solid var(--glass-border);
  border-radius: var(--r-sm); padding: 8px 12px;
  color: var(--text-2); cursor: pointer; font-size: 16px;
  display: flex; align-items: center; gap: 6px;
  transition: all 0.2s; position: relative;
}
.topbar-btn:hover { background: var(--glass-md); color: var(--text-1); }

.notif-badge {
  background: var(--red); color: #fff;
  font-size: 10px; font-weight: 700;
  width: 18px; height: 18px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  position: absolute; top: -4px; right: -4px;
}

.notif-panel {
  position: absolute; top: calc(var(--topbar-h) + 8px); right: 16px;
  width: 340px; z-index: 300;
  border-radius: var(--r-lg); overflow: hidden;
  animation: panelSlide 0.2s var(--transition);
}
@keyframes panelSlide {
  from { opacity: 0; transform: translateY(-10px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.notif-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--glass-border);
  font-weight: 600; font-size: 14px;
}
.notif-header button { background: none; border: none; color: var(--text-3); cursor: pointer; font-size: 18px; }

/* ═══ PAGE CONTENT ═══ */
.page-content {
  flex: 1; padding: 24px;
  padding-bottom: calc(var(--mobile-nav-h) + 24px);
}

.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap; gap: 12px;
}
.page-title { font-size: 24px; font-weight: 800; }
.page-title span { color: var(--accent); }

.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ═══ GLASS / CARDS ═══ */
.glass {
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
}

.card {
  background: var(--bg-2);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  padding: 20px;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.card:hover { border-color: var(--glass-border-md); box-shadow: var(--shadow-md); }

.card-glow:hover { box-shadow: 0 8px 32px rgba(245,158,11,0.15); border-color: rgba(245,158,11,0.3); }

/* ═══ STAT CARDS ═══ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px; margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-2);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg); padding: 20px;
  position: relative; overflow: hidden;
  transition: all 0.25s var(--transition-fast);
  animation: slideUp 0.4s var(--transition) both;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.stat-card::before {
  content: ''; position: absolute; top: 0; right: 0;
  width: 120px; height: 120px; border-radius: 50%;
  background: var(--stat-color, var(--accent));
  opacity: 0.06; transform: translate(30px, -30px);
}

.stat-icon {
  font-size: 28px; margin-bottom: 12px; display: block;
  filter: drop-shadow(0 0 8px var(--stat-color, var(--accent-glow)));
}
.stat-value {
  font-size: 28px; font-weight: 800; color: var(--text-1); line-height: 1;
  font-variant-numeric: tabular-nums;
}
.stat-label { font-size: 13px; color: var(--text-3); margin-top: 4px; }
.stat-change { font-size: 12px; margin-top: 8px; display: flex; align-items: center; gap: 4px; }
.stat-change.up { color: var(--green); }
.stat-change.down { color: var(--red); }

/* ═══ GRID LAYOUTS ═══ */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }

/* ═══ TABLES ═══ */
.table-wrap { overflow-x: auto; border-radius: var(--r-md); }
table { width: 100%; border-collapse: collapse; }
thead th {
  background: var(--bg-3); padding: 12px 16px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.5px;
  text-transform: uppercase; color: var(--text-3);
  text-align: left; white-space: nowrap;
}
thead th:first-child { border-radius: var(--r-sm) 0 0 0; }
thead th:last-child { border-radius: 0 var(--r-sm) 0 0; }
tbody tr { border-bottom: 1px solid var(--glass-border); transition: background 0.15s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--glass); }
tbody td { padding: 13px 16px; font-size: 14px; color: var(--text-2); vertical-align: middle; }

/* ═══ BADGES / CHIPS ═══ */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 99px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.3px;
}
.badge-accent { background: var(--accent-dim); color: var(--accent); border: 1px solid rgba(245,158,11,0.2); }
.badge-blue { background: var(--blue-dim); color: var(--blue); border: 1px solid rgba(59,130,246,0.2); }
.badge-green { background: var(--green-dim); color: var(--green); border: 1px solid rgba(16,185,129,0.2); }
.badge-red { background: var(--red-dim); color: var(--red); border: 1px solid rgba(239,68,68,0.2); }
.badge-purple { background: var(--purple-dim); color: var(--purple); border: 1px solid rgba(139,92,246,0.2); }
.badge-gray { background: var(--bg-3); color: var(--text-3); }

/* ═══ STATUS BADGES ═══ */
.status-pending { background: var(--accent-dim); color: var(--accent); }
.status-preparing { background: var(--blue-dim); color: var(--blue); }
.status-ready { background: var(--purple-dim); color: var(--purple); }
.status-served { background: var(--green-dim); color: var(--green); }
.status-paid { background: var(--green-dim); color: var(--green); }
.status-cancelled { background: var(--red-dim); color: var(--red); }

/* ═══ FORMS ═══ */
.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }

.input, select, textarea {
  width: 100%;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-sm);
  padding: 11px 14px;
  color: var(--text-1); font-size: 14px; font-family: inherit;
  outline: none; transition: all 0.2s;
}
.input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  background: rgba(245,158,11,0.05);
  box-shadow: 0 0 0 3px rgba(245,158,11,0.12);
}
select option { background: var(--bg-2); }
label { display: block; font-size: 12px; font-weight: 600; color: var(--text-3); margin-bottom: 6px; letter-spacing: 0.3px; }

.form-group textarea { resize: vertical; min-height: 80px; }

/* ═══ SEARCH BAR ═══ */
.search-bar {
  display: flex; align-items: center; gap: 10px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg); padding: 10px 16px;
  transition: all 0.2s;
}
.search-bar:focus-within { border-color: var(--accent); background: rgba(245,158,11,0.04); }
.search-bar input { background: none; border: none; outline: none; color: var(--text-1); font-size: 14px; flex: 1; }
.search-bar input::placeholder { color: var(--text-4); }
.search-icon { font-size: 16px; color: var(--text-3); }

/* ═══ ALERTS ═══ */
.alert {
  padding: 12px 16px; border-radius: var(--r-sm);
  font-size: 13px; font-weight: 500;
}
.alert-error { background: var(--red-dim); border: 1px solid rgba(239,68,68,0.3); color: var(--red); }
.alert-success { background: var(--green-dim); border: 1px solid rgba(16,185,129,0.3); color: var(--green); }
.alert-warning { background: var(--accent-dim); border: 1px solid rgba(245,158,11,0.3); color: var(--accent); }
.alert-info { background: var(--blue-dim); border: 1px solid rgba(59,130,246,0.3); color: var(--blue); }

/* ═══ MODAL ═══ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  position: relative; width: 100%; max-width: 560px;
  max-height: 85vh; overflow-y: auto;
  padding: 28px; border-radius: var(--r-xl);
  animation: modalIn 0.3s var(--transition);
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.92) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-close {
  position: absolute; top: 14px; right: 14px;
  background: var(--bg-3); border: 1px solid var(--glass-border);
  border-radius: 50%; width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text-3); font-size: 14px;
  transition: all 0.2s;
}
.modal-close:hover { background: var(--red-dim); color: var(--red); }
.modal-title { font-size: 18px; font-weight: 700; margin-bottom: 20px; }
.modal-footer { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--glass-border); }

/* ═══ TOAST ═══ */
.toast-container {
  position: fixed; bottom: calc(var(--mobile-nav-h) + 20px); right: 20px;
  z-index: 9999; display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-2); border: 1px solid var(--glass-border);
  border-radius: var(--r-md); padding: 12px 16px;
  box-shadow: var(--shadow-md); min-width: 260px; max-width: 360px;
  pointer-events: all;
  animation: toastIn 0.3s var(--transition) both;
}
.toast.out { animation: toastOut 0.3s var(--transition-fast) both; }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(100%) scale(0.9); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(100%); }
}
.toast-icon { font-size: 18px; }
.toast-msg { font-size: 14px; font-weight: 500; flex: 1; }
.toast-success { border-color: rgba(16,185,129,0.3); background: linear-gradient(135deg, rgba(16,185,129,0.08), var(--bg-2)); }
.toast-error { border-color: rgba(239,68,68,0.3); background: linear-gradient(135deg, rgba(239,68,68,0.08), var(--bg-2)); }
.toast-info { border-color: rgba(59,130,246,0.3); }
.toast-warning { border-color: rgba(245,158,11,0.3); }

/* ═══ LOADING ═══ */
.loading-screen {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 300px; gap: 16px; color: var(--text-3);
}
.loading-spinner {
  width: 40px; height: 40px; border-radius: 50%;
  border: 3px solid var(--glass-border);
  border-top-color: var(--accent);
  animation: spin 0.7s linear infinite;
}

.skeleton {
  background: linear-gradient(90deg, var(--bg-2) 25%, var(--bg-3) 50%, var(--bg-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--r-sm);
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ═══ KANBAN ═══ */
.kanban { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 8px; align-items: flex-start; }
.kanban-col {
  flex-shrink: 0; width: 260px;
  background: var(--bg-2); border: 1px solid var(--glass-border);
  border-radius: var(--r-lg); overflow: hidden;
}
.kanban-col-header {
  padding: 14px 16px; font-size: 13px; font-weight: 700;
  display: flex; align-items: center; gap: 8px;
  border-bottom: 1px solid var(--glass-border);
}
.kanban-col-count {
  margin-left: auto; background: var(--glass-md);
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
}
.kanban-cards { padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 80px; }
.kanban-card {
  background: var(--bg-3); border: 1px solid var(--glass-border);
  border-radius: var(--r-sm); padding: 12px;
  cursor: pointer; transition: all 0.2s;
}
.kanban-card:hover { border-color: var(--accent); transform: translateY(-1px); box-shadow: var(--shadow-sm); }

/* ═══ PRODUCTS GRID ═══ */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}
.product-tile {
  background: var(--bg-2); border: 1px solid var(--glass-border);
  border-radius: var(--r-md); padding: 14px 10px;
  text-align: center; cursor: pointer;
  transition: all 0.2s var(--transition);
  position: relative; overflow: hidden;
}
.product-tile:hover {
  border-color: var(--accent); background: rgba(245,158,11,0.06);
  transform: scale(1.02) translateY(-2px);
  box-shadow: 0 8px 20px rgba(245,158,11,0.15);
}
.product-tile:active { transform: scale(0.97); }
.product-tile-icon { font-size: 26px; display: block; margin-bottom: 6px; }
.product-tile-name { font-size: 13px; font-weight: 600; line-height: 1.3; }
.product-tile-price { font-size: 14px; font-weight: 800; color: var(--accent); margin-top: 4px; }
.product-tile-stock { font-size: 11px; color: var(--text-3); }
.product-tile.out-of-stock { opacity: 0.5; }

/* ═══ CAISSE ═══ */
.caisse-layout {
  display: grid; grid-template-columns: 1fr 380px; gap: 16px; height: calc(100vh - var(--topbar-h) - 48px);
}
.caisse-products { overflow-y: auto; }
.caisse-cart {
  background: var(--bg-2); border: 1px solid var(--glass-border);
  border-radius: var(--r-lg); display: flex; flex-direction: column;
  overflow: hidden; position: sticky; top: 0;
}
.cart-header { padding: 16px; border-bottom: 1px solid var(--glass-border); font-weight: 700; font-size: 16px; }
.cart-items { flex: 1; overflow-y: auto; padding: 10px; }
.cart-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px; border-radius: var(--r-sm);
  border-bottom: 1px solid var(--glass-border); transition: background 0.15s;
}
.cart-item:hover { background: var(--glass); }
.cart-item-name { flex: 1; font-size: 14px; font-weight: 500; }
.cart-qty-btn {
  background: var(--bg-3); border: 1px solid var(--glass-border);
  border-radius: var(--r-xs); width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 14px; transition: all 0.15s;
}
.cart-qty-btn:hover { background: var(--accent); color: #000; border-color: var(--accent); }
.cart-qty { font-size: 14px; font-weight: 600; min-width: 24px; text-align: center; }
.cart-price { font-size: 14px; font-weight: 700; color: var(--accent); min-width: 56px; text-align: right; }
.cart-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 150px; color: var(--text-4); gap: 8px; font-size: 14px;
}
.cart-footer { padding: 16px; border-top: 1px solid var(--glass-border); }
.cart-total { display: flex; justify-content: space-between; font-size: 20px; font-weight: 800; margin-bottom: 14px; }

/* ═══ STOCK INDICATOR ═══ */
.stock-bar { height: 4px; background: var(--bg-3); border-radius: 99px; margin-top: 4px; overflow: hidden; }
.stock-fill { height: 100%; border-radius: 99px; transition: width 0.5s ease; }
.stock-fill.ok { background: var(--green); }
.stock-fill.warning { background: var(--accent); }
.stock-fill.low { background: var(--red); }
.stock-low-badge { color: var(--red); font-size: 11px; font-weight: 700; }
.stock-warning-badge { color: var(--accent); font-size: 11px; font-weight: 700; }

/* ═══ PLANNING / CALENDAR ═══ */
.calendar { border-radius: var(--r-lg); overflow: hidden; }
.calendar-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; background: var(--bg-2);
  border-bottom: 1px solid var(--glass-border);
}
.calendar-title { font-size: 18px; font-weight: 700; }
.calendar-nav { display: flex; gap: 8px; }
.calendar-days {
  display: grid; grid-template-columns: 80px repeat(7, 1fr);
  background: var(--bg-2);
}
.cal-day-header {
  padding: 10px 8px; text-align: center;
  font-size: 12px; font-weight: 700; color: var(--text-3);
  border-right: 1px solid var(--glass-border);
  border-bottom: 1px solid var(--glass-border);
  text-transform: uppercase; letter-spacing: 0.5px;
}
.cal-day-header.today { color: var(--accent); }
.cal-time-slot {
  padding: 6px 8px; font-size: 11px; color: var(--text-4);
  border-right: 1px solid var(--glass-border);
  border-bottom: 1px solid rgba(255,255,255,0.03);
  min-height: 40px;
}
.cal-slot {
  border-right: 1px solid var(--glass-border);
  border-bottom: 1px solid rgba(255,255,255,0.03);
  min-height: 40px; padding: 2px;
}
.cal-shift {
  background: var(--accent-dim); border: 1px solid rgba(245,158,11,0.2);
  border-radius: var(--r-xs); padding: 4px 6px;
  font-size: 11px; font-weight: 600; color: var(--accent);
  cursor: pointer; transition: all 0.15s;
}
.cal-shift:hover { background: rgba(245,158,11,0.25); }

/* ═══ TABLE MAP ═══ */
.table-map {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
}
.table-card {
  background: var(--bg-2); border: 2px solid var(--glass-border);
  border-radius: var(--r-lg); padding: 16px;
  text-align: center; cursor: pointer;
  transition: all 0.2s var(--transition);
  position: relative;
}
.table-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.table-card.occupied { border-color: rgba(239,68,68,0.4); background: rgba(239,68,68,0.05); }
.table-card.reserved { border-color: rgba(245,158,11,0.4); background: rgba(245,158,11,0.05); }
.table-card.free { border-color: rgba(16,185,129,0.3); }
.table-card.cleaning { border-color: rgba(59,130,246,0.3); background: rgba(59,130,246,0.05); }
.table-number { font-size: 22px; font-weight: 800; display: block; }
.table-zone { font-size: 11px; color: var(--text-3); }
.table-cap { font-size: 11px; color: var(--text-4); }
.table-order { font-size: 10px; color: var(--accent); font-weight: 600; margin-top: 4px; }
.table-status-dot {
  position: absolute; top: 8px; right: 8px;
  width: 10px; height: 10px; border-radius: 50%;
}
.dot-free { background: var(--green); box-shadow: 0 0 8px var(--green); }
.dot-occupied { background: var(--red); box-shadow: 0 0 8px var(--red); animation: pulse 2s infinite; }
.dot-reserved { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.dot-cleaning { background: var(--blue); }

@keyframes pulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.3); }
}

/* ═══ CHART CONTAINER ═══ */
.chart-container { position: relative; }
canvas { border-radius: var(--r-sm); }

/* ═══ BARCODE SCANNER ═══ */
.scanner-container {
  position: relative; border-radius: var(--r-lg); overflow: hidden;
  background: #000; aspect-ratio: 4/3; max-width: 400px;
}
.scanner-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
.scanner-frame {
  width: 70%; aspect-ratio: 2/1;
  border: 3px solid var(--accent);
  border-radius: var(--r-sm);
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.5);
  position: relative;
}
.scanner-line {
  position: absolute; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: scanLine 2s linear infinite;
}
@keyframes scanLine {
  from { top: 0; } to { top: 100%; }
}
.scanner-corners::before, .scanner-corners::after {
  content: ''; position: absolute;
  width: 20px; height: 20px; border-color: var(--accent); border-style: solid;
}
.scanner-corners::before { top: -3px; left: -3px; border-width: 3px 0 0 3px; border-radius: 2px 0 0 0; }
.scanner-corners::after { bottom: -3px; right: -3px; border-width: 0 3px 3px 0; border-radius: 0 0 2px 0; }

/* ═══ MOBILE NAV ═══ */
.mobile-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0;
  height: var(--mobile-nav-h); z-index: 300;
  background: rgba(13,17,23,0.95);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--glass-border);
  padding: 0 8px env(safe-area-inset-bottom, 0);
  justify-content: space-around; align-items: center;
}
.mobile-nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 12px; border-radius: var(--r-sm); cursor: pointer;
  transition: all 0.2s; color: var(--text-3); text-decoration: none;
  min-width: 52px;
}
.mobile-nav-item:hover, .mobile-nav-item.active { color: var(--accent); }
.mobile-nav-item span { font-size: 22px; }
.mobile-nav-item small { font-size: 10px; font-weight: 600; }
.mobile-nav-center {
  background: linear-gradient(135deg, var(--accent), #E67E22);
  border-radius: 50%; width: 52px; height: 52px;
  box-shadow: 0 4px 16px var(--accent-glow);
  margin-top: -16px;
}
.mobile-nav-center span { font-size: 24px; }

.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.6); z-index: 190;
}

/* ═══ MISC UTILS ═══ */
.text-accent { color: var(--accent); }
.text-muted { color: var(--text-3); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }
.text-lg { font-size: 18px; }
.font-bold { font-weight: 700; }
.font-black { font-weight: 900; }
.mt-1 { margin-top: 4px; }
.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; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.justify-between { justify-content: space-between; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 60px 20px; color: var(--text-4); text-align: center; gap: 12px;
}
.empty-state-icon { font-size: 48px; opacity: 0.5; }
.empty-state-title { font-size: 16px; font-weight: 600; }
.empty-state-sub { font-size: 13px; }

/* ═══ CATEGORY TABS ═══ */
.cat-tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 16px; }
.cat-tabs::-webkit-scrollbar { display: none; }
.cat-tab {
  flex-shrink: 0; padding: 8px 16px; border-radius: 99px;
  background: var(--glass); border: 1px solid var(--glass-border);
  color: var(--text-3); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all 0.2s; white-space: nowrap;
}
.cat-tab:hover { border-color: var(--accent); color: var(--accent); }
.cat-tab.active {
  background: var(--accent); color: #000;
  border-color: var(--accent);
  box-shadow: 0 4px 12px var(--accent-glow);
}

/* ═══ DIVIDER ═══ */
.divider { height: 1px; background: var(--glass-border); margin: 16px 0; }

/* ═══ NUMBER PAD ═══ */
.numpad {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px;
}
.numpad-key {
  background: var(--bg-3); border: 1px solid var(--glass-border);
  border-radius: var(--r-md); padding: 16px 10px;
  font-size: 20px; font-weight: 600;
  text-align: center; cursor: pointer;
  transition: all 0.15s var(--transition);
  user-select: none;
}
.numpad-key:hover { background: var(--glass-md); border-color: var(--accent); }
.numpad-key:active { transform: scale(0.93); background: var(--accent-dim); }
.numpad-key.accent { background: var(--accent-dim); color: var(--accent); }
.numpad-key.danger { background: var(--red-dim); color: var(--red); }

/* ═══ ANIMATIONS ═══ */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes fadeIn {
  from { opacity: 0; } to { opacity: 1; }
}

.anim-fade { animation: fadeIn 0.3s ease both; }
.anim-up { animation: slideUp 0.4s var(--transition) both; }

/* Staggered children */
.stagger > *:nth-child(1) { animation-delay: 0.05s; }
.stagger > *:nth-child(2) { animation-delay: 0.10s; }
.stagger > *:nth-child(3) { animation-delay: 0.15s; }
.stagger > *:nth-child(4) { animation-delay: 0.20s; }
.stagger > *:nth-child(5) { animation-delay: 0.25s; }
.stagger > *:nth-child(6) { animation-delay: 0.30s; }

/* ═══════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════ */

@media (max-width: 1100px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .caisse-layout { grid-template-columns: 1fr 340px; }
}

@media (max-width: 900px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .caisse-layout { grid-template-columns: 1fr; height: auto; }
  .caisse-cart { position: fixed; bottom: var(--mobile-nav-h); left: 0; right: 0; top: auto; border-radius: var(--r-xl) var(--r-xl) 0 0; height: 50vh; z-index: 150; transform: translateY(100%); transition: transform 0.3s var(--transition); }
  .caisse-cart.open { transform: translateY(0); }
  .cart-toggle-btn { display: flex !important; }
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); width: var(--sidebar-w) !important; }
  .sidebar.mobile-open { transform: translateX(0); }
  .sidebar-overlay { display: block; }
  .main-wrapper { margin-left: 0 !important; }
  .mobile-nav { display: flex; }
  .menu-toggle { display: block; }
  .page-content { padding: 16px; padding-bottom: calc(var(--mobile-nav-h) + 16px); }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .topbar { padding: 0 16px; }
  .topbar-clock { display: none; }
  .products-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
  .table-map { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
  .kanban { flex-wrap: nowrap; }
  .modal { padding: 20px; border-radius: var(--r-xl) var(--r-xl) 0 0; align-self: flex-end; max-width: 100%; margin: 0; }
  .modal-overlay { align-items: flex-end; padding: 0; }
  .page-title { font-size: 20px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .login-card { padding: 28px 20px; }
}

/* ═══ SAFE AREAS (iOS) ═══ */
@supports (padding: max(0px)) {
  .sidebar { padding-top: max(0px, env(safe-area-inset-top)); }
  .mobile-nav { padding-bottom: max(8px, env(safe-area-inset-bottom)); height: calc(var(--mobile-nav-h) + env(safe-area-inset-bottom)); }
}

/* ═══════════════════════════════════════════════
   CAISSE POPINA — ORDER TYPES + MULTI-TAB
   ═══════════════════════════════════════════════ */

.order-type-bar {
  display: flex; gap: 10px; margin-bottom: 16px;
}
.order-type-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 14px 10px; border-radius: var(--r-lg);
  background: var(--bg-2); border: 2px solid var(--glass-border);
  cursor: pointer; transition: all 0.2s var(--transition);
  font-size: 13px; font-weight: 600; color: var(--text-3);
}
.order-type-btn:hover { border-color: var(--accent); color: var(--text-1); }
.order-type-btn.active {
  background: var(--accent-dim); border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 4px 20px rgba(245,158,11,0.2);
}
.order-type-btn.active-blue { background: var(--blue-dim); border-color: var(--blue); color: var(--blue); box-shadow: 0 4px 20px rgba(59,130,246,0.2); }
.order-type-btn.active-green { background: var(--green-dim); border-color: var(--green); color: var(--green); box-shadow: 0 4px 20px rgba(16,185,129,0.2); }
.order-type-icon { font-size: 22px; }

.order-tabs-bar {
  display: flex; gap: 6px; margin-bottom: 16px; overflow-x: auto;
  padding-bottom: 4px;
}
.order-tabs-bar::-webkit-scrollbar { display: none; }
.order-tab {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: var(--r-sm);
  background: var(--bg-2); border: 1.5px solid var(--glass-border);
  font-size: 13px; font-weight: 600; color: var(--text-3);
  cursor: pointer; transition: all 0.18s; white-space: nowrap; flex-shrink: 0;
}
.order-tab:hover { border-color: var(--accent); color: var(--text-1); }
.order-tab.active {
  background: var(--accent-dim); border-color: var(--accent); color: var(--accent);
}
.order-tab-close {
  width: 16px; height: 16px; border-radius: 50%; background: rgba(255,255,255,0.1);
  display: flex; align-items: center; justify-content: center; font-size: 10px;
  transition: background 0.15s;
}
.order-tab-close:hover { background: var(--red); color: #fff; }
.order-tab-add {
  padding: 8px 14px; border-radius: var(--r-sm);
  background: transparent; border: 1.5px dashed var(--glass-border);
  color: var(--text-4); font-size: 16px; cursor: pointer;
  transition: all 0.18s; flex-shrink: 0;
}
.order-tab-add:hover { border-color: var(--accent); color: var(--accent); }

/* ═══ RECEIPT TICKET ═══ */
.caisse-new-layout {
  display: grid; grid-template-columns: 1fr 360px; gap: 0;
  height: calc(100vh - var(--topbar-h) - 112px);
  background: var(--bg-2); border: 1px solid var(--glass-border);
  border-radius: var(--r-xl); overflow: hidden;
}
.caisse-left {
  display: flex; flex-direction: column;
  border-right: 1px solid var(--glass-border);
  overflow: hidden;
}
.caisse-left-header {
  padding: 12px 16px; border-bottom: 1px solid var(--glass-border);
  flex-shrink: 0;
}
.caisse-products-scroll { flex: 1; overflow-y: auto; padding: 12px; }

.receipt-panel {
  display: flex; flex-direction: column;
  background: #111827;
  position: relative;
}
.receipt-paper {
  flex: 1; overflow-y: auto; padding: 0;
  font-family: 'Courier New', 'Courier', monospace;
}
.receipt-header-area {
  text-align: center; padding: 16px 16px 12px;
  border-bottom: 2px dashed rgba(255,255,255,0.12);
}
.receipt-logo { font-size: 24px; margin-bottom: 4px; }
.receipt-brand { font-size: 14px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: #F0F6FC; }
.receipt-meta { font-size: 11px; color: #6B7280; margin-top: 4px; line-height: 1.8; }
.receipt-order-type {
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(245,158,11,0.15); border: 1px solid rgba(245,158,11,0.3);
  color: #F59E0B; padding: 3px 10px; border-radius: 99px; font-size: 11px; font-weight: 700;
  margin-top: 8px;
}

.receipt-items-area { padding: 8px 16px; }
.receipt-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 120px; color: #374151; gap: 8px; font-size: 13px;
}

.receipt-line {
  display: grid; grid-template-columns: 24px 1fr auto; gap: 4px; align-items: baseline;
  padding: 7px 0; border-bottom: 1px dashed rgba(255,255,255,0.05);
  font-size: 13px; color: #D1D5DB;
  animation: receiptPrint 0.3s var(--transition) both;
}
@keyframes receiptPrint {
  from { opacity: 0; transform: translateY(-8px); background: rgba(245,158,11,0.08); }
  to { opacity: 1; transform: translateY(0); background: transparent; }
}
.receipt-line-qty { color: #6B7280; font-size: 12px; }
.receipt-line-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.receipt-line-price { font-weight: 700; color: #F0F6FC; white-space: nowrap; }
.receipt-line-sub {
  grid-column: 2 / 4; font-size: 11px; color: #6B7280; margin-top: -4px;
  display: flex; justify-content: space-between;
}

.receipt-line-del {
  width: 18px; height: 18px; border-radius: 50%; background: rgba(239,68,68,0.1);
  color: #EF4444; font-size: 12px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background 0.15s; flex-shrink: 0;
  border: none; margin-left: 6px;
}
.receipt-line-del:hover { background: rgba(239,68,68,0.3); }

.receipt-subtotals {
  border-top: 2px dashed rgba(255,255,255,0.12);
  padding: 10px 16px; font-size: 13px;
}
.receipt-subtotal-row {
  display: flex; justify-content: space-between; padding: 3px 0;
  color: #6B7280;
}
.receipt-subtotal-row.total-row {
  font-size: 18px; font-weight: 800; color: #F0F6FC;
  border-top: 1px solid rgba(255,255,255,0.1); padding-top: 8px; margin-top: 4px;
}
.receipt-subtotal-row.total-row .total-amount { color: #F59E0B; }

.receipt-footer-area {
  padding: 12px; border-top: 2px dashed rgba(255,255,255,0.12);
  background: #0F1623;
}

.pay-methods { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.pay-btn {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 12px 8px; border-radius: var(--r-md);
  background: var(--bg-3); border: 1.5px solid var(--glass-border);
  color: var(--text-2); font-size: 12px; font-weight: 700;
  cursor: pointer; transition: all 0.18s var(--transition);
  font-family: inherit;
}
.pay-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.pay-btn-icon { font-size: 20px; }
.pay-btn.cash:hover, .pay-btn.cash.selected { background: rgba(16,185,129,0.15); border-color: #10B981; color: #10B981; }
.pay-btn.card:hover, .pay-btn.card.selected { background: rgba(59,130,246,0.15); border-color: #3B82F6; color: #3B82F6; }
.pay-btn.mixed:hover, .pay-btn.mixed.selected { background: rgba(139,92,246,0.15); border-color: #8B5CF6; color: #8B5CF6; }
.pay-btn.split:hover, .pay-btn.split.selected { background: rgba(245,158,11,0.15); border-color: #F59E0B; color: #F59E0B; }

.receipt-discount-row {
  display: flex; align-items: center; gap: 6px; margin-bottom: 8px;
}
.receipt-discount-row input {
  flex: 1; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--r-xs); padding: 6px 10px; color: #F0F6FC; font-size: 12px;
  font-family: 'Courier New', monospace; outline: none;
}
.receipt-discount-row input:focus { border-color: #F59E0B; }

/* ═══ CASH PAYMENT MODAL ═══ */
.cash-modal { max-width: 340px; }
.amount-display {
  background: var(--bg-3); border-radius: var(--r-lg); padding: 20px;
  text-align: center; margin-bottom: 16px;
}
.amount-label { font-size: 12px; color: var(--text-3); margin-bottom: 4px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.amount-value { font-size: 36px; font-weight: 900; color: var(--accent); font-variant-numeric: tabular-nums; }
.amount-change { font-size: 16px; color: var(--green); font-weight: 700; margin-top: 4px; }

.quick-amounts { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.quick-amt {
  background: var(--glass); border: 1px solid var(--glass-border);
  border-radius: var(--r-sm); padding: 8px 12px; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all 0.15s; color: var(--text-2);
}
.quick-amt:hover { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }

/* ═══ COMPTA ═══ */
.compta-kpi {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 20px;
}
.kpi-card {
  background: var(--bg-2); border: 1px solid var(--glass-border);
  border-radius: var(--r-lg); padding: 18px; position: relative; overflow: hidden;
  transition: all 0.2s;
}
.kpi-card::before {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 3px;
  background: var(--kpi-color, var(--accent));
}
.kpi-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-3); margin-bottom: 8px; }
.kpi-value { font-size: 24px; font-weight: 800; color: var(--text-1); font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.kpi-positive { color: var(--green) !important; }
.kpi-negative { color: var(--red) !important; }

.expense-cat-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 99px; font-size: 11px; font-weight: 700;
}

/* ═══ RESERVATIONS ═══ */
.res-card {
  background: var(--bg-2); border: 1px solid var(--glass-border);
  border-radius: var(--r-lg); padding: 16px; margin-bottom: 10px;
  display: flex; align-items: center; gap: 14px;
  transition: all 0.2s; cursor: default;
  position: relative; overflow: hidden;
}
.res-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--res-color, var(--accent));
  border-radius: 4px 0 0 4px;
}
.res-time-block {
  background: var(--bg-3); border-radius: var(--r-sm);
  padding: 8px 12px; text-align: center; min-width: 56px; flex-shrink: 0;
}
.res-time { font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }
.res-guests { font-size: 11px; color: var(--text-3); }
.res-info { flex: 1; min-width: 0; }
.res-name { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.res-details { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.res-actions { display: flex; gap: 6px; }

/* ═══ TABLE SELECTOR IN CAISSE ═══ */
.table-selector-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 8px;
}
.table-sel-btn {
  padding: 10px 6px; border-radius: var(--r-sm); text-align: center;
  background: var(--bg-3); border: 1.5px solid var(--glass-border);
  cursor: pointer; transition: all 0.15s; font-size: 13px; font-weight: 700;
}
.table-sel-btn:hover { border-color: var(--accent); color: var(--accent); }
.table-sel-btn.selected { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }
.table-sel-btn.occupied { opacity: 0.4; cursor: not-allowed; }
.table-sel-btn .ts-zone { font-size: 10px; color: var(--text-4); font-weight: 400; }

/* ═══ COMPTA CHART LEGEND ═══ */
.legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

@media (max-width: 900px) {
  .caisse-new-layout { grid-template-columns: 1fr; height: auto; }
  .receipt-panel {
    position: fixed; bottom: var(--mobile-nav-h); left: 0; right: 0;
    height: 55vh; border-radius: var(--r-xl) var(--r-xl) 0 0;
    transform: translateY(calc(100% - 60px));
    transition: transform 0.35s var(--transition);
    z-index: 150; box-shadow: var(--shadow-lg);
  }
  .receipt-panel.open { transform: translateY(0); }
  .receipt-panel-toggle {
    display: flex !important;
    position: absolute; top: -1px; left: 50%; transform: translateX(-50%);
    background: var(--accent); color: #000; border-radius: 0 0 var(--r-sm) var(--r-sm);
    padding: 4px 20px; font-size: 12px; font-weight: 700; cursor: pointer; z-index: 1;
    border: none; align-items: center; gap: 4px;
  }
}
.receipt-panel-toggle { display: none; }
