/* Toctoc — app admin. Design tokens : toctoc_specs_00_architecture.md §4,
   adaptés à un usage desktop (tableaux, barre latérale). */

:root {
  --teal-950: #0D2E26;
  --teal-800: #16463A;
  --teal-700: #1E5947;
  --sage-100: #D9E9E1;
  --sage-200: #C3DDD1;
  --amber-500: #E2793D;
  --red-500: #B84A3E;
  --cream-50: #FAFBFA;
  --ink-900: #1A1A18;
  --ink-500: #6B6B65;
  --ink-300: #A6A69F;
  --line: #E4E4DE;
  --font-heading: Georgia, 'Iowan Old Style', 'Palatino Linotype', serif;
  --font-body: -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  background: var(--cream-50);
  color: var(--ink-900);
  font-family: var(--font-body);
}

h1 { font-family: var(--font-heading); font-size: 1.5rem; margin: 0 0 20px; }
h2 { font-family: var(--font-heading); font-size: 1.2rem; margin: 0 0 16px; }
.muted { color: var(--ink-500); }
code { background: var(--sage-100); padding: 1px 6px; border-radius: 4px; }

/* --- Auth screens --- */
.auth-screen {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.auth-card {
  width: 100%;
  max-width: 380px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 32px;
  text-align: center;
}
.auth-card input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
  margin: 16px 0;
}
.spinner {
  width: 32px; height: 32px;
  border-radius: 999px;
  border: 3px solid var(--sage-100);
  border-top-color: var(--teal-800);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Buttons --- */
.btn {
  font: inherit; font-weight: 600; font-size: 0.9rem;
  border-radius: 10px; padding: 10px 18px; border: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn-primary { background: var(--teal-800); color: white; width: 100%; }
.btn-primary:disabled { background: var(--sage-100); color: var(--ink-300); cursor: not-allowed; }
.btn-outline { background: white; border: 1px solid var(--line); color: var(--teal-800); }
.btn-ghost { background: transparent; color: var(--teal-800); }
.btn-danger { background: var(--red-500); color: white; }
.btn-inline { width: auto; margin-bottom: 16px; }

/* --- Shell --- */
.shell { display: flex; min-height: 100dvh; }
.sidebar {
  width: 220px; flex-shrink: 0;
  background: var(--teal-950); color: white;
  display: flex; flex-direction: column; padding: 20px 0;
}
.sidebar-brand {
  font-family: var(--font-heading); font-size: 1.2rem;
  padding: 0 20px 20px; display: flex; align-items: center; gap: 8px;
}
.badge-role {
  font-family: var(--font-body); font-size: 0.65rem; font-weight: 600;
  background: var(--amber-500); color: white; padding: 2px 8px; border-radius: 999px;
}
.nav-item {
  display: block; width: 100%; text-align: left;
  background: none; border: none; color: rgba(255,255,255,0.75);
  font: inherit; font-size: 0.9rem; padding: 12px 20px; cursor: pointer;
}
.nav-item:hover { background: rgba(255,255,255,0.06); color: white; }
.nav-item.is-active { background: rgba(255,255,255,0.1); color: white; font-weight: 600; }
.nav-item--ghost { margin-top: auto; color: rgba(255,255,255,0.5); }

.content { flex: 1; padding: 32px 40px; overflow-x: auto; }
.view { max-width: 1100px; }

/* --- Stats --- */
.stats-row { display: flex; gap: 16px; flex-wrap: wrap; }
.stat-card {
  background: white; border: 1px solid var(--line); border-radius: 12px;
  padding: 20px 24px; min-width: 160px;
}
.stat-card .value { font-family: var(--font-heading); font-size: 2rem; }
.stat-card .label { color: var(--ink-500); font-size: 0.85rem; }

/* --- Tables --- */
.data-table { width: 100%; border-collapse: collapse; background: white; border-radius: 12px; overflow: hidden; }
.data-table th, .data-table td {
  text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 0.9rem;
}
.data-table th { color: var(--ink-500); font-weight: 600; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.03em; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--cream-50); }

.status-pill {
  display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 600;
}
.status-pill--active, .status-pill--new { background: var(--sage-100); color: var(--teal-800); }
.status-pill--inactive, .status-pill--reported { background: #FBEFEC; color: var(--red-500); }
.status-pill--read, .status-pill--replied { background: #EEF1F0; color: var(--ink-500); }

.filter-toggle { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; font-size: 0.9rem; cursor: pointer; }

/* --- Fleet cards (gestionnaire) --- */
.fleet-card {
  background: white; border: 1px solid var(--line); border-radius: 12px;
  padding: 20px; margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center;
  cursor: pointer;
}
.fleet-card:hover { border-color: var(--teal-800); }
.fleet-actions { display: flex; gap: 12px; margin-bottom: 20px; }

/* --- Modal --- */
.modal {
  position: fixed; inset: 0; background: rgba(13,46,38,0.4);
  display: flex; align-items: center; justify-content: center; z-index: 10;
}
.modal-card {
  background: white; border-radius: 14px; padding: 28px; width: 100%; max-width: 420px;
}
.modal-card input, .modal-card textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
  font: inherit; margin: 6px 0 16px; resize: vertical;
}
.modal-card label { font-size: 0.85rem; color: var(--ink-500); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }
.inline-error { background: #FBEFEC; color: var(--red-500); border-radius: 8px; padding: 10px 12px; font-size: 0.85rem; }

/* --- Print sheet --- */
.print-sheet { display: none; }
@media print {
  body > *:not(.print-sheet) { display: none !important; }
  .print-sheet {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  .print-sticker {
    border: 1px dashed var(--line);
    padding: 16px; text-align: center; break-inside: avoid;
  }
  .print-sticker .label { font-weight: 700; margin-top: 8px; }
}
