/* Mise en page : barre latérale claire groupée par thèmes + espace de travail en cartes ; barre d'onglets en bas sur mobile.
   Palette « océan » : bleu Pacifique, mangue et hibiscus en accents, neutres légèrement bleutés. */
:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #eef1f8;
  --ink: #141c33;
  --muted: #5d6782;
  --line: #e0e5ef;
  --lagon: #2459d6;
  --lagon-ink: #ffffff;
  --lagon-soft: #e5ecfd;
  --mangue: #f2a43a;
  --mangue-soft: #fdf0dc;
  --hibiscus: #e2546b;
  --hibiscus-soft: #fde6ea;
  --ok: #1f9d63;
  --ok-soft: #dcf3e7;
  --warn: #c47a12;
  --warn-soft: #fcefd8;
  --bad: #d43f3a;
  --bad-soft: #fde3e1;
  --info: #7559d9;
  --info-soft: #ece7fb;
  --vacant: #b4bccd;
  --nav: #ffffff;
  --nav-ink: #47516d;
  --nav-active: #e8eefc;
  --glass: rgba(255, 255, 255, .74);
  --glass-item: rgba(255, 255, 255, .78);
  --glass-line: rgba(255, 255, 255, .9);
  --shadow: 0 1px 2px rgba(20, 28, 51, .05), 0 8px 28px rgba(20, 28, 51, .07);
  --overlay: rgba(14, 22, 45, .42);

  --font-display: "Sora", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;

  --radius: 14px;
  --radius-sm: 9px;
  --gutter: 16px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c1120; --surface: #141b2d; --surface-2: #1b2440; --ink: #e7ebf6; --muted: #95a0bd; --line: #262f4b;
    --lagon: #7098ff; --lagon-ink: #0a1230; --lagon-soft: #1c2a55; --mangue: #f5b65a; --mangue-soft: #3a2c13;
    --hibiscus: #f27d90; --hibiscus-soft: #43202a; --ok: #4ccb8c; --ok-soft: #13311f; --warn: #f2a845; --warn-soft: #3a2a12;
    --bad: #f26d66; --bad-soft: #43201e; --info: #a68dff; --info-soft: #262047; --vacant: #4b5570;
    --nav: #10172a; --nav-ink: #b3bdd6; --nav-active: #1c2a52;
    --glass: rgba(16, 23, 42, .72); --glass-item: rgba(27, 36, 64, .78); --glass-line: rgba(255, 255, 255, .12);
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 28px rgba(0,0,0,.28); --overlay: rgba(0,0,0,.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0c1120; --surface: #141b2d; --surface-2: #1b2440; --ink: #e7ebf6; --muted: #95a0bd; --line: #262f4b;
  --lagon: #7098ff; --lagon-ink: #0a1230; --lagon-soft: #1c2a55; --mangue: #f5b65a; --mangue-soft: #3a2c13;
  --hibiscus: #f27d90; --hibiscus-soft: #43202a; --ok: #4ccb8c; --ok-soft: #13311f; --warn: #f2a845; --warn-soft: #3a2a12;
  --bad: #f26d66; --bad-soft: #43201e; --info: #a68dff; --info-soft: #262047; --vacant: #4b5570;
  --nav: #10172a; --nav-ink: #b3bdd6; --nav-active: #1c2a52;
  --glass: rgba(16, 23, 42, .72); --glass-item: rgba(27, 36, 64, .78); --glass-line: rgba(255, 255, 255, .12);
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 28px rgba(0,0,0,.28); --overlay: rgba(0,0,0,.6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
h1, h2, h3, h4 { font-family: var(--font-display); margin: 0; text-wrap: balance; letter-spacing: -.01em; }
h1 { font-size: 1.75rem; font-weight: 700; }
h2 { font-size: 1.15rem; font-weight: 600; }
h3 { font-size: 1rem; font-weight: 600; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--lagon); }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.eyebrow { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
:focus-visible { outline: 2px solid var(--lagon); outline-offset: 2px; border-radius: 6px; }

/* ---------- Structure ---------- */
.app { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100%; }
.sidebar {
  position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto;
  background: var(--nav); color: var(--nav-ink); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 4px;
  padding: 20px 14px 16px;
  padding-left: max(14px, env(safe-area-inset-left, 0px));
}
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 16px; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; flex: none;
  background: linear-gradient(145deg, #6f9bff, #2459d6 55%, #1b3fa6); color: #fff;
  box-shadow: 0 4px 12px rgba(36, 89, 214, .3);
}
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; color: var(--ink); line-height: 1.1; }
.brand-sub { font-size: .72rem; color: var(--muted); }
.nav { display: flex; flex-direction: column; gap: 14px; }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; color: var(--muted); opacity: .8; padding: 0 12px 4px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px;
  color: var(--nav-ink); text-decoration: none; font-weight: 500; position: relative;
  transition: background .15s, color .15s;
}
.nav a svg { color: var(--muted); transition: color .15s; }
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a:hover svg { color: var(--ink); }
.nav a.active { background: var(--nav-active); color: var(--lagon); font-weight: 600; }
.nav a.active svg { color: var(--lagon); }
.nav a.active::before { content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--lagon); }
.nav .badge-count { margin-left: auto; font-size: .7rem; font-weight: 700; padding: 1px 8px; border-radius: 99px; background: var(--bad-soft); color: var(--bad); font-variant-numeric: tabular-nums; }
.nav .badge-count.b-info { background: var(--lagon-soft); color: var(--lagon); }
.nav .badge-count.b-warn { background: var(--mangue-soft); color: var(--warn); }
.nav svg { flex: none; }
.nav .l-short { display: none; }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding-top: 14px; }
.robot-card { border-radius: 14px; padding: 12px 14px; background: linear-gradient(140deg, var(--lagon-soft), var(--surface-2)); display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--ink); }
.robot-card .rc-top { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: .85rem; }
.robot-card .rc-sub { font-size: .74rem; color: var(--muted); }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(31, 157, 99, .5); animation: pulse 2s infinite; flex: none; }
.pulse.off { background: var(--vacant); animation: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(31, 157, 99, .45); } 70% { box-shadow: 0 0 0 8px rgba(31, 157, 99, 0); } 100% { box-shadow: 0 0 0 0 rgba(31, 157, 99, 0); } }
.user-card { display: flex; align-items: center; gap: 10px; padding: 10px 6px 2px; border-top: 1px solid var(--line); }
.user-card .uc-txt { flex: 1; min-width: 0; }
.user-card b { display: block; font-size: .86rem; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-card .uc-txt span { display: block; font-size: .72rem; color: var(--muted); }
.side-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.side-tool { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 8px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--nav-ink); cursor: pointer; font-size: .78rem; font-weight: 500; white-space: nowrap; }
.side-tool:hover { border-color: var(--lagon); color: var(--ink); }
.icon-btn { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); display: grid; place-items: center; cursor: pointer; flex: none; position: relative; }
.icon-btn:hover { color: var(--ink); border-color: var(--lagon); }
.icon-btn .dot { position: absolute; top: 6px; right: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--hibiscus); border: 2px solid var(--surface); }
.demo-note { font-size: .7rem; color: var(--muted); padding: 0 6px; line-height: 1.4; }

