/* Web app shell (sidebar + header) and Accueil screen — see design_handoff_diabete_famille/03-web.md */

/*
 * A real body class, not :has(.app-shell): browser support for :has() is
 * inconsistent enough that relying on it silently let the generic page's
 * own responsive padding/background (design-system.css) bleed through
 * around .app-shell's edges — visible as a thin blue strip wherever the
 * override failed to apply.
 */
body.app-shell-page {
    padding: 0;
    background: var(--df-bg-app);
}

@media (min-width: 62rem) {
    body.app-shell-page { background: var(--df-bg-app); }
}

.app-shell {
    display: flex;
    min-height: 100vh;
    background: var(--df-bg-app);
    color: var(--df-text);
}

/* ---------- Sidebar ---------- */

.app-sidebar {
    display: flex;
    flex: 0 0 252px;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    background: var(--df-gradient-sidebar);
    overflow-y: auto;
}

/* The checkbox is never visible itself — only its :checked state,
   toggled by the <label class="app-hamburger">, matters (see the mobile
   media query further down). */
/*
 * Resets every box-model property design-system.css's generic
 * `input, select, textarea` rule would otherwise hand this checkbox
 * (width: 100%, padding, border, min-height): with no box-sizing:
 * border-box anywhere in the stylesheet, that combination rendered as
 * viewport-width-plus-padding once the mobile breakpoint took away
 * .app-sidebar's position: sticky (this checkbox's containing block),
 * leaving an invisible but real ~28px-wide box past the right edge on
 * every app-shell page — the horizontal scroll/blue-strip bug.
 */
.app-sidebar__checkbox {
    position: absolute;
    width: 1px;
    height: 1px;
    min-height: 0;
    padding: 0;
    margin: -1px;
    border: 0;
    opacity: 0;
    pointer-events: none;
}

.app-sidebar__brand-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 16px;
    cursor: default;
}

.app-sidebar__brand {
    display: flex;
    align-items: center;
    gap: .6rem;
}

.app-hamburger { display: none; }

/* Desktop-first: the sidebar is never collapsed above the mobile
   breakpoint, so its content is visible by default — the mobile media
   query below is the only place that ever hides it. */
.app-sidebar__collapsible {
    display: flex;
    flex-direction: column;
    flex: 1;
    margin: 0 16px 16px;
}

.app-logo {
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    border-radius: var(--df-radius-logo);
    background: white;
    object-fit: contain;
    padding: 3px;
}

.app-brand-name {
    margin: 0;
    color: white;
    font-family: var(--df-font-heading);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.app-family-name {
    margin: 0;
    color: var(--df-blue-gray-on-dark);
    font-size: 11px;
}

.app-nav {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.app-nav__item {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: 10px 12px;
    border-radius: var(--df-radius-btn);
    color: #C2D5F7;
    font-size: 13.5px;
    font-weight: 500;
    text-decoration: none;
    transition: var(--df-transition-nav);
}

.app-nav__icon { display: flex; flex: 0 0 20px; opacity: .85; }
.app-nav__item.is-active .app-nav__icon { opacity: 1; }

.app-nav__item:hover { background: rgba(255, 255, 255, .09); }

.app-nav__item.is-active {
    background: rgba(255, 255, 255, .2);
    color: var(--df-blue-on-dark);
}

.app-sidebar__today {
    margin-top: auto;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 12px;
    background: rgba(255, 255, 255, .05);
}

.app-sidebar__today-label {
    margin: 0 0 .3rem;
    color: var(--df-blue-gray-on-dark);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.app-sidebar__today-text {
    margin: 0;
    color: var(--df-white-blue-on-dark);
    font-size: 12.5px;
    line-height: 1.4;
}

.app-sidebar__user {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, .08);
}

.app-avatar {
    display: flex;
    flex: 0 0 32px;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .16);
    color: white;
    font-size: 13px;
    font-weight: 600;
}

.app-user-name { margin: 0; color: white; font-size: 13px; font-weight: 600; }
.app-user-role { margin: 0; color: var(--df-blue-gray-on-dark); font-size: 11px; }

/*
 * Resets design-system.css's generic `form` rule (padding, border,
 * border-radius, background: var(--df-surface-card), box-shadow,
 * display: grid — meant for actual content forms), which otherwise turns
 * this single-button logout form into a padded white card: at rest a
 * near-invisible pale label on white, and on hover literal white text on
 * a still-white card (the "blanc sur blanc" bug). Same reset already
 * applied to .auth-card form below for the same reason.
 */
.app-sidebar__logout { display: block; margin: .5rem 0 0; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; }
.app-sidebar__logout-button {
    width: 100%;
    min-height: auto;
    padding: .5rem .6rem;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--df-blue-gray-on-dark);
    font-size: 12.5px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}
