/* NORTHSTAR STAFF — application équipe (mobile d'abord). Thème sombre par défaut, clair via [data-theme=light]. */
:root {
  --bg: #f5f5f7; --surface: #fff; --surface2: #f2f2f5; --ink: #111114; --mute: #5f5f66; --dim: #8e8e93;
  --line: rgba(0,0,0,.07); --line2: rgba(0,0,0,.13); --glass: rgba(255,255,255,.85);
  --pri: #0071e3; --pri-ink: #fff; --ok: #34c759; --warn: #ff9500; --bad: #ff3b30;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif; --serif: 'Cormorant Garamond', serif;
  --r: 22px;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { background: var(--bg); color: var(--ink); font: 400 15px/1.45 var(--sans); -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
.muted { color: var(--mute); }
.kicker { font-size: 11px; font-weight: 600; letter-spacing: .28em; text-transform: uppercase; color: var(--dim); }
.ico { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.top-logo { filter: invert(1); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 20px; border-radius: 99px; border: 0; background: var(--surface2); box-shadow: inset 0 0 0 1px var(--line2); font-size: 15px; font-weight: 600; cursor: pointer; transition: transform .15s, background .2s; }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--pri); color: var(--pri-ink); box-shadow: none; }
.btn-ok { background: var(--ok); color: #04150b; box-shadow: none; }
.btn-lg { height: 54px; font-size: 16px; width: 100%; }
.btn-sm { height: 36px; padding: 0 14px; font-size: 13.5px; }
.f { display: flex; flex-direction: column; gap: 6px; }
.f > span { font-size: 12.5px; font-weight: 500; color: var(--mute); }
.f input, .f textarea { height: 50px; border-radius: 14px; border: 0; background: var(--surface2); box-shadow: inset 0 0 0 1px var(--line); padding: 0 15px; font-size: 16px; outline: 0; color-scheme: light; }
:root[data-theme=light] .f input, :root[data-theme=light] .f textarea { color-scheme: light; }
.f textarea { height: auto; min-height: 80px; padding: 12px 15px; resize: vertical; }
.f input:focus, .f textarea:focus { box-shadow: inset 0 0 0 1.5px var(--ink); }
.err { color: var(--bad); font-size: 14px; min-height: 20px; }

/* Connexion : photo plein cadre, rubans de lumière, carte en verre */
.login { position: fixed; inset: 0; overflow: hidden; background: #000; color: #f5f5f7; display: grid; place-items: center; padding: 24px; }
.lg-bg { position: absolute; inset: 0; }
.lg-bg img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 45%; filter: brightness(.42) saturate(.8) contrast(1.05); transform: scale(1.1); animation: lgkb 26s ease-out forwards; }
@keyframes lgkb { to { transform: scale(1); } }
.lg-bg::after { content: ''; position: absolute; inset: 0; background: radial-gradient(70% 60% at 50% 55%, transparent, rgba(0,0,0,.75)), linear-gradient(180deg, rgba(0,0,0,.55), transparent 35%, rgba(0,0,0,.7)); }
.lg-silk { position: absolute; inset: 0; width: 100%; height: 100%; mix-blend-mode: screen; opacity: .8; }
.lg-top { position: absolute; top: calc(22px + env(safe-area-inset-top)); left: 26px; right: 26px; display: flex; justify-content: space-between; align-items: center; z-index: 2; }
.lg-top img { height: 22px; width: auto; filter: none !important; }
.lg-top span { font-size: 13px; color: rgba(255,255,255,.7); letter-spacing: .02em; text-transform: capitalize; }
.lg-card { position: relative; z-index: 2; width: min(400px, 100%); padding: 34px 28px 26px; border-radius: 30px; background: linear-gradient(160deg, rgba(255,255,255,.12), rgba(255,255,255,.04)); backdrop-filter: blur(26px) saturate(150%); -webkit-backdrop-filter: blur(26px) saturate(150%); box-shadow: inset 0 0 0 1px rgba(255,255,255,.16), 0 40px 100px -30px rgba(0,0,0,.9); display: flex; flex-direction: column; gap: 12px; animation: lgin .9s cubic-bezier(.2,.8,.2,1) both .15s; }
@keyframes lgin { from { opacity: 0; transform: translateY(24px) scale(.98); } }
.lg-star { width: 42px; margin: -4px 0 6px; animation: lgtw 3.6s ease-in-out infinite; }
@keyframes lgtw { 50% { opacity: .55; transform: scale(.86) rotate(10deg); } }
.lg-card .kicker { color: rgba(255,255,255,.6); }
.lg-card h1 { font-size: 34px; font-weight: 600; letter-spacing: -.045em; line-height: 1.05; margin: 2px 0 12px; }
.lg-card h1 em { font-family: var(--serif); font-weight: 400; font-size: 1.1em; letter-spacing: -.02em; background: linear-gradient(100deg, #8e8e8e, #f7f7f5 35%, #b4b4b2 55%, #fff 75%, #8a8a8a); background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: lgsh 10s linear infinite; }
@keyframes lgsh { to { background-position: -220% 0; } }
.lg-f { position: relative; display: flex; align-items: center; height: 54px; border-radius: 16px; background: rgba(0,0,0,.35); box-shadow: inset 0 0 0 1px rgba(255,255,255,.14); transition: box-shadow .25s, background .25s; }
.lg-f:focus-within { box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.85); background: rgba(0,0,0,.5); }
.lg-f .ico { width: 19px; height: 19px; margin: 0 4px 0 16px; color: rgba(255,255,255,.55); }
.lg-f input { flex: 1; min-width: 0; height: 100%; background: none; border: 0; outline: 0; padding: 0 12px 0 8px; font-size: 16px; color: #fff; }
.lg-f input::placeholder { color: rgba(255,255,255,.45); }
.lg-eye { border: 0; background: none; color: rgba(255,255,255,.6); font-size: 12.5px; font-weight: 600; padding: 0 16px; cursor: pointer; height: 100%; }
.lg-eye:hover { color: #fff; }
.lg-btn { height: 54px; margin-top: 6px; border-radius: 99px; border: 0; background: #f5f5f7; color: #000; font-size: 16px; font-weight: 600; cursor: pointer; transition: transform .15s, box-shadow .3s; }
.lg-btn:hover { box-shadow: 0 0 0 6px rgba(255,255,255,.08), 0 12px 40px rgba(255,255,255,.2); }
.lg-btn:active { transform: scale(.98); }
.lg-card .err { color: #ff9a9a; text-align: center; min-height: 18px; }
.lg-help { font-size: 12.5px; color: rgba(255,255,255,.5); text-align: center; line-height: 1.5; }
@media (max-width: 600px) { .lg-card { padding: 28px 20px 22px; border-radius: 26px; } .lg-card h1 { font-size: 30px; } .lg-top span { display: none; } }

/* App */
.app { min-height: 100svh; padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; padding: calc(12px + env(safe-area-inset-top)) 18px 12px; background: var(--glass); backdrop-filter: saturate(160%) blur(20px); -webkit-backdrop-filter: saturate(160%) blur(20px); border-bottom: 1px solid var(--line); }
.top-logo { height: 18px; width: auto; }
.me-chip { display: flex; align-items: center; gap: 8px; border: 0; background: none; cursor: pointer; font-weight: 500; font-size: 14px; }
.av { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 12px; color: #111; background: var(--a, #ddd); flex: none; }
.view { max-width: 760px; margin: 0 auto; padding: 18px 16px; }
.h1 { font-size: 30px; font-weight: 700; letter-spacing: -.045em; line-height: 1.1; }
.h1 em { font-family: var(--serif); font-weight: 400; color: var(--mute); }
.sub { color: var(--mute); margin-top: 4px; }
.sec-t { display: flex; justify-content: space-between; align-items: baseline; margin: 26px 2px 10px; }
.sec-t h2 { font-size: 18px; font-weight: 700; letter-spacing: -.03em; }
.sec-t small { color: var(--dim); }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; }
.stat { border-radius: 18px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); padding: 14px; }
.stat b { display: block; font-size: 26px; font-weight: 700; letter-spacing: -.04em; }
.stat span { font-size: 12px; color: var(--mute); }

/* Cartes d'opération */
.op { position: relative; display: block; width: 100%; text-align: left; border: 0; cursor: pointer; border-radius: var(--r); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); padding: 16px 16px 16px 20px; margin-bottom: 10px; overflow: hidden; transition: transform .15s; }
.op:active { transform: scale(.99); }
.op::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--c); }
.op.big { padding: 22px 20px 20px 24px; background: radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--c) 22%, transparent), var(--surface) 60%); }
.op-type { display: flex; align-items: center; gap: 8px; font-size: 11.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--c); }
.op h3 { font-size: 18px; font-weight: 700; letter-spacing: -.03em; margin-top: 6px; }
.op.big h3 { font-size: 24px; }
.op p { color: var(--mute); font-size: 14px; margin-top: 3px; }
.op .row { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.prog { height: 6px; border-radius: 6px; background: var(--line2); overflow: hidden; flex: 1; min-width: 120px; }
.prog i { display: block; height: 100%; background: var(--c); border-radius: 6px; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 99px; font-size: 12px; font-weight: 600; background: color-mix(in srgb, var(--c, #888) 15%, transparent); color: var(--c, var(--mute)); }
.empty { text-align: center; padding: 50px 20px; color: var(--dim); }
.empty b { display: block; color: var(--ink); font-size: 17px; margin-bottom: 4px; }

/* Semaine */
.week-nav { display: flex; align-items: center; justify-content: space-between; margin: 14px 0 6px; }
.week-nav b { font-size: 15px; }
.dayh { display: flex; align-items: baseline; gap: 8px; margin: 18px 4px 8px; font-weight: 700; text-transform: capitalize; }
.dayh small { color: var(--dim); font-weight: 500; }
.dayh.today { color: var(--ok); }

/* Heures */
.bars { display: flex; align-items: flex-end; gap: 8px; height: 150px; padding: 16px; border-radius: var(--r); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.bars div { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bars i { width: 100%; max-width: 34px; border-radius: 8px 8px 3px 3px; background: linear-gradient(180deg, var(--ink), color-mix(in srgb, var(--ink) 35%, transparent)); min-height: 3px; }
.bars div.cur i { background: linear-gradient(180deg, var(--ok), color-mix(in srgb, var(--ok) 35%, transparent)); }
.bars small { font-size: 10.5px; color: var(--dim); }
.bars em { font-style: normal; font-size: 11px; font-weight: 600; }
.list { border-radius: var(--r); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.list .li { display: flex; justify-content: space-between; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--line); align-items: center; }
.list .li:last-child { border-bottom: 0; }
.list .li b { font-weight: 600; }
.list .li small { display: block; color: var(--dim); font-size: 12.5px; }

/* Fiche opération (panneau) */
.sheet { position: fixed; inset: 0; z-index: 50; }
.sheet-bg { position: absolute; inset: 0; background: rgba(0,0,0,.55); animation: fade .25s; }
.sheet-in { position: absolute; left: 0; right: 0; bottom: 0; max-height: 94svh; overflow-y: auto; background: var(--bg); border-radius: 28px 28px 0 0; padding: 10px 18px calc(30px + env(safe-area-inset-bottom)); animation: up .35s cubic-bezier(.2,.8,.2,1); box-shadow: 0 -20px 60px rgba(0,0,0,.4); }
@media (min-width: 800px) { .sheet-in { left: 50%; right: auto; width: 640px; transform: translateX(-50%); bottom: 20px; border-radius: 28px; max-height: calc(100svh - 40px); animation: pop .35s cubic-bezier(.2,.8,.2,1); } }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(40px); opacity: .5; } }
@keyframes pop { from { transform: translate(-50%, 30px); opacity: 0; } }
.grab { width: 40px; height: 5px; border-radius: 5px; background: var(--line2); margin: 0 auto 14px; }
.sh-head { position: relative; border-radius: var(--r); padding: 20px; background: radial-gradient(130% 150% at 100% 0%, color-mix(in srgb, var(--c) 28%, transparent), var(--surface) 65%); box-shadow: inset 0 0 0 1px var(--line); }
.sh-head h2 { font-size: 26px; font-weight: 700; letter-spacing: -.04em; margin-top: 6px; line-height: 1.1; }
.sh-head .route { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-weight: 600; }
.sh-head .route i { flex: 1; height: 2px; border-radius: 2px; background: linear-gradient(90deg, var(--c), color-mix(in srgb, var(--c) 20%, transparent)); }
.sh-close { position: absolute; right: 12px; top: 12px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--line2); cursor: pointer; font-size: 20px; line-height: 1; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 9px 12px; margin-top: 16px; font-size: 14.5px; }
.kv dt { color: var(--dim); }
.acts { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.plate { font: 700 12px ui-monospace, monospace; letter-spacing: .06em; padding: 3px 8px; border-radius: 6px; background: #f2f2f0; color: #111; }

.steps { list-style: none; margin-top: 8px; }
.step { position: relative; padding: 0 0 20px 40px; }
.step::before { content: ''; position: absolute; left: 13px; top: 30px; bottom: 0; width: 2px; background: var(--line2); }
.step:last-child::before { display: none; }
.step.done::before { background: var(--ok); }
.dot { position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; box-shadow: inset 0 0 0 2px var(--line2); background: var(--bg); font-size: 13px; font-weight: 700; color: var(--dim); }
.step.done .dot { background: var(--ok); box-shadow: none; color: #04150b; }
.step.next .dot { box-shadow: inset 0 0 0 2px var(--ink); color: var(--ink); }
.step h4 { font-size: 16px; font-weight: 600; padding-top: 3px; }
.step .meta { color: var(--dim); font-size: 13px; margin-top: 2px; }
.step .note { margin-top: 6px; font-size: 14px; color: var(--mute); }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.thumbs img { width: 76px; height: 76px; object-fit: cover; border-radius: 12px; cursor: zoom-in; }
.thumbs .add { width: 76px; height: 76px; border-radius: 12px; border: 1.5px dashed var(--line2); display: grid; place-items: center; color: var(--mute); cursor: pointer; background: none; font-size: 12px; text-align: center; padding: 6px; }
.validate { margin-top: 12px; padding: 14px; border-radius: 18px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line2); display: grid; gap: 12px; }

.tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.tag { height: 28px; padding: 0 12px; border-radius: 99px; display: inline-flex; align-items: center; font-size: 12.5px; font-weight: 600; background: var(--surface2); box-shadow: inset 0 0 0 1px var(--line); }

/* Barre d'onglets */
.tabbar { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 30; display: flex; padding: 6px; border-radius: 26px; background: var(--glass); backdrop-filter: saturate(170%) blur(22px); -webkit-backdrop-filter: saturate(170%) blur(22px); box-shadow: inset 0 0 0 1px var(--line2), 0 20px 50px rgba(0,0,0,.35); max-width: 560px; margin: 0 auto; }
.tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; border: 0; background: none; padding: 8px 0 6px; border-radius: 20px; color: var(--dim); font-size: 11px; font-weight: 600; cursor: pointer; }
.tabbar button.on { color: var(--ink); background: var(--line); }

.zoom { position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,.92); display: grid; place-items: center; padding: 20px; }
.zoom img { max-width: 100%; max-height: 100%; border-radius: 14px; }
.toast { position: fixed; left: 50%; bottom: calc(110px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); background: var(--pri); color: var(--pri-ink); padding: 12px 20px; border-radius: 99px; font-size: 14px; font-weight: 600; opacity: 0; transition: .3s; pointer-events: none; z-index: 90; white-space: nowrap; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: sp .7s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }
.login { grid-template-columns: minmax(0, 400px); justify-content: center; }
.lg-card { width: 100%; }
.lg-top span { text-transform: none; }

/* ===== v5 : blanc, accent bleu ===== */
.op, .stat, .list, .bars, .sh-head { box-shadow: inset 0 0 0 1px var(--line), 0 1px 2px rgba(0,0,0,.03), 0 10px 26px -18px rgba(0,0,0,.18); }
.op.big { background: #fff; }
.btn-ok { background: var(--ok); color: #fff; }
.step.done .dot { color: #fff; }
.bars i { background: linear-gradient(180deg, #0071e3, rgba(0,113,227,.35)); }
.tabbar button.on { color: #0071e3; background: rgba(0,113,227,.08); }
/* connexion : carte blanche sur photo */
.lg-card { background: #fff; color: #111114; backdrop-filter: none; box-shadow: 0 40px 100px -30px rgba(0,0,0,.6); }
.lg-card .kicker { color: #8e8e93; }
.lg-card h1 { color: #111114; }
.lg-card h1 em { background: none; -webkit-text-fill-color: #6e6e73; color: #6e6e73; animation: none; }
.lg-star { filter: invert(1); opacity: .8; }
.lg-f { background: #f5f5f7; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.lg-f:focus-within { background: #fff; box-shadow: inset 0 0 0 1.5px #0071e3, 0 0 0 4px rgba(0,113,227,.12); }
.lg-f .ico { color: #8e8e93; }
.lg-f input { color: #111; } .lg-f input::placeholder { color: #8e8e93; }
.lg-eye { color: #0071e3; } .lg-eye:hover { color: #0058b0; }
.lg-btn { background: #0071e3; color: #fff; }
.lg-btn:hover { background: #0077ed; box-shadow: 0 0 0 5px rgba(0,113,227,.18); }
.lg-help { color: #8e8e93; } .lg-card .err { color: #ff3b30; }
/* accueil planning */
.hero-op { border-radius: 26px; padding: 22px; background: #fff; box-shadow: inset 0 0 0 1px var(--line), 0 18px 40px -26px rgba(0,0,0,.3); position: relative; overflow: hidden; cursor: pointer; }
.hero-op::before { content: ''; position: absolute; left: 0; top: 0; right: 0; height: 5px; background: var(--c); }
.hero-op .lbl { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--c); }
.hero-op .lbl i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 18%, transparent); animation: pulse 1.8s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--c) 0%, transparent); } }
.hero-op h2 { font-size: 26px; font-weight: 700; letter-spacing: -.04em; margin-top: 8px; }
.hero-op .rt { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-weight: 600; }
.hero-op .rt i { flex: 1; height: 2px; border-radius: 2px; background: linear-gradient(90deg, var(--c), color-mix(in srgb, var(--c) 15%, transparent)); }
.hero-op .when { margin-top: 12px; font-size: 14px; color: var(--mute); }
.hero-op .when b { color: var(--ink); }
.hero-op .cta { margin-top: 16px; display: flex; gap: 8px; }
.days { display: flex; gap: 6px; overflow-x: auto; padding: 4px 2px 8px; scrollbar-width: none; }
.days::-webkit-scrollbar { display: none; }
.days button { flex: 1 0 46px; min-width: 46px; border: 0; border-radius: 16px; padding: 9px 0 8px; background: #fff; box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--mute); }
.days button b { font-size: 17px; color: var(--ink); font-weight: 700; }
.days button small { font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; }
.days button .dots { display: flex; gap: 3px; height: 6px; }
.days button .dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--c); }
.days button.on { background: #0071e3; box-shadow: none; color: rgba(255,255,255,.8); }
.days button.on b { color: #fff; } .days button.on .dots i { background: #fff; }
.days button.today:not(.on) b { color: #0071e3; }
/* documents */
.docl { display: grid; gap: 10px; }
.doc { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 18px; background: #fff; box-shadow: inset 0 0 0 1px var(--line); }
.doc .ic { width: 40px; height: 48px; border-radius: 8px; display: grid; place-items: center; font-size: 10.5px; font-weight: 800; color: #fff; background: #ff3b30; flex: none; }
.doc .ic.contrat { background: #0071e3; } .doc .ic.autre { background: #8e8e93; }
.doc b { display: block; font-weight: 600; font-size: 15px; } .doc small { color: var(--dim); font-size: 12.5px; }
.doc a { margin-left: auto; }
