/* ============ Cockpit — design tokens ============ */
:root {
  color-scheme: light;
  --bg: #f2f2f7;
  --surface: #ffffff;
  --surface-2: #f7f7fa;
  --line: #e5e5ea;
  --line-2: #efeff4;
  --ink: #000000;
  --ink-2: #3c3c43;
  --ink-3: #8e8e93;
  --accent: #007aff;
  --accent-ink: #ffffff;
  --accent-blue: #007aff;
  --hover: rgba(118, 118, 128, .10);
  --perso: #007aff;
  --entreprise: #ff9500;
  --bourse: #af52de;
  --immo: #34c759;
  --flow-in: #34c759;
  --flow-out: #ff9500;
  --good: #34c759; --good-ink: #248a3d; --good-bg: #e3f7e8;
  --warn: #ff9500; --warn-ink: #c93400; --warn-bg: #fff1dd;
  --crit: #ff3b30; --crit-ink: #d70015; --crit-bg: #ffe5e3;
  --info-bg: #e5f1ff; --info-ink: #0060df;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 2px 10px rgba(0, 0, 0, .04);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, .18);
  --radius: 18px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI Variable Text", "Segoe UI", system-ui, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000000;
  --surface: #1c1c1e;
  --surface-2: #2c2c2e;
  --line: #38383a;
  --line-2: #2c2c2e;
  --ink: #ffffff;
  --ink-2: #d1d1d6;
  --ink-3: #8e8e93;
  --accent: #0a84ff;
  --accent-ink: #ffffff;
  --accent-blue: #0a84ff;
  --hover: rgba(118, 118, 128, .24);
  --perso: #0a84ff;
  --entreprise: #ff9f0a;
  --bourse: #bf5af2;
  --immo: #30d158;
  --flow-in: #30d158;
  --flow-out: #ff9f0a;
  --good: #30d158; --good-ink: #30d158; --good-bg: #0f2e18;
  --warn: #ff9f0a; --warn-ink: #ffb340; --warn-bg: #33240a;
  --crit: #ff453a; --crit-ink: #ff6961; --crit-bg: #3a1311;
  --info-bg: #0b2545; --info-ink: #64a8ff;
  --shadow: none;
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, .7);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 14px/1.45 var(--font); -webkit-font-smoothing: antialiased;
  font-feature-settings: "tnum" 1, "cv11" 1;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.sec { color: var(--ink-2); }
.sr { position: absolute; left: -9999px; }
svg.i { flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ============ Layout ============ */
.app { display: grid; grid-template-columns: 232px 1fr; height: 100vh; }
.side {
  background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 18px 12px 12px; gap: 4px; overflow: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; font-weight: 700; font-size: 16px; letter-spacing: -.01em; }
.brand .logo { width: 30px; height: 30px; border-radius: 9px; background: #000; color: #fff; display: grid; place-items: center; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 10px;
  color: var(--ink-2); text-decoration: none; font-weight: 550; cursor: pointer; user-select: none;
}
.nav a:hover { background: var(--hover); color: var(--ink); }
.nav a.on { background: var(--accent); color: var(--accent-ink); }
.nav .count { margin-inline-start: auto; font-size: 11px; font-weight: 700; background: var(--crit); color: #fff; border-radius: 99px; padding: 1px 7px; }
.nav a.on .count { background: var(--accent-ink); color: var(--accent); }
.side .spacer { flex: 1; }
.filebox { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--surface-2); font-size: 12px; color: var(--ink-2); }
.filebox b { display: block; color: var(--ink); font-size: 12.5px; word-break: break-all; }
.filebox .row { display: flex; gap: 6px; margin-top: 8px; }
.dot-ok { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--good); margin-right: 6px; }

.main { display: flex; flex-direction: column; min-width: 0; height: 100vh; overflow: hidden; }
.top {
  display: flex; align-items: center; gap: 14px; padding: 14px 28px; flex-wrap: wrap;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line); position: relative; z-index: 20;
}
.top h1 { font-size: 20px; font-weight: 700; letter-spacing: -.02em; margin-right: auto; }
.top .sub { font-size: 12.5px; color: var(--ink-3); font-weight: 450; display: block; letter-spacing: 0; margin-top: 1px; }
.scroll { flex: 1; overflow: auto; padding: 22px 28px 60px; }
.page { max-width: 1320px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }

