/* =====================================================================
   KCK-IT Desk 6 — style « Verre façon iPhone »
   Surfaces translucides, gros arrondis, couleurs vives par statut,
   mouvements à ressort. Fond simple : tout le mouvement est dans l'appli.
   ===================================================================== */

/* ---------- Polices (hébergées avec le Desk, licence SIL OFL) ---------- */
@font-face { font-family: "Geist"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("../fonts/geist.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; }
@font-face { font-family: "Geist"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("../fonts/geist-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, 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 Mono"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("../fonts/geist-mono.woff2") format("woff2"); }

/* ---------- Jetons ---------- */
:root {
    color-scheme: dark;
    --font: -apple-system, BlinkMacSystemFont, "Geist", "Segoe UI", system-ui, sans-serif;
    --mono: ui-monospace, "SF Mono", "Geist Mono", Menlo, monospace;

    --bg: #05060A;
    --bg-a: rgba(10, 132, 255, .42);
    --bg-b: rgba(191, 90, 242, .30);
    --bg-c: rgba(100, 210, 255, .16);

    --glass: rgba(255, 255, 255, .055);
    --glass-2: rgba(255, 255, 255, .085);
    --glass-3: rgba(255, 255, 255, .13);
    --glass-strong: rgba(28, 28, 32, .72);
    --glass-line: rgba(255, 255, 255, .09);
    --glass-hi: rgba(255, 255, 255, .14);
    --sep: rgba(255, 255, 255, .08);
    --blur: blur(30px) saturate(180%);
    --shadow: 0 1px 0 rgba(255, 255, 255, .06) inset, 0 18px 50px -18px rgba(0, 0, 0, .6);
    --shadow-pop: 0 30px 80px -20px rgba(0, 0, 0, .75), 0 0 0 1px rgba(255, 255, 255, .08);

    --ink: #F5F5F7;
    --ink-2: rgba(235, 235, 245, .80);
    --muted: rgba(235, 235, 245, .56);
    --faint: rgba(235, 235, 245, .30);
    --fill: rgba(120, 120, 128, .24);
    --fill-2: rgba(120, 120, 128, .16);
    --field: rgba(118, 118, 128, .20);

    --blue: #0A84FF; --green: #30D158; --orange: #FF9F0A; --red: #FF453A; --yellow: #FFD60A;
    --purple: #BF5AF2; --teal: #64D2FF; --indigo: #5E5CE6; --pink: #FF375F; --mint: #66D4CF;
    --accent: var(--blue);
    --on-accent: #fff;

    --todo: var(--orange); --doing: var(--blue); --done: var(--green);
    --paid: var(--green); --pending: var(--orange); --quote: var(--purple); --warranty: var(--teal);

    --r-xl: 30px; --r-lg: 24px; --r: 18px; --r-sm: 12px; --r-xs: 9px;

    --spring: linear(0, .0527, .1801, .3433, .5136, .6718, .8066, .913, .9904, 1.0416, 1.0706, 1.0825, 1.0821, 1.0737, 1.0611, 1.0468, 1.033, 1.0208, 1.0109, 1.0034, .9982, .995, .9934, .993, .9935, .9944, .9956, .9967, .9978, .9988, .9995, 1, 1.0003, 1.0005, 1.0006, 1.0003, 1);
    --spring-soft: linear(0, .0383, .1302, .2488, .3755, .4982, .6097, .7064, .7871, .8521, .9028, .9411, .969, .9884, 1.0013, 1.0091, 1.0134, 1.015, 1.015, 1.0139, 1.0122, 1.0103, 1.0084, 1.0067, 1.0051, 1.0038, 1.0027, 1.0018, 1.0011, 1.0006, 1.0003, 1.0001, 1);
    --spring-bounce: linear(0, .0847, .2848, .5285, .7622, .9523, 1.0839, 1.1565, 1.1792, 1.1656, 1.1306, 1.0871, 1.0449, 1.0102, .986, .9724, .9679, .97, .9762, .9839, .9916, .9979, 1.0023, 1.0049, 1.0057, 1.0054, 1.0043, 1.003, 1.0016, 1.0004, .9996, .9991, .999, .999, .9992, .9995, 1);
    --ease: cubic-bezier(.22, 1, .36, 1);
    --t-spring: .62s;

    --side-w: 272px;
    --tab-h: 0px;
    --safe-b: env(safe-area-inset-bottom, 0px);
    --safe-t: env(safe-area-inset-top, 0px);
}
@supports not (transition-timing-function: linear(0, 1)) {
    :root { --spring: cubic-bezier(.34, 1.4, .64, 1); --spring-soft: cubic-bezier(.25, 1.1, .5, 1); --spring-bounce: cubic-bezier(.34, 1.7, .64, 1); }
}

:root[data-theme="light"] {
    color-scheme: light;
    --bg: #EEF0F6;
    --bg-a: rgba(0, 122, 255, .20);
    --bg-b: rgba(175, 82, 222, .14);
    --bg-c: rgba(52, 199, 89, .10);
    --glass: rgba(255, 255, 255, .62);
    --glass-2: rgba(255, 255, 255, .78);
    --glass-3: rgba(255, 255, 255, .92);
    --glass-strong: rgba(255, 255, 255, .82);
    --glass-line: rgba(0, 0, 0, .06);
    --glass-hi: rgba(255, 255, 255, .9);
    --sep: rgba(60, 60, 67, .12);
    --shadow: 0 1px 0 rgba(255, 255, 255, .8) inset, 0 14px 40px -18px rgba(30, 40, 80, .28);
    --shadow-pop: 0 30px 80px -20px rgba(20, 30, 60, .35), 0 0 0 1px rgba(0, 0, 0, .05);
    --ink: #1C1C1E;
    --ink-2: rgba(60, 60, 67, .88);
    --muted: rgba(60, 60, 67, .62);
    --faint: rgba(60, 60, 67, .32);
    --fill: rgba(120, 120, 128, .16);
    --fill-2: rgba(120, 120, 128, .10);
    --field: rgba(118, 118, 128, .12);
    --blue: #007AFF; --green: #28A745; --orange: #E07800; --red: #E5352B; --yellow: #C99700;
    --purple: #9F44D3; --teal: #0E8FC4; --indigo: #5856D6; --pink: #E0245E; --mint: #0FA39D;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--bg); }
body {
    margin: 0; min-height: 100dvh; font-family: var(--font); font-size: 15px; line-height: 1.45; color: var(--ink);
    background: var(--bg); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; -webkit-tap-highlight-color: transparent;
    letter-spacing: -.01em; overflow-x: hidden;
}
body::before {
    content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
    background:
        radial-gradient(55% 50% at 0% 0%, var(--bg-a), transparent 72%),
        radial-gradient(45% 45% at 100% 0%, var(--bg-b), transparent 72%),
        radial-gradient(60% 55% at 70% 100%, var(--bg-c), transparent 75%),
        radial-gradient(40% 40% at 20% 90%, color-mix(in srgb, var(--bg-b) 60%, transparent), transparent 75%);
}
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
a { color: var(--accent); text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2.5px solid color-mix(in srgb, var(--accent) 80%, white); outline-offset: 2px; border-radius: 10px; }
::selection { background: color-mix(in srgb, var(--accent) 45%, transparent); }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.i--sm { width: 16px; height: 16px; }
.i--lg { width: 24px; height: 24px; }
.num, .tab { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: .92em; }
.muted { color: var(--muted); }
.spacer { flex: 1; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--fill); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- Verre ---------- */
.glass {
    background: var(--glass); border: 1px solid var(--glass-line); border-radius: var(--r-lg);
    -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: var(--shadow);
}

/* =====================================================================
   Coquille : barre à gauche + pages
   ===================================================================== */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100dvh; }

.side {
    position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 14px;
    padding: 18px 14px 14px; z-index: 30;
}
.side-panel {
    position: absolute; inset: 10px 0 10px 10px; z-index: -1; border-radius: var(--r-xl);
    background: var(--glass); border: 1px solid var(--glass-line); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: var(--shadow);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 8px 12px 4px 18px; color: var(--ink); }
.brand-logo {
    width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none;
    background: linear-gradient(145deg, #2E8BFF, #5E5CE6); color: #fff; font-weight: 800; font-size: 18px; letter-spacing: -.04em;
    box-shadow: 0 8px 20px -6px rgba(10, 132, 255, .7), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.brand b { display: block; font-size: 16px; font-weight: 700; letter-spacing: -.02em; }
.brand small { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(48, 209, 88, .6); animation: live 2.4s ease-out infinite; }
@keyframes live { 0% { box-shadow: 0 0 0 0 rgba(48, 209, 88, .55); } 70%, 100% { box-shadow: 0 0 0 7px rgba(48, 209, 88, 0); } }

.side-search {
    display: flex; align-items: center; gap: 9px; margin: 2px 10px 0 14px; height: 38px; padding: 0 12px;
    border: 0; border-radius: 12px; background: var(--field); color: var(--muted); text-align: left; font-size: 14px;
    transition: background-color .2s, transform var(--t-spring) var(--spring);
}
.side-search:hover { background: var(--fill); }
.side-search:active { transform: scale(.97); }
.side-search kbd { margin-left: auto; font: 600 11px var(--font); padding: 2px 6px; border-radius: 6px; background: var(--fill-2); color: var(--muted); }

.nav { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 4px 10px 0 14px; }
.nav-glider {
    position: absolute; left: 14px; right: 10px; top: 0; height: 46px; border-radius: 14px; pointer-events: none;
    background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 26%, transparent), color-mix(in srgb, var(--accent) 16%, transparent));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 8px 22px -12px var(--accent);
    transition: transform .55s var(--spring), height .4s var(--spring), opacity .2s;
}
.nav a {
    position: relative; display: flex; align-items: center; gap: 13px; height: 46px; padding: 0 12px; border-radius: 14px;
    color: var(--ink-2); font-size: 15px; font-weight: 550; transition: color .2s, transform .45s var(--spring);
}
.nav a:hover { color: var(--ink); background: var(--fill-2); }
.nav a:active { transform: scale(.97); }
.nav a[aria-current="page"] { color: var(--ink); background: none; }
.nav a[aria-current="page"] .nav-ico { color: #fff; background: var(--accent); box-shadow: 0 6px 14px -6px var(--accent); }
.nav-ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; background: var(--fill-2); color: var(--ink-2); transition: background-color .3s, color .3s, box-shadow .3s; }
.nav-ico .i { width: 18px; height: 18px; }
.nav .badge { margin-left: auto; }
.side-new { margin: 6px 10px 0 14px; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding: 0 10px 4px 14px; }
.side-user { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 16px; }
.side-user > span:nth-child(2) { min-width: 0; }
.side-user b { display: block; font-size: 14px; font-weight: 650; }
.side-user small { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user .icon-btn { margin-left: auto; }
.side-old { font-size: 12px; color: var(--muted); padding: 0 10px; }
.side-old:hover { color: var(--ink); }

.main { min-width: 0; position: relative; }
.stage { position: relative; min-height: 100dvh; }
.page {
    position: relative; min-height: 100dvh; padding: 0 clamp(18px, 3.2vw, 44px) calc(120px + var(--tab-h) + var(--safe-b));
    max-width: 1320px; margin: 0 auto;
}
.page--wide { max-width: 1600px; }
.page.is-leaving { position: absolute; inset: 0 0 auto 0; pointer-events: none; }

/* Transitions de page (façon iPhone) */
.page.push-in { animation: push-in .58s var(--spring-soft) both; }
.page.push-out { animation: push-out .5s var(--ease) both; }
.page.pop-in { animation: pop-in .5s var(--ease) both; }
.page.pop-out { animation: pop-out .5s var(--ease) both; z-index: 2; }
.page.fade-in { animation: fade-in .42s var(--ease) both; }
.page.fade-out { animation: fade-out .22s ease both; }
@keyframes push-in { from { transform: translateX(min(42vw, 420px)); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes push-out { to { transform: translateX(-12%); opacity: 0; filter: brightness(.7); } }
@keyframes pop-in { from { transform: translateX(-12%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes pop-out { to { transform: translateX(min(42vw, 420px)); opacity: 0; } }
@keyframes fade-in { from { opacity: 0; transform: translateY(10px) scale(.992); } to { opacity: 1; transform: none; } }
@keyframes fade-out { to { opacity: 0; transform: scale(.99); } }

/* En-tête : grand titre qui se replie dans la barre en défilant */
.navbar {
    position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px;
    height: calc(58px + var(--safe-t)); padding-top: var(--safe-t);
    margin: 0 calc(-1 * clamp(18px, 3.2vw, 44px)); padding-left: clamp(18px, 3.2vw, 44px); padding-right: clamp(18px, 3.2vw, 44px);
    transition: background-color .25s, border-color .25s, -webkit-backdrop-filter .25s, backdrop-filter .25s;
    border-bottom: 1px solid transparent;
}
.page.is-scrolled .navbar { background: var(--glass-strong); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border-bottom-color: var(--sep); }
.navbar-title { position: absolute; left: 50%; transform: translate(-50%, 6px); max-width: 52%; font-size: 16px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0; transition: opacity .2s, transform .35s var(--spring); pointer-events: none; }
.page.is-scrolled .navbar-title { opacity: 1; transform: translate(-50%, 0); }
.back {
    display: inline-flex; align-items: center; gap: 2px; height: 36px; padding: 0 10px 0 4px; margin-left: -6px; border: 0; border-radius: 12px;
    background: none; color: var(--accent); font-size: 16px; font-weight: 500; transition: transform .4s var(--spring), background-color .2s;
}
.back .i { width: 24px; height: 24px; stroke-width: 2.4; }
.back:hover { background: var(--fill-2); }
.back:active { transform: scale(.94); }
.navbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.hero { padding: 6px 0 22px; }
.hero h1 { font-size: clamp(30px, 3.4vw, 40px); line-height: 1.08; font-weight: 750; letter-spacing: -.035em; }
.hero p { margin-top: 6px; color: var(--muted); font-size: 15px; }
.hero-row { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.hero-row .hero-actions { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }
.eyebrow { font-size: 12px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

/* Barre d'onglets (téléphone) */
.tabbar { display: none; }

/* =====================================================================
   Composants
   ===================================================================== */
.section { margin-top: 28px; }
.section-head { display: flex; align-items: baseline; gap: 10px; margin: 0 4px 12px; }
.section-head h2 { font-size: 21px; font-weight: 700; letter-spacing: -.025em; }
.section-head small { color: var(--muted); font-size: 13px; }
.section-head .link { margin-left: auto; font-size: 14px; font-weight: 550; color: var(--accent); background: none; border: 0; padding: 4px 6px; border-radius: 8px; }
.section-head .link:hover { background: var(--fill-2); }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cols { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr); gap: 22px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row-wrap { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.card { position: relative; padding: 20px; border-radius: var(--r-lg); background: var(--glass); border: 1px solid var(--glass-line); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: var(--shadow); }
.card--flush { padding: 0; overflow: hidden; }
.card h3 { font-size: 16px; font-weight: 650; letter-spacing: -.015em; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.card-head .i { color: var(--muted); }
.card-head small { color: var(--muted); font-size: 13px; }
.card-head > :last-child:not(:first-child):not(h3) { margin-left: auto; }
.hint { font-size: 13px; color: var(--muted); line-height: 1.5; }
.hint b { color: var(--ink-2); font-weight: 600; }

/* Listes groupées (comme Réglages sur iPhone) */
.list { border-radius: var(--r-lg); overflow: hidden; background: var(--glass); border: 1px solid var(--glass-line); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: var(--shadow); }
.list > li + li > .row, .list > .row + .row, .list > li + li { border-top: 0; }
.row {
    position: relative; display: flex; align-items: center; gap: 13px; width: 100%; min-height: 62px; padding: 11px 16px;
    border: 0; background: none; color: inherit; text-align: left; transition: background-color .18s;
}
.list > li + li .row::before, .list > .row + .row::before {
    content: ""; position: absolute; top: 0; right: 0; left: 64px; height: 1px; background: var(--sep);
}
.list--plain > li + li .row::before, .list--plain > .row + .row::before { left: 16px; }
button.row:hover, a.row:hover { background: var(--fill-2); }
button.row:active, a.row:active { background: var(--fill); }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.row-title { font-size: 15.5px; font-weight: 600; letter-spacing: -.015em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.row-sub { font-size: 13.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-sub2 { font-size: 13px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.row-end { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; flex: none; text-align: right; }
.row-end small { font-size: 12.5px; color: var(--muted); }
.row-chev { color: var(--faint); flex: none; }
.row-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.row--tall { min-height: 74px; }
.list-empty { padding: 34px 20px; text-align: center; color: var(--muted); font-size: 14px; }
.list-empty .i { width: 34px; height: 34px; margin: 0 auto 10px; color: var(--faint); stroke-width: 1.5; }
.list-empty b { display: block; color: var(--ink-2); font-size: 15px; margin-bottom: 3px; }
.group-label { padding: 18px 20px 7px; font-size: 12.5px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.group-label:first-child { padding-top: 12px; }
.alpha { position: sticky; top: calc(58px + var(--safe-t)); z-index: 2; padding: 6px 20px; font-size: 13px; font-weight: 700; color: var(--muted); background: var(--glass-strong); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border-top: 1px solid var(--sep); border-bottom: 1px solid var(--sep); }

/* Avatars */
.avatar {
    --h: 210; width: 40px; height: 40px; flex: none; border-radius: 50%; display: grid; place-items: center;
    font-size: 14.5px; font-weight: 700; color: #fff; letter-spacing: -.02em;
    background: linear-gradient(150deg, hsl(var(--h) 72% 62%), hsl(calc(var(--h) + 28) 64% 46%));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 4px 12px -6px hsl(var(--h) 70% 40%);
}
.avatar--lg { width: 84px; height: 84px; font-size: 30px; }
.avatar--sm { width: 30px; height: 30px; font-size: 11.5px; }
.ico-tile { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 12px; color: #fff; background: var(--tile, var(--accent)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 6px 16px -8px var(--tile, var(--accent)); }
.ico-tile .i { width: 20px; height: 20px; }
.ico-tile--sm { width: 30px; height: 30px; border-radius: 9px; }
.ico-tile--sm .i { width: 16px; height: 16px; }

/* Pastilles de statut */
.pill {
    --c: var(--muted); display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px;
    font-size: 12.5px; font-weight: 650; white-space: nowrap; letter-spacing: -.005em;
    color: color-mix(in srgb, var(--c) 92%, white); background: color-mix(in srgb, var(--c) 18%, transparent);
}
:root[data-theme="light"] .pill { color: color-mix(in srgb, var(--c) 80%, black); background: color-mix(in srgb, var(--c) 14%, transparent); }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c); box-shadow: 0 0 10px var(--c); }
.pill--plain::before { display: none; }
.pill--todo { --c: var(--todo); } .pill--doing { --c: var(--doing); } .pill--done { --c: var(--done); }
.pill--paid { --c: var(--paid); } .pill--pending { --c: var(--pending); } .pill--quote { --c: var(--quote); } .pill--warranty { --c: var(--warranty); }
.pill--red { --c: var(--red); } .pill--blue { --c: var(--blue); } .pill--green { --c: var(--green); } .pill--orange { --c: var(--orange); } .pill--purple { --c: var(--purple); } .pill--teal { --c: var(--teal); } .pill--gray { --c: var(--muted); }
.tag { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 8px; background: var(--fill-2); color: var(--ink-2); font-size: 12.5px; font-weight: 550; white-space: nowrap; }
.tag .i { width: 14px; height: 14px; }
.tag--warn { background: color-mix(in srgb, var(--orange) 18%, transparent); color: color-mix(in srgb, var(--orange) 85%, white); }
.tag--red { background: color-mix(in srgb, var(--red) 18%, transparent); color: color-mix(in srgb, var(--red) 85%, white); }
.tag--ok { background: color-mix(in srgb, var(--green) 16%, transparent); color: color-mix(in srgb, var(--green) 85%, white); }
.tag--blue { background: color-mix(in srgb, var(--blue) 18%, transparent); color: color-mix(in srgb, var(--blue) 70%, white); }
:root[data-theme="light"] .tag--warn { color: #A85A00; } :root[data-theme="light"] .tag--red { color: #B3261E; } :root[data-theme="light"] .tag--ok { color: #1E7B34; } :root[data-theme="light"] .tag--blue { color: #0058BA; }
.badge { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; display: inline-grid; place-items: center; background: var(--fill); color: var(--ink-2); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.badge--hot { background: var(--red); color: #fff; box-shadow: 0 4px 12px -4px var(--red); }
.badge--warn { background: var(--orange); color: #1b1100; }

/* Boutons */
.btn {
    --c: var(--accent); position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 42px; padding: 0 18px; border-radius: 14px; border: 0; white-space: nowrap;
    font-size: 15px; font-weight: 600; letter-spacing: -.01em; color: color-mix(in srgb, var(--c) 92%, white);
    background: color-mix(in srgb, var(--c) 17%, transparent);
    transition: transform var(--t-spring) var(--spring), background-color .2s, box-shadow .25s, opacity .2s;
}
:root[data-theme="light"] .btn { color: color-mix(in srgb, var(--c) 85%, black); }
.btn:hover { background: color-mix(in srgb, var(--c) 25%, transparent); }
.btn:active { transform: scale(.955); transition-duration: .12s; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.btn[aria-busy="true"] { pointer-events: none; }
.btn[aria-busy="true"]::after { content: ""; width: 15px; height: 15px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn--fill { color: var(--on-accent); background: linear-gradient(180deg, color-mix(in srgb, var(--c) 92%, white), var(--c)); box-shadow: 0 10px 24px -12px var(--c), inset 0 1px 0 rgba(255, 255, 255, .25); }
:root[data-theme="light"] .btn--fill { color: #fff; }
.btn--fill:hover { background: linear-gradient(180deg, color-mix(in srgb, var(--c) 80%, white), var(--c)); box-shadow: 0 14px 30px -12px var(--c), inset 0 1px 0 rgba(255, 255, 255, .3); }
.btn--plain { background: none; padding: 0 10px; }
.btn--plain:hover { background: var(--fill-2); }
.btn--gray { --c: var(--ink); color: var(--ink); background: var(--fill); }
.btn--gray:hover { background: color-mix(in srgb, var(--ink) 18%, transparent); }
.btn--green { --c: var(--green); } .btn--red { --c: var(--red); } .btn--orange { --c: var(--orange); } .btn--purple { --c: var(--purple); } .btn--teal { --c: var(--teal); }
.btn--sm { height: 34px; padding: 0 13px; border-radius: 11px; font-size: 14px; }
.btn--lg { height: 52px; padding: 0 24px; border-radius: 16px; font-size: 16px; }
.btn--block { width: 100%; }
.btn--pill { border-radius: 999px; }
.btn .i { width: 18px; height: 18px; stroke-width: 2.1; }
.icon-btn {
    --c: var(--ink); width: 38px; height: 38px; flex: none; display: inline-grid; place-items: center; border-radius: 50%; border: 0;
    background: var(--fill-2); color: var(--ink-2); transition: transform var(--t-spring) var(--spring), background-color .2s, color .2s;
}
.icon-btn:hover { background: var(--fill); color: var(--ink); }
.icon-btn:active { transform: scale(.88); transition-duration: .1s; }
.icon-btn--accent { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); }
.icon-btn--red:hover { background: color-mix(in srgb, var(--red) 20%, transparent); color: var(--red); }
.icon-btn--sm { width: 32px; height: 32px; }
.icon-btn--sm .i { width: 17px; height: 17px; }
.icon-btn--ghost { background: none; }
.link-btn { border: 0; background: none; padding: 0; color: var(--accent); font-weight: 550; }
.link-btn:hover { text-decoration: underline; }

/* Actions rondes (fiche contact) */
.quick { display: flex; gap: 10px; flex-wrap: wrap; }
.quick a, .quick button {
    flex: 1 1 0; min-width: 68px; max-width: 110px; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px 10px;
    border-radius: 16px; border: 0; background: var(--fill-2); color: var(--accent); font-size: 12px; font-weight: 600;
    transition: transform var(--t-spring) var(--spring), background-color .2s;
}
.quick a:hover, .quick button:hover { background: var(--fill); }
.quick a:active, .quick button:active { transform: scale(.92); }
.quick [aria-disabled="true"] { opacity: .35; pointer-events: none; }
.quick .i { width: 22px; height: 22px; }

/* Contrôle segmenté avec curseur qui glisse */
.seg {
    position: relative; display: inline-flex; padding: 3px; border-radius: 13px; background: var(--field); isolation: isolate; max-width: 100%;
    overflow-x: auto; scrollbar-width: none;
}
.seg::-webkit-scrollbar { display: none; }
.seg-thumb {
    position: absolute; z-index: -1; top: 3px; bottom: 3px; left: 0; width: 0; border-radius: 10px;
    background: var(--glass-3); box-shadow: 0 3px 10px rgba(0, 0, 0, .22), inset 0 1px 0 rgba(255, 255, 255, .12);
    transition: transform .5s var(--spring), width .45s var(--spring), background-color .3s;
}
:root[data-theme="light"] .seg-thumb { background: #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, .12), 0 0 0 .5px rgba(0, 0, 0, .04); }
.seg button {
    position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; padding: 0 15px; border: 0; border-radius: 10px;
    background: none; color: var(--ink-2); font-size: 14px; font-weight: 600; white-space: nowrap; transition: color .25s, transform .4s var(--spring);
}
.seg button[aria-pressed="true"] { color: var(--ink); }
.seg button:active { transform: scale(.95); }
.seg button .count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--fill-2); font-size: 11.5px; font-weight: 700; display: inline-grid; place-items: center; color: var(--muted); }
.seg button[aria-pressed="true"] .count { background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--accent); }
.seg--block { display: flex; width: 100%; }
.seg--block button { flex: 1; }
.seg--status button[aria-pressed="true"] { color: #fff; }
.seg--status .seg-thumb { background: linear-gradient(180deg, color-mix(in srgb, var(--thumb, var(--accent)) 88%, white), var(--thumb, var(--accent))); box-shadow: 0 6px 16px -8px var(--thumb, var(--accent)), inset 0 1px 0 rgba(255, 255, 255, .25); }
:root[data-theme="light"] .seg--status .seg-thumb { background: linear-gradient(180deg, color-mix(in srgb, var(--thumb, var(--accent)) 85%, white), var(--thumb, var(--accent))); }

/* Onglets soulignés (fiche client, demande) */
.tabs { position: relative; display: flex; gap: 4px; border-bottom: 1px solid var(--sep); margin: 0 0 18px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { position: relative; display: inline-flex; align-items: center; gap: 7px; height: 46px; padding: 0 14px; border: 0; background: none; color: var(--muted); font-size: 15px; font-weight: 600; white-space: nowrap; transition: color .2s; }
.tabs button:hover { color: var(--ink-2); }
.tabs button[aria-selected="true"] { color: var(--ink); }
.tabs .count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--fill-2); font-size: 11.5px; font-weight: 700; display: inline-grid; place-items: center; color: var(--muted); }
.tabs .count--warn { background: color-mix(in srgb, var(--orange) 22%, transparent); color: var(--orange); }
.tabs-bar { position: absolute; bottom: -1px; left: 0; height: 3px; width: 0; border-radius: 3px; background: var(--accent); box-shadow: 0 0 12px var(--accent); transition: transform .5s var(--spring), width .45s var(--spring); }
.tab-panel { animation: panel-in .45s var(--ease) both; }
@keyframes panel-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Champs */
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field > span, .label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field > span em, .req { color: var(--red); font-style: normal; }
.input, .select, .textarea {
    width: 100%; min-width: 0; height: 46px; padding: 0 14px; border-radius: 13px; border: 1px solid transparent; background: var(--field); color: var(--ink);
    font-size: 15.5px; transition: border-color .2s, background-color .2s, box-shadow .25s;
}
.textarea { height: auto; min-height: 96px; padding: 12px 14px; line-height: 1.5; resize: vertical; }
.select { appearance: none; padding-right: 38px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238E8E93' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; }
.select option { background: #1C1C1E; color: #F5F5F7; }
:root[data-theme="light"] .select option { background: #fff; color: #1C1C1E; }
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:hover, .select:hover, .textarea:hover { background: color-mix(in srgb, var(--field) 140%, transparent); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: color-mix(in srgb, var(--accent) 70%, transparent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); background: var(--glass-2); }
.input[aria-invalid="true"], .textarea[aria-invalid="true"], .select[aria-invalid="true"] { border-color: var(--red); box-shadow: 0 0 0 4px color-mix(in srgb, var(--red) 20%, transparent); animation: shake .4s var(--ease); }
@keyframes shake { 20% { transform: translateX(-6px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }
.input--lg { height: 54px; font-size: 18px; font-weight: 600; }
.input-wrap { position: relative; }
.input-wrap > .i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; width: 18px; height: 18px; }
.input-wrap .input { padding-left: 40px; }
.search {
    display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 12px; border-radius: 13px; background: var(--field); color: var(--muted); transition: box-shadow .25s, background-color .2s;
}
.search:focus-within { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 20%, transparent); background: var(--glass-2); }
.search input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; outline: none; color: var(--ink); font-size: 15.5px; }
.search input::placeholder { color: var(--muted); }
.search .i { width: 18px; height: 18px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 18px; }

/* Interrupteur iOS */
.switch { position: relative; width: 51px; height: 31px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 999px; background: var(--fill); transition: background-color .3s; }
.switch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, .25), 0 0 1px rgba(0, 0, 0, .2); transition: transform .5s var(--spring), width .2s; }
.switch input:checked + i { background: var(--green); }
.switch input:checked + i::after { transform: translateX(20px); }
.switch input:active + i::after { width: 32px; }
.switch input:checked:active + i::after { transform: translateX(15px); }
.switch input:disabled + i { opacity: .4; }
.switch input:focus-visible + i { outline: 2.5px solid var(--accent); outline-offset: 2px; }
.set-row { display: flex; align-items: center; gap: 14px; padding: 13px 16px; min-height: 58px; }
.set-row + .set-row { border-top: 1px solid var(--sep); }
.set-row .row-main b { font-size: 15px; font-weight: 600; }
.set-row .row-main small { font-size: 13px; color: var(--muted); line-height: 1.4; }
.set-row .row-main small.is-ok { color: var(--green); }

/* Case ronde */
.check { position: relative; display: flex; align-items: center; gap: 12px; cursor: pointer; }
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check i { width: 26px; height: 26px; flex: none; border-radius: 50%; border: 2px solid var(--faint); display: grid; place-items: center; transition: background-color .25s, border-color .25s, transform .5s var(--spring-bounce); }
.check i .i { width: 15px; height: 15px; stroke: #fff; stroke-width: 3; opacity: 0; transform: scale(.4); transition: opacity .2s, transform .5s var(--spring-bounce); }
.check input:checked + i { background: var(--green); border-color: var(--green); transform: scale(1.08); }
.check input:checked + i .i { opacity: 1; transform: none; }
.check input:checked ~ span { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--faint); }
.check input:focus-visible + i { outline: 2.5px solid var(--accent); outline-offset: 2px; }

/* Puces de prestations */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 13px; border-radius: 999px; border: 0;
    background: var(--fill-2); color: var(--ink); font-size: 13.5px; font-weight: 600; transition: transform .45s var(--spring), background-color .2s;
}
.chip:hover { background: var(--fill); }
.chip:active { transform: scale(.93); }
.chip b { font-weight: 600; color: var(--muted); }
.chip .i { width: 15px; height: 15px; color: var(--accent); stroke-width: 2.4; }
.chip[aria-pressed="true"] { background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--ink); }

/* Chiffres (KPI) */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi {
    --c: var(--accent); position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 4px; padding: 16px 18px 15px; text-align: left; border: 1px solid var(--glass-line);
    border-radius: var(--r-lg); background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: var(--shadow); color: inherit;
    transition: transform var(--t-spring) var(--spring), border-color .2s;
}
.kpi::before { content: ""; position: absolute; inset: -40% 40% 40% -40%; background: radial-gradient(closest-side, color-mix(in srgb, var(--c) 30%, transparent), transparent); pointer-events: none; opacity: .8; }
button.kpi:hover { border-color: color-mix(in srgb, var(--c) 40%, transparent); }
button.kpi:active { transform: scale(.97); }
.kpi-top { position: relative; display: flex; align-items: center; gap: 10px; color: var(--ink-2); font-size: 13.5px; font-weight: 600; }
.kpi-top .ico-tile { --tile: var(--c); }
.kpi-val { position: relative; font-size: 30px; font-weight: 750; letter-spacing: -.035em; line-height: 1.15; margin-top: 8px; font-variant-numeric: tabular-nums; }
.kpi-sub { position: relative; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-sub.is-alert { color: var(--orange); font-weight: 600; }
.kpi--todo { --c: var(--todo); } .kpi--doing { --c: var(--doing); } .kpi--done { --c: var(--done); } .kpi--pending { --c: var(--pending); } .kpi--purple { --c: var(--purple); } .kpi--teal { --c: var(--teal); }
.kpi-ring { position: absolute; right: 16px; bottom: 16px; width: 46px; height: 46px; }

/* Chiffres qui défilent */
.roll { display: inline-flex; overflow: hidden; vertical-align: top; line-height: 1.15; }
.roll-d { display: inline-block; height: 1.15em; overflow: hidden; }
.roll-d > span { display: flex; flex-direction: column; transition: transform .9s var(--spring); }
.roll-d > span > i { font-style: normal; height: 1.15em; display: block; text-align: center; }

/* Anneau de progression */
.ring { transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 5; }
.ring .ring-bg { stroke: var(--fill); }
.ring .ring-fg { stroke: var(--c, var(--green)); stroke-linecap: round; transition: stroke-dashoffset 1.1s var(--spring-soft); filter: drop-shadow(0 0 4px var(--c, var(--green))); }

/* Apparition (les listes sont animées en JS : core.stagger) */
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
.pop { animation: pop .6s var(--spring-bounce) both; }
@keyframes pop { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }
.flash { animation: flash 1.2s var(--ease); }
@keyframes flash { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent); } 100% { box-shadow: 0 0 0 14px transparent; } }

/* Squelette de chargement */
.skel { border-radius: 12px; background: linear-gradient(100deg, var(--fill-2) 30%, var(--fill) 50%, var(--fill-2) 70%) 0 0 / 300% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -150% 0; } }

/* =====================================================================
   Fenêtres (feuilles qui montent sur téléphone, cartes au centre sur PC)
   ===================================================================== */
dialog.sheet {
    width: min(640px, calc(100vw - 32px)); max-height: min(88dvh, 920px); padding: 0; border: 0; border-radius: 28px; overflow: visible;
    background: transparent; color: var(--ink); margin: auto;
}
dialog.sheet--lg { width: min(880px, calc(100vw - 32px)); }
dialog.sheet--sm { width: min(460px, calc(100vw - 32px)); }
dialog.sheet::backdrop { background: rgba(0, 0, 0, .42); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: bd-in .35s ease both; }
:root[data-theme="light"] dialog.sheet::backdrop { background: rgba(20, 24, 40, .25); }
dialog.sheet.is-closing::backdrop { animation: bd-out .25s ease both; }
@keyframes bd-in { from { opacity: 0; } }
@keyframes bd-out { to { opacity: 0; } }
.sheet-panel {
    position: relative; display: flex; flex-direction: column; max-height: inherit; border-radius: inherit; overflow: hidden;
    background: color-mix(in srgb, var(--bg) 62%, transparent); border: 1px solid var(--glass-line);
    -webkit-backdrop-filter: blur(40px) saturate(190%); backdrop-filter: blur(40px) saturate(190%); box-shadow: var(--shadow-pop);
}
:root[data-theme="light"] .sheet-panel { background: rgba(246, 247, 251, .9); }
dialog.sheet[open] .sheet-panel { animation: sheet-in .6s var(--spring) both; }
dialog.sheet.is-closing .sheet-panel { animation: sheet-out .26s var(--ease) both; }
@keyframes sheet-in { from { opacity: 0; transform: translateY(26px) scale(.94); } to { opacity: 1; transform: none; } }
@keyframes sheet-out { to { opacity: 0; transform: translateY(16px) scale(.96); } }
.sheet-grab { display: none; }
.sheet-head { display: flex; align-items: center; gap: 12px; padding: 18px 20px 12px 22px; }
.sheet-head h2 { font-size: 19px; font-weight: 700; letter-spacing: -.02em; }
.sheet-head p { font-size: 13.5px; color: var(--muted); margin-top: 2px; }
.sheet-head .icon-btn { margin-left: auto; }
.sheet-body { padding: 6px 22px 22px; overflow-y: auto; overscroll-behavior: contain; }
.sheet-foot { display: flex; gap: 10px; align-items: center; padding: 14px 22px calc(16px + var(--safe-b)); border-top: 1px solid var(--sep); background: color-mix(in srgb, var(--bg) 30%, transparent); }
.sheet-foot .spacer { flex: 1; }
.sheet-alert { text-align: center; padding: 26px 24px 8px; }
.sheet-alert .ico-tile { margin: 0 auto 14px; width: 54px; height: 54px; border-radius: 17px; }
.sheet-alert h2 { font-size: 19px; font-weight: 700; }
.sheet-alert p { margin-top: 8px; color: var(--ink-2); font-size: 14.5px; line-height: 1.5; }
.sheet-alert-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 20px 20px calc(18px + var(--safe-b)); }

/* Menu contextuel */
.menu {
    position: fixed; z-index: 120; min-width: 230px; padding: 6px; border-radius: 16px; background: var(--glass-strong); border: 1px solid var(--glass-line);
    -webkit-backdrop-filter: blur(40px) saturate(190%); backdrop-filter: blur(40px) saturate(190%); box-shadow: var(--shadow-pop);
    transform-origin: var(--ox, top right); animation: menu-in .42s var(--spring) both;
}
.menu.is-closing { animation: menu-out .16s ease both; }
@keyframes menu-in { from { opacity: 0; transform: scale(.7); } to { opacity: 1; transform: none; } }
@keyframes menu-out { to { opacity: 0; transform: scale(.9); } }
.menu button, .menu a { display: flex; align-items: center; gap: 12px; width: 100%; height: 42px; padding: 0 12px; border: 0; border-radius: 10px; background: none; color: var(--ink); font-size: 15px; font-weight: 500; text-align: left; }
.menu button:hover, .menu a:hover { background: var(--fill-2); }
.menu .is-danger { color: var(--red); }
.menu hr { border: 0; height: 1px; background: var(--sep); margin: 5px 6px; }

/* Message en haut, façon « île dynamique » */
.island { position: fixed; z-index: 200; top: calc(12px + var(--safe-t)); left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; width: min(520px, calc(100vw - 24px)); }
.toast {
    pointer-events: auto; display: flex; align-items: center; gap: 12px; min-height: 48px; max-width: 100%; padding: 10px 18px 10px 12px; border-radius: 999px;
    background: rgba(12, 12, 14, .94); color: #F5F5F7; box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .07);
    font-size: 14.5px; font-weight: 550; line-height: 1.35; animation: island-in .7s var(--spring) both; transform-origin: top center;
}
.toast .ico-tile { width: 30px; height: 30px; border-radius: 50%; }
.toast .ico-tile .i { width: 16px; height: 16px; stroke-width: 2.6; }
.toast--error .ico-tile { --tile: var(--red); }
.toast--ok .ico-tile { --tile: var(--green); }
.toast.is-leaving { animation: island-out .35s var(--ease) both; }
@keyframes island-in { 0% { opacity: 0; transform: scale(.4, .5) translateY(-20px); border-radius: 999px; } 60% { opacity: 1; } 100% { transform: none; } }
@keyframes island-out { to { opacity: 0; transform: scale(.6, .5) translateY(-16px); } }

/* Confettis */
.confetti { position: fixed; inset: 0; z-index: 300; pointer-events: none; }

/* =====================================================================
   Écran de connexion
   ===================================================================== */
.lock { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.lock-card { width: min(420px, 100%); padding: 30px 28px 26px; border-radius: 32px; text-align: center; animation: sheet-in .8s var(--spring) both; }
.lock-logo { width: 74px; height: 74px; margin: 0 auto 16px; border-radius: 22px; font-size: 30px; }
.lock-card h1 { font-size: 26px; font-weight: 750; letter-spacing: -.03em; }
.lock-card > p { margin: 6px 0 22px; color: var(--muted); font-size: 14.5px; }
.lock-card form { display: flex; flex-direction: column; gap: 12px; text-align: left; }
.lock-card .btn { margin-top: 6px; }
.lock-err { min-height: 20px; color: var(--red); font-size: 13.5px; font-weight: 550; text-align: center; }
.lock-links { display: flex; justify-content: center; gap: 18px; margin-top: 4px; }
.code-input { height: 60px; text-align: center; font-size: 28px; font-weight: 700; letter-spacing: .3em; font-variant-numeric: tabular-nums; }

/* =====================================================================
   Pages
   ===================================================================== */
/* Accueil */
.today { display: grid; gap: 12px; }
.slot {
    --c: var(--blue); position: relative; display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 16px 14px 14px;
    border-radius: 20px; background: var(--glass); border: 1px solid var(--glass-line); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: var(--shadow); text-align: left; color: inherit;
    transition: transform var(--t-spring) var(--spring), border-color .2s;
}
.slot::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 4px; border-radius: 0 4px 4px 0; background: var(--c); box-shadow: 0 0 14px var(--c); }
.slot--domicile { --c: var(--blue); } .slot--atelier { --c: var(--purple); } .slot--distance { --c: var(--teal); } .slot--done { --c: var(--green); } .slot--none { --c: var(--muted); }
.slot-time { text-align: center; }
.slot-time b { display: block; font-size: 19px; font-weight: 750; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.slot-time small { display: block; font-size: 11.5px; color: var(--muted); line-height: 1.25; }
.slot-actions { display: flex; gap: 8px; }
.slot.is-now { border-color: color-mix(in srgb, var(--c) 50%, transparent); }
.slot.is-now .slot-time b { color: var(--c); }
.task-ico { --tile: var(--accent); }
.task--late { --tile: var(--red); } .task--money { --tile: var(--orange); } .task--part { --tile: var(--teal); } .task--quote { --tile: var(--purple); } .task--run { --tile: var(--green); } .task--new { --tile: var(--blue); }

/* Fiche client */
.profile { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 22px; align-items: center; }
.profile h1 { font-size: clamp(26px, 3vw, 34px); font-weight: 750; letter-spacing: -.035em; line-height: 1.1; }
.profile-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; color: var(--muted); font-size: 14px; }
.profile-meta span { display: inline-flex; align-items: center; gap: 6px; }
.profile-meta .i { width: 15px; height: 15px; }
.stats-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 20px; }
.mini { padding: 12px 14px; border-radius: 18px; background: var(--fill-2); }
.mini small { display: block; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.mini b { display: block; font-size: 20px; font-weight: 750; letter-spacing: -.03em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kv { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 10px 16px; font-size: 14.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.message { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; line-height: 1.6; color: var(--ink); }
.danger-zone { margin-top: 40px; padding: 18px 20px; border-radius: 20px; border: 1px solid color-mix(in srgb, var(--red) 30%, transparent); background: color-mix(in srgb, var(--red) 6%, transparent); display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.danger-zone .row-main b { color: var(--red); }

/* Demande */
.ticket-hero { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.ticket-hero h1 { font-size: clamp(26px, 3vw, 34px); font-weight: 750; letter-spacing: -.035em; line-height: 1.1; }
.ticket-hero h1 a { color: inherit; }
.ticket-hero h1 a:hover { color: var(--accent); }
.ticket-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.overview { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.ov { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: 18px; border: 0; background: var(--fill-2); color: inherit; text-align: left; transition: transform .5s var(--spring), background-color .2s; }
.ov:hover { background: var(--fill); }
.ov:active { transform: scale(.97); }
.ov small { display: block; font-size: 12px; color: var(--muted); font-weight: 600; }
.ov b { display: block; font-size: 15px; font-weight: 650; }
.ov span.sub { display: block; font-size: 12.5px; color: var(--muted); }
.ov.is-warn .ico-tile { --tile: var(--orange); }
.part-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 12px 16px; }
.part-row + .part-row { border-top: 1px solid var(--sep); }
.part-steps { display: inline-flex; padding: 3px; gap: 2px; border-radius: 11px; background: var(--field); }
.part-steps button { height: 28px; padding: 0 10px; border: 0; border-radius: 8px; background: none; color: var(--muted); font-size: 12.5px; font-weight: 650; transition: background-color .25s, color .25s, transform .4s var(--spring); }
.part-steps button:active { transform: scale(.92); }
.part-steps button[aria-pressed="true"][data-v="Commandé"] { background: color-mix(in srgb, var(--orange) 24%, transparent); color: var(--orange); }
.part-steps button[aria-pressed="true"][data-v="Expédié"] { background: color-mix(in srgb, var(--blue) 24%, transparent); color: var(--blue); }
.part-steps button[aria-pressed="true"][data-v="Reçu"] { background: color-mix(in srgb, var(--green) 24%, transparent); color: var(--green); }

/* Photos */
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; }
.photo { position: relative; aspect-ratio: 1; border-radius: 16px; overflow: hidden; background: var(--fill-2); }
.photo button { display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none; }
.photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--spring); }
.photo:hover img { transform: scale(1.05); }
.photo .tag { position: absolute; left: 8px; bottom: 8px; background: rgba(0, 0, 0, .55); color: #fff; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); height: 22px; font-size: 11.5px; }
.photo.is-up img { opacity: .5; filter: blur(1px); }
.photo-prog { position: absolute; left: 10px; right: 10px; bottom: 10px; height: 5px; border-radius: 5px; background: rgba(255, 255, 255, .25); overflow: hidden; }
.photo-prog i { display: block; height: 100%; width: calc(var(--p, 0) * 100%); background: #fff; transition: width .3s; }
.drop { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 18px; border: 1.5px dashed var(--faint); color: var(--muted); transition: border-color .2s, background-color .2s; }
.drop.is-over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.viewer { position: fixed; inset: 0; z-index: 150; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; background: rgba(0, 0, 0, .94); color: #fff; animation: fade-in .3s ease both; }
.viewer-top, .viewer-bottom { display: flex; align-items: center; gap: 10px; padding: calc(12px + var(--safe-t)) 16px 12px; }
.viewer-bottom { padding: 12px 16px calc(14px + var(--safe-b)); flex-wrap: wrap; justify-content: center; }
.viewer-stage { position: relative; display: grid; place-items: center; overflow: hidden; touch-action: pan-y; }
.viewer-stage img { max-width: 100%; max-height: 100%; object-fit: contain; animation: pop .5s var(--spring-soft) both; }
.viewer .icon-btn { background: rgba(255, 255, 255, .14); color: #fff; }
.viewer .seg { background: rgba(255, 255, 255, .14); }
.viewer .seg button { color: rgba(255, 255, 255, .7); }
.viewer .seg button[aria-pressed="true"] { color: #fff; }
.viewer-nav { position: absolute; top: 50%; transform: translateY(-50%); }
.viewer-nav--prev { left: 14px; } .viewer-nav--next { right: 14px; }

/* Agenda */
.week { --h: 54px; position: relative; display: grid; grid-template-columns: 56px repeat(var(--days, 6), minmax(118px, 1fr)); min-width: calc(56px + var(--days, 6) * 118px); }
.week-scroll { overflow: auto; max-height: calc(100dvh - 250px); border-radius: var(--r-lg); background: var(--glass); border: 1px solid var(--glass-line); box-shadow: var(--shadow); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
.week-corner, .week-dh { position: sticky; top: 0; z-index: 3; height: 62px; background: var(--glass-strong); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border-bottom: 1px solid var(--sep); }
.week-corner { left: 0; z-index: 4; }
.week-dh { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; }
.week-dh small { font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.week-dh b { font-size: 21px; font-weight: 700; letter-spacing: -.03em; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; }
.week-dh.is-today b { background: var(--red); color: #fff; box-shadow: 0 6px 16px -6px var(--red); }
.week-gutter { position: sticky; left: 0; z-index: 2; height: calc(var(--rows) * var(--h)); background: var(--glass-strong); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
.week-gutter span { position: absolute; right: 8px; transform: translateY(-50%); font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.week-gutter span:first-child { transform: none; }
.week-col { position: relative; height: calc(var(--rows) * var(--h)); border-left: 1px solid var(--sep); background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--h) - 1px), var(--sep) calc(var(--h) - 1px), var(--sep) var(--h)); }
.week-col.is-today { background-color: color-mix(in srgb, var(--accent) 5%, transparent); }
.week-col::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: var(--past, 0); background: rgba(0, 0, 0, .14); pointer-events: none; }
:root[data-theme="light"] .week-col::before { background: rgba(0, 0, 0, .035); }
.week-col.is-target { background-color: color-mix(in srgb, var(--accent) 10%, transparent); }
.ev {
    --c: var(--blue); position: absolute; z-index: 1; overflow: hidden; padding: 5px 8px; border-radius: 10px; cursor: grab; user-select: none; touch-action: none;
    background: color-mix(in srgb, var(--c) 26%, var(--glass-2)); border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); color: var(--ink);
    box-shadow: 0 6px 16px -10px var(--c); transition: transform .4s var(--spring), box-shadow .2s;
}
.ev::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--c); }
.ev b { display: block; font-size: 13px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev small { display: block; font-size: 11.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev .t { font-size: 11px; font-weight: 700; color: color-mix(in srgb, var(--c) 80%, white); font-variant-numeric: tabular-nums; }
:root[data-theme="light"] .ev .t { color: color-mix(in srgb, var(--c) 75%, black); }
.ev:hover { transform: translateY(-1px); box-shadow: 0 10px 22px -10px var(--c); }
.ev.is-moving { opacity: .35; }
.ev.is-done { opacity: .6; cursor: pointer; }
.ev--domicile { --c: var(--blue); } .ev--atelier { --c: var(--purple); } .ev--distance { --c: var(--teal); } .ev--done { --c: var(--green); } .ev--none { --c: var(--orange); }
.ev-rs { position: absolute; left: 0; right: 0; bottom: 0; height: 9px; cursor: ns-resize; }
.ev-rs::after { content: ""; position: absolute; left: 50%; bottom: 3px; width: 22px; height: 3px; margin-left: -11px; border-radius: 3px; background: color-mix(in srgb, var(--c) 70%, white); opacity: 0; transition: opacity .2s; }
.ev:hover .ev-rs::after { opacity: .8; }
.now-line { position: absolute; left: -4px; right: 0; height: 2px; background: var(--red); z-index: 2; pointer-events: none; }
.now-line::before { content: ""; position: absolute; left: -4px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--red); }
.preview-slot { position: absolute; left: 3px; right: 3px; z-index: 2; border-radius: 10px; border: 2px dashed var(--accent); background: color-mix(in srgb, var(--accent) 18%, transparent); pointer-events: none; }
.preview-slot span { display: block; padding: 3px 7px; font-size: 11.5px; font-weight: 700; color: var(--ink); }
.hover-slot { position: absolute; left: 3px; right: 3px; height: calc(var(--h) / 2); border-radius: 8px; background: var(--fill-2); color: var(--muted); font-size: 11.5px; font-weight: 650; padding: 2px 8px; pointer-events: none; opacity: 0; transition: opacity .15s; }
.hover-slot.is-on { opacity: 1; }
.drag-ghost { position: fixed; left: 0; top: 0; z-index: 160; padding: 8px 14px; border-radius: 12px; background: var(--accent); color: #fff; font-size: 13.5px; font-weight: 650; pointer-events: none; box-shadow: 0 16px 30px -10px rgba(0, 0, 0, .6); }
body.is-dragging, body.is-dragging * { cursor: grabbing !important; user-select: none; }
.tray-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--fill-2); cursor: grab; touch-action: none; user-select: none; transition: transform .4s var(--spring), background-color .2s; }
.tray-item:hover { background: var(--fill); }
.tray-item:active { transform: scale(.97); }
.tray-item.is-late { box-shadow: inset 3px 0 0 var(--orange); }
.tray-item b { display: block; font-size: 14px; }
.tray-item small { display: block; font-size: 12.5px; color: var(--muted); }
.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.month-dow { text-align: center; font-size: 12px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding-bottom: 4px; }
.day-cell {
    position: relative; min-height: 92px; display: flex; flex-direction: column; gap: 4px; padding: 8px; border-radius: 16px; border: 1px solid transparent; background: var(--fill-2);
    color: inherit; text-align: left; transition: transform .45s var(--spring), background-color .2s, border-color .2s;
}
.day-cell:hover { background: var(--fill); }
.day-cell:active { transform: scale(.96); }
.day-cell.is-out { opacity: .38; }
.day-cell.is-sel { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.day-cell .d { font-size: 14px; font-weight: 700; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; }
.day-cell.is-today .d { background: var(--red); color: #fff; }
.day-cell .ev-mini { font-size: 11.5px; font-weight: 600; padding: 2px 6px; border-radius: 6px; background: color-mix(in srgb, var(--c, var(--blue)) 24%, transparent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.day-cell .more { font-size: 11px; color: var(--muted); font-weight: 650; }
.slot-pop { position: fixed; z-index: 130; width: 320px; padding: 14px; border-radius: 20px; background: var(--glass-strong); border: 1px solid var(--glass-line); -webkit-backdrop-filter: blur(40px) saturate(190%); backdrop-filter: blur(40px) saturate(190%); box-shadow: var(--shadow-pop); animation: menu-in .45s var(--spring) both; }
.slot-pop h4 { font-size: 16px; font-weight: 700; }
.slot-pop p { font-size: 13px; color: var(--muted); margin: 3px 0 10px; }
.slot-pop ul { display: flex; flex-direction: column; gap: 4px; max-height: 260px; overflow: auto; margin-bottom: 10px; }
.slot-pop li button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border: 0; border-radius: 12px; background: none; color: inherit; text-align: left; }
.slot-pop li button:hover { background: var(--fill-2); }
.slot-pop li b { display: block; font-size: 14px; }
.slot-pop li small { display: block; font-size: 12px; color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12.5px; color: var(--muted); }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; background: var(--c); vertical-align: -1px; }

/* Argent */
.bars { display: flex; align-items: flex-end; gap: 10px; height: 190px; padding-top: 14px; }
.bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; min-width: 0; }
.bar-track { position: relative; flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.bar-fill { width: min(46px, 70%); border-radius: 10px 10px 6px 6px; background: linear-gradient(180deg, var(--c, var(--green)), color-mix(in srgb, var(--c, var(--green)) 45%, transparent)); box-shadow: 0 10px 24px -14px var(--c, var(--green)); transform-origin: bottom; animation: grow .9s var(--spring-soft) both; animation-delay: calc(var(--i, 0) * 50ms); height: var(--hgt); min-height: 3px; }
.bar.is-now .bar-fill { --c: var(--accent); }
.bar-val { position: absolute; bottom: calc(var(--hgt) + 6px); font-size: 11.5px; font-weight: 700; color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; animation: fade-in .6s ease both; animation-delay: calc(var(--i, 0) * 50ms + .3s); }
.bar small { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: capitalize; }
@keyframes grow { from { transform: scaleY(0); } to { transform: none; } }
.money-row .row-end b { font-size: 15.5px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.month-head { display: flex; justify-content: space-between; align-items: baseline; padding: 16px 18px 8px; font-weight: 700; text-transform: capitalize; }
.month-head small { color: var(--muted); font-weight: 600; font-size: 13px; text-transform: none; }
.amount-big { font-size: clamp(34px, 4vw, 46px); font-weight: 800; letter-spacing: -.045em; font-variant-numeric: tabular-nums; line-height: 1.05; }
.lines-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.lines-table th { text-align: left; font-size: 12.5px; color: var(--muted); font-weight: 650; padding: 0 0 8px; }
.lines-table td { padding: 9px 0; border-top: 1px solid var(--sep); vertical-align: top; }
.lines-table .n { text-align: right; white-space: nowrap; padding-left: 14px; font-variant-numeric: tabular-nums; }
.lines-table tfoot td { font-weight: 750; font-size: 16px; }
.bar-split { display: flex; height: 12px; border-radius: 12px; overflow: hidden; background: var(--fill-2); }
.bar-split span { height: 100%; transition: width 1s var(--spring-soft); }

/* Formulaire de fiche */
.lines-edit { display: flex; flex-direction: column; gap: 10px; }
.line-edit { display: grid; grid-template-columns: minmax(0, 1fr) 96px 112px 92px 38px; gap: 8px; align-items: center; padding: 10px; border-radius: 16px; background: var(--fill-2); animation: rise .45s var(--spring-soft) both; }
.line-edit .input { height: 42px; font-size: 14.5px; }
.line-edit .unit { position: relative; }
.line-edit .unit i { position: absolute; right: 11px; top: 50%; transform: translateY(-50%); font-style: normal; color: var(--muted); font-size: 13px; pointer-events: none; }
.line-edit .unit .input { padding-right: 28px; text-align: right; }
.line-edit output { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.line-extra { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); }
.line-extra .form-grid { width: 100%; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.line-extra .input { height: 38px; }
.total-bar {
    position: sticky; bottom: calc(14px + var(--tab-h) + var(--safe-b)); z-index: 15; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 22px; padding: 12px 14px 12px 20px;
    border-radius: 22px; background: var(--glass-strong); border: 1px solid var(--glass-line); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: var(--shadow-pop);
}
.total-bar .amount { font-size: 26px; font-weight: 800; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.total-bar small { display: block; font-size: 12px; color: var(--muted); }
.sig-box { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px; background: var(--fill-2); }
.sig-box img { height: 48px; max-width: 160px; object-fit: contain; background: #fff; border-radius: 8px; padding: 4px; }
.sign-pad { position: relative; width: 100%; height: 240px; border-radius: 18px; background: #fff; touch-action: none; cursor: crosshair; }
.sign-pad canvas { width: 100%; height: 100%; display: block; border-radius: inherit; }
.sign-pad .sign-line { position: absolute; left: 24px; right: 24px; bottom: 54px; border-bottom: 1.5px dashed #C7C7CC; pointer-events: none; }
.sign-pad .sign-hint { position: absolute; left: 0; right: 0; bottom: 22px; text-align: center; color: #8E8E93; font-size: 13px; pointer-events: none; }

/* Outils */
.apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.app-tile {
    position: relative; display: flex; flex-direction: column; gap: 14px; padding: 18px; min-height: 150px; border-radius: var(--r-lg); border: 1px solid var(--glass-line);
    background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: var(--shadow); color: inherit; text-align: left;
    transition: transform var(--t-spring) var(--spring), border-color .2s;
}
.app-tile:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--tile, var(--accent)) 45%, transparent); }
.app-tile:active { transform: scale(.97); }
.app-tile .ico-tile { width: 52px; height: 52px; border-radius: 15px; }
.app-tile .ico-tile .i { width: 26px; height: 26px; }
.app-tile b { font-size: 16.5px; font-weight: 700; letter-spacing: -.02em; }
.app-tile small { display: block; font-size: 13px; color: var(--muted); line-height: 1.45; margin-top: 3px; }
.app-tile .badge { position: absolute; top: 16px; right: 16px; }
.article-card { display: flex; flex-direction: column; gap: 8px; padding: 16px; border-radius: 20px; border: 1px solid var(--glass-line); background: var(--glass); color: inherit; text-align: left; min-height: 150px; transition: transform .5s var(--spring), border-color .2s; }
.article-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.article-card b { font-size: 15.5px; font-weight: 650; }
.article-card p { font-size: 13px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line; }
.procedure { white-space: pre-wrap; font-size: 14.5px; line-height: 1.65; padding: 16px; border-radius: 16px; background: var(--fill-2); overflow-wrap: anywhere; }
.stars { color: var(--yellow); letter-spacing: 2px; }

/* Intervention en cours */
.run-wrap { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 24px; align-items: start; }
.run-clock { position: relative; width: 240px; height: 240px; margin: 0 auto; }
.run-clock svg { width: 100%; height: 100%; }
.run-clock .ring circle { stroke-width: 10; }
.run-clock-text { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.run-clock-text b { font-size: 40px; font-weight: 750; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.run-clock-text small { font-size: 13px; color: var(--muted); font-weight: 600; }
.run-steps { display: flex; flex-direction: column; }
.run-steps li { padding: 12px 4px; }
.run-steps li + li { border-top: 1px solid var(--sep); }
.run-pill {
    position: fixed; z-index: 90; left: 50%; bottom: calc(20px + var(--tab-h) + var(--safe-b)); transform: translateX(-50%);
    display: flex; align-items: center; gap: 12px; height: 52px; padding: 0 20px 0 8px; border-radius: 999px; border: 0;
    background: rgba(12, 12, 14, .94); color: #fff; box-shadow: 0 20px 40px -14px rgba(0, 0, 0, .7), 0 0 0 1px rgba(255, 255, 255, .08);
    font-size: 14.5px; font-weight: 600; animation: island-in .7s var(--spring) both;
}
.run-pill .ico-tile { --tile: var(--green); width: 36px; height: 36px; border-radius: 50%; }
.run-pill.is-paused .ico-tile { --tile: var(--orange); }
.run-pill b { font-variant-numeric: tabular-nums; font-weight: 700; }
.run-pill .pulse { animation: breathe 1.6s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.12); } }

/* Recherche rapide */
.palette .sheet-panel { max-height: min(70dvh, 620px); }
.palette .search { height: 52px; border-radius: 0; background: none; border-bottom: 1px solid var(--sep); padding: 0 20px; }
.palette .search input { font-size: 17px; }
.palette-list { overflow-y: auto; padding: 6px; }
.palette-group { padding: 10px 12px 4px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.palette-item { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 12px; cursor: pointer; }
.palette-item[aria-selected="true"] { background: color-mix(in srgb, var(--accent) 20%, transparent); }
.palette-item b { display: block; font-size: 15px; font-weight: 600; }
.palette-item small { display: block; font-size: 12.5px; color: var(--muted); }

/* Diagnostic clé USB */
.dg-list li { padding: 12px 16px; border-top: 1px solid var(--sep); }
.dg-list li:first-child { border-top: 0; }
.dg-list details summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; gap: 10px; align-items: baseline; }
.dg-list details summary::-webkit-details-marker { display: none; }
.dg-list details p { margin-top: 6px; font-size: 13.5px; color: var(--ink-2); }
.dg-crit { --c: var(--red); } .dg-warn { --c: var(--orange); } .dg-info { --c: var(--blue); } .dg-ok { --c: var(--green); }
.hw-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.hw-table th { text-align: left; color: var(--muted); font-weight: 600; padding: 8px 12px 8px 0; vertical-align: top; width: 150px; }
.hw-table td { padding: 8px 0; border-top: 1px solid var(--sep); }
.hw-table tr:first-child td, .hw-table tr:first-child th { border-top: 0; }
.hw-table th { border-top: 1px solid var(--sep); }

/* Tournée */
.map { height: 420px; border-radius: 20px; overflow: hidden; background: var(--fill-2); }
.route-stop { display: grid; grid-template-columns: 54px minmax(0, 1fr); gap: 10px; padding: 10px 0; border-top: 1px solid var(--sep); }
.route-stop:first-child { border-top: 0; }
.route-n { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; margin-right: 6px; }
.rt-pin { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #0A84FF; color: #fff; font: 700 13px var(--font); border: 2px solid #fff; box-shadow: 0 4px 10px rgba(0, 0, 0, .4); }
.rt-pin.is-home { background: #30D158; }

/* Comparateur de prix (prix.js) : variables attendues */
#view-prix {
    --muted: var(--muted); --surface: var(--glass-2); --surface-2: var(--fill-2); --surface-3: var(--fill); --line: var(--sep); --line-strong: var(--faint);
    --card-shadow: var(--shadow); --field-bg: var(--field); --field-line: transparent; --hover-bg: var(--fill-2); --glass-line: var(--glass-line);
    --ok: var(--green); --ok-soft: color-mix(in srgb, var(--green) 18%, transparent); --danger: var(--red); --danger-soft: color-mix(in srgb, var(--red) 18%, transparent);
    --warn: var(--orange); --warn-soft: color-mix(in srgb, var(--orange) 18%, transparent);
    --px-a: var(--blue) !important; --px-a-text: color-mix(in srgb, var(--blue) 70%, white) !important; --px-a-soft: color-mix(in srgb, var(--blue) 20%, transparent) !important;
    --px-orange: linear-gradient(160deg, #3D9BFF, #0A6AE0) !important;
}
#view-prix .toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 16px; }
#view-prix .toolbar-meta { font-size: 13px; color: var(--muted); }
#view-prix .segmented { display: inline-flex; padding: 3px; border-radius: 13px; background: var(--field); }
#view-prix .segmented button { height: 34px; padding: 0 15px; border: 0; border-radius: 10px; background: none; color: var(--ink-2); font-weight: 600; font-size: 14px; }
#view-prix .segmented button[aria-pressed="true"] { background: var(--glass-3); color: var(--ink); box-shadow: 0 3px 10px rgba(0, 0, 0, .2); }
#view-prix .segmented .count { margin-left: 6px; font-size: 12px; color: var(--muted); }
#view-prix .btn--primary { --c: var(--accent); color: #fff; background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 90%, white), var(--accent)); }
#view-prix .btn--glass { --c: var(--ink); color: var(--ink); background: var(--fill); }
#view-prix .btn--danger, #view-prix .btn--ghost-danger { --c: var(--red); }
#view-prix .input { height: 44px; }

/* =====================================================================
   Assistant (assistant.js) : accordé au verre
   ===================================================================== */
.ka-fab { --ka-a: var(--accent) !important; }

/* =====================================================================
   Tablette et téléphone
   ===================================================================== */
@media (max-width: 1180px) {
    :root { --side-w: 236px; }
    .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cols { grid-template-columns: minmax(0, 1fr) !important; }
    .run-wrap { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
    :root { --tab-h: 64px; }
    .shell { grid-template-columns: minmax(0, 1fr); }
    .side { display: none; }
    .tabbar {
        display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; z-index: 40; left: 12px; right: 12px; bottom: calc(10px + var(--safe-b));
        height: var(--tab-h); padding: 6px; border-radius: 26px; background: var(--glass-strong); border: 1px solid var(--glass-line);
        -webkit-backdrop-filter: blur(30px) saturate(190%); backdrop-filter: blur(30px) saturate(190%); box-shadow: var(--shadow-pop);
    }
    .tabbar a { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border-radius: 20px; color: var(--muted); font-size: 10.5px; font-weight: 650; transition: color .25s, transform .45s var(--spring); }
    .tabbar a:active { transform: scale(.9); }
    .tabbar a[aria-current="page"] { color: var(--accent); }
    .tabbar .i { width: 23px; height: 23px; }
    .tabbar .badge { position: absolute; top: 4px; left: calc(50% + 6px); min-width: 18px; height: 18px; font-size: 10.5px; padding: 0 5px; }
    .tab-glider { position: absolute; z-index: 0; top: 6px; bottom: 6px; left: 0; width: 0; border-radius: 20px; background: color-mix(in srgb, var(--accent) 16%, transparent); transition: transform .55s var(--spring), width .45s var(--spring); }
    .page { padding-left: 16px; padding-right: 16px; }
    .navbar { margin: 0 -16px; padding-left: 16px; padding-right: 16px; height: calc(52px + var(--safe-t)); }
    .alpha { top: calc(52px + var(--safe-t)); }
    .hero h1 { font-size: 32px; }
    .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stats-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .overview { grid-template-columns: minmax(0, 1fr); }
    .week-scroll { max-height: calc(100dvh - 300px); }
    dialog.sheet { width: 100vw; max-width: 100vw; max-height: 94dvh; margin: auto 0 0; border-radius: 28px 28px 0 0; }
    dialog.sheet .sheet-panel { border-bottom: 0; }
    dialog.sheet[open] .sheet-panel { animation: sheet-up .55s var(--spring-soft) both; }
    dialog.sheet.is-closing .sheet-panel { animation: sheet-down .28s var(--ease) both; }
    .sheet-grab { display: block; width: 40px; height: 5px; margin: 8px auto 0; border-radius: 5px; background: var(--faint); flex: none; }
    .sheet-head { padding-top: 10px; }
    .line-edit { grid-template-columns: minmax(0, 1fr) 84px 100px 34px; }
    .line-edit output { grid-column: 1 / 4; text-align: left; font-size: 13px; color: var(--muted); }
    .line-edit .line-del { grid-row: 1; grid-column: 4; }
    .line-extra .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes sheet-down { to { transform: translateY(100%); } }
@media (max-width: 640px) {
    body { font-size: 15px; }
    .kpis { gap: 10px; }
    .kpi { padding: 14px 14px 13px; }
    .kpi-val { font-size: 25px; }
    .form-grid { grid-template-columns: minmax(0, 1fr); }
    .grid-2 { grid-template-columns: minmax(0, 1fr); }
    .slot { grid-template-columns: 56px minmax(0, 1fr); }
    .slot-actions { grid-column: 1 / -1; justify-content: flex-end; }
    .profile { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; }
    .profile-meta { justify-content: center; }
    .kv { grid-template-columns: minmax(0, 1fr); gap: 2px; }
    .kv dd { margin-bottom: 10px; }
    .part-row { grid-template-columns: minmax(0, 1fr) auto; }
    .part-row .part-steps { grid-column: 1 / -1; justify-self: start; }
    .month { gap: 4px; }
    .day-cell { min-height: 58px; padding: 6px 4px; align-items: center; }
    .day-cell .ev-mini { display: none; }
    .day-cell .dots { display: flex; gap: 3px; }
    .hero-row .hero-actions { margin-left: 0; width: 100%; }
    .kpi-ring { display: none; }
    .kpi-top { font-size: 12.5px; }
    .apps { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .app-tile { min-height: 130px; padding: 14px; }
    .run-clock { width: 200px; height: 200px; }
    .menu { left: 10px !important; right: 10px !important; bottom: calc(10px + var(--safe-b)) !important; top: auto !important; transform-origin: bottom center; }
    .total-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; padding: 10px 10px 10px 16px; border-radius: 20px; }
    .total-bar .spacer, .total-bar #ff-total-sub { display: none; }
    .total-bar .amount { font-size: 21px; }
    .total-bar .btn { height: 44px; padding: 0 14px; font-size: 14.5px; border-radius: 13px; }
    .total-bar .long { display: none; }
    .quick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .quick a, .quick button { max-width: none; }
}
.total-bar .short { display: none; }
@media (max-width: 640px) { .total-bar .short { display: inline; } }
.dots { display: none; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--c, var(--blue)); }

/* =====================================================================
   Moins d'animations (réglage du système)
   ===================================================================== */
/* ---------- Déclaration URSSAF ---------- */
.ur-strip .row-end { flex-direction: row; align-items: center; gap: 10px; }
.ur-strip .row-end .i { color: var(--faint); width: 16px; height: 16px; }
.ur-main { margin-top: 6px; position: relative; overflow: hidden; }
.ur-main::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--c); opacity: .9; }
.ur-title { font-size: clamp(24px, 2.8vw, 32px); font-weight: 750; letter-spacing: -.03em; margin-top: 4px; }
.ur-amount { text-align: right; }
.ur-state { margin-top: 16px; font-weight: 600; color: var(--ink-2); }
.ur-warn { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, var(--orange) 14%, transparent); color: var(--ink-2); font-size: 14px; }
.ur-warn .i { color: var(--orange); flex: none; margin-top: 1px; }
.ur-cotis { display: flex; gap: 10px; align-items: flex-start; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--sep); }
.ur-cotis .i { flex: none; width: 17px; height: 17px; margin-top: 1px; }
.ur-day { flex: none; width: 46px; font-size: 13px; font-weight: 650; color: var(--muted); font-variant-numeric: tabular-nums; }
#ur-periods .row.is-current { background: color-mix(in srgb, var(--accent) 12%, transparent); }
#ur-periods .row-end { gap: 10px; }
@media (max-width: 640px) {
    .ur-amount { text-align: left; }
    .ur-strip .row-end .pill { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
    .live-dot { animation: none; }
}

/* Impression : seulement la page en cours */
@media print {
    .side, .tabbar, .navbar, .ka-fab, .ka-panel, .run-pill, .island { display: none !important; }
    body::before { display: none; }
    .shell { display: block; }
}
