/* ==============================================================
   STYLE UNIQUE – CUISINE PRO (CLAIR, MODERNE, PLEINE LARGEUR)
   ============================================================== */

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

:root {
  --bg-body: #f5f7fb;
  --bg-card: #ffffff;
  --bg-input: #ffffff;
  --bg-hover: #f0f4ff;
  --text-main: #0b1a33;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --border-light: #eef2f6;
  --border-medium: #dce1eb;
  --accent: #f97316;
  --accent-dark: #ea580c;
  --accent-glow: rgba(249, 115, 22, 0.15);
  --blue: #2563eb;
  --blue-hover: #1d4ed8;
  --blue-glow: rgba(37, 99, 235, 0.12);
  --green: #22c55e;
  --green-bg: #f0fdf4;
  --red: #ef4444;
  --red-bg: #fef2f2;
  --yellow: #eab308;
  --yellow-bg: #fefce8;
  --orange-bg: #fff7ed;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.07);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-full: 999px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: var(--font);
  background-color: var(--bg-body);
  color: var(--text-main);
  padding: 24px;
  min-height: 100vh;
  line-height: 1.6;
}
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-body); }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

h1, h2, h3, h4 { font-weight: 800; letter-spacing: -0.02em; color: var(--text-main); }
h1 { font-size: 2.4rem; }
h2 { font-size: 1.8rem; }
h3 { font-size: 1.4rem; }
a { color: var(--accent); text-decoration: none; font-weight: 600; transition: 0.2s; }
a:hover { color: var(--accent-dark); text-decoration: underline; }

.container { max-width: 1440px; margin: 0 auto; padding: 0 4px; }

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 16px 28px;
  margin-bottom: 32px;
  box-shadow: var(--shadow-sm);
}
.page-header h1 {
  font-size: 2rem;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}
.page-header h1 i {
  color: var(--accent);
  background: var(--accent-glow);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}
.user-badge {
  background: var(--bg-body);
  padding: 8px 20px;
  border-radius: var(--radius-full);
  font-weight: 600;
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
  font-size: 0.95rem;
}
.user-badge i { color: var(--accent); margin-right: 8px; }
.btn-logout {
  background: var(--red);
  color: #fff;
  border: none;
  padding: 9px 22px;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}
.btn-logout:hover { background: #dc2626; transform: scale(1.03); box-shadow: 0 8px 20px rgba(239,68,68,0.25); }

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 28px 30px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  transition: 0.25s;
}
.card:hover { box-shadow: var(--shadow-md); border-color: var(--border-medium); }
.card-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 22px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-main);
}
.card-title i {
  color: var(--accent);
  font-size: 1.4rem;
  background: var(--accent-glow);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }
.row { display: flex; flex-wrap: wrap; gap: 24px; }
.col { flex: 1; min-width: 280px; }

