/* Kynoria — design system. Noir / or / blanc, épuré, lisible. Aucun statut n'est communiqué par la seule couleur (icône + libellé). */
:root {
  --navy: #0b0b0c; --navy-2: #1c1c1e; --navy-3: #2b2b2e; --gold: #96701a; --gold-2: #c9a24a; --gold-soft: #f6efdc;
  --bg: #fafaf8; --surface: #fff; --surface-2: #f3f2ee; --line: #e7e4dc; --text: #111111; --muted: #6b6b66;
  --ok: #17734a; --ok-bg: #e3f4ec; --warn: #8a5a00; --warn-bg: #fff3d6; --urgent: #b4430f; --urgent-bg: #ffe9dc; --crit: #a3122a; --crit-bg: #fde3e8; --info: #3d3d40; --info-bg: #eeeeec;
  --radius: 14px; --shadow: 0 1px 2px rgba(0,0,0,.06), 0 8px 24px rgba(0,0,0,.06); --sidebar: 252px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0a0a0a; --surface: #141414; --surface-2: #1c1c1c; --line: #2e2e2e; --text: #f2f0ea; --muted: #a3a09a; --gold-soft: #2a2410;
    --ok-bg: #0f3324; --warn-bg: #3a2b08; --urgent-bg: #3d1d0c; --crit-bg: #3d0f19; --info-bg: #1f1f1f; --ok: #5fd39b; --warn: #f1c561; --urgent: #ff9b64; --crit: #ff7b90; --info: #cfcfcf; --gold: #d9b45b; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 var(--font); background: var(--bg); color: var(--text); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; letter-spacing: -.01em; }
h1 { font-size: 1.7rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }
a { color: var(--navy-3); } @media (prefers-color-scheme: dark) { a { color: var(--gold-2); } }
button, input, select, textarea { font: inherit; color: inherit; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 8px; top: 8px; background: #fff; padding: 8px 12px; z-index: 100; border-radius: 8px; }
:focus-visible { outline: 3px solid var(--gold-2); outline-offset: 2px; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .center { text-align: center; } .right { text-align: right; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; } .between { justify-content: space-between; } .grow { flex: 1; }
.stack > * + * { margin-top: 12px; } .gap-lg > * + * { margin-top: 20px; }
.grid { display: grid; gap: 16px; } .g2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); } .g3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); } .g4 { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }

/* Boutons */
.btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); padding: 9px 16px; border-radius: 10px; cursor: pointer; font-weight: 600; text-decoration: none; transition: transform .08s, box-shadow .15s, background .15s; min-height: 40px; }
.btn:hover { box-shadow: var(--shadow); } .btn:active { transform: translateY(1px); }
.btn.primary { background: var(--navy); color: #fff; border-color: var(--navy); } .btn.primary:hover { background: var(--navy-2); }
@media (prefers-color-scheme: dark) { .btn.primary { background: var(--gold-2); color: #1a1405; border-color: var(--gold-2); } .btn.primary:hover { background: #dbb757; } }
.btn.gold { background: var(--gold); color: #fff; border-color: var(--gold); }
.btn.danger { color: var(--crit); border-color: var(--crit); } .btn.ghost { border-color: transparent; background: transparent; }
.btn.lg { padding: 14px 22px; min-height: 52px; font-size: 1.02rem; border-radius: 12px; } .btn.block { width: 100%; justify-content: center; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* Cartes */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card.flat { box-shadow: none; } .card h2 { margin-bottom: 12px; }
.kpi { display: flex; flex-direction: column; gap: 2px; } .kpi .n { font-size: 2rem; font-weight: 750; letter-spacing: -.02em; } .kpi .l { color: var(--muted); font-size: .85rem; }
.kpi.link { cursor: pointer; text-decoration: none; color: inherit; } .kpi.link:hover { border-color: var(--gold-2); }

/* Badges : icône + texte */
.badge { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 3px 10px; font-size: .78rem; font-weight: 650; background: var(--surface-2); color: var(--text); white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); } .badge.warn { background: var(--warn-bg); color: var(--warn); } .badge.urgent { background: var(--urgent-bg); color: var(--urgent); }
.badge.crit { background: var(--crit-bg); color: var(--crit); } .badge.info { background: var(--info-bg); color: var(--info); } .badge.gold { background: var(--gold-soft); color: var(--gold); }

/* Formulaires */
label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=datetime-local], input[type=search], input[type=tel], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); min-height: 42px; }
textarea { min-height: 90px; resize: vertical; }
.field { margin-bottom: 14px; } .field .err { color: var(--crit); font-size: .82rem; margin-top: 4px; } .field .hint { color: var(--muted); font-size: .8rem; margin-top: 4px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; } .check input { margin-top: 4px; width: 18px; height: 18px; }

/* Tableaux */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; } th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--surface-2); position: sticky; top: 0; }
tbody tr:hover { background: var(--surface-2); } tr.click { cursor: pointer; } tbody tr:last-child td { border-bottom: 0; }

