/* ═══════════════════════════════════════════════════
   VARIABLES — Palette Canard (défaut)
═══════════════════════════════════════════════════ */
:root {
    --c-bg: #FAF7F2;
    --c-surface: #FFFFFF;
    --c-surface2: #F5F0EA;
    --c-border: #E8DFD5;
    --c-border-hi: #C5B8AB;
    --c-text: #333333;
    --c-text-2: #6B6259;
    --c-text-3: #A89C92;

    --c-accent: #1D7074;
    --c-accent-lt: rgba(29, 112, 116, 0.08);
    --c-success: #2D9E5F;
    --c-success-lt: #E5F5EC;
    --c-warn-bg: #FFFBEB;
    --c-warn-txt: #92610A;
    --c-warn-bdr: #F5C842;

    --g-header: linear-gradient(135deg, #1D7074 0%, #279198 100%);
    --g-month: linear-gradient(90deg, #1D7074 0%, #279198 100%);
    --g-btn: linear-gradient(135deg, #F4A261 0%, #F7B97E 100%);

    --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
    --r-xl: 22px;
    --r-lg: 16px;
    --r-md: 12px;
    --r-sm: 8px;
}

/* ── Couleurs Canard appliquées globalement ── */
.btn-primary {
    background: var(--g-btn) !important;
    box-shadow: 0 4px 16px rgba(244, 162, 97, 0.28) !important;
    color: white !important;
}

.total-value {
    color: #1D7074 !important;
}

.results-card {
    border-top-color: #1D7074 !important;
}

.mode-btn.active {
    border-color: #1D7074 !important;
    background: rgba(29, 112, 116, 0.08) !important;
    color: #1D7074 !important;
}

.child-label {
    color: #1D7074;
}

.child-avatar {
    color: #1D7074;
    background: rgba(29, 112, 116, 0.09);
    border-color: rgba(29, 112, 116, 0.18);
}

/* ═══════════════════════════════════════════════════
   DARK MODE — teintes Canard sombres
═══════════════════════════════════════════════════ */
[data-theme="dark"] {
    --c-bg: #0D1A1A;
    --c-surface: #122020;
    --c-surface2: #1A2E2E;
    --c-border: rgba(255, 255, 255, 0.08);
    --c-border-hi: rgba(255, 255, 255, 0.15);
    --c-text: #EDF4F4;
    --c-text-2: #89A8A8;
    --c-text-3: #4A7070;

    --c-accent: #4FB8BD;
    --c-accent-lt: rgba(79, 184, 189, 0.12);
    --c-success: #34D399;
    --c-success-lt: rgba(52, 211, 153, 0.12);
    --c-warn-bg: rgba(245, 200, 66, 0.08);
    --c-warn-txt: #FCD34D;
    --c-warn-bdr: rgba(245, 200, 66, 0.35);

    --g-header: linear-gradient(135deg, #1D5E62 0%, #226B6F 100%);
    --g-month: linear-gradient(90deg, #1D5E62 0%, #226B6F 100%);
    --g-btn: linear-gradient(135deg, #D4824A 0%, #E09A62 100%);
}

[data-theme="dark"] .btn-primary {
    box-shadow: 0 4px 16px rgba(212, 130, 74, 0.25) !important;
}

[data-theme="dark"] .total-value {
    color: #4FB8BD !important;
}

[data-theme="dark"] .results-card {
    border-top-color: #4FB8BD !important;
}

[data-theme="dark"] .mode-btn.active {
    border-color: #4FB8BD !important;
    background: rgba(79, 184, 189, 0.12) !important;
    color: #4FB8BD !important;
}

[data-theme="dark"] .child-label {
    color: #4FB8BD;
}

[data-theme="dark"] .child-avatar {
    color: #4FB8BD;
    background: rgba(79, 184, 189, 0.12);
    border-color: rgba(79, 184, 189, 0.2);
}

/* ═══════════════════════════════════════════════════
   BASE
═══════════════════════════════════════════════════ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--c-bg);
    color: var(--c-text);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    transition: background 0.3s, color 0.3s;
}

.app-container {
    max-width: 960px;
    margin: 0 auto;
    padding: 22px 16px 80px;
}

/* ═══════════════════════════════════════════════════
   HEADER
═══════════════════════════════════════════════════ */
.app-header {
    background: var(--g-header);
    border-radius: var(--r-xl);
    padding: 0 24px 26px;
    text-align: center;
    margin-bottom: 24px;
    box-shadow: 0 8px 32px rgba(29, 112, 116, 0.22);
    position: relative;
    overflow: hidden;
}

/* ── Topbar: Portail + Mode sombre ── */
.header-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0 12px;
}

.header-topbar .portal-back-btn {
    position: static;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: white;
    border-radius: 20px;
    padding: 5px 14px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    backdrop-filter: blur(8px);
    transition: background .2s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.header-topbar .portal-back-btn:hover {
    background: rgba(255, 255, 255, 0.28);
}

.header-topbar .theme-toggle {
    position: static;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: white;
    border-radius: 20px;
    padding: 5px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    backdrop-filter: blur(8px);
    transition: background .2s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.header-topbar .theme-toggle:hover {
    background: rgba(255, 255, 255, 0.28);
}

/* ── Titre ── */
.app-header h1 {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.6px;
    color: white;
    margin-top: 4px;
}

.app-header .subtitle {
    color: rgba(255, 255, 255, 0.88);
    font-size: 15px;
    font-weight: 500;
    margin-top: 4px;
}

/* ── Slogan ── */
.header-slogan {
    color: rgba(255, 255, 255, 0.55);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-top: 6px;
}

/* ── Legacy toggle (hors topbar — fallback) ── */
.theme-toggle {
    position: absolute;
    top: 14px;
    right: 14px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: white;
    border-radius: 20px;
    padding: 5px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    backdrop-filter: blur(8px);
    transition: background .2s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.28);
}

/* ═══════════════════════════════════════════════════
   NAV LINKS
═══════════════════════════════════════════════════ */
.nav-links {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 18px;
    flex-wrap: nowrap;
    padding-bottom: 2px;
}

.nav-links::-webkit-scrollbar {
    display: none;
}

.nav-btn {
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.22);
    padding: 9px 18px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    transition: all .25s ease;
    backdrop-filter: blur(8px);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.nav-icon {
    font-size: 15px;
    line-height: 1;
}

.nav-label-short {
    display: none;
}

.nav-btn:hover,
.nav-btn.active {
    background: white;
    color: var(--c-accent);
    border-color: white;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-1px);
}

@media (max-width: 500px) {
    .app-header h1 {
        font-size: 22px;
    }

    .app-header .subtitle {
        font-size: 13px;
    }

    .nav-label {
        display: none;
    }

    .nav-label-short {
        display: inline;
    }

    .nav-btn {
        padding: 8px 14px;
        font-size: 13px;
    }
}

/* ═══════════════════════════════════════════════════
   FOOTER
═══════════════════════════════════════════════════ */
.app-footer {
    text-align: center;
    padding: 20px 0 40px;
    color: var(--c-text-3);
    font-size: 13px;
    font-weight: 500;
}

/* ═══════════════════════════════════════════════════
   CARDS
═══════════════════════════════════════════════════ */
.card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-xl);
    padding: 26px;
    margin-bottom: 18px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: background .3s, border-color .3s;
}

.card h2 {
    font-size: 21px;
    font-weight: 700;
    letter-spacing: -0.4px;
    margin-bottom: 14px;
}

.card p {
    color: var(--c-text-2);
    font-size: 15px;
    margin-bottom: 10px;
}

.card p strong {
    color: var(--c-text);
}

/* ── INFO BOXES ── */
.info-box {
    background: var(--c-accent-lt);
    border: 1px solid rgba(65, 88, 208, 0.15);
    border-radius: var(--r-md);
    padding: 14px 16px;
    margin-bottom: 20px;
    font-size: 14px;
    color: var(--c-text-2);
}

.info-box strong {
    color: var(--c-accent);
}

/* Si le strong est au début (titre), on peut lui laisser son aspect bloc si besoin, 
   mais ici on privilégie le comportement inline par défaut pour la flexibilité. */
.info-box>strong:first-child {
    display: block;
    margin-bottom: 4px;
}

.info-box-neutral {
    background: var(--c-surface2);
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
    padding: 14px 16px;
    margin-bottom: 20px;
    font-size: 14px;
    color: var(--c-text-2);
}

.info-box-neutral strong {
    color: var(--c-text);
}

.warn-box {
    background: var(--c-warn-bg);
    border: 1px solid var(--c-warn-bdr);
    border-radius: var(--r-md);
    padding: 13px 15px;
    font-size: 14px;
    color: var(--c-warn-txt);
    margin-bottom: 16px;
}

/* ── TOOLTIP ── */
.tooltip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background: var(--c-text-3);
    color: var(--c-surface);
    border-radius: 50%;
    font-size: 10px;
    font-weight: 800;
    cursor: help;
    margin-left: 5px;
    flex-shrink: 0;
    vertical-align: middle;
    transition: background .2s;
}

.tooltip-icon:hover {
    background: var(--c-accent);
}

/* ═══════════════════════════════════════════════════
   MODE SELECTOR — deux boutons clairs
═══════════════════════════════════════════════════ */
.mode-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 24px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--c-border);
}