/* ============ Controls ============ */
.btn {
  display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface);
  border-radius: 10px; padding: 8px 14px; font-weight: 600; line-height: 1.2; white-space: nowrap;
  transition: background .12s, transform .06s, box-shadow .12s;
}
.btn:hover { background: var(--surface-2); box-shadow: var(--shadow); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { background: var(--accent); filter: brightness(1.15); }
.btn.danger { color: var(--crit-ink); }
.btn.danger:hover { background: var(--crit-bg); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--hover); box-shadow: none; }
.btn.sm { padding: 5px 10px; font-size: 12.5px; border-radius: 8px; gap: 6px; }
.btn.lg { padding: 12px 20px; font-size: 15px; border-radius: 12px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn.icon { padding: 7px; }
kbd { font: 600 11px var(--mono); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; color: var(--ink-3); background: var(--surface-2); }
.btn.primary kbd { background: transparent; color: inherit; border-color: color-mix(in srgb, var(--accent-ink) 40%, transparent); opacity: .8; }

.seg { display: inline-flex; background: var(--hover); border-radius: 11px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 6px 13px; border-radius: 8px; font-weight: 600; color: var(--ink-2); display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.seg.lg button { padding: 10px 18px; font-size: 15px; }
.seg .dotc { width: 8px; height: 8px; border-radius: 50%; }
.seg.block { display: flex; } .seg.block button { flex: 1; justify-content: center; }

.pillbtn {
  display: inline-flex; align-items: center; gap: 9px; padding: 8px 13px; border: 1px solid var(--line); background: var(--surface);
  border-radius: 11px; font-weight: 600; cursor: pointer;
}
.pillbtn:hover { box-shadow: var(--shadow); }
.pillbtn .arrow { color: var(--ink-3); font-weight: 500; }

input[type=text], input[type=number], input[type=date], input[type=month], input[type=search], select, textarea {
  width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 9px 12px; outline: none;
  transition: border-color .12s, box-shadow .12s; min-height: 38px;
}
input:focus, select:focus, textarea:focus { border-color: var(--ink-2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink) 10%, transparent); }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); }
textarea { resize: vertical; min-height: 70px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .lbl { font-size: 12px; font-weight: 650; color: var(--ink-2); letter-spacing: .01em; }
.field .hint { font-size: 12px; color: var(--ink-3); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.err { color: var(--crit-ink); font-size: 12.5px; font-weight: 600; }

/* ============ Cards ============ */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; min-width: 0; }
.card > header { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.card > header h2 { font-size: 14px; font-weight: 700; letter-spacing: -.005em; }
.card > header .sub { color: var(--ink-3); font-size: 12.5px; }
.card > header .right { margin-inline-start: auto; display: flex; gap: 8px; align-items: center; }
.row2 { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 18px; }
.row2e { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
@media (max-width: 1100px) { .row2, .row2e { grid-template-columns: 1fr; } }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 1150px) { .kpis { grid-template-columns: repeat(2, 1fr); } }
.kpi { padding: 16px 18px 14px; display: flex; flex-direction: column; gap: 4px; position: relative; overflow: hidden; }
.kpi .t { font-size: 12.5px; font-weight: 650; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.kpi .v { font-size: 27px; font-weight: 720; letter-spacing: -.03em; line-height: 1.15; margin-top: 2px; }
.kpi .d { font-size: 12.5px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.kpi .spark { position: absolute; right: 14px; top: 16px; opacity: .9; }
.delta { display: inline-flex; align-items: center; gap: 3px; font-weight: 700; font-size: 12px; padding: 1px 7px 1px 5px; border-radius: 99px; }
.delta.good { background: var(--good-bg); color: var(--good-ink); }
.delta.bad { background: var(--crit-bg); color: var(--crit-ink); }
.delta.flat { background: var(--hover); color: var(--ink-2); }
.pos { color: var(--good-ink); } .neg { color: var(--crit-ink); }

/* ============ Table ============ */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 11.5px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; background: var(--surface); }
.tbl td { padding: 10px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background .1s; }
.tbl tbody tr.click { cursor: pointer; }
@media (hover: hover) and (pointer: fine) { .tbl tbody tr:hover { background: var(--hover); } }
.tbl tbody tr.click { -webkit-tap-highlight-color: transparent; }
.tbl .r { text-align: end; } .tbl .c { text-align: center; }
.tbl td .sub { display: block; font-size: 12px; color: var(--ink-3); }
.tbl .acts { opacity: 0; display: flex; gap: 2px; justify-content: flex-end; }
.tbl tr:hover .acts { opacity: 1; }
.tbl tr.dim td { opacity: .55; }
.tbl tfoot td { font-weight: 700; border-top: 1px solid var(--line); border-bottom: 0; }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 99px; background: var(--hover); font-size: 12.5px; font-weight: 550; color: var(--ink-2); white-space: nowrap; }
.adot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; vertical-align: 1px; }
.adot.Perso, .bg-Perso { background: var(--perso); } .adot.Entreprise, .bg-Entreprise { background: var(--entreprise); } .adot.Immobilier, .bg-Immobilier { background: var(--immo); } .adot.Bourse, .bg-Bourse { background: var(--bourse); }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.pill.good { background: var(--good-bg); color: var(--good-ink); }
.pill.warn { background: var(--warn-bg); color: var(--warn-ink); }
.pill.bad { background: var(--crit-bg); color: var(--crit-ink); }
.pill.info { background: var(--info-bg); color: var(--info-ink); }
.pill.mute { background: var(--hover); color: var(--ink-2); }

/* ============ Bars list ============ */
.bl { display: flex; flex-direction: column; gap: 11px; }
.bl .it { display: grid; grid-template-columns: minmax(90px, 170px) 1fr auto; gap: 12px; align-items: center; }
.bl .it .lb { font-weight: 550; display: flex; align-items: center; gap: 7px; min-width: 0; }
.bl .it .lb span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bl .it .tr { height: 9px; background: var(--hover); border-radius: 99px; overflow: hidden; }
.bl .it .fl { height: 100%; border-radius: 99px; background: var(--flow-in); min-width: 3px; transition: width .4s cubic-bezier(.2, .8, .2, 1); }
.bl .it .vl { font-weight: 650; min-width: 74px; text-align: right; }

/* ============ Alerts ============ */
.alerts { display: flex; flex-direction: column; gap: 8px; }
.alert { display: flex; gap: 12px; align-items: center; padding: 11px 13px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-2); }
.alert .ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.alert.warn .ic { background: var(--warn-bg); color: var(--warn-ink); }
.alert.bad .ic { background: var(--crit-bg); color: var(--crit-ink); }
.alert.info .ic { background: var(--info-bg); color: var(--info-ink); }
.alert.good .ic { background: var(--good-bg); color: var(--good-ink); }
.alert .tx { flex: 1; min-width: 0; font-weight: 550; }
.alert .tx small { display: block; color: var(--ink-3); font-weight: 450; font-size: 12.5px; }

/* ============ Charts ============ */
.chart { width: 100%; position: relative; }
.chart svg { display: block; overflow: visible; }
.legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--ink-2); font-weight: 550; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.tip { position: fixed; z-index: 200; pointer-events: none; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; box-shadow: var(--shadow-lg); font-size: 12.5px; min-width: 150px; opacity: 0; transition: opacity .1s; }
.tip.on { opacity: 1; }
.tip .th { font-weight: 700; margin-bottom: 5px; }
.tip .tr { display: flex; justify-content: space-between; gap: 18px; padding: 1px 0; }
.tip .tr i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; }