.app-sidebar__logout-button:hover { background: rgba(255, 255, 255, .08); color: white; }

/* ---------- Header ---------- */

.app-main-col {
    display: flex;
    flex: 1;
    min-width: 1080px;
    flex-direction: column;
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 61px;
    padding: 18px 32px;
    background: rgba(245, 247, 252, .9);
    backdrop-filter: var(--df-blur-header);
}

.app-child-selector {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 4px;
    border-radius: 12px;
    background: var(--df-progress-track);
}

.app-child-tab {
    display: flex;
    align-items: center;
    gap: .4rem;
    padding: 6px 12px 6px 6px;
    border-radius: 10px;
    color: var(--df-text-muted);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.app-child-tab.is-active {
    background: var(--df-surface-card);
    box-shadow: var(--df-shadow-tab-active);
    color: var(--df-text);
}

.app-child-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    color: white;
    font-size: 11px;
    font-weight: 700;
}

.app-child-add {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    margin-left: 4px;
    border-radius: 50%;
    background: var(--df-surface-card);
    color: var(--df-text-muted);
    font-weight: 700;
    text-decoration: none;
}

.app-header__actions {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.app-search {
    display: inline-flex;
    align-items: center;
    min-width: 220px;
    padding: .5rem .8rem;
    border: 1px solid var(--df-border-card);
    border-radius: var(--df-radius-input);
    background: var(--df-surface-card);
    color: var(--df-placeholder);
    font-size: 13px;
}

.app-cta {
    padding: .55rem .9rem;
    border-radius: var(--df-radius-btn);
    background: var(--df-blue);
    color: white;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}
.app-cta:hover { background: var(--df-blue-hover); }

.app-content {
    padding: 28px 32px 56px;
}

/* Palette used for child avatars/tabs/week grid, decorative only */
.app-color-blue { background: var(--df-blue); }
.app-color-violet { background: var(--df-violet); }
.app-color-amber { background: var(--df-warning); }
.app-color-coral { background: var(--df-alert); }

/* ---------- Écran 1 : Accueil ---------- */

.home-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 20px;
}

.home-title-row h1 { margin: 0 0 .3rem; }
.home-subtitle { margin: 0; color: var(--df-text-muted); font-size: 14px; }

.home-title-actions { display: flex; gap: .6rem; flex-shrink: 0; }

.btn-secondary {
    padding: .55rem .9rem;
    border: 0;
    border-radius: var(--df-radius-btn);
    background: var(--df-mint);
    color: white;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}
.btn-secondary:hover { background: var(--df-mint-hover); }

.alert-banner {
    display: flex;
    align-items: center;
    gap: .85rem;
    margin-bottom: 20px;
    padding: 16px 20px;
    border: 1px solid var(--df-alert-border);
    border-radius: 16px;
    background: var(--df-alert-surface);
}

.alert-banner__dot {
    flex: 0 0 10px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--df-alert);
    animation: pulseRing 2s infinite;
}

.alert-banner__text { flex: 1; min-width: 0; }
.alert-banner__title { margin: 0; font-size: 14.5px; font-weight: 600; }
.alert-banner__subtitle { margin: 0; color: var(--df-alert-text-secondary); font-size: 13px; }

.alert-banner__pill {
    display: flex;
    align-items: center;
    gap: .4rem;
    padding: .35rem .7rem;
    border-radius: var(--df-radius-pill);
    background: white;
    font-size: 12.5px;
    font-weight: 600;
    white-space: nowrap;
}

.alert-banner__pill-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--df-blue-surface);
    color: var(--df-blue-deep);
    font-size: 10px;
    font-weight: 700;
}

.alert-banner__cta {
    padding: .5rem .85rem;
    border-radius: var(--df-radius-btn);
    background: var(--df-blue);
    color: white;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.home-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
    gap: 22px;
    align-items: start;
}

.home-col-left, .home-col-right { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

.card {
    padding: 18px 20px;
    border: 1px solid var(--df-border-card);
    border-radius: var(--df-radius-card-md);
    background: var(--df-surface-card);
}
.card h2 { margin: 0 0 .3rem; font-size: 16px; }

/*
 * design-system.css's [class*="card"] fallback (for plain unstyled pages)
 * matches any class containing "card" as a substring, including these —
 * reset the box-model properties it adds so text-only children of .card
 * don't get an unwanted nested border/background/shadow.
 */
.card__subtitle, .card__empty, .card__link {
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
}
.card__subtitle { margin: 0 0 .9rem; color: var(--df-text-muted); font-size: 12px; }
.card__empty { margin: 0; color: var(--df-text-muted); font-size: 13px; }
.card__link { display: inline-block; margin-top: .75rem; color: var(--df-blue); font-size: 13px; font-weight: 600; text-decoration: none; }
.card--warning { border-color: var(--df-warning-border); background: var(--df-warning-surface); }

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

.child-tile {
    padding: 16px 18px;
    border: 1px solid var(--df-border-card);
    border-radius: var(--df-radius-card-md);
    background: var(--df-surface-card);
}

.child-tile__head { display: flex; align-items: flex-start; gap: .7rem; margin-bottom: .9rem; }
.child-tile__head h2 { margin: 0; font-size: 18px; }

.child-tile__avatar {
    display: flex;
    flex: 0 0 44px;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--df-radius-avatar-square);
    color: white;
    font-family: var(--df-font-heading);
    font-size: 18px;
    font-weight: 600;
}

