/* Frenezee UI kit - charte "lumineux & colore" (reference : maquettes Clocking).
   Polices hebergees localement (fonts.css). Aucune dependance externe. */

:root {
  --primary: #3355FF; --primary-dark: #2440D8; --primary-tint: #EAEEFF; --primary-contrast: #FFFFFF;
  --accent: #FFC933;
  --ink: #1B1F3B; --ink-2: #3A4060; --ink-3: #4A5070; --muted: #5A6080;
  --bg: #F6F7FB; --card: #FFFFFF; --line: #E6E8F0; --line-2: #EEF0F5; --field: #F2F4FA;
  --green: #16A36A; --green-dark: #0B6B45; --green-tint: #DDF7EA;
  --orange: #FF8A3D; --orange-dark: #9A4A00; --orange-tint: #FFE9D6;
  --violet: #7C4DFF; --violet-dark: #5B2FC4; --violet-tint: #EEE6FF;
  --rose: #E0305A; --rose-dark: #B0173F; --rose-tint: #FFE3EA;
  --yellow: #FFC933; --yellow-dark: #7A5A00; --yellow-tint: #FFF4CC; --yellow-line: #FFE08A;
  --teal: #1FB5B0; --teal-dark: #0E6E6A; --teal-tint: #D5F5F3;
  --gray-tint: #ECEEF4; --gray-dark: #3A4060;
  --r-sm: 9px; --r-md: 12px; --r-lg: 18px; --r-xl: 22px; --r-2xl: 24px;
  --font-title: 'Outfit', system-ui, sans-serif;
  --font-body: 'Atkinson Hyperlegible', system-ui, sans-serif;
  --sidebar-w: 264px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font-body); color: var(--ink); background: var(--bg); font-size: 16px; line-height: 1.45; }