label {
  display: block;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
input, select, textarea {
  width: 100%;
  padding: 14px 18px;
  background: var(--bg-input);
  border: 1.5px solid var(--border-medium);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 1rem;
  color: var(--text-main);
  transition: 0.2s;
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-glow);
  background: #ffffff;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 32px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: 0.25s ease;
  text-decoration: none;
}
.btn:hover { transform: translateY(-2px); text-decoration: none; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 4px 12px var(--accent-glow); }
.btn-primary:hover { background: var(--accent-dark); box-shadow: 0 8px 25px rgba(249,115,22,0.35); color: #fff; }
.btn-success { background: var(--green); color: #fff; }
.btn-success:hover { background: #16a34a; box-shadow: 0 8px 25px rgba(34,197,94,0.3); color: #fff; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #dc2626; box-shadow: 0 8px 25px rgba(239,68,68,0.25); color: #fff; }
.btn-outline { background: transparent; border: 2px solid var(--border-medium); color: var(--text-secondary); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-glow); }
.btn-dark { background: #1e293b; color: #fff; }
.btn-dark:hover { background: #0f172a; color: #fff; }

.table-wrapper { overflow-x: auto; border-radius: var(--radius-sm); border: 1px solid var(--border-light); }
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
  background: #ffffff;
}
.table thead { background: #f8fafc; border-bottom: 2px solid var(--border-medium); }
.table thead th {
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 16px 16px;
  text-align: left;
  border: none;
}
.table tbody tr { border-bottom: 1px solid var(--border-light); transition: 0.15s; }
.table tbody tr:last-child { border-bottom: none; }
.table tbody tr:hover { background: var(--bg-hover); }
.table tbody td { padding: 16px 16px; vertical-align: middle; border: none; }

.badge {
  display: inline-block;
  padding: 6px 20px;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 1px solid transparent;
}
.badge-warning { background: var(--yellow-bg); color: #854d0e; border-color: #fef08a; }
.badge-info    { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }
.badge-success { background: var(--green-bg); color: #166534; border-color: #bbf7d0; }
.badge-danger  { background: var(--red-bg); color: #991b1b; border-color: #fecaca; }
.badge-dark    { background: #f1f5f9; color: #334155; border-color: #e2e8f0; }
.badge-orange  { background: var(--orange-bg); color: #9a3412; border-color: #fed7aa; }
.badge-blue    { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }

.status-bar { display: flex; align-items: center; gap: 10px; }
.status-bar .dot { width: 14px; height: 14px; border-radius: 50%; display: inline-block; flex-shrink: 0; border: 1px solid rgba(0,0,0,0.05); }
.dot-en_cours  { background: var(--yellow); }
.dot-cuisson   { background: var(--accent); }
.dot-dressage  { background: var(--green); }
.dot-termine   { background: var(--text-muted); }
.status-bar .label { font-weight: 600; font-size: 0.9rem; }

.alert {
  padding: 16px 24px;
  border-radius: var(--radius-sm);
  margin-bottom: 24px;
  font-weight: 600;
  border-left: 8px solid transparent;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-left-width: 8px;
}
.alert-success { border-left-color: var(--green); color: #166534; }
.alert-danger  { border-left-color: var(--red); color: #991b1b; }
.alert-warning { border-left-color: var(--accent); color: #9a3412; }
.alert-info    { border-left-color: var(--blue); color: #1e40af; }

.tv-mode .card { background: #ffffff; border: 1px solid var(--border-light); box-shadow: var(--shadow-lg); }
.tv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 28px; }
.tv-card {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-md);
  transition: 0.3s;
  border-top: 6px solid var(--accent);
}
.tv-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.tv-card .order-number { font-size: 2.8rem; font-weight: 900; color: var(--text-main); letter-spacing: -0.03em; }
.tv-card .order-meta { display: flex; gap: 20px; font-weight: 600; color: var(--text-secondary); margin: 8px 0 16px 0; }
.tv-card .order-time { font-size: 2rem; font-weight: 800; color: var(--accent); }
.tv-card .plat-item {
  background: var(--bg-body);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-left: 4px solid var(--border-medium);
}
.tv-card .plat-item .status-tag {
  font-weight: 700;
  font-size: 0.7rem;
  text-transform: uppercase;
  padding: 4px 14px;
  border-radius: var(--radius-full);
}
.status-a_cuire  { background: var(--red-bg); color: #991b1b; }
.status-cuit     { background: var(--yellow-bg); color: #854d0e; }
.status-a_dresser{ background: #eff6ff; color: #1e40af; }
.status-dresse   { background: var(--green-bg); color: #166534; }
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state span { font-size: 4rem; display: block; margin-bottom: 16px; }
.empty-state h2 { font-size: 2rem; color: var(--text-main); }

.ready-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-bottom: 10px; }
.ready-card {
  background: var(--green-bg);
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: 0.2s;
}
.ready-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.ready-card .plat-info { display: flex; flex-direction: column; }
.ready-card .plat-name { font-weight: 700; font-size: 1.1rem; color: var(--text-main); }
.ready-card .plat-meta { font-size: 0.85rem; color: var(--text-secondary); }
.ready-card .plat-meta i { margin-right: 4px; color: var(--accent); }
.ready-card .badge-ready {
  background: var(--green);
  color: #fff;
  padding: 4px 16px;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.stats-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  padding: 6px 18px;
  border-radius: var(--radius-full);
  font-weight: 600;
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}
.stats-badge i { color: var(--accent); }
.stats-badge .number { color: var(--text-main); font-size: 1.2rem; font-weight: 800; }

.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
.flex-center { display: flex; justify-content: center; align-items: center; gap: 12px; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 28px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 28px; }
.w-100 { width: 100%; }
.order-time { font-weight: 600; color: var(--text-secondary); font-size: 0.9rem; white-space: nowrap; }
.order-time i { margin-right: 6px; color: var(--accent); }

@media (max-width: 768px) {
  body { padding: 16px; }
  .page-header { flex-direction: column; align-items: flex-start; padding: 18px; }
  .page-header h1 { font-size: 1.6rem; }
  .card { padding: 20px; }
  .grid-2 { grid-template-columns: 1fr; gap: 16px; }
  .col { min-width: 100%; }
  .tv-grid { grid-template-columns: 1fr; }
  .btn { padding: 12px 20px; font-size: 0.9rem; }
  .table { font-size: 0.85rem; }
  .table thead th, .table tbody td { padding: 12px 8px; }
  .ready-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .page-header .header-actions { flex-wrap: wrap; width: 100%; }
  .header-actions .user-badge { font-size: 0.8rem; padding: 6px 14px; }
  .btn-logout { padding: 8px 16px; font-size: 0.8rem; }
  .tv-card .order-number { font-size: 2rem; }
  .tv-card .order-time { font-size: 1.5rem; }
  .stats-badge { font-size: 0.85rem; padding: 4px 12px; }
}