.child-tile__meta { margin: 0; color: var(--df-text-muted); font-size: 12px; }

.pill {
    margin-left: auto;
    padding: .25rem .6rem;
    border-radius: var(--df-radius-pill);
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}
.pill--neutral { background: var(--df-blue-surface); color: var(--df-blue-deep); }
.pill--amber { background: var(--df-warning-surface); color: var(--df-warning-text); }

.child-tile__fields { display: flex; flex-direction: column; gap: .45rem; margin: 0 0 1rem; }
.child-tile__field-row { display: flex; align-items: center; gap: .5rem; font-size: 13px; }

.dot { flex: 0 0 6px; width: 6px; height: 6px; border-radius: 50%; }
.dot--blue { background: var(--df-blue); }
.dot--violet { background: var(--df-violet); }
.dot--amber { background: var(--df-warning); }
.dot--gray { background: var(--df-toggle-off); }

.field-label { flex: 0 0 108px; color: var(--df-text-muted); }
.field-value { font-weight: 600; color: var(--df-text); }

.child-tile__actions { display: flex; gap: .6rem; }

.btn-manage, .btn-fiche {
    flex: 1;
    padding: .55rem .8rem;
    border: 0;
    border-radius: var(--df-radius-btn);
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.btn-manage { background: var(--df-blue); color: white; }
.btn-manage--active { background: var(--df-blue); color: white; }
.btn-manage--disabled { background: var(--df-surface-btn-secondary-alt); color: var(--df-text-muted); cursor: default; }
.btn-fiche { background: var(--df-surface-btn-secondary); color: var(--df-text); }

.bolus-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }

.bolus-tile {
    padding: 12px 10px;
    border-radius: var(--df-radius-card-sm);
    background: var(--df-surface-subtle);
    text-align: center;
}

.bolus-tile--pending {
    border: 1px solid var(--df-alert-border);
    background: var(--df-alert-surface);
    color: var(--df-alert-text);
}

.bolus-tile__meal { margin: 0 0 .3rem; font-size: 12.5px; color: var(--df-text-muted); }
.bolus-tile--pending .bolus-tile__meal { color: var(--df-alert-text); }
.bolus-tile__time { margin: 0; font-family: var(--df-font-heading); font-size: 19px; font-weight: 600; }
.bolus-tile__author { margin: 0; font-size: 12px; color: var(--df-text-muted); }

.bolus-tile__confirm {
    display: inline-block;
    margin-top: .3rem;
    padding: .3rem .6rem;
    border-radius: var(--df-radius-btn);
    background: var(--df-blue);
    color: white;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

/* ---------- Confirmations de bolus : sélecteur de créneau ---------- */

.meal-slot-list { display: flex; flex-direction: column; gap: 10px; }

.meal-slot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border: 2px solid transparent;
    border-radius: 14px;
    background: var(--df-blue-surface);
    color: var(--df-text);
    text-decoration: none;
}

.meal-slot--selected { background: var(--df-surface-card); border-color: var(--df-blue); }

.meal-slot__label { font-weight: 700; font-size: 15px; }
.meal-slot__time { color: var(--df-text-muted); font-size: 13px; font-weight: 600; }

.back-link {
    display: inline-block;
    margin-top: 6px;
    color: var(--df-text-muted);
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
}
.back-link:hover { color: var(--df-blue); }

.bolus-confirm-card h2 { margin-top: 0; }

.bolus-photo-drop { margin: 4px 0; }

.bolus-photo-drop__label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 110px;
    border: 2px dashed var(--df-border-input);
    border-radius: var(--df-radius-md);
    color: var(--df-blue);
    font-weight: 600;
    font-size: 14px;
    text-align: center;
    cursor: pointer;
}

.bolus-photo-drop__icon { font-size: 22px; }

.bolus-photo-drop__input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.bolus-history { display: flex; flex-direction: column; gap: 14px; }

.bolus-history__entry {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--df-border-card);
}

.bolus-history__entry:last-child { padding-bottom: 0; border-bottom: 0; }

.bolus-history__info { min-width: 0; }

