/* Portail CAUDALIE x UNITECH — feuille de style unique (aucun outil de build) */
:root {
  /* Palette UNITECH : à ajuster avec la charte officielle si besoin */
  --brand: #0b3c5d;
  --brand-dark: #072a42;
  --brand-light: #2e9cca;
  --brand-pale: #e6f3f9;
  --accent: #f29f05;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --text: #1c2733;
  --muted: #5d6b7a;
  --line: #dde3ea;
  --ok: #1e8e3e;
  --ok-bg: #e6f4ea;
  --warn: #b26a00;
  --warn-bg: #fff4e0;
  --danger: #c5221f;
  --danger-bg: #fce8e6;
  --info: #1a6fb0;
  --info-bg: #e8f1fb;
  --neutral-bg: #eef1f4;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.1);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--text); background: var(--bg); line-height: 1.45; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .5rem; line-height: 1.25; color: var(--brand-dark); }
h1 { font-size: 1.5rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }
p { margin: 0 0 .75rem; }
small, .muted { color: var(--muted); }
.small { font-size: .85rem; }
code { background: var(--neutral-bg); padding: .1em .35em; border-radius: 4px; font-size: .9em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1rem 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ------------------------------------------------------------------ Layout */
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar { background: var(--brand-dark); color: #fff; padding: 1rem; display: flex; flex-direction: column; gap: .75rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: .6rem; padding: .25rem .25rem .75rem; border-bottom: 1px solid rgba(255,255,255,.15); }
.brand img { width: 36px; height: 36px; }
.brand .brand-name { font-weight: 700; letter-spacing: .04em; font-size: 1.05rem; }
.brand .brand-sub { font-size: .75rem; opacity: .75; }
.nav { display: flex; flex-direction: column; gap: .15rem; }
.nav a { color: rgba(255,255,255,.85); padding: .42rem .7rem; border-radius: 8px; display: flex; align-items: center; gap: .6rem; font-weight: 500; }
.nav a:hover { background: rgba(255,255,255,.08); text-decoration: none; }
.nav a.active { background: var(--brand-light); color: #fff; }
.nav .badge { margin-left: auto; }
.nav-section { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; opacity: .6; padding: .75rem .7rem .25rem; }
.sidebar-footer { margin-top: auto; font-size: .8rem; opacity: .85; border-top: 1px solid rgba(255,255,255,.15); padding-top: .75rem; }
.sidebar-footer a { color: #fff; }
.main { padding: 1.25rem 1.5rem 3rem; max-width: 1200px; width: 100%; min-width: 0; }
.shell > *, .grid > *, .card { min-width: 0; }
.topbar { display: none; }
.page-header { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: .75rem; margin-bottom: 1rem; }
.page-header .actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.pm-contact { font-size: .85rem; color: var(--muted); }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .topbar { display: flex; align-items: center; justify-content: space-between; background: var(--brand-dark); color: #fff; padding: .6rem .9rem; position: sticky; top: 0; z-index: 20; }
  .topbar .brand { border: 0; padding: 0; }
  .topbar details { position: relative; }
  .topbar summary { list-style: none; cursor: pointer; padding: .4rem .7rem; border: 1px solid rgba(255,255,255,.4); border-radius: 8px; font-size: .9rem; }
  .topbar summary::-webkit-details-marker { display: none; }
  .topbar .menu { position: absolute; right: 0; top: 2.6rem; background: var(--brand-dark); border-radius: 10px; padding: .5rem; min-width: 240px; box-shadow: 0 8px 24px rgba(0,0,0,.3); z-index: 30; }
  .main { padding: 1rem .9rem 5rem; }
  .bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid var(--line); display: flex; justify-content: space-around; z-index: 20; padding: .25rem 0 calc(.25rem + env(safe-area-inset-bottom)); }
  .bottom-nav a { flex: 1; text-align: center; font-size: .68rem; color: var(--muted); padding: .35rem .2rem; display: flex; flex-direction: column; align-items: center; gap: .15rem; }
  .bottom-nav a.active { color: var(--brand); font-weight: 600; }
  .bottom-nav svg { width: 20px; height: 20px; }
  h1 { font-size: 1.3rem; }
}
@media (min-width: 901px) { .bottom-nav { display: none; } }

/* ------------------------------------------------------------------ Cards */
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem 1.1rem; }
.card + .card { margin-top: 1rem; }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .6rem; }
.card-title h2 { margin: 0; }
.card.highlight { border-left: 4px solid var(--brand-light); }
.card.compact { padding: .75rem .9rem; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: .6rem 0; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; padding-top: 0; }
.list .row { display: flex; gap: .75rem; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.list .row > div:first-child { flex: 1 1 220px; min-width: 0; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1rem; font-size: .93rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
@media (max-width: 600px) { .kv { grid-template-columns: 1fr; gap: .1rem; } .kv dt { margin-top: .4rem; } }
.empty { color: var(--muted); font-style: italic; padding: .4rem 0; }
.stat { font-size: 1.6rem; font-weight: 700; color: var(--brand-dark); }
.prose { white-space: pre-wrap; }

/* ------------------------------------------------------------------ Badges */
.badge { display: inline-block; font-size: .72rem; font-weight: 600; padding: .15rem .5rem; border-radius: 999px; background: var(--neutral-bg); color: var(--muted); white-space: nowrap; vertical-align: middle; letter-spacing: .01em; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.danger { background: var(--danger-bg); color: var(--danger); }
.badge.info { background: var(--info-bg); color: var(--info); }
.badge.brand { background: var(--brand-pale); color: var(--brand); }
.badge.draft { background: #fff; color: var(--warn); border: 1px dashed var(--warn); }
.badge.tentative { background: #fff; color: var(--muted); border: 1px dashed var(--muted); }
.badge.sys { background: var(--brand-pale); color: var(--brand-dark); }
.date-confirmed { font-weight: 600; color: var(--ok); }
.date-tentative { color: var(--muted); font-style: italic; border-bottom: 1px dashed var(--muted); }
.date-tbd { color: var(--muted); font-style: italic; }

/* ------------------------------------------------------------------ Steps */
.steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; margin: .25rem 0; }
.step { height: 8px; border-radius: 3px; background: var(--line); position: relative; }
.step.TERMINEE { background: var(--ok); }
.step.EN_COURS { background: var(--brand-light); }
.step.A_FAIRE { background: var(--line); }
.step.NON_APPLICABLE { background: repeating-linear-gradient(45deg, #e3e7ec 0 3px, #f7f8fa 3px 6px); }
.step.unknown { background: #fff; border: 1px dashed var(--line); }
.steps-legend { display: flex; gap: .8rem; flex-wrap: wrap; font-size: .72rem; color: var(--muted); }
.steps-legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: .3rem; vertical-align: -1px; background: var(--line); }
.steps-legend .l-done::before { background: var(--ok); }
.steps-legend .l-cur::before { background: var(--brand-light); }
.steps-legend .l-na::before { background: repeating-linear-gradient(45deg, #e3e7ec 0 3px, #f7f8fa 3px 6px); }
.sysrow { display: grid; grid-template-columns: 130px 1fr auto; align-items: center; gap: .6rem; padding: .35rem 0; font-size: .9rem; }
@media (max-width: 600px) { .sysrow { grid-template-columns: 1fr auto; gap: .15rem .5rem; } .sysrow .steps { grid-column: 1 / -1; order: 3; } }

/* ------------------------------------------------------------------ Tables */
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
th, td { text-align: left; padding: .55rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; background: #fafbfc; }
tr:hover td { background: #fafcfe; }
td.num, th.num { text-align: right; }
.progress-grid td { padding: .3rem .4rem; }
.progress-grid select { width: 100%; min-width: 120px; }

/* ------------------------------------------------------------------ Forms */
form.stack { display: flex; flex-direction: column; gap: .8rem; }
form.inline { display: inline; }
.field { display: flex; flex-direction: column; gap: .25rem; }
.field label, .field .label { font-size: .85rem; font-weight: 600; color: var(--brand-dark); }
.field .hint { font-size: .78rem; color: var(--muted); }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .8rem; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=datetime-local], input[type=number], input[type=file], select, textarea {
  font: inherit; padding: .5rem .6rem; border: 1px solid #c3ccd6; border-radius: 8px; background: #fff; width: 100%; color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand-light); outline-offset: 1px; border-color: var(--brand-light); }
textarea { min-height: 90px; resize: vertical; }
.checks { display: flex; flex-wrap: wrap; gap: .5rem 1rem; }
.checks label { display: inline-flex; align-items: center; gap: .4rem; font-weight: 500; font-size: .9rem; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; font: inherit; font-weight: 600; font-size: .9rem; padding: .5rem .9rem; border-radius: 8px; border: 1px solid transparent; cursor: pointer; background: var(--brand); color: #fff; white-space: nowrap; text-decoration: none; }
.btn:hover { background: var(--brand-dark); text-decoration: none; }
.btn.secondary { background: #fff; color: var(--brand); border-color: var(--brand); }
.btn.secondary:hover { background: var(--brand-pale); }
.btn.ghost { background: transparent; color: var(--brand); border-color: transparent; }
.btn.ghost:hover { background: var(--brand-pale); }
.btn.danger { background: var(--danger); }
.btn.success { background: var(--ok); }
.btn.sm { padding: .3rem .6rem; font-size: .8rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-end; margin-bottom: 1rem; }
.filters .field { min-width: 160px; }
.filters select, .filters input { padding: .4rem .5rem; }

/* ------------------------------------------------------------------ Alerts */
.alert { padding: .7rem .9rem; border-radius: 8px; margin-bottom: 1rem; border: 1px solid transparent; font-size: .93rem; }
.alert.success { background: var(--ok-bg); color: var(--ok); border-color: #b7dfc2; }
.alert.error { background: var(--danger-bg); color: var(--danger); border-color: #f3b9b7; }
.alert.info { background: var(--info-bg); color: var(--info); border-color: #b8d3ee; }
.alert.warn { background: var(--warn-bg); color: var(--warn); border-color: #f0d4a3; }
.notice-draft { background: var(--warn-bg); color: var(--warn); padding: .4rem .7rem; border-radius: 6px; font-size: .82rem; display: inline-block; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 1rem; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 .9rem .9rem; }
.timeline li::before { content: ""; position: absolute; left: -1.45rem; top: .35rem; width: 10px; height: 10px; border-radius: 50%; background: var(--brand-light); border: 2px solid #fff; }
.timeline time { font-size: .78rem; color: var(--muted); display: block; }

/* ------------------------------------------------------------------ Login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(160deg, var(--brand-dark), var(--brand) 60%, var(--brand-light)); padding: 1rem; }
.login-card { background: #fff; border-radius: 14px; padding: 2rem; width: 100%; max-width: 420px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.login-card .brand { color: var(--brand-dark); border-bottom-color: var(--line); margin-bottom: 1rem; }
.login-card .brand .brand-sub { color: var(--muted); }

/* ------------------------------------------------------------------ Calendar */
.calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; background: var(--line); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.calendar .dow { background: #fafbfc; font-size: .7rem; text-transform: uppercase; color: var(--muted); padding: .3rem; text-align: center; }
.calendar .day { background: #fff; min-height: 84px; padding: .25rem .3rem; font-size: .75rem; }
.calendar .day.other { background: #f7f8fa; color: #aab; }
.calendar .day .n { font-weight: 600; color: var(--muted); }
.calendar .ev { display: block; margin-top: .15rem; padding: .1rem .3rem; border-radius: 4px; background: var(--brand-pale); color: var(--brand-dark); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calendar .ev.tentative { background: #fff; border: 1px dashed var(--muted); color: var(--muted); }
.calendar .ev.confirmed { background: var(--ok-bg); color: var(--ok); }
@media (max-width: 700px) { .calendar .day { min-height: 56px; } .calendar .ev { font-size: .65rem; } }

/* ------------------------------------------------------------------ Misc */
.pill-list { display: flex; flex-wrap: wrap; gap: .3rem; }
.tag-demo { background: var(--accent); color: #fff; font-size: .7rem; padding: .1rem .4rem; border-radius: 4px; font-weight: 700; }
.err-page { text-align: center; padding: 4rem 1rem; }
.err-page .code { font-size: 4rem; font-weight: 800; color: var(--line); }
footer.meta { font-size: .78rem; color: var(--muted); margin-top: 2rem; border-top: 1px solid var(--line); padding-top: .75rem; display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; }
details.panel { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: .75rem 1rem; margin-top: 1rem; }
details.panel summary { cursor: pointer; font-weight: 600; color: var(--brand-dark); }
details.panel[open] summary { margin-bottom: .75rem; }
.env-banner { background: var(--accent); color: #fff; text-align: center; font-size: .75rem; padding: .2rem; font-weight: 700; letter-spacing: .05em; }

/* ------------------------------------------------------------------ Améliorations participants */
.skip-link { position: absolute; left: -999px; top: 0; background: var(--brand-dark); color: #fff; padding: .5rem .8rem; z-index: 100; border-radius: 0 0 8px 0; }
.skip-link:focus { left: 0; }
:focus-visible { outline: 2px solid var(--brand-light); outline-offset: 2px; }
.contact-box { background: rgba(255,255,255,.07); border-radius: 10px; padding: .6rem .7rem; font-size: .8rem; line-height: 1.4; }
.contact-box .label { text-transform: uppercase; letter-spacing: .06em; font-size: .65rem; opacity: .7; }
.contact-box a { color: #fff; text-decoration: underline; text-decoration-color: rgba(255,255,255,.4); }
.page-header .meta-dates { font-size: .8rem; color: var(--muted); text-align: right; line-height: 1.5; }
.page-header .meta-dates abbr { text-decoration: underline dotted; cursor: help; }
@media (max-width: 900px) { .page-header .meta-dates { text-align: left; } }
.cta { display: flex; gap: .9rem; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: .9rem 1.1rem; border-radius: var(--radius); background: var(--warn-bg); border: 1px solid #f0d4a3; margin-bottom: 1rem; }
.cta strong { color: var(--warn); }
.cta.info { background: var(--info-bg); border-color: #b8d3ee; } .cta.info strong { color: var(--info); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .6rem; margin-bottom: 1rem; }
.kpi { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: .7rem .9rem; display: block; color: inherit; border-left: 3px solid var(--line); }
.kpi:hover { text-decoration: none; box-shadow: 0 2px 8px rgba(16,24,40,.12); }
.kpi .n { font-size: 1.5rem; font-weight: 700; color: var(--brand-dark); line-height: 1.1; }
.kpi .l { font-size: .78rem; color: var(--muted); }
.kpi.warn { border-left-color: var(--warn); } .kpi.danger { border-left-color: var(--danger); } .kpi.ok { border-left-color: var(--ok); } .kpi.brand { border-left-color: var(--brand-light); }
.badge.new { background: var(--accent); color: #fff; }
.month-head { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 1rem 0 .4rem; padding-bottom: .25rem; border-bottom: 1px solid var(--line); }
.month-head:first-child { margin-top: 0; }
.next-up { border-left: 4px solid var(--brand-light); }
.next-up .when { font-size: 1.05rem; font-weight: 600; }
.subnav { display: flex; gap: .3rem; flex-wrap: wrap; margin: .25rem 0 1rem; }
.subnav a { font-size: .8rem; padding: .25rem .65rem; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow); color: var(--brand-dark); }
.subnav a:hover { background: var(--brand-pale); text-decoration: none; }
.legend { display: flex; flex-wrap: wrap; gap: .4rem 1rem; font-size: .78rem; color: var(--muted); align-items: center; }
.doc-card { display: grid; grid-template-columns: 1fr auto; gap: .6rem 1rem; align-items: center; padding: .7rem 0; border-top: 1px solid var(--line); }
.doc-card:first-child { border-top: 0; padding-top: 0; }
.doc-card .title { font-weight: 600; }
.doc-card .sub { font-size: .82rem; color: var(--muted); }
@media (max-width: 600px) { .doc-card { grid-template-columns: 1fr; } }
.choice { display: grid; gap: .5rem; }
.choice label { display: flex; gap: .6rem; align-items: flex-start; padding: .7rem .8rem; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font-weight: 500; }
.choice label:has(input:checked) { border-color: var(--brand-light); background: var(--brand-pale); }
.choice input { margin-top: .2rem; }
.choice small { display: block; font-weight: 400; color: var(--muted); }
.calendar .day.today { outline: 2px solid var(--brand-light); outline-offset: -2px; }
.calendar .day.today .n { color: var(--brand); }
.help-box { font-size: .88rem; }
.help-box dt { font-weight: 600; margin-top: .5rem; color: var(--brand-dark); }
.help-box dd { margin: 0; color: var(--muted); }
.status-explain { font-size: .85rem; color: var(--muted); border-left: 3px solid var(--line); padding-left: .7rem; margin-top: .5rem; }
.card h3.sub { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: .75rem 0 .35rem; }
@media print {
  .sidebar, .topbar, .bottom-nav, .btn, .filters, .env-banner, .skip-link, footer.meta { display: none !important; }
  .shell { display: block; } .main { padding: 0; max-width: none; }
  .card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
}
.int-item { display: grid; grid-template-columns: 190px 1fr auto; gap: .4rem 1rem; align-items: start; padding: .7rem 0; border-top: 1px solid var(--line); color: inherit; }
.int-item:first-of-type { border-top: 0; }
.int-item:hover { text-decoration: none; background: #fafcfe; }
.int-item .what strong { color: var(--brand-dark); }
.int-item .sub { font-size: .82rem; color: var(--muted); margin-top: .15rem; }
.int-item .st { text-align: right; }
@media (max-width: 700px) { .int-item { grid-template-columns: 1fr; gap: .2rem; } .int-item .st { text-align: left; } }
