/* ==========================================================================
   Mon Dashboard — feuille de style
   Tokens de couleur (clair / sombre), puis composants.
   ========================================================================== */
:root {
  color-scheme: light;
  --bg: #f3f4f1;
  --bg-gradient: radial-gradient(1200px 600px at 10% -10%, rgba(42,120,214,.10), transparent 60%), radial-gradient(900px 500px at 100% 0%, rgba(27,175,122,.08), transparent 55%);
  --surface: #ffffff;
  --surface-2: #f4f4f1;
  --surface-3: #eaeae6;
  --border: #e4e4df;
  --border-strong: #d2d2cc;
  --text: #17171a;
  --text-2: #5a5a60;
  --text-3: #8f8f96;
  --accent: #2a78d6;
  --accent-hover: #2369c0;
  --accent-soft: #e6f0fc;
  --accent-ring: rgba(42,120,214,.28);
  --sidebar-bg: #15161a;
  --sidebar-bg-2: #1c1d23;
  --sidebar-text: #b8b9c2;
  --sidebar-active: #ffffff;
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --good: #0c8f0c;
  --warning: #e0a000;
  --critical: #d03b3b;
  --good-soft: #e4f6e4;
  --warning-soft: #fff4d6;
  --critical-soft: #fce6e6;
  --warning-text: #8a5f00;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(20,20,30,.04), 0 6px 20px rgba(20,20,30,.05);
  --shadow-hover: 0 2px 4px rgba(20,20,30,.06), 0 12px 30px rgba(20,20,30,.10);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #101013;
    --bg-gradient: radial-gradient(1200px 600px at 10% -10%, rgba(57,135,229,.12), transparent 60%), radial-gradient(900px 500px at 100% 0%, rgba(25,158,112,.08), transparent 55%);
    --surface: #18191d;
    --surface-2: #202127;
    --surface-3: #2a2b32;
    --border: #2a2b31;
    --border-strong: #3a3b43;
    --text: #f4f4f6;
    --text-2: #b5b6be;
    --text-3: #7f8089;
    --accent: #3987e5;
    --accent-hover: #4d96ee;
    --accent-soft: #1b2a40;
    --accent-ring: rgba(57,135,229,.35);
    --sidebar-bg: #0c0c0f;
    --sidebar-bg-2: #131418;
    --sidebar-text: #9d9ea8;
    --series-1: #3987e5;
    --series-2: #d95926;
    --series-3: #199e70;
    --good: #2fbf2f;
    --warning: #fab219;
    --critical: #e25555;
    --good-soft: #17301a;
    --warning-soft: #33290f;
    --critical-soft: #3a1c1c;
    --warning-text: #fab219;
    --shadow: 0 1px 2px rgba(0,0,0,.35), 0 6px 20px rgba(0,0,0,.25);
    --shadow-hover: 0 2px 4px rgba(0,0,0,.4), 0 12px 30px rgba(0,0,0,.4);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101013;
  --bg-gradient: radial-gradient(1200px 600px at 10% -10%, rgba(57,135,229,.12), transparent 60%), radial-gradient(900px 500px at 100% 0%, rgba(25,158,112,.08), transparent 55%);
  --surface: #18191d;
  --surface-2: #202127;
  --surface-3: #2a2b32;
  --border: #2a2b31;
  --border-strong: #3a3b43;
  --text: #f4f4f6;
  --text-2: #b5b6be;
  --text-3: #7f8089;
  --accent: #3987e5;
  --accent-hover: #4d96ee;
  --accent-soft: #1b2a40;
  --accent-ring: rgba(57,135,229,.35);
  --sidebar-bg: #0c0c0f;
  --sidebar-bg-2: #131418;
  --sidebar-text: #9d9ea8;
  --series-1: #3987e5;
  --series-2: #d95926;
  --series-3: #199e70;
  --good: #2fbf2f;
  --warning: #fab219;
  --critical: #e25555;
  --good-soft: #17301a;
  --warning-soft: #33290f;
  --critical-soft: #3a1c1c;
  --warning-text: #fab219;
  --shadow: 0 1px 2px rgba(0,0,0,.35), 0 6px 20px rgba(0,0,0,.25);
  --shadow-hover: 0 2px 4px rgba(0,0,0,.4), 0 12px 30px rgba(0,0,0,.4);
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  background-image: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--accent-soft); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ---------- Layout ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px; flex-shrink: 0;
  background: linear-gradient(180deg, var(--sidebar-bg-2), var(--sidebar-bg));
  color: var(--sidebar-text);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  border-right: 1px solid rgba(255,255,255,.04);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 24px 22px 18px; font-weight: 700; font-size: 16.5px; color: #fff; letter-spacing: -.01em; }
