:root {
  --navy:#102538; --navy-2:#18364e; --accent:#137c8b; --accent-dark:#0f6673;
  --ink:#172432; --muted:#687985; --line:#dce4e8; --line-strong:#cbd6dc;
  --surface:#fff; --background:#f4f6f8; --danger:#b33d48; --warn:#8a6308;
  --ok:#237354; --blue:#26749b; --radius:10px; --shadow:0 1px 2px rgba(16,37,56,.04),0 8px 24px rgba(16,37,56,.045);
}

* { box-sizing:border-box; }
html { background:var(--background); }
body { color:var(--ink); background:var(--background); -webkit-font-smoothing:antialiased; }
a,button,input,select,textarea { transition:border-color .15s ease,background-color .15s ease,color .15s ease,box-shadow .15s ease; }
h1,h2,h3 { letter-spacing:-.028em; }
.muted { color:var(--muted); }
svg { display:block; }

/* Connexion */
.login-page { display:block; min-height:100vh; padding:0; background:#edf1f3; }
.login-shell { display:grid; grid-template-columns:minmax(420px,.9fr) minmax(520px,1.1fr); width:min(1120px,calc(100% - 56px)); min-height:650px; margin:34px auto; overflow:hidden; border:1px solid #d8e1e5; border-radius:18px; background:white; box-shadow:0 24px 65px rgba(16,37,56,.12); }
.login-visual { position:relative; overflow:hidden; padding:48px; color:white; background:var(--navy); }
.login-visual::before { position:absolute; inset:auto -210px -260px auto; width:560px; height:560px; border:1px solid rgba(255,255,255,.1); border-radius:50%; content:""; }
.login-visual::after { position:absolute; inset:auto -105px -150px auto; width:360px; height:360px; border:70px solid rgba(19,124,139,.2); border-radius:50%; content:""; }
.login-visual-content { position:relative; z-index:1; display:flex; flex-direction:column; height:100%; }
.brand-large { color:white; }
.brand-large .brand-mark { width:40px; height:40px; border:1px solid rgba(255,255,255,.2); border-radius:9px; background:rgba(255,255,255,.08); }
.brand-large > span:last-child { display:grid; gap:1px; }
.brand-large strong { font-size:19px; }
.brand-large small { color:#aebfca; font-size:11px; font-weight:500; }
.login-copy { margin:auto 0; }
.eyebrow,.section-kicker { display:block; margin-bottom:6px; color:var(--accent); font-size:10px; font-weight:800; letter-spacing:.11em; text-transform:uppercase; }
.eyebrow.light { color:#70c5cd; }
.login-copy h2 { margin:0 0 18px; color:white; font-size:43px; line-height:1.08; letter-spacing:-.045em; }
.login-copy p { max-width:440px; color:#c1cdd5; font-size:15px; line-height:1.65; }
.login-features { display:grid; gap:10px; color:#cfdae0; font-size:12px; }
.login-features span { display:flex; align-items:center; gap:9px; }
.login-features span::before { display:grid; width:19px; height:19px; place-items:center; border-radius:50%; background:rgba(19,124,139,.35); color:#aee4e7; content:"✓"; font-size:10px; font-weight:900; }
.login-card { align-self:center; width:min(440px,calc(100% - 72px)); margin:auto; padding:38px 0; border:0; border-radius:0; box-shadow:none; }
.login-card h1 { margin:4px 0 7px; color:var(--navy); font-size:34px; }
.login-card > .muted { margin:0 0 30px; font-size:14px; }
.login-card .field { margin-bottom:18px; }
.login-card .field input { min-height:48px; }
.login-submit { justify-content:space-between; width:100%; min-height:48px; margin-top:2px; }
.login-submit span { font-size:18px; }
.login-security { margin:22px 0 0; color:#86949c; font-size:11px; text-align:center; }
.login-mobile-brand { display:none; }

/* Cadre logiciel */
.shell { grid-template-columns:248px minmax(0,1fr); }
.sidebar { position:sticky; top:0; display:flex; flex-direction:column; height:100vh; padding:20px 14px 15px; background:var(--navy); color:white; }
.sidebar-brand { gap:11px; padding:2px 8px 20px; border-bottom:1px solid rgba(255,255,255,.09); color:white; }
.sidebar-brand:hover { color:white; }
.brand-symbol { display:grid; width:36px; height:36px; flex:0 0 36px; place-items:center; border-radius:9px; background:var(--accent); box-shadow:inset 0 1px rgba(255,255,255,.18); }
.brand-symbol svg { width:20px; height:20px; fill:white; }
.sidebar-brand > span:last-child { display:grid; gap:0; }
.sidebar-brand strong { font-size:18px; letter-spacing:-.02em; }
.sidebar-brand small { color:#93a6b3; font-size:9px; font-weight:600; letter-spacing:.035em; text-transform:uppercase; }
.nav-label { margin:21px 11px 7px; color:#718a9b; font-size:9px; font-weight:850; letter-spacing:.14em; text-transform:uppercase; }
.nav-label-secondary { margin-top:19px; }
.nav { display:grid; gap:3px; margin:0; }
.nav a { display:flex; align-items:center; gap:11px; min-height:42px; padding:9px 11px; border:1px solid transparent; border-radius:8px; color:#bac8d1; font-size:13px; font-weight:650; }
.nav a:hover { background:rgba(255,255,255,.055); color:white; }
.nav a.active { border-color:rgba(90,196,205,.12); background:rgba(19,124,139,.22); color:white; box-shadow:inset 3px 0 #42b3bd; }
.nav-icon { display:grid; width:20px; height:20px; flex:0 0 20px; place-items:center; color:#8198a7; }
.nav-icon svg { width:18px; height:18px; fill:currentColor; }
.nav a.active .nav-icon { color:#72cbd2; }
.sidebar-bottom { display:grid; gap:11px; margin-top:auto; }
.sidebar-status { display:flex; align-items:center; gap:9px; padding:10px 11px; border:1px solid rgba(255,255,255,.08); border-radius:8px; background:rgba(0,0,0,.08); }
.sidebar-status > span:last-child { display:grid; gap:1px; }
.sidebar-status strong { color:#dce6eb; font-size:11px; }
.sidebar-status small { color:#8298a6; font-size:9px; }
.status-dot { width:7px; height:7px; flex:0 0 7px; border-radius:50%; background:#4fc393; box-shadow:0 0 0 3px rgba(79,195,147,.12); }
.app-version { color:#567083; font-size:8px; font-weight:750; letter-spacing:.12em; text-align:center; }
.sidebar-backdrop { display:none; }
.sidebar-footer { display:none; }

.main { min-width:0; background:var(--background); }
.topbar { position:sticky; z-index:4; top:0; display:flex; align-items:center; justify-content:space-between; height:64px; padding:0 28px; border-bottom:1px solid var(--line); background:rgba(255,255,255,.96); backdrop-filter:blur(10px); }
.topbar-left,.topbar-user { display:flex; align-items:center; gap:10px; }
.topbar-context { display:grid; gap:1px; }
.topbar-context span { color:#87959d; font-size:9px; font-weight:750; letter-spacing:.08em; text-transform:uppercase; }
.topbar-context strong { color:#273743; font-size:13px; }
.user-card { display:flex; align-items:center; gap:9px; padding:5px 8px 5px 5px; border-radius:8px; color:var(--ink); }
.user-card:hover { background:#f1f4f6; color:var(--ink); }
.user-avatar { display:grid; width:34px; height:34px; place-items:center; border-radius:8px; background:#e5eff2; color:var(--accent-dark); font-size:11px; font-weight:850; }
.user-card > span:last-child { display:grid; gap:0; }
.user-card strong { font-size:12px; }
.user-card small { color:#7d8b94; font-size:9px; }
.icon-control { display:grid; width:36px; height:36px; padding:0; place-items:center; border:1px solid var(--line); border-radius:8px; background:white; color:#526570; cursor:pointer; }
.icon-control:hover { border-color:#aebdc5; background:#f7f9fa; color:var(--navy); }
.icon-control svg { width:18px; height:18px; fill:currentColor; }
.logout-btn:hover { border-color:#e3bdc1; background:#fff5f5; color:var(--danger); }
.mobile-menu { display:none; }
.content { max-width:1460px; padding:30px 34px 60px; }

/* Éléments métier */
.page-head,.workspace-head { display:flex; align-items:flex-start; justify-content:space-between; gap:22px; margin-bottom:22px; }
.page-head h1,.workspace-head h1 { margin:0 0 5px; color:var(--navy); font-size:28px; line-height:1.15; }
.page-head p,.workspace-head p { margin:0; color:var(--muted); font-size:13px; }
.workspace-head { align-items:flex-end; }
.card { border:1px solid var(--line); border-radius:var(--radius); background:white; box-shadow:var(--shadow); }
.btn { min-height:40px; padding:9px 14px; border:1px solid var(--navy); border-radius:8px; background:var(--navy); color:white; font-size:12px; font-weight:750; box-shadow:none; }
.btn:hover { border-color:var(--navy-2); background:var(--navy-2); color:white; transform:none; }
.btn.secondary { border-color:var(--line-strong); background:white; color:#304450; }
.btn.secondary:hover { border-color:#9fb1ba; background:#f8fafb; color:var(--navy); }
.btn.small { min-height:32px; padding:6px 10px; font-size:11px; }
.btn svg { width:16px; height:16px; fill:currentColor; }
.actions { gap:8px; }
.field { gap:6px; margin-bottom:15px; }
.field label { color:#3a4b56; font-size:11px; font-weight:750; }
.field input,.field select,.field textarea { border-color:var(--line-strong); border-radius:7px; background:#fff; font-size:13px; }
.field input:hover,.field select:hover,.field textarea:hover { border-color:#aab9c1; }
.field input:focus,.field select:focus,.field textarea:focus { outline:0; border-color:var(--accent); box-shadow:0 0 0 3px rgba(19,124,139,.11); }
.choice { min-height:42px; border-color:var(--line); border-radius:7px; background:#fafbfc; font-size:12px; }
.choice:hover { border-color:#8ebec3; background:#f2f9f9; }
.choice-section legend { color:var(--navy); font-size:14px; }
.flash { border-radius:8px; box-shadow:none; }
.table th,.table td { padding:12px 10px; border-color:#e7ecef; }
.table th { color:#7b8991; font-size:9px; font-weight:850; letter-spacing:.065em; }
.table tbody tr:hover { background:#f8fafb; }
.table td { color:#334650; font-size:12px; }
.table td a { color:#176879; }
.badge { padding:5px 8px; font-size:9px; letter-spacing:.04em; text-transform:uppercase; }
.empty { border-radius:9px; background:#fafbfc; }
.note { padding:11px 13px; border-left-color:var(--accent); border-radius:0 7px 7px 0; background:#f4f9fa; }

/* Tableau de bord */
.metrics-bar { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); margin-bottom:18px; overflow:hidden; border:1px solid var(--line); border-radius:10px; background:white; box-shadow:var(--shadow); }
.metric { display:grid; grid-template-columns:40px 1fr auto; align-items:center; gap:11px; min-height:92px; padding:17px 18px; border-right:1px solid var(--line); color:var(--ink); }
.metric:last-child { border-right:0; }
.metric:hover { background:#f9fbfb; color:var(--ink); }
.metric-icon { display:grid; width:38px; height:38px; place-items:center; border-radius:8px; }
.metric-icon svg,.action-icon svg { width:19px; height:19px; fill:currentColor; }
.metric > span:nth-child(2) { display:grid; gap:2px; }
.metric small { color:#74838c; font-size:10px; }
.metric strong { color:var(--navy); font-size:23px; line-height:1; }
.metric b { color:#9babb3; font-size:18px; font-weight:400; }
.blue { background:#e6f1f5; color:#266f8f; }
.amber { background:#fff4dc; color:#8c640b; }
.green { background:#e8f4ed; color:#287255; }
.violet { background:#f0ecf7; color:#715c9d; }
.dashboard-layout { display:grid; grid-template-columns:minmax(0,1.55fr) minmax(330px,.75fr); gap:18px; }
.work-panel { min-width:0; padding:20px; }
.panel-head { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:15px; }
.panel-head h2 { margin:0; color:var(--navy); font-size:18px; }
.panel-head .section-kicker { margin-bottom:3px; }
.text-link { color:var(--accent-dark); font-size:11px; font-weight:750; }
.text-link span { padding-left:3px; }
.activity-table td small { display:block; margin-top:2px; color:#8b989f; font-size:9px; }
.activity-table th:last-child,.activity-table td:last-child { width:36px; text-align:right; }
.row-open { display:grid; width:28px; height:28px; place-items:center; border:1px solid var(--line); border-radius:6px; color:#647782!important; }
.row-open:hover { border-color:#a8bbc3; background:white; color:var(--accent-dark)!important; }
.empty-state { display:grid; min-height:220px; place-items:center; align-content:center; color:var(--muted); text-align:center; }
.empty-state-icon { display:grid; width:38px; height:38px; margin-bottom:9px; place-items:center; border-radius:50%; background:#e9f5ef; color:var(--ok); }
.empty-state-icon svg { width:20px; height:20px; fill:currentColor; }
.empty-state strong { color:#344751; font-size:13px; }
.empty-state p { margin:4px 0 0; font-size:11px; }
.shortcut-panel { display:flex; flex-direction:column; }
.software-actions { display:grid; gap:6px; }
.software-actions > a { display:grid; grid-template-columns:38px 1fr auto; align-items:center; gap:11px; padding:10px; border:1px solid transparent; border-radius:8px; color:var(--ink); }
.software-actions > a:hover { border-color:var(--line); background:#f8fafb; color:var(--ink); }
.action-icon { display:grid; width:36px; height:36px; place-items:center; border-radius:8px; }
.software-actions > a > span:nth-child(2) { display:grid; gap:2px; }
.software-actions strong { font-size:11px; }
.software-actions small { color:#7d8b93; font-size:9px; line-height:1.3; }
.software-actions b { color:#9cabb3; font-size:15px; }
.privacy-reminder { display:flex; align-items:center; gap:10px; margin-top:auto; padding:12px; border-top:1px solid var(--line); color:#657680; }
.privacy-reminder > svg { width:20px; height:20px; flex:0 0 20px; fill:#78909c; }
.privacy-reminder > span { display:grid; gap:1px; }
.privacy-reminder strong { color:#455862; font-size:10px; }
.privacy-reminder small { font-size:9px; }

/* Planning */
.planning-child-picker { padding:16px 18px; }
.timetable-card,.timetable-editor-card { border:1px solid var(--line); box-shadow:var(--shadow); }
.timetable-title h2 { font-size:19px; }
.planning-toolbar { padding:8px; border:1px solid var(--line); border-radius:8px; background:#f7f9fa; }
.planning-save { z-index:3; padding:10px; border:1px solid var(--line); border-radius:9px; background:rgba(255,255,255,.97); box-shadow:0 7px 24px rgba(16,37,56,.09); }
.signature-grid > div { border-color:#aebdc5; background:#fbfcfd; }
.icon-btn { border-radius:6px; }

/* Connexion neutre */
.login-page { background:#f2f4f5; }
.neutral-login { display:grid; width:min(420px,calc(100% - 32px)); min-height:100vh; margin:0 auto; place-content:center; }
.neutral-login-brand { display:flex; align-items:center; gap:11px; margin:0 auto 22px; color:var(--navy); }
.neutral-login-brand > span:last-child { display:grid; gap:1px; }
.neutral-login-brand strong { font-size:17px; }
.neutral-login-brand small { color:#74838b; font-size:9px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; }
.neutral-login-card { width:100%; padding:30px; border:1px solid #d7e0e4; border-radius:10px; background:white; box-shadow:0 8px 30px rgba(16,37,56,.07); }
.neutral-login-card h1 { margin:0 0 5px; color:var(--navy); font-size:24px; }
.neutral-login-card > p { margin:0 0 25px; color:var(--muted); font-size:13px; }
.neutral-login-card .field { margin-bottom:16px; }
.neutral-login-card input { min-height:46px; }
.neutral-login-submit { width:100%; min-height:44px; margin-top:2px; }
.neutral-login-note { margin:16px 0 0; color:#849199; font-size:9px; text-align:center; }

/* Planning daté */
.timetable-title { display:flex; align-items:center; justify-content:space-between; gap:20px; text-align:left; }
.planning-period { display:grid; min-width:165px; gap:2px; padding:9px 12px; border:1px solid var(--line); border-radius:8px; background:#f7f9fa; text-align:right; }
.planning-period strong { color:var(--navy); font-size:12px; }
.planning-period span { color:var(--accent-dark); font-size:10px; font-weight:800; letter-spacing:.05em; text-transform:uppercase; }
.planning-period-editor { display:flex; align-items:center; justify-content:flex-start; gap:16px; margin:-1px 0 12px; text-align:left; }
.planning-settings .field small { color:var(--muted); font-size:9px; }
.planning-day-name,.planning-day-date { display:block; }
.planning-day-date,.planning-column-date { margin-top:3px; color:#416678; font-size:10px; font-weight:750; letter-spacing:.02em; text-transform:none; }
.timetable-editor thead .planning-column-date { position:absolute; top:4px; left:8px; margin:0; }
.timetable-editor thead th:not(:first-child) { padding-top:19px; }

/* Fiche d'incident structurée */
.incident-form { padding:0 22px 20px; }
.form-section { padding:22px 0 5px; border-top:1px solid var(--line); }
.form-section.first { border-top:0; }
.form-section-head { display:flex; align-items:flex-start; gap:10px; margin-bottom:18px; }
.form-section-head > span { display:grid; width:24px; height:24px; flex:0 0 24px; place-items:center; border-radius:6px; background:#e6f1f3; color:var(--accent-dark); font-size:10px; font-weight:900; }
.form-section-head h2 { margin:1px 0 2px; color:var(--navy); font-size:16px; }
.form-section-head p { margin:0; color:var(--muted); font-size:10px; }
.incident-form .choice-section { margin-bottom:18px; }
.incident-form .choice-grid { grid-template-columns:repeat(4,minmax(0,1fr)); }
.incident-form .choice span { display:grid; gap:1px; }
.incident-form .choice small { color:var(--muted); font-size:8px; font-weight:500; }
.compact-choices .choice { background:#fff; }
.choice-details { margin-top:13px; }
.form-submit-bar { position:sticky; z-index:3; bottom:12px; display:flex; align-items:center; justify-content:space-between; gap:15px; margin-top:12px; padding:11px 12px; border:1px solid var(--line); border-radius:9px; background:rgba(255,255,255,.97); box-shadow:0 8px 24px rgba(16,37,56,.1); }
.form-submit-bar > span { color:var(--muted); font-size:9px; }
[data-location-other]:not([hidden]) { display:block; margin-top:7px; }

@media(max-width:1180px) {
  .shell { grid-template-columns:224px minmax(0,1fr); }
  .sidebar { padding-inline:11px; }
  .content { padding-inline:24px; }
  .metrics-bar { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .metric:nth-child(2) { border-right:0; }
  .metric:nth-child(-n+2) { border-bottom:1px solid var(--line); }
  .incident-form .choice-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
}

@media(max-width:900px) {
  .login-shell { grid-template-columns:1fr; width:min(500px,calc(100% - 28px)); min-height:0; margin:14px auto; }
  .login-visual { display:none; }
  .login-card { width:auto; padding:35px 28px; }
  .login-mobile-brand { display:flex; align-items:center; gap:10px; margin-bottom:30px; color:var(--navy); }
  .login-mobile-brand .brand-mark { width:36px; height:36px; border-radius:8px; }
  .shell { display:block; }
  .sidebar { position:fixed; z-index:20; left:-270px; width:248px; transition:left .18s ease; }
  .sidebar.open { left:0; box-shadow:15px 0 40px rgba(9,26,39,.25); }
  .sidebar-backdrop { position:fixed; z-index:19; inset:0; display:block; padding:0; border:0; background:rgba(9,26,39,.4); opacity:0; pointer-events:none; backdrop-filter:blur(2px); }
  .menu-open .sidebar-backdrop { opacity:1; pointer-events:auto; }
  .menu-open { overflow:hidden; }
  .mobile-menu { display:grid; }
  .topbar { padding:0 16px; }
  .topbar-context { display:none; }
  .content { padding:24px 16px 48px; }
  .dashboard-layout { grid-template-columns:1fr; }
  .page-head,.workspace-head { align-items:flex-start; }
  .incident-form .choice-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}

@media(max-width:620px) {
  .user-card > span:last-child { display:none; }
  .user-card { padding-right:3px; }
  .page-head,.workspace-head { display:grid; gap:15px; }
  .page-head .actions,.workspace-head .actions { display:grid; width:100%; grid-template-columns:1fr; margin:0; }
  .page-head .btn,.workspace-head .btn { width:100%; }
  .metrics-bar { grid-template-columns:1fr; }
  .metric { min-height:78px; border-right:0; border-bottom:1px solid var(--line); }
  .metric:nth-child(-n+2) { border-bottom:1px solid var(--line); }
  .metric:last-child { border-bottom:0; }
  .grid-4,.grid-2,.form-grid { grid-template-columns:1fr; }
  .panel-head { align-items:flex-start; }
  .work-panel,.card { padding:16px; }
  .content { padding-inline:12px; }
  .login-card { padding:30px 22px; }
  .login-card h1 { font-size:30px; }
  .activity-table th:nth-child(3),.activity-table td:nth-child(3) { display:none; }
  .neutral-login-card { padding:24px; }
  .incident-form { padding:0 14px 14px; }
  .incident-form .choice-grid { grid-template-columns:1fr; }
  .form-submit-bar { display:grid; position:static; }
  .form-submit-bar .btn { width:100%; }
  .timetable-title { display:grid; }
  .planning-period { width:100%; text-align:left; }
  .planning-period-editor { display:flex; }
}
