/* ═══════════════════════════════════════════════════════════════════════
   TimeShift 8×3 — Styles globaux
   Extrait fidèlement de la maquette v1.2 (17/03/2026)
   ═══════════════════════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&family=JetBrains+Mono:wght@400;600&display=swap');

/* ─── Variables ─────────────────────────────────────────────────────── */
:root {
    --navy:   #1F3864;
    --blue:   #2E75B6;
    --gold:   #FFD966;
    --bg:     #F4F6FB;
    --border: #E8EEF7;
}

/* ─── Reset ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--bg);
    color: #1a1a2e;
    display: flex;
    height: 100vh;
    overflow: hidden;
    font-size: 13px;
}

/* ─── Sidebar ────────────────────────────────────────────────────────── */
#sidebar {
    width: 260px;
    background: var(--navy);
    display: flex;
    flex-direction: column;
    height: 100vh;
    flex-shrink: 0;
    overflow-y: auto;
    transition: width .25s ease;
    position: relative;
}
#sidebar.collapsed { width: 52px; overflow: hidden; }
#sidebar.collapsed .logo-name,
#sidebar.collapsed .logo-sub,
#sidebar.collapsed .sfooter,
#sidebar.collapsed #snav { opacity: 0; pointer-events: none; }
#sidebar.collapsed .logo { padding: 14px 10px; }

#sb-toggle {
    position: absolute; top: 50%; right: -14px;
    transform: translateY(-50%);
    width: 28px; height: 28px;
    background: var(--navy);
    border: 2px solid rgba(255,255,255,.15);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; z-index: 100; color: white; font-size: 12px;
    transition: transform .25s ease;
}
#sb-toggle:hover { background: #1F3864; }
#sidebar.collapsed #sb-toggle { transform: translateY(-50%) rotate(180deg); }

