@font-face { font-family: 'Inter'; src: url('../fonts/inter-latin.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }

:root {
  --night: #0B1437; --night-2: #121D47; --night-3: #1B2858; --night-line: rgba(255,255,255,.08); --night-text: #C6CDE3; --night-muted: #8089A8;
  --accent: #5B50E8; --accent-hover: #4A40D4; --accent-soft: #EEEDFD; --accent-text: #4338CA;
  --bg: #F5F6FA; --surface: #FFFFFF; --surface-2: #F8F9FC; --line: #E5E8F0; --line-strong: #D3D8E4;
  --text: #111936; --text-2: #4A5470; --text-3: #6D7690;
  --good: #15803D; --good-soft: #E7F6EC; --warning: #C2610C; --warning-soft: #FDF0E3; --critical: #C8281F; --critical-soft: #FCEBEA; --info: #0369A1; --info-soft: #E5F2FA;
  --chart-1: #5B50E8; --chart-2: #0E97B8; --chart-neutral: #A9B4C8; --grid: #E8EBF2;
  --logo-bg: #0B1437; --shadow: 0 1px 2px rgba(11,20,55,.05), 0 1px 3px rgba(11,20,55,.04); --shadow-lg: 0 16px 48px rgba(11,20,55,.18);
  --radius: 12px; --radius-sm: 8px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0A1024; --surface: #141B33; --surface-2: #1A2240; --line: #262F50; --line-strong: #364069;
  --text: #EDF0F9; --text-2: #B3BBD3; --text-3: #8A93AF;
  --accent: #7C74F0; --accent-hover: #8F88F5; --accent-soft: #24264F; --accent-text: #B4AFFA;
  --good: #4ADE80; --good-soft: #12301F; --warning: #FB923C; --warning-soft: #35210F; --critical: #F87171; --critical-soft: #3A1717; --info: #5CBDEB; --info-soft: #102C3D;
  --chart-1: #7C74F0; --chart-2: #1A94B5; --chart-neutral: #5C6789; --grid: #262F50;
  --night: #080E22; --night-2: #101831; --night-3: #1A2445; --logo-bg: #1B2858;
  --shadow: 0 1px 2px rgba(0,0,0,.3); --shadow-lg: 0 16px 48px rgba(0,0,0,.5);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 14px/1.5 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif; -webkit-font-smoothing: antialiased; font-feature-settings: 'cv11', 'tnum' 0; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.01em; line-height: 1.25; }
h1 { font-size: 22px; } h2 { font-size: 15px; } h3 { font-size: 14px; }
p { margin: 0; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.icon { flex: none; }

/* Coquille */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--night); color: var(--night-text); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 16px 12px; gap: 4px; z-index: 30; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; color: #fff; font-weight: 700; letter-spacing: .06em; font-size: 14px; }
.org-switch { margin: 0 4px 12px; }
.org-switch select { width: 100%; background: var(--night-2); color: #fff; border: 1px solid var(--night-line); padding: 8px 10px; border-radius: var(--radius-sm); font: inherit; font-size: 13px; }
.org-switch select option { color: #111; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--night-text); font-size: 13.5px; font-weight: 500; transition: background .12s, color .12s; }
.nav a:hover { background: var(--night-2); color: #fff; text-decoration: none; }
.nav a.active { background: var(--night-3); color: #fff; box-shadow: inset 2px 0 0 #8F88F5; }
.nav-count { margin-left: auto; background: #5B50E8; color: #fff; font-size: 11px; font-weight: 600; border-radius: 10px; padding: 0 6px; min-width: 18px; text-align: center; }
.nav-section { margin: 14px 10px 4px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--night-muted); }
.sidebar-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--night-line); display: flex; flex-direction: column; gap: 6px; }
.user-chip { display: flex; align-items: center; gap: 9px; padding: 6px 8px; font-size: 13px; color: #fff; min-width: 0; }
.user-chip span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.foot-actions { display: flex; gap: 2px; padding: 0 4px; }
.foot-actions .icon-btn { color: var(--night-text); }
.foot-actions .icon-btn:hover { background: var(--night-2); color: #fff; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: none; align-items: center; gap: 10px; padding: 10px 16px; background: var(--night); color: #fff; position: sticky; top: 0; z-index: 25; }
.topbar .icon-btn { color: #fff; }
.topbar .icon-btn:hover { background: var(--night-2); }
.topbar .brand { padding: 0; }
.status-strip { display: flex; align-items: center; gap: 8px; padding: 7px 28px; font-size: 12.5px; background: var(--warning-soft); color: var(--warning); border-bottom: 1px solid var(--line); }
.status-strip.error { background: var(--critical-soft); color: var(--critical); }
.status-strip a, .status-strip button { color: inherit; font-weight: 600; text-decoration: underline; background: none; border: 0; cursor: pointer; font: inherit; padding: 0; }
.content { padding: 24px 28px 48px; max-width: 1360px; width: 100%; margin: 0 auto; animation: rise .16s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-sub { color: var(--text-3); margin-top: 3px; font-size: 13.5px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.crumbs { display: flex; align-items: center; gap: 4px; color: var(--text-3); font-size: 13px; margin-bottom: 6px; }

/* Boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 14px; border-radius: var(--radius-sm); border: 1px solid transparent; font: 500 13.5px/1.3 inherit; font-family: inherit; cursor: pointer; transition: background .12s, border-color .12s, opacity .12s; white-space: nowrap; }
.btn:disabled { opacity: .55; cursor: default; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
:root[data-theme="dark"] .btn-primary { color: #0A1024; }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--line-strong); }
.btn-secondary:hover:not(:disabled) { background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.btn-danger { background: var(--critical); color: #fff; }
:root[data-theme="dark"] .btn-danger { color: #2A0B0B; }
.btn-sm { padding: 5px 10px; font-size: 12.5px; }
.btn-block { width: 100%; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: 0; background: transparent; color: var(--text-3); border-radius: var(--radius-sm); cursor: pointer; flex: none; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

/* Cartes */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 18px 0; flex-wrap: wrap; }
.card-body { padding: 14px 18px 18px; }
.card-actions { display: flex; gap: 6px; align-items: center; }
.grid { display: grid; gap: 16px; }
.grid-kpi { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.muted { color: var(--text-3); }
.small { font-size: 12.5px; }
.strong { font-weight: 600; }
.right { text-align: right; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi { padding: 15px 18px; }
.kpi-top { display: flex; justify-content: space-between; align-items: center; color: var(--text-3); }
.kpi-label { font-size: 12.5px; font-weight: 500; }
.kpi-icon { color: var(--text-3); }
.kpi-value { font-size: 24px; font-weight: 600; letter-spacing: -.02em; margin-top: 6px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; line-height: 1.2; }
.kpi-sub { font-size: 12.5px; color: var(--text-3); margin-top: 4px; }
.kpi-critical .kpi-value { color: var(--critical); } .kpi-warning .kpi-value { color: var(--warning); } .kpi-good .kpi-value { color: var(--good); }

/* Pastilles */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 20px; font-size: 12px; font-weight: 500; white-space: nowrap; background: var(--surface-2); color: var(--text-2); }
.badge-good { background: var(--good-soft); color: var(--good); } .badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-critical { background: var(--critical-soft); color: var(--critical); } .badge-info { background: var(--info-soft); color: var(--info); }
.badge-accent { background: var(--accent-soft); color: var(--accent-text); }
.progress { height: 6px; background: var(--line); border-radius: 4px; overflow: hidden; min-width: 60px; }
.progress > div { height: 100%; background: var(--accent); border-radius: 4px; transition: width .25s; }
.progress-good > div { background: var(--good); } .progress-warning > div { background: var(--warning); } .progress-critical > div { background: var(--critical); }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); font-size: 11px; font-weight: 600; flex: none; }
.sidebar .avatar { background: var(--night-3); color: #fff; }
.sync-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; }
.sync-synced { background: var(--good); } .sync-pending { background: var(--warning); } .sync-error { background: var(--critical); }

/* Tableaux */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-size: 12px; font-weight: 500; color: var(--text-3); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table th.right, .table td.right { text-align: right; font-variant-numeric: tabular-nums; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td { background: var(--surface-2); }
.cell-title { font-weight: 500; }
.cell-sub { font-size: 12px; color: var(--text-3); }

/* Onglets et filtres */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tab { display: inline-flex; align-items: center; gap: 6px; padding: 9px 12px; background: none; border: 0; border-bottom: 2px solid transparent; color: var(--text-3); font: 500 13.5px inherit; font-family: inherit; cursor: pointer; white-space: nowrap; margin-bottom: -1px; }
.tab:hover { color: var(--text); text-decoration: none; }
.tab.active { color: var(--accent-text); border-bottom-color: var(--accent); }
.tab-count { background: var(--surface-2); color: var(--text-3); border-radius: 10px; padding: 0 6px; font-size: 11px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 16px; }
.filter { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--text-3); }
.filter select, .filter input { min-width: 130px; }
.search { position: relative; flex: 1 1 200px; max-width: 320px; }
.search input { width: 100%; padding-left: 32px; }
.search .icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-3); }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 2px; }
.seg button { display: inline-flex; gap: 5px; align-items: center; border: 0; background: none; padding: 5px 10px; border-radius: 6px; font: 500 12.5px inherit; font-family: inherit; color: var(--text-3); cursor: pointer; }
.seg button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* Formulaires */
input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 8px 10px; width: auto; max-width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
input[type=checkbox] { width: 16px; height: 16px; padding: 0; accent-color: var(--accent); flex: none; margin: 0; }
textarea { resize: vertical; width: 100%; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field { grid-column: span 2; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field-half { grid-column: span 1; }
.field label { font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.field input:not([type=checkbox]), .field select, .field textarea { width: 100%; }
.req { color: var(--critical); }
.help { font-size: 12px; color: var(--text-3); }
.check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text); cursor: pointer; }
.multi { display: flex; flex-direction: column; gap: 6px; max-height: 180px; overflow-y: auto; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.form-heading { grid-column: span 2; font-size: 13px; color: var(--text-2); padding-top: 4px; border-top: 1px solid var(--line); margin-top: 2px; padding-top: 12px; }
.form-error { background: var(--critical-soft); color: var(--critical); padding: 9px 12px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 14px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

/* Dialogues */
.overlay { position: fixed; inset: 0; background: rgba(8,14,34,.5); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 16px; z-index: 100; overflow-y: auto; animation: fade .12s; }
@keyframes fade { from { opacity: 0; } }
.dialog { background: var(--surface); border-radius: 14px; width: 100%; max-width: 520px; box-shadow: var(--shadow-lg); border: 1px solid var(--line); }
.dialog-wide { max-width: 780px; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px 12px 20px; border-bottom: 1px solid var(--line); gap: 12px; }
.dialog-head h2 { font-size: 16px; }
.dialog-body { padding: 18px 20px; }
.dialog-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 0 20px 18px; }
.dialog-text { color: var(--text-2); margin-bottom: 12px; }
.dialog-body > .dialog-text:last-child { margin-bottom: 0; }
#toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 200; max-width: min(420px, calc(100vw - 32px)); }
.toast { display: flex; gap: 8px; align-items: flex-start; background: var(--night); color: #fff; padding: 10px 14px; border-radius: 10px; box-shadow: var(--shadow-lg); font-size: 13.5px; animation: rise .15s; }
.toast-error { background: #8E1B15; } .toast-success { background: #14532D; }
.empty { text-align: center; padding: 40px 16px; display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--text-3); }
.empty-icon { width: 52px; height: 52px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; color: var(--text-3); margin-bottom: 4px; }
.empty h3 { color: var(--text); }
.empty p { max-width: 400px; font-size: 13.5px; }
.empty .btn { margin-top: 8px; }

/* Graphiques */
.chart { margin: 0; }
.chart-svg { width: 100%; height: auto; display: block; }
.chart-svg .grid { stroke: var(--grid); stroke-width: 1; }
.chart-svg .axis, .donut-svg .axis { fill: var(--text-3); font-size: 10.5px; }
.chart-svg .label { fill: var(--text-2); font-size: 11.5px; }
.chart-svg .crosshair { stroke: var(--line-strong); stroke-width: 1; }
.mark { transition: opacity .1s; cursor: default; }
.mark:hover { opacity: .8; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12.5px; color: var(--text-2); margin-bottom: 10px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i, .chart-tip i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: none; }
.chart-legend-col { flex-direction: column; gap: 7px; margin: 0; flex: 1; min-width: 120px; }
.chart-legend-col b { margin-left: auto; font-weight: 600; color: var(--text); padding-left: 12px; }
.chart-donut { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.donut-svg { width: 140px; height: 140px; flex: none; }
.donut-track { stroke: var(--line); }
.donut-value { fill: var(--text); font-size: 24px; font-weight: 600; }
.chart-tip { position: fixed; background: var(--night); color: #fff; padding: 8px 10px; border-radius: 8px; font-size: 12px; z-index: 150; pointer-events: none; box-shadow: var(--shadow-lg); max-width: 280px; }
.tip-strong { font-weight: 600; margin-bottom: 3px; }
.tip-row { display: flex; align-items: center; gap: 6px; }
.risk-matrix { display: grid; grid-template-columns: 22px 1fr; grid-template-rows: 1fr auto; gap: 6px; max-width: 360px; }
.risk-y { writing-mode: vertical-rl; transform: rotate(180deg); text-align: center; font-size: 11.5px; color: var(--text-3); }
.risk-x { grid-column: 2; text-align: center; font-size: 11.5px; color: var(--text-3); }
.risk-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; }
.risk-cell { aspect-ratio: 1; border: 0; border-radius: 5px; font-weight: 600; font-size: 13px; font-family: inherit; color: var(--text); }
.risk-cell:not(:disabled) { cursor: pointer; }
.risk-low { background: var(--good-soft); } .risk-med { background: var(--info-soft); } .risk-high { background: var(--warning-soft); } .risk-crit { background: var(--critical-soft); }

/* Tâches : tableau Kanban */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.kanban-col { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; min-height: 180px; display: flex; flex-direction: column; gap: 8px; }
.kanban-col.drop { border-color: var(--accent); background: var(--accent-soft); }
.kanban-head { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; font-weight: 600; color: var(--text-2); padding: 2px 4px; }
.task-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 11px; cursor: pointer; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 7px; }
.task-card:hover { border-color: var(--line-strong); }
.task-card.dragging { opacity: .5; }
.task-card .title { font-weight: 500; font-size: 13.5px; overflow-wrap: anywhere; }
.task-meta { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 12px; color: var(--text-3); flex-wrap: wrap; }
.late { color: var(--critical); font-weight: 500; }

/* Planning (Gantt) */
.gantt { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.gantt-inner { min-width: 760px; }
.gantt-row { display: grid; grid-template-columns: 220px 1fr; border-bottom: 1px solid var(--line); min-height: 34px; align-items: center; }
.gantt-row:last-child { border-bottom: 0; }
.gantt-name { padding: 6px 12px; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-right: 1px solid var(--line); position: sticky; left: 0; background: var(--surface); z-index: 1; }
.gantt-phase .gantt-name { font-weight: 600; background: var(--surface-2); }
.gantt-phase { background: var(--surface-2); }
.gantt-track { position: relative; height: 100%; min-height: 34px; }
.gantt-bar { position: absolute; top: 9px; height: 16px; border-radius: 4px; background: var(--chart-neutral); overflow: hidden; cursor: pointer; }
.gantt-bar > i { display: block; height: 100%; background: var(--chart-1); }
.gantt-bar.overdue { box-shadow: 0 0 0 1.5px var(--critical); }
.gantt-ms { position: absolute; top: 11px; width: 12px; height: 12px; transform: rotate(45deg); background: var(--accent); border-radius: 2px; margin-left: -6px; }
.gantt-today { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--critical); opacity: .6; }
.gantt-head { font-size: 11px; color: var(--text-3); }
.gantt-tick { position: absolute; top: 9px; transform: translateX(-1px); white-space: nowrap; border-left: 1px solid var(--line-strong); padding-left: 4px; }

/* Calendrier */
.cal-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.cal-title { font-size: 16px; font-weight: 600; text-transform: capitalize; min-width: 170px; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--line); gap: 1px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.cal-dow { background: var(--surface-2); padding: 7px 8px; font-size: 11.5px; font-weight: 500; color: var(--text-3); text-transform: capitalize; }
.cal-day { background: var(--surface); min-height: 104px; padding: 5px; display: flex; flex-direction: column; gap: 3px; cursor: pointer; min-width: 0; }
.cal-day:hover { background: var(--surface-2); }
.cal-day.out { background: var(--bg); }
.cal-day.out .cal-num { color: var(--text-3); opacity: .6; }
.cal-num { font-size: 12px; font-weight: 500; width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; color: var(--text-2); flex: none; }
.cal-day.today .cal-num { background: var(--accent); color: #fff; }
.cal-item { display: block; width: 100%; text-align: left; border: 0; font: 500 11.5px/1.3 inherit; font-family: inherit; padding: 2px 6px; border-radius: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; background: var(--accent-soft); color: var(--accent-text); }
.cal-item.task { background: var(--surface-2); color: var(--text-2); box-shadow: inset 2px 0 0 var(--line-strong); }
.cal-item.overdue { box-shadow: inset 2px 0 0 var(--critical); color: var(--critical); }
.cal-item.milestone { background: var(--info-soft); color: var(--info); }
.cal-more { font-size: 11px; color: var(--text-3); padding-left: 6px; }
.agenda-day { display: grid; grid-template-columns: 110px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.agenda-day:last-child { border-bottom: 0; }
.agenda-date { font-weight: 600; font-size: 13px; text-transform: capitalize; }
.agenda-item { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 13.5px; cursor: pointer; min-width: 0; }

/* Listes */
.list-item { display: flex; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); align-items: flex-start; }
.list-item:last-child { border-bottom: 0; }
.list-item.unread { background: linear-gradient(90deg, var(--accent-soft), transparent 40%); margin: 0 -18px; padding-left: 18px; padding-right: 18px; }
.list-main { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.alert-item { display: flex; gap: 10px; padding: 9px 12px; border-radius: var(--radius-sm); font-size: 13.5px; align-items: flex-start; margin-bottom: 6px; background: var(--surface-2); color: var(--text-2); }
.alert-item:last-child { margin-bottom: 0; }
.alert-critical { background: var(--critical-soft); color: var(--critical); }
.alert-warning { background: var(--warning-soft); color: var(--warning); }
.alert-good { background: var(--good-soft); color: var(--good); }
.project-card { padding: 16px 18px; display: flex; flex-direction: column; gap: 11px; cursor: pointer; transition: border-color .12s, box-shadow .12s; color: inherit; }
.project-card:hover { border-color: var(--line-strong); text-decoration: none; box-shadow: 0 4px 14px rgba(11,20,55,.07); }
.project-card h3 { font-size: 15px; overflow-wrap: anywhere; }
.dl { display: grid; grid-template-columns: minmax(110px, auto) 1fr; gap: 7px 16px; font-size: 13.5px; margin: 0; }
.dl dt { color: var(--text-3); }
.dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.swot { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 12px; }
.swot > div { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; }
.swot h3 { font-size: 13px; margin-bottom: 8px; }
.swot ul { margin: 0; padding-left: 16px; font-size: 13.5px; color: var(--text-2); }
.swot li { margin-bottom: 4px; }
.conversion { font-size: 12px; color: var(--text-3); }

/* Assistant */
.chat { display: flex; flex-direction: column; gap: 12px; min-height: 240px; }
.msg { max-width: min(760px, 92%); padding: 10px 14px; border-radius: 12px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; }
.msg-user { align-self: flex-end; background: var(--accent); color: #fff; }
:root[data-theme="dark"] .msg-user { color: #0A1024; }
.msg-ai { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--line); }
.proposal { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; display: flex; gap: 12px; justify-content: space-between; align-items: center; flex-wrap: wrap; margin-top: 8px; background: var(--surface); }
.quick { display: flex; flex-wrap: wrap; gap: 6px; }
.chat-input { display: flex; gap: 8px; align-items: flex-end; }
.chat-input textarea { flex: 1; }

/* Accès */
.auth-page { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); background: var(--surface); }
.auth-side { background: var(--night); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; }
.auth-side h1 { font-size: 30px; line-height: 1.2; letter-spacing: -.02em; max-width: 440px; margin-top: 56px; }
.auth-side p { color: var(--night-text); margin-top: 14px; max-width: 420px; font-size: 15px; }
.auth-points { display: flex; flex-direction: column; gap: 12px; color: var(--night-text); font-size: 13.5px; }
.auth-points div { display: flex; gap: 10px; align-items: center; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 32px 20px; }
.auth-box { width: 100%; max-width: 410px; }
.auth-box h2 { font-size: 21px; margin-bottom: 4px; }
.auth-box .sub { color: var(--text-3); margin-bottom: 20px; }
.auth-box form { display: flex; flex-direction: column; gap: 13px; }
.auth-box .field input, .auth-box .field select { width: 100%; }
.auth-links { display: flex; justify-content: space-between; gap: 12px; margin-top: 16px; font-size: 13px; flex-wrap: wrap; }
.linkish { background: none; border: 0; color: var(--accent-text); cursor: pointer; font: inherit; padding: 0; }
.linkish:hover { text-decoration: underline; }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; font-family: ui-monospace, Consolas, monospace; font-size: 13px; background: var(--surface-2); padding: 12px; border-radius: var(--radius-sm); border: 1px solid var(--line); margin: 10px 0; }
.pin-input { letter-spacing: .5em; text-align: center; font-size: 20px; }
.lang-switch { display: flex; gap: 4px; justify-content: flex-end; margin-bottom: 18px; }
.boot { min-height: 100vh; display: flex; align-items: center; justify-content: center; }

@media (max-width: 960px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 270px; transform: translateX(-100%); transition: transform .18s; }
  .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .scrim { position: fixed; inset: 0; background: rgba(8,14,34,.45); z-index: 28; }
  .topbar { display: flex; }
  .content { padding: 18px 16px 40px; }
  .status-strip { padding: 7px 16px; }
  .auth-page { grid-template-columns: minmax(0, 1fr); }
  .auth-side { display: none; }
}
@media (max-width: 640px) {
  .field-half { grid-column: span 2; }
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { padding: 10px 0; border-bottom: 1px solid var(--line); }
  .table tr:last-child { border-bottom: 0; }
  .table td { border: 0; padding: 3px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right !important; }
  .table td::before { content: attr(data-label); color: var(--text-3); font-size: 12px; text-align: left; flex: none; max-width: 45%; }
  .table td:empty { display: none; }
  .cal-day { min-height: 62px; padding: 3px; }
  .cal-item { font-size: 10px; padding: 1px 3px; }
  .cal-dow { padding: 5px 3px; font-size: 10.5px; text-align: center; }
  .overlay { padding: 0; align-items: stretch; }
  .dialog { border-radius: 0; max-width: none; border: 0; min-height: 100%; }
  .page-actions .btn { flex: 1 1 auto; }
  .agenda-day { grid-template-columns: 1fr; gap: 4px; }
  .search { max-width: none; flex-basis: 100%; }
  .filter { flex: 1 1 45%; }
  .filter select, .filter input { min-width: 0; width: 100%; }
}
@media print {
  .sidebar, .topbar, .status-strip, .page-actions, .filters, .tabs, #toasts, .no-print { display: none !important; }
  .shell { display: block; }
  body { background: #fff; }
  .card { box-shadow: none; break-inside: avoid; }
  .content { padding: 0; max-width: none; }
}