.mode-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 14px 10px;
    border: 2px solid var(--c-border);
    border-radius: var(--r-lg);
    cursor: pointer;
    background: var(--c-surface2);
    color: var(--c-text-2);
    font-family: var(--font);
    transition: all .2s ease;
    text-align: center;
}

.mode-btn:hover {
    border-color: var(--c-accent);
    background: var(--c-accent-lt);
    color: var(--c-accent);
}

.mode-btn.active {
    border-color: var(--c-accent);
    background: var(--c-accent-lt);
    color: var(--c-accent);
    box-shadow: 0 0 0 3px rgba(65, 88, 208, 0.08);
}

.mode-btn-icon {
    font-size: 22px;
    line-height: 1;
}

.mode-btn-label {
    font-size: 14px;
    font-weight: 700;
}

.mode-btn-sub {
    font-size: 12px;
    font-weight: 400;
    opacity: 0.75;
}

/* ═══════════════════════════════════════════════════
   MODE TOGGLE (gardé pour compatibilité JS)
═══════════════════════════════════════════════════ */
.mode-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--c-border);
}

#outil1-mode-label {
    font-weight: 600;
    font-size: 15px;
}

/* Apple-style toggle switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 25px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--c-border-hi);
    transition: .25s;
    border-radius: 25px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 19px;
    width: 19px;
    left: 3px;
    bottom: 3px;
    background: white;
    transition: .25s;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
}

input:checked+.slider {
    background: var(--c-accent);
}

input:checked+.slider:before {
    transform: translateX(21px);
}

/* ═══════════════════════════════════════════════════
   CHILDREN SELECTOR
═══════════════════════════════════════════════════ */
.mode-selector-help {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 25px;
}

