/* ============================================================
   YVO Épargne — feuille de style principale
   Palette : vert profond, crème, or discret
   ============================================================ */

:root {
  --bg: #f3f0e7;
  --bg-soft: #ece7da;
  --surface: #fffdf9;
  --surface-2: #faf7ef;
  --ink: #15231d;
  --ink-2: #39463f;
  --muted: #77817a;
  --line: #e5dfd1;
  --line-2: #d8d0be;

  --brand: #0e5c45;
  --brand-2: #0a4634;
  --brand-3: #e4f0e9;
  --brand-4: #cfe4d8;

  --gold: #b47c2a;
  --green: #0f7656;
  --green-bg: #e3f3ea;
  --amber: #9a5e0c;
  --amber-bg: #fbf1da;
  --red: #a63c33;
  --red-bg: #fbe9e6;
  --blue: #2f628c;
  --blue-bg: #e9f1f8;

  --shadow: 0 1px 2px rgba(28, 38, 32, 0.04), 0 8px 24px -20px rgba(28, 38, 32, 0.25);

  --sans: "Inter", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, "Times New Roman", serif;

  color-scheme: light;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.modal-open { overflow: hidden; }

h1, h2, h3, h4, p { margin: 0; }

a { color: inherit; text-decoration: none; }

button, input, select, textarea { font: inherit; color: inherit; }

button { cursor: pointer; }

svg { flex: none; }

[hidden] { display: none !important; }

::selection { background: #cfe4d8; color: #08392a; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #d5cdbc; border-radius: 99px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.muted { color: var(--muted); }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.green { color: var(--green); }
.amber { color: var(--amber); }
.red { color: var(--red); }
.in { color: var(--green); }
.out { color: var(--red); }
.pad { padding: 18px; }
.span2 { grid-column: span 2; }

/* ============================================================
   Structure générale
   ============================================================ */

.app {
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  min-height: 100vh;
}

.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.view {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 32px 36px 64px;
  flex: 1;
}

.page { animation: fadeUp 0.24s ease both; }

/* ============================================================
   Barre latérale
   ============================================================ */

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 22px 16px;
  background:
    radial-gradient(circle at 20% 0%, rgba(217, 184, 120, 0.09), transparent 45%),
    linear-gradient(170deg, #0d3a2b, #08271e 72%);
  color: #e9f2ec;
  z-index: 30;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 8px 20px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #f6e7c8, #dcb877);
  color: #0b3226;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 700;
  flex: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4), 0 6px 18px rgba(0, 0, 0, 0.25);
}

.brand-mark.big {
  width: 64px;
  height: 64px;
  font-size: 34px;
  border-radius: 18px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  min-width: 0;
}

.brand-text strong {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.brand-text small {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #9db9ab;
  margin-top: 4px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 6px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 10px;
  color: #b9cfc3;
  font-size: 13px;
  font-weight: 500;
  position: relative;
  transition: background 0.15s, color 0.15s;
}

.nav-link:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }

.nav-link.active {
  background: #f0ead9;
  color: #0b3d2e;
  font-weight: 650;
  box-shadow: 0 8px 20px -10px rgba(0, 0, 0, 0.6);
}

.nav-link .ic { opacity: 0.85; }

.nav-badge {
  margin-left: auto;
  background: #d9a64a;
  color: #20160a;
  font-size: 10px;
  font-weight: 700;
  border-radius: 99px;
  min-width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  padding: 0 5px;
}

.nav-link.active .nav-badge { background: #0e5c45; color: #fff; }

.sidebar-foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 18px;
}

.caisse-mini {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 13px;
  padding: 12px 13px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  color: #eaf3ed;
  transition: background 0.15s;
}

.caisse-mini:hover { background: rgba(255, 255, 255, 0.1); }

.cm-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #9db9ab;
}

.caisse-mini strong {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.cm-link {
  font-size: 10px;
  color: #a9c7b8;
  display: flex;
  align-items: center;
  gap: 2px;
}

.lock-link {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 0;
  color: #9db9ab;
  font-size: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  text-align: left;
}

.lock-link:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }

.side-version {
  font-size: 9px;
  color: #5f7d6e;
  text-align: center;
  letter-spacing: 0.08em;
}

/* ============================================================
   Barre mobile & navigation basse
   ============================================================ */

.mobile-bar { display: none; }

.mobile-bar .brand { padding: 0; gap: 9px; }

.mobile-bar .brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  font-size: 19px;
}

.mobile-bar .brand-text strong { font-size: 15px; }

.mobile-bar .brand-text small { font-size: 8.5px; margin-top: 2px; }

.mobile-actions { display: flex; gap: 4px; }

.bottom-nav { display: none; }

/* ============================================================
   En-têtes de page
   ============================================================ */

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.eyebrow {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brand);
  font-weight: 700;
  margin-bottom: 7px;
}

.page-head h1 {
  font-family: var(--serif);
  font-size: clamp(28px, 3vw, 38px);
  line-height: 1.05;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.page-sub {
  color: var(--muted);
  font-size: 13px;
  margin: 8px 0 0;
  max-width: 64ch;
  line-height: 1.45;
}

.page-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  margin: 26px 0 12px;
  flex-wrap: wrap;
}

.section-head h2 {
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.section-head p { font-size: 11.5px; color: var(--muted); margin-top: 3px; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--muted);
  margin-bottom: 14px;
  font-weight: 500;
}

.back-link:hover { color: var(--brand); }

/* ============================================================
   Boutons & contrôles
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 40px;
  padding: 0 15px;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  transition: transform 0.15s, background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.btn:hover { border-color: #bdb39c; transform: translateY(-1px); }

.btn.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  box-shadow: 0 8px 18px -10px rgba(14, 92, 69, 0.8);
}

.btn.primary:hover { background: var(--brand-2); border-color: var(--brand-2); }

.btn.ghost { background: transparent; border-color: var(--line-2); }

.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }

.btn.danger:hover { background: #8d3029; border-color: #8d3029; }

.btn.danger-ghost { background: transparent; border-color: #e5c3be; color: var(--red); }

.btn.danger-ghost:hover { background: var(--red-bg); border-color: #dda9a1; }

.btn.sm { height: 33px; padding: 0 11px; font-size: 11.5px; border-radius: 8px; }

.btn.lg { height: 48px; padding: 0 22px; font-size: 14px; border-radius: 12px; }

.btn.full { width: 100%; }

.btn.is-on { border-color: var(--brand); color: var(--brand); background: var(--brand-3); }

.icon-btn {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line-2);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink-2);
  transition: background 0.15s, border-color 0.15s;
  flex: none;
}

.icon-btn:hover { background: var(--surface-2); border-color: #bdb39c; }

.icon-btn.sm { width: 30px; height: 30px; border-radius: 7px; }

.icon-btn.danger { color: var(--red); border-color: #ecd2cd; }

.icon-btn.danger:hover { background: var(--red-bg); }

.link-arrow {
  font-size: 11.5px;
  color: var(--brand);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  white-space: nowrap;
}

.link-arrow:hover { text-decoration: underline; }

.link-btn {
  background: none;
  border: 0;
  color: var(--brand);
  font-size: 11px;
  font-weight: 600;
  padding: 4px;
}

.offline-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--brand-3);
  border: 1px solid var(--brand-4);
  color: var(--brand);
  border-radius: 99px;
  padding: 7px 12px;
  font-size: 10.5px;
  font-weight: 650;
  height: 36px;
}

/* ============================================================
   Badges
   ============================================================ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2.5px 7px;
  border-radius: 99px;
  font-size: 9.5px;
  font-weight: 650;
  line-height: 1.5;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.badge.green { background: var(--green-bg); color: var(--green); }
.badge.amber { background: var(--amber-bg); color: var(--amber); }
.badge.red { background: var(--red-bg); color: var(--red); }
.badge.blue { background: var(--blue-bg); color: var(--blue); }
.badge.gray { background: #eeeae0; color: #6d766f; }

.pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 99px;
  font-size: 9.5px;
  font-weight: 650;
  background: #eeeae0;
  color: #6d766f;
}

.pill.blue { background: var(--blue-bg); color: var(--blue); }
.pill.green { background: var(--green-bg); color: var(--green); }

/* ============================================================
   Avatars
   ============================================================ */

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.02em;
  flex: none;
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.avatar-lg { width: 68px; height: 68px; border-radius: 18px; font-size: 22px; }
.avatar-sm { width: 30px; height: 30px; border-radius: 9px; font-size: 10px; }