.brand-dot { width: 12px; height: 12px; border-radius: 50%; background: linear-gradient(135deg, var(--series-1), var(--series-3)); box-shadow: 0 0 0 4px rgba(42,120,214,.22); flex-shrink: 0; }
.nav { display: flex; flex-direction: column; padding: 4px 12px; gap: 2px; }
.nav a { color: var(--sidebar-text); text-decoration: none; padding: 10px 12px; border-radius: 10px; display: flex; align-items: center; gap: 12px; font-size: 14px; font-weight: 500; transition: background .15s, color .15s; position: relative; }
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.nav a.active { background: rgba(255,255,255,.10); color: var(--sidebar-active); }
.nav a.active::before { content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 3px; background: var(--accent); }
.nav .ico { width: 30px; height: 30px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; background: rgba(255,255,255,.05); flex-shrink: 0; }
.nav a.active .ico { background: var(--accent); color: #fff; }
.nav .ico svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.sidebar-footer { margin-top: auto; padding: 14px 16px 18px; border-top: 1px solid rgba(255,255,255,.06); }
.sidebar-footer .btn { color: var(--sidebar-text); }
.sidebar-footer .btn:hover { background: rgba(255,255,255,.08); color: #fff; }
.sync-status { font-size: 12px; color: var(--sidebar-text); opacity: .85; padding: 2px 10px 8px; }
.sync-status.error { color: #ff8a8a; opacity: 1; }
.sync-status.offline, .sync-status.saving { color: var(--warning); opacity: 1; }
.sync-status:empty { display: none; }

.main { flex: 1; padding: 30px 40px 70px; max-width: 1320px; min-width: 0; animation: fadeIn .25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------- Typo ---------- */
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-header h1 { margin: 0; font-size: 27px; font-weight: 700; letter-spacing: -.02em; }
.page-header .sub { color: var(--text-2); margin-top: 3px; font-size: 14px; }
h2 { font-size: 16px; font-weight: 650; margin: 0 0 12px; letter-spacing: -.01em; }
h3 { font-size: 14.5px; font-weight: 650; margin: 0 0 8px; }
h4 { font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); margin: 0 0 6px; }
.muted { color: var(--text-2); }
.small { font-size: 13px; }
.tiny { font-size: 12px; color: var(--text-3); }

/* ---------- Onglets ---------- */
.tabs { display: inline-flex; gap: 2px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 4px; margin-bottom: 22px; flex-wrap: wrap; }
.tabs button { background: none; border: none; padding: 7px 14px; cursor: pointer; color: var(--text-2); border-radius: 9px; font-weight: 500; font-size: 13.5px; transition: all .15s; }
.tabs button:hover { color: var(--text); }
.tabs button.active { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.08); }

/* ---------- Cartes & grilles ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.spacer { flex: 1; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.stat::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: linear-gradient(90deg, var(--series-1), transparent); opacity: .7; }
.stat .label { color: var(--text-2); font-size: 12.5px; font-weight: 500; }
.stat .value { font-size: 24px; font-weight: 700; margin-top: 6px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat .hint { color: var(--text-3); font-size: 12px; margin-top: 4px; }
.stat.neg .value { color: var(--critical); }
.stat.neg::after { background: linear-gradient(90deg, var(--critical), transparent); }
.stat.warn::after { background: linear-gradient(90deg, var(--warning), transparent); }

/* ---------- Boutons ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface); cursor: pointer; font-weight: 500; font-size: 13.5px; white-space: nowrap; transition: all .15s; line-height: 1.3; }
.btn:hover { background: var(--surface-2); border-color: var(--text-3); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: default; }
.btn[hidden], [hidden] { display: none !important; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 1px 2px rgba(42,120,214,.3); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-danger { color: var(--critical); }
.btn-danger:hover { background: var(--critical-soft); border-color: var(--critical); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-2); border-color: transparent; }
.btn-sm { padding: 5px 11px; font-size: 12.5px; border-radius: 8px; }
.btn-icon { padding: 4px 8px; font-size: 13px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--text-3); cursor: pointer; line-height: 1.2; transition: all .15s; }
.btn-icon:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }

/* ---------- Tableaux ---------- */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 10px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { color: var(--text-3); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: var(--surface-2); }
tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.actions { text-align: right; white-space: nowrap; }
td.actions .btn-icon { opacity: .5; }
tr:hover td.actions .btn-icon { opacity: 1; }
.table-wrap { overflow-x: auto; margin: 0 -6px; }

.amount { font-variant-numeric: tabular-nums; font-weight: 600; }
.amount.pos { color: var(--good); }
.amount.neg { color: var(--critical); }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--surface-3); color: var(--text-2); white-space: nowrap; line-height: 1.6; }
.badge.good { background: var(--good-soft); color: var(--good); }
.badge.warn { background: var(--warning-soft); color: var(--warning-text); }
.badge.crit { background: var(--critical-soft); color: var(--critical); }
.badge.accent { background: var(--accent-soft); color: var(--accent); }