.mode-selector-help p {
    margin-bottom: 5px;
}

.children-config {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
    background: var(--c-surface2);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    padding: 14px 18px;
    margin-bottom: 22px;
}

.children-config span {
    font-weight: 600;
    font-size: 15px;
}

.children-config select {
    padding: 8px 12px;
    border: 1px solid var(--c-border-hi);
    border-radius: var(--r-sm);
    font-size: 15px;
    font-weight: 600;
    font-family: var(--font);
    background: var(--c-surface);
    color: var(--c-text);
    cursor: pointer;
    outline: none;
    transition: border-color .2s;
}

.children-config select:focus {
    border-color: var(--c-accent);
}

/* ═══════════════════════════════════════════════════
   MONTH TABLE (Outil 1 détaillé)
═══════════════════════════════════════════════════ */
.month-table {
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    overflow: hidden;
    margin-bottom: 12px;
    background: var(--c-surface);
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.05);
    transition: box-shadow .2s;
}

.month-table:hover {
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.09);
}

.month-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--g-month);
    padding: 11px 18px;
    color: white;
    font-weight: 700;
    font-size: 15px;
}

.month-sub {
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.95);
}

/* Column header */
.month-cols-hdr {
    display: grid;
    grid-template-columns: 100px 1fr 150px;
    padding: 7px 18px;
    background: var(--c-surface2);
    border-bottom: 1px solid var(--c-border);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.07em;
    color: var(--c-text-3);
    text-transform: uppercase;
}

.month-cols-hdr span:nth-child(2) {
    text-align: center;
}

.month-cols-hdr span:nth-child(3) {
    text-align: right;
}

/* Child rows */
.child-row {
    display: grid;
    grid-template-columns: 100px 1fr 150px;
    align-items: center;
    padding: 9px 18px;
    border-bottom: 1px solid var(--c-border);
    transition: background .12s;
}

