/* Dataroom PE — feuille de style commune (administration, portail, pages publiques).
   Aucune règle en ligne : la politique CSP n'autorise que les feuilles de même origine. */

:root {
  --accent: #1f3a5f;
  --accent-strong: #152a45;
  --accent-soft: #e8eef6;
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --border: #dde1e6;
  --border-strong: #c4cad2;
  --text: #1d2430;
  --text-2: #4d5868;
  --text-3: #7a8494;
  --ok: #1e7a4c;
  --ok-soft: #e3f3ea;
  --warn: #9a6200;
  --warn-soft: #fdf3dc;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --info: #1f5fa8;
  --info-soft: #e6f0fb;
  --neutral-soft: #eceef1;
  --note: #6b4e00;
  --note-soft: #fff8e1;
  --radius: 6px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.08);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, 0.18);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .5em; font-weight: 600; line-height: 1.25; color: var(--text); }
h1 { font-size: 22px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-2); }
p { margin: 0 0 .75em; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
hr { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }
.hidden { display: none !important; }
.muted { color: var(--text-3); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.grow { flex: 1 1 auto; min-width: 0; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.row.top { align-items: flex-start; }
.stack > * + * { margin-top: 12px; }
.stack-sm > * + * { margin-top: 6px; }
.mt { margin-top: 16px; }
.mb { margin-bottom: 16px; }
.mt-sm { margin-top: 8px; }
.prewrap { white-space: pre-wrap; word-break: break-word; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ------------------------------------------------------------------ Shell */
.topbar {
  display: flex; align-items: center; gap: 16px;
  height: 56px; padding: 0 20px;
  background: var(--accent); color: #fff;
  position: sticky; top: 0; z-index: 50;
}
.topbar a, .topbar button.linklike { color: #fff; }
.topbar .brand { font-weight: 700; font-size: 15px; letter-spacing: .01em; display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.topbar .brand .sub { font-weight: 400; opacity: .75; font-size: 13px; }
.topbar .brand img { height: 28px; max-width: 140px; object-fit: contain; background: #fff; border-radius: 4px; padding: 2px; }
.topbar nav { display: flex; gap: 2px; flex: 1 1 auto; overflow-x: auto; }
.topbar nav a {
  padding: 6px 12px; border-radius: 4px; color: rgba(255,255,255,.85); font-weight: 500; white-space: nowrap;
}
.topbar nav a:hover { background: rgba(255,255,255,.12); text-decoration: none; }
.topbar nav a.active { background: rgba(255,255,255,.2); color: #fff; }
.topbar .user { display: flex; align-items: center; gap: 12px; font-size: 13px; white-space: nowrap; }
.topbar .user .name { opacity: .9; }
.topbar .btn { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.25); color: #fff; }
.topbar .btn:hover { background: rgba(255,255,255,.22); }

.bell { position: relative; }
.bell .count {
  position: absolute; top: -4px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: #e5484d; color: #fff; font-size: 11px; line-height: 18px; text-align: center; font-weight: 600;
}
.dropdown {
  position: absolute; right: 0; top: 40px; width: 380px; max-height: 460px; overflow: auto;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); z-index: 60;
}
.dropdown .item { padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 13px; }
.dropdown .item.unread { background: var(--info-soft); }
.dropdown .head { padding: 10px 14px; border-bottom: 1px solid var(--border); font-weight: 600; display: flex; justify-content: space-between; align-items: center; }

main.page { max-width: 1320px; margin: 0 auto; padding: 24px 20px 64px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.page-head .meta { color: var(--text-2); margin-top: 4px; }
.breadcrumb { font-size: 13px; color: var(--text-3); margin-bottom: 6px; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.breadcrumb a { color: var(--text-2); }
.breadcrumb .sep { color: var(--border-strong); }

/* ------------------------------------------------------------------ Cards & panels */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px 18px;
}
.card + .card { margin-top: 16px; }
.card.flush { padding: 0; }
.card > .card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.card > .card-head h2, .card > .card-head h3 { margin: 0; }
.card.flush > .card-head { padding: 14px 18px 0; }
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.cards { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.split { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; align-items: start; }
.split.wide-left { grid-template-columns: minmax(0, 1fr) 380px; }

.fund-card { display: flex; flex-direction: column; gap: 10px; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.fund-card:hover { border-color: var(--accent); box-shadow: var(--shadow-lg); }
.fund-card h3 { margin: 0; font-size: 16px; }
.fund-card .facts { display: flex; gap: 16px; color: var(--text-2); font-size: 13px; flex-wrap: wrap; }
.fund-card .counts { display: flex; gap: 0; border-top: 1px solid var(--border); padding-top: 10px; }
.fund-card .counts > div { flex: 1; text-align: center; }
.fund-card .counts strong { display: block; font-size: 18px; }
.fund-card .counts span { color: var(--text-3); font-size: 12px; }
.fund-card.disabled { opacity: .55; cursor: not-allowed; }
.fund-card.disabled:hover { border-color: var(--border); box-shadow: var(--shadow); }

dl.facts { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 6px 16px; margin: 0; }
dl.facts dt { color: var(--text-3); }
dl.facts dd { margin: 0; }

/* ------------------------------------------------------------------ Tabs */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tabs a {
  padding: 10px 16px; color: var(--text-2); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { color: var(--accent); border-bottom-color: var(--accent); }
.subtabs { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.subtabs button { border-radius: 16px; }
.subtabs .active, .subtabs .active:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ------------------------------------------------------------------ Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 14px; border-radius: var(--radius);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--surface-2); border-color: var(--text-3); text-decoration: none; }
.btn:disabled, .btn.disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-strong); }
.btn.danger { color: var(--danger); border-color: #e7b4ae; }
.btn.danger:hover { background: var(--danger-soft); }
.btn.danger.solid { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--neutral-soft); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn.xs { height: 24px; padding: 0 8px; font-size: 12px; }
.btn.block { width: 100%; }
button.linklike { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font: inherit; }
button.linklike:hover { text-decoration: underline; }
.btn-group { display: inline-flex; gap: 6px; flex-wrap: wrap; }

/* ------------------------------------------------------------------ Forms */
label { display: block; font-weight: 500; font-size: 13px; color: var(--text-2); margin-bottom: 4px; }
.field { margin-bottom: 14px; }
.field .hint { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.field.inline { display: flex; align-items: center; gap: 8px; }
.field.inline label { margin: 0; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=datetime-local],
input[type=search], input[type=url], input[type=color], select, textarea {
  width: 100%; height: 36px; padding: 0 10px;
  border: 1px solid var(--border-strong); border-radius: var(--radius); background: #fff;
  font: inherit; color: var(--text);
}
input[type=color] { padding: 2px 4px; width: 60px; }
textarea { height: auto; min-height: 90px; padding: 8px 10px; resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 2px solid rgba(31, 58, 95, .35); outline-offset: 1px; border-color: var(--accent); }
input[type=checkbox], input[type=radio] { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); vertical-align: middle; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 400; color: var(--text); margin-bottom: 8px; cursor: pointer; }
.check .hint { margin: 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 14px; }
.filters .field { margin: 0; min-width: 150px; }
.filters > select { width: auto; min-width: 170px; }
.filters > .grow { flex: 1 1 260px; }
.filters > .check { margin: 0; height: 36px; }
.filters input[type=search] { min-width: 220px; }
.form-error { color: var(--danger); background: var(--danger-soft); border: 1px solid #f2c4bf; padding: 8px 12px; border-radius: var(--radius); margin-bottom: 12px; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; margin: 0 0 14px; }
legend { padding: 0 6px; font-weight: 600; font-size: 13px; color: var(--text-2); }

/* ------------------------------------------------------------------ Tables */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th, .table td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--text-3); font-weight: 600; background: var(--surface-2); white-space: nowrap; }
.table tbody tr:hover { background: #fafbfc; }
.table tr.clickable { cursor: pointer; }
.table tr.selected { background: var(--accent-soft) !important; }
.table tr.muted-row td { color: var(--text-3); }
.table tr.overdue td { background: #fff6f5; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table td .sub { display: block; color: var(--text-3); font-size: 12px; }
.table select { height: 30px; font-size: 13px; }
.table input { height: 30px; font-size: 13px; }
#pipeline-table input, #pipeline-table select { min-width: 130px; }
#pipeline-table td:first-child { min-width: 170px; }

/* ------------------------------------------------------------------ Badges */
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 10px;
  font-size: 11.5px; font-weight: 600; line-height: 18px; white-space: nowrap;
  background: var(--neutral-soft); color: var(--text-2); border: 1px solid transparent;
}
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.accent { background: var(--accent); color: #fff; }
.badge.outline { background: transparent; border-color: var(--border-strong); }
.badge.new { background: #e5484d; color: #fff; }
.badge.updated { background: #f5a524; color: #fff; }

/* ------------------------------------------------------------------ States */
.empty {
  padding: 32px 16px; text-align: center; color: var(--text-3);
  border: 1px dashed var(--border-strong); border-radius: var(--radius); background: var(--surface-2);
}
.empty strong { display: block; color: var(--text-2); margin-bottom: 4px; font-size: 14px; }
.state {
  max-width: 560px; margin: 48px auto; padding: 24px 28px; text-align: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
}
.state h2 { margin-bottom: 8px; }
.state .code { font-family: var(--mono); font-size: 12px; color: var(--text-3); margin-top: 12px; }
.state.denied { border-top: 4px solid var(--warn); }
.state.error { border-top: 4px solid var(--danger); }
.state.gone { border-top: 4px solid var(--text-3); }
.state.notfound { border-top: 4px solid var(--info); }
.loading { padding: 32px; text-align: center; color: var(--text-3); }
.loading::before {
  content: ""; display: inline-block; width: 16px; height: 16px; margin-right: 8px; vertical-align: -3px;
  border: 2px solid var(--border-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.notice { padding: 10px 14px; border-radius: var(--radius); background: var(--info-soft); color: #173f6d; border: 1px solid #c7dbf3; font-size: 13px; }
.notice.warn { background: var(--warn-soft); color: #6d4600; border-color: #f1d9a4; }
.notice.danger { background: var(--danger-soft); color: #7a1a12; border-color: #f2c4bf; }
.notice.ok { background: var(--ok-soft); color: #145234; border-color: #b9e0ca; }
.notice + .notice { margin-top: 8px; }

/* ------------------------------------------------------------------ Tree */
.tree { list-style: none; margin: 0; padding: 0; font-size: 13.5px; }
.tree ul { list-style: none; margin: 0; padding: 0 0 0 16px; }
.tree .node {
  display: flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 4px; cursor: pointer; user-select: none;
}
.tree .node:hover { background: var(--neutral-soft); }
.tree a.node { color: inherit; text-decoration: none; }
.tree .node.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.tree .node.archived { color: var(--text-3); font-style: italic; }
.tree .node.drop { outline: 2px dashed var(--accent); }
.tree .toggle { width: 14px; color: var(--text-3); font-size: 10px; text-align: center; flex: 0 0 14px; }
.tree .icon { display: inline-block; width: 14px; height: 11px; border-radius: 2px; background: #c9a64a; flex: 0 0 14px; position: relative; }
.tree .icon::before { content: ""; position: absolute; top: -3px; left: 0; width: 6px; height: 3px; background: #c9a64a; border-radius: 1px 1px 0 0; }
.tree .icon.doc { background: #b8c4d3; border-radius: 1px 4px 1px 1px; height: 14px; width: 11px; flex-basis: 11px; }
.tree .icon.doc::before { display: none; }
.tree .label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree .count { color: var(--text-3); font-size: 12px; }
.scope-tree .node { cursor: default; }
.scope-tree .node .label { cursor: pointer; }
.scope-tree select { height: 24px; font-size: 12px; width: auto; padding: 0 4px; }
.scope-tree .node.covered { color: var(--ok); }

/* ------------------------------------------------------------------ Upload */
.dropzone {
  border: 2px dashed var(--border-strong); border-radius: var(--radius); padding: 18px; text-align: center; color: var(--text-2);
  background: var(--surface-2); transition: border-color .15s, background .15s; cursor: pointer;
}
.dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.progress { height: 8px; background: var(--neutral-soft); border-radius: 4px; overflow: hidden; }
.progress > div { height: 100%; width: 0; background: var(--accent); transition: width .15s; }
.upload-results { margin-top: 10px; }
.upload-results .res { display: flex; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }

/* ------------------------------------------------------------------ Bars / charts */
.bars { display: flex; flex-direction: column; gap: 6px; }
.bar-row { display: grid; grid-template-columns: 220px minmax(0, 1fr) 48px; gap: 10px; align-items: center; font-size: 13px; }
.bar-row .track { height: 14px; background: var(--neutral-soft); border-radius: 3px; overflow: hidden; }
.bar-row .fill { height: 100%; width: 0; background: var(--accent); border-radius: 3px; }
.bar-row .fill.alt { background: #6b8bb3; }
.chart { display: flex; align-items: flex-end; gap: 3px; height: 160px; padding: 8px 0; border-bottom: 1px solid var(--border); overflow-x: auto; }
.chart .col { flex: 1 0 14px; max-width: 48px; display: flex; flex-direction: column-reverse; align-items: stretch; height: 100%; min-width: 14px; }
.chart .seg { background: var(--accent); min-height: 0; }
.chart .seg.dl { background: #c9a64a; }
.chart-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-3); margin-top: 4px; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--text-2); }
.legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; background: var(--accent); margin-right: 4px; vertical-align: -1px; }
.legend .sw.dl { background: #c9a64a; }

.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.kpi .v { font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--accent); }
.kpi .l { font-size: 13px; color: var(--text-2); font-weight: 500; }
.kpi .d { font-size: 11.5px; color: var(--text-3); margin-top: 6px; line-height: 1.4; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }

/* ------------------------------------------------------------------ Q&A thread */
.thread { display: flex; flex-direction: column; gap: 10px; }
.msg { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; background: var(--surface); }
.msg .meta { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--text-3); margin-bottom: 4px; flex-wrap: wrap; }
.msg .kind { font-weight: 600; color: var(--text-2); }
.msg.question, .msg.investor_reply { border-left: 3px solid var(--info); }
.msg.answer { border-left: 3px solid var(--ok); background: #fbfefc; }
.msg.clarification_request { border-left: 3px solid var(--warn); background: #fffcf4; }
.msg.internal_note { border: 1px dashed #d8b64a; background: var(--note-soft); }
.msg.internal_note .kind { color: var(--note); }
.internal-label { display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--note); background: #ffeeb0; padding: 1px 6px; border-radius: 3px; }
.internal-zone { border: 1px dashed #d8b64a; background: var(--note-soft); border-radius: var(--radius); padding: 12px 14px; }

.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain li { padding: 8px 0; border-bottom: 1px solid var(--border); }
.list-plain li:last-child { border-bottom: 0; }

/* ------------------------------------------------------------------ Modal */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(16, 24, 40, .45); z-index: 100;
  display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; overflow-y: auto;
}
.modal {
  background: var(--surface); border-radius: 8px; box-shadow: var(--shadow-lg); width: 100%; max-width: 560px;
  display: flex; flex-direction: column; max-height: none;
}
.modal.wide { max-width: 860px; }
.modal.xwide { max-width: 1100px; }
.modal-head { padding: 14px 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.modal-head h2 { margin: 0; font-size: 17px; }
.modal-body { padding: 18px 20px; }
.modal-foot { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; background: var(--surface-2); border-radius: 0 0 8px 8px; }
.close-x { background: none; border: 0; font-size: 22px; line-height: 1; cursor: pointer; color: var(--text-3); padding: 0 4px; }
.close-x:hover { color: var(--text); }

/* ------------------------------------------------------------------ Toasts */
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 200; display: flex; flex-direction: column; gap: 8px; max-width: 420px; }
.toast {
  background: #1d2430; color: #fff; padding: 10px 14px; border-radius: var(--radius); box-shadow: var(--shadow-lg); font-size: 13.5px;
  border-left: 4px solid #6b8bb3; animation: toastin .2s ease-out;
}
.toast.ok { border-left-color: #3ccf8e; }
.toast.error { border-left-color: #ff6b5e; }
.toast.warn { border-left-color: #f5a524; }
.toast .cid { display: block; font-family: var(--mono); font-size: 11px; opacity: .7; margin-top: 2px; }
@keyframes toastin { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ------------------------------------------------------------------ Auth screens */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; background: linear-gradient(160deg, #eef1f5 0%, #dfe5ec 100%); }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border-radius: 8px; box-shadow: var(--shadow-lg); padding: 28px 30px; border-top: 4px solid var(--accent); }
.auth-card .app-name { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); font-weight: 600; margin-bottom: 4px; }
.auth-card h1 { font-size: 20px; margin-bottom: 16px; }
.auth-card .foot { margin-top: 16px; font-size: 13px; display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.secret { font-family: var(--mono); font-size: 16px; letter-spacing: .08em; background: var(--surface-2); border: 1px solid var(--border); padding: 10px 12px; border-radius: var(--radius); text-align: center; word-break: break-all; }
.otpauth { font-family: var(--mono); font-size: 11px; color: var(--text-2); word-break: break-all; background: var(--surface-2); border: 1px solid var(--border); padding: 6px 8px; border-radius: var(--radius); }
.code-input { font-family: var(--mono); font-size: 20px !important; letter-spacing: .3em; text-align: center; height: 44px !important; }
.policy { font-size: 12px; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 10px; margin-bottom: 14px; }
.policy li.ok { color: var(--ok); }
.policy ul { margin: 4px 0 0; padding-left: 18px; }

/* ------------------------------------------------------------------ Landing */
.landing { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 16px; background: linear-gradient(160deg, #eef1f5 0%, #dfe5ec 100%); }
.landing h1 { font-size: 26px; margin-bottom: 6px; }
.landing .lead { color: var(--text-2); margin-bottom: 28px; text-align: center; max-width: 560px; }
.landing .choices { display: grid; grid-template-columns: repeat(2, minmax(0, 280px)); gap: 20px; }
.landing .choice { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 24px; box-shadow: var(--shadow); color: var(--text); border-top: 4px solid var(--accent); }
.landing .choice.portal { border-top-color: #2f6f62; }
.landing .choice:hover { text-decoration: none; box-shadow: var(--shadow-lg); }
.landing .choice h2 { margin-bottom: 6px; }
.landing .choice p { color: var(--text-2); margin: 0; }

/* ------------------------------------------------------------------ Viewer */
.viewer-frame { width: 100%; height: 78vh; border: 1px solid var(--border); border-radius: var(--radius); background: #525659; display: block; }
.viewer-img { max-width: 100%; max-height: 78vh; display: block; margin: 0 auto; border: 1px solid var(--border); background: #fff; }
.preview-frame { width: 100%; height: 520px; border: 1px solid var(--border); border-radius: var(--radius); background: #525659; display: block; }
.side-panel { position: sticky; top: 72px; }

/* ------------------------------------------------------------------ Portal theme (distinct de l'administration) */
body.portal { --accent: #2f6f62; --accent-strong: #24564c; --accent-soft: #e6f2ef; background: #f6f5f2; }
body.portal .topbar { background: #fff; color: var(--text); border-bottom: 3px solid var(--accent); height: 64px; box-shadow: var(--shadow); }
body.portal .topbar a, body.portal .topbar button.linklike { color: var(--text); }
body.portal .topbar .brand { color: var(--accent); font-size: 16px; }
body.portal .topbar .brand .sub { color: var(--text-2); opacity: 1; }
body.portal .topbar nav a { color: var(--text-2); }
body.portal .topbar nav a:hover { background: var(--accent-soft); }
body.portal .topbar nav a.active { background: var(--accent-soft); color: var(--accent); }
body.portal .topbar .btn { background: #fff; border-color: var(--border-strong); color: var(--text); }
body.portal .topbar .btn:hover { background: var(--surface-2); }
body.portal .card { border-radius: 8px; }
body.portal .hero { background: var(--surface); border: 1px solid var(--border); border-left: 5px solid var(--accent); border-radius: 8px; padding: 20px 24px; margin-bottom: 20px; box-shadow: var(--shadow); }
body.portal .hero h1 { margin-bottom: 4px; }
body.portal .doc-row { display: flex; gap: 10px; align-items: center; padding: 10px 4px; border-bottom: 1px solid var(--border); }
body.portal .doc-row:last-child { border-bottom: 0; }
body.portal .doc-row .grow { cursor: pointer; }
body.portal .doc-row .name { font-weight: 500; }
body.portal .doc-row .sub { color: var(--text-3); font-size: 12px; }

/* ------------------------------------------------------------------ Responsive */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split.wide-left { grid-template-columns: minmax(0, 1fr); }
  .side-panel { position: static; }
  .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .grid.cols-2, .grid.cols-3 { grid-template-columns: minmax(0, 1fr); }
  .form-grid, .form-grid.cols-3 { grid-template-columns: minmax(0, 1fr); }
  .topbar { height: auto; min-height: 56px; flex-wrap: wrap; padding: 8px 12px; }
  .topbar nav { order: 3; flex-basis: 100%; }
  .bar-row { grid-template-columns: 140px minmax(0, 1fr) 40px; }
  dl.facts { grid-template-columns: 130px minmax(0, 1fr); }
  .landing .choices { grid-template-columns: minmax(0, 1fr); }
  .dropdown { width: 300px; }
}
