@import url('https://fonts.googleapis.com/css2?family=Sora:wght@500;600;700&family=Inter:wght@400;500;600;700&display=swap');

:root{
  --ink:#101826; --ink-soft:#4a5568; --ink-mute:#8a94a6;
  --bg:#f2f4f8; --surface:#ffffff; --surface-2:#f7f8fb;
  --line:#e3e7ee; --line-soft:#edf0f5;
  --brand:#1a4fd6; --brand-deep:#0d2f8f; --brand-soft:#e8edfc;
  --teal:#0f8f72; --teal-soft:#e3f6f0;
  --amber:#c2740a; --amber-soft:#fdf1de;
  --red:#c62828; --red-soft:#fdeaea;
  --radius-lg:18px; --radius-md:13px; --radius-sm:9px;
  --shadow-card:0 1px 2px rgba(16,24,38,.04), 0 6px 20px rgba(16,24,38,.06);
  --shadow-pop:0 8px 28px rgba(16,24,38,.14);
}
*{box-sizing:border-box}
body{margin:0;font-family:'Inter',Arial,sans-serif;background:var(--bg);color:var(--ink);-webkit-font-smoothing:antialiased}
h1,h2,h3{font-family:'Sora','Inter',sans-serif}
body.dark{--ink:#eef1f6;--ink-soft:#aab4c4;--ink-mute:#6b7690;--bg:#0c1220;--surface:#141c2c;--surface-2:#101827;--line:#232e42;--line-soft:#1b2434;--brand-soft:#132352;--teal-soft:#0e2620;--amber-soft:#2a1f0c;--red-soft:#2a1414}

header{background:linear-gradient(160deg,var(--brand-deep),var(--brand) 70%);color:#fff;padding:20px 16px 18px;text-align:center;position:sticky;top:0;z-index:6;box-shadow:0 4px 18px rgba(13,47,143,.25)}
header h2{margin:0;font-size:19px;font-weight:700;letter-spacing:.2px}
header .tag{font-size:12px;opacity:.85;margin-top:3px;font-weight:500}

.icon-row{display:flex;align-items:stretch;justify-content:space-between;gap:5px;padding:8px 8px 10px;margin:0;background:var(--bg);position:sticky;top:0;z-index:5;border-bottom:1px solid var(--line)}
.icon-btn{flex:1;border-radius:var(--radius-sm);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;font-size:18px;border:0;cursor:pointer;color:var(--ink-soft);padding:9px 3px 7px;background:transparent;position:relative;font-family:inherit}
.icon-btn span{font-size:10px;font-weight:600;letter-spacing:.1px}
.icon-btn.on{color:var(--brand);background:var(--brand-soft)}
.icon-btn.on::after{content:"";position:absolute;bottom:2px;left:50%;transform:translateX(-50%);width:16px;height:3px;border-radius:3px;background:var(--brand)}

.wrap{max-width:900px;margin:auto;padding:14px 14px 110px}

.card{background:var(--surface);border-radius:var(--radius-lg);padding:17px 17px;margin:12px 0;box-shadow:var(--shadow-card);border:1px solid var(--line-soft)}
.card h3{margin:0 0 4px;font-size:15.5px;font-weight:700;color:var(--ink)}

button{border:0;border-radius:var(--radius-sm);padding:13px 16px;background:var(--brand);color:#fff;font-weight:700;font-size:14.5px;cursor:pointer;font-family:'Inter',sans-serif;transition:transform .08s ease,filter .12s ease}
button:hover{filter:brightness(1.06)}
button:active{transform:scale(.98)}
button.gray{background:var(--surface-2);color:var(--ink-soft);border:1px solid var(--line)}
button.red{background:var(--red-soft);color:var(--red);border:1px solid #f2c3c3}
button.green{background:var(--teal);color:#fff}
button.orange{background:var(--amber-soft);color:var(--amber);border:1px solid #f0d5a3}
button.small{padding:8px 13px;font-size:12.5px}
button.link{background:transparent;color:var(--brand);font-weight:700;padding:6px}
button:disabled{opacity:.5;cursor:not-allowed}

input,select,textarea{width:100%;padding:11px 12px;border:1.5px solid var(--line);border-radius:var(--radius-sm);font-size:14.5px;margin:5px 0;font-family:inherit;background:var(--surface);color:var(--ink);transition:border-color .12s ease}
input:focus,select:focus,textarea:focus{outline:none;border-color:var(--brand)}
textarea{resize:vertical;min-height:64px;line-height:1.5}
label{font-size:12.5px;font-weight:700;color:var(--ink-soft);display:block;margin-top:11px;text-transform:uppercase;letter-spacing:.3px}
.small{color:var(--ink-mute);font-size:12.5px}
.row2{display:grid;grid-template-columns:1fr 1fr;gap:8px}

.tabs{display:flex;background:var(--surface-2);border-radius:var(--radius-sm);padding:4px;margin:10px 0;border:1px solid var(--line)}
.tabs button{flex:1;background:transparent;color:var(--ink-soft);padding:9px;border-radius:8px;font-size:13px}
.tabs button.active{background:var(--brand);color:#fff}

/* Sections repliables (fiche) */
details.section{background:var(--surface);border-radius:var(--radius-lg);margin:12px 0;box-shadow:var(--shadow-card);border:1px solid var(--line-soft);overflow:hidden}
details.section > summary{list-style:none;cursor:pointer;padding:15px 17px;display:flex;align-items:center;gap:11px;user-select:none}
details.section > summary::-webkit-details-marker{display:none}
details.section > summary .sec-ico{width:32px;height:32px;border-radius:9px;background:var(--brand-soft);color:var(--brand);display:flex;align-items:center;justify-content:center;font-size:16px;flex-shrink:0}
details.section > summary .sec-txt{flex:1;min-width:0}
details.section > summary .sec-txt b{display:block;font-size:14.5px;font-weight:700}
details.section > summary .sec-txt .sec-sub{font-size:11.5px;color:var(--ink-mute);margin-top:1px}
details.section > summary .sec-chev{color:var(--ink-mute);font-size:13px;transition:transform .18s ease;flex-shrink:0}
details.section[open] > summary .sec-chev{transform:rotate(90deg)}
details.section[open] > summary{border-bottom:1px solid var(--line-soft)}
details.section .sec-body{padding:6px 17px 17px}
details.section .sec-dot{width:8px;height:8px;border-radius:50%;background:var(--line);flex-shrink:0}
details.section .sec-dot.filled{background:var(--teal)}

.icon-row2{display:flex;align-items:center;justify-content:space-around;gap:6px;padding:8px 6px;margin:0;background:#f4f7fb;border-radius:14px}

.phase{background:var(--surface-2);border:1px solid var(--line);border-radius:var(--radius-md);padding:12px 13px;margin:9px 0}
.phase-head{display:flex;align-items:center;justify-content:space-between;gap:6px}
.phase-head b{font-size:13.5px;color:var(--ink)}
.badge{display:inline-block;padding:3px 10px;border-radius:20px;background:var(--teal-soft);color:var(--teal);font-size:11px;font-weight:700}
.fiche-card{background:var(--surface);border-radius:var(--radius-md);padding:13px 15px;margin:9px 0;box-shadow:var(--shadow-card);cursor:pointer;border:1px solid var(--line-soft);border-left:3px solid var(--brand);transition:transform .1s ease}
.fiche-card:active{transform:scale(.99)}
.fiche-card b{display:block;font-size:14.5px;font-weight:700}
.fiche-card .small{margin-top:3px}
.pill{display:inline-block;font-size:10.5px;font-weight:700;padding:3px 9px;border-radius:20px;background:var(--surface-2);color:var(--ink-soft);margin-right:4px;margin-top:5px;border:1px solid var(--line)}
.mat-btn{background:var(--surface-2);color:var(--brand-deep);border:1.5px solid var(--line);font-weight:700}
body.dark .mat-btn{color:#8ab4f8}
.mat-btn.active{background:var(--brand);color:#fff;border-color:var(--brand)}
.warn-box{background:var(--amber-soft);color:var(--amber);padding:11px 13px;border-radius:var(--radius-sm);font-size:12.5px;margin:9px 0;border:1px solid #f0d5a3}
.empty{text-align:center;color:var(--ink-mute);padding:34px 12px}
.spin{display:inline-block;width:16px;height:16px;border:2.5px solid #fff8;border-top-color:#fff;border-radius:50%;animation:sp .7s linear infinite;vertical-align:-3px}
@keyframes sp{to{transform:rotate(360deg)}}
.footer-credit{text-align:center;padding:14px;color:var(--ink-mute);font-size:11px}

/* Barre d'action fixe (vue Fiche) */
.action-bar{position:fixed;left:0;right:0;bottom:0;z-index:8;background:var(--surface);border-top:1px solid var(--line);padding:10px 14px calc(10px + env(safe-area-inset-bottom));display:flex;gap:8px;box-shadow:0 -4px 20px rgba(16,24,38,.08)}
.action-bar button{flex:1;padding:12px 4px;font-size:11.5px;white-space:nowrap}
.action-bar button.primary{flex:1.5}

::-webkit-scrollbar{width:8px}
::-webkit-scrollbar-thumb{background:var(--line);border-radius:8px}