/* ============ Rent grid ============ */
.gridwrap { overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
table.rent { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13px; }
table.rent th, table.rent td { padding: 0; border-bottom: 1px solid var(--line-2); border-right: 1px solid var(--line-2); text-align: center; }
table.rent th { background: var(--surface-2); font-weight: 700; font-size: 12px; color: var(--ink-2); padding: 9px 6px; position: sticky; top: 0; z-index: 2; white-space: nowrap; }
table.rent th:first-child, table.rent td:first-child { position: sticky; left: 0; z-index: 3; background: var(--surface); text-align: left; padding: 9px 12px; min-width: 210px; border-right: 1px solid var(--line); }
table.rent th:first-child { background: var(--surface-2); z-index: 4; }
table.rent td.cell { min-width: 74px; }
table.rent .c { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; padding: 6px 4px; height: 100%; cursor: pointer; transition: background .1s; font-weight: 650; }
table.rent .c small { font-weight: 500; font-size: 11px; opacity: .85; }
table.rent .c:hover { filter: brightness(.96); outline: 2px solid var(--ink-3); outline-offset: -2px; border-radius: 2px; }
.c.paid { background: var(--good-bg); color: var(--good-ink); }
.c.part { background: var(--warn-bg); color: var(--warn-ink); }
.c.late { background: var(--crit-bg); color: var(--crit-ink); }
.c.vac { color: var(--ink-3); cursor: default !important; font-weight: 400 !important; }
.c.fut { color: var(--ink-3); background: repeating-linear-gradient(135deg, transparent 0 6px, var(--hover) 6px 7px); }
table.rent tfoot td { background: var(--surface-2); font-weight: 700; padding: 8px 6px; }
table.rent .lot b { font-weight: 650; display: block; }
table.rent .lot span { font-size: 12px; color: var(--ink-3); }

/* ============ Modal / popover / toast ============ */
.overlay { position: fixed; inset: 0; background: rgba(10, 10, 10, .45); backdrop-filter: blur(3px); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 16px; overflow: auto; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.985); } }
.modal { background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg); width: 100%; max-width: 640px; animation: pop .18s cubic-bezier(.2, .8, .2, 1); border: 1px solid var(--line); }
.modal > header { display: flex; align-items: center; padding: 18px 22px 6px; gap: 10px; }
.modal > header h2 { font-size: 17px; font-weight: 720; letter-spacing: -.015em; }
.modal > header .x { margin-inline-start: auto; }
.modal .body { padding: 10px 22px 8px; display: flex; flex-direction: column; gap: 16px; }
.modal > footer { padding: 14px 22px 18px; display: flex; gap: 10px; align-items: center; }
.modal > footer .sp { flex: 1; }

.amount-row { display: flex; gap: 10px; align-items: stretch; }
.amount { font-size: 34px !important; font-weight: 720; letter-spacing: -.03em; padding: 10px 16px !important; height: 66px; border-radius: 14px !important; }
.catgrid { display: flex; flex-wrap: wrap; gap: 7px; }
.cat {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface);
  font-weight: 600; font-size: 13px; color: var(--ink-2); transition: all .1s;
}
.cat:hover { border-color: var(--ink-3); color: var(--ink); background: var(--surface-2); }
.cat.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.cat .em { font-size: 15px; line-height: 1; }
.grp { font-size: 11px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; margin: 8px 0 6px; }
.grp:first-child { margin-top: 0; }
.suggest { position: absolute; left: 0; right: 0; top: 100%; margin-top: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); z-index: 30; overflow: hidden; }
.suggest div { padding: 9px 13px; display: flex; justify-content: space-between; gap: 10px; cursor: pointer; }
.suggest div:hover, .suggest div.on { background: var(--hover); }
.suggest small { color: var(--ink-3); }
.rel { position: relative; }
.details > summary { cursor: pointer; font-weight: 650; color: var(--ink-2); list-style: none; display: flex; align-items: center; gap: 6px; }
.details > summary::-webkit-details-marker { display: none; }
.details[open] > summary { margin-bottom: 12px; }