/* ---------- Lignes à cocher ---------- */
.check-row { display: flex; align-items: center; gap: 12px; padding: 9px 8px; border-radius: 9px; transition: background .12s; }
.check-row + .check-row { border-top: 1px solid var(--border); border-radius: 0; }
.check-row:hover { background: var(--surface-2); }
.check-row input[type=checkbox] { width: 19px; height: 19px; accent-color: var(--accent); cursor: pointer; flex-shrink: 0; margin: 0; }
.check-row .titre { font-weight: 500; }
.check-row.checked .titre { color: var(--text-3); text-decoration: line-through; }
.check-row.inactive { opacity: .55; }
.check-row .meta { color: var(--text-3); font-size: 12.5px; }
.check-row .amt { margin-left: auto; white-space: nowrap; }
.check-row .main-txt { display: flex; flex-direction: column; min-width: 0; }
.check-row .btn-icon { opacity: .45; }
.check-row:hover .btn-icon { opacity: 1; }
.prio { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 6px; white-space: nowrap; }
.prio-haute { color: var(--critical); background: var(--critical-soft); }
.prio-moyenne { color: var(--warning-text); background: var(--warning-soft); }
.prio-basse { color: var(--text-3); background: var(--surface-3); }

.empty { color: var(--text-3); padding: 18px 6px; text-align: center; font-size: 13.5px; }
.empty-state { text-align: center; padding: 40px 24px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty-state .empty-icon { font-size: 40px; line-height: 1; margin-bottom: 4px; }
.empty-state p { max-width: 460px; margin: 0 0 8px; }

/* ---------- Filtres & formulaires inline ---------- */
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filters select, .filters input { padding: 7px 11px; border-radius: 9px; border: 1px solid var(--border-strong); background: var(--surface); font-size: 13.5px; }
.filters input[type=search] { min-width: 240px; }
.filters select:focus, .filters input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); outline: none; }

.month-nav { display: inline-flex; align-items: center; gap: 4px; }
.month-nav .label { min-width: 140px; text-align: center; font-weight: 600; text-transform: capitalize; font-size: 13.5px; }

