/* Pointage Pro — feuille de style unique (web et logiciel Windows) */

:root {
    --bg: #f3f5f9;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --surface-3: #eef2f7;
    --border: #e2e8f0;
    --border-strong: #cbd5e1;
    --text: #0f172a;
    --text-2: #475569;
    --text-3: #8492a6;
    --primary: #0d6efd;
    --primary-hover: #0056b3;
    --primary-soft: #e7f0ff;
    --primary-text: #0a58ca;
    --accent: #ffc107;
    --pattern: rgba(13, 110, 253, .075);
    --success: #04875f;
    --success-strong: #059669;
    --success-soft: #e3f6ee;
    --danger: #c92a2a;
    --danger-strong: #dc2626;
    --danger-soft: #fdeceb;
    --warning: #b45309;
    --warning-soft: #fff3dc;
    --info-soft: #e8f4fd;
    --info: #0b6aa2;
    --sidebar: #0b1424;
    --sidebar-2: #111c31;
    --sidebar-line: #1c2840;
    --sidebar-text: #c8d2e2;
    --sidebar-muted: #6b7a93;
    --sidebar-active: #1a2742;
    --radius: 14px;
    --radius-sm: 9px;
    --radius-xs: 6px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
    --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 6px 20px -10px rgba(15, 23, 42, .14);
    --shadow-lg: 0 30px 60px -20px rgba(15, 23, 42, .35);
    --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    --font-display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    --focus: 0 0 0 3px rgba(13, 110, 253, .28);
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #0b1120;
        --surface: #121a2b;
        --surface-2: #162036;
        --surface-3: #1b2740;
        --border: #233149;
        --border-strong: #2f3f5c;
        --text: #e6ebf3;
        --text-2: #a5b1c4;
        --text-3: #6f7d94;
        --primary: #5b86ff;
        --primary-hover: #7598ff;
        --primary-soft: #1a2850;
        --primary-text: #a9c0ff;
        --success: #34c38f;
        --success-strong: #22a776;
        --success-soft: #11322a;
        --danger: #f26b6b;
        --danger-strong: #e04848;
        --danger-soft: #3a1b1f;
        --warning: #f0a944;
        --warning-soft: #36280f;
        --info-soft: #102a3d;
        --info: #6cc0f0;
        --sidebar: #070d19;
        --sidebar-2: #0c1426;
        --sidebar-line: #172238;
        --sidebar-active: #16223a;
        --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -12px rgba(0, 0, 0, .5);
        --shadow-lg: 0 30px 60px -20px rgba(0, 0, 0, .7);
        --focus: 0 0 0 3px rgba(91, 134, 255, .35);
        color-scheme: dark;
    }
}

:root[data-theme="dark"] {
    --bg: #0b1120;
    --surface: #121a2b;
    --surface-2: #162036;
    --surface-3: #1b2740;
    --border: #233149;
    --border-strong: #2f3f5c;
    --text: #e6ebf3;
    --text-2: #a5b1c4;
    --text-3: #6f7d94;
    --primary: #4d94ff;
    --primary-hover: #6ea8fe;
    --primary-soft: #132c55;
    --primary-text: #9ec5fe;
    --pattern: rgba(255, 255, 255, .04);
    --success: #34c38f;
    --success-strong: #22a776;
    --success-soft: #11322a;
    --danger: #f26b6b;
    --danger-strong: #e04848;
    --danger-soft: #3a1b1f;
    --warning: #f0a944;
    --warning-soft: #36280f;
    --info-soft: #102a3d;
    --info: #6cc0f0;
    --sidebar: #070d19;
    --sidebar-2: #0c1426;
    --sidebar-line: #172238;
    --sidebar-active: #16223a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -12px rgba(0, 0, 0, .5);
    --shadow-lg: 0 30px 60px -20px rgba(0, 0, 0, .7);
    --focus: 0 0 0 3px rgba(91, 134, 255, .35);
    color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
    font-family: var(--font);
    font-size: 14.5px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-display); margin: 0; line-height: 1.25; letter-spacing: -.01em; }