.main {
  min-width: 0;
  padding-block: 26px 48px;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}
.page { max-width: 1320px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); margin-top: 4px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

@media (min-width: 901px) { :root { --gutter: 32px; } }
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: auto; z-index: 40;
    flex-direction: row; padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px));
    padding-left: max(6px, env(safe-area-inset-left, 0px)); padding-right: max(6px, env(safe-area-inset-right, 0px));
    box-shadow: 0 -6px 24px rgba(20, 28, 51, .1); border-right: 0; border-top: 1px solid var(--line); overflow: visible;
  }
  .brand, .sidebar-foot, .demo-note, .nav-label { display: none; }
  .nav-group { display: contents; }
  .nav { flex-direction: row; gap: 0; width: 100%; justify-content: space-between; overflow-x: auto; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { flex-direction: column; gap: 2px; padding: 6px 2px; font-size: .64rem; flex: 1 0 58px; text-align: center; min-width: 58px; }
  .nav .l-long { display: none; }
  .nav .l-short { display: inline; }
  .nav a.active { background: transparent; }
  .nav a.active::before { left: 30%; right: 30%; top: -6px; bottom: auto; height: 3px; width: auto; border-radius: 0 0 3px 3px; }
  .nav .badge-count { position: absolute; top: 2px; right: 18%; margin: 0; padding: 0 5px; font-size: .6rem; }
  .main { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
  .mobile-top { display: flex !important; }
}
.mobile-top { display: none; align-items: center; justify-content: space-between; gap: 10px; }
.mobile-top .brand-name { color: var(--ink); }

/* ---------- Boutons, champs, pastilles ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  padding: 8px 14px; border-radius: 10px; cursor: pointer; font-weight: 500; font-size: .88rem;
  transition: transform .08s, background .15s, border-color .15s; white-space: nowrap; text-decoration: none;
}
.btn:hover { border-color: var(--lagon); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--lagon); border-color: var(--lagon); color: var(--lagon-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.accent { background: var(--mangue); border-color: var(--mangue); color: #2b1d05; }
.btn.danger { color: var(--bad); }
.btn.danger:hover { border-color: var(--bad); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { padding: 5px 10px; font-size: .8rem; border-radius: 8px; }
.btn.icon { padding: 7px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field label { font-size: .8rem; font-weight: 600; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 9px; padding: 9px 11px;
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--lagon); box-shadow: 0 0 0 3px var(--lagon-soft); }
textarea.input { resize: vertical; min-height: 90px; line-height: 1.5; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 560px) { .form-grid { grid-template-columns: minmax(0, 1fr); } }

.search { position: relative; min-width: 0; }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search .input { padding-left: 36px; min-width: 220px; }
@media (max-width: 560px) { .search .input { min-width: 0; } }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line); background: var(--surface); padding: 6px 12px; border-radius: 99px;
  cursor: pointer; font-size: .82rem; font-weight: 500; display: inline-flex; gap: 6px; align-items: center;
}
.chip .n { color: var(--muted); font-variant-numeric: tabular-nums; }
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip.on .n { color: inherit; opacity: .7; }

.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 99px;
  font-size: .75rem; font-weight: 600; white-space: nowrap;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.info { background: var(--info-soft); color: var(--info); }
.pill.neutral { background: var(--surface-2); color: var(--muted); }
.pill.lagon { background: var(--lagon-soft); color: var(--lagon); }

.grade { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; font-weight: 700; font-family: var(--font-display); font-size: .85rem; }
.grade.A { background: var(--ok-soft); color: var(--ok); }
.grade.B { background: var(--lagon-soft); color: var(--lagon); }
.grade.C { background: var(--warn-soft); color: var(--warn); }
.grade.D { background: var(--bad-soft); color: var(--bad); }

.avatar {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none;
  font-weight: 700; font-size: .8rem; font-family: var(--font-display); color: #fff;
}
.avatar.lg { width: 56px; height: 56px; font-size: 1.1rem; }

/* ---------- Cartes ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head .hint { font-size: .8rem; color: var(--muted); }

/* ---------- Tableau de bord ---------- */
.hero {
  position: relative; border-radius: 18px; overflow: hidden; min-height: 190px;
  display: flex; align-items: flex-end; color: #fff; background: #0b3b3d;
}
.hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 60%; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(14,26,62,.62) 0%, rgba(14,26,62,.34) 42%, rgba(14,26,62,0) 72%); }
.hero-body { position: relative; z-index: 1; padding: 26px 28px; display: flex; flex-direction: column; gap: 6px; max-width: 640px; }
.hero h1 { font-size: 2rem; color: #fff; }
.hero p { color: rgba(255,255,255,.88); font-size: .95rem; }
.hero .hero-date { font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: #ffe3b0; font-weight: 600; }
.hero-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.hero .btn { border-color: rgba(255,255,255,.35); background: rgba(255,255,255,.12); color: #fff; backdrop-filter: blur(6px); }
.hero .btn.accent { background: var(--mangue); border-color: var(--mangue); color: #2b1d05; }
@media (max-width: 560px) { .hero h1 { font-size: 1.5rem; } .hero-body { padding: 20px; } }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpi { display: flex; flex-direction: column; gap: 6px; position: relative; overflow: hidden; }
.kpi .kpi-top { display: flex; align-items: center; justify-content: space-between; }
.kpi .kpi-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; }
.kpi .value { font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.kpi .value .unit { font-size: .85rem; font-weight: 600; color: var(--muted); margin-left: 4px; }
.kpi .foot { font-size: .8rem; color: var(--muted); }
.kpi .bar { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.kpi .bar span { display: block; height: 100%; border-radius: inherit; background: var(--lagon); animation: grow-x .9s ease-out both; transform-origin: left; }
@media (max-width: 560px) { .kpi .value { font-size: 1.25rem; } .kpis { gap: 10px; } .kpi { padding: 14px; } }

.dash-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 14px; }
.dash-grid-3 { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
@media (max-width: 1100px) { .dash-grid, .dash-grid-3 { grid-template-columns: minmax(0, 1fr); } }

.chart-wrap { width: 100%; overflow: hidden; }
.chart-wrap svg { width: 100%; height: auto; display: block; }
.chart-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: .8rem; color: var(--muted); }
.chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.chart-tip {
  position: fixed; z-index: 90; pointer-events: none; background: var(--ink); color: var(--bg);
  padding: 8px 10px; border-radius: 8px; font-size: .78rem; line-height: 1.4; box-shadow: var(--shadow); white-space: nowrap;
}
.bar-col { cursor: default; }
.bar-col rect.hit { fill: transparent; }
.bar-col:hover rect.paid { filter: brightness(1.1); }
@keyframes grow-y { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes grow-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.anim-y { transform-box: fill-box; transform-origin: bottom; animation: grow-y .7s cubic-bezier(.2,.8,.2,1) both; }

/* Objectif */
.goal { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.ring { position: relative; width: 168px; height: 168px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .ring-label { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring .ring-label b { font-family: var(--font-display); font-size: 2.1rem; line-height: 1; font-variant-numeric: tabular-nums; }
.ring .ring-label span { font-size: .75rem; color: var(--muted); margin-top: 4px; }
.ring circle.prog { transition: stroke-dashoffset 1s cubic-bezier(.2,.8,.2,1); }
.streak { display: inline-flex; align-items: center; gap: 6px; background: var(--mangue-soft); color: var(--warn); border-radius: 99px; padding: 4px 12px; font-weight: 600; font-size: .82rem; }

.badges { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; width: 100%; }
.badge-item { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; border-radius: 10px; text-align: center; }
.badge-item .medal { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.badge-item.won .medal { background: linear-gradient(145deg, var(--mangue), #d97a1a); color: #fff; box-shadow: 0 3px 10px rgba(233,160,50,.35); }
.badge-item span { font-size: .68rem; line-height: 1.25; color: var(--muted); }
.badge-item.won span { color: var(--ink); font-weight: 600; }

/* À faire */
.todo { display: flex; flex-direction: column; }
.todo-item { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.todo-item:first-child { border-top: 0; padding-top: 0; }
.todo-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.todo-ico.bad { background: var(--bad-soft); color: var(--bad); }
.todo-ico.warn { background: var(--warn-soft); color: var(--warn); }
.todo-ico.info { background: var(--info-soft); color: var(--info); }
.todo-ico.lagon { background: var(--lagon-soft); color: var(--lagon); }
.todo-txt { flex: 1; min-width: 0; }
.todo-txt b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.todo-txt span { font-size: .8rem; color: var(--muted); }
.empty { text-align: center; padding: 26px 12px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 8px; }

/* Carte du patrimoine */
.tiles { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; }
.tile {
  aspect-ratio: 1; border-radius: 7px; border: 0; cursor: pointer; padding: 0; max-width: 100%;
  font-size: .58rem; font-weight: 700; color: rgba(255,255,255,.92); display: grid; place-items: center;
  transition: transform .12s; font-variant-numeric: tabular-nums;
}
.tile:hover { transform: scale(1.12); z-index: 1; position: relative; }
.tile.com { border-radius: 50%; }
.tile.payé { background: var(--ok); }
.tile.retard { background: var(--bad); }
.tile.partiel { background: var(--warn); }
.tile.attente { background: var(--info); }
.tile.vacant { background: var(--vacant); }
.tiles-legend { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; font-size: .74rem; color: var(--muted); }
.tiles-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; }

.donut-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.donut { width: 132px; height: 132px; flex: none; }
.donut-legend { display: flex; flex-direction: column; gap: 10px; flex: 1; min-width: 140px; }
.donut-legend div { display: flex; align-items: center; gap: 8px; font-size: .85rem; }
.donut-legend i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.donut-legend b { margin-left: auto; font-variant-numeric: tabular-nums; }

.feed { display: flex; flex-direction: column; gap: 2px; }
.feed-item { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.feed-item:first-child { border-top: 0; padding-top: 0; }
.feed-item .amt { margin-left: auto; font-weight: 600; color: var(--ok); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- Biens ---------- */
.toolbar { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.prop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.prop {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  cursor: pointer; text-align: left; padding: 0; display: flex; flex-direction: column;
  transition: transform .15s, box-shadow .15s;
}
.prop:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.prop-img { position: relative; aspect-ratio: 16 / 10; background: var(--surface-2); max-width: 100%; }
.prop-img img { width: 100%; height: 100%; object-fit: cover; }
.prop-img .pill { position: absolute; top: 10px; left: 10px; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.prop-img .ref { position: absolute; top: 10px; right: 10px; background: rgba(14,22,45,.66); color: #fff; font-size: .7rem; font-weight: 700; padding: 3px 8px; border-radius: 6px; letter-spacing: .03em; }
.prop-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.prop-body h3 { font-size: .98rem; }
.prop-meta { font-size: .8rem; color: var(--muted); }
.prop-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 10px; }
.prop-foot .rent { font-family: var(--font-display); font-weight: 700; font-variant-numeric: tabular-nums; }
.prop-foot .rent small { font-family: var(--font-body); font-weight: 500; color: var(--muted); font-size: .72rem; }
.prop-tenant { display: flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--muted); min-width: 0; }
.prop-tenant span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Tableaux ---------- */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
table.data { width: 100%; border-collapse: collapse; font-size: .86rem; }
table.data th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface); }
table.data td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr { transition: background .12s; }
table.data tbody tr.click { cursor: pointer; }
table.data tbody tr.click:hover { background: var(--surface-2); }
table.data td.r, table.data th.r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data td.small { white-space: nowrap; }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who > div > b { display: block; font-weight: 600; white-space: nowrap; }
.who > div > span { display: block; font-size: .78rem; color: var(--muted); white-space: nowrap; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: nowrap; }
.lease-bar { width: 110px; height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.lease-bar span { display: block; height: 100%; background: var(--lagon); border-radius: inherit; }
.lease-bar span.end { background: var(--warn); }

/* ---------- Encaissements ---------- */
.month-nav { display: flex; align-items: center; gap: 6px; }
.month-nav .label { font-family: var(--font-display); font-weight: 600; min-width: 150px; text-align: center; text-transform: capitalize; }
.sumbar { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 900px) { .sumbar { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.sumbar .card { padding: 14px 16px; }
.sumbar .v { font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.progress-line { height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; display: flex; }
.progress-line span { height: 100%; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; cursor: pointer; font-weight: 500; font-size: .84rem; color: var(--muted); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }

.heat { border-collapse: separate; border-spacing: 3px; font-size: .78rem; }
.heat th { font-weight: 600; color: var(--muted); font-size: .68rem; text-transform: capitalize; padding: 2px; }
.heat td.name { white-space: nowrap; padding-right: 10px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.heat td.cell { width: 34px; min-width: 34px; height: 26px; border-radius: 6px; cursor: pointer; }
.heat td.cell.payé { background: var(--ok); }
.heat td.cell.partiel { background: var(--warn); }
.heat td.cell.retard { background: var(--bad); }
.heat td.cell.attente { background: var(--info-soft); outline: 1px dashed var(--info); outline-offset: -1px; }
.heat td.cell.na { background: var(--surface-2); cursor: default; }
.heat td.cell:not(.na):hover { filter: brightness(1.12); }

/* ---------- Relances ---------- */
.stages { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 1000px) { .stages { grid-template-columns: minmax(0, 1fr); } }
.stage { display: flex; flex-direction: column; gap: 10px; background: var(--surface-2); border-radius: var(--radius); padding: 14px; min-width: 0; }
.stage-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stage-head h3 { display: flex; align-items: center; gap: 8px; }
.stage-head .dot { width: 10px; height: 10px; border-radius: 50%; }
.dun { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.dun-top { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.dun .amt { font-family: var(--font-display); font-weight: 700; color: var(--bad); font-variant-numeric: tabular-nums; white-space: nowrap; }
.dun-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.timeline { display: flex; flex-direction: column; }
.tl-item { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; position: relative; padding-bottom: 14px; }
.tl-item::before { content: ""; position: absolute; left: 16px; top: 34px; bottom: 0; width: 2px; background: var(--line); }
.tl-item:last-child::before { display: none; }
.tl-ico { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.tl-ico.paiement { background: var(--ok-soft); color: var(--ok); }
.tl-ico.relance { background: var(--bad-soft); color: var(--bad); }
.tl-ico.appel { background: var(--info-soft); color: var(--info); }
.tl-ico.email { background: var(--lagon-soft); color: var(--lagon); }
.tl-ico.visite { background: var(--mangue-soft); color: var(--warn); }
.tl-body { padding-top: 6px; min-width: 0; }
.tl-body .t { font-size: .88rem; overflow-wrap: anywhere; }
.tl-body .d { font-size: .75rem; color: var(--muted); }

/* ---------- Tiroir & fenêtres ---------- */
.overlay { position: fixed; inset: 0; background: var(--overlay); z-index: 60; animation: fade .2s ease-out; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 61; width: min(520px, 100%);
  background: var(--bg); box-shadow: -10px 0 40px rgba(0,0,0,.2); overflow-y: auto;
  animation: slide-in .25s cubic-bezier(.2,.8,.2,1);
  padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); padding-right: env(safe-area-inset-right, 0px);
}
@keyframes slide-in { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 20px; background: var(--bg); border-bottom: 1px solid var(--line); }
.drawer-body { padding: 18px 20px 28px; display: flex; flex-direction: column; gap: 16px; }
.drawer-photo { border-radius: var(--radius); overflow: hidden; aspect-ratio: 16 / 9; max-width: 100%; }
.drawer-photo img { width: 100%; height: 100%; object-fit: cover; }
.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.kv div span { display: block; font-size: .74rem; color: var(--muted); }
.kv div b { font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.strip { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 4px; }
.strip div { height: 28px; border-radius: 5px; background: var(--surface-2); position: relative; }
.strip div.payé { background: var(--ok); }
.strip div.partiel { background: var(--warn); }
.strip div.retard { background: var(--bad); }
.strip div.attente { background: var(--info-soft); outline: 1px dashed var(--info); outline-offset: -1px; }
.strip-labels { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 4px; font-size: .62rem; color: var(--muted); text-align: center; margin-top: 4px; }
.contact-line { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.contact-line .v { flex: 1; min-width: 0; overflow-wrap: anywhere; user-select: all; }
.actions-row { display: flex; gap: 8px; flex-wrap: wrap; }

.modal-wrap { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 16px; padding-top: max(16px, env(safe-area-inset-top, 0px)); padding-bottom: max(16px, env(safe-area-inset-bottom, 0px)); }
.modal {
  position: relative; z-index: 71; width: min(560px, 100%); max-height: 100%; overflow-y: auto;
  background: var(--surface); border-radius: 18px; box-shadow: 0 20px 60px rgba(0,0,0,.3);
  animation: pop .22s cubic-bezier(.2,.8,.2,1);
}
.modal.wide { width: min(720px, 100%); }
@keyframes pop { from { transform: translateY(10px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 18px 22px 0; }
.modal-body { padding: 18px 22px; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 0 22px 20px; flex-wrap: wrap; }
.callout { background: var(--surface-2); border-radius: 10px; padding: 12px 14px; font-size: .85rem; }
.callout.warn { background: var(--warn-soft); }
.callout.bad { background: var(--bad-soft); }

/* Quittance */
.doc {
  background: #fff; color: #1b2440; border: 1px solid #e0e5ef; border-radius: 10px; padding: 26px 28px;
  font-size: .86rem; line-height: 1.6; font-family: var(--font-body);
}
.doc h2 { font-size: 1.25rem; color: #2459d6; letter-spacing: .02em; }
.doc .doc-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-bottom: 2px solid #2459d6; padding-bottom: 12px; margin-bottom: 14px; }
.doc table { width: 100%; border-collapse: collapse; margin: 12px 0; }
.doc td { padding: 6px 0; border-bottom: 1px dashed #e0e5ef; }
.doc td.r { text-align: right; font-variant-numeric: tabular-nums; }
.doc tr.total td { font-weight: 700; border-bottom: 0; border-top: 2px solid #1b2440; padding-top: 8px; }
.doc .sign { margin-top: 18px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.doc .stamp { border: 2px solid #1f9d63; color: #1f9d63; border-radius: 8px; padding: 4px 12px; font-weight: 700; transform: rotate(-4deg); display: inline-block; letter-spacing: .08em; }

/* Toast */
.toasts { position: fixed; z-index: 95; right: max(16px, env(safe-area-inset-right, 0px)); bottom: max(16px, env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
@media (max-width: 900px) { .toasts { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); left: max(16px, env(safe-area-inset-left, 0px)); align-items: stretch; } }
.toast { background: var(--ink); color: var(--bg); padding: 11px 16px; border-radius: 12px; box-shadow: var(--shadow); display: flex; align-items: center; gap: 10px; font-weight: 500; animation: pop .25s ease-out; max-width: 420px; }
.toast svg { color: var(--mangue); flex: none; }

#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 99; width: 100%; height: 100%; }

.view-in { animation: view-in .3s ease-out; }
@keyframes view-in { from { opacity: .4; transform: translateY(6px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

@media print {
  .sidebar, .main, .toasts, .overlay, .drawer, .modal-head, .modal-foot, #confetti { display: none !important; }
  .modal-wrap { position: static; display: block; padding: 0; }
  .modal { box-shadow: none; width: 100%; max-height: none; animation: none; }
  .doc { border: 0; }
}

/* ---------- Ajouts : en-tête, verre dépoli, courrier, robot ---------- */
.brand-inline { display: flex; align-items: center; gap: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.linkish { background: none; border: 0; padding: 0; color: inherit; font: inherit; cursor: pointer; text-align: left; }
.linkish:hover { color: var(--lagon); }
button.who { width: 100%; }
.site-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-top: 6px; }

.hero { min-height: 0; align-items: stretch; }
.hero::after { background: linear-gradient(100deg, rgba(14,26,62,.62) 0%, rgba(14,26,62,.34) 42%, rgba(14,26,62,0) 72%); }
.hero img { filter: brightness(1.12) saturate(1.08); }
.hero h1, .hero p, .hero .hero-date { text-shadow: 0 1px 12px rgba(10, 20, 50, .35); }
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 20px; align-items: center; width: 100%; padding: 26px 26px; }
.hero-grid .hero-body { padding: 0; }
@media (max-width: 1000px) { .hero-grid { grid-template-columns: minmax(0, 1fr); padding: 20px; } }

/* Boîte « E-mails en partance » : verre dépoli clair posé sur la photo */
.outbox {
  color: var(--ink); border-radius: 22px; padding: 16px; display: flex; flex-direction: column; gap: 8px; min-width: 0;
  background: var(--glass); border: 1px solid var(--glass-line);
  box-shadow: 0 20px 50px rgba(14, 26, 62, .22), inset 0 1px 0 rgba(255, 255, 255, .6);
  -webkit-backdrop-filter: blur(22px) saturate(160%); backdrop-filter: blur(22px) saturate(160%);
}
.ob-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 2px 4px 6px; }
.ob-head h3 { display: flex; align-items: center; gap: 10px; font-size: 1.05rem; color: var(--ink); }
.ob-head h3 svg { color: var(--lagon); }
.ob-head a { color: var(--lagon); text-decoration: none; font-size: .85rem; font-weight: 600; }
.ob-head a:hover { text-decoration: underline; }
.ob-n { background: var(--hibiscus); color: #fff; font-size: .72rem; font-weight: 700; padding: 1px 8px; border-radius: 99px; }
.ob-empty { display: flex; gap: 14px; align-items: center; background: var(--glass-item); border-radius: 16px; padding: 16px 18px; }
.ob-empty svg { color: var(--lagon); flex: none; }
.ob-empty p { color: var(--muted); font-size: .88rem; line-height: 1.5; }
.ob-item { display: flex; align-items: center; gap: 10px; background: var(--glass-item); border: 1px solid var(--glass-line); border-radius: 14px; padding: 9px 10px; min-width: 0; animation: pop .3s ease-out; }
.ob-item.sched { background: var(--glass-item); }
.ob-ico { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--lagon-soft); color: var(--lagon); flex: none; }
.ob-item.sched .ob-ico, .ob-ico.solid { background: var(--mangue-soft); color: var(--warn); }
.ob-txt { flex: 1; min-width: 0; background: none; border: 0; padding: 0; color: inherit; text-align: left; cursor: pointer; font: inherit; }
.ob-txt b { display: block; font-size: .85rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ob-txt span { display: block; font-size: .74rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ob-btn { width: 30px; height: 30px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); display: grid; place-items: center; cursor: pointer; flex: none; }
.ob-btn:hover { color: var(--bad); border-color: var(--bad); }
.ob-btn.go { background: var(--lagon); border-color: var(--lagon); color: var(--lagon-ink); }
.ob-btn.go:hover { filter: brightness(1.1); color: var(--lagon-ink); }
.ob-more { color: var(--lagon); font-size: .8rem; font-weight: 600; text-align: center; text-decoration: none; padding: 2px; }
.ob-more:hover { text-decoration: underline; }

/* Compte à rebours d'annulation */
.cd { display: inline-flex; align-items: center; gap: 5px; flex: none; font-variant-numeric: tabular-nums; font-size: .74rem; font-weight: 700; }
.cd svg { width: 22px; height: 22px; }
.cd .cd-bg { stroke: currentColor; opacity: .2; }
.cd .cd-fg { stroke: var(--mangue); transition: stroke-dashoffset 1s linear; }
.outbox .cd { color: var(--ink); }

/* Courrier */
.mail-layout { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1000px) { .mail-layout { grid-template-columns: minmax(0, 1fr); } }
.mail-list-wrap { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.mail-tabs { width: 100%; overflow-x: auto; }
.mail-tabs button { flex: 1; white-space: nowrap; }
.mail-tabs .n { font-size: .72rem; opacity: .7; margin-left: 2px; }
.mail-list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); max-height: 720px; overflow-y: auto; }
.mail-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 14px; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; cursor: pointer; color: inherit; font: inherit; min-width: 0; }
.mail-item:last-child { border-bottom: 0; }
.mail-item:hover { background: var(--surface-2); }
.mail-item.on { background: var(--lagon-soft); }
.mail-item.sched { cursor: default; flex-wrap: wrap; }
.mi-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.mi-txt b { font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mi-txt > span { font-size: .78rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mi-meta { display: flex; align-items: center; gap: 6px; font-size: .7rem !important; }
.mi-date { font-size: .74rem; color: var(--muted); white-space: nowrap; }
.kind { padding: 0 7px; border-radius: 6px; font-weight: 600; background: var(--surface-2); color: var(--muted); }
.kind.k-quittance { background: var(--ok-soft); color: var(--ok); }
.kind.k-avis { background: var(--lagon-soft); color: var(--lagon); }
.kind.k-relance1 { background: var(--warn-soft); color: var(--warn); }
.kind.k-relance2, .kind.k-relance3 { background: var(--bad-soft); color: var(--bad); }
.kind.k-rapport { background: var(--info-soft); color: var(--info); }
.mail-preview { min-width: 0; }
.mail-preview > .empty { background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); padding: 60px 20px; }

.email { display: flex; flex-direction: column; gap: 14px; }
.email-meta { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 4px; font-size: .86rem; }
.email-meta > div { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; min-width: 0; }
.email-meta > div > span:first-child { width: 44px; color: var(--muted); font-size: .76rem; flex: none; }
.email-meta b { overflow-wrap: anywhere; }
.email-state { margin-top: 6px; align-items: center !important; }
.email-state > span:first-child { width: auto !important; }
.email-canvas { background: var(--surface-2); border-radius: var(--radius); padding: 22px 16px; }
.email-card { max-width: 560px; margin: 0 auto; background: #ffffff; color: #1b2440; border-radius: 16px; overflow: hidden; box-shadow: 0 10px 34px rgba(15, 42, 46, .14); }
.email-banner { position: relative; height: 112px; }
.email-banner img { width: 100%; height: 100%; object-fit: cover; object-position: center 55%; }
.email-banner::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(20, 40, 100, .72), rgba(20, 40, 100, .05)); }
.email-brand { position: absolute; z-index: 1; left: 22px; bottom: 18px; display: flex; align-items: center; gap: 10px; color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; }
.email-content { padding: 24px 26px 8px; display: flex; flex-direction: column; gap: 12px; font-size: .92rem; line-height: 1.6; }
.email-hello { font-weight: 600; font-size: 1rem; }
.email-amount { border-radius: 12px; padding: 14px 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; background: #e8eefc; }
.email-amount span { font-size: .8rem; color: #5d6782; }
.email-amount b { font-family: var(--font-display); font-size: 1.3rem; color: #2459d6; font-variant-numeric: tabular-nums; }
.email-amount.ok { background: #e2f5eb; } .email-amount.ok b { color: #178253; }
.email-amount.warn { background: #fcf0dc; } .email-amount.warn b { color: #a8650c; }
.email-amount.bad { background: #fbe6e3; } .email-amount.bad b { color: #b5342b; }
.email-attach { display: flex; align-items: center; gap: 12px; border: 1px solid #e0e5ef; border-radius: 12px; padding: 10px 12px; flex-wrap: wrap; }
.email-attach > div { flex: 1; min-width: 150px; }
.email-attach b { display: block; font-size: .84rem; overflow-wrap: anywhere; }
.email-attach span { font-size: .74rem; color: #6b7590; }
.pdf-ico { width: 38px; height: 46px; border-radius: 6px; background: #c8456a; color: #fff; font-size: .62rem; font-weight: 800; display: grid; place-items: center; letter-spacing: .05em; flex: none; position: relative; }
.ebtn { display: inline-flex; align-items: center; gap: 6px; border: 0; background: #2459d6; color: #fff; border-radius: 9px; padding: 8px 12px; font-weight: 600; font-size: .8rem; cursor: pointer; }
.ebtn:hover { background: #1d4bb8; }
.email-foot { background: #f3f5fa; color: #6b7590; font-size: .72rem; text-align: center; padding: 12px 18px; margin-top: 14px; }

/* Robot */
.robot-hero { display: flex; flex-direction: column; gap: 16px; background: linear-gradient(135deg, var(--lagon-soft), var(--surface) 60%); }
.robot-stat { display: flex; flex-direction: column; gap: 2px; }
.robot-stat b { font-family: var(--font-display); font-size: 2.4rem; line-height: 1.1; letter-spacing: -.02em; }
.robot-break { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 1000px) { .robot-break { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 560px) { .robot-break { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.robot-break > div { display: flex; flex-direction: column; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px; min-width: 0; }
.robot-break b { font-family: var(--font-display); font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.robot-break span:last-child { font-size: .72rem; color: var(--muted); line-height: 1.3; }
.rb-ico { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; }
.callout svg { vertical-align: -3px; margin-right: 4px; }
.rules { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.rule { display: flex; flex-direction: column; gap: 10px; transition: opacity .2s; }
.rule.off { opacity: .62; }
.rule-top { display: flex; align-items: center; gap: 12px; }
.rule-ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.rule-params { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: auto; padding-top: 4px; }
.param { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; color: var(--muted); }
.param .input { width: 72px; padding: 6px 8px; }
.param-sel { width: auto; padding: 6px 8px; font-size: .82rem; }
.switch { position: relative; width: 44px; height: 26px; flex: none; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; background: var(--line); border-radius: 99px; transition: background .2s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.switch input:checked + span { background: var(--lagon); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--lagon); outline-offset: 2px; }
.tl-date { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; padding: 10px 0 8px; }
.tl-date:first-child { padding-top: 0; }

/* Divers */
.note-form { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto; gap: 8px; }
.rev-box { display: flex; align-items: center; justify-content: space-around; gap: 12px; background: var(--surface-2); border-radius: 14px; padding: 18px; }
.rev-box > div { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.rev-box b { font-family: var(--font-display); font-size: 1.4rem; font-variant-numeric: tabular-nums; }
.bank-intro { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.bank-ico { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: var(--info-soft); color: var(--info); flex: none; }
code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; background: var(--surface-2); padding: 2px 6px; border-radius: 5px; }
.ring b small { font-size: .9rem; margin-left: 2px; }
.streak svg { color: var(--mangue); }
@media (max-width: 560px) {
  .ob-item { flex-wrap: wrap; }
  .ob-txt { flex: 1 1 calc(100% - 44px); }
  .ob-item .cd { margin-left: 42px; margin-right: auto; }
  .ob-item.sched .ob-btn { margin-left: auto; }
  .hero-actions .btn { flex: 1 1 auto; }
  .note-form { grid-template-columns: minmax(0, 1fr) auto; }
  .note-form select { grid-column: 1 / -1; }
  .chart-wrap svg text { font-size: 17px !important; }
}
.nowrap { white-space: nowrap; }
.btn.icon { position: relative; }
.dot-abs { position: absolute; top: 5px; right: 5px; width: 8px; height: 8px; border-radius: 50%; background: var(--hibiscus); border: 2px solid var(--bg); }

/* Notifications */
.push-card { display: flex; flex-direction: column; gap: 10px; background: linear-gradient(140deg, var(--lagon-soft), var(--surface) 70%); }
.push-top { display: flex; align-items: center; gap: 12px; }
.push-top h3 { margin-bottom: 4px; }
.push-ico { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; background: var(--lagon); color: var(--lagon-ink); flex: none; box-shadow: 0 6px 16px rgba(36, 89, 214, .3); }
.notif-prefs { display: flex; flex-direction: column; }
.np { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.np:first-child { border-top: 0; padding-top: 0; }
.np > div { flex: 1; min-width: 0; }
.np b { display: block; font-size: .88rem; }
.np span { font-size: .76rem; color: var(--muted); }
.notif-list { display: flex; flex-direction: column; gap: 4px; }
.notif { display: flex; gap: 12px; align-items: flex-start; width: 100%; text-align: left; border: 0; background: transparent; padding: 10px; border-radius: 12px; cursor: pointer; color: inherit; font: inherit; }
.notif:hover { background: var(--surface-2); }
.notif.unread { background: var(--lagon-soft); }
.notif .nt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.notif .nt b { font-size: .86rem; }
.notif .nt span { font-size: .8rem; color: var(--muted); overflow-wrap: anywhere; }
.notif .nt em { font-style: normal; font-size: .7rem; color: var(--muted); }
.notif .tl-ico { flex: none; }
.sidebar-foot > .btn { width: 100%; }