.pop { position: fixed; z-index: 150; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); animation: pop .15s; }
.period { display: grid; grid-template-columns: 170px 1fr 1fr; gap: 0; padding: 0; }
.period .presets { padding: 12px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.period .presets button { text-align: left; border: 0; background: transparent; padding: 8px 10px; border-radius: 9px; font-weight: 600; color: var(--ink-2); }
.period .presets button:hover { background: var(--hover); color: var(--ink); }
.period .presets button.on { background: var(--accent); color: var(--accent-ink); }
.period .mp { padding: 14px 16px; width: 232px; }
.period .mp .yr { display: flex; align-items: center; justify-content: space-between; font-weight: 700; margin-bottom: 8px; }
.period .mp .ttl { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; color: var(--ink-3); margin-bottom: 4px; }
.period .mp .ms { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.period .mp .ms button { border: 0; background: transparent; padding: 9px 0; border-radius: 9px; font-weight: 600; color: var(--ink-2); }
.period .mp .ms button:hover { background: var(--hover); }
.period .mp .ms button.on { background: var(--accent); color: var(--accent-ink); }
.period .mp .ms button.in { background: var(--hover); }
.period .mp .ms button:disabled { opacity: .3; pointer-events: none; }

.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 300; }
.toast { background: var(--accent); color: var(--accent-ink); padding: 11px 16px; border-radius: 12px; box-shadow: var(--shadow-lg); font-weight: 600; animation: pop .2s; display: flex; gap: 10px; align-items: center; max-width: 440px; }
.toast.error { background: var(--crit); color: #fff; }

/* ============ Misc ============ */
.empty { text-align: center; padding: 34px 10px; color: var(--ink-3); }
.empty b { display: block; color: var(--ink-2); font-size: 15px; margin-bottom: 4px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filters .grow { flex: 1; min-width: 200px; position: relative; }
.filters .grow input { padding-left: 36px; }
.filters .grow svg { position: absolute; left: 11px; top: 10px; color: var(--ink-3); }
.filters select { width: auto; min-width: 150px; }
.thr { position: relative; height: 46px; margin: 26px 0 30px; }
.thr .track { position: absolute; left: 0; right: 0; top: 16px; height: 14px; background: var(--hover); border-radius: 99px; overflow: hidden; display: flex; }
.thr .seg1 { background: var(--flow-in); height: 100%; }
.thr .seg2 { background: var(--flow-out); height: 100%; }
.thr .seg3 { height: 100%; background: repeating-linear-gradient(135deg, var(--flow-out) 0 4px, transparent 4px 8px); opacity: .8; }
.thr .mk { position: absolute; top: 6px; width: 0; border-left: 2px solid var(--ink-3); height: 34px; }
.thr .mk span { position: absolute; top: -20px; left: 0; transform: translateX(-50%); font-size: 11.5px; font-weight: 700; white-space: nowrap; color: var(--ink-2); }
.thr .mk em { position: absolute; top: 36px; left: 0; transform: translateX(-50%); font-size: 11px; font-style: normal; color: var(--ink-3); white-space: nowrap; }
.thr .mk.low span { top: 56px; } .thr .mk.low em { top: 56px; transform: translateX(-50%); } .thr .mk.low { border-left-style: dashed; height: 54px; }
.thr .mk.low span, .thr .mk.low em { position: absolute; }
.thr .mk.low span { top: 54px; } .thr .mk.low em { display: none; }
.thr { margin-bottom: 52px; }
.note { font-size: 12.5px; color: var(--ink-3); }
.infobox { background: var(--info-bg); color: var(--info-ink); border-radius: 12px; padding: 10px 14px; font-weight: 500; font-size: 13px; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.split { display: flex; align-items: center; gap: 10px; }
.sp { flex: 1; }
.section-title { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); margin: 6px 0 -6px; }
.toggle { position: relative; width: 38px; height: 22px; background: var(--line); border-radius: 99px; border: 0; padding: 0; transition: background .15s; flex: none; }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
.toggle.on { background: var(--good); } .toggle.on::after { transform: translateX(16px); }
.loading { display: grid; place-items: center; height: 100vh; color: var(--ink-3); font-weight: 600; }
::-webkit-scrollbar { width: 11px; height: 11px; } ::-webkit-scrollbar-thumb { background: var(--line); border-radius: 99px; border: 3px solid transparent; background-clip: content-box; } ::-webkit-scrollbar-thumb:hover { background: var(--ink-3); border: 3px solid transparent; background-clip: content-box; }

table.rent td.num { text-align: right; } table.rent td:first-child { font-weight: inherit; }

/* ============ Cloud : connexion, synchro, réglages ============ */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: max(24px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom)); }
.auth-card { width: 100%; max-width: 420px; padding: 26px 26px 20px; display: flex; flex-direction: column; gap: 14px; }
.auth-card .brand { padding: 0 0 4px; }
.auth-card h1 { font-size: 22px; letter-spacing: -.02em; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form .btn { justify-content: center; }
.auth-links { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px; }
input[type=email], input[type=password] { width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 9px 12px; outline: none; min-height: 38px; }
input.otp { font: 700 26px/1 var(--mono); letter-spacing: .35em; text-align: center; padding: 12px; }
.qr { display: grid; place-items: center; padding: 8px; background: #fff; border-radius: 12px; width: max-content; margin: 0 auto; }
.secret { font: 600 13px var(--mono); background: var(--hover); padding: 2px 6px; border-radius: 6px; user-select: all; word-break: break-all; }
.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; color: var(--ink-2); }
.stack { display: flex; flex-direction: column; gap: 10px; }
.kv { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--ink-2); }
.kv b { color: var(--ink); word-break: break-all; text-align: right; }
.toggles { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; margin-top: 12px; }
.tg { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line-2); font-weight: 550; font-size: 13px; }
.dot-off, .dot-warn { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; }
.dot-off { background: var(--ink-3); } .dot-warn { background: var(--warn); }
.tbl tr.pending td { opacity: .65; }
.tbl tr.pending td.c-amt::after { content: "⟳"; margin-left: 4px; color: var(--warn-ink); }
.m-only { display: none; }
.tabbar { display: none; }
.morelist { display: flex; flex-direction: column; }
.morelist a { display: flex; align-items: center; gap: 14px; padding: 15px 4px; border-bottom: 1px solid var(--line-2); color: var(--ink); text-decoration: none; font-weight: 600; font-size: 16px; }
.morelist a > svg:last-child { margin-inline-start: auto; color: var(--ink-3); }
.morelist a.on { color: var(--accent); }
.morelist .count { font-size: 11px; font-weight: 700; background: var(--crit); color: #fff; border-radius: 99px; padding: 1px 7px; }
.syncline { padding: 14px 4px 4px; color: var(--ink-3); font-size: 13px; }

/* ============ Mobile (iPhone) ============ */
@media (max-width: 760px) {
  body { font-size: 15px; }
  .app { grid-template-columns: 1fr; height: 100dvh; }
  .side { display: none; }
  .main { height: 100dvh; }
  .top { padding: calc(8px + env(safe-area-inset-top)) 12px 8px; gap: 6px 8px; flex-wrap: wrap; }
  .top h1 { flex-basis: 100%; }
  .top .seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .top::-webkit-scrollbar { display: none; }
  .top h1 { font-size: 19px; white-space: nowrap; }
  .top .sub { display: none; }
  .top .seg button { padding: 6px 10px; font-size: 13px; }
  .pillbtn { padding: 7px 10px; font-size: 13px; white-space: nowrap; }
  .scroll { padding: 12px 12px calc(92px + env(safe-area-inset-bottom)); -webkit-overflow-scrolling: touch; }
  .page { gap: 12px; }
  .card { padding: 14px; border-radius: 16px; }
  .card > header { flex-wrap: wrap; margin-bottom: 10px; }
  .card > header .right { margin-left: 0; width: 100%; flex-wrap: wrap; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 12px 13px; }
  .kpi .v { font-size: 21px; }
  .kpi .spark { display: none; }
  .kpi .d { font-size: 11.5px; }
  .grid2, .grid3, .toggles { grid-template-columns: 1fr; }
  .row2, .row2e { gap: 12px; }
  kbd { display: none; }
  input, select, textarea { font-size: 16px !important; }   /* évite le zoom automatique d'iOS */
  .amount { font-size: 30px !important; }
  .btn { min-height: 40px; }
  .btn.sm { min-height: 34px; }
  .filters select { min-width: 0; flex: 1 1 45%; }
  .filters .grow { min-width: 100%; }
  .bl .it { grid-template-columns: minmax(80px, 120px) 1fr auto; gap: 8px; }
  .tbl { font-size: 14px; }
  .tbl th, .tbl td { padding: 9px 6px; }
  .card:has(> .tbl), .card > .tbl { overflow-x: auto; }
  table.rent th:first-child, table.rent td:first-child { min-width: 118px; padding: 8px; }
  table.rent .lot span { display: none; }
  .tbl .acts { opacity: 1; }
  .thr .mk span, .thr .mk em { font-size: 10px; }

  /* listes d'opérations en cartes */
  .txlist thead { display: none; }
  .txlist tr { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 10px; padding: 10px 2px; border-bottom: 1px solid var(--line-2); }
  .txlist td { padding: 0 !important; border: 0 !important; }
  .txlist td.c-date, .txlist td.c-cat, .txlist td.c-act, .txlist td.c-nat { display: none; }
  .txlist td.c-lib .lib { font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .txlist td.c-lib { min-width: 0; }
  .txlist .m-only { display: inline; }
  .txlist tfoot tr { display: block; }
  .txlist tfoot td { display: block; text-align: left !important; padding: 8px 2px !important; }

  /* fenêtres = feuilles plein écran venant du bas */
  .overlay { padding: 0; align-items: flex-end; }
  .modal { max-width: none !important; border-radius: 20px 20px 0 0; max-height: 94dvh; display: flex; flex-direction: column; animation: sheet .22s cubic-bezier(.2, .8, .2, 1); }
  .modal .body { overflow-y: auto; padding: 8px 16px 8px; -webkit-overflow-scrolling: touch; }
  .modal > header { padding: 14px 16px 6px; }
  .modal > header::before { content: ""; position: absolute; left: 50%; top: 6px; width: 38px; height: 4px; border-radius: 9px; background: var(--line); transform: translateX(-50%); }
  .modal { position: relative; }
  .modal > footer { padding: 10px 16px calc(12px + env(safe-area-inset-bottom)); flex-wrap: wrap; border-top: 1px solid var(--line-2); }
  .modal > footer .btn.lg { flex: 1; justify-content: center; }
  .pop { left: 8px !important; right: 8px; max-height: 80dvh; overflow: auto; }
  .period { grid-template-columns: 1fr; }
  .period .presets { border-right: 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr 1fr; }
  .period .mp { width: auto; }
  .toasts { left: 12px; right: 12px; bottom: calc(84px + env(safe-area-inset-bottom)); align-items: center; }
  .toast { max-width: 100%; }

  /* barre d'onglets */
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); align-items: end; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
  .tabbar a, .tabbar button { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 0; border: 0; background: none; color: var(--ink-3); text-decoration: none; font-size: 10.5px; font-weight: 600; }
  .tabbar a.on, .tabbar button.on { color: var(--ink); }
  .tabbar .fab { width: 54px; height: 54px; border-radius: 18px; background: var(--accent); color: var(--accent-ink); justify-self: center; margin-bottom: 4px; box-shadow: var(--shadow-lg); display: grid; place-items: center; padding: 0; }
  .tabbar .dotn { position: absolute; top: 0; left: calc(50% + 6px); font-style: normal; font-size: 10px; font-weight: 700; background: var(--crit); color: #fff; border-radius: 99px; padding: 0 5px; min-width: 16px; text-align: center; }
}
@keyframes sheet { from { transform: translateY(40px); opacity: .4; } }
@media (hover: none) { .tbl tbody tr:hover { background: none; } .btn:hover { box-shadow: none; } }

.userbox { display: flex; align-items: center; gap: 7px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); color: var(--ink-2); }
.userbox span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.morelogout { display: flex; align-items: center; gap: 14px; padding: 15px 4px; border: 0; border-bottom: 1px solid var(--line-2); background: none; color: var(--crit-ink); font-weight: 650; font-size: 16px; text-align: left; width: 100%; }
.morelogout small { display: block; color: var(--ink-3); font-weight: 450; font-size: 12.5px; }
.fxbox { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 10px 14px; margin-top: 12px; }
.fxbox b { font-size: 16px; }

.pbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pchip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 7px 14px; font-weight: 650; color: var(--ink-2); }
.pchip.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.pchip.add { border-style: dashed; }
.pcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-top: 14px; }
.pcard { border: 1px solid var(--line); border-radius: 14px; padding: 14px; cursor: pointer; background: var(--surface-2); display: flex; flex-direction: column; gap: 4px; }
.pcard:hover { border-color: var(--ink-3); }
.pdetail { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.pdetail b { font-size: 17px; }
.pdetail .sub { display: block; color: var(--ink-3); font-size: 12.5px; }
.invlink { margin: 8px 0; }
.readonly-banner { background: var(--info-bg); color: var(--info-ink); border-radius: 10px; padding: 8px 12px; font-weight: 600; font-size: 13px; }
@media (max-width: 760px) { .pbar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; } .pchip { white-space: nowrap; } }