.bolus-history__meta { margin: 0 0 4px; font-weight: 700; font-size: 14px; }

.bolus-history__quantity { margin: 0; color: var(--df-text-muted); font-size: 13px; }

.bolus-history__photo-link { flex-shrink: 0; }

.bolus-history__photo-thumb {
    display: block;
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: var(--df-radius-md);
    border: 1px solid var(--df-border-input);
}

.care-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }

.care-week__day {
    padding: 8px 4px;
    border-radius: 10px;
    background: var(--df-surface-subtle);
    text-align: center;
}

.care-week__day--today { border: 2px solid var(--df-blue); }

.care-week__label { margin: 0; color: var(--df-label); font-size: 11px; text-transform: uppercase; }
.care-week__number { margin: .2rem 0; font-family: var(--df-font-heading); font-size: 16px; font-weight: 600; }
.care-week__caregiver { margin: 0; font-size: 10.5px; font-weight: 700; color: var(--df-text-muted); }

.upcoming-list, .stock-list, .feed-list { display: flex; flex-direction: column; gap: 12px; padding: 0; margin: 0; list-style: none; }

.upcoming-item { display: flex; gap: .7rem; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; }
.upcoming-item__date { flex: 0 0 38px; font-size: 11.5px; font-weight: 700; color: var(--df-text-muted); }
.upcoming-item__date--urgent { color: var(--df-alert-text); }
.upcoming-item__body { padding-left: .7rem; border-left: 1px solid var(--df-border-card); }
.upcoming-item__title { margin: 0; font-size: 13.5px; font-weight: 600; }
.upcoming-item__detail { margin: 0; font-size: 12px; color: var(--df-text-muted); }

.stock-item { display: flex; align-items: center; justify-content: space-between; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; font-size: 12px; }
.stock-item__quantity { font-weight: 700; color: var(--df-warning-text); }

.feed-item { display: flex; gap: .6rem; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; }
.feed-item__avatar {
    display: flex;
    flex: 0 0 28px;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--df-blue-surface);
    color: var(--df-blue-deep);
    font-size: 11px;
    font-weight: 700;
}
.feed-item__text { margin: 0; font-size: 13px; }
.feed-item__time { margin: 0; color: var(--df-label-discrete); font-size: 11.5px; }

/* ---------- Écran 2 : Fiche enfant ---------- */

.profile-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 20px;
}

.profile-header__identity { display: flex; align-items: center; gap: .9rem; }

.profile-header__avatar {
    display: flex;
    flex: 0 0 58px;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    border-radius: 18px;
    color: white;
    font-family: var(--df-font-heading);
    font-size: 24px;
    font-weight: 600;
}

.profile-header h1 { margin: 0; font-size: 27px; letter-spacing: -0.02em; }
.profile-header__summary { margin: .2rem 0 0; color: var(--df-text-muted); font-size: 13px; }
.profile-header__actions { display: flex; gap: .6rem; flex-shrink: 0; }

.profile-tiles {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.profile-tile {
    padding: 14px 16px;
    border: 1px solid var(--df-border-card);
    border-radius: var(--df-radius-card-md);
    background: var(--df-surface-card);
}
.profile-tile__label { margin: 0 0 .4rem; color: var(--df-label); font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; }
.profile-tile__value { margin: 0; font-family: var(--df-font-heading); font-size: 20px; font-weight: 600; }
.profile-tile__subtext { margin: .2rem 0 0; color: var(--df-text-muted); font-size: 12px; }

.profile-grid { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }

.device-list, .person-list, .contact-list { display: flex; flex-direction: column; gap: 14px; padding: 0; margin: 0 0 .5rem; list-style: none; }

.device-item { margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; }

.device-item__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .35rem; }
.device-item__name { font-size: 14px; font-weight: 600; }
.device-item__remaining { font-size: 12.5px; font-weight: 600; }
.device-item__remaining--ok { color: var(--df-blue-deep); }
.device-item__remaining--warning { color: var(--df-warning-text); }
.device-item__remaining--critical { color: var(--df-alert-text); }

.device-item__bar { height: 8px; border-radius: var(--df-radius-pill); background: var(--df-progress-track); overflow: hidden; }
.device-item__bar-fill { height: 100%; border-radius: var(--df-radius-pill); }
.device-item__bar-fill--ok { background: var(--df-blue); }
.device-item__bar-fill--warning { background: var(--df-warning); }
.device-item__bar-fill--critical { background: var(--df-alert); }

.device-item__meta { margin: .4rem 0 0; color: var(--df-text-muted); font-size: 12.5px; }
.device-item__meta a { color: var(--df-blue); font-weight: 600; text-decoration: none; }