p { margin: 0; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
.num, .tabular { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-2); }
.subtle { color: var(--text-3); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.icon { display: inline-flex; width: 18px; height: 18px; flex: none; }
.icon svg { width: 100%; height: 100%; }

/* ------------------------------------------------------------ démarrage */

.boot { min-height: 100vh; display: grid; place-items: center; }
.spinner {
    width: 28px; height: 28px; border-radius: 50%;
    border: 3px solid var(--border); border-top-color: var(--primary);
    animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------ mise en page */

/* Fond de page : pictogrammes des services AidAssistance, très discrets */
body::before {
    content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
    background-color: var(--pattern);
    -webkit-mask: url("../assets/motif-services.svg") repeat 0 0 / 320px 320px;
    mask: url("../assets/motif-services.svg") repeat 0 0 / 320px 320px;
}
#app { position: relative; z-index: 1; }

.shell { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; }
.sidebar {
    background: var(--sidebar);
    color: var(--sidebar-text);
    display: flex; flex-direction: column;
    position: sticky; top: 0; height: 100vh;
    border-right: 1px solid var(--sidebar-line);
}
.brand { display: flex; align-items: center; gap: 11px; padding: 20px 20px 18px; }
.brand-logo {
    width: 36px; height: 36px; border-radius: 10px;
    background: linear-gradient(140deg, #0d6efd, #0056b3);
    display: grid; place-items: center; color: #fff;
    box-shadow: 0 6px 16px -6px rgba(13, 110, 253, .7);
}
.brand-logo .icon { width: 20px; height: 20px; }
.brand-name { font-weight: 650; font-size: 15.5px; color: #fff; letter-spacing: -.01em; }
.brand-sub { font-size: 12px; color: var(--sidebar-muted); max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.nav { padding: 6px 12px; display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.nav-section { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--sidebar-muted); padding: 14px 10px 6px; font-weight: 600; }
.nav-item {
    display: flex; align-items: center; gap: 11px;
    padding: 9px 10px; border-radius: 9px;
    color: var(--sidebar-text); text-decoration: none; font-weight: 500;
    position: relative;
}
.nav-item:hover { background: var(--sidebar-2); text-decoration: none; color: #fff; }
.nav-item.active { background: var(--sidebar-active); color: #fff; }
.nav-item.active::before {
    content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px;
    border-radius: 0 3px 3px 0; background: var(--accent, #ffc107);
}
.nav-item .icon { opacity: .85; }
.nav-badge {
    margin-left: auto; background: #e5484d; color: #fff; font-size: 11px; font-weight: 700;
    border-radius: 999px; padding: 1px 7px; min-width: 20px; text-align: center;
}

.sidebar-foot { padding: 12px; border-top: 1px solid var(--sidebar-line); display: flex; flex-direction: column; gap: 8px; }
.sync-pill {
    display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 9px;
    background: var(--sidebar-2); color: var(--sidebar-text); font-size: 12.5px; border: 0; cursor: pointer; text-align: left; width: 100%;
}
.sync-pill:hover { background: var(--sidebar-active); }
.sync-dot { width: 8px; height: 8px; border-radius: 50%; background: #64748b; flex: none; }
.sync-dot.ok { background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .18); }
.sync-dot.busy { background: #5b86ff; animation: pulse 1s ease-in-out infinite; }
.sync-dot.off { background: #f59e0b; }
.sync-dot.err { background: #ef4444; }
@keyframes pulse { 50% { opacity: .35; } }
.sync-text { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.sync-text b { font-weight: 600; color: #fff; }
.sync-text span { color: var(--sidebar-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.user-card { display: flex; align-items: center; gap: 10px; padding: 6px 4px; }
.user-card .who { min-width: 0; flex: 1; }
.user-card .who b { display: block; color: #fff; font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-card .who span { font-size: 12px; color: var(--sidebar-muted); }
.icon-btn-dark {
    background: transparent; border: 0; color: var(--sidebar-muted); cursor: pointer;
    width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center;
}
.icon-btn-dark:hover { background: var(--sidebar-2); color: #fff; }

.avatar {
    width: 34px; height: 34px; border-radius: 50%; flex: none;
    display: grid; place-items: center; font-weight: 650; font-size: 13px; color: #fff;
    background: var(--av, #4f6bd8);
}
.avatar.lg { width: 44px; height: 44px; font-size: 15px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
    display: flex; align-items: center; gap: 14px;
    padding: 18px 32px; position: sticky; top: 0; z-index: 20;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid transparent;
}
.topbar.scrolled { border-bottom-color: var(--border); }
.topbar h1 { font-size: 22px; font-weight: 650; }
.topbar .crumb { font-size: 12.5px; color: var(--text-3); }
.topbar-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.menu-btn { display: none; }
.content { padding: 8px 32px 48px; display: flex; flex-direction: column; gap: 20px; max-width: 1480px; width: 100%; }

.banner {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px; border-radius: var(--radius-sm);
    background: var(--info-soft); color: var(--info); border: 1px solid color-mix(in srgb, var(--info) 22%, transparent);
}
.banner.warn { background: var(--warning-soft); color: var(--warning); border-color: color-mix(in srgb, var(--warning) 25%, transparent); }
.banner.danger { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.banner.success { background: var(--success-soft); color: var(--success); border-color: color-mix(in srgb, var(--success) 25%, transparent); }
.banner .grow { flex: 1; }
.banner b { font-weight: 650; }
.update-bar {
    display: flex; align-items: center; gap: 12px; justify-content: center;
    padding: 8px 16px; background: linear-gradient(90deg, #1b47c4, #2457e6); color: #fff; font-size: 13.5px;
}
.update-bar .btn { background: #fff; color: #1b47c4; border-color: #fff; }

/* Bandeau d'information de l'administrateur : visible, fin, non collant, masquable. */
.notice-bar {
    display: flex; align-items: center; gap: 10px; justify-content: center;
    padding: 7px 44px 7px 16px; position: relative;
    background: var(--danger-soft); color: var(--danger);
    border-bottom: 1px solid color-mix(in srgb, var(--danger) 28%, transparent);
    box-shadow: inset 3px 0 0 var(--danger-strong);
    font-size: 13.5px; font-weight: 600; line-height: 1.35;
}
.notice-bar > .icon { width: 16px; height: 16px; }
.notice-text { min-width: 0; overflow-wrap: anywhere; }
.notice-close {
    position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
    display: grid; place-items: center; width: 28px; height: 28px; padding: 0;
    border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; opacity: .7;
}
.notice-close:hover { opacity: 1; background: color-mix(in srgb, var(--danger) 12%, transparent); }
.notice-close:focus-visible { outline: none; box-shadow: var(--focus); opacity: 1; }
.notice-close .icon { width: 15px; height: 15px; }
.login-page { min-height: 100vh; display: flex; flex-direction: column; }
.login-page > .login { min-height: 0; flex: 1; }

/* ------------------------------------------------------------ cartes */

.card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow);
}
.card-head {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.card-head h2 { font-size: 15.5px; font-weight: 650; }
.card-head .sub { font-size: 12.5px; color: var(--text-3); }
.card-head .actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.card-body { padding: 18px 20px; }
.card-body.flush { padding: 0; }

.grid { display: grid; gap: 20px; }
.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)); }
.grid-main { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.spacer { flex: 1; }

.stat {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 16px 18px; box-shadow: var(--shadow); display: flex; gap: 14px; align-items: flex-start;
}
.stat-icon {
    width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; flex: none;
    background: var(--primary-soft); color: var(--primary);
}
.stat-icon.green { background: var(--success-soft); color: var(--success); }
.stat-icon.amber { background: var(--warning-soft); color: var(--warning); }
.stat-icon.red { background: var(--danger-soft); color: var(--danger); }
.stat-label { font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.stat-value { font-size: 24px; font-weight: 680; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.2; margin-top: 2px; font-family: var(--font-display); }
.stat-hint { font-size: 12px; color: var(--text-3); margin-top: 2px; }

/* ------------------------------------------------------------ boutons */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    height: 36px; padding: 0 14px; border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
    font-weight: 560; font-size: 13.5px; cursor: pointer; white-space: nowrap;
    transition: background .12s, border-color .12s, box-shadow .12s, transform .05s;
    text-decoration: none;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--focus); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn .icon { width: 16px; height: 16px; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-success { background: var(--success-strong); border-color: var(--success-strong); color: #fff; }
.btn-success:hover { filter: brightness(.95); background: var(--success-strong); }
.btn-danger { background: var(--danger-strong); border-color: var(--danger-strong); color: #fff; }
.btn-danger:hover { filter: brightness(.95); background: var(--danger-strong); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }
.btn-soft-danger { background: transparent; border-color: transparent; color: var(--danger); }
.btn-soft-danger:hover { background: var(--danger-soft); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; }
.btn-lg { height: 46px; padding: 0 20px; font-size: 15px; border-radius: 11px; }
.btn-icon { width: 34px; padding: 0; }
.btn-sm.btn-icon { width: 30px; }
.btn-block { width: 100%; }

/* ------------------------------------------------------------ formulaires */

.form { display: flex; flex-direction: column; gap: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.field .hint { font-size: 12px; color: var(--text-3); }
.input, .select, .textarea {
    width: 100%; height: 38px; padding: 0 12px; border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
    transition: border-color .12s, box-shadow .12s;
}
.textarea { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.select {
    appearance: none; padding-right: 34px; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238492a6' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center;
}
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--focus); }
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input-sm, .select-sm { height: 32px; font-size: 13px; }
.input-group { position: relative; display: flex; }
.input-group .input { padding-right: 42px; }
.input-group .addon { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); }
.check { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; font-size: 13.5px; }
.check input { width: 17px; height: 17px; accent-color: var(--primary); margin: 0; cursor: pointer; }

.segmented { display: inline-flex; padding: 3px; background: var(--surface-3); border-radius: 10px; gap: 2px; }
.segmented button {
    border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; cursor: pointer;
    font-weight: 560; font-size: 13px; color: var(--text-2);
}
.segmented button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.filters .field { min-width: 150px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); padding: 0 12px; }
.tab {
    border: 0; background: transparent; padding: 12px 10px; cursor: pointer; font-weight: 560; color: var(--text-2);
    border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; gap: 7px; align-items: center;
}
.tab:hover { color: var(--text); }
.tab.on { color: var(--primary); border-bottom-color: var(--primary); }
.tab .count { background: var(--surface-3); color: var(--text-2); font-size: 11.5px; border-radius: 999px; padding: 0 7px; }
.tab.on .count { background: var(--primary-soft); color: var(--primary-text); }

/* ------------------------------------------------------------ tableaux */

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
    text-align: left; font-weight: 600; font-size: 12px; color: var(--text-3);
    text-transform: uppercase; letter-spacing: .05em; padding: 10px 16px;
    background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table td { padding: 11px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-2); }
.table .right { text-align: right; }
.table .center { text-align: center; }
.table .actions { text-align: right; white-space: nowrap; }
.table tr.cancelled td { color: var(--text-3); }
.table tr.cancelled td .strike { text-decoration: line-through; }
.table tfoot td { font-weight: 650; background: var(--surface-2); border-top: 1px solid var(--border); }
.person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.person .avatar { width: 30px; height: 30px; font-size: 12px; }
.person b { font-weight: 600; display: block; }
.person > div > span { font-size: 12px; color: var(--text-3); }

.badge {
    display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 999px;
    font-size: 12px; font-weight: 600; background: var(--surface-3); color: var(--text-2); white-space: nowrap;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.green { background: var(--success-soft); color: var(--success); }
.badge.red { background: var(--danger-soft); color: var(--danger); }
.badge.amber { background: var(--warning-soft); color: var(--warning); }
.badge.blue { background: var(--primary-soft); color: var(--primary-text); }
.badge.info { background: var(--info-soft); color: var(--info); }

.empty { padding: 40px 20px; text-align: center; color: var(--text-3); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty .icon { width: 36px; height: 36px; color: var(--border-strong); }
.empty b { color: var(--text-2); font-weight: 600; }

.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: 0; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .title { font-weight: 600; }
.list-item .meta { font-size: 12.5px; color: var(--text-3); }
.punch-dot { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.punch-dot.in { background: var(--success-soft); color: var(--success); }
.punch-dot.out { background: var(--danger-soft); color: var(--danger); }
.punch-dot.off { background: var(--surface-3); color: var(--text-3); }
.punch-dot .icon { width: 16px; height: 16px; }

/* ------------------------------------------------------------ graphique */

.bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 12px; align-items: end; height: 200px; padding: 8px 4px 0; }
.bar-col { display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.bar-val { font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; font-weight: 600; }
.bar {
    width: 100%; max-width: 44px; border-radius: 7px 7px 3px 3px; min-height: 3px;
    background: linear-gradient(180deg, var(--primary), color-mix(in srgb, var(--primary) 70%, #0b1424));
    transition: height .4s ease;
}
.bar.today { background: linear-gradient(180deg, var(--success-strong), color-mix(in srgb, var(--success-strong) 70%, #0b1424)); }
.bar.zero { background: var(--surface-3); }
.bar-label { font-size: 12px; color: var(--text-3); font-weight: 600; text-transform: capitalize; }
.bar-label.today { color: var(--success); }

/* ------------------------------------------------------------ pointeuse */

.clock-card {
    position: relative; overflow: hidden;
    background: url("../assets/fond-aidassistance.svg") right -40px bottom -120px / 420px auto no-repeat,
        radial-gradient(1200px 400px at 0% 0%, #1a73ff 0%, transparent 60%), linear-gradient(135deg, #0a3d8f, #062a63);
    color: #fff; border-radius: 20px; padding: 32px; box-shadow: var(--shadow-lg);
    display: grid; grid-template-columns: 1.2fr 1fr; gap: 28px; align-items: center;
}
.clock-card::after {
    content: ""; position: absolute; right: -80px; top: -80px; width: 280px; height: 280px; border-radius: 50%;
    border: 40px solid rgba(255, 255, 255, .04);
}
.clock-greet { font-size: 15px; color: #b9c7e6; }
.clock-time { font-family: var(--font-display); font-size: 64px; font-weight: 650; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.05; margin: 6px 0 4px; }
.clock-date { color: #b9c7e6; text-transform: capitalize; }
.status-chip {
    display: inline-flex; align-items: center; gap: 8px; margin-top: 18px;
    padding: 7px 14px; border-radius: 999px; background: rgba(255, 255, 255, .1); font-weight: 600; font-size: 13.5px;
}
.status-chip .dot { width: 9px; height: 9px; border-radius: 50%; background: #94a3b8; }
.status-chip.in .dot { background: #34d399; box-shadow: 0 0 0 4px rgba(52, 211, 153, .25); animation: pulse 2s ease-in-out infinite; }
.punch-zone { display: flex; flex-direction: column; gap: 12px; position: relative; z-index: 1; }
.punch-btn {
    height: 86px; border-radius: 16px; border: 0; cursor: pointer; color: #fff;
    font-size: 19px; font-weight: 650; display: flex; align-items: center; justify-content: center; gap: 12px;
    transition: transform .08s, filter .12s, box-shadow .12s;
}
.punch-btn .icon { width: 26px; height: 26px; }
.punch-btn.in { background: linear-gradient(180deg, #10b981, #059669); box-shadow: 0 14px 30px -12px rgba(16, 185, 129, .8); }
.punch-btn.out { background: linear-gradient(180deg, #f05252, #d63434); box-shadow: 0 14px 30px -12px rgba(240, 82, 82, .8); }
.punch-btn:hover { filter: brightness(1.06); }
.punch-btn:active { transform: scale(.985); }
.punch-btn:disabled { filter: grayscale(.4) brightness(.8); cursor: wait; }
.punch-note { background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); color: #fff; }
.punch-note::placeholder { color: #9fb0d3; }
.punch-note:focus { border-color: #7ea0ff; }
.link-light { color: #b9c7e6; font-size: 13px; background: none; border: 0; cursor: pointer; padding: 0; text-align: left; }
.link-light:hover { color: #fff; text-decoration: underline; }

.done-overlay {
    position: fixed; inset: 0; z-index: 90; display: grid; place-items: center;
    background: rgba(5, 10, 20, .6); backdrop-filter: blur(4px); animation: fade .15s ease;
}
.done-card { background: var(--surface); border-radius: 22px; padding: 36px 44px; text-align: center; box-shadow: var(--shadow-lg); max-width: 420px; }
.done-check { width: 72px; height: 72px; margin: 0 auto 16px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.done-check .icon { width: 38px; height: 38px; }
.done-check.in { background: var(--success-strong); }
.done-check.out { background: var(--danger-strong); }
.done-card h2 { font-size: 22px; margin-bottom: 6px; }
.done-card .big { font-size: 40px; font-weight: 680; font-variant-numeric: tabular-nums; letter-spacing: -.02em; margin: 8px 0; }

/* ------------------------------------------------------------ connexion */

.login {
    min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr;
}
.login-hero {
    position: relative; overflow: hidden; color: #fff; padding: 44px 52px;
    display: flex; flex-direction: column; justify-content: space-between;
    background: radial-gradient(900px 600px at 0% 0%, #1a73ff 0%, transparent 60%), linear-gradient(160deg, #0d6efd 0%, #0056b3 55%, #003d82 100%);
}
.login-hero::before {
    content: ""; position: absolute; inset: 0;
    background: url("../assets/fond-aidassistance.svg") right 18px bottom 64px / min(88%, 700px) auto no-repeat;
}
.login-hero::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(90deg, rgba(0, 44, 110, .72) 0%, rgba(0, 44, 110, .35) 45%, rgba(0, 44, 110, 0) 70%);
}
.login-hero > * { z-index: 1; }
.hero-title { font-family: var(--font-display); font-weight: 800; font-size: 30px; letter-spacing: .02em; line-height: 1.1; }
.hero-title span { display: block; font-size: 14px; font-weight: 600; letter-spacing: .32em; color: #ffd54f; margin-top: 6px; }
.login-hero > * { position: relative; }
.hero-time { font-family: var(--font-display); font-size: 92px; font-weight: 640; letter-spacing: -.04em; font-variant-numeric: tabular-nums; line-height: 1; }
.hero-date { font-size: 19px; color: #dbe8ff; text-transform: capitalize; margin-top: 10px; }
.hero-foot { color: #cfe0ff; font-size: 13px; display: flex; gap: 18px; flex-wrap: wrap; }
.hero-foot span { display: inline-flex; gap: 7px; align-items: center; }
.login-side { display: grid; place-items: center; padding: 32px; }
.login-card { width: 100%; max-width: 400px; }
.login-card h2 { font-size: 26px; font-weight: 680; margin-bottom: 6px; }
.login-card .lead { color: var(--text-2); margin-bottom: 26px; }
.code-input { height: 52px; font-size: 20px; letter-spacing: .18em; text-align: center; border-radius: 12px; }
.code-input::placeholder { letter-spacing: .02em; font-size: 15px; }
.login-msg { min-height: 22px; font-size: 13.5px; color: var(--danger); font-weight: 560; }
.choice-grid { display: grid; gap: 10px; }
.choice {
    display: flex; gap: 14px; align-items: flex-start; text-align: left; width: 100%;
    padding: 16px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface); cursor: pointer;
}
.choice:hover { border-color: var(--primary); box-shadow: var(--focus); }
.choice .stat-icon { width: 38px; height: 38px; }
.choice b { display: block; margin-bottom: 2px; }
.choice span { font-size: 13px; color: var(--text-2); }

/* ------------------------------------------------------------ messagerie */

.messenger { display: grid; grid-template-columns: 340px 1fr; min-height: 560px; }
.threads { border-right: 1px solid var(--border); overflow-y: auto; max-height: 72vh; }
.thread-item { display: flex; gap: 11px; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; background: transparent; border-left: 3px solid transparent; width: 100%; text-align: left; border-top: 0; border-right: 0; }
.thread-item:hover { background: var(--surface-2); }
.thread-item.on { background: var(--primary-soft); border-left-color: var(--primary); }
.thread-item .grow { min-width: 0; flex: 1; }
.thread-item .top { display: flex; gap: 8px; align-items: baseline; }
.thread-item .top b { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.thread-item .top time { font-size: 11.5px; color: var(--text-3); white-space: nowrap; }
.thread-item .subj { font-size: 13px; font-weight: 600; color: var(--text-2); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.thread-item .snip { font-size: 12.5px; color: var(--text-3); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.thread-item.unread .subj, .thread-item.unread .top b { color: var(--text); }
.unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); flex: none; margin-top: 6px; }
.conversation { display: flex; flex-direction: column; min-width: 0; }
.conv-head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; gap: 12px; align-items: center; }
.conv-head h3 { font-size: 16px; }
.conv-body { flex: 1; padding: 20px; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; max-height: 56vh; background: var(--surface-2); }
.bubble-row { display: flex; gap: 10px; align-items: flex-end; }
.bubble-row.mine { flex-direction: row-reverse; }
.bubble { max-width: 72%; padding: 11px 14px; border-radius: 14px 14px 14px 4px; background: var(--surface); border: 1px solid var(--border); white-space: pre-wrap; word-wrap: break-word; }
.bubble-row.mine .bubble { background: var(--primary); color: #fff; border-color: var(--primary); border-radius: 14px 14px 4px 14px; }
.bubble .meta { font-size: 11.5px; color: var(--text-3); margin-bottom: 3px; font-weight: 600; }
.bubble-row.mine .bubble .meta { color: #d4defd; }
.composer { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; gap: 10px; align-items: flex-end; }
.composer .textarea { min-height: 44px; height: 44px; }

/* ------------------------------------------------------------ modales */

.modal-backdrop {
    position: fixed; inset: 0; z-index: 100; background: rgba(5, 10, 20, .55);
    display: grid; place-items: center; padding: 20px; animation: fade .12s ease;
    backdrop-filter: blur(2px);
}
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px) scale(.985); } }
.modal {
    width: 100%; max-width: 560px; max-height: calc(100vh - 40px); overflow: auto;
    background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg);
    border: 1px solid var(--border); animation: rise .16s ease;
}
.modal.wide { max-width: 980px; }
.modal.narrow { max-width: 440px; }
.modal-head { display: flex; align-items: flex-start; gap: 12px; padding: 20px 22px 6px; }
.modal-head h3 { font-size: 18px; font-weight: 660; }
.modal-head .sub { color: var(--text-2); font-size: 13.5px; margin-top: 4px; }
.modal-head .close { margin-left: auto; }
.modal-body { padding: 14px 22px 8px; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 16px 22px 20px; }
.form-error { color: var(--danger); font-size: 13px; font-weight: 560; min-height: 0; }

/* Fenêtre « Nouveau message » du salarié. */
.msg-popup { display: flex; flex-direction: column; gap: 10px; }
.msg-popup-item {
    display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px;
    border-radius: 12px; background: var(--primary-soft); color: var(--text);
}
.msg-popup-item > .icon { flex: none; width: 18px; height: 18px; margin-top: 2px; color: var(--primary); }
.msg-popup-item b { display: block; font-weight: 650; overflow-wrap: anywhere; }
.msg-popup-item p { margin: 4px 0 0; color: var(--text-2); font-size: 13.5px; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }

.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
    display: flex; gap: 10px; align-items: center; min-width: 280px; max-width: 420px;
    padding: 12px 14px; border-radius: 12px; background: #0f172a; color: #fff; box-shadow: var(--shadow-lg);
    animation: rise .18s ease; font-weight: 520;
}
.toast .icon { color: #34d399; }
.toast.error .icon { color: #f87171; }
.toast.leave { opacity: 0; transform: translateY(6px); transition: all .2s; }

.kv { display: grid; grid-template-columns: 170px 1fr; gap: 8px 16px; font-size: 13.5px; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; font-weight: 520; word-break: break-all; }

.progress { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.progress > div { height: 100%; background: var(--primary); border-radius: inherit; transition: width .3s; }

.month-nav { display: inline-flex; align-items: center; gap: 4px; }
.month-nav .label { min-width: 150px; text-align: center; font-weight: 650; text-transform: capitalize; }

/* ------------------------------------------------------------ impression */

#print-root { display: none; }
.sheet { font-family: var(--font); color: #000; font-size: 11.5pt; }
.sheet h1 { font-size: 18pt; margin-bottom: 2pt; }
.sheet .sheet-head { display: flex; justify-content: space-between; border-bottom: 2px solid #000; padding-bottom: 10pt; margin-bottom: 14pt; }
.sheet table { width: 100%; border-collapse: collapse; font-size: 10pt; }
.sheet th, .sheet td { border: 1px solid #999; padding: 4pt 6pt; text-align: left; }
.sheet th { background: #eee; }
.sheet .we td { background: #f6f6f6; color: #555; }
.sheet .totals { margin-top: 12pt; display: flex; gap: 24pt; font-size: 11pt; }
.sheet .sign { margin-top: 30pt; display: flex; justify-content: space-between; gap: 40pt; }
.sheet .sign div { flex: 1; border-top: 1px solid #000; padding-top: 6pt; font-size: 10pt; }
.sheet .right { text-align: right; }

@media print {
    body::before { display: none !important; }
    @page { size: A4; margin: 14mm; }
    body { background: #fff; }
    body > *:not(#print-root) { display: none !important; }
    #print-root { display: block !important; }
}

/* ------------------------------------------------------------ responsive */

@media (max-width: 1180px) {
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-main { grid-template-columns: 1fr; }
    .clock-card { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
    .shell { grid-template-columns: 1fr; }
    .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 270px; z-index: 60; transform: translateX(-100%); transition: transform .2s ease; }
    .shell.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
    .shell.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(0, 0, 0, .4); z-index: 50; }
    .menu-btn { display: inline-flex; }
    .topbar { padding: 12px 16px; }
    .topbar h1 { font-size: 19px; }
    .content { padding: 6px 16px 40px; gap: 16px; }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .login { grid-template-columns: 1fr; }
    .login-hero { padding: 28px 24px; min-height: 230px; }
    .hero-time { font-size: 60px; }
    .messenger { grid-template-columns: 1fr; }
    .messenger.has-thread .threads { display: none; }
    .messenger:not(.has-thread) .conversation { display: none; }
    .threads { max-height: none; border-right: 0; }
    .form-grid { grid-template-columns: 1fr; }
    .kv { grid-template-columns: 1fr; gap: 2px 0; }
    .kv dd { margin-bottom: 8px; }
    .clock-card { padding: 22px; }
    .clock-time { font-size: 48px; }
    .card-head { padding: 14px 16px; }
    .card-body { padding: 16px; }
    .table th, .table td { padding: 10px 12px; }
}
@media (max-width: 560px) {
    .grid-4 { grid-template-columns: 1fr 1fr; gap: 12px; }
    .stat { padding: 12px; gap: 10px; }
    .stat-icon { display: none; }
    .stat-value { font-size: 20px; }
    .topbar-actions .btn span.lbl { display: none; }
    .notice-bar { justify-content: flex-start; font-size: 12.5px; padding: 6px 40px 6px 12px; }
}
