:root {
  --bg: #f5f8ff;
  --card: #fff;
  --text: #0f172a;
  --muted: #64748b;
  --line: #dbe5ff;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --success: #15803d;
  --danger: #b91c1c;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
html.auth-locked body { overflow: hidden; }
html.auth-locked .page-shell { opacity: .4; pointer-events: none; }

.page-shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 28px 0 48px; }
.page-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.page-header h1 { margin: 2px 0 4px; font-size: clamp(26px, 4vw, 38px); }
.eyebrow { margin: 0; color: var(--primary); font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.subtitle, .section-heading p { margin: 0; color: var(--muted); }

.card { margin-bottom: 16px; padding: 18px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 8px 24px rgba(30, 64, 175, .06); }
.status-area { min-height: 30px; }
.details-grid label { color: #334155; font-weight: 700; }

.page-shell input, .page-shell select, .page-shell textarea { width: 100%; border: 1px solid #cbd5e1; border-radius: 10px; padding: 11px 12px; background: #fff; color: var(--text); font: inherit; }
.page-shell input:focus, .page-shell select:focus, .page-shell textarea:focus { outline: 0; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.btn { border: 0; border-radius: 10px; padding: 11px 15px; background: var(--primary); color: #fff; font-weight: 700; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--primary-dark); }
.btn:disabled { opacity: .6; cursor: wait; }
.btn.ghost { background: #fff; color: var(--text); border: 1px solid var(--line); }

.message { min-height: 20px; margin: 10px 0 0; font-weight: 700; }
.message.error { color: var(--danger); }
.message.success { color: var(--success); }
.commande-card { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.commande-card > div { display: grid; gap: 4px; }
.meta-label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }

.section-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 14px; }
.section-heading h2 { margin: 0 0 4px; font-size: 20px; }
#selectedTotal { color: var(--primary); white-space: nowrap; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 11px 10px; border-bottom: 1px solid #eef2f7; text-align: left; vertical-align: middle; }
th { background: #f3f6ff; color: #475569; font-size: 13px; }
td input { min-width: 130px; }
td select { min-width: 155px; }
.product-name { font-weight: 700; }
.format-name { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.available-hint { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; }
.status-pill { display: inline-block; border-radius: 999px; padding: 4px 9px; background: #fef3c7; color: #92400e; font-size: 12px; font-weight: 800; }
.status-pill.confirme { background: #dcfce7; color: #166534; }
.status-pill.annule { background: #fee2e2; color: #991b1b; }

.details-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.details-grid label { display: grid; gap: 7px; }
.notes-field { grid-column: 1 / -1; }
.form-actions { display: flex; justify-content: flex-end; }
.empty { margin: 14px 0 0; color: var(--muted); text-align: center; }
.hidden { display: none !important; }

@media (max-width: 700px) {
  .page-header, .section-heading { flex-direction: column; }
  .commande-card, .details-grid { grid-template-columns: 1fr; }
  .notes-field { grid-column: auto; }
  .form-actions .btn { width: 100%; }
}