.person-item { display: flex; align-items: center; gap: .6rem; margin: 0; padding: 0 0 14px; border: 0; border-bottom: 1px solid var(--df-border-divider); border-radius: 0; background: transparent; }
.person-item:last-child { border-bottom: 0; padding-bottom: 0; }
.person-item__avatar {
    display: flex;
    flex: 0 0 32px;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--df-blue-surface);
    color: var(--df-blue-deep);
    font-size: 12.5px;
    font-weight: 700;
}
.person-item__identity { flex: 1; min-width: 0; }
.person-item__name { margin: 0; font-size: 13.5px; font-weight: 600; }
.person-item__role { margin: 0; color: var(--df-text-muted); font-size: 12px; }

.pill--complete { background: var(--df-blue-surface); color: var(--df-blue-deep); }
.pill--read { background: var(--df-surface-subtle); color: var(--df-text-muted); border: 1px solid var(--df-border-card); }

.autonomy-card {
    padding: 20px;
    border-radius: 18px;
    background: var(--df-gradient-card-accent);
    color: var(--df-white-blue-on-dark);
}
.autonomy-card__eyebrow { margin: 0 0 .4rem; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--df-blue-on-dark); }
.autonomy-card__text { margin: 0 0 1rem; font-size: 14px; line-height: 1.5; }
.autonomy-card__list { display: flex; flex-direction: column; gap: .6rem; padding: 0; margin: 0; list-style: none; }
.autonomy-card__row { display: flex; align-items: center; justify-content: space-between; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; font-size: 13px; }
.autonomy-card__pill {
    padding: .2rem .6rem;
    border-radius: var(--df-radius-pill);
    background: rgba(255, 255, 255, .16);
    font-size: 11.5px;
    font-weight: 700;
}

.contact-item { margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; }

.contact-item__name { margin: 0; font-size: 13.5px; font-weight: 600; }
.contact-item__detail { margin: .15rem 0 0; color: var(--df-text-muted); font-size: 12px; }

.device-associated-label { margin: 1rem 0 .4rem; color: var(--df-label); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.device-associated-list { display: flex; flex-direction: column; gap: .4rem; padding: 0; margin: 0; list-style: none; font-size: 13px; }
.device-associated-list__date { color: var(--df-text-muted); }

/* ---------- Écran 3 : Journal partagé ---------- */

.journal-page { max-width: 980px; }

.journal-quickadd h2 { margin: 0 0 .9rem; font-size: 16px; }

.journal-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.journal-pill-form { margin: 0; }
.journal-pill {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: 8px 14px;
    border: 0;
    border-radius: var(--df-radius-pill);
    background: white;
    color: var(--df-text-secondary);
    font-size: 13px;
    font-weight: 600;
    box-shadow: inset 0 0 0 1px var(--df-border-input);
    cursor: pointer;
}
.journal-pill svg { flex: 0 0 16px; width: 16px; height: 16px; }
.journal-pill--red { background: var(--df-alert-surface); color: var(--df-alert-text); box-shadow: none; }
.journal-pill--amber { background: var(--df-warning-surface); color: var(--df-warning-text); box-shadow: none; }

.journal-filters { display: flex; gap: 8px; margin: 20px 0; flex-wrap: wrap; }
.journal-filter {
    padding: .5rem .9rem;
    border-radius: var(--df-radius-pill);
    background: white;
    color: var(--df-text-tertiary);
    box-shadow: inset 0 0 0 1px var(--df-border-input);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}
.journal-filter.is-active { background: var(--df-blue-gradient-start); color: white; box-shadow: none; }

.journal-day-label { margin: 20px 0 .6rem; color: var(--df-label-discrete); font-size: 12px; font-weight: 700; text-transform: uppercase; }
.journal-day-card { padding: 0; }

.journal-event-list { display: flex; flex-direction: column; padding: 0; margin: 0; list-style: none; }
.journal-event {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 0;
    padding: 14px 18px;
    border: 0;
    border-bottom: 1px solid var(--df-border-divider);
    border-radius: 0;
    background: transparent;
}
.journal-event:last-child { border-bottom: 0; }

.journal-event__time { flex: 0 0 52px; font-family: var(--df-font-heading); font-size: 14px; font-weight: 600; padding-top: 1px; }

.journal-event__accent { flex: 0 0 4px; align-self: stretch; border-radius: 999px; background: var(--df-label); }
.journal-event--alert .journal-event__accent { background: var(--df-alert); }
.journal-event--device .journal-event__accent { background: var(--df-violet); }
.journal-event--neutral .journal-event__accent { background: var(--df-label); }

.journal-event__body { flex: 1; min-width: 0; }
.journal-event__title { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 14px; font-weight: 600; }
.journal-event__detail { margin: .3rem 0 0; color: var(--df-text-tertiary); font-size: 13px; line-height: 1.5; }

.journal-event__tag {
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: white;
}
.journal-event--alert .journal-event__tag { background: var(--df-alert); }
.journal-event--device .journal-event__tag { background: var(--df-violet); }
.journal-event--neutral .journal-event__tag { background: var(--df-label); }

.journal-event__author { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.journal-event__avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--df-blue-surface);
    color: var(--df-blue-deep);
    font-size: 11px;
    font-weight: 700;
}