.chartctl { display: flex; gap: 8px; flex-wrap: wrap; margin: -4px 0 12px; }
.seg.sm button { padding: 4px 10px; font-size: 12.5px; }
.cashlist { display: flex; flex-direction: column; }
.cashrow { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.cashrow .sub { display: block; color: var(--ink-3); font-size: 12px; }
.cashrow .v { font-size: 17px; font-weight: 700; text-align: right; }
.cashrow .v .sub { font-size: 12px; font-weight: 500; }
.cashrow.total { border-bottom: 0; }
.cashrow.total .v { font-size: 20px; }
.health { display: flex; align-items: center; gap: 16px; margin-bottom: 10px; }
.hlabel { font-size: 20px; font-weight: 750; }
.hlabel.good { color: var(--good-ink); } .hlabel.warn { color: var(--warn-ink); } .hlabel.bad { color: var(--crit-ink); }
.hind { display: flex; flex-direction: column; gap: 2px; }
.hi { display: flex; gap: 10px; padding: 8px 10px; border-radius: 12px; align-items: flex-start; }
.hi i { flex: none; width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; }
.hi.good { background: color-mix(in srgb, var(--good-bg) 55%, transparent); } .hi.warn { background: color-mix(in srgb, var(--warn-bg) 70%, transparent); } .hi.bad { background: color-mix(in srgb, var(--crit-bg) 70%, transparent); }
.hi .sub { display: block; color: var(--ink-2); font-size: 12.5px; }
.hi .hv { font-weight: 600; color: var(--ink-3); margin-left: 4px; }
.alert.bad { border-left: 4px solid var(--crit); } .alert.warn { border-left: 4px solid var(--warn); } .alert.info { border-left: 4px solid var(--info-ink); } .alert.good { border-left: 4px solid var(--good); }

/* ============ Cartes repliables / plein écran / tri ============ */
.card > header { flex-wrap: wrap; }
.cardtools { display: flex; gap: 2px; margin-left: 4px; order: 99; }
.card > header .right + .cardtools, .card > header .right ~ .cardtools { margin-left: 4px; }
.card > header h2.clickable { cursor: pointer; user-select: none; }
.card.collapsed > :not(header) { display: none !important; }
.card.collapsed > header { margin-bottom: 0; }
.card.collapsed { padding-bottom: 14px; }
/* Carte agrandie : voile sombre dessiné par l'ombre de la carte elle-même (jamais de flou, jamais de voile orphelin) */
.card.maxed { position: fixed; inset: 18px; z-index: 95; overflow: auto; max-width: none; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .42), var(--shadow-lg); }
body.has-max { overflow: hidden; }
.tbl th.sortable { cursor: pointer; user-select: none; }
.tbl th.sortable:hover { color: var(--ink); }
.tbl th.sorted { color: var(--accent-blue, var(--ink)); }
.tbl th[data-dir="asc"]::after { content: " ▲"; font-size: 9px; } .tbl th[data-dir="desc"]::after { content: " ▼"; font-size: 9px; }
.tbl th.dragging { opacity: .4; } .tbl th.dropping { box-shadow: inset 2px 0 0 var(--accent-blue, var(--ink)); }
@media (max-width: 760px) { .card.maxed { inset: 0; border-radius: 0; padding-top: calc(14px + env(safe-area-inset-top)); } }