a { color: var(--primary-dark); }
a:hover { color: var(--primary); }
h1, h2, h3 { font-family: var(--font-title); margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 36px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
h2 { font-size: 22px; font-weight: 600; }
h3 { font-size: 18px; font-weight: 600; }
p { margin: 0; }
button { font-family: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--ink-3); }
.small { font-size: 14px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.grow { flex-grow: 1; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-hero { grid-template-columns: 1.6fr 1fr 1fr; }

/* ---------- Coque ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar-w); flex-shrink: 0; background: var(--card); border-right: 1px solid var(--line); padding: 24px 20px; display: flex; flex-direction: column; gap: 22px; position: sticky; top: 0; height: 100vh; overflow-y: auto; z-index: 30; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px; text-decoration: none; color: var(--ink); min-height: 40px; }
.brand img, .brand svg { width: 36px; height: 36px; object-fit: contain; flex-shrink: 0; }
.brand-name { font-family: var(--font-title); font-weight: 700; font-size: 20px; letter-spacing: -0.01em; line-height: 1.1; }
.brand-sub { font-size: 13px; color: var(--ink-3); }
.module-switch { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: var(--r-md); background: var(--bg); border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 700; font-size: 15px; }
.module-switch:hover { background: var(--primary-tint); color: var(--primary-dark); }
.nav-section { display: flex; flex-direction: column; gap: 4px; }
.nav-label { font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); padding: 0 12px 6px; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: var(--r-md); color: var(--ink-2); font-size: 16px; text-decoration: none; }
.nav-item:hover { background: var(--bg); color: var(--ink); }
.nav-item.is-active { background: var(--primary-tint); color: var(--primary-dark); font-weight: 700; }
.nav-item .tile { width: 30px; height: 30px; border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.nav-item.is-active .tile { background: var(--primary); color: var(--primary-contrast); }
.nav-badge { margin-left: auto; font-size: 13px; font-weight: 700; border-radius: 999px; padding: 2px 8px; background: var(--orange); color: var(--ink); }
.nav-badge.violet { background: var(--violet); color: #fff; }
.sidebar-foot { margin-top: auto; }
.usercard { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; background: var(--bg); }
.usercard .who { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.usercard .who strong { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usercard .who span { font-size: 14px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.powered { font-size: 12px; color: var(--muted); text-align: center; padding-top: 8px; }

.main { flex-grow: 1; min-width: 0; padding: 24px 40px 48px; display: flex; flex-direction: column; gap: 24px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; }
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 10px; }
.menu-toggle { display: none; }
.crumbs { font-size: 15px; color: var(--ink-3); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head .eyebrow { font-size: 16px; color: var(--ink-3); display: block; margin-bottom: 6px; }
.page-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ---------- Avatar, pastilles ---------- */
.avatar { width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; color: #fff; flex-shrink: 0; }
.avatar.sm { width: 34px; height: 34px; font-size: 13px; }
.avatar.lg { width: 56px; height: 56px; font-size: 20px; }
.av1 { background: #FF8A3D; color: #1B1F3B; } .av2 { background: #3355FF; } .av3 { background: #FFC933; color: #1B1F3B; }
.av4 { background: #E0305A; } .av5 { background: #16A36A; } .av6 { background: #7C4DFF; } .av7 { background: #1FB5B0; color: #1B1F3B; }
.pill { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; padding: 4px 12px; border-radius: 999px; white-space: nowrap; }
.pill::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; opacity: .85; }
.pill.no-dot::before { display: none; }
.pill.green { background: var(--green-tint); color: var(--green-dark); }
.pill.orange { background: var(--orange-tint); color: var(--orange-dark); }
.pill.violet { background: var(--violet-tint); color: var(--violet-dark); }
.pill.rose { background: var(--rose-tint); color: var(--rose-dark); }
.pill.yellow { background: var(--yellow-tint); color: var(--yellow-dark); }
.pill.blue { background: var(--primary-tint); color: var(--primary-dark); }
.pill.teal { background: var(--teal-tint); color: var(--teal-dark); }
.pill.gray { background: var(--gray-tint); color: var(--gray-dark); }
.tile-blue { background: var(--primary-tint); color: var(--primary-dark); }
.tile-green { background: var(--green-tint); color: var(--green-dark); }
.tile-violet { background: var(--violet-tint); color: var(--violet-dark); }
.tile-orange { background: var(--orange-tint); color: var(--orange-dark); }
.tile-rose { background: var(--rose-tint); color: var(--rose-dark); }
.tile-yellow { background: var(--yellow-tint); color: var(--yellow-dark); }
.tile-teal { background: var(--teal-tint); color: var(--teal-dark); }
.tile-gray { background: var(--gray-tint); color: var(--gray-dark); }

/* ---------- Cartes ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-2xl); padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.card.flush { padding: 0; overflow: hidden; border-radius: var(--r-xl); gap: 0; }
.card-title { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 700; }
.card-title .tile { width: 36px; height: 36px; border-radius: var(--r-md); display: flex; align-items: center; justify-content: center; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 24px 0; flex-wrap: wrap; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 20px; display: flex; flex-direction: column; gap: 8px; border-top: 6px solid var(--green); }
.stat .label { font-size: 15px; font-weight: 700; }
.stat .value { font-family: var(--font-title); font-weight: 700; font-size: 44px; line-height: 1; }
.stat .hint { font-size: 14px; color: var(--ink-3); }
.stat.green { border-top-color: var(--green); } .stat.green .label { color: var(--green-dark); }
.stat.orange { border-top-color: var(--orange); } .stat.orange .label { color: var(--orange-dark); }
.stat.violet { border-top-color: var(--violet); } .stat.violet .label { color: var(--violet-dark); }
.stat.rose { border-top-color: var(--rose); } .stat.rose .label { color: var(--rose-dark); }
.stat.blue { border-top-color: var(--primary); } .stat.blue .label { color: var(--primary-dark); }
.stat.yellow { border-top-color: var(--yellow); } .stat.yellow .label { color: var(--yellow-dark); }
.hero { background: var(--primary); color: var(--primary-contrast); border-radius: var(--r-2xl); padding: 28px; display: flex; flex-direction: column; gap: 18px; position: relative; overflow: hidden; }
.hero::after { content: ''; position: absolute; right: -50px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: var(--accent); opacity: .9; }
.hero > * { position: relative; z-index: 1; }
.hero .big { font-family: var(--font-title); font-weight: 700; font-size: 64px; line-height: 1; letter-spacing: -0.02em; }
.hero .pill { background: #fff; align-self: flex-start; }
.banner { display: flex; align-items: center; gap: 16px; padding: 16px 20px; border-radius: var(--r-lg); background: var(--yellow-tint); border: 1px solid var(--yellow-line); flex-wrap: wrap; }
.banner .tile { width: 40px; height: 40px; border-radius: var(--r-md); background: var(--yellow); color: var(--ink); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.banner.rose { background: var(--rose-tint); border-color: #F6B6C6; }
.banner.rose .tile { background: var(--rose); color: #fff; }
.banner.green { background: var(--green-tint); border-color: #A8E5C8; }
.banner.green .tile { background: var(--green); color: #fff; }
.banner.violet { background: var(--violet-tint); border-color: #CDBBFF; }
.banner.violet .tile { background: var(--violet); color: #fff; }
.empty { padding: 40px 24px; text-align: center; color: var(--ink-3); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty .tile { width: 56px; height: 56px; border-radius: 18px; display: flex; align-items: center; justify-content: center; }

/* ---------- Boutons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: var(--r-md); border: 1px solid transparent; background: var(--ink); color: #fff; font-weight: 700; font-size: 15px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { filter: brightness(1.12); color: #fff; }
.btn.primary { background: var(--primary); color: var(--primary-contrast); }
.btn.secondary { background: #fff; color: var(--ink); border-color: var(--line); }
.btn.secondary:hover { background: var(--bg); color: var(--ink); filter: none; }
.btn.danger { background: var(--rose); color: #fff; }
.btn.success { background: var(--green); color: #fff; }
.btn.ghost { background: transparent; color: var(--primary-dark); }
.btn.sm { height: 36px; padding: 0 12px; font-size: 14px; }
.btn.lg { height: 56px; font-size: 18px; border-radius: 16px; padding: 0 28px; }
.btn.block { width: 100%; }
.btn[disabled], .btn.is-muted { opacity: .55; cursor: not-allowed; }
.icon-btn { width: 40px; height: 40px; border-radius: var(--r-md); border: 1px solid var(--line); background: #fff; color: var(--ink-2); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; position: relative; text-decoration: none; padding: 0; }
.icon-btn:hover { background: var(--primary-tint); color: var(--primary-dark); }
.icon-btn.sm { width: 34px; height: 34px; }
.icon-btn.danger:hover { background: var(--rose-tint); color: var(--rose-dark); }
.icon-btn.success:hover { background: var(--green-tint); color: var(--green-dark); }
.icon-btn .dot { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; border-radius: 999px; background: var(--rose); color: #fff; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 5px; }
.row-actions { display: inline-flex; gap: 6px; }

/* ---------- Tooltips ---------- */
[data-tip] { position: relative; }
[data-tip]::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; font-size: 13px; font-weight: 400; padding: 5px 9px; border-radius: 8px; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .12s; z-index: 80; }
[data-tip]:hover::after, [data-tip]:focus-visible::after { opacity: 1; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }

/* ---------- Formulaires ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .field > .label { font-size: 14px; font-weight: 700; color: var(--ink-2); }
.input, .select, .textarea { width: 100%; height: 46px; border-radius: var(--r-md); border: 1px solid #D5D9E6; background: #fff; padding: 0 14px; font-family: inherit; font-size: 16px; color: var(--ink); }
.textarea { height: auto; min-height: 96px; padding: 12px 14px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); outline: 3px solid var(--primary-tint); }
.input.is-invalid { border-color: var(--rose); }
.error-text { font-size: 14px; color: var(--rose-dark); }
.help { font-size: 14px; color: var(--ink-3); }
.input-wrap { position: relative; }
.input-wrap .icon-btn { position: absolute; right: 4px; top: 3px; width: 40px; height: 40px; border: none; background: transparent; }
.radio-group { display: flex; gap: 10px; flex-wrap: wrap; }
.radio { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border: 1px solid #D5D9E6; border-radius: var(--r-md); background: #fff; cursor: pointer; font-size: 15px; }
.radio input { accent-color: var(--primary); width: 18px; height: 18px; margin: 0; }
.radio:has(input:checked) { border-color: var(--primary); background: var(--primary-tint); font-weight: 700; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.check { display: inline-flex; align-items: center; gap: 8px; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); }
.segmented { display: inline-flex; gap: 6px; background: #fff; border: 1px solid var(--line); padding: 5px; border-radius: 14px; flex-wrap: wrap; }
.segmented a, .segmented button { height: 40px; padding: 0 16px; border: none; border-radius: 10px; background: transparent; color: var(--ink-2); font-size: 15px; cursor: pointer; display: inline-flex; align-items: center; text-decoration: none; }
.segmented .is-active { background: var(--ink); color: #fff; font-weight: 700; }
.color-input { height: 46px; width: 80px; padding: 4px; border: 1px solid #D5D9E6; border-radius: var(--r-md); background: #fff; }

/* ---------- Depot de fichier ---------- */
.dropzone { border: 2px dashed #C9CEE0; border-radius: var(--r-lg); background: #FBFBFE; padding: 22px; display: flex; align-items: center; gap: 16px; cursor: pointer; transition: border-color .12s, background .12s; }
.dropzone:hover, .dropzone.is-over { border-color: var(--primary); background: var(--primary-tint); }
.dropzone .dz-icon { width: 48px; height: 48px; border-radius: 14px; background: var(--primary-tint); color: var(--primary-dark); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.dropzone .dz-preview { width: 64px; height: 64px; object-fit: contain; border-radius: 12px; background: #fff; border: 1px solid var(--line); display: none; }
.dropzone.has-file .dz-preview { display: block; }
.dropzone.has-file .dz-icon { display: none; }
.dropzone input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dz-error { color: var(--rose-dark); font-size: 14px; }

/* ---------- Tableaux ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 16px; }
.table thead tr { background: var(--bg); text-align: left; color: var(--ink-3); font-size: 14px; }
.table th { padding: 14px 16px; font-weight: 700; white-space: nowrap; }
.table th:first-child, .table td:first-child { padding-left: 24px; }
.table th:last-child, .table td:last-child { padding-right: 24px; }
.table td { padding: 12px 16px; border-top: 1px solid var(--line-2); vertical-align: middle; }
.table tbody tr:hover { background: #FAFBFE; }
.table th[data-sort] { cursor: pointer; user-select: none; }
.table th[data-sort]:hover { color: var(--ink); }
.table th .arrow { display: inline-block; width: 14px; margin-left: 4px; color: var(--primary); }
.table .cell-person { display: flex; align-items: center; gap: 12px; }
.table .cell-person .name { font-weight: 700; display: block; }
.table .cell-person .sub { font-size: 14px; color: var(--ink-3); }
.dt-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 24px; flex-wrap: wrap; border-bottom: 1px solid var(--line-2); }
.dt-toolbar .group { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dt-toolbar .select, .dt-toolbar .input { height: 38px; width: auto; font-size: 14px; }
.dt-pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 24px; border-top: 1px solid var(--line-2); flex-wrap: wrap; font-size: 14px; color: var(--ink-3); }
.dt-pager .pages { display: flex; align-items: center; gap: 10px; }
.dropdown { position: relative; }
.dropdown-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 32px rgba(27,31,59,.14); padding: 8px; z-index: 60; display: none; }
.dropdown.is-open .dropdown-menu { display: block; }
.dropdown-menu a, .dropdown-menu button.item, .dropdown-menu label.item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border-radius: 10px; color: var(--ink); text-decoration: none; font-size: 15px; background: transparent; border: none; cursor: pointer; text-align: left; }
.dropdown-menu a:hover, .dropdown-menu button.item:hover, .dropdown-menu label.item:hover { background: var(--bg); }
.dropdown-menu .sep { height: 1px; background: var(--line); margin: 6px 0; }
.dropdown-menu .head { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 6px 12px; }

/* ---------- Modales ---------- */
dialog.modal { border: none; border-radius: var(--r-2xl); padding: 0; width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); box-shadow: 0 24px 64px rgba(27,31,59,.28); color: var(--ink); }
dialog.modal.wide { width: min(780px, calc(100vw - 32px)); }
dialog.modal::backdrop { background: rgba(27,31,59,.45); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 22px 28px 0; }
.modal-body { padding: 18px 28px; display: flex; flex-direction: column; gap: 16px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 0 28px 24px; }

/* ---------- Flash ---------- */
.flash { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-radius: var(--r-lg); font-size: 16px; }
.flash.success { background: var(--green-tint); color: var(--green-dark); }
.flash.error { background: var(--rose-tint); color: var(--rose-dark); }
.flash.info { background: var(--primary-tint); color: var(--primary-dark); }

/* ---------- Lanceur de modules ---------- */
.launcher { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.launch-card { background: #fff; border: 1px solid var(--line); border-radius: var(--r-2xl); padding: 22px; display: flex; flex-direction: column; gap: 12px; text-decoration: none; color: var(--ink); min-height: 168px; position: relative; }
.launch-card:hover { border-color: var(--primary); box-shadow: 0 8px 24px rgba(51,85,255,.12); color: var(--ink); }
.launch-card .tile { width: 48px; height: 48px; border-radius: 14px; display: flex; align-items: center; justify-content: center; }
.launch-card h3 { font-size: 19px; }
.launch-card p { font-size: 14px; color: var(--ink-3); }
.launch-card.is-locked { background: #FBFBFE; border-style: dashed; color: var(--ink-3); }
.launch-card.is-locked .tile { background: var(--gray-tint); color: var(--muted); }
.launch-card .lock { position: absolute; right: 18px; top: 18px; color: var(--muted); }

/* ---------- Pointage / calendrier ---------- */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 14px; align-items: end; height: 220px; }
.week .day { display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.week .bar { width: 100%; border-radius: 12px; background: var(--green); }
.week .bar.now { background: var(--primary); }
.week .bar.todo { background: transparent; border: 2px dashed #C9CEE0; }
.week .bar.off { background: var(--gray-tint); height: 8px; }
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.timeline li { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 14px; background: #F0FBF5; }
.timeline li.out { background: #FFF6EE; }
.timeline .time { font-family: var(--font-title); font-weight: 600; font-size: 20px; width: 64px; }
.cal { display: grid; gap: 4px; }
.cell { height: 30px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.c-trav { background: #DDF7EA; color: #0B6B45; } .c-cp { background: #EEE6FF; color: #5B2FC4; } .c-ma { background: #FFE3EA; color: #B0173F; }
.c-we { background: #ECEEF4; color: #8C92AD; } .c-fo { background: #D5F5F3; color: #0E6E6A; } .c-jf { background: #FFF4CC; color: #7A5A00; }

/* ---------- Connexion ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.auth-left { background: var(--primary); color: var(--primary-contrast); padding: 56px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-left::after { content: ''; position: absolute; right: -90px; bottom: -110px; width: 380px; height: 380px; border-radius: 50%; background: var(--accent); opacity: .92; }
.auth-left > * { position: relative; z-index: 1; }
.auth-left h1 { font-size: 44px; max-width: 520px; }
.auth-left p { font-size: 18px; max-width: 480px; opacity: .95; }
.auth-left .brand { color: inherit; padding: 0; }
.auth-left .brand-name { font-size: 24px; }
.auth-right { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: var(--bg); }
.auth-card { width: min(440px, 100%); display: flex; flex-direction: column; gap: 22px; }
.auth-card .card { padding: 28px; }
.demo-box { background: var(--yellow-tint); border: 1px solid var(--yellow-line); border-radius: var(--r-lg); padding: 14px 16px; font-size: 14px; }
.demo-box table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.demo-box td { padding: 3px 0; }

/* ---------- Divers ---------- */
.kv { display: grid; grid-template-columns: 180px 1fr; gap: 8px 16px; font-size: 15px; }
.kv dt { color: var(--ink-3); } .kv dd { margin: 0; font-weight: 700; }
.progress { height: 10px; border-radius: 999px; background: var(--violet-tint); overflow: hidden; }
.progress > div { height: 100%; background: var(--violet); border-radius: 999px; }
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tabs a { padding: 10px 16px; border-radius: 12px 12px 0 0; text-decoration: none; color: var(--ink-3); font-weight: 700; font-size: 15px; border-bottom: 3px solid transparent; }
.tabs a.is-active { color: var(--primary-dark); border-bottom-color: var(--primary); }
.logo-preview { width: 72px; height: 72px; border-radius: 16px; border: 1px solid var(--line); background: #fff; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.logo-preview img { max-width: 100%; max-height: 100%; }
.matrix td, .matrix th { text-align: center; }
.matrix td:first-child, .matrix th:first-child { text-align: left; }
.switch { position: relative; width: 46px; height: 26px; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; inset: 0; background: #C9CEE0; border-radius: 999px; cursor: pointer; transition: .15s; }
.switch .slider::before { content: ''; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .15s; }
.switch input:checked + .slider { background: var(--green); }
.switch input:checked + .slider::before { transform: translateX(20px); }

@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-hero { grid-template-columns: 1fr 1fr; }
  .main { padding: 20px 24px 40px; }
}
@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .18s; box-shadow: 0 0 40px rgba(27,31,59,.25); }
  body.nav-open .sidebar { transform: none; }
  .menu-toggle { display: inline-flex; }
  .auth { grid-template-columns: 1fr; }
  .auth-left { display: none; }
  .grid-2, .grid-3, .grid-hero, .form-grid { grid-template-columns: 1fr; }
  h1 { font-size: 28px; }
  .hero .big { font-size: 52px; }
  .kv { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .main { padding: 16px 16px 40px; }
  .stat .value { font-size: 34px; }
}

/* Calendrier : demande en attente (hachure) */
.c-cpd { background: repeating-linear-gradient(135deg, #EEE6FF 0 4px, #FFFFFF 4px 8px); color: #5B2FC4; border: 1.5px dashed #7C4DFF; }
