/* Style repris de MoneyMind : tokens oklch, police Geist, accent indigo, menu latéral, thème clair/sombre. */
@font-face { font-family: "Geist Variable"; font-weight: 100 900; font-display: swap;
  src: url("fonts/geist-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Geist Variable"; font-weight: 100 900; font-display: swap;
  src: url("fonts/geist-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --background: oklch(1 0 0); --foreground: oklch(0.148 0.004 228.8);
  --card: oklch(1 0 0); --card-foreground: oklch(0.148 0.004 228.8);
  --primary: oklch(0.457 0.24 277.023); --primary-foreground: oklch(0.962 0.018 272.314);
  --secondary: oklch(0.967 0.001 286.375); --secondary-foreground: oklch(0.21 0.006 285.885);
  --muted: oklch(0.963 0.002 197.1); --muted-foreground: oklch(0.56 0.021 213.5);
  --accent: oklch(0.963 0.002 197.1); --accent-foreground: oklch(0.218 0.008 223.9);
  --destructive: oklch(0.577 0.245 27.325);
  --border: oklch(0.925 0.005 214.3); --input: oklch(0.925 0.005 214.3); --ring: oklch(0.723 0.014 214.4);
  --chart-1: oklch(0.72 0.19 160); --chart-2: oklch(0.65 0.20 280); --chart-3: oklch(0.75 0.15 75);
  --chart-4: oklch(0.65 0.22 25); --chart-5: oklch(0.70 0.16 210);
  --radius: 0.875rem;
  --sidebar: oklch(0.987 0.002 197.1); --sidebar-foreground: oklch(0.148 0.004 228.8);
  --sidebar-primary: oklch(0.511 0.262 276.966); --sidebar-accent: oklch(0.963 0.002 197.1);
  --sidebar-accent-foreground: oklch(0.218 0.008 223.9); --sidebar-border: oklch(0.925 0.005 214.3);
  --sl: 0.46; /* luminosité des couleurs de statut */
}
.dark {
  --background: oklch(0.148 0.004 228.8); --foreground: oklch(0.987 0.002 197.1);
  --card: oklch(0.218 0.008 223.9); --card-foreground: oklch(0.987 0.002 197.1);
  --primary: oklch(0.585 0.233 277.117); --primary-foreground: oklch(0.962 0.018 272.314);
  --secondary: oklch(0.274 0.006 286.033); --secondary-foreground: oklch(0.985 0 0);
  --muted: oklch(0.275 0.011 216.9); --muted-foreground: oklch(0.78 0.012 214.4);
  --accent: oklch(0.275 0.011 216.9); --accent-foreground: oklch(0.987 0.002 197.1);
  --destructive: oklch(0.704 0.191 22.216);
  --border: oklch(1 0 0 / 10%); --input: oklch(1 0 0 / 15%); --ring: oklch(0.56 0.021 213.5);
  --chart-1: oklch(0.78 0.18 155); --chart-2: oklch(0.70 0.22 280); --chart-3: oklch(0.80 0.15 85);
  --chart-4: oklch(0.70 0.20 25); --chart-5: oklch(0.75 0.16 210);
  --sidebar: oklch(0.218 0.008 223.9); --sidebar-foreground: oklch(0.987 0.002 197.1);
  --sidebar-primary: oklch(0.585 0.233 277.117); --sidebar-accent: oklch(0.275 0.011 216.9);
  --sidebar-accent-foreground: oklch(0.987 0.002 197.1); --sidebar-border: oklch(1 0 0 / 10%);
  --sl: 0.8;
}
* { box-sizing: border-box; border-color: var(--border); }
html { font-family: "Geist Variable", system-ui, sans-serif; font-size: 15px; -webkit-font-smoothing: antialiased; }
body { margin: 0; background: var(--background); color: var(--foreground); min-height: 100vh; }
a { color: var(--primary); text-decoration: none; } a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; letter-spacing: -0.01em; font-weight: 600; }
h1 { font-size: 1.35rem; } h2 { font-size: 1rem; } h3 { font-size: .9rem; }
.dark a { color: oklch(0.78 0.12 277); }
.muted { color: var(--muted-foreground); } .small { font-size: .85rem; } .num { font-variant-numeric: tabular-nums; }

/* disposition */
.app { display: grid; grid-template-columns: 16rem 1fr; min-height: 100vh; }
.side { background: var(--sidebar); border-right: 1px solid var(--sidebar-border); padding: 1rem .75rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: .6rem; padding: .25rem .6rem 1rem; font-weight: 600; }
.brand .logo { width: 1.9rem; height: 1.9rem; border-radius: .6rem; background: var(--sidebar-primary); color: #fff; display: grid; place-items: center; font-size: .9rem; }
.nav a { display: flex; align-items: center; gap: .65rem; padding: .5rem .65rem; border-radius: calc(var(--radius) * .7); color: var(--sidebar-foreground); font-size: .93rem; }
.nav a:hover { background: var(--sidebar-accent); text-decoration: none; }
.nav a.actif { background: var(--sidebar-accent); font-weight: 600; }
.nav .titre { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted-foreground); padding: 1rem .65rem .3rem; }
.main { min-width: 0; }
.top { display: flex; align-items: center; gap: .75rem; padding: .8rem 1.5rem; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: color-mix(in oklch, var(--background) 88%, transparent); backdrop-filter: blur(8px); z-index: 20; }
.top .grow { flex: 1; }
.contenu { padding: 1.5rem; max-width: 84rem; }
.entete { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.entete p { margin: .25rem 0 0; }
svg.i { width: 1.1em; height: 1.1em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* composants */
.card { background: var(--card); color: var(--card-foreground); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.15rem; }
.card > h2 { margin-bottom: .75rem; display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.grille { display: grid; gap: 1rem; } .g4 { grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); }
.g2 { grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr)); } .g3 { grid-template-columns: 2fr 1fr; }
@media (max-width: 62rem) { .app { grid-template-columns: 1fr; } .side { position: static; height: auto; } .g3 { grid-template-columns: 1fr; } }
.kpi .v { font-size: 1.9rem; font-weight: 600; letter-spacing: -.02em; } .kpi .l { color: var(--muted-foreground); font-size: .85rem; }
.btn { display: inline-flex; align-items: center; gap: .4rem; border: 1px solid var(--border); background: var(--card); color: var(--foreground); border-radius: calc(var(--radius) * .7); padding: .42rem .8rem; font: inherit; font-size: .9rem; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--accent); text-decoration: none; } .btn.p { background: var(--primary); color: var(--primary-foreground); border-color: transparent; }
.btn.p:hover { filter: brightness(1.1); } .btn.s { padding: .25rem .55rem; font-size: .82rem; } .btn.d { color: var(--destructive); }
.dark .btn.p { color: var(--primary-foreground); }
input, select, textarea { font: inherit; color: var(--foreground); background: var(--background); border: 1px solid var(--input); border-radius: calc(var(--radius) * .7); padding: .42rem .65rem; max-width: 100%; }
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 2px solid var(--ring); outline-offset: 1px; }
textarea { width: 100%; min-height: 5rem; } label { font-size: .82rem; color: var(--muted-foreground); display: grid; gap: .25rem; }
.form { display: grid; gap: .85rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); } .form .large { grid-column: 1 / -1; }
.barre { display: flex; flex-wrap: wrap; gap: .6rem; align-items: end; } .barre label { min-width: 7rem; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { text-align: left; font-weight: 500; color: var(--muted-foreground); font-size: .8rem; padding: .5rem .7rem; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: .55rem .7rem; border-bottom: 1px solid var(--border); vertical-align: top; } tbody tr:hover { background: var(--muted); }
tr:last-child td { border-bottom: 0; } th a { color: inherit; } .tabw { overflow-x: auto; }
.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .12rem .55rem; border-radius: 999px; font-size: .78rem; font-weight: 500; white-space: nowrap;
  color: var(--c); background: color-mix(in oklch, var(--c) 13%, transparent); border: 1px solid color-mix(in oklch, var(--c) 28%, transparent); }