.child-row:last-of-type {
    border-bottom: none;
}

.child-row:hover {
    background: var(--c-surface2);
}

.child-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 13px;
    color: var(--c-accent);
    white-space: nowrap;
    overflow: hidden;
}

.child-avatar {
    width: 26px;
    height: 26px;
    background: var(--c-accent-lt);
    border: 1px solid rgba(65, 88, 208, 0.18);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
    color: var(--c-accent);
    flex-shrink: 0;
}

/* Days input — centré */
.days-input-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
}

.days-input {
    width: 82px;
    padding: 8px 10px;
    border: 1px solid var(--c-border-hi);
    border-radius: var(--r-sm);
    font-size: 16px;
    font-weight: 600;
    font-family: var(--font);
    text-align: center;
    background: var(--c-surface);
    color: var(--c-text);
    transition: border-color .2s, box-shadow .2s;
    -moz-appearance: textfield;
    appearance: textfield;
}

.days-input::-webkit-outer-spin-button,
.days-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
}

.days-input:focus {
    outline: none;
    border-color: var(--c-accent);
    box-shadow: 0 0 0 3px rgba(65, 88, 208, 0.1);
}

/* Sujétion — mini toggle */
.suj-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-end;
    cursor: pointer;
}

.suj-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--c-text-2);
}

.suj-toggle {
    position: relative;
    display: inline-block;
    width: 38px;
    height: 22px;
}

.suj-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.suj-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--c-border-hi);
    transition: .22s;
    border-radius: 22px;
}

.suj-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background: white;
    transition: .22s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

input:checked+.suj-slider {
    background: var(--c-success);
}

input:checked+.suj-slider:before {
    transform: translateX(16px);
}

/* ═══════════════════════════════════════════════════
   SIMPLIFIÉ GRID
═══════════════════════════════════════════════════ */
.simp-month {
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    overflow: hidden;
    margin-bottom: 10px;
    background: var(--c-surface);
}

.simp-month-header {
    background: var(--g-month);
    color: white;
    padding: 10px 18px;
    font-weight: 700;
    font-size: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.simp-month-body {
    padding: 14px 18px;
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.simp-month-body .input-group {
    flex: 1;
    min-width: 140px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.simp-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--c-text-3);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    display: flex;
    align-items: center;
}

.simp-input {
    padding: 10px 12px;
    border: 1px solid var(--c-border-hi);
    border-radius: var(--r-sm);
    font-size: 16px;
    font-family: var(--font);
    font-weight: 600;
    text-align: center;
    background: var(--c-surface);
    color: var(--c-text);
    transition: border-color .2s, box-shadow .2s;
    -moz-appearance: textfield;
    appearance: textfield;
}

.simp-input::-webkit-outer-spin-button,
.simp-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
}

.simp-input:focus {
    outline: none;
    border-color: var(--c-accent);
    box-shadow: 0 0 0 3px rgba(65, 88, 208, 0.1);
}

/* ═══════════════════════════════════════════════════
   OUTIL 2 — HEURES
═══════════════════════════════════════════════════ */
.hours-section {
    padding: 12px 18px 14px;
    background: var(--c-surface2);
    border-top: 1px solid var(--c-border);
}

.hours-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--c-text-3);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 8px;
}

.hour-item {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 8px;
    background: var(--c-surface);
    padding: 10px 12px;
    border-radius: var(--r-sm);
    border: 1px solid var(--c-border);
}

.hour-item input[type="number"] {
    width: 110px;
    padding: 8px 10px;
    border: 1px solid var(--c-border-hi);
    border-radius: var(--r-sm);
    font-size: 15px;
    font-family: var(--font);
    text-align: center;
    background: var(--c-surface);
    color: var(--c-text);
}

.hour-item input[type="number"]:focus {
    outline: none;
    border-color: var(--c-accent);
}

.hour-item label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--c-text-2);
    cursor: pointer;
}

.hour-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--c-accent);
}

.btn-delete-hour {
    margin-left: auto;
    background: none;
    border: none;
    color: #E05252;
    font-size: 18px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: background .15s;
}

.btn-delete-hour:hover {
    background: rgba(224, 82, 82, 0.1);
}

.btn-add-hour {
    width: 100%;
    margin-top: 8px;
    padding: 9px 14px;
    background: var(--c-accent-lt);
    color: var(--c-accent);
    border: 1px dashed rgba(65, 88, 208, 0.3);
    border-radius: var(--r-sm);
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: all .2s;
}