.progress { height: 7px; background: var(--surface-3); border-radius: 4px; overflow: hidden; }
.progress > div { height: 100%; background: linear-gradient(90deg, var(--series-3), #3fd39a); border-radius: 4px; transition: width .3s; }

/* ---------- Kanban (contenu) ---------- */
.kanban { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.kanban-col { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; min-height: 220px; }
.kanban-col h3 { display: flex; justify-content: space-between; align-items: center; padding: 2px 4px 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-2); }
.kanban-col:nth-child(1) h3::before, .kanban-col:nth-child(2) h3::before, .kanban-col:nth-child(3) h3::before { content: ""; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; }
.kanban-col:nth-child(1) h3::before { background: var(--text-3); }
.kanban-col:nth-child(2) h3::before { background: var(--series-1); }
.kanban-col:nth-child(3) h3::before { background: var(--series-3); }
.kanban-col h3 .badge { margin-left: auto; }
.kcard { background: var(--surface); border: 1px solid var(--border); border-radius: 11px; padding: 11px 13px; margin-bottom: 10px; box-shadow: var(--shadow); transition: box-shadow .15s, transform .15s; }
.kcard:hover { box-shadow: var(--shadow-hover); transform: translateY(-1px); }
.kcard .titre { font-weight: 600; margin-bottom: 6px; }
.kcard .notes { color: var(--text-2); font-size: 13px; white-space: pre-wrap; margin-top: 6px; }
.kcard .foot { display: flex; align-items: center; gap: 6px; margin-top: 10px; flex-wrap: wrap; }

/* ---------- Rando ---------- */
.rando-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 6px; transition: box-shadow .15s, transform .15s; }
.rando-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-1px); }
.rando-card .titre { font-weight: 700; font-size: 16px; letter-spacing: -.01em; }
.rando-card .specs { display: flex; gap: 12px; flex-wrap: wrap; color: var(--text-2); font-size: 13px; }
.rando-card .notes { color: var(--text-2); font-size: 13.5px; white-space: pre-wrap; }
.rando-card .foot { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }

