/* ==========================================================================
   Heures — système visuel
   Applicatif, dense, arrondi. Deux couleurs de marque : mauve et rose.
   ========================================================================== */

:root {
    /* --- Mauve (couleur principale) ------------------------------------ */
    --violet-900: #211D52;
    --violet-800: #2E2A7A;
    --violet-700: #3A36A4;
    --violet-600: #4E45CE;
    --violet-500: #6C5CE7;
    --violet-200: #C9C3F5;
    --violet-100: #E7E4FB;
    --violet-50:  #F3F1FE;

    /* --- Rose (couleur d'accompagnement) -------------------------------- */
    --rose-700: #A8306B;
    --rose-600: #D4468C;
    --rose-400: #EE8FBE;
    --rose-300: #F5C6DE;
    --rose-200: #FAD9E9;
    --rose-100: #FDEDF4;

    /* --- Neutres --------------------------------------------------------- */
    --ink: #14112B;
    --slate: #454168;
    --muted: #7A7694;
    --line: #E9E6F4;
    --line-soft: #F1EFF8;
    --paper: #F7F6FC;
    --white: #FFFFFF;

    /* --- Statuts ---------------------------------------------------------- */
    --green-600: #17845A;
    --green-100: #DCF5E9;
    --amber-700: #9A6300;
    --amber-100: #FDF0D5;
    --red-600: #C93B4E;
    --red-100: #FCE7EA;

    --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

    --shell: 46rem;
    --shell-wide: 76rem;

    --r-sm: 10px;
    --r: 14px;
    --r-lg: 20px;
    --r-xl: 26px;

    --shadow: 0 1px 2px rgba(20, 17, 43, .04), 0 8px 24px rgba(20, 17, 43, .05);
    --shadow-sm: 0 1px 2px rgba(20, 17, 43, .05);
    --ease: cubic-bezier(.22, .61, .36, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    font-feature-settings: "cv11", "ss01";
}

.shell {
    width: 100%;
    max-width: var(--shell);
    margin: 0 auto;
    padding: 0 1.25rem;
}
.shell--wide { max-width: var(--shell-wide); }

/* --- Typographie ---------------------------------------------------------- */

h1, h2, h3 { margin: 0 0 .75rem; letter-spacing: -.02em; }
h1 { font-size: clamp(1.75rem, 4vw, 2.375rem); font-weight: 800; line-height: 1.1; }
h2 { font-size: 1.1875rem; font-weight: 700; line-height: 1.3; }
h3 { font-size: 1rem; font-weight: 600; }

p { margin: 0 0 1rem; }
a { color: var(--violet-600); }

.eyebrow {
    font-size: .6875rem;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--violet-500);
    margin: 0 0 .5rem;
}
.lede { font-size: 1.0625rem; color: var(--slate); max-width: 42em; }
.muted { color: var(--muted); }
.small { font-size: .8125rem; line-height: 1.55; color: var(--muted); }
.empty { font-size: .875rem; color: var(--muted); padding: 1.5rem 0; text-align: center; }
code { font-family: var(--mono); font-size: .875em; background: var(--violet-50); padding: .1em .35em; border-radius: 5px; }

.pad { padding: 2rem 0 4rem; }
.narrow { max-width: 30rem; }

/* --- En-tête et pied du parcours d'une personne --------------------------- */

.site-header { padding: 1.5rem 0 .5rem; }
.site-header .shell { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }

/* Le logo est un lockup large (rapport 2,34). On ne fixe que la hauteur :
   la largeur suit, et les attributs width/height du HTML réservent la place. */
.logo { display: block; width: auto; height: 32px; }
.logo--sidebar { height: 38px; }
.logo--lg { height: 46px; margin-bottom: 1.5rem; }

.header-note { font-size: .8125rem; color: var(--muted); text-decoration: none; }
.header-note:hover { color: var(--violet-600); }