.btn-add-hour:hover {
    background: rgba(65, 88, 208, 0.12);
}

/* ═══════════════════════════════════════════════════
   RÉSULTATS
═══════════════════════════════════════════════════ */
.results-card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-top: 3px solid var(--c-accent);
    border-radius: var(--r-xl);
    padding: 26px;
    margin-bottom: 18px;
    box-shadow: 0 3px 16px rgba(0, 0, 0, 0.06);
}

.results-card h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
}

.total-block {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 0;
    border-top: 1px solid var(--c-border);
    border-bottom: 1px solid var(--c-border);
    margin: 16px 0;
    gap: 12px;
}

.total-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--c-text-2);
}

.total-value {
    font-size: 32px;
    font-weight: 800;
    color: var(--c-accent);
}

.btn-primary {
    display: block;
    width: 100%;
    padding: 15px;
    background: var(--g-btn);
    color: white;
    border: none;
    border-radius: var(--r-md);
    font-size: 15px;
    font-weight: 700;
    font-family: var(--font);
    cursor: pointer;
    transition: opacity .2s, transform .1s;
    box-shadow: 0 4px 16px rgba(65, 88, 208, 0.22);
    letter-spacing: 0.01em;
}

.btn-center {
    display: block !important;
    margin-left: auto !important;
    margin-right: auto !important;
    width: fit-content !important;
}

.btn-primary:hover {
    opacity: 0.9;
}

.btn-primary:active {
    transform: scale(0.987);
}

/* ═══════════════════════════════════════════════════
   ACCUEIL DE JOUR — LIGNE PAR MOIS (Outil 2)
═══════════════════════════════════════════════════ */
.accueil-jour-section {
    border-top: 1px dashed var(--c-border);
    margin-top: 2px;
    padding: 10px 18px 12px;
    background: rgba(29, 112, 116, 0.025);
}

[data-theme="dark"] .accueil-jour-section {
    background: rgba(79, 184, 189, 0.04);
}

.accueil-jour-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--c-text-3);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.accueil-jour-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-sm);
    padding: 8px 12px;
    margin-bottom: 6px;
}

.aj-lbl {
    flex: 1;
    min-width: 90px;
    padding: 6px 10px;
    border: 1px solid var(--c-border-hi);
    border-radius: var(--r-sm);
    font-size: 13px;
    font-family: var(--font);
    background: var(--c-surface);
    color: var(--c-text);
    outline: none;
}

.aj-lbl:focus {
    border-color: var(--c-accent);
}

/* Champ date -- compact */
.aj-date {
    padding: 6px 8px;
    border: 1px solid var(--c-border-hi);
    border-radius: var(--r-sm);
    font-size: 13px;
    font-family: var(--font);
    background: var(--c-surface);
    color: var(--c-text);
    outline: none;
    flex: 0 0 130px;
    min-width: 100px;
}

.aj-date:focus {
    border-color: var(--c-accent);
}

.aj-hrs {
    width: 72px !important;
    padding: 6px 8px !important;
    font-size: 14px !important;
}

.btn-add-accueil-jour {
    width: 100%;
    margin-top: 6px;
    padding: 7px 12px;
    background: rgba(29, 112, 116, 0.06);
    color: var(--c-accent);
    border: 1px dashed rgba(29, 112, 116, 0.3);
    border-radius: var(--r-sm);
    font-size: 12px;
    font-weight: 700;
    font-family: var(--font);
    cursor: pointer;
    transition: all .2s;
    text-align: left;
}

.btn-add-accueil-jour:hover {
    background: rgba(29, 112, 116, 0.12);
}

/* ═══════════════════════════════════════════════════
   SECTION TITLE (Outil 2)
═══════════════════════════════════════════════════ */
.section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--c-border);
}

.section-icon {
    font-size: 24px;
    line-height: 1;
    background: var(--c-surface2);
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
    padding: 8px;
    flex-shrink: 0;
}

.section-title strong {
    font-size: 16px;
    font-weight: 700;
    display: block;
}

.section-sub {
    font-size: 13px;
    color: var(--c-text-2);
    margin-top: 2px;
    display: block;
}

