@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url("/fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-display: swap; src: url("/fonts/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url("/fonts/inter-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 700; font-display: swap; src: url("/fonts/inter-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-weight: 500; font-display: swap; src: url("/fonts/cormorant-garamond-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-weight: 600; font-display: swap; src: url("/fonts/cormorant-garamond-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-weight: 700; font-display: swap; src: url("/fonts/cormorant-garamond-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-weight: 600; font-style: italic; font-display: swap; src: url("/fonts/cormorant-garamond-latin-600-italic.woff2") format("woff2"); }
:root {
  /* Identité Buffet Azur : bleu nuit + or. Le nom --bleu est gardé pour
     la compatibilité avec les styles hérités de BKD Manager. */
  --bleu: #1E2F52;
  --bleu-fonce: #141F38;
  --bleu-clair: #EEF1F8;
  --or: #D4A03A;
  --or-clair: #F2C14E;
  --or-fonce: #A8691E;
  --or-pale: #FBF3E0;
  --creme: #FBF7EF;
  --sable: #F3EBDD;
  --degrade-or: linear-gradient(135deg, #A8691E 0%, #D4A03A 45%, #F2C14E 100%);
  --zellige: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'%3E%3Cg fill='none' stroke='%23D4A03A' stroke-width='1'%3E%3Crect x='20' y='20' width='24' height='24'/%3E%3Crect x='20' y='20' width='24' height='24' transform='rotate(45 32 32)'/%3E%3Ccircle cx='32' cy='32' r='5'/%3E%3Cpath d='M0 32h8M56 32h8M32 0v8M32 56v8'/%3E%3C/g%3E%3C/svg%3E");
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --vert: #16a34a;
  --vert-clair: #f0fdf4;
  --rouge: #dc2626;
  --rouge-clair: #fef2f2;
  --orange: #d97706;
  --orange-clair: #fffbeb;
  --gris-900: #111827;
  --gris-700: #374151;
  --gris-500: #6b7280;
  --gris-300: #d1d5db;
  --gris-200: #e5e7eb;
  --gris-100: #f3f4f6;
  --gris-50: #fafaf9;
  --blanc: #ffffff;
  --radius: 8px;
  --ombre: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --ombre-lg: 0 10px 25px rgba(0,0,0,0.15);
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0; height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--gris-900);
  background: var(--gris-50);
  font-size: 14px;
}

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

/* --- Sidebar --- */
.sidebar {
  width: 230px; flex-shrink: 0;
  background: #1c1917;
  color: #d6d3d1;
  display: flex; flex-direction: column;
  position: fixed; top: 0; bottom: 0; left: 0;
}
.logo { display: flex; align-items: center; gap: 10px; padding: 18px 18px; border-bottom: 1px solid #292524; }
.logo-icon { font-size: 26px; }
.logo-title { font-weight: 700; color: #fff; font-size: 16px; }
.logo-sub { font-size: 11px; color: #a8a29e; }
.nav { display: flex; flex-direction: column; padding: 10px 10px; gap: 1px; flex: 1; overflow-y: auto; }
.nav-section { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: #a8a29e; padding: 12px 12px 4px; font-weight: 700; }
.nav a {
  color: #d6d3d1; text-decoration: none; padding: 8px 12px; border-radius: 6px;
  font-size: 13.5px; font-weight: 500; transition: background .12s;
}
.nav a:hover { background: #292524; color: #fff; }
.nav a.active { background: var(--bleu); color: #fff; }
.nav-badge {
  display: inline-block; min-width: 18px; padding: 1px 5px; margin-left: 4px;
  background: var(--rouge); color: #fff; border-radius: 999px; font-size: 10.5px;
  font-weight: 700; text-align: center; vertical-align: middle;
}
.sidebar-footer { padding: 12px 18px; font-size: 11px; color: #a8a29e; border-top: 1px solid #292524; }
.footer-utilisateur { margin-bottom: 8px; }
.footer-nom { color: #e2e8f0; font-weight: 600; font-size: 12.5px; margin-bottom: 2px; }
.footer-role { color: #a8a29e; font-size: 11px; }
.footer-role a { color: #fdba74; text-decoration: none; }
.footer-role a:hover { text-decoration: underline; }
.footer-version { opacity: .7; }

/* --- Content --- */
.content { margin-left: 230px; flex: 1; padding: 28px 32px; max-width: 1280px; }
.loading { color: var(--gris-500); padding: 40px; text-align: center; }

/* --- Écran de connexion --- */
.login-screen {
  min-height: 100vh; width: 100%; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 30% 20%, #7c2d12 0%, #1c1917 60%); padding: 20px;
}
.login-card {
  background: var(--blanc); border-radius: 12px; box-shadow: var(--ombre-lg);
  padding: 36px 32px; width: 100%; max-width: 380px;
}
.login-card .logo-title { color: var(--gris-900); }
.login-card .logo-sub { color: var(--gris-500); }
.login-message {
  background: var(--orange-clair); color: var(--orange); border-radius: 6px;
  padding: 10px 12px; font-size: 13px; margin-bottom: 16px;
}
.login-erreur { color: var(--rouge); font-size: 13px; margin-top: 4px; min-height: 16px; }

.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; flex-wrap: wrap; gap: 12px; }
.page-header h1 { font-size: 22px; margin: 0; }
.page-header .sub { color: var(--gris-500); font-size: 13px; margin-top: 2px; }

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; border-radius: 6px; border: 1px solid transparent;
  font-size: 13.5px; font-weight: 600; cursor: pointer; text-decoration: none;
  transition: all .12s; background: var(--blanc); color: var(--gris-700); border-color: var(--gris-300);
}
.btn:hover { background: var(--gris-100); }
.btn-primary { background: var(--bleu); color: #fff; border-color: var(--bleu); }
.btn-primary:hover { background: var(--bleu-fonce); }
.btn-danger { background: var(--blanc); color: var(--rouge); border-color: #fecaca; }
.btn-danger:hover { background: var(--rouge-clair); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-icon { padding: 6px 9px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* --- Cards / KPIs --- */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.kpi-card { background: var(--blanc); border: 1px solid var(--gris-200); border-radius: var(--radius); padding: 18px; box-shadow: var(--ombre); }
.kpi-card .label { font-size: 12px; color: var(--gris-500); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.kpi-card .value { font-size: 26px; font-weight: 700; margin-top: 6px; }
.kpi-card .value.rouge { color: var(--rouge); }
.kpi-card .value.orange { color: var(--orange); }
.kpi-card .value.vert { color: var(--vert); }

.card { background: var(--blanc); border: 1px solid var(--gris-200); border-radius: var(--radius); box-shadow: var(--ombre); margin-bottom: 20px; }
.card-header { padding: 14px 18px; border-bottom: 1px solid var(--gris-200); font-weight: 700; font-size: 14.5px; display: flex; justify-content: space-between; align-items: center; }
.card-body { padding: 18px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 1000px) { .two-col { grid-template-columns: 1fr; } .kpi-grid { grid-template-columns: repeat(2,1fr); } }
.m-pointage-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--gris-100); font-size: 13.5px; }
.m-pointage-row:last-child { border-bottom: none; }

/* --- Tables --- */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .03em; color: var(--gris-500); padding: 10px 14px; border-bottom: 1px solid var(--gris-200); }
td { padding: 12px 14px; border-bottom: 1px solid var(--gris-100); font-size: 13.5px; }
tr:last-child td { border-bottom: none; }
table.clickable tbody tr { cursor: pointer; }
table.clickable tbody tr:hover { background: var(--gris-50); }
.empty-row td { text-align: center; color: var(--gris-500); padding: 30px; }

/* --- Badges --- */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; }
.badge-gris { background: var(--gris-100); color: var(--gris-700); }
.badge-bleu { background: var(--bleu-clair); color: var(--bleu-fonce); }
.badge-vert { background: var(--vert-clair); color: var(--vert); }
.badge-rouge { background: var(--rouge-clair); color: var(--rouge); }
.badge-orange { background: var(--orange-clair); color: var(--orange); }

/* --- Forms --- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid.full, .form-row { grid-column: 1 / -1; }
label { display: block; font-size: 12.5px; font-weight: 600; color: var(--gris-700); margin-bottom: 5px; }
input, select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--gris-300); border-radius: 6px;
  font-size: 13.5px; font-family: inherit; background: var(--blanc); color: var(--gris-900);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--bleu); box-shadow: 0 0 0 3px var(--bleu-clair); }
textarea { resize: vertical; min-height: 60px; }
.field { margin-bottom: 4px; }
.hint { font-size: 11.5px; color: var(--gris-500); margin-top: 4px; }

/* --- Search bar --- */
.toolbar { display: flex; gap: 10px; margin-bottom: 16px; align-items: center; flex-wrap: wrap; }
.search-input { max-width: 320px; }

/* --- Modal --- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15,23,42,0.5);
  display: flex; align-items: flex-start; justify-content: center; padding: 40px 20px;
  overflow-y: auto; z-index: 100;
}
.modal { background: var(--blanc); border-radius: 10px; width: 100%; max-width: 640px; box-shadow: var(--ombre-lg); }
.modal.wide { max-width: 820px; }
.modal-header { padding: 16px 22px; border-bottom: 1px solid var(--gris-200); display: flex; justify-content: space-between; align-items: center; }
.modal-header h2 { margin: 0; font-size: 17px; }
.modal-close { cursor: pointer; background: none; border: none; font-size: 20px; color: var(--gris-500); }
.modal-body { padding: 20px 22px; max-height: 70vh; overflow-y: auto; }
.modal-footer { padding: 14px 22px; border-top: 1px solid var(--gris-200); display: flex; justify-content: flex-end; gap: 10px; }

/* --- Line items editor --- */
.items-table { width: 100%; border-collapse: collapse; margin-bottom: 10px; }
.items-table th { font-size: 11px; padding: 6px 8px; }
.items-table td { padding: 6px 8px; border-bottom: none; }
.items-table input { padding: 7px 9px; font-size: 13px; }
.items-table .col-desc { width: 45%; }
.items-table .col-qte { width: 12%; }
.items-table .col-prix { width: 16%; }
.items-table .col-total { width: 16%; text-align: right; padding-right: 4px; font-weight: 600; }
.items-table .col-del { width: 30px; }
.totals-box { margin-left: auto; width: 260px; margin-top: 12px; }
.totals-box .row { display: flex; justify-content: space-between; padding: 4px 0; font-size: 13.5px; }
.totals-box .row.total { font-weight: 700; font-size: 16px; border-top: 1px solid var(--gris-300); margin-top: 6px; padding-top: 8px; }
.remove-row-btn { background: none; border: none; color: var(--rouge); cursor: pointer; font-size: 16px; }

/* --- Calendar / Planification --- */
.cal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.cal-nav { display: flex; gap: 6px; align-items: center; }
.week-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; }
.day-col { background: var(--blanc); border: 1px solid var(--gris-200); border-radius: var(--radius); min-height: 220px; display: flex; flex-direction: column; }
.day-col.today { border-color: var(--bleu); box-shadow: 0 0 0 1px var(--bleu); }
.day-col-header { padding: 8px 10px; border-bottom: 1px solid var(--gris-200); font-size: 12px; font-weight: 700; text-align: center; }
.day-col-header .dow { color: var(--gris-500); text-transform: uppercase; font-size: 10px; display: block; }
.day-col-body { padding: 6px; display: flex; flex-direction: column; gap: 5px; flex: 1; }
.rdv-chip { border-radius: 5px; padding: 5px 7px; font-size: 11px; cursor: pointer; color: #fff; line-height: 1.3; }
.rdv-chip .heure { font-weight: 700; display: block; }
.add-day-btn { text-align: center; padding: 5px; font-size: 11px; color: var(--gris-500); cursor: pointer; border: 1px dashed var(--gris-300); border-radius: 5px; margin: 4px 6px 6px; }
.add-day-btn:hover { background: var(--gris-50); }

/* --- Detail page --- */
.detail-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; }
.detail-title { font-size: 20px; font-weight: 700; }
.detail-meta { color: var(--gris-500); font-size: 13px; margin-top: 4px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--gris-200); margin-bottom: 18px; }
.tab { padding: 9px 14px; cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--gris-500); border-bottom: 2px solid transparent; }
.tab.active { color: var(--bleu); border-color: var(--bleu); }

.equip-item { border: 1px solid var(--gris-200); border-radius: 6px; padding: 10px 12px; margin-bottom: 8px; }
.equip-item .titre { font-weight: 700; font-size: 13px; }
.equip-item .meta { font-size: 12px; color: var(--gris-500); margin-top: 3px; }

.site-block { border: 1px solid var(--gris-200); border-radius: var(--radius); padding: 14px; margin-bottom: 14px; }
.site-block-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.site-block-header .titre { font-weight: 700; }

.stat-row { display: flex; gap: 16px; flex-wrap: wrap; }

.link { color: var(--bleu); cursor: pointer; text-decoration: none; font-weight: 600; }
.link:hover { text-decoration: underline; }

.muted { color: var(--gris-500); }
.text-right { text-align: right; }
.mt-0 { margin-top: 0; }

.photo-thumb {
  width: 40px; height: 40px; object-fit: cover; border-radius: 6px;
  border: 1px solid var(--gris-300); cursor: pointer; display: block;
}

/* --- Toast --- */
.toast {
  position: fixed; bottom: 24px; right: 24px; background: var(--gris-900); color: #fff;
  padding: 12px 18px; border-radius: 8px; font-size: 13.5px; box-shadow: var(--ombre-lg);
  z-index: 200; animation: fadein .15s ease-out;
}
.toast.erreur { background: var(--rouge); }
.toast.succes { background: var(--vert); }
@keyframes fadein { from { opacity: 0; transform: translateY(8px);} to { opacity: 1; transform: translateY(0);} }

.print-only { display: none; }
@media print {
  .sidebar, .page-header .btn, .toolbar, .no-print, #toast-root, #modal-root { display: none !important; }
  .content { margin-left: 0; }
  .print-only { display: block; }
  body.print-mode-doc .card { display: none !important; }
  body.print-mode-doc .page-header { display: none !important; }
  @page { margin: 14mm; }
  table.doc-print-items thead { display: table-header-group; }
  table.doc-print-items tfoot { display: table-row-group; }
  table.doc-print-items tr { page-break-inside: avoid; }
}

/* --- Gabarit d'impression professionnel (factures / soumissions / facturation contracteurs) --- */
.doc-print {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  color: #111827;
  max-width: 820px;
  margin: 0 auto;
}
.doc-print-top {
  display: flex; justify-content: space-between; align-items: flex-start;
  border-bottom: 3px solid #111827; padding-bottom: 18px; margin-bottom: 24px;
}
.doc-print-company-name { font-size: 20px; font-weight: 800; margin-bottom: 4px; }
.doc-print-company div { font-size: 12.5px; line-height: 1.55; color: #374151; }
.doc-print-taxids { margin-top: 4px; }
.doc-print-doctitle { text-align: right; flex-shrink: 0; padding-left: 20px; }
.doc-print-doctitle h1 { font-size: 30px; letter-spacing: 3px; margin: 0; color: #111827; }
.doc-print-num { font-size: 13.5px; color: #374151; margin-top: 6px; font-weight: 700; }

.doc-print-meta { display: flex; justify-content: space-between; gap: 30px; margin-bottom: 26px; }
.doc-print-billto { flex: 1 1 auto; min-width: 220px; white-space: nowrap; }
.doc-print-billto .label, .doc-print-notes .label, .doc-print-paiements .label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: #6b7280; font-weight: 700; margin-bottom: 6px; white-space: nowrap;
}
.doc-print-billto .name { font-weight: 700; font-size: 14.5px; margin-bottom: 2px; }
.doc-print-billto div { font-size: 13px; line-height: 1.55; color: #1f2937; }
.doc-print-info { flex: 0 0 auto; align-self: flex-start; }
.doc-print-info .info-row { display: flex; justify-content: flex-end; gap: 24px; padding: 3px 0; font-size: 13px; white-space: nowrap; }
.doc-print-info .info-row span:first-child { color: #6b7280; min-width: 90px; text-align: left; }
.doc-print-info .info-row span:last-child { color: #1f2937; text-align: right; min-width: 110px; }

table.doc-print-items { width: 100%; border-collapse: collapse; margin-bottom: 20px; }
table.doc-print-items thead th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .04em;
  color: #fff; background: #111827; padding: 9px 10px;
}
table.doc-print-items thead th.text-right { text-align: right; }
table.doc-print-items tbody td { padding: 9px 10px; font-size: 13px; border-bottom: 1px solid #e5e7eb; }
table.doc-print-items tbody tr:last-child td { border-bottom: 2px solid #111827; }

.doc-print-totals { margin-left: auto; width: 280px; margin-bottom: 22px; }
.doc-print-totals .row { display: flex; justify-content: space-between; padding: 5px 0; font-size: 13px; }
.doc-print-totals .row.total { border-top: 2px solid #111827; margin-top: 6px; padding-top: 10px; font-size: 18px; font-weight: 800; }
.doc-print-totals .row.solde { font-weight: 800; color: #b91c1c; }

.doc-print-paiements { margin-bottom: 20px; }
.doc-print-paiements table { width: 100%; border-collapse: collapse; }
.doc-print-paiements td { padding: 5px 0; font-size: 12.5px; border-bottom: 1px solid #f3f4f6; }

.doc-print-notes { margin-bottom: 24px; }
.doc-print-notes p { font-size: 12.5px; color: #374151; white-space: pre-wrap; margin: 0; }

/* --- Rapport de dépenses (comptable) --- */
table.doc-print-items.dep-print-table thead th { font-size: 10px; padding: 7px 6px; }
table.doc-print-items.dep-print-table tbody td { font-size: 11px; padding: 6px 6px; }
table.doc-print-items.dep-print-table tfoot td { padding: 8px 6px; font-size: 11.5px; border-top: 2px solid #111827; }
.doc-print .label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: #6b7280; font-weight: 700; margin-bottom: 6px; }
.dep-print-repart-row { display: flex; justify-content: space-between; font-size: 12.5px; padding: 4px 0; border-bottom: 1px solid #f3f4f6; }
.dep-print-vide { font-size: 12.5px; color: #9ca3af; margin: 0; }
.dep-print-tail { page-break-inside: avoid; break-inside: avoid; margin-top: 10px; }

/* --- Messages (chat bureau <-> techniciens) --- */
.chat-layout {
  display: grid; grid-template-columns: 240px 1fr; gap: 0;
  background: var(--blanc); border: 1px solid var(--gris-200); border-radius: var(--radius);
  box-shadow: var(--ombre); overflow: hidden; height: calc(100vh - 170px); min-height: 420px;
}
.chat-list { border-right: 1px solid var(--gris-200); overflow-y: auto; background: var(--gris-50); }
.chat-list-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 12px 14px; font-size: 13.5px; cursor: pointer; border-bottom: 1px solid var(--gris-100);
}
.chat-list-item:hover { background: var(--gris-100); }
.chat-list-item.active { background: var(--bleu-clair); color: var(--bleu-fonce); font-weight: 600; }
.chat-thread { display: flex; flex-direction: column; height: 100%; }
.chat-thread-header { padding: 14px 18px; border-bottom: 1px solid var(--gris-200); font-weight: 700; font-size: 14.5px; }
.chat-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.chat-bubble {
  max-width: 70%; padding: 8px 12px; border-radius: 12px; font-size: 13.5px; line-height: 1.4;
  background: var(--gris-100); color: var(--gris-900); align-self: flex-start;
}
.chat-bubble.moi { background: var(--bleu); color: #fff; align-self: flex-end; }
.chat-bubble-heure { font-size: 10.5px; opacity: .7; margin-top: 3px; text-align: right; }
.chat-input-row { display: flex; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--gris-200); }
.chat-input-row input {
  flex: 1; padding: 9px 12px; border: 1px solid var(--gris-300); border-radius: 8px; font-size: 13.5px;
}
.chat-input-row input:focus { outline: none; border-color: var(--bleu); }

.doc-print-footer { text-align: center; font-size: 12.5px; color: #6b7280; border-top: 1px solid #e5e7eb; padding-top: 14px; margin-top: 10px; }


/* =================== Ajouts Azur Manager =================== */
.actions-rapides { display: flex; gap: 8px; flex-wrap: wrap; }
.kpi-grid.kpi-5 { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 1200px) { .kpi-grid.kpi-5 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 1000px) { .kpi-grid.kpi-5 { grid-template-columns: repeat(2, 1fr); } }
.kpi-sub { font-size: 12px; color: var(--gris-500); margin-top: 4px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; vertical-align: middle; }
.sous-titre { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--gris-500); font-weight: 700; margin: 14px 0 6px; }
.sous-titre:first-child { margin-top: 0; }
.ligne-simple { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--gris-100); font-size: 13.5px; align-items: center; }
.ligne-simple:last-child { border-bottom: none; }
.alerte-ligne { background: var(--rouge-clair); color: var(--rouge); padding: 8px 12px; border-radius: 6px; font-size: 13px; margin: 12px 0 0; }
.info-bandeau { background: var(--bleu-clair); border: 1px solid #fed7aa; color: var(--bleu-fonce); padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 14px; }
.ligne-attenuee td { opacity: .5; }
.ligne-alerte td { background: var(--rouge-clair); }
.select-sm { padding: 6px 8px; border: 1px solid var(--gris-300); border-radius: 6px; font-size: 13px; background: #fff; }
.check-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; cursor: pointer; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--gris-300); background: #fff; border-radius: 999px; padding: 5px 12px; font-size: 12.5px; font-weight: 600; color: var(--gris-700); cursor: pointer; }
.chip:hover { background: var(--gris-100); }
.chip.active { background: var(--bleu); border-color: var(--bleu); color: #fff; }
.toolbar { flex-wrap: wrap; }
.presets, .jours-choix { display: flex; gap: 6px; flex-wrap: wrap; }
.jour-check { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--gris-300); border-radius: 6px; padding: 6px 9px; font-size: 12.5px; cursor: pointer; }
.jour-check:has(input:checked) { background: var(--bleu-clair); border-color: var(--bleu); color: var(--bleu-fonce); }
.pastille { width: 20px; height: 20px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--gris-300); cursor: pointer; padding: 0; }
.legende-emp { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.chip-poste { opacity: .9; font-size: 10.5px; }
.absence-chip { border-radius: 5px; padding: 4px 7px; font-size: 11px; background: var(--gris-100); color: var(--gris-700); border: 1px dashed var(--gris-300); }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg label { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--gris-300); border-radius: 6px; padding: 7px 11px; font-size: 13px; font-weight: 500; cursor: pointer; }
.seg label:has(input:checked) { background: var(--bleu-clair); border-color: var(--bleu); color: var(--bleu-fonce); font-weight: 600; }
.input-comptage { width: 90px; padding: 5px 7px; border: 1px solid var(--gris-300); border-radius: 5px; text-align: right; font-size: 13px; }
.input-comptage.sauve { border-color: var(--vert); background: var(--vert-clair); }
.apercu-scroll { max-height: 260px; overflow-y: auto; border: 1px solid var(--gris-200); border-radius: 6px; }
.table-view { margin-top: 10px; font-size: 12.5px; }
.table-view summary { cursor: pointer; color: var(--gris-500); font-weight: 600; }
.table-view table { margin-top: 8px; }

/* Graphique en barres (ventes 14 jours) — une seule série, pas de légende. */
.bar-chart-plot { display: flex; align-items: flex-end; gap: 2px; height: 180px; border-bottom: 1px solid var(--gris-200); padding-top: 8px; }
.bar-col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; outline: none; }
.bar { width: 70%; max-width: 26px; background: #ea580c; border-radius: 4px 4px 0 0; transition: background .1s; }
.bar-col.auj .bar { background: #fdba74; }
.bar-col:hover .bar, .bar-col:focus .bar { background: #9a3412; }
.bar-x { position: absolute; bottom: -18px; font-size: 10.5px; color: var(--gris-500); }
.bar-chart { padding-bottom: 20px; }
.bar-tip { display: none; position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%); background: var(--gris-900); color: #fff; font-size: 11.5px; padding: 6px 9px; border-radius: 6px; white-space: nowrap; z-index: 5; pointer-events: none; line-height: 1.4; }
.bar-col:hover .bar-tip, .bar-col:focus .bar-tip { display: block; top: 0; bottom: auto; transform: translate(-50%, -100%); }

/* Barres horizontales (pertes, ventes par jour) */
.hbar-row { display: grid; grid-template-columns: minmax(160px, 2.6fr) 1fr 80px; gap: 10px; align-items: center; padding: 5px 0; font-size: 13px; }
.hbar-track { background: var(--gris-100); border-radius: 4px; height: 12px; overflow: hidden; }
.hbar { background: #ea580c; height: 100%; border-radius: 0 4px 4px 0; }
.hbar-val { text-align: right; font-weight: 600; }
.hbar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Tuiles de températures */
.temp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.temp-tile { border: 1px solid var(--gris-200); border-radius: 8px; padding: 10px 12px; border-left-width: 4px; }
.temp-tile.ok { border-left-color: var(--vert); }
.temp-tile.alerte { border-left-color: var(--rouge); background: var(--rouge-clair); }
.temp-tile.attente { border-left-color: var(--orange); }
.temp-tile-nom { font-size: 12.5px; font-weight: 700; }
.temp-tile-val { font-size: 22px; font-weight: 700; margin: 2px 0; }
.temp-tile-etat { font-size: 11.5px; color: var(--gris-700); }
.temp-tile.attente .temp-tile-etat { color: var(--orange); font-weight: 600; }
.temp-tile.alerte .temp-tile-etat { color: var(--rouge); font-weight: 700; }
.temp-tile-norme { font-size: 11px; color: var(--gris-500); margin-top: 2px; }

.tournee-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.tournee-item { border: 1px solid var(--gris-200); border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.tournee-item.ok { border-color: var(--vert); background: var(--vert-clair); }
.tournee-item.hors-norme { border-color: var(--rouge); background: var(--rouge-clair); }
.tournee-nom { font-weight: 700; font-size: 13.5px; }
.tournee-dernier { font-size: 12px; }
.tournee-saisie { display: flex; align-items: center; gap: 6px; }
.tournee-saisie input { width: 110px; font-size: 18px; font-weight: 700; padding: 6px 8px; border: 1px solid var(--gris-300); border-radius: 6px; }
.t-action { padding: 7px 9px; border: 1px solid var(--rouge); border-radius: 6px; font-size: 13px; }

.ing-libre { display: flex; gap: 6px; margin-top: 6px; }
.ing-libre input, .ing-inv, .ing-qte { padding: 6px 8px; border: 1px solid var(--gris-300); border-radius: 5px; font-size: 13px; }
.ing-inv { width: 100%; }
.ing-qte { width: 100%; }

@media print {
  body.print-mode-doc .content > *:not(.print-only) { display: none !important; }
  .card { box-shadow: none; break-inside: avoid; }
  .kpi-grid.kpi-5 { grid-template-columns: repeat(5, 1fr); }
}


/* =================================================================
   THÈME BUFFET AZUR — bleu nuit, or, motif zellige, animations
   ================================================================= */
html, body { font-family: var(--sans); background: var(--creme); color: #1b2436; }
h1, h2, h3, .card-header, .detail-title, .logo-title, .modal-header h2 { font-family: var(--serif); letter-spacing: .01em; }
.page-header h1 { font-size: 32px; font-weight: 700; color: var(--bleu); line-height: 1.1; }
.page-header h1::after { content: ""; display: block; width: 54px; height: 3px; border-radius: 3px; background: var(--degrade-or); margin-top: 8px; }
.page-header .sub { color: #6b7385; }

/* Barre latérale */
.sidebar { background: var(--bleu-fonce); background-image: linear-gradient(180deg, rgba(20,31,56,.92), rgba(20,31,56,.98)), var(--zellige); color: #cfd6e6; border-right: 1px solid rgba(212,160,58,.25); }
.logo { flex-direction: column; gap: 6px; padding: 18px 16px 14px; border-bottom: 1px solid rgba(212,160,58,.25); text-align: center; }
.logo-medaillon { width: 112px; height: 112px; border-radius: 50%; background: var(--creme); display: grid; place-items: center; box-shadow: 0 0 0 3px rgba(212,160,58,.55), 0 8px 24px rgba(0,0,0,.35); transition: transform .5s cubic-bezier(.2,.8,.2,1); }
.logo-medaillon:hover { transform: rotate(-4deg) scale(1.04); }
.logo-medaillon img { width: 96px; height: 96px; object-fit: contain; }
.logo-sub { color: var(--or-clair); font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; }
.nav-section { color: var(--or); opacity: .85; }
.nav a { color: #cfd6e6; position: relative; transition: background .18s, color .18s, padding-left .18s; }
.nav a:hover { background: rgba(212,160,58,.12); color: #fff; padding-left: 16px; }
.nav a.active { background: var(--degrade-or); color: var(--bleu-fonce); font-weight: 700; box-shadow: 0 4px 14px rgba(212,160,58,.35); }
.sidebar-footer { border-top: 1px solid rgba(212,160,58,.25); color: #8f9ab3; }
.footer-nom { color: #fff; }
.footer-role a { color: var(--or-clair); }

/* Contenu */
.content { animation: apparition .35s ease-out; }
@keyframes apparition { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.card, .kpi-card { border: 1px solid #ece3d2; border-radius: 14px; box-shadow: 0 1px 2px rgba(30,47,82,.05), 0 6px 18px rgba(30,47,82,.06); transition: transform .2s ease, box-shadow .2s ease; }
.card:hover { box-shadow: 0 2px 4px rgba(30,47,82,.06), 0 12px 28px rgba(30,47,82,.09); }
.card-header { font-size: 19px; font-weight: 700; color: var(--bleu); border-bottom: 1px solid #f0e8d8; }
.kpi-card { position: relative; overflow: hidden; }
.kpi-card::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 3px; background: var(--degrade-or); }
.kpi-card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(30,47,82,.12); }
.kpi-card .label { color: #7a6a4d; letter-spacing: .08em; font-size: 11px; }
.kpi-card .value { font-family: var(--sans); color: var(--bleu); font-variant-numeric: tabular-nums; }
.kpi-card .value.vert { color: #15803d; } .kpi-card .value.rouge { color: #b91c1c; } .kpi-card .value.orange { color: #b45309; }
.btn { border-radius: 10px; transition: transform .12s, box-shadow .15s, background .15s; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn-primary { background: var(--bleu); border-color: var(--bleu); color: #fff; box-shadow: 0 4px 12px rgba(30,47,82,.25); }
.btn-primary:hover { background: var(--bleu-fonce); box-shadow: 0 6px 18px rgba(30,47,82,.32); }
.btn-or { background: var(--degrade-or); color: var(--bleu-fonce); border: none; font-weight: 700; box-shadow: 0 4px 14px rgba(212,160,58,.4); }
.link { color: var(--or-fonce); }
.tab.active { color: var(--bleu); border-color: var(--or); }
.chip.active, .seg label:has(input:checked), .jour-check:has(input:checked) { background: var(--bleu); border-color: var(--bleu); color: #fff; }
table thead th { color: #7a6a4d; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: var(--or-pale); }
.badge-bleu { background: var(--bleu-clair); color: var(--bleu); }
.info-bandeau { background: var(--or-pale); border-color: #ecd9a8; color: #6b4b12; }
.modal { border-radius: 16px; overflow: hidden; animation: pop .22s cubic-bezier(.2,.9,.3,1.2); }
.modal-header { background: var(--bleu); color: #fff; background-image: linear-gradient(90deg, rgba(30,47,82,.96), rgba(30,47,82,.88)), var(--zellige); }
.modal-header h2 { color: #fff; font-size: 22px; }
.modal-close { color: var(--or-clair) !important; }
@keyframes pop { from { opacity: 0; transform: scale(.96) translateY(8px); } to { opacity: 1; transform: none; } }
.toast { border-radius: 12px; animation: glisse .25s ease-out; }
@keyframes glisse { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }
.day-col { border-radius: 12px; }
.day-col.today { border-color: var(--or); box-shadow: 0 0 0 2px rgba(212,160,58,.45); }
.rdv-chip { border-radius: 8px; transition: transform .15s, box-shadow .15s; }
.rdv-chip:hover { transform: translateY(-2px) scale(1.02); box-shadow: 0 6px 14px rgba(0,0,0,.2); }

/* Bandeau d'accueil du tableau de bord */
.hero { position: relative; border-radius: 18px; padding: 26px 28px; margin-bottom: 22px; color: #fff; overflow: hidden;
  background: linear-gradient(120deg, rgba(20,31,56,.97) 0%, rgba(30,47,82,.93) 60%, rgba(42,63,107,.9) 100%), var(--zellige);
  box-shadow: 0 16px 40px rgba(20,31,56,.25); display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }
.hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 260px; height: 260px; border-radius: 50%; border: 2px solid rgba(242,193,78,.35); }
.hero h1 { font-family: var(--serif); font-size: 36px; margin: 0; color: #fff; }
.hero .hero-sub { color: var(--or-clair); letter-spacing: .12em; text-transform: uppercase; font-size: 12px; margin-bottom: 6px; }
.hero .hero-date { color: #cfd6e6; margin-top: 6px; }
.hero-horloge { font-family: var(--serif); font-size: 44px; font-weight: 700; color: var(--or-clair); font-variant-numeric: tabular-nums; line-height: 1; text-align: right; }
.hero-prochain { font-size: 13px; color: #cfd6e6; margin-top: 6px; text-align: right; max-width: 320px; }
.hero .actions-rapides .btn { background: rgba(255,255,255,.1); border-color: rgba(242,193,78,.5); color: #fff; }
.hero .actions-rapides .btn:hover { background: rgba(255,255,255,.2); }
.hero .actions-rapides .btn-or { background: var(--degrade-or); color: var(--bleu-fonce); border: none; }

/* Graphiques aux couleurs Azur */
.bar { background: linear-gradient(180deg, #F2C14E, #D4A03A 60%, #A8691E); transform-origin: bottom; animation: pousse .7s cubic-bezier(.2,.8,.2,1) both; }
.bar-col:nth-child(n) .bar { animation-delay: calc(var(--i, 0) * 35ms); }
.bar-col.auj .bar { background: var(--bleu); }
.bar-col:hover .bar, .bar-col:focus .bar { background: var(--bleu-fonce); }
@keyframes pousse { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.hbar { background: var(--degrade-or); animation: etire .8s cubic-bezier(.2,.8,.2,1) both; transform-origin: left; }
@keyframes etire { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.bar-tip { background: var(--bleu-fonce); }

/* Anneau de progression */
.anneau { --p: 0; width: 86px; height: 86px; border-radius: 50%; display: grid; place-items: center; position: relative;
  background: conic-gradient(var(--or) calc(var(--p) * 1%), #efe6d4 0); transition: --p 1s; }
.anneau::before { content: ""; position: absolute; inset: 9px; background: #fff; border-radius: 50%; }
.anneau span { position: relative; font-weight: 700; color: var(--bleu); font-size: 18px; }
.anneau small { display: block; font-size: 10px; color: #7a6a4d; font-weight: 600; text-align: center; }

/* Tâches */
.taches-resume { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.statut-pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; }
.st-faite { background: #e7f6ec; color: #15803d; }
.st-maintenant, .st-en_cours { background: var(--or-pale); color: #8a5a10; box-shadow: 0 0 0 0 rgba(212,160,58,.6); animation: pulse 1.8s infinite; }
.st-en_retard { background: #fdecec; color: #b91c1c; }
.st-manquee { background: #f3f4f6; color: #6b7280; text-decoration: line-through; }
.st-a_venir { background: var(--bleu-clair); color: var(--bleu); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(212,160,58,.55); } 70% { box-shadow: 0 0 0 8px rgba(212,160,58,0); } 100% { box-shadow: 0 0 0 0 rgba(212,160,58,0); } }
.frise { position: relative; overflow-x: auto; }
.frise-grille { position: relative; min-width: 1100px; }
.frise-axe { display: grid; margin-left: 170px; height: 22px; font-size: 11px; color: #7a6a4d; position: relative; }
.frise-axe span { position: absolute; transform: translateX(-50%); top: 2px; }
.frise-ligne { display: flex; align-items: stretch; min-height: 46px; border-top: 1px dashed #efe6d4; }
.frise-nom { width: 170px; align-self: center; flex-shrink: 0; font-weight: 600; font-size: 13px; display: flex; align-items: center; gap: 6px; padding-right: 8px; }
.frise-piste { position: relative; flex: 1; min-height: 46px; }
.frise-bloc { position: absolute; top: 7px; height: 32px; border-radius: 8px; padding: 0 8px; font-size: 11.5px; font-weight: 600; display: flex; align-items: center; gap: 4px; white-space: nowrap; overflow: hidden; cursor: pointer; transition: transform .15s, box-shadow .15s, z-index 0s; border: 1px solid rgba(0,0,0,.06); }
.frise-bloc:hover { transform: translateY(-2px) scale(1.04); z-index: 5; box-shadow: 0 8px 18px rgba(0,0,0,.18); overflow: visible; }
.frise-bloc.st-faite { background: #dcfce7; color: #14532d; animation: none; }
.frise-bloc.st-maintenant, .frise-bloc.st-en_cours { background: var(--degrade-or); color: var(--bleu-fonce); }
.frise-bloc.st-en_retard { background: #fecaca; color: #7f1d1d; }
.frise-bloc.st-manquee { background: #e5e7eb; color: #6b7280; }
.frise-bloc.st-a_venir { background: var(--bleu-clair); color: var(--bleu); }
.frise-maintenant { position: absolute; top: 0; bottom: 0; width: 2px; background: #dc2626; z-index: 4; pointer-events: none; }
.frise-maintenant::before { content: "maintenant"; position: absolute; top: -2px; left: 4px; font-size: 10px; color: #dc2626; font-weight: 700; }
.tache-ligne { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid #f3ecdf; cursor: pointer; }
.tache-ligne:last-child { border-bottom: none; }
.tache-icone { width: 36px; height: 36px; border-radius: 10px; background: var(--or-pale); display: grid; place-items: center; font-size: 18px; flex-shrink: 0; }
.tache-infos { flex: 1; min-width: 0; }
.tache-titre { font-weight: 600; }
.tache-meta { font-size: 12px; color: #6b7385; }
.etapes-editeur .etape-ligne { display: flex; gap: 6px; margin-bottom: 6px; align-items: center; }
.etapes-editeur .etape-ligne input { flex: 1; padding: 8px 10px; border: 1px solid var(--gris-300); border-radius: 8px; }
.etape-num { width: 24px; height: 24px; border-radius: 50%; background: var(--bleu); color: #fff; font-size: 12px; display: grid; place-items: center; font-weight: 700; flex-shrink: 0; }
.icone-choix { display: flex; flex-wrap: wrap; gap: 4px; }
.icone-choix button { width: 36px; height: 36px; font-size: 18px; border: 1px solid var(--gris-300); background: #fff; border-radius: 8px; cursor: pointer; }
.icone-choix button.active { border-color: var(--or); background: var(--or-pale); box-shadow: 0 0 0 2px rgba(212,160,58,.35); }
.biblio-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.biblio-item { border: 1px solid #ece3d2; border-radius: 12px; padding: 12px; cursor: pointer; transition: all .15s; background: #fff; }
.biblio-item:hover { border-color: var(--or); transform: translateY(-2px); box-shadow: 0 8px 18px rgba(30,47,82,.1); }
.biblio-item.ajoute { opacity: .45; pointer-events: none; }
.biblio-item .t { font-weight: 700; margin: 4px 0 2px; }
.photo-preuve { max-width: 100%; border-radius: 10px; margin-top: 8px; border: 1px solid #ece3d2; }

/* Écran de connexion */
.login-screen { background: linear-gradient(135deg, rgba(20,31,56,.96), rgba(30,47,82,.9)), var(--zellige); }
.login-card { background: var(--creme); border-radius: 20px; border: 1px solid rgba(212,160,58,.4); box-shadow: 0 30px 60px rgba(0,0,0,.35); animation: pop .4s cubic-bezier(.2,.9,.3,1.2); }
.login-logo { width: 170px; height: 170px; margin: -10px auto 10px; display: block; animation: flotte 5s ease-in-out infinite; }
@keyframes flotte { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

/* Adresse mobile (page Employés) */
.adresse-mobile {
  display: flex; align-items: center; gap: 10px; margin-top: 10px; padding: 10px 14px;
  background: var(--or-pale); border: 1px solid rgba(212,160,58,.4); border-radius: 10px; flex-wrap: wrap;
}
.adresse-mobile code { font-family: var(--sans); font-weight: 700; font-size: 13.5px; color: var(--bleu-fonce); letter-spacing: .01em; }

/* Barre latérale : logo plus compact pour laisser de la place aux 22 liens,
   défilement interne visible et discret, et le lien actif reste toujours
   visible même quand la liste dépasse la hauteur de l'écran. */
.logo { padding: 14px 18px; }
.logo-medaillon { width: 72px; height: 72px; box-shadow: 0 0 0 2px rgba(212,160,58,.55), 0 6px 16px rgba(0,0,0,.3); }
.logo-medaillon img { width: 60px; height: 60px; }
.logo-sub { margin-top: 2px; }
.nav { padding: 6px 10px; }
.nav a { padding: 6.5px 12px; }
.nav-section { padding: 10px 12px 3px; }
.nav::-webkit-scrollbar { width: 6px; }
.nav::-webkit-scrollbar-track { background: transparent; }
.nav::-webkit-scrollbar-thumb { background: rgba(212,160,58,.35); border-radius: 3px; }
.nav::-webkit-scrollbar-thumb:hover { background: rgba(212,160,58,.6); }
.nav { scrollbar-width: thin; scrollbar-color: rgba(212,160,58,.45) transparent; }
.sidebar-footer { padding: 10px 18px; }

/* Les chiffres de Cormorant Garamond (police des titres) sont des chiffres
   « elzéviriens » dont le 0 se confond avec un o — illisible pour un compte
   (« 0 réservation(s) »). On force les figures « lining » là où c'est
   possible, et on repasse en police sans-serif dans les en-têtes de carte
   pour les compteurs dynamiques (toujours lisibles, quel que soit le chiffre). */
h1, h2, h3, .card-header, .detail-title, .modal-header h2 { font-variant-numeric: lining-nums tabular-nums; }
.card-header .muted, .card-header .sub { font-family: var(--sans); font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
