/* OJL Redac — interface */
:root {
  --bg: #f6f7fc;
  --panel: #ffffff;
  --sidebar: #f1f3fb;
  --line: #e3e6f2;
  --ink: #161827;
  --ink-2: #5b6079;
  --ink-3: #8c91a8;
  --violet: #6a5ae0;
  --violet-2: #8b7cf6;
  --violet-soft: #efedff;
  --ok: #18865a;
  --ok-soft: #e4f6ee;
  --err: #c43c3c;
  --err-soft: #fdeceb;
  --wait: #a06400;
  --wait-soft: #fff4dd;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(22, 24, 39, .04), 0 6px 24px rgba(22, 24, 39, .05);
  --font: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Space Grotesk', var(--font);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 15px/1.55 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--violet); text-decoration: none; }
a:hover { text-decoration: underline; }
[hidden] { display: none !important; }
code, .mono { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: 13px; }

/* Structure */
.shell { display: grid; grid-template-columns: 272px 1fr; min-height: 100vh; }
.sidebar { background: var(--sidebar); border-right: 1px solid var(--line); padding: 22px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 12px; font: 700 21px var(--display); color: var(--ink); margin: 0 8px 22px; letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand-center { justify-content: center; margin-bottom: 26px; }
.brand-mark { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: #fff; font-size: 18px; background: linear-gradient(135deg, var(--violet), var(--violet-2)); box-shadow: 0 6px 18px rgba(106, 90, 224, .35); }
.nav { display: flex; flex-direction: column; gap: 6px; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 999px; color: var(--ink); background: rgba(255, 255, 255, .7); border: 1px solid var(--line); font-weight: 500; font-size: 14.5px; transition: background .15s, transform .15s; }
.nav-item svg { color: var(--ink-2); flex: none; }
.nav-item:hover { background: #fff; text-decoration: none; transform: translateX(2px); }
.nav-item.is-active { color: #fff; border-color: transparent; background: linear-gradient(110deg, var(--violet), var(--violet-2)); box-shadow: 0 8px 20px rgba(106, 90, 224, .28); border-radius: 18px; }
.nav-item.is-active svg { color: #fff; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 16px; padding: 14px 32px; border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, .8); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 10; }
.topbar-title { font-weight: 600; color: var(--ink-2); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar form { margin: 0; }
.menu-toggle { display: none; }
.lang-switch { display: flex; background: var(--sidebar); border-radius: 999px; padding: 3px; border: 1px solid var(--line); }
.lang-switch button { border: 0; background: none; padding: 4px 11px; border-radius: 999px; font: 600 12px var(--font); color: var(--ink-2); cursor: pointer; }
.lang-switch button.is-on { background: #fff; color: var(--violet); box-shadow: var(--shadow); }
.user-chip { font-weight: 600; color: var(--ink); padding: 6px 12px; border-radius: 999px; background: var(--violet-soft); }
.content { padding: 32px; max-width: 1100px; width: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; }

/* Typo */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.page-title { font: 700 34px/1.15 var(--display); letter-spacing: -.03em; margin: 0 0 4px; }
.h2 { font: 700 24px var(--display); margin: 0 0 8px; letter-spacing: -.02em; }
.card-title { font: 600 18px var(--font); margin: 0; display: flex; align-items: center; gap: 8px; }
.muted { color: var(--ink-2); margin: 0; }
.hint { color: var(--ink-3); font-size: 13px; margin: 0; }
.label { font-weight: 600; color: var(--ink-2); margin: 16px 0 8px; font-size: 13.5px; }
.text-error { color: var(--err); }

/* Cartes */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 26px; box-shadow: var(--shadow); }
.subcard { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px 18px; background: #fcfcff; margin: 0; }
fieldset.subcard legend { font-weight: 600; font-size: 13.5px; color: var(--ink-2); padding: 0 6px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.grid-2, .grid-3, .grid-4 { display: grid; gap: 16px; }
.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)); }
.inline { display: inline; margin: 0; }
.nowrap { white-space: nowrap; }
.w-200 { max-width: 220px; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ellipsis-cell { max-width: 420px; }

/* Formulaires */
.field { display: flex; flex-direction: column; gap: 6px; font-weight: 500; font-size: 14px; }
.field > span { color: var(--ink); }
input, select, textarea { width: 100%; font: 15px var(--font); color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 11px 14px; box-shadow: 0 1px 2px rgba(22, 24, 39, .03); transition: border-color .15s, box-shadow .15s; }
textarea { resize: vertical; line-height: 1.55; }
input:focus, select:focus, textarea:focus, [contenteditable]:focus { outline: none; border-color: var(--violet-2); box-shadow: 0 0 0 4px rgba(139, 124, 246, .15); }
input[type=checkbox], input[type=radio] { width: auto; box-shadow: none; accent-color: var(--violet); }
input[type=file] { padding: 9px; }
.checks { display: flex; flex-wrap: wrap; gap: 10px 22px; }
.checks label, .check { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }
.count { font-style: normal; color: var(--ink-3); font-size: 12px; font-weight: 500; }
.count.warn { color: var(--err); }
.seg { display: inline-flex; background: var(--sidebar); border: 1px solid var(--line); border-radius: 999px; padding: 3px; flex-wrap: wrap; }
.seg-item input { position: absolute; opacity: 0; pointer-events: none; }
.seg-item span { display: block; padding: 6px 14px; border-radius: 999px; font-weight: 500; font-size: 13.5px; color: var(--ink-2); cursor: pointer; }
.seg-item input:checked + span { background: #fff; color: var(--violet); box-shadow: var(--shadow); }
.seg-item input:focus-visible + span { outline: 2px solid var(--violet-2); }
.dropzone { border: 1.5px dashed var(--line); border-radius: var(--radius-sm); padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }

/* Boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); background: #fff; color: var(--ink); font: 600 14px var(--font); padding: 10px 18px; border-radius: 999px; cursor: pointer; transition: transform .1s, box-shadow .15s, background .15s; white-space: nowrap; }
.btn:hover { text-decoration: none; box-shadow: var(--shadow); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: wait; }
.btn-primary { color: #fff; border-color: transparent; background: linear-gradient(110deg, var(--violet), var(--violet-2)); box-shadow: 0 6px 16px rgba(106, 90, 224, .25); }
.btn-ghost { background: #fff; }
.btn-danger { color: var(--err); border-color: #f2c9c7; }
.btn-sm { padding: 6px 13px; font-size: 13px; }
.btn-lg { padding: 13px 26px; font-size: 15.5px; }
.btn-block { width: 100%; }
.icon-btn { border: 0; background: none; cursor: pointer; font-size: 16px; color: var(--ink-2); padding: 4px 8px; border-radius: 8px; }
.icon-btn:hover { background: var(--violet-soft); color: var(--violet); }
[data-dictate].is-rec { color: #fff; background: var(--err); border-color: transparent; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .65; } }
.spinner { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; display: inline-block; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Badges, chips, alertes */
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--sidebar); color: var(--ink-2); border: 1px solid var(--line); }
.badge-ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge-err { background: var(--err-soft); color: var(--err); border-color: transparent; }
.badge-wait { background: var(--wait-soft); color: var(--wait); border-color: transparent; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 4px 12px; border-radius: 999px; background: var(--sidebar); color: var(--ink-2); font-size: 13px; font-weight: 500; }
.alert { padding: 12px 16px; border-radius: var(--radius-sm); font-weight: 500; }
.alert-success { background: var(--ok-soft); color: var(--ok); }
.alert-error { background: var(--err-soft); color: var(--err); }
.alert-info { background: var(--violet-soft); color: var(--violet); }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 120px); background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 12px; font-weight: 500; max-width: min(92vw, 620px); transition: transform .25s; z-index: 50; box-shadow: 0 12px 30px rgba(0, 0, 0, .2); }
.toast.is-on { transform: translate(-50%, 0); }
.toast-error { background: var(--err); }
.toast-success { background: var(--ok); }

/* Résultat article */
.seo-title { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; }
.seo-title:has(input:checked) { border-color: var(--violet-2); background: var(--violet-soft); }
.seo-title .num { color: var(--violet); font-weight: 700; }
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-top: 6px; }
.tab { border: 0; background: none; font: 600 14px var(--font); color: var(--ink-3); padding: 10px 14px; cursor: pointer; border-bottom: 2px solid transparent; }
.tab.is-on { color: var(--violet); border-bottom-color: var(--violet); }
.article-body { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 22px 26px; max-height: 720px; overflow-y: auto; line-height: 1.75; font-size: 16px; }
.article-body h2 { font-size: 21px; margin: 1.4em 0 .5em; }
.article-body h3 { font-size: 18px; margin: 1.2em 0 .4em; }
.article-body table { border-collapse: collapse; width: 100%; }
.article-body td, .article-body th { border: 1px solid var(--line); padding: 8px; }
.block-preview { padding: 6px; }
.photos { display: grid; grid-template-columns: 3fr 2fr; gap: 18px; align-items: start; }
.photo-slot { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.photo-slot figcaption { font-weight: 600; font-size: 13.5px; }
.photo-frame { border: 1.5px dashed var(--line); border-radius: var(--radius-sm); display: grid; place-items: center; overflow: hidden; background: #fbfbfe; }
.landscape .photo-frame { aspect-ratio: 3 / 2; }
.portrait .photo-frame { aspect-ratio: 2 / 3; }
.photo-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-frame.big { min-height: 200px; }
.photo-frame.big img { height: auto; }

/* Listes et tableaux */
.list { display: flex; flex-direction: column; gap: 8px; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.table-wrap { overflow-x: auto; padding: 8px 10px; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); padding: 12px; border-bottom: 1px solid var(--line); }
.table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.progress { height: 8px; border-radius: 999px; background: var(--sidebar); overflow: hidden; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--violet), var(--violet-2)); transition: width .4s; }
.progress-lg { height: 12px; margin-top: 10px; }
.subnav { display: flex; gap: 6px; flex-wrap: wrap; }
.subnav a { padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink-2); font-weight: 600; font-size: 14px; }
.subnav a.is-active { background: var(--ink); color: #fff; border-color: var(--ink); }
.subnav a:hover { text-decoration: none; }
.secret { font-size: 16px; letter-spacing: .05em; background: var(--sidebar); padding: 8px 12px; border-radius: 8px; }

/* Statistiques */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; }
.kpi span { color: var(--ink-3); font-size: 13px; font-weight: 600; }
.kpi strong { font: 700 28px var(--display); }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 180px; padding-top: 10px; overflow-x: auto; }
.bar { flex: 1; min-width: 22px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.bar span { width: 100%; background: linear-gradient(180deg, var(--violet-2), var(--violet)); border-radius: 6px 6px 2px 2px; min-height: 2px; }
.bar em { font-style: normal; font-size: 10.5px; color: var(--ink-3); }

/* Pages sans menu */
body.bare { display: grid; place-items: center; min-height: 100vh; padding: 20px; background: radial-gradient(1200px 600px at 10% -10%, #e6e2ff, transparent), var(--bg); }
.bare-box { width: min(420px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 24px; padding: 34px 30px; box-shadow: 0 20px 60px rgba(22, 24, 39, .08); display: flex; flex-direction: column; gap: 14px; }

/* Mobile */
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 280px; z-index: 30; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 40px rgba(0, 0, 0, .15); }
  .sidebar.is-open { transform: none; }
  .menu-toggle { display: inline-block; }
  .topbar { padding: 12px 16px; }
  .user-chip { display: none; }
  .content { padding: 20px 16px; }
  .grid-2, .grid-3, .grid-4, .photos, .kpis { grid-template-columns: 1fr; }
  .page-title { font-size: 27px; }
  .card { padding: 18px 16px; }
}
#seo-titles + .grid-2 { margin-top: 16px; }
.card > .field + .field, .card > .grid-2 + .field { margin-top: 14px; }

/* Mes dépenses */
.table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table tfoot th, .table tfoot td { border-top: 2px solid var(--line); padding: 12px; }
.table tr.is-current td { background: var(--violet-soft); }
.page-head form.row select, .page-head form.row input { width: auto; }
.table td .progress { min-width: 120px; }
.table tfoot th { text-transform: none; letter-spacing: 0; font-size: 15px; color: var(--ink); font-weight: 700; }
