/* ═══════════════════════════════════════════════════════
   BALAM BROCHETTE — Custom Stylesheet
   Dark theme · Warm amber accents · Modern restaurant UI
═══════════════════════════════════════════════════════ */

:root {
  --brand:        #f59e0b;
  --brand-dark:   #d97706;
  --brand-light:  #fcd34d;
  --sidebar-w:    240px;
  --sidebar-bg:   #0f0f1a;
  --topbar-h:     60px;
  --card-bg:      #1e1e2e;
  --card-border:  #2a2a3e;
  --text-main:    #e2e8f0;
  --text-muted:   #64748b;
  --success:      #10b981;
  --danger:       #ef4444;
  --info:         #3b82f6;
  --purple:       #8b5cf6;
}

/* ── GLOBAL ── */
* { box-sizing: border-box; }
body {
  background: #0d0d1a;
  color: var(--text-main);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  margin: 0;
  overflow-x: hidden;
}

/* ── LAYOUT ── */

/* ── SIDEBAR BRAND ── */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 16px 18px;
  background: linear-gradient(135deg, rgba(245,158,11,.12) 0%, rgba(217,119,6,.04) 100%);
  border-bottom: 1px solid rgba(245,158,11,.2);
  position: relative;
  overflow: hidden;
}
.sidebar-brand::before {
  content: '';
  position: absolute;
  top: -30px; right: -30px;
  width: 90px; height: 90px;
  background: radial-gradient(circle, rgba(245,158,11,.18) 0%, transparent 70%);
  pointer-events: none;
}
.brand-logo { line-height: 1; flex-shrink: 0; }
.sidebar-logo {
  width: 46px; height: 46px;
  object-fit: contain;
  border-radius: 12px;
  background: #fff;
  padding: 4px;
  box-shadow: 0 0 0 2px rgba(245,158,11,.35), 0 4px 14px rgba(245,158,11,.25);
}
.brand-name {
  display: block;
  font-size: .92rem; font-weight: 800;
  background: linear-gradient(90deg, #fcd34d 0%, #f59e0b 60%, #d97706 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: .4px;
  line-height: 1.2;
}
.brand-sub {
  display: inline-block;
  margin-top: 4px;
  font-size: .58rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 1.2px;
  color: rgba(245,158,11,.6);
  border: 1px solid rgba(245,158,11,.2);
  border-radius: 20px;
  padding: 1px 7px;
  background: rgba(245,158,11,.07);
  white-space: nowrap;
}

/* ── SIDEBAR NAV ── */
.sidebar-nav { padding: 10px 0; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 18px;
  color: #94a3b8;
  text-decoration: none;
  font-size: .875rem;
  font-weight: 500;
  transition: all .15s;
  border-left: 3px solid transparent;
  white-space: nowrap;
}
.nav-item:hover { color: #fff; background: rgba(255,255,255,.05); }
.nav-item.active { color: var(--brand); border-left-color: var(--brand); background: rgba(245,158,11,.08); }
.nav-item.highlight { color: var(--brand); font-weight: 700; }
.nav-item.highlight:hover { background: rgba(245,158,11,.12); }
.nav-item i { font-size: 1.05rem; width: 20px; text-align: center; }
.nav-badge {
  margin-left: auto; background: #ef4444; color: #fff; font-size: .68rem; font-weight: 800;
  min-width: 18px; height: 18px; border-radius: 9px; display: inline-flex; align-items: center;
  justify-content: center; padding: 0 5px; line-height: 1;
}
.nav-divider { padding: 12px 18px 4px; font-size: .65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; color: #334155; }

/* ── SIDEBAR FOOTER ── */
.sidebar-footer {
  padding: 12px 14px;
  border-top: 1px solid #1e1e30;
  display: flex; align-items: center; gap: 8px;
}
.user-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #000; font-weight: 800; font-size: .9rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.user-details { flex: 1; min-width: 0; }
.user-name { display: block; font-size: .8rem; font-weight: 600; color: #e2e8f0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: .6rem; }
.logout-btn { padding: 4px 8px; }

/* ── TOPBAR ── */
.topbar {
  height: var(--topbar-h);
  background: linear-gradient(90deg, #13131f 0%, #1a1a2e 100%);
  border-bottom: 1px solid rgba(245,158,11,.18);
  box-shadow: 0 2px 24px rgba(0,0,0,.35);
  display: flex; align-items: center; gap: 14px;
  padding: 0 22px;
  position: sticky; top: 0; z-index: 500;
}
.topbar-title {
  flex: 1;
  font-size: 1.05rem; font-weight: 700;
  color: #f1f5f9; letter-spacing: .3px;
}
.topbar-right { display: flex; align-items: center; gap: 10px; }
.clock {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 20px;
  padding: 5px 13px;
  font-size: .78rem; font-variant-numeric: tabular-nums;
  color: #94a3b8; white-space: nowrap;
  letter-spacing: .3px;
}
.topbar-divider { width: 1px; height: 24px; background: rgba(255,255,255,.1); }
.btn-ghost {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  color: #94a3b8; padding: 7px 9px; border-radius: 8px;
  transition: all .15s;
}
.btn-ghost:hover { color: #fff; background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.18); }

/* ── SIDEBAR COLLAPSED (desktop) ── */
.sidebar {
  position: fixed; top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--sidebar-bg);
  border-right: 1px solid #1e1e30;
  z-index: 1000;
  transition: width .25s ease;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.sidebar.collapsed { width: 62px; }
.sidebar.collapsed .brand-text,
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .nav-divider,
.sidebar.collapsed .user-details,
.sidebar.collapsed .logout-btn { opacity: 0; width: 0; overflow: hidden; white-space: nowrap; pointer-events: none; }
.sidebar.collapsed .sidebar-brand { justify-content: center; padding: 16px 8px; gap: 0; }
.sidebar.collapsed .sidebar-logo { width: 40px; height: 40px; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 11px 0; border-left: 3px solid transparent; }
.sidebar.collapsed .nav-item.active { border-left-color: var(--brand); }
.sidebar.collapsed .sidebar-footer { justify-content: center; padding: 12px 8px; gap: 0; }
.main-content { margin-left: var(--sidebar-w); min-height: 100vh; transition: margin-left .25s ease; }
.main-content.sidebar-collapsed { margin-left: 62px; }

/* ── PAGE CONTENT ── */
.page-content { padding: 24px 20px; }

/* Messages flash en overlay flottant : n'affecte jamais la mise en page,
   n'apparaissent ni ne disparaissent en décalant le contenu */
.flash-container {
  position: fixed;
  top: calc(var(--topbar-h) + 14px);
  left: var(--sidebar-w);
  right: 0;
  z-index: 1050;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  transition: left .25s ease;
}
.flash-container .alert {
  pointer-events: auto;
  width: 100%;
  max-width: 560px;
  box-shadow: 0 12px 32px rgba(0,0,0,.4);
}
.main-content.sidebar-collapsed .flash-container { left: 62px; }
@media (max-width: 768px) {
  .flash-container { left: 0; padding: 0 12px; }
}

/* ── CARDS ── */
.card {
  background: var(--card-bg) !important;
  border-color: var(--card-border) !important;
}
.card-header {
  background: rgba(255,255,255,.03) !important;
  border-color: var(--card-border) !important;
  padding: 12px 16px;
}
.card-footer {
  background: rgba(255,255,255,.02) !important;
  border-color: var(--card-border) !important;
}

/* ── STAT CARDS ── */
.stat-card {
  border-radius: 14px;
  padding: 20px;
  display: flex; align-items: center; gap: 16px;
  position: relative; overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute; right: -20px; top: -20px;
  width: 100px; height: 100px;
  border-radius: 50%;
  opacity: .12;
}
.stat-orange { background: linear-gradient(135deg, #1a1000, #2a1800); border: 1px solid #3d2200; }
.stat-orange::before { background: #f59e0b; }
.stat-orange .stat-icon { color: #f59e0b; }
.stat-green  { background: linear-gradient(135deg, #001a0d, #00261a); border: 1px solid #004d1a; }
.stat-green::before  { background: #10b981; }
.stat-green .stat-icon  { color: #10b981; }
.stat-blue   { background: linear-gradient(135deg, #00091a, #000d26); border: 1px solid #001f4d; }
.stat-blue::before   { background: #3b82f6; }
.stat-blue .stat-icon   { color: #3b82f6; }
.stat-red    { background: linear-gradient(135deg, #1a0000, #260000); border: 1px solid #4d0000; }
.stat-red::before    { background: #ef4444; }
.stat-red .stat-icon    { color: #ef4444; }
.stat-purple { background: linear-gradient(135deg, #0d001a, #130026); border: 1px solid #30004d; }
.stat-purple::before { background: #8b5cf6; }
.stat-purple .stat-icon { color: #8b5cf6; }

.stat-icon { font-size: 2rem; flex-shrink: 0; }
.stat-value { font-size: 1.6rem; font-weight: 800; line-height: 1; color: #fff; }
.stat-label { font-size: .75rem; color: var(--text-muted); margin-top: 4px; }
.stat-sub   { font-size: .68rem; color: rgba(255,255,255,.35); margin-top: 5px; border-top: 1px solid rgba(255,255,255,.08); padding-top: 4px; }

/* ── STATUS BADGES ── */
.badge.status-en-attente      { background: #92400e; color: #fcd34d; }
.badge.status-en-préparation  { background: #1e3a5f; color: #93c5fd; }
.badge.status-prêt            { background: #065f46; color: #6ee7b7; }
.badge.status-livré           { background: #1f2937; color: #9ca3af; }
.badge.status-annulé          { background: #450a0a; color: #fca5a5; }

/* ── TABLES ── */
.table { --bs-table-bg: transparent; --bs-table-color: var(--text-main); }
.table-hover > tbody > tr:hover { --bs-table-hover-bg: rgba(255,255,255,.04); }
thead th { color: var(--text-muted) !important; font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .8px; border-color: var(--card-border) !important; }
tbody td { border-color: rgba(255,255,255,.05) !important; vertical-align: middle; }

/* ── FORMS ── */
.form-control, .form-select {
  background: #12121f !important;
  border-color: #2a2a3e !important;
  color: #e2e8f0 !important;
}
.form-control:focus, .form-select:focus {
  border-color: var(--brand) !important;
  box-shadow: 0 0 0 3px rgba(245,158,11,.15) !important;
}
.form-control::placeholder { color: #475569 !important; }
.input-group-text { background: #1a1a2e !important; border-color: #2a2a3e !important; color: #94a3b8 !important; }

/* ── BUTTONS ── */
.btn-warning  { background: var(--brand); border-color: var(--brand); color: #000; font-weight: 700; }
.btn-warning:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #000; }
.btn-xs { padding: 2px 8px; font-size: .75rem; border-radius: 4px; }

/* ── GRADIENT BRAND CARD ── */
.bg-gradient-brand { background: linear-gradient(135deg, #1a0f00, #2d1a00) !important; border: 1px solid #3d2200 !important; }

/* ── MENU GRID ── */
.category-label {
  font-size: .7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; color: var(--text-muted); margin-bottom: 8px;
}
.menu-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.menu-btn {
  display: flex; flex-direction: column; align-items: flex-start;
  padding: 8px 12px; border-radius: 8px;
  background: #12121f; border: 1px solid #2a2a3e;
  color: var(--text-main); cursor: pointer; transition: all .15s;
  min-width: 130px; text-align: left;
}
.menu-btn:hover { border-color: var(--brand); background: rgba(245,158,11,.08); transform: translateY(-1px); }
.menu-btn-name  { font-size: .8rem; font-weight: 600; }
.menu-btn-price { font-size: .75rem; color: var(--brand); font-weight: 700; margin-top: 2px; }

/* ── CUSTOMER AVATARS ── */
.customer-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #000; font-weight: 800; font-size: .8rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.customer-avatar-lg {
  width: 72px; height: 72px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #000; font-weight: 900; font-size: 2rem;
  display: flex; align-items: center; justify-content: center;
}
.stat-mini { padding: 8px; background: rgba(255,255,255,.04); border-radius: 8px; }

/* ── LOGIN PAGE ── */
.login-body { background: #080812; display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-bg {
  position: fixed; inset: 0; z-index: 0;
  background: radial-gradient(ellipse at 20% 50%, rgba(245,158,11,.08) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 20%, rgba(59,130,246,.06) 0%, transparent 60%);
}
.login-wrapper { position: relative; z-index: 1; width: 100%; max-width: 420px; padding: 20px; }
.login-card {
  background: #12121f;
  border: 1px solid #2a2a3e;
  border-radius: 16px;
  padding: 36px 32px;
  box-shadow: 0 25px 50px rgba(0,0,0,.5);
}
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo-img {
  width: 90px; height: 90px;
  object-fit: contain;
  border-radius: 16px;
  background: #fff;
  padding: 8px;
  margin-bottom: 10px;
  box-shadow: 0 4px 20px rgba(245,158,11,.2);
  display: block;
  margin-left: auto; margin-right: auto;
}
.logo-title { font-size: 1.5rem; font-weight: 800; color: var(--brand); margin: 0; }
.logo-sub   { color: var(--text-muted); font-size: .85rem; margin-top: 4px; }
.login-input { background: #0d0d1a !important; border-color: #2a2a3e !important; color: #e2e8f0 !important; }
.login-btn  { background: linear-gradient(135deg, var(--brand), var(--brand-dark)); border: none; color: #000; }
.login-btn:hover { background: linear-gradient(135deg, var(--brand-dark), #b45309); color: #000; }

/* ── MODALS ── */
.modal-content { background: #1a1a2e; border-color: #2a2a3e; }
.modal-header  { border-color: #2a2a3e; }
.modal-footer  { border-color: #2a2a3e; }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #0d0d1a; }
::-webkit-scrollbar-thumb { background: #2a2a3e; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #3a3a5e; }

/* ── ALERTS ──
   Fond opaque : ces messages flottent en overlay au-dessus de n'importe
   quel contenu (y compris des sections à fond blanc comme le pointage),
   donc un fond translucide les rend invisibles selon ce qu'il y a dessous.
   Un fond plein + bordure de couleur reste lisible partout. */
.alert { border-radius: 10px; border: none; border-left: 4px solid; background: #1e2b3f; color: #f1f5f9; }
.alert-success  { border-left-color: #10b981; }
.alert-success i  { color: #34d399; }
.alert-danger   { border-left-color: #ef4444; }
.alert-danger i   { color: #f87171; }
.alert-warning  { border-left-color: #f59e0b; }
.alert-warning i  { color: #fbbf24; }
.alert-info     { border-left-color: #3b82f6; }
.alert-info i     { color: #60a5fa; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .stat-value { font-size: 1.2rem; }
  .page-content { padding: 16px 12px; }
}

/* ── TOAST NOTIFICATIONS ── */
#toast-container {
  position: fixed;
  bottom: 28px; right: 24px;
  z-index: 9999;
  display: flex; flex-direction: column-reverse;
  gap: 10px;
  pointer-events: none;
}
.app-toast {
  padding: 13px 18px;
  border-radius: 12px;
  font-size: .875rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 220px;
  max-width: 340px;
  opacity: 0;
  transform: translateX(60px) scale(.95);
  transition: opacity .28s cubic-bezier(.4,0,.2,1),
              transform .28s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
  pointer-events: auto;
}
.app-toast.show {
  opacity: 1;
  transform: translateX(0) scale(1);
}
.app-toast.hide {
  opacity: 0;
  transform: translateX(60px) scale(.95);
}
.app-toast .toast-icon { font-size: 1.1rem; flex-shrink: 0; }
.app-toast .toast-msg  { flex: 1; line-height: 1.35; }
.toast-progress {
  position: absolute;
  bottom: 0; left: 0;
  height: 3px; border-radius: 0 0 12px 12px;
  animation: toast-shrink linear forwards;
}
@keyframes toast-shrink {
  from { width: 100%; }
  to   { width: 0%; }
}
.app-toast { position: relative; overflow: hidden; }

.toast-success {
  background: #052e16;
  color: #86efac;
  border: 1px solid #166534;
}
.toast-success .toast-progress { background: #22c55e; }

.toast-warning {
  background: #1c0a00;
  color: #fcd34d;
  border: 1px solid #92400e;
}
.toast-warning .toast-progress { background: #f59e0b; }

.toast-danger {
  background: #1c0000;
  color: #fca5a5;
  border: 1px solid #7f1d1d;
}
.toast-danger .toast-progress { background: #ef4444; }

.toast-info {
  background: #0c1a2e;
  color: #93c5fd;
  border: 1px solid #1e3a5f;
}
.toast-info .toast-progress { background: #3b82f6; }

/* ── PRINT (general) ── */
@media print {
  .sidebar, .topbar, .flash-container { display: none !important; }
  .main-content { margin-left: 0; }
}