/* ═══════════════════════════════════════════════════
   ACCUEIL DE JOUR LIBRE (Outil 2)
═══════════════════════════════════════════════════ */
.day-accueil-item {
    background: var(--c-surface2);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    padding: 14px 16px;
    margin-bottom: 10px;
    transition: border-color .15s;
}

.day-accueil-item:hover {
    border-color: var(--c-border-hi);
}

.day-accueil-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.day-accueil-field {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 120px;
    gap: 5px;
}

.day-accueil-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--c-text-3);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    display: flex;
    align-items: center;
}

.day-accueil-field select,
.day-accueil-field input[type="text"],
.day-accueil-field input[type="number"] {
    padding: 9px 11px;
    border: 1px solid var(--c-border-hi);
    border-radius: var(--r-sm);
    font-size: 14px;
    font-family: var(--font);
    background: var(--c-surface);
    color: var(--c-text);
    outline: none;
    transition: border-color .2s;
    width: 100%;
}

.day-accueil-field select:focus,
.day-accueil-field input:focus {
    border-color: var(--c-accent);
}

.da-hrs {
    text-align: center;
    font-weight: 600;
}

.btn-add-month-accueil {
    width: 100%;
    margin-top: 6px;
    padding: 12px 16px;
    background: var(--c-accent-lt);
    color: var(--c-accent);
    border: 1px dashed rgba(65, 88, 208, 0.35);
    border-radius: var(--r-lg);
    font-size: 14px;
    font-weight: 700;
    font-family: var(--font);
    cursor: pointer;
    transition: all .2s;
}

.btn-add-month-accueil:hover {
    background: rgba(65, 88, 208, 0.12);
}

/* ═══════════════════════════════════════════════════
   INDEX / EXPLICATION PAGE
═══════════════════════════════════════════════════ */
.feature-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 8px;
}

.feature-item {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    background: var(--c-surface2);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    padding: 18px;
    transition: border-color .2s, box-shadow .2s;
}

.feature-item:hover {
    border-color: var(--c-border-hi);
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.07);
}

.feature-icon {
    font-size: 26px;
    line-height: 1;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
    padding: 9px;
    flex-shrink: 0;
}

.feature-item h4 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 4px;
}

.feature-item p {
    font-size: 14px;
    color: var(--c-text-2);
    margin: 0;
}

/* ── Tooltip on hover ── */
.tooltip-term {
    border-bottom: 1px dashed var(--c-accent);
    cursor: help;
    position: relative;
}

.tooltip-term:hover::after {
    content: attr(title);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #222;
    color: #fff;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.5;
    white-space: normal;
    width: max-content;
    max-width: 280px;
    z-index: 999;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .25);
    pointer-events: none;
}

.tooltip-term:hover::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #222;
    z-index: 999;
}

@media (max-width: 600px) {
    .feature-icon {
        display: none;
    }

    .feature-item {
        gap: 0;
    }
}

.pill {
    display: inline-block;
    margin-top: 8px;
    background: var(--c-accent-lt);
    color: var(--c-accent);
    border-radius: 20px;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 700;
}

.cta-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 12px;
    background: var(--g-btn);
    color: white;
    text-decoration: none;
    padding: 9px 18px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 14px;
    box-shadow: 0 3px 12px rgba(65, 88, 208, 0.22);
    transition: opacity .2s;
}

.cta-link:hover {
    opacity: 0.88;
}

/* ═══════════════════════════════════════════════════
   PDF
═══════════════════════════════════════════════════ */
#pdf-export-container {
    display: none;
}

#pdf-template {
    padding: 40px;
    font-family: Arial, sans-serif;
    color: #333;
    background: white;
}

#pdf-template h1 {
    font-size: 22px;
    border-bottom: 2px solid #333;
    padding-bottom: 10px;
    margin-bottom: 18px;
}

#pdf-template table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 22px;
}

#pdf-template th,
#pdf-template td {
    border: 1px solid #ccc;
    padding: 8px 10px;
    font-size: 11px;
    text-align: left;
}

#pdf-template th {
    background: #f4f4f4;
    font-weight: bold;
}

#pdf-template .pdf-total {
    font-size: 18px;
    font-weight: bold;
    text-align: right;
    margin-top: 14px;
}

#pdf-template .legal {
    font-size: 10px;
    color: #888;
    margin-top: 24px;
    padding-top: 10px;
    border-top: 1px solid #ddd;
}

