/* Mon planning : feuille de style commune (connexion et application). Inspiration Apple, comme « Mes Finances » et « Mes Projets ». */
:root {
  color-scheme: light;
  --bg: #f5f5f7; --card: #ffffff; --side: #f9f9fb; --ink: #1d1d1f; --ink-2: #6e6e73; --ink-3: #86868b;
  --hair: rgba(0,0,0,.08); --hair-strong: rgba(0,0,0,.14); --fill: rgba(118,118,128,.12); --fill-2: rgba(118,118,128,.07);
  --accent: #0071e3; --bad: #ff3b30; --bad-text: #c9302c; --good: #34c759; --good-text: #1a7f37; --warn: #ff9500; --warn-text: #b45f00;
  --we: rgba(118,118,128,.07); --sum: #1d1d1f;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 32px rgba(0,0,0,.06);
  --row: 34px; --row0: 38px; --tint: 9%;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #000; --card: #1c1c1e; --side: #111113; --ink: #f5f5f7; --ink-2: #a1a1a6; --ink-3: #8e8e93;
    --hair: rgba(255,255,255,.09); --hair-strong: rgba(255,255,255,.16); --fill: rgba(118,118,128,.24); --fill-2: rgba(118,118,128,.14);
    --accent: #0a84ff; --bad-text: #ff6961; --good-text: #30d158; --warn-text: #ff9f0a; --we: rgba(118,118,128,.12); --sum: #f5f5f7; --tint: 16%;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 32px rgba(0,0,0,.4);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000; --card: #1c1c1e; --side: #111113; --ink: #f5f5f7; --ink-2: #a1a1a6; --ink-3: #8e8e93;
  --hair: rgba(255,255,255,.09); --hair-strong: rgba(255,255,255,.16); --fill: rgba(118,118,128,.24); --fill-2: rgba(118,118,128,.14);
  --accent: #0a84ff; --bad-text: #ff6961; --good-text: #30d158; --warn-text: #ff9f0a; --we: rgba(118,118,128,.12); --sum: #f5f5f7;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 32px rgba(0,0,0,.4);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); color: var(--ink); font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", system-ui, "Segoe UI", sans-serif; font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 40%, transparent); outline-offset: 2px; }
h1, h2, h3 { margin: 0; letter-spacing: -0.01em; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--ink-2); } .small { font-size: 12.5px; } .nowrap { white-space: nowrap; } .sp { flex: 1; }
svg.i { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Champs et boutons ---------- */
input, select, textarea { width: 100%; border-radius: 10px; border: 1px solid var(--hair-strong); background: var(--card); padding: 0 12px; height: 38px; outline: none; }
textarea { height: auto; min-height: 64px; padding: 9px 12px; resize: vertical; line-height: 1.4; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
input[type="checkbox"] { width: 18px; height: 18px; padding: 0; accent-color: var(--accent); }
label.f { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 500; color: var(--ink-2); }
.btn { height: 34px; padding: 0 13px; border-radius: 9px; border: 1px solid var(--hair-strong); background: var(--card); font-weight: 500; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-size: 13px; }
.btn:hover { background: var(--fill-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { background: var(--bad-text); border-color: var(--bad-text); color: #fff; font-weight: 600; }
.btn.warn { background: var(--warn); border-color: var(--warn); color: #fff; font-weight: 600; }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn[disabled] { opacity: .5; cursor: default; }
.ib { width: 30px; height: 30px; display: inline-grid; place-items: center; border: 0; background: none; border-radius: 8px; color: var(--ink-2); flex: none; }
.ib:hover { background: var(--fill); color: var(--ink); }
.ib[disabled], .ib.off { opacity: .3; pointer-events: none; }
.seg { display: inline-flex; background: var(--fill); border-radius: 9px; padding: 2px; }
.seg button { border: 0; background: none; padding: 3px 11px; border-radius: 7px; font-size: 12.5px; color: var(--ink-2); }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); font-weight: 600; }
.msg { font-size: 13px; line-height: 1.45; border-radius: 10px; padding: 10px 12px; }
.msg:empty { display: none; }
.msg.err { color: var(--bad-text); background: color-mix(in srgb, var(--bad-text) 10%, transparent); }
.msg.info { color: var(--ink-2); background: var(--fill); }
.spin { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.pill { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--hair-strong); background: var(--card); border-radius: 999px; padding: 2px 10px; font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--good); }
.pill.mod .dot { background: var(--warn); }
.pill.ro { background: color-mix(in srgb, var(--warn) 16%, var(--card)); border-color: color-mix(in srgb, var(--warn) 45%, transparent); color: var(--ink); }
.pill.ro .dot { background: var(--warn); }
.tag { display: inline-block; border-radius: 999px; padding: 1px 9px; font-size: 11.5px; background: var(--fill); color: var(--ink-2); white-space: nowrap; }
.tag.c { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.prog { display: inline-block; width: 60px; height: 5px; background: var(--fill); border-radius: 3px; vertical-align: middle; margin-right: 7px; overflow: hidden; }
.prog i { display: block; height: 100%; background: var(--accent); }

/* ---------- Connexion ---------- */
body.login { display: grid; place-items: center; padding: 24px 16px; min-height: 100vh; }
.wrap-login { width: 100%; max-width: 380px; }
.brand { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-bottom: 26px; text-align: center; }
.mark { width: 64px; height: 64px; border-radius: 16px; display: grid; place-items: center; background: linear-gradient(135deg, #0a84ff, #5e5ce6); box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 8px 24px rgba(10,132,255,.35); }
.brand h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.brand p { color: var(--ink-2); margin: 4px 0 0; }
.login .card { background: var(--card); border: 1px solid var(--hair); border-radius: 20px; padding: 22px; box-shadow: var(--shadow); }
.login form { display: flex; flex-direction: column; gap: 14px; }
.login input { height: 44px; border-radius: 11px; font-size: 15px; }
.login .btn.primary { height: 44px; justify-content: center; font-size: 15px; margin-top: 4px; }
.foot { margin-top: 18px; text-align: center; font-size: 12px; color: var(--ink-3); line-height: 1.5; }

/* ---------- En-tête : menu magnétique ---------- */
body.app { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--card) 84%, transparent); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-bottom: 1px solid var(--hair); flex: none; }
.bar { display: flex; align-items: center; gap: 4px; padding: 0 16px; height: 40px; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 650; letter-spacing: -.01em; margin-right: 10px; white-space: nowrap; }
.logo i { width: 22px; height: 22px; border-radius: 6px; background: linear-gradient(135deg, #0a84ff, #5e5ce6); display: grid; place-items: center; }
.logo i:before { content: ""; width: 12px; height: 2px; background: #fff; box-shadow: 3px 4px 0 #fff, -2px -4px 0 #fff; border-radius: 2px; }
.nav { border: 0; background: none; padding: 6px 11px; border-radius: 8px; color: var(--ink-2); font-weight: 500; white-space: nowrap; }
.nav:hover { background: var(--fill); }
.nav.on { color: var(--ink); background: var(--fill); }
.user { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 13px; }
.av { width: 28px; height: 28px; border-radius: 50%; background: var(--fill); display: grid; place-items: center; font-weight: 600; color: var(--ink); font-size: 12px; text-transform: uppercase; }
.ctx { display: flex; align-items: center; gap: 6px; padding: 5px 16px; border-top: 1px solid var(--hair); min-height: 41px; }
.ctx:empty { display: none; }
.crumb { color: var(--ink-3); font-size: 13px; white-space: nowrap; display: flex; align-items: center; gap: 5px; min-width: 0; flex: 0 1 auto; overflow: hidden; }
.crumb b { overflow: hidden; text-overflow: ellipsis; }
.ctx > :not(.crumb) { flex: none; }
.ctx { overflow-x: auto; scrollbar-width: none; }
.crumb a { color: var(--ink-3); } .crumb b { color: var(--ink); font-size: 15px; letter-spacing: -.01em; cursor: default; }
.crumb b.editable { cursor: pointer; } .crumb b.editable:hover { color: var(--accent); }
.gap { width: 1px; height: 18px; background: var(--hair-strong); margin: 0 6px; flex: none; }
.dd { position: relative; }
.menu { position: absolute; top: 36px; left: 0; min-width: 260px; max-width: 380px; background: var(--card); border: 1px solid var(--hair-strong); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; display: none; z-index: 40; max-height: 70vh; overflow: auto; }
.menu.open { display: block; }
.menu h4 { margin: 8px 10px 2px; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); font-weight: 600; }
.mi { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 8px; cursor: pointer; font-size: 13px; color: var(--ink); }
.mi:hover { background: var(--fill); text-decoration: none; }
.mi .t { flex: 1; min-width: 0; } .mi .t b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mi .t small { color: var(--ink-3); font-size: 12px; } .mi .ck { width: 14px; color: var(--accent); font-weight: 700; flex: none; }
.mi .ia { display: none; } .mi:hover .ia { display: flex; }
.mi .ia button { width: 24px; height: 24px; border: 0; background: none; border-radius: 6px; color: var(--ink-3); display: grid; place-items: center; }
.mi .ia button:hover { background: var(--fill-2); color: var(--ink); }
.mi.dim { color: var(--ink-3); cursor: default; }
.menu hr { border: 0; border-top: 1px solid var(--hair); margin: 6px 0; }
.banner { display: none; align-items: center; gap: 10px; padding: 7px 16px; background: color-mix(in srgb, var(--warn) 14%, var(--card)); border-top: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); font-size: 13px; }
.banner.show { display: flex; }

/* ---------- Corps ---------- */
#main { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.page { padding: 14px 16px 24px; overflow: auto; flex: 1; min-height: 0; }
.card { background: var(--card); border: 1px solid var(--hair); border-radius: 14px; box-shadow: var(--shadow); }
.layout { display: grid; grid-template-columns: 250px 1fr; gap: 12px; align-items: start; }
.tree { padding: 10px; position: sticky; top: 0; }
.tree h3 { margin: 4px 8px 8px; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); font-weight: 600; }
.fo { display: flex; align-items: center; gap: 7px; padding: 6px 8px; border-radius: 8px; color: var(--ink); font-size: 13.5px; cursor: pointer; white-space: nowrap; user-select: none; }
.fo:hover { background: var(--fill-2); }
.fo.on { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); font-weight: 600; }
.fo.drop { outline: 2px solid var(--accent); outline-offset: -2px; background: color-mix(in srgb, var(--accent) 10%, transparent); }
.fo .tg { color: var(--ink-3); font-size: 9px; width: 12px; text-align: center; flex: none; }
.fo .nm { overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; } .fo .n { color: var(--ink-3); font-size: 12px; font-weight: 400; }
.fo svg.i { color: var(--ink-3); } .fo.on svg.i { color: var(--accent); }
.main-card { padding: 16px 18px 8px; min-width: 0; }
.hd { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.hd h2 { font-size: 20px; letter-spacing: -.02em; } .hd .sub { color: var(--ink-3); }
.subs { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-bottom: 16px; }
.sf { display: flex; align-items: center; gap: 10px; border: 1px solid var(--hair); border-radius: 12px; padding: 10px 12px; background: var(--fill-2); cursor: pointer; min-width: 0; }
.sf:hover { background: var(--fill); } .sf.drop { outline: 2px solid var(--accent); }
.sf svg.i { color: var(--accent); width: 24px; height: 24px; } .sf b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .sf small { color: var(--ink-3); }
.sf .t { min-width: 0; flex: 1; }
table.list { border-collapse: collapse; width: 100%; }
table.list th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--hair-strong); white-space: nowrap; }
table.list td { padding: 0 10px; height: 50px; border-bottom: 1px solid var(--hair); white-space: nowrap; }
table.list tr.p:hover td { background: var(--fill-2); } table.list tr.p { cursor: pointer; }
table.list .r { text-align: right; }
.pn { display: flex; align-items: center; gap: 10px; font-weight: 600; } .pn svg.i { color: var(--accent); width: 22px; height: 22px; }
.pn small { display: block; font-weight: 400; color: var(--ink-3); font-size: 12px; }
.acts { opacity: 0; display: flex; justify-content: flex-end; } tr.p:hover .acts, tr.p:focus-within .acts { opacity: 1; }
.empty { text-align: center; color: var(--ink-3); padding: 36px 16px; }
.hint { padding: 10px 4px 12px; color: var(--ink-3); font-size: 12.5px; }
.search { display: flex; align-items: center; gap: 6px; background: var(--fill); border-radius: 9px; padding: 0 10px; height: 30px; width: 260px; color: var(--ink-3); }
.search input { border: 0; background: none; outline: none; width: 100%; height: 30px; padding: 0; box-shadow: none !important; }

/* ---------- Écran planning : tableau + Gantt ---------- */
.split-wrap { flex: 1; min-height: 0; margin: 12px 16px 0; background: var(--card); border: 1px solid var(--hair); border-radius: 14px; box-shadow: var(--shadow); display: grid; grid-template-columns: var(--tw, 660px) 6px 1fr; overflow: hidden; }
.split-wrap.ro { border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.splitter { background: var(--fill-2); cursor: col-resize; border-left: 1px solid var(--hair); border-right: 1px solid var(--hair); }
.splitter:hover, .splitter.drag { background: color-mix(in srgb, var(--accent) 30%, transparent); }
.pane { overflow: auto; position: relative; min-width: 0; outline: none; }
.sheet { border-collapse: collapse; width: 100%; font-size: 13px; table-layout: fixed; }
.sheet th { height: 56px; text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); font-weight: 600; padding: 0 8px; position: sticky; top: 0; background: var(--card); border-bottom: 1px solid var(--hair-strong); z-index: 5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet td { height: var(--row); padding: 0 8px; border-bottom: 1px solid var(--hair); white-space: nowrap; overflow: visible; position: relative; text-overflow: ellipsis; }
.sheet tr.sel td { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.sheet td.n { color: var(--ink-3); text-align: center; cursor: pointer; background: var(--side); user-select: none; padding: 0; }
.sheet tr.sel td.n { background: color-mix(in srgb, var(--accent) 22%, var(--side)); color: var(--ink); font-weight: 700; }
.sheet td.r, .sheet th.r { text-align: right; }
.sheet .prog { width: 44px; margin-right: 6px; }
.sheet td.ro { color: var(--ink-2); }
.sheet td.act-cell { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 4px; background: var(--card) !important; z-index: 2; }
.sheet tr.s td.nm { font-weight: 650; }
.sheet .cn { display: flex; align-items: center; gap: 6px; overflow: hidden; } .sheet .cn span.tx { overflow: hidden; text-overflow: ellipsis; }
.sheet .ch { color: var(--ink-3); font-size: 10px; width: 12px; flex: none; text-align: center; }
.sheet .ms { display: inline-block; width: 8px; height: 8px; background: var(--ink); transform: rotate(45deg); flex: none; margin: 0 2px; }
.sheet td.nm .cn.hide { visibility: hidden; }
.cell-input { position: absolute; left: 0; top: 0; width: 100%; min-width: 120px; height: var(--row); border: 2px solid var(--accent); border-radius: 4px; padding: 0 6px; background: var(--card); z-index: 6; box-shadow: none; }
.cell-input:focus { box-shadow: none; }
.gantt { position: relative; }
.ghd { position: sticky; top: 0; z-index: 5; background: var(--card); height: 56px; border-bottom: 1px solid var(--hair-strong); }
.grow { display: flex; height: 28px; } .grow.a { border-bottom: 1px solid var(--hair); }
.grow div { font-size: 11.5px; color: var(--ink-2); font-weight: 600; padding: 6px 6px; border-right: 1px solid var(--hair); white-space: nowrap; overflow: hidden; flex: none; }
.grow.b div { font-weight: 500; color: var(--ink-3); }
.gcols { position: absolute; left: 0; top: 56px; bottom: 0; }
.col { position: absolute; top: 0; bottom: 0; border-right: 1px solid var(--hair); }
.col.we { background: var(--we); } .col.fe { background: repeating-linear-gradient(135deg, var(--we), var(--we) 4px, transparent 4px, transparent 8px); }
.glines { position: absolute; left: 0; right: 0; top: 56px; }
.gl { height: var(--row); border-bottom: 1px solid var(--hair); }
.gl.sel { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.today { position: absolute; top: 56px; bottom: 0; width: 2px; background: #ff3b30; z-index: 3; }
.glbl { position: absolute; font-size: 11.5px; color: var(--ink-2); z-index: 2; white-space: nowrap; line-height: 20px; pointer-events: none; }
svg.dep { position: absolute; left: 0; top: 56px; pointer-events: none; z-index: 1; overflow: visible; }
.status { display: flex; gap: 18px; align-items: center; padding: 8px 20px; color: var(--ink-2); font-size: 12.5px; flex: none; flex-wrap: wrap; }
.status b { color: var(--ink); }

/* ---------- Paramètres ---------- */
.setrow { display: flex; align-items: center; gap: 12px; height: 46px; border-bottom: 1px solid var(--hair); }
.setrow .d { width: 160px; font-variant-numeric: tabular-nums; } .setrow .l { flex: 1; font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.setrow.off .l, .setrow.off .d { color: var(--ink-3); text-decoration: line-through; }
.sw { position: relative; width: 38px; height: 22px; border-radius: 999px; background: var(--fill); border: 0; flex: none; padding: 0; }
.sw:after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: .15s; }
.sw.on { background: var(--good); } .sw.on:after { left: 18px; }
.cols2 { display: grid; grid-template-columns: 1fr 300px; gap: 18px; align-items: start; }
.sidebox { background: var(--fill-2); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.sidebox h4 { margin: 0; font-size: 14px; }
.prefs { max-width: 520px; display: flex; flex-direction: column; gap: 14px; }

/* ---------- Fenêtres et notifications ---------- */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.38); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); z-index: 60; display: flex; align-items: flex-start; justify-content: center; padding: 8vh 16px; overflow-y: auto; }
.modal { background: var(--card); border-radius: 18px; box-shadow: 0 20px 60px rgba(0,0,0,.3); width: 100%; max-width: 480px; border: 1px solid var(--hair); }
.modal .mh { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 6px; } .modal .mh h2 { font-size: 17px; }
.modal .mb { padding: 6px 20px 14px; display: flex; flex-direction: column; gap: 12px; } .modal .mb p { margin: 0; color: var(--ink-2); font-size: 13.5px; }
.modal .mf { padding: 12px 20px 16px; display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--hair); flex-wrap: wrap; align-items: center; }
.recap { background: var(--fill-2); border-radius: 10px; padding: 10px 12px; font-size: 12.5px; color: var(--ink-2); }
.chk { display: flex; gap: 9px; align-items: flex-start; font-size: 13px; color: var(--ink); } .chk input { margin-top: 2px; flex: none; }
.toast { position: fixed; bottom: 40px; left: 50%; transform: translateX(-50%); background: #1d1d1f; color: #fff; padding: 9px 18px; border-radius: 999px; font-weight: 500; z-index: 100; box-shadow: 0 8px 28px rgba(0,0,0,.3); max-width: 90vw; text-align: center; }
.toast.err { background: #c9302c; }

@media (max-width: 900px) { .layout { grid-template-columns: 1fr; } .tree { position: static; } .cols2 { grid-template-columns: 1fr; } .split-wrap { grid-template-columns: 1fr; } .splitter { display: none; } }

/* ---------- Aides à la saisie : calendrier, liste de ressources ---------- */
.picker { position: fixed; z-index: 90; background: var(--card); border: 1px solid var(--hair-strong); border-radius: 12px; box-shadow: var(--shadow); padding: 8px; font-size: 13px; }
.cal { width: 252px; }
.cal-h { display: flex; align-items: center; justify-content: space-between; padding: 0 2px 6px; } .cal-h b { text-transform: capitalize; }
.cal-g { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-g .wd { text-align: center; font-size: 11px; color: var(--ink-3); padding: 3px 0; text-transform: uppercase; }
.cal-g .d { border: 0; background: none; height: 30px; border-radius: 8px; color: var(--ink); font: inherit; cursor: pointer; }
.cal-g .d:hover { background: var(--fill); }
.cal-g .d.out { color: var(--ink-3); opacity: .6; } .cal-g .d.we { color: var(--ink-2); }
.cal-g .d.fe { background: var(--we); text-decoration: underline dotted; }
.cal-g .d.now { box-shadow: inset 0 0 0 1.5px var(--accent); }
.cal-g .d.sel { background: var(--accent); color: #fff; font-weight: 600; opacity: 1; }
.cal-f { display: flex; justify-content: center; padding-top: 6px; }
.res { width: 270px; max-height: 300px; overflow: auto; padding: 6px; }
.opt { display: flex; align-items: center; gap: 9px; padding: 6px 8px; border-radius: 8px; cursor: pointer; }
.opt:hover, .opt.hi { background: var(--fill); }
.opt.none { color: var(--ink-3); cursor: default; }
.opt .cb { width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--hair-strong); display: grid; place-items: center; font-size: 12px; color: transparent; flex: none; }
.opt .cb.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.opt.add .cb { border-style: dashed; color: var(--accent); }
.opt .tx { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opt-hint { padding: 6px 8px 2px; font-size: 11.5px; color: var(--ink-3); }
.sheet .ch[data-toggle] { cursor: pointer; border-radius: 4px; }
.sheet .ch[data-toggle]:hover { background: var(--fill); color: var(--ink); }
.ctxmenu { position: fixed; z-index: 95; top: auto; left: auto; min-width: 230px; }
.ctxmenu .mi svg.i { color: var(--ink-3); } .ctxmenu .mi.danger { color: var(--bad-text); } .ctxmenu .mi.danger svg.i { color: var(--bad-text); }
.ctxmenu .mi.off { opacity: .4; pointer-events: none; }

/* ---------- Teintes des phases (12 couleurs) ---------- */
.c-blue { --c: #0a84ff; } .c-green { --c: #30c04f; } .c-orange { --c: #ff9f0a; } .c-purple { --c: #af52de; } .c-pink { --c: #ff375f; } .c-teal { --c: #2bb5c9; }
.c-yellow { --c: #f2c200; } .c-grey { --c: #8e8e93; } .c-indigo { --c: #5e5ce6; } .c-lime { --c: #8cc63f; } .c-brown { --c: #a2845e; } .c-red { --c: #e5383b; }

/* Tableau : bande de couleur à gauche, ligne de phase de 1er niveau plus haute et teintée */
.sheet td.n { box-shadow: inset 5px 0 0 var(--c, transparent); }
.sheet tr.g td { font-weight: 700; height: var(--row0); background: color-mix(in srgb, var(--c) var(--tint), var(--card)); }
.sheet tr.g td.n { background: color-mix(in srgb, var(--c) calc(var(--tint) * 1.6), var(--side)); color: var(--ink); }
.sheet tr.g td.nm { font-size: 13.5px; }
.sheet tr.g.sel td { background: color-mix(in srgb, var(--accent) 16%, var(--card)); }
.sheet .ms { background: var(--c, var(--ink)); }
.sheet .prog i { background: var(--c, var(--accent)); }

/* Gantt : phases (barre épaisse avec pointes et curseur d'avancement), tâches, jalons */
.gl.g { background: color-mix(in srgb, var(--c) calc(var(--tint) * .6), transparent); }
.bar-g { position: absolute; height: 16px; border-radius: 5px 5px 3px 3px; background: var(--c); z-index: 2; box-shadow: 0 1px 2px rgba(0,0,0,.25); cursor: context-menu; }
.bar-g:before, .bar-g:after { content: ""; position: absolute; bottom: -5px; width: 8px; height: 8px; background: var(--c); clip-path: polygon(0 0, 100% 0, 0 100%); }
.bar-g:before { left: 0; } .bar-g:after { right: 0; transform: scaleX(-1); }
.bar-g .pt { position: absolute; left: 6px; right: 6px; top: 6.5px; height: 3px; border-radius: 2px; background: rgba(255,255,255,.34); }
.bar-g .pt i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 2px; background: #fff; box-shadow: 0 0 0 .5px rgba(0,0,0,.12); }
.bar-t { position: absolute; height: 15px; border-radius: 5px; background: color-mix(in srgb, var(--c) 30%, var(--card)); border: 1px solid color-mix(in srgb, var(--c) 70%, transparent); overflow: hidden; z-index: 2; }
.bar-t i { display: block; height: 100%; background: var(--c); }
.dm { position: absolute; width: 15px; height: 15px; background: var(--c); transform: rotate(45deg); border-radius: 2px; z-index: 2; box-shadow: 0 0 0 2px var(--card); }
.glbl.g { font-weight: 700; color: var(--ink); font-size: 12.5px; }
.rem { color: var(--ink-3); margin-right: 8px; }
.pc { font-weight: 700; color: var(--ink); margin: 0 4px 0 2px; }
.today:before { content: none; }

/* Choix de la couleur d'une phase, options du Gantt, infobulle de détails */
.cpop { position: fixed; z-index: 90; width: 262px; background: var(--card); border: 1px solid var(--hair-strong); border-radius: 14px; box-shadow: 0 12px 40px rgba(0,0,0,.28); padding: 12px; }
.cpop h4 { margin: 0 0 2px; font-size: 13px; } .cpop p { margin: 0 0 10px; font-size: 12px; color: var(--ink-3); }
.swatches { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 10px; }
.swatches button { height: 34px; border: 0; border-radius: 9px; background: var(--c); position: relative; color: #fff; font-weight: 700; }
.swatches button:hover { transform: scale(1.06); }
.swatches button.on:after { content: "✓"; position: absolute; inset: 0; display: grid; place-items: center; }
.swatches .c-yellow.on:after, .swatches .c-lime.on:after { color: #1d1d1f; }
.opts { position: fixed; z-index: 90; width: 300px; background: var(--card); border: 1px solid var(--hair-strong); border-radius: 14px; box-shadow: 0 12px 40px rgba(0,0,0,.28); padding: 8px; }
.opts h4 { margin: 6px 8px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); font-weight: 600; }
.opts label { display: flex; align-items: flex-start; gap: 10px; padding: 8px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.opts label:hover { background: var(--fill); } .opts label small { display: block; color: var(--ink-3); font-size: 12px; }
.opts input { width: 17px; height: 17px; margin-top: 1px; accent-color: var(--accent); flex: none; padding: 0; }
.tipc { position: fixed; z-index: 95; pointer-events: none; min-width: 210px; max-width: 280px; background: var(--card); border: 1px solid var(--hair-strong); border-radius: 12px; box-shadow: 0 10px 32px rgba(0,0,0,.28); padding: 10px 13px; font-size: 12.5px; color: var(--ink-2); }
.tipc b { display: flex; align-items: center; gap: 7px; color: var(--ink); font-size: 13px; margin-bottom: 5px; } .tipc b i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); flex: none; }
.tipc .l { display: flex; justify-content: space-between; gap: 14px; padding: 1.5px 0; } .tipc .l span:last-child { color: var(--ink); font-weight: 500; text-align: right; }
.tipc .pr { height: 5px; border-radius: 3px; background: var(--fill); margin: 5px 0 4px; overflow: hidden; } .tipc .pr i { display: block; height: 100%; background: var(--c); }