/* ---------- Clients & projets ---------- */
.client-card { padding: 0; overflow: hidden; transition: box-shadow .15s; }
.client-card.open { box-shadow: var(--shadow-hover); }
.client-head { display: flex; align-items: center; gap: 14px; padding: 14px 18px; cursor: pointer; user-select: none; transition: background .12s; }
.client-head:hover { background: var(--surface-2); }
.avatar { width: 42px; height: 42px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; color: #fff; flex-shrink: 0; background: linear-gradient(135deg, var(--series-1), #6aa6f0); letter-spacing: .02em; }
.avatar.statut-prospect { background: linear-gradient(135deg, var(--series-2), #f39a72); }
.avatar.statut-termine { background: linear-gradient(135deg, #7d7e86, #a9aab2); }
.client-titre { min-width: 0; flex: 1; }
.client-titre .nom { font-weight: 700; font-size: 15.5px; letter-spacing: -.01em; }
.client-titre .ent { color: var(--text-2); }
.client-meta { color: var(--text-3); font-size: 12.5px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.client-badges { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.chevron { font-size: 20px; transition: transform .2s; padding: 0 6px; color: var(--text-3); }
.chevron.open { transform: rotate(90deg); }
.client-body { padding: 4px 18px 18px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 16px; animation: fadeIn .2s ease; }
.client-body > .row { padding-top: 14px; }
.contact-row { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; }
.notes-box { margin-top: 8px; padding: 10px 12px; background: var(--surface-2); border-radius: 9px; font-size: 13px; color: var(--text-2); white-space: pre-wrap; max-width: 640px; }
.sub-section { display: flex; flex-direction: column; gap: 4px; }
.sub-section h4 { margin: 0 0 4px; }

.projet { border: 1px solid var(--border); border-left: 3px solid var(--series-1); border-radius: 11px; padding: 12px 14px; background: var(--surface); margin-bottom: 10px; }
.projet.termine { border-left-color: var(--series-3); opacity: .8; }
.projet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.projet-titre { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.projet-titre .nom { font-weight: 650; font-size: 14.5px; }
.projet-desc { color: var(--text-2); font-size: 13px; margin-top: 6px; white-space: pre-wrap; }
.projet-budget { margin-top: 10px; display: flex; flex-direction: column; gap: 5px; }
.projet-list { margin-top: 8px; border-top: 1px dashed var(--border); padding-top: 4px; }
.projet-list .check-row { padding: 7px 6px; }

/* ---------- Graphiques ---------- */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .grid-line { stroke: var(--border); stroke-width: 1; }
.chart .axis-text { fill: var(--text-3); font-size: 11px; font-family: var(--font); }
.chart .zero-line { stroke: var(--text-3); stroke-dasharray: 3 3; stroke-width: 1; }
.chart .crosshair { stroke: var(--text-3); stroke-width: 1; stroke-dasharray: 2 3; }
.chart-tooltip { position: absolute; pointer-events: none; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 9px; padding: 6px 10px; font-size: 12.5px; box-shadow: var(--shadow-hover); white-space: nowrap; z-index: 5; }
.chart-tooltip b { font-variant-numeric: tabular-nums; }
.legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--text-2); margin-bottom: 8px; }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; background: var(--c); vertical-align: -1px; }

/* ---------- Modale & formulaires ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(10,10,14,.5); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 20px; }
.modal-backdrop[hidden] { display: none; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 24px 26px; width: 100%; max-width: 580px; max-height: 90vh; overflow-y: auto; box-shadow: 0 30px 70px rgba(0,0,0,.35); animation: slideUp .2s ease; }
@keyframes slideUp { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
.modal h2 { margin-bottom: 18px; font-size: 18px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 12.5px; color: var(--text-2); font-weight: 600; }
.field input, .field select, .field textarea { padding: 9px 11px; border-radius: 9px; border: 1px solid var(--border-strong); background: var(--surface); width: 100%; transition: border-color .15s, box-shadow .15s; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); outline: none; }
.field textarea { min-height: 84px; resize: vertical; }
.field.checkbox { flex-direction: row; align-items: center; gap: 8px; padding-top: 6px; }
.field.checkbox input { width: 18px; height: 18px; accent-color: var(--accent); }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }
.modal-actions .left { margin-right: auto; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-size: 13.5px; font-weight: 500; z-index: 60; box-shadow: var(--shadow-hover); animation: slideUp .2s ease; }
.toast[hidden] { display: none; }

.alert { padding: 11px 14px; border-radius: 11px; border: 1px solid var(--border); background: var(--surface-2); font-size: 13.5px; }
.alert.warn { background: var(--warning-soft); border-color: rgba(224,160,0,.4); }
.alert.crit { background: var(--critical-soft); border-color: rgba(208,59,59,.4); }

.detail-list { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; font-size: 14px; }
.detail-list dt { color: var(--text-2); }
.detail-list dd { margin: 0; white-space: pre-wrap; }

.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain li { padding: 9px 0; border-bottom: 1px solid var(--border); display: flex; gap: 10px; align-items: center; }
.list-plain li:last-child { border-bottom: none; }

/* ---------- Connexion ---------- */
.auth-screen { position: fixed; inset: 0; background: var(--bg); background-image: var(--bg-gradient); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.auth-card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 30px; width: 100%; max-width: 390px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow-hover); animation: slideUp .25s ease; }
.auth-card .btn { width: 100%; }
.auth-msg { font-size: 13px; color: var(--critical); min-height: 1em; }
.auth-msg:empty { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kanban { grid-template-columns: 1fr; }
  .main { padding: 24px 24px 60px; }
}
@media (max-width: 720px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: sticky; top: 0; z-index: 20; flex-direction: row; align-items: center; padding-right: 8px; }
  .brand { padding: 12px 14px; font-size: 15px; }
  .nav { flex-direction: row; overflow-x: auto; padding: 6px 4px; flex: 1; }
  .nav a { white-space: nowrap; padding: 6px 8px; font-size: 13px; }
  .nav a span:not(.ico) { display: none; }
  .nav a.active::before { display: none; }
  .sidebar-footer { display: none; }
  .main { padding: 18px 16px 50px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .detail-list { grid-template-columns: 1fr; }
  .page-header h1 { font-size: 22px; }
  .client-badges { display: none; }
  .filters input[type=search] { min-width: 0; flex: 1; }
}