.logo { padding: 16px 18px 12px; border-bottom: 1px solid rgba(255,255,255,.08); }
.logo-name { font-family: 'JetBrains Mono', monospace; font-size: 15px; font-weight: 600; color: white; }
.logo-sub  { font-size: 10px; color: #9EAFCC; margin-top: 2px; }

#snav { flex: 1; padding: 10px 0; }
.nsec { padding: 6px 18px 4px; font-size: 9px; font-weight: 700; color: #4A6080; letter-spacing: 1.5px; text-transform: uppercase; margin-top: 6px; }

.ni {
    display: flex; align-items: center; gap: 8px;
    padding: 7px 18px;
    cursor: pointer; color: #C5D3E8; font-size: 12px;
    transition: all .15s; user-select: none;
    border-left: 3px solid transparent;
    text-decoration: none;
}
.ni:hover { background: rgba(255,255,255,.06); color: white; }
.ni.act   { background: rgba(46,117,182,.3); color: white; border-left-color: var(--gold); }
.ni.act .nic { color: var(--gold); }

.ni.s1 { padding-left: 10px; font-size: 11px; color: #9EAFCC; border-left: 3px solid #00BCD4; margin-left: 8px; border-radius: 0 4px 4px 0; }
.ni.s1:hover { color: white; background: rgba(0,188,212,.12); }
.ni.s1.act { border-left-color: #00BCD4; background: rgba(0,188,212,.2); color: white; }

.ni.s2 { padding-left: 10px; font-size: 11px; color: #8899BB; border-left: 3px solid #4CAF50; margin-left: 24px; border-radius: 0 4px 4px 0; }
.ni.s2:hover { color: #C5D3E8; background: rgba(76,175,80,.1); }
.ni.s2.act { border-left-color: #4CAF50; background: rgba(76,175,80,.18); color: white; }

.ni.s3 { display: flex; align-items: center; gap: 8px; padding: 5px 10px; cursor: pointer; color: #6A80A0; font-size: 10px; transition: all .15s; user-select: none; border-left: 3px solid #FF9800; margin-left: 40px; border-radius: 0 4px 4px 0; }
.ni.s3:hover { color: #C5D3E8; background: rgba(255,152,0,.1); }
.ni.s3.act  { border-left-color: #FF9800; background: rgba(255,152,0,.18); color: white; }

.nic  { font-size: 13px; width: 16px; text-align: center; flex-shrink: 0; }
.ntog { margin-left: auto; font-size: 10px; color: #4A6080; transition: transform .2s; flex-shrink: 0; }
.ntog.open { transform: rotate(90deg); }
.nch { display: none; }
.nch.open { display: block; }

.sfooter { padding: 12px 18px; border-top: 1px solid rgba(255,255,255,.08); }
.sfooter .un { font-size: 11px; color: #C5D3E8; font-weight: 500; }
.sfooter .ur { font-size: 10px; color: #6A80A0; }

/* ─── Main layout ────────────────────────────────────────────────────── */
#main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

#topbar {
    height: 52px; background: white;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; padding: 0 24px; gap: 12px;
    flex-shrink: 0;
    box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
#bc { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #8899BB; flex: 1; }
#bc span { color: #1F3864; font-weight: 600; }
#bc .sep  { color: #C5D3E8; }
#tbr { display: flex; align-items: center; gap: 10px; }

#content { flex: 1; overflow-y: auto; padding: 24px; }

/* ─── Badges ─────────────────────────────────────────────────────────── */
.tbadge { background: #EEF2FF; color: #2E75B6; border: 1px solid #C5D3E8; border-radius: 20px; padding: 3px 10px; font-size: 11px; font-weight: 600; }
.tbadge.al { background: #FFF3E0; color: #C55A11; border-color: #F0C070; }

.b  { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 20px; font-size: 10px; font-weight: 700; }
.bg { background: #E8F5E9; color: #175944; border: 1px solid #A5D6A7; }
.bb { background: #E3F2FD; color: #1565C0; border: 1px solid #90CAF9; }
.bo { background: #FFF3E0; color: #E65100; border: 1px solid #FFCC80; }
.bx { background: #F5F5F5; color: #616161; border: 1px solid #E0E0E0; }
.bn { background: #E8EEF7; color: #1F3864; border: 1px solid #9EAFCC; }

/* ─── Buttons ────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 14px;
    border-radius: 6px; font-size: 12px; font-weight: 600;
    cursor: pointer; border: none;
    transition: all .15s;
    font-family: 'DM Sans', sans-serif;
}
.bp  { background: #2E75B6; color: white; }
.bp:hover { background: #1F5A9A; }
.bsm { padding: 4px 10px; font-size: 11px; }
.bo2 { background: white; color: #2E75B6; border: 1px solid #2E75B6; }
.bo2:hover { background: #EEF4FF; }
.bgh { background: transparent; color: #8899BB; border: 1px solid #E0E8F4; }
.bgh:hover { background: #F4F6FB; }
.btn-excel {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 4px 10px; background: #1A6B45; color: #FFF;
    border: none; border-radius: 6px; font-size: 11px; font-weight: 600;
    cursor: pointer; font-family: 'DM Sans', sans-serif;
    transition: background .15s, box-shadow .15s, transform .1s;
    box-shadow: 0 1px 3px rgba(26,107,69,.22);
}
.btn-excel:hover { background: #155838; transform: translateY(-1px); }
.btn-excel:active { transform: translateY(0); }
.lb { color: #2E75B6; cursor: pointer; font-weight: 600; font-size: 12px; background: none; border: none; font-family: 'DM Sans', sans-serif; }
.lb:hover { text-decoration: underline; }

/* ─── Cards ──────────────────────────────────────────────────────────── */
.card { background: white; border-radius: 10px; border: 1px solid var(--border); box-shadow: 0 2px 8px rgba(0,0,0,.04); }
.ch   { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.ct   { font-size: 13px; font-weight: 700; color: #1F3864; }
.cb   { padding: 18px; }

/* ─── KPI grid ───────────────────────────────────────────────────────── */
.kgrid { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-bottom: 20px; }
.kc { background: white; border-radius: 10px; border: 1px solid var(--border); padding: 16px 18px; box-shadow: 0 2px 8px rgba(0,0,0,.04); }
.kv { font-size: 28px; font-weight: 700; color: #1F3864; line-height: 1; }
.kv.g { color: #175944; } .kv.o { color: #C55A11; } .kv.r { color: #C00000; }
.kl { font-size: 11px; color: #8899BB; margin-top: 4px; }
.kt { font-size: 10px; color: #9EAFCC; margin-top: 6px; }

/* ─── Tables ──────────────────────────────────────────────────────────── */
.dt { width: 100%; border-collapse: collapse; }
.dt th { background: #F4F6FB; color: #4A6080; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; padding: 8px 12px; text-align: left; border-bottom: 2px solid var(--border); }
.dt td { padding: 10px 12px; border-bottom: 1px solid #F0F2F8; font-size: 12px; color: #333; vertical-align: middle; }
.dt tr:hover td { background: #F8FAFF; }
.dt tr:last-child td { border-bottom: none; }

/* ─── Forms ──────────────────────────────────────────────────────────── */
.fg   { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.fgr  { display: flex; flex-direction: column; gap: 4px; }
.fgr.full { grid-column: 1/-1; }
.fl   { font-size: 11px; font-weight: 700; color: #4A6080; text-transform: uppercase; letter-spacing: .5px; }
.fi, .fs {
    padding: 8px 12px; border: 1.5px solid #E0E8F4; border-radius: 6px;
    font-size: 13px; color: #1F3864; background: white; outline: none;
    transition: border .15s; font-family: 'DM Sans', sans-serif; width: 100%;
}
.fi:focus, .fs:focus { border-color: #2E75B6; box-shadow: 0 0 0 3px rgba(46,117,182,.1); }
.fi[readonly] { background: #F4F6FB; color: #8899BB; }
.fh { font-size: 10px; color: #9EAFCC; margin-top: 2px; }
.fe { font-size: 10px; color: #C00000; margin-top: 2px; display: none; }
.fi.err { border-color: #C00000; }

/* ─── Page titles ────────────────────────────────────────────────────── */
.ptitle { font-size: 20px; font-weight: 700; color: #1F3864; margin-bottom: 4px; }
.psub   { font-size: 12px; color: #8899BB; margin-bottom: 20px; }

/* ─── Site header gradient ───────────────────────────────────────────── */
.sh2 { background: linear-gradient(135deg, #1F3864, #2E75B6); color: white; border-radius: 12px; padding: 24px 28px; margin-bottom: 20px; display: flex; align-items: center; gap: 20px; }
.si  { width: 60px; height: 60px; background: rgba(255,255,255,.15); border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 28px; flex-shrink: 0; }
.sn2 { font-size: 22px; font-weight: 700; }
.sm2 { font-size: 12px; color: rgba(255,255,255,.7); margin-top: 4px; }
.ss  { margin-left: auto; display: flex; gap: 20px; }
.sv2 { text-align: center; }
.sv2 .v { font-size: 22px; font-weight: 700; color: var(--gold); }
.sv2 .l { font-size: 10px; color: rgba(255,255,255,.6); }

/* ─── Affectation grid ───────────────────────────────────────────────── */
.ag  { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.ar  { display: grid; grid-template-columns: 50px minmax(280px,1fr) repeat(7,80px); align-items: center; border-bottom: 1px solid #F0F2F8; min-height: 44px; }
.ar:last-child { border-bottom: none; }
.ar.hd { background: #1F3864; color: white; }
.aw    { padding: 10px 14px; font-size: 12px; font-weight: 700; }
.ach   { padding: 6px 14px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tchip { display: inline-flex; align-items: center; gap: 4px; background: #E8EEF7; color: #1F3864; border-radius: 20px; padding: 3px 10px; font-size: 11px; font-weight: 600; }
.cr    { color: #9EAFCC; cursor: pointer; font-size: 14px; margin-left: 2px; line-height: 1;
         background: none; border: none; padding: 0; font-family: inherit; }
.cr:hover { color: #C00000; }
.sh3  { padding: 4px 6px; text-align: center; }
.sh3-day-hd { font-size: 10px; color: #9EAFCC; font-weight: 700; text-align: center; padding: 6px; }

/* ─── Cycle grid ─────────────────────────────────────────────────────── */
.cwrap { overflow-x: auto; background: white; border-radius: 0 0 8px 8px; box-shadow: 0 4px 12px rgba(0,0,0,.06); }

table.cg { width: 100%; border-collapse: collapse; min-width: 1100px; font-size: 11px; }
table.cg thead th { background: #1F3864; color: white; padding: 7px 5px; font-size: 10px; text-align: center; border: 1px solid #2E75B6; white-space: nowrap; }
table.cg thead th.cn { text-align: left; padding-left: 8px; min-width: 130px; }
table.cg thead th.csum { background: #162952; min-width: 55px; }

.slab  { background: #1F3864 !important; color: white !important; font-size: 10px; width: 52px; white-space: pre-line; line-height: 1.6; font-weight: 700; text-align: center; border: 1px solid #2E75B6 !important; vertical-align: middle; }
.sstat { text-align: center; vertical-align: middle; border: 1px solid #C5D3E8 !important; background: #F8F9FC !important; padding: 5px 4px !important; width: 115px; }

.rd td { background: #E8EEF7; color: #1F3864; font-size: 10px; font-weight: 700; padding: 4px 3px; text-align: center; border: 1px solid #C5D3E8; }
.rd td.tn { text-align: left; padding-left: 8px; }
.rd td.ts { background: #162952; color: #9EAFCC; }

.rt td { padding: 4px 3px; font-size: 11px; border: 1px solid #EEE; text-align: center; vertical-align: middle; background: white; }
.rt td.cn { text-align: left; padding-left: 8px; font-weight: 700; color: #1F3864; background: #F8F9FC; white-space: nowrap; }
.rt td.sv { background: #F5F7FA; font-size: 10px; }
.rt td.dw { background: #E8F5E9; color: #175944; font-weight: 700; }
.rt:hover td { background: #F0F4FF !important; }

.rc td { background: #1F3864; color: white; border: 1px solid #2E75B6; padding: 4px 3px; text-align: center; font-size: 11px; }
.rc td.cl { text-align: left; padding-left: 8px; color: #FFD966; font-size: 10px; font-weight: 700; white-space: nowrap; }
.rc td.cs { background: #162952; }

.rsep td { height: 4px; background: #D0D8EC; border: none; padding: 0; }

/* ─── Shift badges ───────────────────────────────────────────────────── */
.sh   { display: inline-block; border-radius: 3px; padding: 2px 4px; font-size: 10px; font-weight: 700; white-space: nowrap; }
.nuit { background: #1A237E; color: white; }
.mat  { background: #1B5E20; color: white; }
.apr  { background: #E65100; color: white; }
.jour { background: #4A148C; color: white; }
.mat2 { background: #006064; color: white; }
.apr2 { background: #880E4F; color: white; }
.rep  { background: #BDBDBD; color: white; }

/* ─── Semaine validation ─────────────────────────────────────────────── */
.sv-ok { display: inline-flex; align-items: center; gap: 3px; background: #E8F5E9; color: #175944; border: 1px solid #175944; border-radius: 10px; padding: 2px 7px; font-size: 10px; font-weight: 700; }
.sv-en { display: inline-flex; align-items: center; gap: 3px; background: #FFF3E0; color: #C55A11; border: 1px solid #C55A11; border-radius: 10px; padding: 2px 7px; font-size: 10px; font-weight: 700; }
.sv-at { display: inline-flex; align-items: center; gap: 3px; background: #E8EEF7; color: #1F3864; border: 1px solid #9EAFCC; border-radius: 10px; padding: 2px 7px; font-size: 10px; }

.bval { background: #2E75B6; color: white; border: none; border-radius: 5px; padding: 3px 7px; font-size: 10px; font-weight: 700; cursor: pointer; display: block; margin: 4px auto 0; width: 95%; font-family: 'DM Sans', sans-serif; }
.bval:hover { background: #1F5A9A; }
.bdis { background: #E0E0E0; color: #9E9E9E; border: none; border-radius: 5px; padding: 3px 7px; font-size: 10px; display: block; margin: 4px auto 0; width: 95%; cursor: not-allowed; }

/* ─── KPI bar (haut de grille) ───────────────────────────────────────── */
.kbar { display: flex; gap: 10px; padding: 8px 16px; background: #162952; border-radius: 8px 8px 0 0; flex-wrap: wrap; }
.kbc  { background: rgba(255,255,255,.08); border-radius: 6px; padding: 6px 14px; text-align: center; min-width: 90px; }
.kbc .v { font-size: 16px; font-weight: 700; color: #FFD966; }
.kbc .l { font-size: 9px; color: #9EAFCC; margin-top: 1px; }

.rotbar { background: #FFF8E1; border-left: 3px solid #FFD966; padding: 5px 14px; font-size: 11px; color: #5D4037; margin-bottom: 6px; }
.legbar { display: flex; gap: 10px; flex-wrap: wrap; padding: 10px 16px; background: #F5F5F5; border-top: 1px solid #E0E0E0; align-items: center; border-radius: 0 0 8px 8px; }
.leg    { display: flex; align-items: center; gap: 4px; font-size: 10px; color: #595959; }

/* ─── Jours fériés ───────────────────────────────────────────────────── */
td.cell-jf { border: 2px solid #FFD700 !important; position: relative; }
.jf-badge  { position: absolute; top: 1px; right: 2px; font-size: 7px; font-weight: 800; color: #B8860B; background: #FFF8DC; border-radius: 3px; padding: 0 2px; line-height: 1.4; }
th.th-jf   { background: #7B6000 !important; color: #FFD700 !important; position: relative; }
th.th-jf::after { content: 'JF'; font-size: 8px; font-weight: 800; color: #FFD700; display: block; margin-top: 1px; }
td.th-jf   { background: #7B6000 !important; color: #FFD700 !important; }

/* ─── Absences cellules ──────────────────────────────────────────────── */
td.cell-abs  { background: #FFEBEE !important; cursor: pointer; position: relative; }
td.cell-abs span.sh { background: #C62828 !important; color: white !important; text-decoration: line-through; opacity: .7; }
td.cell-remp { background: #E8F5E9 !important; cursor: pointer; }
td.cell-remp span.sh { background: #2E7D32 !important; color: white !important; }
td.cell-click { cursor: pointer; }
td.cell-click:hover { background: #EEF4FF !important; }

/* ─── Formations et Réunions (ISO maquette) ─────────────────────────── */
td.cell-form        { background: #F3E5F5; cursor: pointer; }
td.cell-form-nc     { background: #F3E5F5; cursor: default; }
td.cell-reunion     { background: #E0F7FA; cursor: pointer; }
td.cell-reunion-nc  { background: #E0F7FA; cursor: default; }
td.cell-solidarite  { background: #FFF3E0; cursor: pointer; }
td.cell-solidarite:hover { background: #FFE0B2 !important; }
td.cell-rep-click   { cursor: pointer; transition: background .15s; }
td.cell-rep-click:hover { background: #F3E5F5 !important; }
td.cell-jf.cell-form       { border: 2px solid #FFD700 !important; }
td.cell-jf.cell-reunion    { border: 2px solid #FFD700 !important; }
td.cell-jf.cell-solidarite { border: 2px solid #FFD700 !important; }

.abs-pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: 12px; font-size: 10px; font-weight: 700; }
.ap-mal   { background: #FFEBEE; color: #C62828; border: 1px solid #EF9A9A; }
.ap-cng   { background: #FFF3E0; color: #E65100; border: 1px solid #FFCC80; }
.ap-at    { background: #FCE4EC; color: #AD1457; border: 1px solid #F48FB1; }
.ap-for   { background: #E3F2FD; color: #1565C0; border: 1px solid #90CAF9; }
.ap-aut   { background: #F3E5F5; color: #6A1B9A; border: 1px solid #CE93D8; }
.ap-dep   { background: #FBE9E7; color: #BF360C; border: 1px solid #FFAB91; }
.ap-frm   { background: #E8F5E9; color: #175944; border: 1px solid #A5D6A7; }
.hist-row-abs td  { background: #FFF8F8; }
.hist-row-remp td { background: #F8FFF8; }

/* ─── Règles R1/R2/R3 ─────────────────────────────────────────────────── */
.rule-ok    { color: #175944; font-size: 11px; font-weight: 600; }
.rule-warn  { color: #C55A11; font-size: 11px; font-weight: 600; }
.rule-block { color: #C00000; font-size: 11px; font-weight: 600; }

.remp-card { border: 1.5px solid var(--border); border-radius: 8px; padding: 10px 14px; margin-bottom: 8px; cursor: pointer; transition: all .15s; display: flex; align-items: center; gap: 12px; }
.remp-card:hover { border-color: #2E75B6; background: #F0F6FF; }
.remp-card.blocked { opacity: .5; cursor: not-allowed; background: #F9F9F9; }
.remp-card .rc-name  { font-weight: 700; color: #1F3864; font-size: 12px; }
.remp-card .rc-shift { font-size: 11px; color: #8899BB; }
.remp-card .rc-rule  { font-size: 10px; margin-top: 2px; }

/* ─── Navigation semaine ─────────────────────────────────────────────── */
.wnav { display: flex; align-items: center; background: white; border: 1.5px solid #D0D8EC; border-radius: 12px; padding: 8px 16px; margin-bottom: 14px; justify-content: space-between; }
.wnav-arrow { width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid #C8D8F0; background: white; color: #1F3864; font-size: 16px; cursor: pointer; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: background .15s; }
.wnav-arrow:hover:not(:disabled) { background: #EEF2FF; }
.wnav-arrow:disabled { opacity: .25; cursor: default; }
.wnav-center { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 1; }
.wnav-label  { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 700; color: #1F3864; }
.wnav-dots   { display: flex; gap: 6px; align-items: center; }
.wnav-dot    { width: 22px; height: 5px; border-radius: 3px; cursor: pointer; transition: all .15s; }
.wnav-dot.ok  { background: #4CAF50; }
.wnav-dot.en  { background: #FFC107; }
.wnav-dot.at  { background: #D0D8EC; }
.wnav-dot.cur { outline: 2px solid #1F3864; outline-offset: 2px; }

/* ─── Onglets ────────────────────────────────────────────────────────── */
.tabs { display: flex; gap: 0; margin-bottom: 10px; border-bottom: 2px solid var(--border); flex-wrap: nowrap; align-items: flex-end; }
.tab  { padding: 5px 14px; font-size: 11px; font-weight: 600; cursor: pointer; color: #8899BB; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all .15s; }
.tab:hover { color: #1F3864; }
.tab.on    { color: #2E75B6; border-bottom-color: #2E75B6; }
.tab .tc   { display: inline-flex; align-items: center; justify-content: center; background: #E8EEF7; color: #1F3864; border-radius: 10px; padding: 1px 6px; font-size: 10px; margin-left: 5px; }
.tab.on .tc { background: #2E75B6; color: white; }

/* ─── Filter bar ─────────────────────────────────────────────────────── */
.fbar       { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 16px; background: white; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 14px; }
.fbar-label { font-size: 11px; font-weight: 700; color: #4A6080; text-transform: uppercase; letter-spacing: .5px; white-space: nowrap; }
.fchip      { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; cursor: pointer; border: 1.5px solid #E0E8F4; background: white; color: #8899BB; transition: all .15s; }
.fchip:hover   { border-color: #2E75B6; color: #2E75B6; }
.fchip.sel     { background: #1F3864; color: white; border-color: #1F3864; }
.fchip.sel-all { background: #2E75B6; color: white; border-color: #2E75B6; }
.fsep { width: 1px; height: 20px; background: #E0E8F4; margin: 0 4px; }

/* ─── Alertes ────────────────────────────────────────────────────────── */
.al  { display: flex; flex-direction: column; gap: 8px; }
.ai  { display: flex; align-items: flex-start; gap: 10px; padding: 10px 14px; border-radius: 8px; border: 1px solid; font-size: 12px; }
.ai.er { background: #FFEBEE; border-color: #EF9A9A; color: #B71C1C; }
.ai.wa { background: #FFF8E1; border-color: #FFD54F; color: #5D4037; }
.ai.in { background: #E3F2FD; border-color: #90CAF9; color: #0D47A1; }

/* ─── Modal ──────────────────────────────────────────────────────────── */
.mbg   { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 100; display: flex; align-items: center; justify-content: center; animation: fi .15s; }
.modal { background: white; border-radius: 12px; padding: 24px; width: 560px; max-width: 95vw; box-shadow: 0 20px 60px rgba(0,0,0,.2); }
.mt    { font-size: 16px; font-weight: 700; color: #1F3864; margin-bottom: 4px; }
.ms    { font-size: 12px; color: #8899BB; margin-bottom: 18px; }
.ma    { display: flex; gap: 10px; margin-top: 20px; }

/* ─── Toast ──────────────────────────────────────────────────────────── */
.toast { position: fixed; bottom: 24px; right: 24px; background: #1F3864; color: white; padding: 12px 18px; border-radius: 8px; font-size: 13px; font-weight: 600; z-index: 200; box-shadow: 0 8px 24px rgba(0,0,0,.2); animation: su .3s ease; display: flex; align-items: center; gap: 8px; }
@keyframes su { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }

/* ─── Divers ─────────────────────────────────────────────────────────── */
.mono  { font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 700; color: #2E75B6; }
.empty { text-align: center; padding: 40px; color: #9EAFCC; font-size: 13px; }
.empty .ei { font-size: 36px; margin-bottom: 12px; }

.sbadge { background: #E8EEF7; color: #1F3864; border: 1px solid #9EAFCC; border-radius: 4px; padding: 1px 4px; font-size: 9px; font-weight: 700; margin-left: 4px; }

.tip { position: relative; display: inline-block; }
.tip .tiptext { visibility: hidden; opacity: 0; background: #1F3864; color: #fff; font-size: 11px; font-weight: 500; padding: 5px 9px; border-radius: 7px; white-space: nowrap; position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); z-index: 99; pointer-events: none; transition: opacity .1s ease; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.tip .tiptext::after { content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); border: 5px solid transparent; border-top-color: #1F3864; }
.tip:hover .tiptext { visibility: visible; opacity: 1; }

@keyframes fi { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ─── Login ──────────────────────────────────────────────────────────── */
.login-wrap { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--bg); }
.login-card { background: white; border-radius: 16px; padding: 40px; width: 380px; box-shadow: 0 8px 32px rgba(0,0,0,.1); }
.login-logo { font-family: 'JetBrains Mono', monospace; font-size: 20px; font-weight: 700; color: var(--navy); margin-bottom: 4px; }
.login-sub  { font-size: 12px; color: #8899BB; margin-bottom: 28px; }
.login-err  { background: #FFEBEE; color: #C62828; border: 1px solid #EF9A9A; border-radius: 8px; padding: 10px 14px; font-size: 12px; margin-bottom: 16px; }

/* ─── Bilan table ────────────────────────────────────────────────────── */
.bilan-row.seuil-orange td { background: #FFF8F0 !important; }
.bilan-row.seuil-rouge  td { background: #FFF0F0 !important; }
.bilan-seuil-badge { display: inline-block; padding: 2px 8px; border-radius: 12px; font-size: 10px; font-weight: 700; }
.bilan-seuil-badge.normal  { background: #E8F5E9; color: #175944; }
.bilan-seuil-badge.orange  { background: #FFF3E0; color: #E65100; }
.bilan-seuil-badge.rouge   { background: #FFEBEE; color: #C62828; }

/* ── View toggle (ISO maquette lignes 198-200) ─────────────────────────── */
.view-toggle { display: flex; align-items: center; gap: 8px; padding: 8px 0 10px; }
.vbtn { padding: 4px 14px; font-size: 11px; font-weight: 600; border-radius: 20px; border: 1.5px solid #C8D8F0; background: white; color: #8899BB; cursor: pointer; transition: all .15s; user-select: none; }
.vbtn.on { background: #1F3864; color: white; border-color: #1F3864; }

/* ── Modal overlay (P2 — ISO maquette) ───────────────────────────────────── */
.modal-overlay { position:fixed;inset:0;background:rgba(0,0,0,.45);z-index:1000;display:flex;align-items:center;justify-content:center; }
.modal-box     { background:white;border-radius:12px;padding:24px 28px;min-width:340px;max-width:560px;box-shadow:0 8px 32px rgba(0,0,0,.18); }

/* ── Dropdown Actions ⚙ (FT-19 — ISO maquette lignes 126-135) ──────────── */
.act-menu { position: relative; display: inline-block; }
.act-menu-btn { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; border-radius: 8px; transition: background .15s; }
.act-menu-btn:hover { background: #E8EDF5; }
.btn.bp.act-menu-btn:hover { background: #0D2B4E; color: #fff; }
.act-dropdown { display: none; position: absolute; right: 0; top: calc(100% + 6px); background: white; border: 1px solid #D0D8EC; border-radius: 12px; box-shadow: 0 8px 24px rgba(31,56,100,.15); z-index: 200; min-width: 100%; width: max-content; overflow: hidden; animation: fdrop .12s ease; }
@keyframes fdrop { from { opacity: 0; transform: translateY(-6px) } to { opacity: 1; transform: translateY(0) } }
.act-dropdown.open { display: block; }
.act-item { display: flex; align-items: center; gap: 10px; padding: 10px 16px; font-size: 12px; font-weight: 600; cursor: pointer; color: #1F3864; white-space: nowrap; border: none; background: none; width: 100%; text-align: left; transition: background .1s; }
.act-item:hover { background: #F0F4FA; }
.act-item.danger { color: #C62828; }
.act-item.danger:hover { background: #FFF0F0; }
.act-item.purple { color: #6A1B9A; }
.act-item.purple:hover { background: #F5EEFF; }
.act-sep { height: 1px; background: #E8EDF5; margin: 2px 0; }