.site-footer {
    margin-top: 3rem;
    padding: 1.5rem 0 2.5rem;
    font-size: .75rem;
    color: var(--muted);
}
.site-footer .shell { display: flex; gap: 1.25rem; flex-wrap: wrap; justify-content: space-between; }

/* --- Bandeau de section --------------------------------------------------- */

.banner {
    position: relative;
    overflow: hidden;
    border-radius: var(--r-lg);
    padding: 1.5rem 1.75rem;
    margin: 0 0 1.5rem;
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
    background: var(--violet-100);
    color: var(--violet-900);
}
.banner--rose { background: var(--rose-200); color: var(--rose-700); }
.banner--violet { background: var(--violet-100); color: var(--violet-800); }
.banner--deep { background: var(--violet-700); color: #fff; }

.banner-title {
    font-size: clamp(1.5rem, 3.5vw, 2rem);
    font-weight: 800;
    letter-spacing: -.03em;
    margin: 0;
    line-height: 1;
}
.banner-figures { display: flex; gap: 2rem; flex-wrap: wrap; margin-left: auto; }
.banner-figure { line-height: 1.2; }
.banner-figure .label { display: block; font-size: .75rem; font-weight: 500; opacity: .72; }
.banner-figure .value { display: block; font-size: 1.375rem; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.banner-actions { display: flex; gap: .5rem; align-items: center; }

/* --- Onglets --------------------------------------------------------------- */

.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin: 0 0 1.5rem; overflow-x: auto; }
.tabs a {
    display: inline-flex; align-items: center; gap: .5rem;
    padding: .75rem 1rem; font-size: .875rem; font-weight: 500;
    color: var(--muted); text-decoration: none;
    border-bottom: 2px solid transparent; white-space: nowrap;
}
.tabs a:hover { color: var(--ink); }
.tabs a.is-current { color: var(--ink); font-weight: 600; border-color: var(--ink); }
.tabs .count { font-size: .75rem; color: var(--violet-500); font-weight: 600; }

/* --- Messages -------------------------------------------------------------- */

.flash {
    font-size: .875rem;
    padding: .8125rem 1.125rem;
    margin: 0 0 1rem;
    border-radius: var(--r);
    background: var(--violet-50);
    color: var(--violet-800);
    border: 1px solid var(--violet-100);
}
.flash--ok { background: var(--green-100); color: var(--green-600); border-color: transparent; }
.flash--error { background: var(--red-100); color: var(--red-600); border-color: transparent; }

/* --- Le chrono -------------------------------------------------------------- */

.tracker { margin: 0 0 1.25rem; }

.toggle-form { margin: 0 0 .75rem; }

.toggle {
    display: block; width: 100%;
    padding: 2rem 1.5rem;
    border: 0;
    border-radius: var(--r-xl);
    background: var(--violet-600);
    color: #fff;
    cursor: pointer;
    font-family: inherit;
    box-shadow: 0 10px 30px rgba(78, 69, 206, .28);
    transition: background .2s var(--ease), box-shadow .2s var(--ease), transform .12s var(--ease);
    -webkit-tap-highlight-color: transparent;
}
.toggle:hover { background: var(--violet-700); }
.toggle:active { transform: scale(.995); }

.toggle--on {
    background: var(--rose-300);
    color: var(--violet-900);
    box-shadow: 0 10px 30px rgba(212, 70, 140, .22);
}
.toggle--on:hover { background: var(--rose-400); }

.toggle-label {
    display: inline-flex; align-items: center; gap: .5rem;
    font-size: .9375rem; font-weight: 600; letter-spacing: .02em;
}
.toggle--on .toggle-label::before {
    content: ""; width: 9px; height: 9px; border-radius: 50%;
    background: var(--rose-600);
    animation: pulse 1.6s var(--ease) infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: .35; transform: scale(.8); }
}

.toggle-clock {
    display: block;
    margin-top: .5rem;
    font-size: clamp(2.75rem, 13vw, 4rem);
    font-weight: 800;
    letter-spacing: -.045em;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    opacity: .5;
    transition: opacity .2s var(--ease);
}
.toggle--on .toggle-clock { opacity: 1; }