[data-s=a_contacter] { --c: oklch(calc(var(--sl) + .05) .02 230); } [data-s=mail_envoye] { --c: oklch(var(--sl) .14 245); }
[data-s=appele] { --c: oklch(var(--sl) .17 285); } [data-s=a_rappeler] { --c: oklch(var(--sl) .13 70); }
[data-s=relance_necessaire] { --c: oklch(var(--sl) .17 40); } [data-s=dispo_partielle] { --c: oklch(var(--sl) .11 195); }
[data-s=valide] { --c: oklch(var(--sl) .15 155); } [data-s=refuse] { --c: oklch(var(--sl) .19 25); } [data-s=hors_zone] { --c: oklch(var(--sl) 0 0); }
.alerte { display: flex; gap: .6rem; padding: .6rem .8rem; border-radius: calc(var(--radius) * .7); font-size: .9rem; margin-bottom: .5rem; align-items: flex-start;
  border: 1px solid color-mix(in oklch, var(--c) 30%, transparent); background: color-mix(in oklch, var(--c) 10%, transparent); }
.alerte.danger { --c: var(--destructive); } .alerte.warn { --c: oklch(var(--sl) .13 70); } .alerte.ok { --c: oklch(var(--sl) .15 155); }
.barres { display: grid; gap: .5rem; } .barres .l { display: grid; grid-template-columns: 9.5rem 1fr 2rem; gap: .6rem; align-items: center; font-size: .88rem; }
.barres .b { height: .55rem; border-radius: 99px; background: var(--muted); overflow: hidden; } .barres .b i { display: block; height: 100%; background: var(--c); border-radius: 99px; }
.chip { display: inline-block; padding: .05rem .45rem; border-radius: .4rem; background: var(--muted); font-size: .78rem; }
.vide { color: var(--muted-foreground); padding: 1rem 0; text-align: center; font-size: .9rem; }
.fil { border-left: 2px solid var(--border); margin-left: .4rem; padding-left: 1rem; display: grid; gap: .9rem; }
.fil .ev { position: relative; } .fil .ev::before { content: ""; position: absolute; left: -1.38rem; top: .35rem; width: .55rem; height: .55rem; border-radius: 50%; background: var(--primary); }
.score { display: inline-block; min-width: 2rem; text-align: center; font-weight: 600; }
details summary { cursor: pointer; color: var(--muted-foreground); font-size: .9rem; padding: .3rem 0; }
.pager { display: flex; gap: .5rem; align-items: center; justify-content: center; margin-top: 1rem; }