.journal-detailed-form { margin-top: 24px; }
.journal-detailed-form h2 { margin: 0 0 .9rem; font-size: 16px; }

.care-page__header { margin-bottom: 20px; }
.care-page__header h1 { margin: 0 0 6px; }
.care-page__disclaimer { margin: 0 0 6px; font-size: 12.5px; color: var(--df-text-muted); }
.care-page__current { margin: 0; font-size: 13.5px; }

.care-calendar {
    background: var(--df-surface-card);
    border: 1px solid var(--df-border-card);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
}

.care-calendar__toolbar { display: flex; align-items: center; justify-content: center; gap: 18px; margin-bottom: 14px; }
.care-calendar__month { margin: 0; font-size: 16px; font-weight: 600; min-width: 10rem; text-align: center; }
.care-calendar__nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: var(--df-surface-btn-secondary);
    text-decoration: none;
    color: inherit;
}

.care-calendar__legend { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.care-calendar__legend-item { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; }
.care-calendar__legend-swatch, .care-period-list__swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: none; }

.care-calendar__weekdays {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    margin-bottom: 6px;
}
.care-calendar__weekdays span { font-size: 11px; font-weight: 700; text-transform: uppercase; text-align: center; color: var(--df-text-muted); }

.care-calendar__grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
}

.care-calendar__cell {
    aspect-ratio: 1 / 0.72;
    border-radius: 10px;
    padding: 6px 8px;
    background: var(--df-surface-subtle);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: white;
}
.care-calendar__cell--outside { background: var(--df-surface-subtle); }
.care-calendar__cell--outside .care-calendar__cell-number { color: transparent; }
.care-calendar__cell--today { box-shadow: inset 0 0 0 2px var(--df-blue); }
.care-calendar__cell-number { font-size: 12px; font-weight: 600; color: var(--df-text-primary, #1A2333); }
.care-calendar__cell[style*="background"] .care-calendar__cell-number { color: rgba(255,255,255,.92); }
.care-calendar__cell-name { font-size: 10.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.care-page__panels {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}
.care-panel {
    background: var(--df-surface-card);
    border: 1px solid var(--df-border-card);
    border-radius: 16px;
    padding: 18px;
}
.care-panel h3 { margin: 0 0 10px; font-size: 14px; }
.care-panel__hint { font-size: 12px; margin: 0 0 10px; color: var(--df-text-muted); }
.care-panel button { margin-top: 10px; }

.care-period-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.care-period-list__item { display: flex; align-items: center; gap: 8px; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; font-size: 13px; }

.stocks-locations {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}
.stocks-location-card { display: flex; flex-direction: column; }
.stocks-location-card__name { margin: 0 0 10px; font-size: 16px; font-weight: 600; }
.stocks-location-card__items { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-direction: column; gap: 8px; }
.stocks-location-card__item { display: flex; align-items: center; justify-content: space-between; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; font-size: 13px; }
.stocks-location-card__quantity { font-weight: 700; }
.stocks-location-card__quantity--ok { color: var(--df-blue-deep); }
.stocks-location-card__quantity--low { color: var(--df-warning-text); }
.stocks-location-card__quantity--critical { color: var(--df-alert-text); }
.stocks-location-card__update {
    margin-top: auto;
    align-self: flex-start;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--df-blue);
    text-decoration: none;
}

.stocks-form-card { margin-bottom: 20px; }

.stocks-history { padding: 0; overflow-x: auto; }
.stocks-history__table { width: 100%; border-collapse: collapse; font-size: 13px; }
.stocks-history__table th {
    text-align: left;
    font-size: 11.5px;
    text-transform: uppercase;
    color: #98A1B5;
    border-bottom: 1px solid var(--df-border-card);
    padding: 10px 14px;
}
.stocks-history__table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--df-border-divider);
}
.stocks-history__table tr:last-child td { border-bottom: none; }
.stocks-history__ongoing { color: var(--df-alert-text); font-weight: 600; }

.docs-page__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 20px;
    align-items: start;
}