.toggle-hint { font-size: .8125rem; color: var(--muted); margin: 0 0 1.25rem; text-align: center; }

.totals { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; }
.total {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--r);
    padding: 1rem 1.125rem;
}
.total-value { display: block; font-size: 1.375rem; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.total-label { display: block; font-size: .75rem; color: var(--muted); margin-top: .125rem; }

/* --- Cartes ----------------------------------------------------------------- */

.card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 1.5rem;
    margin: 0 0 1.25rem;
}
.card h2 { margin-bottom: .375rem; }
.card--warn { border-color: var(--amber-100); background: #FFFCF6; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.card-head h2 { margin: 0; }

.week-total { font-size: .8125rem; font-weight: 500; color: var(--muted); margin-left: .5rem; }

.week-nav { display: flex; gap: .375rem; }
.week-nav a {
    font-size: .8125rem; font-weight: 500; color: var(--muted); text-decoration: none;
    padding: .375rem .75rem; border-radius: 999px; background: var(--violet-50);
}
.week-nav a:hover { background: var(--violet-100); color: var(--violet-700); }

/* --- Journée et lignes ------------------------------------------------------ */

.day { border-top: 1px solid var(--line-soft); padding: .875rem 0 .25rem; }
.day:first-of-type { border-top: 0; }
.day-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .25rem; }
.day-name { font-size: .75rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.day-total { font-size: .875rem; font-weight: 700; font-variant-numeric: tabular-nums; }

.entry {
    display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
    padding: .625rem .75rem;
    border-radius: var(--r-sm);
}
.entry:hover { background: var(--violet-50); }
.entry-time { min-width: 4.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.entry-body { flex: 1 1 12rem; min-width: 0; }
.entry-label { display: block; font-size: .9375rem; }
.entry-meta { display: block; font-size: .75rem; color: var(--muted); }
.entry--running { background: var(--rose-100); }
.entry--running:hover { background: var(--rose-200); }
.entry--running .entry-time { color: var(--rose-600); }

.entry-edit { font-size: .8125rem; }
.entry-edit summary {
    list-style: none; cursor: pointer; color: var(--muted);
    padding: .25rem .625rem; border-radius: 999px;
}
.entry-edit summary::-webkit-details-marker { display: none; }
.entry-edit summary:hover { background: var(--violet-100); color: var(--violet-700); }
.entry-edit[open] {
    flex: 1 1 100%;
    margin-top: .5rem;
    padding: 1rem;
    background: var(--violet-50);
    border-radius: var(--r);
}

/* --- Pastilles --------------------------------------------------------------- */

.tag {
    display: inline-flex; align-items: center; gap: .3125rem;
    font-size: .75rem; font-weight: 600;
    padding: .1875rem .625rem;
    border-radius: 999px;
    background: var(--violet-50);
    color: var(--violet-700);
    white-space: nowrap;
}
.tag--review { background: var(--amber-100); color: var(--amber-700); }
.tag--running { background: var(--rose-200); color: var(--rose-700); }
.tag--running::before {
    content: ""; width: 6px; height: 6px; border-radius: 50%;
    background: var(--rose-600); animation: pulse 1.6s var(--ease) infinite;
}
.tag--ok { background: var(--green-100); color: var(--green-600); }

/* --- Formulaires --------------------------------------------------------------- */

.stack { display: flex; flex-direction: column; gap: .875rem; align-items: flex-start; }
.stack > * { flex: 0 0 auto; }
.stack .field, .stack .check, .stack .row-form { width: 100%; }
.stack h2 { margin: .75rem 0 -.25rem; }

.row-form { display: flex; flex-wrap: wrap; gap: .875rem; align-items: flex-end; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: .875rem; width: 100%; }

.field { display: flex; flex-direction: column; gap: .3125rem; }
.field > span { font-size: .75rem; font-weight: 600; color: var(--slate); }
.field > span em { font-style: normal; font-weight: 400; color: var(--muted); }

/* Les largeurs de base ne valent que sur une ligne. Dans une colonne (.stack,
   .pin-form) l'axe principal est vertical : une base de 12rem y deviendrait
   une hauteur de 12rem, et le formulaire se couvrirait de trous. */
.row-form > .field { flex: 1 1 12rem; }
.row-form > .field--date { flex: 0 1 10rem; }
.row-form > .field--duration { flex: 0 1 8rem; }
.row-form > .field--label { flex: 2 1 13rem; }

input[type="text"], input[type="email"], input[type="url"], input[type="password"],
input[type="number"], input[type="date"], select, textarea {
    font-family: inherit;
    font-size: .9375rem;
    padding: .625rem .8125rem;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    background: var(--white);
    color: var(--ink);
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
input::placeholder { color: #A9A5BE; }
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--violet-500);
    box-shadow: 0 0 0 3px var(--violet-100);
}

select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%237A7694' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .75rem center;
    padding-right: 2rem;
}

.pin-form { max-width: 17rem; display: flex; flex-direction: column; gap: 1rem; }
.pin-input {
    font-size: 1.5rem; font-weight: 700;
    letter-spacing: .55em; text-align: center; text-indent: .55em;
    padding: .875rem .5rem;
}

.check { display: flex; align-items: flex-start; gap: .625rem; font-size: .875rem; color: var(--slate); }
.check input { margin-top: .25rem; accent-color: var(--violet-600); }

.field-label { font-size: .75rem; font-weight: 600; color: var(--slate); margin: 1.25rem 0 .375rem; }

.mono-box {
    font-family: var(--mono);
    font-size: .8125rem;
    line-height: 1.55;
    background: var(--violet-50);
    border: 1px solid var(--violet-100);
    border-radius: var(--r-sm);
    padding: .75rem .875rem;
    margin: 0 0 .5rem;
    overflow-x: auto;
    white-space: pre;
    color: var(--violet-800);
    -webkit-user-select: all;
    user-select: all;
}

/* --- Boutons ------------------------------------------------------------------- */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    font-family: inherit; font-size: .875rem; font-weight: 600;
    padding: .6875rem 1.125rem;
    border: 1px solid transparent;
    border-radius: var(--r-sm);
    background: var(--violet-600);
    color: #fff;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease);
}
.btn:hover { background: var(--violet-700); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn--wide { width: 100%; }
.btn--small { padding: .4375rem .8125rem; font-size: .8125rem; }
.btn--dark { background: var(--ink); }
.btn--dark:hover { background: #000; }
.btn--ghost { background: var(--white); color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { background: var(--violet-50); border-color: var(--violet-200); color: var(--violet-700); }
.btn--rose { background: var(--rose-600); }
.btn--rose:hover { background: var(--rose-700); }

.link, .link-danger {
    font-family: inherit; font-size: .8125rem; font-weight: 500;
    background: none; border: 0; padding: 0;
    color: var(--muted); cursor: pointer; text-decoration: none;
}
.link:hover { color: var(--violet-600); }
.link-danger { color: var(--red-600); }
.link-danger:hover { color: #A32A3B; }

.inline-form { display: inline-block; margin: 0; }
.actions { display: flex; gap: .625rem; flex-wrap: wrap; margin: 1.25rem 0; }
.access-actions { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; margin-top: 1.25rem; }
.archive-form { margin-top: 1.25rem; }

/* --- Petits écrans ---------------------------------------------------------------- */

@media (max-width: 40rem) {
    .banner { padding: 1.25rem; gap: 1rem; }
    .banner-figures { margin-left: 0; gap: 1.25rem; width: 100%; }
    .totals { grid-template-columns: 1fr 1fr; }
    .total:last-child { grid-column: 1 / -1; }
    .card { padding: 1.125rem; }
    .row-form > .field { flex: 1 1 100%; }
}