/* Mise en page application */
.app { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar { background: var(--navy); color: #ecebe6; padding: 18px 12px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 18px; color: #fff; font-weight: 750; letter-spacing: .02em; font-size: 1.1rem; text-decoration: none; }
.brand .mark { width: 32px; height: 32px; border-radius: 9px; background: #fff1; display: grid; place-items: center; color: var(--gold-2); font-weight: 800; }
.nav-group { font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: var(--gold-2); padding: 14px 12px 4px; }
.nav a { display: flex; align-items: center; gap: 10px; color: #ecebe6; text-decoration: none; padding: 9px 12px; border-radius: 10px; font-weight: 550; min-height: 40px; }
.nav a:hover { background: #ffffff14; } .nav a[aria-current=page] { background: #ffffff1f; color: #fff; box-shadow: inset 3px 0 0 var(--gold-2); }
.nav .count { margin-left: auto; background: var(--gold-2); color: #1a1405; border-radius: 999px; font-size: .72rem; font-weight: 800; padding: 1px 8px; }
.main { min-width: 0; } .topbar { display: flex; align-items: center; gap: 12px; padding: 12px 24px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.content { padding: 24px; max-width: 1400px; margin: 0 auto; } .page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.search-btn { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); color: var(--muted); cursor: pointer; min-width: 240px; }
.kbd { border: 1px solid var(--line); border-radius: 6px; padding: 0 6px; font-size: .75rem; background: var(--surface); }
.icon-btn { position: relative; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; width: 42px; height: 42px; cursor: pointer; display: grid; place-items: center; font-size: 1.1rem; }
.icon-btn .dot { position: absolute; top: -5px; right: -5px; background: var(--crit); color: #fff; border-radius: 999px; font-size: .7rem; padding: 1px 6px; font-weight: 800; }
.menu-toggle { display: none; }
.app.collapsed { grid-template-columns: 72px 1fr; } .app.collapsed .nav span.t, .app.collapsed .nav-group, .app.collapsed .brand .name, .app.collapsed .nav .count { display: none; }

/* À traiter / timeline */
.todo-item { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.todo-item .sev { width: 4px; border-radius: 4px; background: var(--muted); align-self: stretch; } .todo-item.critical .sev { background: var(--crit); } .todo-item.urgent .sev { background: var(--urgent); } .todo-item.attention .sev { background: var(--warn); }
.card-human { border: 2px solid var(--gold-2); background: linear-gradient(180deg, var(--gold-soft), var(--surface)); }
.card-human .tag { font-size: .7rem; letter-spacing: .12em; font-weight: 800; color: var(--gold); }
.timeline { position: relative; padding-left: 22px; } .timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.tl-item { position: relative; padding: 6px 0 14px; } .tl-item::before { content: ""; position: absolute; left: -21px; top: 10px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 3px solid var(--navy-3); }
.tl-item .time { font-weight: 750; font-variant-numeric: tabular-nums; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; } .chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 14px; cursor: pointer; font-weight: 600; font-size: .85rem; } .chip[aria-pressed=true] { background: var(--navy); color: #fff; border-color: var(--navy); }
@media (prefers-color-scheme: dark) { .chip[aria-pressed=true] { background: var(--gold-2); color: #1a1405; } }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; } .tab { padding: 10px 16px; border: 0; background: none; cursor: pointer; font-weight: 650; color: var(--muted); border-bottom: 3px solid transparent; white-space: nowrap; } .tab[aria-selected=true] { color: var(--text); border-color: var(--gold-2); }

/* Calendrier */
.cal { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.cal-grid { display: grid; min-width: 760px; } .cal-head, .cal-cell { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); padding: 6px; min-height: 52px; position: relative; font-size: .8rem; }
.cal-head { background: var(--surface-2); font-weight: 700; text-align: center; position: sticky; top: 0; z-index: 2; } .cal-prop { position: sticky; left: 0; background: var(--surface); z-index: 1; font-weight: 650; font-size: .85rem; }
.cal-ev { background: var(--navy-3); color: #fff; border-radius: 8px; padding: 3px 8px; font-size: .75rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; border: 0; width: 100%; text-align: left; }
.cal-ev.in_progress { background: var(--ok); } .cal-ev.cancelled { background: var(--muted); text-decoration: line-through; } .cal-today { background: var(--gold-soft); }

/* Tiroir, modal, palette */
.overlay { position: fixed; inset: 0; background: rgba(2,10,40,.5); z-index: 60; display: flex; justify-content: flex-end; }
.overlay.center { justify-content: center; align-items: flex-start; padding-top: 12vh; }
.drawer { width: min(520px, 100%); background: var(--surface); height: 100%; overflow-y: auto; padding: 22px; box-shadow: -8px 0 32px rgba(0,0,0,.25); animation: slide .18s ease-out; }
.modal { width: min(560px, 94vw); background: var(--surface); border-radius: var(--radius); padding: 22px; max-height: 80vh; overflow-y: auto; box-shadow: var(--shadow); animation: pop .15s ease-out; }
.palette { width: min(620px, 94vw); background: var(--surface); border-radius: 16px; overflow: hidden; box-shadow: 0 24px 80px rgba(0,0,0,.4); }
.palette input { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 16px 18px; font-size: 1.05rem; }
.palette li { list-style: none; padding: 10px 18px; cursor: pointer; display: flex; gap: 12px; align-items: center; } .palette li[aria-selected=true] { background: var(--surface-2); } .palette ul { margin: 0; padding: 0; max-height: 50vh; overflow: auto; }
@keyframes slide { from { transform: translateX(24px); opacity: 0; } } @keyframes pop { from { transform: scale(.97); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Toasts, squelettes, états vides */
#toasts { position: fixed; right: 16px; bottom: 16px; z-index: 90; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--navy); color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow); max-width: 360px; animation: pop .15s ease-out; border-left: 5px solid var(--gold-2); } .toast.err { border-left-color: var(--crit); background: #3a0c17; }
.skel { background: linear-gradient(90deg, var(--surface-2), var(--line), var(--surface-2)); background-size: 200% 100%; animation: sh 1.2s infinite; border-radius: 10px; height: 18px; } @keyframes sh { to { background-position: -200% 0; } }
.empty { text-align: center; padding: 40px 16px; color: var(--muted); } .empty .big { font-size: 2.2rem; margin-bottom: 6px; }
.alert { padding: 12px 14px; border-radius: 12px; background: var(--info-bg); color: var(--info); border: 1px solid transparent; } .alert.err { background: var(--crit-bg); color: var(--crit); } .alert.warn { background: var(--warn-bg); color: var(--warn); } .alert.ok { background: var(--ok-bg); color: var(--ok); }
.progress { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; } .progress > div { height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-2)); transition: width .3s; }
.mock-tag { font-size: .7rem; font-weight: 800; letter-spacing: .06em; color: var(--warn); background: var(--warn-bg); border-radius: 6px; padding: 1px 6px; }
.log-line { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85rem; padding: 4px 0; border-bottom: 1px dashed var(--line); } .log-line.error { color: var(--crit); } .log-line.warning { color: var(--warn); }
.chat { display: flex; flex-direction: column; gap: 10px; } .bubble { max-width: 85%; padding: 10px 14px; border-radius: 16px; background: var(--surface-2); } .bubble.me { align-self: flex-end; background: var(--navy); color: #fff; } .bubble.ai { background: var(--gold-soft); }
@media (prefers-color-scheme: dark) { .bubble.me { background: var(--gold-2); color: #1a1405; } }

/* Public */
.pub-nav { display: flex; align-items: center; gap: 18px; padding: 16px 5vw; position: sticky; top: 0; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); z-index: 30; border-bottom: 1px solid var(--line); }
.pub-nav .brand { color: var(--navy); padding: 0; } .pub-nav .brand .mark { background: var(--navy); } @media (prefers-color-scheme: dark) { .pub-nav .brand { color: #fff; } }
.hero { background: radial-gradient(1200px 500px at 80% -10%, #2b2b2e, transparent), var(--navy); color: #fff; padding: 90px 5vw 80px; } .hero h1 { font-size: clamp(2rem, 5vw, 3.6rem); max-width: 18ch; } .hero p { max-width: 56ch; color: #d6d3cb; font-size: 1.1rem; }
.section { padding: 64px 5vw; max-width: 1200px; margin: 0 auto; } .section h2 { font-size: 1.8rem; } .lead { color: var(--muted); max-width: 60ch; }
.step-dots { display: flex; gap: 6px; margin-bottom: 18px; } .step-dots span { flex: 1; height: 6px; border-radius: 6px; background: var(--line); } .step-dots span.on { background: var(--gold-2); }
.price { font-size: 2rem; font-weight: 800; } .feature { display: flex; gap: 14px; } .feature .ic { width: 44px; height: 44px; border-radius: 12px; background: var(--gold-soft); display: grid; place-items: center; font-size: 1.3rem; flex: none; }
footer.pub { padding: 40px 5vw; background: var(--navy); color: #a8a59d; }

/* Prestataire — mobile first */
.prov { max-width: 560px; margin: 0 auto; padding: 14px 14px 90px; } .prov-top { display: flex; justify-content: space-between; align-items: center; padding: 6px 2px 14px; }
.mission { display: block; text-decoration: none; color: inherit; } .mission .when { font-weight: 800; font-size: 1.1rem; }
.bigbtn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 58px; border-radius: 14px; border: 0; font-size: 1.05rem; font-weight: 800; letter-spacing: .02em; cursor: pointer; background: var(--navy); color: #fff; text-decoration: none; margin-top: 12px; }
.bigbtn.gold { background: var(--gold); } .bigbtn.outline { background: transparent; color: var(--text); border: 2px solid var(--line); } .bigbtn.red { background: var(--crit); } .bigbtn[disabled] { opacity: .45; }
.checkrow { display: flex; align-items: center; gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); min-height: 56px; cursor: pointer; } .checkrow input { width: 24px; height: 24px; flex: none; } .checkrow.done { background: var(--ok-bg); }
.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; } .photos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; }

@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; } .sidebar { position: fixed; z-index: 50; left: 0; width: 280px; transform: translateX(-100%); transition: transform .2s; } .app.open .sidebar { transform: none; }
  .menu-toggle { display: grid; } .search-btn { min-width: 0; flex: 1; } .search-btn .kbd, .search-btn .lbl { display: none; } .content { padding: 16px; } .topbar { padding: 10px 14px; }
  .todo-item { grid-template-columns: auto 1fr; } .todo-item .acts { grid-column: 1 / -1; }
}
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.chart { width: 100%; height: auto; max-height: 260px; color: var(--text); }
button.card.link { cursor: pointer; font: inherit; color: inherit; width: 100%; }
.status-hero { border-left: 6px solid var(--ok, #1a7f4b); } .status-hero.warn { border-left-color: var(--warn, #b7791f); } .status-hero .big { font-size: 2rem; }
.checklist { list-style: none; padding: 0; display: grid; gap: 6px; }
.sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
.btn.big { width: 100%; min-height: 54px; font-size: 1rem; justify-content: center; text-align: center; letter-spacing: .02em; }
.btn.big[disabled] { opacity: .45; cursor: not-allowed; }
.prov-top .brand { color: var(--text); padding: 0; } .prov-top .brand .mark { background: var(--navy); }
.code { font: 700 1.4rem ui-monospace, monospace; letter-spacing: .08em; padding: 10px 12px; background: var(--gold-soft); border-radius: 10px; }
.big-check { padding: 8px 0; font-size: 1.02rem; }

.todo-item { grid-template-columns: auto minmax(0, 1fr); } .todo-item .acts { grid-column: 2; display: flex !important; flex-direction: row !important; flex-wrap: wrap; min-width: 0 !important; }