/* ═══════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════ */
@media (max-width: 500px) {

    .app-container {
        padding: 12px 8px 80px;
    }

    .month-table {
        margin-bottom: 8px;
    }

    .month-cols-hdr,
    .child-row {
        grid-template-columns: 90px 1fr 100px;
        padding: 9px 10px;
    }

    .suj-label {
        display: none;
    }

    .total-value {
        font-size: 26px;
    }

    .total-block {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 360px) {
    .month-cols-hdr {
        display: none;
    }

    .app-container {
        padding: 8px 4px 80px;
    }

    .child-row {
        grid-template-columns: 80px 1fr 90px;
        gap: 4px;
        padding: 8px 6px;
    }
}

/* ── BOUTON RETOUR PORTAIL — géré dans .header-topbar ── */
/* Styles legacy (hors topbar) — conservés par sécurité */
.portal-back-btn {
    position: absolute;
    top: 14px;
    left: 14px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: white;
    border-radius: 20px;
    padding: 5px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    backdrop-filter: blur(8px);
    transition: background .2s;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.portal-back-btn:hover {
    background: rgba(255, 255, 255, 0.28);
}

.mode-guide-trigger {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    padding: 2px 8px;
    margin-top: 6px;
    font-size: 11px;
    color: var(--c-text);
    cursor: pointer;
    transition: background 0.2s;
}

.mode-guide-trigger:hover {
    background: rgba(255, 255, 255, 0.5);
}

[data-theme="dark"] .mode-guide-trigger {
    background: rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .mode-guide-trigger:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* ═══════════════════════════════════════════════════
   GUIDE INTERACTIF (ONBOARDING)
═══════════════════════════════════════════════════ */
.introjs-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9998;
    transition: opacity 0.3s;
}

.introjs-highlight {
    position: relative;
    z-index: 9999 !important;
    background: var(--c-surface);
    /* Pour s'assurer du fond sur les inputs */
    border-radius: var(--r-md);
    box-shadow: 0 0 0 4px var(--c-accent), 0 0 15px rgba(244, 162, 97, 0.5);
    pointer-events: none;
    /* L'utilisateur ne clique pas pendant le tuto */
    transition: all 0.3s ease;
}

.introjs-tooltip {
    position: absolute;
    z-index: 10000;
    background: var(--c-surface);
    color: var(--c-text);
    padding: 20px;
    border-radius: var(--r-lg);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    width: 300px;
    max-width: 90vw;
    font-size: 15px;
    border: 1px solid var(--c-border-hi);
    transition: opacity 0.3s, transform 0.3s;
}

.introjs-tooltip-title {
    font-weight: 700;
    font-size: 16px;
    color: var(--c-primary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.introjs-tooltip-desc {
    margin-bottom: 20px;
    line-height: 1.5;
}

.introjs-btn-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.introjs-skip {
    background: none;
    border: none;
    color: var(--c-text-2);
    cursor: pointer;
    font-size: 14px;
    padding: 5px;
}

.introjs-skip:hover {
    color: var(--c-text);
    text-decoration: underline;
}

.introjs-next {
    background: var(--g-btn);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

.introjs-next:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Donation block (classique + mixte) */
.donation-card {
    background: linear-gradient(140deg, #fff8ee 0%, #fffdf8 100%);
    border: 1px solid #f2d8b0;
    border-radius: var(--r-lg);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.07);
    text-align: center;
    padding: 22px 20px;
}

.donation-card h3 {
    margin: 0 0 10px;
    font-size: 30px;
    letter-spacing: -0.3px;
    color: #2c2c2c;
}

.donation-card p {
    margin: 0 auto 16px;
    max-width: 560px;
    color: var(--c-text-2);
    font-weight: 500;
    line-height: 1.55;
}

.donation-card form {
    margin: 0;
    display: flex;
    justify-content: center;
}

.donate-btn {
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, #ffb347 0%, #ff9f1c 100%);
    color: #222;
    font-weight: 800;
    font-size: 18px;
    padding: 13px 24px;
    cursor: pointer;
    box-shadow: 0 6px 14px rgba(255, 159, 28, 0.28);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.donate-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(255, 159, 28, 0.34);
    filter: brightness(1.03);
}

@media (max-width: 900px) {
    .donation-card h3 {
        font-size: 24px;
    }

    .donation-card p {
        font-size: 15px;
    }
}