.alloc { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; justify-content: center; }
.legendv { display: flex; flex-direction: column; gap: 6px; min-width: 180px; flex: 1; }
.legendv div { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.legendv i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legendv span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.prefrow { display: flex; gap: 6px; margin-top: 8px; }
.prefsel { width: auto !important; min-height: 30px !important; padding: 4px 8px !important; font-size: 12.5px !important; border-radius: 8px !important; flex: 1; }
[dir="rtl"] body { font-family: -apple-system, "SF Arabic", "Segoe UI", Tahoma, "Noto Sans Arabic", sans-serif; }
[dir="rtl"] .side { border-right: 0; border-left: 1px solid var(--line); }
[dir="rtl"] .toasts { right: auto; left: 20px; }
[dir="rtl"] .filters .grow svg { left: auto; right: 11px; } [dir="rtl"] .filters .grow input { padding-left: 12px; padding-right: 36px; }
[dir="rtl"] svg.i path[d^="m9 18"], [dir="rtl"] svg.i path[d^="m15 18"] { transform: scaleX(-1); transform-origin: center; }
[dir="rtl"] .num, [dir="rtl"] input.amount, [dir="rtl"] .chart, [dir="rtl"] code { direction: ltr; unicode-bidi: isolate; }
[dir="rtl"] .tbl th, [dir="rtl"] .tbl td { text-align: start; } [dir="rtl"] .tbl .r { text-align: end; }
[dir="rtl"] .alert.bad, [dir="rtl"] .alert.warn, [dir="rtl"] .alert.info, [dir="rtl"] .alert.good { border-left-width: 1px; border-right-width: 4px; border-right-style: solid; }

/* ============ Style iOS ============ */
body { letter-spacing: -.01em; }
.card { border: 0; box-shadow: var(--shadow); border-radius: var(--radius); }
:root[data-theme="dark"] .card { border: 0; }
.card > header h2 { font-size: 17px; font-weight: 650; letter-spacing: -.02em; }
.kpi .v { font-weight: 700; letter-spacing: -.03em; }
.btn { border-radius: 12px; border-color: transparent; background: var(--hover); color: var(--accent-blue); font-weight: 600; }
.btn:hover { background: color-mix(in srgb, var(--hover) 160%, transparent); box-shadow: none; }
.btn.primary { background: var(--accent); color: #fff; border-color: transparent; }
.btn.primary:hover { filter: brightness(1.08); background: var(--accent); }
.btn.danger { color: var(--crit); }
.btn.ghost { background: transparent; color: var(--accent-blue); }
.btn.sm { border-radius: 10px; }
.btn.lg { border-radius: 14px; }
.seg { background: rgba(118, 118, 128, .12); border-radius: 10px; padding: 2px; }
.seg button { border-radius: 8px; color: var(--ink); font-weight: 550; padding: 6px 14px; }
.seg button.on { background: var(--surface); box-shadow: 0 3px 8px rgba(0, 0, 0, .12), 0 3px 1px rgba(0, 0, 0, .04); font-weight: 650; }
:root[data-theme="dark"] .seg button.on { background: #636366; }
.toggle { width: 51px; height: 31px; background: rgba(120, 120, 128, .16); }
.toggle::after { top: 2px; left: 2px; width: 27px; height: 27px; box-shadow: 0 3px 8px rgba(0, 0, 0, .15), 0 3px 1px rgba(0, 0, 0, .06); }
.toggle.on { background: var(--good); } .toggle.on::after { transform: translateX(20px); }
[dir="rtl"] .toggle.on::after { transform: translateX(-20px); } [dir="rtl"] .toggle::after { left: auto; right: 2px; }
.nav a { border-radius: 10px; color: var(--ink); font-weight: 500; }
.nav a svg { color: var(--accent-blue); }
.nav a.on { background: var(--accent); color: #fff; }
.nav a.on svg { color: #fff; }
.side { background: color-mix(in srgb, var(--bg) 70%, var(--surface)); border-right: 0; }
.brand .logo { background: #000; color: #fff; border-radius: 10px; }
:root[data-theme="dark"] .brand .logo { background: #000; color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22); }   /* logo TOUJOURS noir : en mode sombre, un fin liseré le détache du fond */
.top { background: color-mix(in srgb, var(--bg) 82%, transparent); border-bottom: 0; }
.top h1 { font-size: 30px; font-weight: 750; letter-spacing: -.03em; }
input[type=text], input[type=number], input[type=date], input[type=month], input[type=search], input[type=email], input[type=password], input[type=tel], select, textarea { border-radius: 12px; background: var(--surface-2); border-color: transparent; }
input:focus, select:focus, textarea:focus { border-color: var(--accent-blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-blue) 20%, transparent); background: var(--surface); }
.pill { border-radius: 8px; font-weight: 600; }
.chip { border-radius: 8px; }
.cat { border-radius: 12px; border-color: transparent; background: var(--surface-2); color: var(--ink); }
.cat.on { background: var(--accent); color: #fff; }
.modal { border-radius: 22px; border: 0; }
.pchip { border-color: transparent; background: var(--hover); color: var(--ink); }
.pchip.on { background: var(--accent); color: #fff; }
.alert { background: var(--surface-2); border-color: transparent; border-radius: 14px; }
.tbl th { color: var(--ink-3); font-weight: 600; text-transform: none; letter-spacing: 0; font-size: 12.5px; }
.tabbar a.on, .tabbar button.on { color: var(--accent-blue); }
.tabbar .fab { background: var(--accent); border-radius: 50%; box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 40%, transparent); }
.toast { border-radius: 14px; background: color-mix(in srgb, var(--ink) 88%, transparent); color: var(--surface); backdrop-filter: blur(10px); }
.dot-ok { background: var(--good); }
.hi { border-radius: 14px; }
@media (max-width: 760px) { .top h1 { font-size: 28px; } .card { border-radius: 16px; } }

@media (max-width: 760px) {
  .card { position: relative; }
  .card > header:has(.cardtools) { padding-inline-end: 70px; }
  .cardtools { position: absolute; top: 10px; inset-inline-end: 8px; margin: 0; }
  .card.maxed .cardtools { top: calc(10px + env(safe-area-inset-top)); }
}
.card:has(> .tbl), .card:has(> table) { overflow-x: auto; }
.card:has(> .tbl) > .tbl { min-width: 100%; }

/* ============ v3 : santé par domaine, comparaison pays, immobilier, confidentialité ============ */
.hscore { font-weight: 650; color: var(--ink-3); font-size: 15px; }
.hgroup + .hgroup { margin-top: 8px; }
.hgrp { display: flex; align-items: center; gap: 8px; margin: 10px 0 4px; }
.hgs { margin-inline-start: auto; font-weight: 750; font-size: 12.5px; padding: 1px 8px; border-radius: 8px; background: var(--hover); color: var(--ink-2); text-transform: none; letter-spacing: 0; }
.hgs.good { background: var(--good-bg); color: var(--good-ink); } .hgs.warn { background: var(--warn-bg); color: var(--warn-ink); } .hgs.bad { background: var(--crit-bg); color: var(--crit-ink); }
.hi .advice { display: flex; gap: 5px; align-items: flex-start; margin-top: 3px; font-size: 12px; color: var(--ink-2); font-weight: 550; }
.hi .advice .i { flex: none; margin-top: 2px; color: var(--info-ink); }
.hnext { background: var(--surface-2); border-radius: 14px; padding: 10px 14px; margin: 4px 0 10px; font-size: 13px; display: flex; flex-direction: column; gap: 4px; }
.hnext b { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }
.hnext .gain { display: inline-block; min-width: 62px; margin-inline-end: 6px; font-weight: 750; color: var(--good-ink); }
.hnext > div > b { text-transform: none; letter-spacing: 0; font-size: 13px; color: var(--ink); }
.hnext.ok { flex-direction: row; align-items: center; gap: 6px; color: var(--good-ink); font-weight: 650; background: var(--good-bg); }
.actions { display: flex; flex-direction: column; gap: 8px; }
.act { display: flex; gap: 12px; align-items: flex-start; padding: 8px 12px; background: var(--surface-2); border-radius: 12px; }
.act > b { color: var(--good-ink); min-width: 56px; }
.act .sub { display: block; color: var(--ink-2); font-size: 12.5px; font-weight: 450; }
tr.total td { border-top: 1px solid var(--line); }
tr.apart td { color: var(--ink-3); border-top: 1px dashed var(--line); }
.cashsep { margin: 14px 0 2px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }
.cashrow.apart .v { color: var(--ink-3); }
/* comparaison pays */
.cmpblock + .cmpblock { margin-top: 16px; }
.cmphead { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.cmprow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.cmpcell { background: var(--surface-2); border-radius: 16px; padding: 12px 14px; }
.cmpfl { font-size: 13px; font-weight: 650; color: var(--ink-2); }
.cmptop { font-size: 26px; font-weight: 780; letter-spacing: -.02em; margin-top: 2px; }
.cmpsub { font-size: 12px; color: var(--ink-3); margin-top: -2px; }
.cmpbar { height: 6px; border-radius: 4px; background: var(--line); margin: 8px 0 6px; overflow: hidden; }
.cmpbar i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.cmpmed { font-size: 12px; color: var(--ink-2); font-weight: 550; }
.cmpsave { margin-top: 14px; font-size: 13px; }
@media (max-width: 760px) { .cmprow { grid-template-columns: 1fr; } .cmptop { font-size: 22px; } }
/* immobilier : associés, capital, analyses */
.assoc { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin: 10px 0 14px; }
.assoc .ac { background: var(--surface-2); border-radius: 16px; padding: 14px; }
.assoc .ac h3 { font-size: 15px; font-weight: 700; display: flex; justify-content: space-between; gap: 8px; }
.assoc .ac dl { margin: 8px 0 0; display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; font-size: 13px; }
.assoc .ac dt { color: var(--ink-3); } .assoc .ac dd { margin: 0; text-align: right; font-weight: 600; }
.assoc .ac.big dd.v { font-size: 17px; font-weight: 750; }
.owe { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 14px; background: var(--warn-bg); color: var(--warn-ink); font-weight: 650; margin-bottom: 8px; }
.owe.ok { background: var(--good-bg); color: var(--good-ink); }
.owe .i { flex: none; }
.insights { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.insight { border-radius: 16px; padding: 12px 14px; background: var(--surface-2); border-inline-start: 4px solid var(--line); }
.insight.good { border-color: var(--good); } .insight.warn { border-color: var(--warn); } .insight.bad { border-color: var(--crit); } .insight.info { border-color: var(--accent); }
.insight .it { display: flex; justify-content: space-between; gap: 8px; font-weight: 700; font-size: 13.5px; }
.insight .iv { font-weight: 780; }
.insight p { margin: 4px 0 0; font-size: 12.5px; color: var(--ink-2); }
.insight .adv { margin-top: 5px; font-size: 12px; color: var(--ink-3); font-weight: 550; }
.lotsbar { display: flex; flex-wrap: wrap; gap: 8px; }
.filebox .row { flex-wrap: wrap; }
/* mode confidentialité : voir privacy.js (texte remplacé par •••• ) et revolut.css */

/* ============ verrouillage biométrique ============ */
.lockscreen { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 24px; background: var(--bg); }
.lockcard { width: min(380px, 100%); display: flex; flex-direction: column; gap: 14px; align-items: stretch; text-align: center; }
.lockcard .brand { justify-content: center; padding: 0 0 8px; }
.lockcard h1 { font-size: 24px; letter-spacing: -.02em; }
html.is-locked body { overflow: hidden; }

/* ============ glisser pour supprimer ============ */
/* Glisser pour supprimer : la ligne reste en place (rien ne déborde de la carte), seules les cellules glissent et le bouton
   rouge grandit depuis le bord, dans la hauteur exacte de la ligne. Aucun gris résiduel : pas de survol « collant » au doigt,
   pas de surbrillance d'appui iOS, et l'état revient entièrement à zéro quand la ligne se referme. */
.swipe-row { --sx: 0px; --row-bg: var(--surface); position: relative; touch-action: pan-y; background: transparent !important; clip-path: inset(0); user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; }
.swipe-row > td { position: relative; z-index: 1; background: var(--row-bg); transform: translateX(var(--sx)); transition: transform .26s cubic-bezier(.22, .9, .3, 1), background-color .12s; will-change: transform; }
.swipe-row.dragging > td, .swipe-row.dragging > .swipe-del { transition: none; }
@media (hover: hover) and (pointer: fine) { .swipe-row:not(.swiped):not(.dragging):hover { --row-bg: color-mix(in srgb, var(--ink) 4%, var(--surface)); } }
.swipe-del { position: absolute; top: 0; bottom: 0; z-index: 0; width: 0; padding: 0; border: 0; background: #e5352b; color: #fff; font: inherit; font-weight: 700; font-size: 13px; letter-spacing: -.01em; display: none; align-items: center; overflow: hidden; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: width .26s cubic-bezier(.22, .9, .3, 1); }
.swipe-del .swipe-lbl { flex: 0 0 96px; width: 96px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; white-space: nowrap; }
.swipe-del.left { left: 0; justify-content: flex-end; border-radius: 12px 0 0 12px; width: max(0px, var(--sx)); }
.swipe-del.right { right: 0; justify-content: flex-start; border-radius: 0 12px 12px 0; width: max(0px, calc(var(--sx) * -1)); }
.swipe-del:active { background: #c92a21; }
.swipe-row.show-left > .swipe-del.left, .swipe-row.show-right > .swipe-del.right { display: flex; }
.toast .toast-act { margin-inline-start: 12px; font: inherit; font-weight: 750; color: inherit; background: rgba(255, 255, 255, .18); border: 0; border-radius: 8px; padding: 4px 10px; cursor: pointer; }

/* ============ Relevé de soldes / Mes comptes : listes lisibles sur iPhone comme sur ordinateur ============ */
.relist { display: flex; flex-direction: column; }
.relrow { display: grid; grid-template-columns: minmax(0, 1fr) 168px; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line-2); cursor: text; }
.relrow:last-child { border-bottom: 0; }
.rel-name { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.rel-name b { font-weight: 650; font-size: 15px; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rel-name small { font-size: 12.5px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rel-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--ink-3); }
.rel-dot.ok { background: var(--good, #1a9e5c); }
.rel-amt { position: relative; display: block; }
.rel-amt input { width: 100%; text-align: right; padding-inline-end: 46px !important; font-variant-numeric: tabular-nums; }
.rel-amt.long input { padding-inline-end: 58px !important; }
.rel-amt em { position: absolute; inset-inline-end: 14px; top: 50%; transform: translateY(-50%); font-style: normal; font-size: 13px; font-weight: 600; color: var(--ink-3); pointer-events: none; }

.acclist { display: flex; flex-direction: column; }
.acc-head, .accrow { display: grid; grid-template-columns: minmax(0, 1fr) 92px auto 40px; gap: 10px; align-items: center; }
.acc-head { font-size: 12.5px; font-weight: 600; color: var(--ink-3); padding: 0 2px 8px; border-bottom: 1px solid var(--line-2); }
.accrow { padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.accrow:last-child { border-bottom: 0; }
.acc-name input { width: 100%; font-weight: 600; }
.accrow select { width: 100%; }
.acc-dispo button { min-width: 46px; justify-content: center; }
.acc-del { justify-self: end; }
@media (max-width: 560px) {
  .relrow { grid-template-columns: minmax(0, 1fr) 152px; gap: 12px; }
  .acc-head { display: none; }
  .accrow { grid-template-columns: 96px auto 1fr; grid-template-areas: "name name name" "cur dispo del"; row-gap: 8px; }
  .acc-name { grid-area: name; } .accrow select { grid-area: cur; } .acc-dispo { grid-area: dispo; } .acc-del { grid-area: del; }
}