/* ============================================================
   Progression
   ============================================================ */

.progress {
  height: 6px;
  background: #eae5d8;
  border-radius: 99px;
  overflow: hidden;
  width: 100%;
}

.progress > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #0f7656, #4ca184);
  border-radius: 99px;
  transition: width 0.3s ease;
}

.progress.green > span { background: linear-gradient(90deg, #0f7656, #4ca184); }
.progress.gold > span { background: linear-gradient(90deg, #b47c2a, #d9ac5e); }
.progress.red > span { background: linear-gradient(90deg, #a63c33, #d07970); }

/* ============================================================
   Panneaux
   ============================================================ */

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px 21px;
  box-shadow: var(--shadow);
  min-width: 0;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-head h2 { font-size: 14.5px; font-weight: 650; letter-spacing: -0.005em; }

.panel-sub { font-size: 11px; color: var(--muted); margin-top: 3px; line-height: 1.35; }

.panel-total {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  white-space: nowrap;
}

.split {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 16px;
  margin-bottom: 18px;
}

/* ============================================================
   KPI
   ============================================================ */

.kpi-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr 1fr 1.1fr;
  gap: 14px;
  margin-bottom: 20px;
}

.kpi {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px 19px 16px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.kpi.primary {
  background: linear-gradient(150deg, #0d4f3b, #0a2f24);
  color: #f4f1e6;
  border-color: #0c4133;
  position: relative;
  overflow: hidden;
}

.kpi.primary::after {
  content: "";
  position: absolute;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(214, 176, 104, 0.22), transparent 70%);
  right: -55px;
  top: -75px;
  pointer-events: none;
}

.kpi-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  position: relative;
  z-index: 1;
}

.kpi-label {
  font-size: 11px;
  font-weight: 650;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.kpi.primary .kpi-label { color: #b5cdc0; }

.kpi-value {
  font-family: var(--serif);
  font-size: clamp(23px, 2.3vw, 32px);
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  position: relative;
  z-index: 1;
}

.kpi-sub {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.35;
  position: relative;
  z-index: 1;
}

.kpi.primary .kpi-sub { color: #a9c4b6; }

.kpi-foot { margin-top: auto; font-size: 11px; color: var(--muted); position: relative; z-index: 1; }

.kpi.primary .kpi-foot { color: #b5cdc0; }

.kpi-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  position: relative;
  z-index: 1;
}

.kpi-split div { display: flex; flex-direction: column; gap: 2px; }

.kpi-split span {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9db9ab;
}

.kpi-split strong { font-size: 13px; font-weight: 650; color: #f4e9d4; }

.kpi-ic {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.1);
  color: #e7d8b8;
  flex: none;
}

.kpi-ic.soft { background: var(--surface-2); color: var(--brand); border: 1px solid var(--line); }

.kpi-of { font-size: 16px; color: var(--muted); font-family: var(--sans); font-weight: 500; }

.trend { display: inline-flex; align-items: center; gap: 2px; font-weight: 650; }
.trend.up { color: var(--green); }

/* ============================================================
   Mini KPI (listes)
   ============================================================ */

.mini-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.mini-kpi {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 13px 15px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  box-shadow: 0 1px 2px rgba(28, 38, 32, 0.03);
  min-width: 0;
}

.mini-kpi span {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
  font-weight: 600;
}

.mini-kpi strong {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-kpi em { font-style: normal; font-size: 10px; color: var(--muted); }

/* ============================================================
   Bandeau démo & checklist
   ============================================================ */

.demo-banner {
  display: flex;
  align-items: center;
  gap: 11px;
  background: #fdf4df;
  border: 1px solid #ecd9ad;
  border-radius: 12px;
  padding: 10px 13px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.demo-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 4px rgba(180, 124, 42, 0.13);
  flex: none;
}

.demo-banner > div { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 200px; }

.demo-banner strong { font-size: 11.5px; color: #6f4a0f; }
.demo-banner span { font-size: 10.5px; color: #8a672c; }

.setup { background: linear-gradient(135deg, #fffdf8, #f8f4e9); margin-bottom: 18px; }

.setup-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--brand-3);
  color: var(--brand);
  border: 1px solid var(--brand-4);
  border-radius: 99px;
  padding: 4px 9px;
  font-size: 9.5px;
  font-weight: 700;
  white-space: nowrap;
}

.setup-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

.setup-step {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  flex-wrap: wrap;
}

.setup-step.done { opacity: 0.65; }

.ss-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--brand);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  flex: none;
}

.setup-step.done .ss-num { background: var(--green-bg); color: var(--green); }

.ss-main { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 120px; }
.ss-main strong { font-size: 11.5px; }
.ss-main span { font-size: 10px; color: var(--muted); line-height: 1.35; }

/* ============================================================
   Graphique 7 jours
   ============================================================ */

.chart {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 190px;
  padding: 18px 2px 0;
  background: repeating-linear-gradient(to top, transparent 0, transparent 46px, var(--line) 46px, var(--line) 47px);
  border-radius: 8px;
}

.chart-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  gap: 5px;
  min-width: 0;
}

.chart-val { font-size: 8.5px; color: var(--muted); height: 12px; white-space: nowrap; }

.chart-track {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-height: 0;
}

.chart-fill {
  width: min(34px, 70%);
  background: linear-gradient(180deg, #1c8060, #0b4f3a);
  border-radius: 6px 6px 3px 3px;
  min-height: 2px;
  transition: height 0.3s ease;
}

.chart-day {
  font-size: 9px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.chart-day.today { color: var(--brand); font-weight: 700; }

/* ============================================================
   Pointage du jour — tableau de bord
   ============================================================ */

.today-body { display: flex; gap: 18px; align-items: center; }

.ring {
  width: 122px;
  height: 122px;
  border-radius: 50%;
  flex: none;
  display: grid;
  place-items: center;
  position: relative;
}

.ring-inner {
  width: 94px;
  height: 94px;
  border-radius: 50%;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
}

.ring-inner strong {
  font-family: var(--serif);
  font-size: 25px;
  line-height: 1;
  font-weight: 600;
}

.ring-inner span {
  font-size: 9px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 2px;
}

.today-lines {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  min-width: 0;
}

.today-lines div { display: flex; flex-direction: column; gap: 1px; }
.today-lines span { font-size: 10px; color: var(--muted); }
.today-lines strong { font-size: 13.5px; font-variant-numeric: tabular-nums; }

.today-note {
  margin-top: 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 11px;
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-2);
}

.today-note.ok { background: var(--green-bg); border-color: #cce5d8; color: var(--green); }

/* ============================================================
   Quartiers
   ============================================================ */

.quartier-list { display: flex; flex-direction: column; gap: 13px; }

.quartier-row { min-width: 0; }

.qr-head { display: flex; justify-content: space-between; gap: 8px; font-size: 11.5px; }

.qr-name { font-weight: 600; display: flex; align-items: center; gap: 4px; }

.qr-count { color: var(--muted); font-size: 10px; white-space: nowrap; }

.qr-bar {
  height: 6px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 99px;
  margin: 5px 0 3px;
  overflow: hidden;
}

.qr-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #0e5c45, #3f9677);
  border-radius: 99px;
}

.qr-foot { display: flex; justify-content: space-between; font-size: 9.5px; color: var(--muted); }

/* ============================================================
   Alertes
   ============================================================ */

.alert-list { display: flex; flex-direction: column; gap: 4px; }

.alert-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 9px;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: background 0.15s;
}

.alert-item:hover { background: var(--surface-2); }

.alert-ic {
  width: 29px;
  height: 29px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex: none;
}

.alert-item.red .alert-ic { background: var(--red-bg); color: var(--red); }
.alert-item.amber .alert-ic { background: var(--amber-bg); color: var(--amber); }
.alert-item.blue .alert-ic { background: var(--blue-bg); color: var(--blue); }

.alert-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.alert-main strong { font-size: 11px; font-weight: 600; line-height: 1.35; }
.alert-main span { font-size: 10px; color: var(--muted); line-height: 1.35; }
.alert-item > .ic { color: var(--muted); }

.all-good {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 16px;
  background: var(--green-bg);
  border: 1px solid #cce5d8;
  border-radius: 12px;
  color: var(--green);
}

.all-good div { display: flex; flex-direction: column; gap: 1px; }
.all-good strong { font-size: 11.5px; }
.all-good span { font-size: 10px; color: #3f7a64; }

/* ============================================================
   Mouvements
   ============================================================ */

.movement-list { display: flex; flex-direction: column; }

.mv {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 2px;
  border-bottom: 1px solid var(--line);
}

.mv:last-child { border-bottom: 0; }

.mv-ico {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  flex: none;
}

.mv-ico.in { background: var(--green-bg); color: var(--green); }
.mv-ico.out { background: var(--red-bg); color: var(--red); }

.mv-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }

.mv-title {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mv-card {
  font-size: 9px;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--line);
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 500;
}

.mv-sub { font-size: 10px; color: var(--muted); }

.mv-link { font-weight: 600; color: var(--ink-2); }
.mv-link:hover { color: var(--brand); text-decoration: underline; }

.mv-amt {
  font-size: 12.5px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.mv-amt.in { color: var(--green); }
.mv-amt.out { color: var(--red); }

/* ============================================================
   Barre d'outils, recherche, filtres
   ============================================================ */

.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 0 0 12px;
  flex-wrap: wrap;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: 10px;
  padding: 0 12px;
  height: 40px;
  color: var(--muted);
  min-width: 220px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.search-box input {
  border: 0;
  background: none;
  outline: none;
  flex: 1;
  height: 100%;
  font-size: 12.5px;
  min-width: 0;
}

.search-box:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(14, 92, 69, 0.1);
}

.grow { flex: 1; }

.select-inline { display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--muted); }

.select-inline select {
  height: 40px;
  border: 1px solid var(--line-2);
  border-radius: 9px;
  background: var(--surface);
  padding: 0 10px;
  font-size: 11.5px;
  outline: none;
}

.chips { display: flex; gap: 7px; flex-wrap: wrap; margin: 0 0 18px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 10px;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 10.5px;
  font-weight: 550;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}

.chip:hover { border-color: var(--brand-4); background: var(--brand-3); }

.chip span {
  background: var(--surface-2);
  border-radius: 99px;
  padding: 0 5px;
  font-size: 9px;
  color: var(--muted);
  min-width: 16px;
  text-align: center;
}

.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip.active span { background: rgba(255, 255, 255, 0.2); color: #fff; }

/* ============================================================
   Groupes clients & cartes clients
   ============================================================ */

.client-group { margin-bottom: 24px; }

.group-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 11px;
  padding: 0 2px;
  flex-wrap: wrap;
}

.gh-title { display: flex; align-items: baseline; gap: 9px; }

.gh-title h2 {
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.gh-title span { font-size: 10.5px; color: var(--muted); }

.gh-stats { display: flex; gap: 16px; font-size: 10px; color: var(--muted); flex-wrap: wrap; }
.gh-stats strong { color: var(--ink); font-size: 11px; margin-left: 3px; font-variant-numeric: tabular-nums; }

.client-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

.client-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 15px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 1px 2px rgba(28, 38, 32, 0.03);
  transition: transform 0.16s, border-color 0.16s, box-shadow 0.16s;
  position: relative;
  overflow: hidden;
  min-width: 0;
}

.client-card:hover {
  transform: translateY(-2px);
  border-color: #cfc6b2;
  box-shadow: 0 12px 28px -18px rgba(28, 38, 32, 0.4);
}

.client-card.late { border-color: #ecc9c2; background: linear-gradient(180deg, #fffdfa, #fdf6f3); }
.client-card.inactive { opacity: 0.68; }

.cc-top { display: flex; align-items: center; gap: 10px; }

.cc-id { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.cc-id strong { font-size: 13px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-id span { font-size: 10.5px; color: var(--muted); }

.cc-badges { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }

.cc-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: var(--muted);
  flex-wrap: wrap;
}

.cc-meta .dot { opacity: 0.5; }

.cc-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 10px 0;
  border-top: 1px dashed var(--line);
  border-bottom: 1px dashed var(--line);
}

.cc-stats div { display: flex; flex-direction: column; gap: 1px; min-width: 0; }

.cc-stats span {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  white-space: nowrap;
}

.cc-stats strong { font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.cc-progress { display: flex; align-items: center; gap: 8px; }
.cc-progress .progress { flex: 1; }
.cc-progress > span { font-size: 9.5px; color: var(--muted); min-width: 30px; text-align: right; }

.cc-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  color: var(--muted);
}

.cc-foot > span { display: flex; align-items: center; gap: 4px; }

.cc-link { color: var(--brand); font-weight: 600; }

.late-pill {
  background: var(--red-bg);
  color: var(--red);
  padding: 2px 7px;
  border-radius: 99px;
  font-weight: 650;
  font-size: 9.5px;
  white-space: nowrap;
}

/* ============================================================
   Fiche client
   ============================================================ */

.profile {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.profile-top { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; }

.profile-id { flex: 1; min-width: 200px; }

.profile-name { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.profile-name h1 { font-size: 30px; }

.profile-meta {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  margin-top: 7px;
  font-size: 11.5px;
  color: var(--muted);
}

.profile-meta span, .profile-meta a { display: flex; align-items: center; gap: 5px; }
.profile-meta a:hover { color: var(--brand); }

.profile-actions { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; }

.profile-stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.profile-stats div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

.profile-stats span {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-stats strong {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.client-info-split { grid-template-columns: 1.5fr 1fr; margin-bottom: 22px; }

.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; margin: 0; }

.info-grid div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

.info-grid .span2 { grid-column: span 2; }

.info-grid dt {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  font-weight: 600;
}

.info-grid dd { margin: 0; font-size: 12px; color: var(--ink-2); overflow-wrap: anywhere; }

.notes-text { font-size: 12px; line-height: 1.6; color: var(--ink-2); }

.info-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  font-size: 10.5px;
  color: var(--muted);
  flex-wrap: wrap;
}

.info-foot > span { display: flex; align-items: center; gap: 5px; }

/* ============================================================
   Cartes d'épargne
   ============================================================ */

.card-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 19px 20px;
  margin-bottom: 16px;
  box-shadow: 0 1px 2px rgba(28, 38, 32, 0.03);
  scroll-margin-top: 20px;
}

.cp-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.cp-title-wrap { min-width: 0; }

.cp-title { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }

.cp-title h3 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

.cp-period {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 4px;
}

.cp-period strong { color: var(--ink-2); font-weight: 600; }
.cp-period .arrow { color: var(--gold); font-weight: 700; }
.cp-period .dot { opacity: 0.5; margin: 0 1px; }

.cp-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

.mini-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 14px;
}

.mini-stats > div {
  background: var(--surface-2);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.mini-stats span {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-stats strong {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-stats .solde-stat { background: var(--brand-3); }
.mini-stats .solde-stat strong { color: var(--brand); }

.cp-progress { margin-bottom: 16px; }

.cp-progress-head {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 5px;
  gap: 8px;
  flex-wrap: wrap;
}

.cp-progress-head strong { color: var(--ink-2); }

/* ============================================================
   Calendrier
   ============================================================ */

.calendar {
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 12px;
  background: linear-gradient(180deg, #fffdf9, #fbf8f0);
}

.cal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.cal-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.15;
  text-align: center;
  min-width: 0;
}

.cal-title strong { font-family: var(--serif); font-size: 17px; font-weight: 600; }
.cal-title span { font-size: 9px; color: var(--muted); }

.cal-nav { display: flex; align-items: center; gap: 4px; }

.cal-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin-bottom: 4px; }

.cal-weekdays span {
  text-align: center;
  font-size: 8.5px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
}

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }

.cal-empty { min-height: 50px; }

.cal-day {
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  padding: 5px 6px;
  position: relative;
  transition: transform 0.12s, box-shadow 0.12s, border-color 0.12s;
  text-align: left;
  min-width: 0;
  overflow: hidden;
}

.cal-day:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 12px -8px rgba(0, 0, 0, 0.35);
  border-color: #c8bfa9;
}

.cal-day .dnum { font-size: 10.5px; font-weight: 600; line-height: 1; }

.cal-day .damt {
  font-size: 8px;
  font-weight: 650;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cal-day.complet { background: var(--green-bg); border-color: #bfe1cf; color: #0b5c43; }
.cal-day.avance { background: var(--amber-bg); border-color: #ecd7a8; color: #7d4c08; }
.cal-day.absent { background: var(--red-bg); border-color: #f0c8c3; color: #8c3029; }
.cal-day.missed { background: #fdf4f1; border: 1px dashed #dfb3ac; color: #9b5b52; }
.cal-day.future { background: #fcfaf4; color: #a4aaa3; }

.cal-day.out {
  background: transparent;
  border-color: transparent;
  color: #d2d2c8;
  cursor: default;
  opacity: 0.5;
}

.cal-day.today { box-shadow: 0 0 0 2px var(--brand); border-color: var(--brand); }
.cal-day.today .dnum { color: var(--brand); font-weight: 800; }

.cal-summary {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 9.5px;
  color: var(--muted);
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
}

.cal-summary strong { color: var(--ink-2); }

.cal-legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 9px; color: var(--muted); margin-top: 7px; }

.cal-legend span { display: flex; align-items: center; gap: 4px; }

i.lg {
  width: 9px;
  height: 9px;
  border-radius: 3px;
  display: inline-block;
  border: 1px solid var(--line);
}

i.lg.complet { background: var(--green-bg); border-color: #bfe1cf; }
i.lg.avance { background: var(--amber-bg); border-color: #ecd7a8; }
i.lg.absent { background: var(--red-bg); border-color: #f0c8c3; }
i.lg.future { background: #fcfaf4; border-color: var(--line); }
i.lg.today { background: #fff; border: 2px solid var(--brand); }

/* ============================================================
   Historique & tableaux
   ============================================================ */

.card-history { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 10px; }

.card-history summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-2);
  padding: 4px 0;
  gap: 8px;
}

.card-history summary::-webkit-details-marker { display: none; }

.card-history summary span { display: flex; align-items: center; gap: 5px; }

.card-history summary span:last-child .ic { transition: transform 0.15s; }

.card-history[open] summary span:last-child .ic { transform: rotate(90deg); }

.table-wrap {
  overflow-x: auto;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.table { width: 100%; border-collapse: collapse; font-size: 11px; min-width: 540px; }

.table th {
  text-align: left;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  font-weight: 700;
  padding: 8px 10px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.table td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }

.table tr:last-child td { border-bottom: 0; }

.table tbody tr:hover { background: #fdfaf3; }

.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; }
.table .right { text-align: right; }
.table .nowrap { white-space: nowrap; }
.table .muted { color: var(--muted); font-size: 10px; }

.mono { font-variant-numeric: tabular-nums; font-size: 10px; letter-spacing: 0.02em; }

/* ============================================================
   Pointage (page)
   ============================================================ */

.pointage-top { padding: 18px 20px; margin-bottom: 16px; }

.pointage-toolbar {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.date-picker { display: flex; flex-direction: column; gap: 4px; }

.date-picker span {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 650;
}

.date-picker input {
  height: 40px;
  border: 1px solid var(--line-2);
  border-radius: 9px;
  background: var(--surface);
  padding: 0 10px;
  font-size: 12px;
  outline: none;
}

.pointage-toolbar .search-box { min-width: 240px; }

.pointage-summary {
  display: flex;
  gap: 26px;
  align-items: center;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  padding-top: 13px;
  margin-top: 4px;
}

.ps-main { flex: 1; min-width: 200px; }

.ps-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 650;
}

.ps-count { font-size: 11px; margin: 2px 0 5px; color: var(--muted); }

.ps-count strong {
  font-family: var(--serif);
  font-size: 20px;
  color: var(--ink);
  font-weight: 600;
}

.ps-stat { display: flex; flex-direction: column; gap: 1px; text-align: right; }
.ps-stat span { font-size: 9px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.ps-stat strong { font-size: 13.5px; font-variant-numeric: tabular-nums; }

.pointage-group { margin-bottom: 18px; }

.pg-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 7px;
  flex-wrap: wrap;
  padding: 0 2px;
}

.pg-head h2 {
  font-size: 11.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-2);
}

.pg-head span { font-size: 9.5px; color: var(--muted); }

.pointage-list {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(28, 38, 32, 0.03);
}

.pointage-row {
  display: grid;
  grid-template-columns: minmax(190px, 1.4fr) 105px 118px auto;
  gap: 12px;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}

.pointage-row:last-child { border-bottom: 0; }
.pointage-row:hover { background: #fdfaf3; }

.pr-main { display: flex; align-items: center; gap: 9px; min-width: 0; }

.pr-id { display: flex; flex-direction: column; gap: 1px; min-width: 0; }

.pr-id a {
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pr-id a:hover { color: var(--brand); }

.pr-id span { font-size: 9.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.pr-daily { display: flex; flex-direction: column; gap: 1px; }

.pr-daily span { font-size: 9px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.pr-daily strong { font-size: 11.5px; font-variant-numeric: tabular-nums; }

.pr-status { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.pr-paid { font-size: 9.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

.pr-actions { display: flex; gap: 3px; justify-content: flex-end; }

.pbtn {
  height: 31px;
  padding: 0 8px;
  border-radius: 7px;
  border: 1px solid var(--line-2);
  background: #fff;
  font-size: 9.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--ink-2);
  transition: background 0.15s, border-color 0.15s;
}

.pbtn:hover { border-color: #bdb39c; background: var(--surface-2); }

.pbtn.on.green { background: var(--green-bg); border-color: #bfe1cf; color: var(--green); }
.pbtn.on.amber { background: var(--amber-bg); border-color: #ecd7a8; color: var(--amber); }
.pbtn.on.red { background: var(--red-bg); border-color: #f0c8c3; color: var(--red); }

.pbtn.icon-only { padding: 0 7px; }

/* ============================================================
   Multi-cartes
   ============================================================ */

.multi-list { display: flex; flex-direction: column; gap: 13px; }

.multi-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 17px 18px;
  box-shadow: var(--shadow);
}

.mc-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.mc-client { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 200px; }

.mc-client > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

.mc-client strong { font-size: 13.5px; }
.mc-client > div span { font-size: 10px; color: var(--muted); display: flex; align-items: center; gap: 3px; }

.mc-badges { display: flex; gap: 4px; flex-wrap: wrap; }

.mc-solde { text-align: right; display: flex; flex-direction: column; gap: 1px; }

.mc-solde span {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}

.mc-solde strong { font-family: var(--serif); font-size: 20px; color: var(--brand); font-weight: 600; }

.mc-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 8px; padding: 12px 0; }

.mc-carte {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 11px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color 0.15s, background 0.15s;
}

.mc-carte:hover { border-color: var(--brand-4); background: #f7fbf8; }

.mc-carte-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: 11px; }

.mc-carte-nums { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 9px; color: var(--muted); }

.mc-foot {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 11px;
  border-top: 1px dashed var(--line);
}

.mc-foot > div { display: flex; flex-direction: column; gap: 1px; }

.mc-foot span {
  font-size: 8.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.mc-foot strong { font-size: 11.5px; font-variant-numeric: tabular-nums; }

.mc-foot .btn { margin-left: auto; }

/* ============================================================
   Trésorerie
   ============================================================ */

.cash-hero {
  background: linear-gradient(135deg, #0c4b38, #0a2b21);
  color: #f6f1e3;
  border-radius: 18px;
  padding: 24px 26px;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 18px 40px -25px rgba(10, 60, 44, 0.9);
}

.cash-hero::after {
  content: "";
  position: absolute;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(214, 176, 104, 0.2), transparent 68%);
  right: -70px;
  top: -100px;
  pointer-events: none;
}

.cash-main { display: flex; flex-direction: column; gap: 3px; position: relative; z-index: 1; }

.cash-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #a9c4b5;
  font-weight: 650;
}

.cash-value {
  font-family: var(--serif);
  font-size: clamp(30px, 4vw, 44px);
  letter-spacing: -0.02em;
  line-height: 1.1;
  font-weight: 600;
}

.cash-formula { font-size: 10px; color: #8fae9e; }

.cash-side {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 26px;
  align-content: center;
  position: relative;
  z-index: 1;
  min-width: 260px;
}

.cash-side div { display: flex; flex-direction: column; gap: 1px; }

.cash-side span {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9ab8a8;
}

.cash-side strong { font-size: 13.5px; font-variant-numeric: tabular-nums; }

.cash-hero .in { color: #7fe0b6; }
.cash-hero .out { color: #f3a39a; }

.period-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }

.period-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 14px 15px;
  box-shadow: 0 1px 2px rgba(28, 38, 32, 0.03);
}

.pc-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 9px;
}

.pc-row, .pc-net { display: flex; justify-content: space-between; font-size: 11px; padding: 3px 0; }
.pc-row span { color: var(--muted); }
.pc-row strong, .pc-net strong { font-variant-numeric: tabular-nums; }

.pc-net {
  border-top: 1px dashed var(--line);
  margin-top: 5px;
  padding-top: 7px;
  font-weight: 650;
}

.journal-tools { display: flex; gap: 8px; align-items: center; }

.select-sm {
  height: 34px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--surface);
  padding: 0 9px;
  font-size: 11px;
  outline: none;
}

.treasury-table td { font-size: 10.5px; }

.t-op { display: flex; align-items: center; gap: 8px; min-width: 170px; }

.t-ic { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; flex: none; }
.t-ic.in { background: var(--green-bg); color: var(--green); }
.t-ic.out { background: var(--red-bg); color: var(--red); }

.t-op div { display: flex; flex-direction: column; gap: 0; min-width: 0; }
.t-op strong { font-size: 10.5px; font-weight: 600; }
.t-op span { font-size: 9px; color: var(--muted); }

.table-link { font-weight: 600; color: var(--brand); font-size: 10.5px; }
.table-link:hover { text-decoration: underline; }

.journal-foot {
  display: flex;
  gap: 26px;
  justify-content: flex-end;
  flex-wrap: wrap;
  padding: 13px 4px 2px;
  font-size: 10.5px;
  color: var(--muted);
}

.journal-foot div { display: flex; flex-direction: column; gap: 1px; text-align: right; }
.journal-foot strong { font-size: 13px; font-variant-numeric: tabular-nums; }

.table-note { font-size: 10px; color: var(--muted); padding: 8px 2px 0; }

/* ============================================================
   Paramètres
   ============================================================ */

.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.setting-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow);
  min-width: 0;
}

.setting-head { display: flex; gap: 11px; align-items: flex-start; margin-bottom: 16px; }

.setting-ic {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--brand-3);
  color: var(--brand);
  display: grid;
  place-items: center;
  flex: none;
}

.setting-head h2 { font-size: 14px; font-weight: 650; }
.setting-head p { font-size: 10.5px; color: var(--muted); margin: 2px 0 0; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }

.field > span {
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.03em;
  color: var(--ink-2);
}

.field small { font-size: 9px; color: var(--muted); line-height: 1.35; }

.field.span2, .form-grid .span2 { grid-column: span 2; }

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line-2);
  background: #fff;
  border-radius: 9px;
  padding: 9px 11px;
  font-size: 12px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  color: var(--ink);
}

input:focus, select:focus, textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(14, 92, 69, 0.1);
}

textarea { resize: vertical; min-height: 70px; line-height: 1.45; }

.input-suffix {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--line-2);
  border-radius: 9px;
  background: #fff;
  overflow: hidden;
}

.input-suffix:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(14, 92, 69, 0.1); }

.input-suffix input { border: 0; border-radius: 0; box-shadow: none !important; }

.input-suffix span {
  display: flex;
  align-items: center;
  padding: 0 10px;
  background: var(--surface-2);
  border-left: 1px solid var(--line);
  font-size: 9px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}

.form-actions { display: flex; justify-content: flex-end; margin-top: 14px; }

.account-readout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  margin-top: 14px;
}

.account-readout div { display: flex; flex-direction: column; gap: 1px; min-width: 0; }

.account-readout span {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-readout strong {
  font-family: var(--serif);
  font-size: 17px;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-readout small { font-size: 8.5px; color: var(--muted); }

.security-row, .backup-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px dashed var(--line);
  flex-wrap: wrap;
}

.security-row > div, .backup-row > div { display: flex; flex-direction: column; gap: 2px; }
.security-row strong, .backup-row strong { font-size: 11.5px; }
.security-row span, .backup-row span { font-size: 10px; color: var(--muted); }

.security-actions, .backup-actions { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 12px; }

.auto-lock { margin-top: 12px; }

.callout {
  display: flex;
  gap: 10px;
  padding: 11px 13px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 10.5px;
  line-height: 1.45;
  margin-top: 13px;
}

.callout .ic { flex: none; margin-top: 1px; }

.callout > div { display: flex; flex-direction: column; gap: 2px; }

.callout strong { font-size: 11px; }
.callout span { color: var(--ink-2); }

.callout.info { background: var(--blue-bg); border-color: #cfe1ef; color: #245273; }
.callout.info .ic { color: var(--blue); }
.callout.warn { background: var(--amber-bg); border-color: #ecd7a8; color: #7d4c08; }
.callout.warn .ic { color: var(--amber); }
.callout.solde-callout { background: var(--brand-3); border-color: var(--brand-4); color: var(--brand); }
.callout.solde-callout .ic { color: var(--brand); }
.callout.small { padding: 9px 11px; }

.storage-line {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 9.5px;
  color: var(--muted);
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}

.storage-line span { display: flex; align-items: center; gap: 4px; }

.file-btn { cursor: pointer; }

.about-panel { margin-top: 16px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }

.about-brand { display: flex; align-items: center; gap: 10px; }

.about-brand .brand-mark {
  width: 38px;
  height: 38px;
  font-size: 20px;
  border-radius: 10px;
  background: var(--brand);
  color: #f6e7c8;
  box-shadow: none;
}

.about-brand div { display: flex; flex-direction: column; }
.about-brand strong { font-family: var(--serif); font-size: 16px; font-weight: 600; }
.about-brand span { font-size: 9.5px; color: var(--muted); }

.about-meta { display: flex; gap: 14px; font-size: 9.5px; color: var(--muted); margin-left: auto; flex-wrap: wrap; }

.about-note {
  width: 100%;
  font-size: 10px;
  color: var(--muted);
  padding-top: 11px;
  border-top: 1px dashed var(--line);
  line-height: 1.5;
}

/* ============================================================
   États vides
   ============================================================ */

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 42px 20px;
  gap: 6px;
}

.empty-icon {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: var(--brand-3);
  color: var(--brand);
  display: grid;
  place-items: center;
  margin-bottom: 4px;
}

.empty h3 {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.empty p { font-size: 11.5px; color: var(--muted); max-width: 50ch; line-height: 1.5; }

.empty-cta { margin-top: 10px; }

/* ============================================================
   Modales
   ============================================================ */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 26, 20, 0.58);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  animation: fadeIn 0.15s ease;
}

.modal {
  background: var(--surface);
  border-radius: 18px;
  width: 100%;
  max-width: 560px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 30px 70px -20px rgba(0, 0, 0, 0.5);
  animation: modalIn 0.22s cubic-bezier(0.2, 0.8, 0.3, 1);
  overflow: hidden;
}

.modal-wide { max-width: 720px; }
.modal-large { max-width: 860px; }

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  padding: 20px 22px 14px;
  border-bottom: 1px solid var(--line);
}

.modal-head h2 {
  font-family: var(--serif);
  font-size: 23px;
  letter-spacing: -0.015em;
  font-weight: 600;
  line-height: 1.1;
}

.modal-sub { font-size: 10.5px; color: var(--muted); margin-top: 4px; line-height: 1.4; }

.modal-body { padding: 18px 22px; overflow-y: auto; flex: 1; }

.modal-foot {
  padding: 14px 22px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  background: var(--surface-2);
}

.confirm-box { display: flex; gap: 13px; align-items: flex-start; }
.confirm-box p { margin: 0 0 6px; font-size: 12px; line-height: 1.5; }
.confirm-box p:last-child { margin-bottom: 0; }

.confirm-ic {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex: none;
  background: var(--red-bg);
  color: var(--red);
}

.confirm-ic.green { background: var(--green-bg); color: var(--green); }

.day-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }

.day-cards div {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.day-cards span {
  font-size: 8.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.day-cards strong { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.seg-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-bottom: 14px; }

.seg-card { cursor: pointer; position: relative; }

.seg-card input { position: absolute; opacity: 0; pointer-events: none; }

.seg-card span {
  display: flex;
  flex-direction: column;
  gap: 2px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  padding: 9px 10px;
  background: #fff;
  transition: background 0.15s, border-color 0.15s;
}

.seg-card strong { display: flex; align-items: center; gap: 5px; font-size: 11px; }
.seg-card em { font-style: normal; font-size: 9px; color: var(--muted); }

.seg-card input:checked + span { border-color: currentColor; box-shadow: 0 0 0 1px currentColor; }

.seg-card.complet input:checked + span { background: var(--green-bg); border-color: #bfe1cf; color: var(--green); }
.seg-card.avance input:checked + span { background: var(--amber-bg); border-color: #ecd7a8; color: var(--amber); }
.seg-card.absent input:checked + span { background: var(--red-bg); border-color: #f0c8c3; color: var(--red); }

.hint { font-size: 9.5px; color: var(--muted); line-height: 1.4; margin: 10px 0 0; }

.checkline {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--ink-2);
  cursor: pointer;
}

.checkline input { width: auto; accent-color: var(--brand); }

.choice-list { display: flex; flex-direction: column; gap: 7px; }

.choice {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}

.choice:hover { border-color: var(--brand); background: var(--brand-3); }

.choice-ic {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--brand-3);
  color: var(--brand);
  display: grid;
  place-items: center;
  flex: none;
}

.choice-main { display: flex; flex-direction: column; gap: 1px; flex: 1; }
.choice-main strong { font-size: 11.5px; }
.choice-main span { font-size: 9.5px; color: var(--muted); }

/* ============================================================
   Reçu imprimable
   ============================================================ */

.receipt {
  background: #fff;
  color: #1a2420;
  padding: 8px;
  font-size: 11px;
  max-width: 760px;
  margin: 0 auto;
}

.receipt-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  padding-bottom: 14px;
  border-bottom: 2px solid #0e5c45;
}

.receipt-brand { display: flex; align-items: center; gap: 10px; }

.receipt-logo {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #0e5c45;
  color: #f6e7c8;
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 700;
  flex: none;
}

.receipt-brand div { display: flex; flex-direction: column; }
.receipt-brand strong { font-family: var(--serif); font-size: 20px; line-height: 1.1; }
.receipt-brand span { font-size: 8.5px; color: #6f7b74; text-transform: uppercase; letter-spacing: 0.1em; margin-top: 3px; }

.receipt-stamp { text-align: right; display: flex; flex-direction: column; gap: 2px; align-items: flex-end; }
.receipt-stamp span { font-size: 7.5px; text-transform: uppercase; letter-spacing: 0.16em; color: #0e5c45; font-weight: 700; }
.receipt-stamp strong { font-size: 11.5px; font-variant-numeric: tabular-nums; }
.receipt-stamp em { font-style: normal; font-size: 9.5px; color: #6f7b74; }

.receipt-company {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  font-size: 8px;
  color: #6f7b74;
  padding: 8px 0;
  border-bottom: 1px dashed #dcd7ca;
}

.receipt-title {
  text-align: center;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  margin: 18px 0 14px;
  letter-spacing: -0.01em;
}

.receipt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 16px; margin-bottom: 16px; }
.receipt-grid div { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.receipt-grid .span2 { grid-column: span 2; }
.receipt-grid span { font-size: 7.5px; text-transform: uppercase; letter-spacing: 0.08em; color: #7a857f; }
.receipt-grid strong { font-size: 10.5px; font-weight: 600; overflow-wrap: anywhere; }

.receipt-table { width: 100%; border-collapse: collapse; margin-bottom: 14px; font-size: 10px; }
.receipt-table th {
  text-align: left;
  background: #f4f1e8;
  padding: 7px 8px;
  font-size: 7.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #5e6b64;
  border-bottom: 1px solid #dcd7ca;
}
.receipt-table td { padding: 8px; border-bottom: 1px solid #ece8dd; vertical-align: top; }
.receipt-table .right { text-align: right; font-variant-numeric: tabular-nums; }
.receipt-table .receipt-pay td { background: #e9f4ed; font-weight: 600; }

.receipt-amount {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #0e5c45;
  color: #fff;
  padding: 11px 14px;
  border-radius: 8px;
  margin-bottom: 14px;
}

.receipt-amount span { font-size: 8px; text-transform: uppercase; letter-spacing: 0.12em; color: #cfe4d8; }
.receipt-amount strong { font-family: var(--serif); font-size: 24px; letter-spacing: -0.01em; }

.receipt-note { font-size: 9.5px; line-height: 1.6; color: #39463f; margin: 0 0 24px; }

.receipt-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; margin-bottom: 18px; }
.receipt-sign div { display: flex; flex-direction: column; gap: 26px; }
.receipt-sign span { font-size: 8px; text-transform: uppercase; letter-spacing: 0.08em; color: #6f7b74; }
.receipt-sign i { display: block; border-bottom: 1px dashed #b9b2a2; }

.receipt-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  border-top: 1px dashed #dcd7ca;
  padding-top: 8px;
  font-size: 7px;
  color: #8a938d;
}

/* ============================================================
   Écran d'accueil
   ============================================================ */

.welcome {
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 18%, #19523f 0, #0a2b21 46%, #071e17 100%);
  color: #f3efe3;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 36px;
  overflow: hidden;
}

.welcome-wrap {
  width: 100%;
  max-width: 1180px;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 48px;
  align-items: center;
}

.welcome-visual { position: relative; height: 500px; }

.wv-glow {
  position: absolute;
  inset: 10% 5%;
  background: radial-gradient(circle, rgba(212, 172, 96, 0.22), transparent 65%);
  filter: blur(20px);
}

.wv-card {
  position: absolute;
  background: #fffdf9;
  color: #15231d;
  border-radius: 16px;
  box-shadow: 0 30px 60px -25px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.wv-card-main { top: 40px; left: 20px; width: 320px; padding: 20px; transform: rotate(-3deg); }

.wv-card-top {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #77817a;
  font-weight: 700;
}

.wv-card-top .ic { margin-left: auto; }

.wv-dot { width: 6px; height: 6px; border-radius: 50%; background: #0e5c45; }

.wv-amount { display: block; font-family: var(--serif); font-size: 27px; margin: 10px 0 14px; letter-spacing: -0.02em; }

.wv-bars {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 70px;
  padding-top: 6px;
  background: repeating-linear-gradient(to top, transparent 0, transparent 22px, #ece7db 22px, #ece7db 23px);
}

.wv-bars i { flex: 1; background: linear-gradient(180deg, #1c8060, #0b4f3a); border-radius: 4px 4px 2px 2px; opacity: 0.9; }

.wv-card-cal { top: 185px; right: 10px; width: 280px; padding: 16px; transform: rotate(2.5deg); }

.wv-cal-head { display: flex; justify-content: space-between; font-size: 9.5px; margin-bottom: 10px; color: #77817a; }
.wv-cal-head strong { color: #15231d; font-size: 12px; }

.wv-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }

.wv-cal i { aspect-ratio: 1; border-radius: 5px; background: #f3efe5; border: 1px solid #e7e1d4; }
.wv-cal i.c { background: #e3f3ea; border-color: #c9e6d7; }
.wv-cal i.a { background: #fbf1da; border-color: #ecd7a8; }
.wv-cal i.m { background: #fbe9e6; border-color: #f0c8c3; }
.wv-cal i.t { box-shadow: 0 0 0 2px #0e5c45; }

.wv-card-receipt {
  bottom: 35px;
  left: 80px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  transform: rotate(-1.5deg);
  background: #f3dfb8;
  color: #3d2a0c;
  border-color: #e6cd9a;
}

.wv-card-receipt div { display: flex; flex-direction: column; gap: 1px; }
.wv-card-receipt strong { font-size: 11px; }
.wv-card-receipt span { font-size: 9px; opacity: 0.7; font-variant-numeric: tabular-nums; }

.welcome-copy { max-width: 520px; }

.welcome-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 40px; }
.welcome-brand .brand-text strong { color: #f3efe3; font-size: 18px; }
.welcome-brand .brand-text small { color: #9db9ab; }

.welcome .eyebrow { color: #d9b878; }

.welcome-copy h1 {
  font-family: var(--serif);
  font-size: clamp(42px, 5vw, 64px);
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin: 8px 0 18px;
  color: #f8f4e7;
  font-weight: 600;
}

.welcome-copy h1 em { font-style: italic; color: #d9b878; }

.welcome-lead { font-size: 13.5px; line-height: 1.6; color: #b9cfc3; margin: 0 0 22px; max-width: 46ch; }

.welcome-features { list-style: none; padding: 0; margin: 0 0 28px; display: flex; flex-direction: column; gap: 10px; }

.welcome-features li { display: flex; gap: 9px; align-items: flex-start; font-size: 11.5px; line-height: 1.5; color: #b9cfc3; }
.welcome-features .ic { color: #d9b878; margin-top: 1px; flex: none; }
.welcome-features strong { color: #f3efe3; font-weight: 600; }

.welcome-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.welcome .btn.primary {
  background: #e8c88a;
  border-color: #e8c88a;
  color: #1d1607;
  box-shadow: 0 12px 30px -12px rgba(232, 200, 138, 0.6);
}

.welcome .btn.primary:hover { background: #f0d49b; border-color: #f0d49b; }

.welcome .btn.ghost { border-color: rgba(255, 255, 255, 0.22); color: #f3efe3; background: rgba(255, 255, 255, 0.04); }
.welcome .btn.ghost:hover { background: rgba(255, 255, 255, 0.1); }

.welcome-note { display: flex; align-items: center; gap: 6px; font-size: 9.5px; color: #7f9c8c; margin-top: 18px; }

/* ============================================================
   Verrouillage
   ============================================================ */

.lock-screen {
  min-height: 100vh;
  background: radial-gradient(circle at 50% 15%, #174f3c, #0a2b21 55%, #061a14);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.lock-box {
  width: 100%;
  max-width: 360px;
  background: #fffdf9;
  border-radius: 20px;
  padding: 30px 28px;
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.lock-box .brand-mark.big {
  background: #0e5c45;
  color: #f6e7c8;
  margin-bottom: 14px;
  box-shadow: 0 12px 24px -12px rgba(14, 92, 69, 0.6);
}

.lock-brand { display: flex; flex-direction: column; gap: 2px; margin-bottom: 22px; }
.lock-brand strong { font-family: var(--serif); font-size: 23px; font-weight: 600; }
.lock-brand span { font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted); }

.lock-box form { width: 100%; display: flex; flex-direction: column; gap: 10px; text-align: left; }

.lock-error { min-height: 15px; font-size: 10px; color: var(--red); text-align: center; margin: 0; }

.lock-note { display: flex; align-items: center; gap: 4px; font-size: 8.5px; color: var(--muted); margin: 12px 0 0; text-align: center; }

/* ============================================================
   Notifications
   ============================================================ */

.toast-root {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  background: #10291f;
  color: #f3efe3;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-left: 3px solid #d9b878;
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 11px;
  box-shadow: 0 18px 40px -15px rgba(0, 0, 0, 0.6);
  animation: toastIn 0.2s ease;
  max-width: 340px;
  line-height: 1.4;
}

.toast.success { border-left-color: #5ec39a; }
.toast.error { border-left-color: #e07b70; }
.toast.info { border-left-color: #7fb6dd; }

.toast-ic { display: grid; place-items: center; flex: none; color: #d9b878; }
.toast.success .toast-ic { color: #5ec39a; }
.toast.error .toast-ic { color: #e07b70; }
.toast.info .toast-ic { color: #7fb6dd; }

.toast-out { opacity: 0; transform: translateY(6px); transition: 0.25s; }

/* ============================================================
   Animations
   ============================================================ */

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 1180px) {
  .kpi-grid { grid-template-columns: 1.25fr 1fr 1fr; }
  .kpi-grid .kpi:last-child { grid-column: span 3; }
  .kpi-grid .kpi:last-child .kpi-value { font-size: 26px; }
  .mini-stats { grid-template-columns: repeat(4, 1fr); }
  .settings-grid { grid-template-columns: 1fr; }
  .client-card { padding: 14px; }
}

@media (max-width: 1060px) {
  .split { grid-template-columns: 1fr; }
  .client-info-split { grid-template-columns: 1fr; }
  .profile-stats { grid-template-columns: repeat(3, 1fr); }
  .setup-steps { grid-template-columns: 1fr; }
  .mini-kpis { grid-template-columns: repeat(2, 1fr); }
  .client-grid { grid-template-columns: 1fr 1fr; }
  .pointage-row { grid-template-columns: minmax(170px, 1.3fr) 95px 110px auto; gap: 9px; padding: 10px 11px; }
  .pbtn { padding: 0 6px; }
  .pbtn span { display: none; }
  .pbtn { width: 31px; justify-content: center; }
}

@media (max-width: 980px) {
  .app { grid-template-columns: 1fr; }

  .sidebar { display: none; }

  .mobile-bar {
    display: flex;
    position: sticky;
    top: 0;
    z-index: 35;
    background: rgba(243, 240, 231, 0.94);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
    padding: 9px 16px;
    align-items: center;
    justify-content: space-between;
  }

  .view { padding: 22px 18px 96px; }

  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 253, 249, 0.97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
    z-index: 40;
    padding: 5px 6px calc(5px + env(safe-area-inset-bottom));
    justify-content: space-around;
  }

  .bottom-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    font-size: 8.5px;
    color: var(--muted);
    padding: 5px 3px;
    border-radius: 8px;
    flex: 1;
    text-align: center;
    font-weight: 550;
  }

  .bottom-link.active { color: var(--brand); background: var(--brand-3); }

  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .kpi-grid .kpi:last-child { grid-column: auto; }
  .kpi-grid .kpi.primary { grid-column: span 2; }

  .cash-hero { padding: 20px; }
  .cash-side { min-width: 220px; }

  .welcome { padding: 24px; }
  .welcome-wrap { grid-template-columns: 1fr; gap: 24px; max-width: 560px; }
  .welcome-visual { display: none; }
  .welcome-copy { max-width: none; }
  .welcome-brand { margin-bottom: 24px; }
  .welcome-copy h1 { font-size: clamp(38px, 9vw, 54px); }
  .welcome-lead { font-size: 13px; }
}

@media (max-width: 760px) {
  .page-head { align-items: flex-start; gap: 14px; margin-bottom: 18px; }
  .page-head h1 { font-size: 28px; }
  .page-sub { font-size: 12px; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1; }

  .kpi-grid { gap: 10px; }
  .kpi { padding: 14px 15px; border-radius: 14px; }
  .kpi-value { font-size: 24px; }
  .kpi.primary .kpi-value { font-size: 30px; }

  .mini-kpis { gap: 9px; }
  .mini-kpi strong { font-size: 18px; }

  .client-grid { grid-template-columns: 1fr; }

  .profile { padding: 17px; }
  .profile-name h1 { font-size: 25px; }
  .profile-actions { width: 100%; }
  .profile-actions .btn { flex: 1; }
  .profile-stats { grid-template-columns: repeat(3, 1fr); gap: 9px; }

  .card-panel { padding: 15px; }
  .cp-title h3 { font-size: 20px; }
  .cp-actions { width: 100%; }
  .mini-stats { grid-template-columns: 1fr 1fr; }
  .mini-stats > div { padding: 9px 11px; }

  .cal-day { min-height: 43px; padding: 4px 4px; border-radius: 7px; }
  .cal-day .dnum { font-size: 9.5px; }
  .cal-day .damt { font-size: 6.5px; }
  .cal-weekdays { gap: 3px; }
  .cal-grid { gap: 3px; }
  .cal-empty { min-height: 43px; }
  .calendar { padding: 9px; }
  .cal-title strong { font-size: 15px; }
  .cal-nav .btn { display: none; }

  .period-cards { grid-template-columns: 1fr; }
  .cash-side { grid-template-columns: 1fr 1fr; gap: 10px 18px; min-width: 100%; }
  .cash-value { font-size: 34px; }

  .form-grid { grid-template-columns: 1fr; }
  .field.span2, .form-grid .span2 { grid-column: auto; }
  .account-readout { grid-template-columns: 1fr 1fr; }

  .settings-grid { gap: 12px; }
  .setting-card { padding: 16px; }

  .modal-backdrop { padding: 10px; align-items: flex-end; }
  .modal { max-height: 94vh; border-radius: 16px; }
  .modal-head { padding: 16px 16px 12px; }
  .modal-head h2 { font-size: 20px; }
  .modal-body { padding: 14px 16px; }
  .modal-foot { padding: 12px 16px; }
  .day-cards { grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
  .seg-cards { gap: 5px; }
  .seg-card span { padding: 8px; }

  .pointage-toolbar { align-items: stretch; }
  .date-picker { flex: 1; min-width: 140px; }
  .pointage-toolbar .search-box { min-width: 100%; flex-basis: 100%; }
  .pointage-toolbar .btn { height: 40px; }
  .pointage-summary { gap: 13px 20px; }
  .ps-stat { text-align: left; }

  .pointage-row {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "main status"
      "daily actions";
    gap: 7px 10px;
    padding: 10px 11px;
  }

  .pr-main { grid-area: main; }
  .pr-daily { grid-area: daily; flex-direction: row; align-items: center; gap: 5px; }
  .pr-status { grid-area: status; align-items: flex-end; }
  .pr-actions { grid-area: actions; }
  .pbtn { width: 31px; }
  .pbtn span { display: none; }

  .journal-tools { width: 100%; }
  .journal-tools select { width: 100%; }

  .mc-head { align-items: flex-start; }
  .mc-solde { text-align: left; }
  .mc-client { min-width: 100%; }
  .mc-foot { gap: 12px; }
  .mc-foot .btn { margin-left: 0; }

  .about-meta { margin-left: 0; }

  .welcome { padding: 22px 18px; }
  .welcome-brand { margin-bottom: 18px; }
  .welcome-copy h1 { font-size: 40px; }
  .welcome-actions .btn { flex: 1; }
  .welcome-features li { font-size: 11px; }

  .toast-root { left: 12px; right: 12px; bottom: 78px; align-items: stretch; }
  .toast { max-width: none; }

  .receipt-head { flex-direction: column; gap: 10px; }
  .receipt-stamp { align-items: flex-start; text-align: left; }
  .receipt-amount strong { font-size: 20px; }
}

@media (max-width: 560px) {
  .view { padding: 18px 13px 92px; }
  .page-head h1 { font-size: 25px; }
  .eyebrow { font-size: 9px; }

  .kpi-grid { grid-template-columns: 1fr; }
  .kpi-grid .kpi.primary { grid-column: auto; }
  .kpi-value, .kpi.primary .kpi-value { font-size: 28px; }

  .mini-kpis { grid-template-columns: 1fr 1fr; }
  .mini-kpi { padding: 11px 12px; }
  .mini-kpi strong { font-size: 17px; }

  .profile-stats { grid-template-columns: 1fr 1fr; }
  .info-grid { grid-template-columns: 1fr; }
  .info-grid .span2 { grid-column: auto; }

  .cal-day { min-height: 38px; }
  .cal-empty { min-height: 38px; }
  .cal-day .damt { display: none; }
  .cal-summary { gap: 8px; }
  .cal-legend { gap: 8px; }

  .mini-stats { grid-template-columns: 1fr 1fr; }
  .cp-actions .btn { flex: 1; }
  .cp-actions .icon-btn { width: 33px; height: 33px; }

  .cash-value { font-size: 30px; }
  .cash-side { grid-template-columns: 1fr; }
  .cash-hero { padding: 18px; }

  .day-cards { grid-template-columns: 1fr; gap: 5px; }
  .day-cards div { flex-direction: row; justify-content: space-between; align-items: center; }
  .seg-cards { grid-template-columns: 1fr; }
  .seg-card span { flex-direction: row; align-items: center; justify-content: space-between; }
  .seg-card em { display: none; }

  .toolbar .search-box { min-width: 100%; }
  .chips { gap: 5px; }
  .chip { font-size: 9.5px; height: 28px; padding: 0 8px; }

  .account-readout { grid-template-columns: 1fr; }
  .security-actions .btn, .backup-actions .btn { flex: 1; }

  .about-panel { padding: 15px; }
  .about-meta { gap: 8px; font-size: 8.5px; }

  .welcome-copy h1 { font-size: 35px; }
  .welcome-lead { font-size: 12px; }
  .welcome-actions { flex-direction: column; }
  .welcome-actions .btn { width: 100%; }

  .modal { border-radius: 14px; }
  .modal-foot .btn { flex: 1; }

  .receipt-sign { gap: 16px; }
  .receipt-grid { grid-template-columns: 1fr; }
  .receipt-grid .span2 { grid-column: auto; }
}

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

/* ============================================================
   Impression du reçu
   ============================================================ */

@media print {
  @page { size: A4; margin: 14mm; }

  body { background: #fff; overflow: visible; }

  body * { visibility: hidden; }

  #receipt-print, #receipt-print * { visibility: visible; }

  #receipt-print {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    max-width: none;
    padding: 0;
    margin: 0;
    border: 0;
  }

  .modal-backdrop { position: static; display: block; background: none; padding: 0; backdrop-filter: none; }
  .modal { max-height: none; max-width: none; width: 100%; border-radius: 0; box-shadow: none; overflow: visible; }
  .modal-head, .modal-foot { display: none !important; }
  .modal-body { padding: 0; overflow: visible; max-height: none; }

  .no-print { display: none !important; }
}