.docs-list { list-style: none; padding: 0; margin: 0 0 20px; display: flex; flex-direction: column; }
.docs-list__item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    padding: 12px 0;
    border: 0;
    border-bottom: 1px solid var(--df-border-divider);
    border-radius: 0;
    background: transparent;
}
.docs-list__item:last-child { border-bottom: none; }
.docs-list__badge {
    flex: none;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10.5px;
    font-weight: 700;
    background: var(--df-blue-surface);
    color: var(--df-blue-deep);
}
.docs-list__badge--pdf { background: var(--df-alert-surface); color: var(--df-alert-text); }
.docs-list__badge--jpg, .docs-list__badge--png { background: var(--df-violet-surface); color: var(--df-violet-text); }
.docs-list__body { flex: 1; min-width: 0; }
.docs-list__name { margin: 0; font-size: 13.5px; font-weight: 600; }
.docs-list__version { font-weight: 500; color: var(--df-text-muted); }
.docs-list__meta { margin: 2px 0 0; font-size: 12px; color: var(--df-text-muted); }
.docs-list__status {
    flex: none;
    font-size: 11.5px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 999px;
}
.docs-list__status--current { background: var(--df-blue-surface); color: var(--df-blue-deep); }
.docs-list__status--archived { background: var(--df-surface-btn-secondary); color: var(--df-text-muted); }
.docs-list__download { flex: none; font-size: 12.5px; font-weight: 600; color: var(--df-blue); text-decoration: none; }