/* calendrier */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.cal .h { padding: .45rem; font-size: .78rem; color: var(--muted-foreground); background: var(--muted); text-align: center; }
.cal .j { min-height: 5.4rem; padding: .35rem; border-top: 1px solid var(--border); border-left: 1px solid var(--border); font-size: .78rem; display: grid; gap: .2rem; align-content: start; }
.cal .j:nth-child(7n+1) { border-left: 0; } .cal .j.autre { opacity: .45; } .cal .j.auj { box-shadow: inset 0 0 0 2px var(--primary); }
.cal .j .d { font-weight: 600; } .cal .j.libre { background: color-mix(in oklch, var(--chart-1) 12%, transparent); }
.pill { display: block; padding: .05rem .35rem; border-radius: .35rem; background: color-mix(in oklch, var(--c) 18%, transparent); color: var(--c); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.annee { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; } .annee a.actif { background: var(--primary); color: var(--primary-foreground); }

/* carte, palette */
#carte { height: calc(100vh - 11rem); min-height: 28rem; border-radius: var(--radius); border: 1px solid var(--border); }
.dark .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.92) contrast(.9); }
.legende { display: flex; gap: .8rem; flex-wrap: wrap; margin: .6rem 0; }
#palette { position: fixed; inset: 0; background: oklch(0 0 0 / 45%); display: none; place-items: start center; padding-top: 14vh; z-index: 100; }
#palette.ouverte { display: grid; } #palette .boite { width: min(36rem, 92vw); background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: 0 20px 50px oklch(0 0 0 / 30%); }
#palette input { width: 100%; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; padding: .9rem 1rem; font-size: 1rem; }
#palette a { display: block; padding: .6rem 1rem; color: var(--foreground); } #palette a:hover, #palette a.sel { background: var(--accent); text-decoration: none; }
kbd { font: inherit; font-size: .75rem; border: 1px solid var(--border); border-radius: .35rem; padding: .05rem .35rem; background: var(--muted); }
@media print { .side, .top, .btn, form { display: none !important; } .app { display: block; } .contenu { padding: 0; } }
