/* SPL Pilot — mobile-first */
:root {
  --navy: #102A43;
  --blue: #2563EB;
  --white: #FFFFFF;
  --grey: #E8EEF5;
  --bg: #F4F7FB;
  --surface: #FFFFFF;
  --text: #102A43;
  --muted: #52667A;
  --border: #D5DEE9;
  --success-bg: #E7F6EE; --success: #146C43;
  --error-bg: #FDECEC; --error: #B42318;
  --radius: 14px;
  --tap: 48px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  html[data-theme="system"] { --bg:#0B1A2B; --surface:#102A43; --text:#E8EEF5; --muted:#9FB3C8; --border:#24405E; --success-bg:#0F3B2A; --success:#7BD8A8; --error-bg:#47171A; --error:#FFA4A0; color-scheme: dark; }
}
html[data-theme="dark"] { --bg:#0B1A2B; --surface:#102A43; --text:#E8EEF5; --muted:#9FB3C8; --border:#24405E; --success-bg:#0F3B2A; --success:#7BD8A8; --error-bg:#47171A; --error:#FFA4A0; color-scheme: dark; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--blue); }
html[data-theme="dark"] .main a:not(.btn):not(.tab) { color: #7AA7FF; }
@media (prefers-color-scheme: dark) { html[data-theme="system"] .main a:not(.btn):not(.tab) { color: #7AA7FF; } }
code { background: var(--grey); color: var(--navy); padding: .1em .35em; border-radius: 6px; font-size: .9em; }
.sprite { display: none; }
.ico { width: 22px; height: 22px; flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--blue); color: #fff; padding: 10px 14px; border-radius: 8px; z-index: 100; }
.skip-link:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.muted { color: var(--muted); }
.text-danger { color: var(--error); font-weight: 600; }

/* Brand */
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 16px; }
.brand-mark { background: var(--blue); color: #fff; font-weight: 800; letter-spacing: .04em; border-radius: 10px; padding: 6px 8px; font-size: 14px; }
.brand-name { font-weight: 700; font-size: 18px; }
.brand-center { justify-content: center; color: var(--text); }

/* Shell */
.sidebar { position: fixed; inset: 0 auto 0 0; width: 272px; background: var(--navy); color: #fff; transform: translateX(-100%); transition: transform .2s ease; z-index: 50; display: flex; flex-direction: column; overflow-y: auto; padding-bottom: var(--safe-bottom); }
.sidebar.is-open { transform: none; }
.backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 40; }
.side-nav { display: flex; flex-direction: column; gap: 2px; padding: 4px 10px; flex: 1; }
.nav-item { display: flex; align-items: center; gap: 12px; min-height: var(--tap); padding: 10px 12px; border-radius: 10px; color: #DCE6F2; text-decoration: none; font-size: 15px; }
.sidebar a.nav-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar .nav-item[aria-current="page"] { background: var(--blue); color: #fff; }
.nav-item.is-disabled { opacity: .5; cursor: not-allowed; }
.badge-soon { margin-left: auto; white-space: nowrap; font-size: 11px; background: rgba(255,255,255,.12); padding: 2px 7px; border-radius: 99px; }
.logout-form { padding: 10px; border-top: 1px solid rgba(255,255,255,.1); }
.as-button { width: 100%; background: none; border: 0; cursor: pointer; font: inherit; text-align: left; }

.shell { min-height: 100vh; padding-bottom: calc(72px + var(--safe-bottom)); }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px; padding: 10px 14px; padding-top: max(10px, env(safe-area-inset-top)); background: var(--navy); color: #fff; }
.page-title { font-size: 18px; margin: 0; flex: 1; }
.icon-btn { width: var(--tap); height: var(--tap); display: grid; place-items: center; border: 0; border-radius: 12px; background: rgba(255,255,255,.1); color: #fff; cursor: pointer; }
.user-chip { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--blue); font-weight: 700; }
.main { padding: 16px; max-width: 1100px; margin: 0 auto; }
.main:focus { outline: none; }

.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr); background: var(--surface); border-top: 1px solid var(--border); padding-bottom: var(--safe-bottom); }
.bottom-nav .nav-item { flex-direction: column; gap: 2px; justify-content: center; min-height: 60px; padding: 6px 2px; font-size: 11px; color: var(--muted); border-radius: 0; }
.bottom-nav .nav-item[aria-current="page"] { color: var(--blue); font-weight: 700; }

@media (min-width: 960px) {
  .sidebar { transform: none; }
  .shell { margin-left: 272px; padding-bottom: 0; }
  .bottom-nav, .menu-toggle, .backdrop { display: none !important; }
  .main { padding: 28px; }
}

/* Cards & layout */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.narrow { max-width: 460px; margin: 0 auto 16px; }
.wide-ish { max-width: 720px; }
.bare-main { padding: 24px 16px; }
.section-title { font-size: 16px; margin: 0 0 12px; }
.two-cols { display: grid; gap: 16px; }
@media (min-width: 760px) { .two-cols { grid-template-columns: 1fr 1fr; } .two-cols .card { margin-bottom: 0; } .two-cols { margin-bottom: 16px; } }
.hero { display: grid; gap: 12px; background: linear-gradient(135deg, var(--navy), #1B3A5C); color: #fff; border: 0; }
.hero .muted { color: #BCCCDC; }
.hero-title { margin: 0; font-size: 22px; }
.eyebrow { margin: 0; color: #9DBBFF; font-weight: 600; }
.hero .btn-ghost { color: #fff; border-color: rgba(255,255,255,.35); justify-self: start; }

.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; }
.chip { background: rgba(255,255,255,.12); border-radius: 99px; padding: 6px 12px; font-size: 14px; }
.chip small { opacity: .8; }
.chip-en_projet, .chip-en_cours { background: rgba(37,99,235,.35); }

.grid-tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 16px; }
@media (min-width: 760px) { .grid-tiles { grid-template-columns: repeat(4, 1fr); } }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 2px; }
.tile-value { font-size: 28px; font-weight: 800; color: var(--blue); }
.tile-label { font-size: 14px; }
.tile-note { font-size: 12px; color: var(--muted); }
.tile.is-pending .tile-value { color: var(--muted); }

.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 10px 0; border-bottom: 1px solid var(--border); }
.list li:last-child { border-bottom: 0; }
.list.compact li { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; padding: 8px 0; }
.salary { display: block; font-weight: 800; color: var(--blue); }
.empty { color: var(--muted); margin: 0; }

/* Forms */
.form { display: grid; gap: 14px; }
.grid-2 { display: grid; gap: 14px; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.field { display: grid; gap: 6px; }
label { font-weight: 600; font-size: 14px; }
input[type=text], input:not([type]), input[type=email], input[type=password], input[type=number], input[type=url], input[type=date], select {
  width: 100%; min-height: var(--tap); padding: 10px 12px; font-size: 16px; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px; }
.fieldset { border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; margin: 0; display: grid; gap: 4px; }
.fieldset legend { font-weight: 700; padding: 0 6px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 400; font-size: 15px; }
.check input { width: 22px; height: 22px; accent-color: var(--blue); flex: none; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: var(--tap); padding: 10px 18px; border-radius: 12px; border: 1px solid transparent; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: #1D4ED8; }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn-danger { background: transparent; border-color: var(--error); color: var(--error); }
.btn-block { width: 100%; }
.inline-form { margin-top: 10px; }
.btn[disabled] { opacity: .6; cursor: progress; }

.alert { border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; }
.alert ul { margin: 0; padding-left: 18px; }
.alert-success { background: var(--success-bg); color: var(--success); }
.alert-error { background: var(--error-bg); color: var(--error); }

.tabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 14px; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
.tab { white-space: nowrap; padding: 10px 14px; min-height: 44px; border-radius: 99px; background: var(--surface); border: 1px solid var(--border); color: var(--text); text-decoration: none; font-size: 14px; }
.tab[aria-current="page"] { background: var(--navy); color: #fff; border-color: var(--navy); }
.qualif { border-bottom: 1px solid var(--border); padding: 10px 0; }
.qualif summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; }
.qualif .form { margin-top: 10px; }

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--border); }
.checklist { list-style: none; padding: 0; display: grid; gap: 4px; }
.checklist .ok span:first-child { color: var(--success); font-weight: 800; }
.checklist .ko { color: var(--error); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