.docs-emergency-card {
    background: var(--df-gradient-emergency-mobile);
    border-radius: 18px;
    padding: 22px;
    color: var(--df-white-blue-on-dark);
}
.docs-emergency-card__eyebrow { margin: 0 0 6px; font-size: 11.5px; text-transform: uppercase; font-weight: 700; color: var(--df-blue-on-dark); }
.docs-emergency-card__name { margin: 0 0 16px; font-size: 21px; font-weight: 600; }
.docs-emergency-card__pairs { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.docs-emergency-card__pairs p { display: flex; gap: 10px; margin: 0; font-size: 13px; }
.docs-emergency-card__pairs p span:first-child { flex: 0 0 96px; color: var(--df-blue-gray-on-dark, #9FBCF2); }
.docs-emergency-card__pairs p span:last-child { flex: 1; color: var(--df-white-blue-on-dark); font-weight: 500; }
.docs-emergency-card__full-link { display: inline-block; margin-bottom: 18px; font-size: 12.5px; font-weight: 600; color: var(--df-white-blue-on-dark); }
.docs-emergency-card__qr {
    width: 62px;
    height: 62px;
    border-radius: 8px;
    background: repeating-linear-gradient(45deg, #4C86FF 0 4px, #2B5FD6 4px 8px);
    margin-bottom: 10px;
}
.docs-emergency-card__qr-note { margin: 0 0 16px; font-size: 11.5px; color: var(--df-blue-on-dark); }
.docs-emergency-card__cta {
    display: inline-block;
    background: var(--df-blue);
    color: white;
    font-size: 13px;
    font-weight: 600;
    padding: 10px 16px;
    border-radius: 10px;
    text-decoration: none;
}

/*
 * Pre-login pages (connexion, inscription, mot de passe oublié…) have no
 * design_handoff spec of their own — only the app shell's post-login
 * screens do — so this reuses the same tokens (brand mark, card, blue
 * primary) rather than leaving them on base.html.twig's bare generic
 * form styling, which read as an unstyled placeholder next to the rest
 * of the product.
 */
.auth-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding: 24px;
}
.auth-brand { display: flex; align-items: center; gap: 10px; }
.auth-brand-name { font-family: var(--df-font-heading); font-size: 18px; font-weight: 600; color: var(--df-text); }
.auth-card {
    width: 100%;
    max-width: 26rem;
    background: var(--df-surface-card);
    border: 1px solid var(--df-border-card);
    border-radius: var(--df-radius-card-lg);
    box-shadow: var(--df-shadow);
    padding: 28px;
}
.auth-card h1 { font-size: 1.5rem; margin: 0 0 1.25rem; }
.auth-card p { margin: 0 0 .75rem; }
.auth-card p:last-child { margin-bottom: 0; }
.auth-card form { border: none; padding: 0; box-shadow: none; background: none; margin: 0; }
.auth-links { display: flex; flex-direction: column; gap: 8px; align-items: center; text-align: center; }
.auth-links a { color: var(--df-blue); font-weight: 600; font-size: 13.5px; text-decoration: none; }
.auth-links a:hover { text-decoration: underline; }

/*
 * 83.25rem = 252px sidebar + .app-main-col's own 1080px floor: below that
 * total, the two can't fit side by side without forcing a horizontal
 * scrollbar. The old 75rem (1200px) threshold left a 1200-1332px dead
 * zone — a common non-maximized laptop window width — where the floor
 * was still active but didn't fit, causing the scroll to appear on every
 * page (the shell, not any single screen, is what carries this rule).
 */
@media (max-width: 83.25rem) {
    .app-main-col { min-width: 0; }
    .home-grid { grid-template-columns: 1fr; }
    .child-tiles { grid-template-columns: 1fr; }
    .profile-grid { grid-template-columns: 1fr; }
    .profile-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.brand-values { display: flex; flex-wrap: wrap; gap: 1.5rem; list-style: none; margin: 1.5rem 0 2rem; padding: 0; }
.brand-values li { display: flex; flex-direction: column; align-items: center; gap: .5rem; width: 92px; text-align: center; font-size: 12.5px; font-weight: 700; color: var(--df-text-secondary); }
.brand-values__icon { display: flex; align-items: center; justify-content: center; flex: 0 0 52px; width: 52px; height: 52px; border-radius: 50%; background: var(--df-blue-surface); color: var(--df-blue-deep); }

.billing-summary { display: grid; gap: .65rem; margin-bottom: var(--df-space); }
.billing-summary__row { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.billing-summary__label { color: var(--df-text-muted); font-weight: 600; font-size: .85rem; }
.billing-summary__value { color: var(--df-text); font-weight: 600; }

.trial-status-badge { display: inline-flex; align-items: center; padding: .25rem .75rem; border-radius: 999px; font-size: .8rem; font-weight: 700; text-transform: capitalize; }
.trial-status-badge--active { color: #17633a; background: #f0fff6; border: 1px solid #9bd6b5; }
.trial-status-badge--converted { color: var(--df-blue-deep); background: var(--df-blue-surface); border: 1px solid var(--df-blue-border); }
.trial-status-badge--expired { color: #9b1c1c; background: #fff4f4; border: 1px solid #f3b7b7; }

.billing-actions { display: flex; flex-direction: row; gap: .75rem; flex-wrap: wrap; }

/*
 * Below this width the sidebar's fixed 252px rail + sticky 100vh height
 * no longer fits alongside real content: without this, a phone-width
 * viewport squeezes .app-content into a sliver next to a full-height
 * blue column, and a "full page" screenshot tool re-captures that stuck
 * sidebar/header at every scroll position, making the page look like it
 * repeats itself. The sidebar becomes a normal, non-sticky top block
 * instead. Deliberately a narrower threshold than a typical "tablet"
 * breakpoint (768px, not 896px): a desktop browser window that simply
 * isn't maximized is still a desktop, not a phone, and 252px + readable
 * content genuinely still fits down to around this width.
 */
@media (max-width: 48rem) {
    .app-shell { flex-direction: column; }

    .app-sidebar {
        position: static;
        flex: 0 0 auto;
        width: 100%;
        height: auto;
    }

    .app-sidebar__brand-row { padding: 14px 16px; cursor: default; }
    .app-hamburger { display: flex; flex-direction: column; justify-content: center; gap: 4px; width: 22px; height: 22px; cursor: pointer; }
    .app-hamburger span { display: block; height: 2px; border-radius: 2px; background: white; transition: transform 140ms ease, opacity 140ms ease; }
    .app-sidebar__checkbox:checked ~ .app-sidebar__brand-row .app-hamburger span:nth-child(2) { opacity: 0; }
    .app-sidebar__checkbox:checked ~ .app-sidebar__brand-row .app-hamburger span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
    .app-sidebar__checkbox:checked ~ .app-sidebar__brand-row .app-hamburger span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

    /* Closed by default on mobile; only shown once the checkbox is
       checked (the hamburger label toggles it) — the opposite of the
       desktop-first default set outside this media query. */
    .app-sidebar__collapsible { display: none; margin: 0 16px 16px; }
    .app-sidebar__checkbox:checked ~ .app-sidebar__collapsible { display: flex; }

    .app-nav { flex-direction: column; }
    .app-sidebar__today { margin-top: 12px; }
    .app-sidebar__user { margin-top: 12px; }

    .app-main-col { min-width: 0; }

    .app-header {
        position: static;
        flex-wrap: wrap;
        height: auto;
        gap: 10px;
        padding: 14px 16px;
    }
    .app-child-selector { flex-wrap: wrap; }
    .app-header__actions { flex-wrap: wrap; width: 100%; }
    .app-search { flex: 1; min-width: 0; }

    .app-content { padding: 16px; }

    .home-title-row { flex-direction: column; align-items: stretch; }
    .home-title-actions { flex-wrap: wrap; }

    .bolus-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }

    .care-week { overflow-x: auto; }

    .profile-header { flex-direction: column; align-items: stretch; }
    .profile-tiles { grid-template-columns: 1fr; }

    .care-page__panels { grid-template-columns: 1fr; }
    .care-calendar__cell-name { display: none; }

    .stocks-locations { grid-template-columns: 1fr; }

    .docs-page__grid { grid-template-columns: 1fr; }
    .docs-list__item { flex-wrap: wrap; }
}
