:root {
    --bg-main: #f0f2f5;
    --bg-card: #ffffff;
    --text: #333333;
    --text-muted: #666666;
    --border: #e0e0e0;
    --primary: #667eea;
    --primary-hover: #5a6fd6;
    --row-hover: #f4f4f4;
    --modal-bg: #ffffff;
    --time-label-color: #999;
    --day-cell-bg: #ffffff;
    --top-bar-bg: #667eea;
}

.dark {
    --bg-main: #121212;
    --bg-card: #1e1e1e;
    --text: #e0e0e0;
    --text-muted: #aaaaaa;
    --border: #333333;
    --primary: #7c8ef0;
    --primary-hover: #667eea;
    --row-hover: #2a2a2a;
    --modal-bg: #2d2d2d;
    --time-label-color: #777;
    --day-cell-bg: #1e1e1e;
    --top-bar-bg: #1a1a2e;
}

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

html, body { margin: 0; padding: 0; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; }
h1:focus { outline: none; }

#app-root {
    min-height: 100vh;
    background: var(--bg-main);
    color: var(--text);
    transition: background 0.3s, color 0.3s;
}

.app-loading {
    min-height: 100vh;
    background: var(--bg-main);
}

.flyout-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 999;
}

.flyout {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    background: #1e1e1e;
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.28s ease;
    will-change: transform;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 24px rgba(0,0,0,0.4);
    overscroll-behavior: contain;
}
.flyout-open { transform: translateX(0); }

.flyout-header {
    padding: 24px 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.flyout-logo-text {
    font-size: 1.6rem;
    font-weight: 700;
    color: #ffffff;
    text-align: center;
    margin-bottom: 14px;
    letter-spacing: 1px;
}

.server-badge {
    background: #2d2d2d;
    border-radius: 8px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
}
.status-dot-flyout {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    background: gray;
}
.badge-online .status-dot-flyout { background: limegreen; }
.badge-offline .status-dot-flyout { background: #f44336; }
.badge-text { color: #ccc; flex: 1; }

.btn-refresh-status {
    background: transparent;
    border: none;
    color: #aaa;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: color 0.2s;
}
.btn-refresh-status:hover { color: white; }

.flyout-items { flex: 1; padding: 10px 0; overflow-y: auto; }

.flyout-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    color: #cccccc;
    text-decoration: none;
    font-size: 1rem;
    transition: background 0.2s, color 0.2s;
    cursor: pointer;
}
.flyout-item:hover { background: #2d2d2d; color: #ffffff; }
.flyout-icon { font-size: 1.1rem; }

.flyout-footer {
    padding: 20px;
    border-top: 1px solid rgba(255,255,255,0.08);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-theme-toggle {
    background: #2d2d2d;
    color: #e0e0e0;
    border: none;
    padding: 11px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    text-align: left;
    transition: background 0.2s;
}
.btn-theme-toggle:hover { background: #3a3a3a; }

.btn-logout-flyout {
    background: #dc3545;
    color: white;
    border: none;
    padding: 13px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.95rem;
    transition: background 0.2s;
}
.btn-logout-flyout:hover { background: #c82333; }

.top-bar {
    height: 56px;
    background: var(--top-bar-bg);
    display: flex;
    align-items: center;
    padding: 0 1rem;
    gap: 1rem;
    color: white;
    position: sticky;
    top: 0;
    z-index: 200;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.btn-hamburger {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 4px;
    line-height: 1;
    transition: background 0.2s;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-hamburger:hover { background: rgba(255,255,255,0.15); }

.top-bar-title { font-size: 1.15rem; font-weight: 600; }

.user-avatar-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.5);
    background: rgba(255,255,255,0.18);
    color: white;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s, border-color 0.2s;
    touch-action: manipulation;
}
.user-avatar-btn:hover { background: rgba(255,255,255,0.32); border-color: white; }

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.22);
    min-width: 200px;
    z-index: 200;
    overflow: hidden;
}

.user-dropdown-email {
    padding: 10px 16px 6px;
    font-size: 0.78rem;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 11px 16px;
    color: var(--text);
    text-decoration: none;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
    background: none;
    text-align: left;
    transition: background 0.15s;
}
.user-dropdown-item:hover { background: var(--row-hover); }

.user-dropdown-logout {
    color: #dc3545;
    border-top: 1px solid var(--border);
}

.account-page {
    display: flex;
    justify-content: center;
    padding: 2rem 1rem;
}

.account-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 2rem;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.account-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.8rem;
    padding-bottom: 1.2rem;
    border-bottom: 1px solid var(--border);
}

.account-avatar-large {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    font-size: 1.6rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.account-title {
    margin: 0 0 4px;
    font-size: 1.25rem;
    color: var(--text);
}

.account-email-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    word-break: break-all;
}

.account-section { margin-bottom: 1.6rem; }

.account-section-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.8rem;
}

.lang-buttons {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.btn-lang {
    padding: 9px 18px;
    border-radius: 8px;
    border: 2px solid var(--border);
    background: var(--bg-main);
    color: var(--text);
    font-size: 0.92rem;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.btn-lang:hover { border-color: var(--primary); }
.btn-lang-active {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
    font-weight: 600;
}

.lang-saved-msg {
    margin-top: 0.7rem;
    font-size: 0.88rem;
    color: #28a745;
    font-weight: 500;
}

.btn-account-back {
    margin-top: 0.5rem;
    background: none;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s, color 0.2s;
}
.btn-account-back:hover { background: var(--row-hover); color: var(--text); }

.main-wrapper { min-height: 100vh; display: flex; flex-direction: column; }
.content-area { flex: 1; }

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.dark .login-container {
    background: var(--bg-main);
}

.btn-theme-flottant {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 200;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--bg-card);
    color: var(--text);
    font-size: 1.1rem;
    cursor: pointer;
    touch-action: manipulation;
}

.login-card {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
    width: 100%;
    max-width: 400px;
}

.login-title { text-align: center; font-size: 2rem; margin-bottom: 0.5rem; color: var(--text); }
.login-subtitle { text-align: center; color: var(--text-muted); margin-bottom: 1.5rem; }

.oauth-buttons { display: flex; flex-direction: column; gap: 0.75rem; }
.btn-oauth { display: block; padding: 0.75rem; border-radius: 8px; text-align: center; text-decoration: none; font-weight: 600; transition: opacity 0.2s; }
.btn-oauth:hover { opacity: 0.88; }
.btn-google { background-color: #4285F4; color: white; }
.btn-microsoft { background-color: #00A4EF; color: white; }

.separator { text-align: center; margin: 1rem 0; position: relative; }
.separator::before, .separator::after { content: ""; position: absolute; top: 50%; width: 40%; height: 1px; background: var(--border); }
.separator::before { left: 0; }
.separator::after { right: 0; }
.separator span { background: var(--bg-card); padding: 0 0.5rem; color: var(--text-muted); }

.tab-buttons { display: flex; margin-bottom: 1rem; }
.tab-buttons button { flex: 1; padding: 0.5rem; border: 1px solid var(--border); background: var(--bg-main); color: var(--text); cursor: pointer; }
.tab-buttons button.active { background: #667eea; color: white; border-color: #667eea; }

.form-group { display: flex; flex-direction: column; gap: 0.75rem; }
.form-input { padding: 0.75rem; border: 1px solid var(--border); border-radius: 8px; font-size: 1rem; background: var(--bg-main); color: var(--text); }

.btn-submit { padding: 0.75rem; background: #667eea; color: white; border: none; border-radius: 8px; font-size: 1rem; cursor: pointer; font-weight: 600; }
.btn-submit:hover { background: #5a6fd6; }
.btn-submit:disabled { opacity: 0.6; cursor: not-allowed; }

.error-message { color: #d32f2f; text-align: center; margin-top: 0.5rem; }
.success-message { color: #2e7d32; text-align: center; margin-top: 0.5rem; line-height: 1.5; }

.login-link { text-align: center; margin-top: 1rem; font-size: 0.9rem; }
.login-link a { color: #667eea; text-decoration: none; }
.login-link a:hover { text-decoration: underline; }

.forgot-hint { color: var(--text-muted); font-size: 0.9rem; line-height: 1.5; text-align: center; margin-bottom: 1rem; }
.forgot-sent { text-align: center; margin-bottom: 1rem; }
.forgot-icon { font-size: 2.5rem; display: block; margin-bottom: 0.75rem; }

.calendar-container { max-width: 1200px; margin: 0 auto; padding: 1rem; }

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.nav-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: background 0.2s;
}
.nav-btn:hover { background: var(--primary-hover); }

.week-title-group { display: flex; flex-direction: column; align-items: center; text-align: center; flex: 1; }
.week-title { user-select: none; text-transform: capitalize; color: var(--text); font-size: 1.1rem; margin: 0; }
.period-dates-sub { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }

.view-mode-bar {
    display: flex;
    gap: 4px;
    margin-bottom: 0.75rem;
    background: var(--bg-card);
    border-radius: 10px;
    padding: 4px;
    border: 1px solid var(--border);
}

.view-btn {
    flex: 1;
    padding: 8px 4px;
    border: none;
    border-radius: 7px;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.view-btn:hover { background: var(--row-hover); color: var(--text); }
.view-btn.active { background: var(--primary); color: white; }

.period-label {
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 20px;
    margin-bottom: 0.5rem;
    background: var(--primary);
    color: white;
    display: inline-block;
    width: 100%;
    box-sizing: border-box;
    letter-spacing: 0.3px;
}
.period-label--holiday {
    background: #FF9800;
    color: #1a1a1a;
}

.print-bar { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem; flex-wrap: wrap; }
.print-btn {
    padding: 0.3rem 0.75rem; border: 1px solid var(--border); border-radius: 6px;
    background: var(--bg-card); color: var(--text); font-size: 0.85rem; cursor: pointer;
    transition: background 0.15s;
}
.print-btn:hover { background: var(--row-hover); }
.print-hint { font-size: 0.75rem; color: var(--text-muted); }

.report-bar { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem; flex-wrap: wrap; }
.report-btn {
    padding: 0.3rem 0.75rem; border: 1px solid #7E57C2; border-radius: 6px;
    background: var(--bg-card); color: #7E57C2; font-size: 0.85rem; font-weight: 600;
    cursor: pointer; transition: background 0.15s, color 0.15s;
}
.report-btn:hover:not(:disabled) { background: #7E57C2; color: #fff; }
.report-btn:disabled { opacity: 0.45; cursor: default; }
.report-hint { font-size: 0.75rem; color: var(--text-muted); }

.report-flash {
    display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
    padding: 0.4rem 0.7rem; margin-bottom: 0.75rem;
    border: 1px solid #7E57C2; border-left: 4px solid #7E57C2; border-radius: 6px;
    background: rgba(126, 87, 194, 0.12); color: var(--text); font-size: 0.85rem;
}
.report-flash-close {
    border: none; background: transparent; color: var(--text-muted);
    cursor: pointer; font-size: 0.9rem; line-height: 1; padding: 0 2px;
}
.report-flash-close:hover { color: var(--text); }

.modal-report {
    display: flex; flex-direction: column; gap: 0.35rem;
    margin-bottom: 0.75rem;
}
.btn-report-toggle {
    align-self: flex-start;
    padding: 0.3rem 0.7rem; border: 1px solid #7E57C2; border-radius: 6px;
    background: transparent; color: #7E57C2; font-size: 0.85rem; font-weight: 600; cursor: pointer;
}
.btn-report-toggle:hover { background: rgba(126, 87, 194, 0.15); }
.report-deja { font-size: 0.75rem; color: #7E57C2; font-weight: 600; }
.report-panel {
    display: flex; flex-direction: column; gap: 0.4rem;
    padding: 0.5rem; border: 1px solid var(--border); border-radius: 8px;
    background: var(--bg-main);
}
.report-cible { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.report-cible label { font-size: 0.85rem; color: var(--text-muted); }
.report-cible-lundi { font-size: 0.75rem; color: var(--text-muted); }
.report-raccourcis { display: flex; align-items: center; gap: 0.25rem; flex-wrap: wrap; }
.report-raccourcis-label { font-size: 0.75rem; color: var(--text-muted); margin-right: 0.15rem; }
.report-warn {
    margin: 0; font-size: 0.78rem; color: #E65100;
    background: rgba(255, 152, 0, 0.12); border-radius: 6px; padding: 0.3rem 0.5rem;
}
.dark .report-warn { color: #FFB74D; }
.btn-report { align-self: flex-start; }

.report-modal { max-width: 520px; }
.report-liste {
    max-height: 40vh; overflow-y: auto;
    display: flex; flex-direction: column; gap: 0.5rem;
    margin: 0.5rem 0; padding-right: 2px;
}
.report-jour { display: flex; flex-direction: column; gap: 2px; }
.report-jour-titre {
    font-size: 0.78rem; font-weight: 700; color: var(--text);
    text-transform: capitalize;
}
.report-jour-fleche { font-weight: 400; color: #7E57C2; margin-left: 0.3rem; }
.report-ligne {
    display: flex; align-items: baseline; gap: 0.4rem;
    padding: 2px 4px; border-radius: 4px; cursor: pointer; font-size: 0.8rem;
}
.report-ligne:hover { background: var(--row-hover); }
.report-ligne-heure { color: #E65100; font-weight: 600; white-space: nowrap; }
.dark .report-ligne-heure { color: #FFB74D; }
.report-ligne-texte { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.copie-btn {
    padding: 0.3rem 0.75rem; border: 1px solid #00897B; border-radius: 6px;
    background: var(--bg-card); color: #00897B; font-size: 0.85rem; font-weight: 600;
    cursor: pointer; transition: background 0.15s, color 0.15s;
}
.copie-btn:hover:not(:disabled) { background: #00897B; color: #fff; }
.copie-btn:disabled { opacity: 0.45; cursor: default; }

.modal-report-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.btn-copie-toggle {
    padding: 0.3rem 0.7rem; border: 1px solid #00897B; border-radius: 6px;
    background: transparent; color: #00897B; font-size: 0.85rem; font-weight: 600; cursor: pointer;
}
.btn-copie-toggle:hover { background: rgba(0, 137, 123, 0.15); }

.copie-modal { max-width: 560px; }
.copie-ajout { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 0.4rem; }
.copie-ajout label { font-size: 0.85rem; color: var(--text-muted); }

.copie-chips {
    display: flex; flex-wrap: wrap; gap: 0.3rem;
    margin: 0.5rem 0; padding: 0.4rem;
    border: 1px dashed var(--border); border-radius: 8px; min-height: 2rem;
}
.copie-vide { font-size: 0.78rem; color: var(--text-muted); align-self: center; }
.copie-chip {
    display: inline-flex; align-items: center; gap: 0.3rem;
    padding: 2px 6px 2px 9px; border-radius: 999px;
    background: rgba(0, 137, 123, 0.15); border: 1px solid #00897B; color: #00897B;
    font-size: 0.78rem; font-weight: 600; white-space: nowrap;
}
.copie-chip-conge { background: rgba(255, 152, 0, 0.18); border-color: #FB8C00; color: #E65100; }
.dark .copie-chip { color: #4DB6AC; }
.dark .copie-chip-conge { color: #FFB74D; }
.copie-chip-x {
    border: none; background: transparent; color: inherit;
    cursor: pointer; font-size: 0.7rem; line-height: 1; padding: 0 1px;
}
.copie-chip-x:hover { color: #f44336; }

.note-reporte {
    display: block; font-size: 0.72rem; font-weight: 700; color: #7E57C2; margin-bottom: 2px;
}
.note-block-reporte { border-left: 4px solid #7E57C2; }
.mini-reporte { display: block; font-weight: 700; color: #7E57C2; }
.note-mini-reporte { border-left: 3px solid #7E57C2; }
.dark .note-reporte, .dark .mini-reporte, .dark .report-deja, .dark .report-jour-fleche { color: #B39DDB; }

.identite-modal { max-width: 420px; }
.identite-champ { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.6rem; }
.identite-champ label { width: 70px; font-size: 0.85rem; color: var(--text-muted); }
.identite-champ input {
    flex: 1; padding: 5px 8px; border: 1px solid var(--border); border-radius: 6px;
    background: var(--bg-main); color: var(--text); font-size: 0.9rem;
}

.print-header { display: none; }

.day-holiday-banner {
    text-align: center;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 5px 12px;
    margin-bottom: 0.5rem;
    border: 1px solid;
    border-radius: 8px;
}

.single-day-header { text-align: center; margin-bottom: 0.35rem; line-height: 1.15; }
.day-name { display: block; text-transform: capitalize; color: var(--text-muted); font-size: 0.9rem; }
.day-number { display: block; font-size: 1.9rem; font-weight: bold; color: var(--text); }

.time-grid {
    display: grid;
    grid-template-columns: 60px 1fr;
    grid-auto-rows: minmax(60px, auto);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-card);
}

.time-label {
    grid-column: 1;
    padding: 0.5rem;
    font-size: 0.8rem;
    color: var(--time-label-color);
    border-right: 1px solid var(--border);
    border-bottom: 1px dashed var(--border);
}

.time-cell {
    grid-column: 2;
    display: flex;
    flex-direction: column;
    padding: 0.25rem 0.5rem;
    border-bottom: 1px dashed var(--border);
    cursor: pointer;
    transition: background 0.15s;
    position: relative;
}
.time-cell:hover { background: var(--row-hover); }

.course-block { padding: 0.5rem; border-radius: 6px; color: white; margin-bottom: 2px; }
.course-name { font-weight: bold; font-size: 0.9rem; display: block; }
.course-time { font-size: 0.75rem; opacity: 0.85; display: block; }

.note-block { flex: 1; background: #FFF3E0; border: 1px solid #FF9800; border-radius: 4px; padding: 0.25rem 0.5rem; font-size: 0.8rem; color: #E65100; cursor: pointer; }
.dark .note-block { background: #2d1f0a; border-color: #FF9800; color: #FFB74D; }

.grid-header { display: flex; gap: 2px; margin-bottom: 4px; }
.grid-header-cell { flex: 1; text-align: center; font-weight: 600; font-size: 0.85rem; text-transform: capitalize; color: var(--text-muted); }
.days-grid { display: grid; gap: 2px; }

.day-cell { background: var(--day-cell-bg); border-radius: 6px; padding: 0.5rem; min-height: 80px; cursor: pointer; border: 1px solid var(--border); transition: box-shadow 0.2s; }
.day-cell:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.15); }
.day-cell.today { border-color: var(--primary); border-width: 2px; }
.day-cell.holiday { background: #FFF3E0; }
.dark .day-cell.holiday { background: #2a1800; }
.day-cell.school-start { background: #E8F5E9; }
.dark .day-cell.school-start { background: #0d2d10; }
.day-cell.out-of-period { opacity: 0.25; pointer-events: none; }

.day-num { font-weight: bold; font-size: 1.1rem; color: var(--text); }
.holiday-name { display: block; font-size: 0.7rem; color: #E65100; }
.course-mini { font-size: 0.65rem; color: white; padding: 1px 4px; border-radius: 3px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-mini { font-size: 0.65rem; color: #E65100; background: #FFF3E0; padding: 1px 4px; border-radius: 3px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dark .note-mini { background: #2d1f0a; color: #FFB74D; }

.note-mini-week { white-space: normal; padding: 3px 5px; line-height: 1.35; }
.note-mini-week .mini-time { display: block; font-weight: 700; }
.mini-course { display: block; font-weight: 600; color: #4CAF50; }
.mini-text { display: block; }

.course-mini .mini-time { font-weight: 700; opacity: 0.85; margin-right: 3px; }
.trim-note-dot { font-size: 0.7rem; line-height: 1; display: block; margin-top: 1px; }

.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.55); display: flex; justify-content: center; align-items: center; z-index: 1000; }

.modal-content { background: var(--modal-bg); color: var(--text); padding: 1.5rem; border-radius: 12px; width: 90%; max-width: 400px; box-shadow: 0 8px 32px rgba(0,0,0,0.3); }
.modal-content h3 { margin-top: 0; color: var(--text); }

.modal-content textarea { width: 100%; padding: 0.5rem; border: 1px solid var(--border); border-radius: 8px; resize: vertical; font-family: inherit; box-sizing: border-box; background: var(--bg-main); color: var(--text); }

.modal-buttons { display: flex; gap: 0.5rem; margin-top: 1rem; }
.btn-save { background: #4CAF50; color: white; border: none; padding: 0.5rem 1rem; border-radius: 6px; cursor: pointer; }
.btn-delete { background: #f44336; color: white; border: none; padding: 0.5rem 1rem; border-radius: 6px; cursor: pointer; }
.btn-cancel { background: #9e9e9e; color: white; border: none; padding: 0.5rem 1rem; border-radius: 6px; cursor: pointer; }
.btn-save:disabled { opacity: 0.45; cursor: not-allowed; }

.modal-date { margin: -0.5rem 0 0.75rem; font-size: 0.85rem; color: var(--text-muted); text-transform: capitalize; }
.modal-time-range { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem; }
.modal-time-range label { font-size: 0.85rem; color: var(--text-muted); }
.modal-time-range select { padding: 0.3rem 0.5rem; border-radius: 6px; border: 1px solid var(--border); background: var(--bg-main); color: var(--text); font-size: 0.9rem; cursor: pointer; }

.time-box {
    display: inline-flex; align-items: center; gap: 1px;
    padding: 2px 5px; border: 1px solid var(--border); border-radius: 6px;
    background: var(--bg-main);
}
.tb-num {
    width: 2.1ch; padding: 0; border: none; background: transparent;
    color: var(--text); font-size: 0.95rem; text-align: center;
}
.tb-num:focus { outline: none; }
.tb-colon { color: var(--text); font-size: 0.95rem; padding: 0 2px; }
.tb-spin { display: inline-flex; flex-direction: column; }
.tb-arrow {
    width: 15px; height: 9px; padding: 0; line-height: 1;
    border: none; background: transparent; color: var(--text-muted);
    cursor: pointer; font-size: 0.5rem; user-select: none;
    display: flex; align-items: center; justify-content: center;
}
.tb-arrow:hover { color: var(--text); }
.modal-repeat {
    display: flex; flex-direction: column; gap: 0.4rem;
    padding: 0.5rem; margin-bottom: 0.75rem;
    border: 1px solid var(--border); border-radius: 8px;
    background: var(--bg-main);
}
.modal-repeat-dates { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.modal-repeat-dates label { font-size: 0.85rem; color: var(--text-muted); }
.date-box {
    padding: 2px 5px; border: 1px solid var(--border); border-radius: 6px;
    background: var(--bg-card); color: var(--text); font-size: 0.9rem;
}
.modal-repeat-days { display: flex; gap: 0.25rem; flex-wrap: wrap; }
.dow-btn {
    padding: 3px 9px; border: 1px solid var(--border); border-radius: 999px;
    background: var(--bg-card); color: var(--text-muted);
    font-size: 0.8rem; cursor: pointer; transition: background 0.15s, color 0.15s;
}
.dow-btn:hover { color: var(--text); }
.dow-btn.active { background: #4CAF50; border-color: #4CAF50; color: #fff; font-weight: 600; }.modal-repeat-count { font-size: 0.75rem; color: var(--text-muted); }

.modal-char-count { text-align: right; font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }
.modal-error { color: #f44336; font-size: 0.8rem; margin-top: 0.5rem; }

.note-modal-wrap { display: flex; align-items: stretch; gap: 0.75rem; max-width: 96vw; }
.note-modal-wrap .modal-content { flex: 0 1 380px; width: 380px; max-width: 90vw; }

.modal-header-row { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.modal-header-row h3 { margin: 0; }
.btn-cascade-toggle {
    background: transparent; color: var(--text); border: 2px solid var(--text);
    padding: 0.3rem 0.7rem; border-radius: 6px; cursor: pointer;
    font-weight: 600; font-size: 0.85rem; white-space: nowrap;
}
.btn-cascade-toggle:hover { background: var(--text); color: var(--modal-bg); }

.cascade-panel {
    position: relative; background: var(--modal-bg); color: var(--text);
    border-radius: 12px; box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    padding: 1.25rem; flex: 1 1 440px; min-width: 300px; max-width: 560px;
    max-height: 85vh; overflow-y: auto;
}
.cascade-back {
    position: absolute; top: 0.6rem; left: 0.6rem;
    width: 34px; height: 34px; border-radius: 50%;
    border: 2px solid var(--text); background: transparent; color: var(--text);
    font-size: 1rem; line-height: 1; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.cascade-back:hover { background: var(--text); color: var(--modal-bg); }

.cascade-selector { margin-top: 2.2rem; display: flex; flex-direction: column; gap: 0.7rem; }
.cascade-field { display: flex; flex-direction: column; gap: 0.2rem; }
.cascade-field label { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); }
.cascade-field select {
    padding: 0.4rem 0.5rem; border-radius: 6px; border: 1px solid var(--border);
    background: var(--bg-main); color: var(--text); font-size: 0.9rem; cursor: pointer;
    max-width: 100%;
}
.cascade-field-lm select { border-color: #6ea8fe; }
.cascade-field-lm .ss-input { border-color: #6ea8fe; }

.ss-root { position: relative; }
.ss-input {
    width: 100%; box-sizing: border-box;
    padding: 0.4rem 1.6rem 0.4rem 0.5rem;
    border-radius: 6px; border: 1px solid var(--border);
    background: var(--bg-main); color: var(--text); font-size: 0.9rem;
    cursor: pointer; text-overflow: ellipsis;
}
.ss-input:focus { outline: none; border-color: #6ea8fe; cursor: text; }
.ss-input::placeholder { color: var(--text-muted); }
.ss-arrow {
    position: absolute; right: 0.5rem; top: 50%; transform: translateY(-50%);
    pointer-events: none; color: var(--text-muted); font-size: 0.75rem;
}
.ss-list {
    position: absolute; z-index: 40; top: calc(100% + 2px); left: 0; right: 0;
    min-width: 100%; width: max-content; max-width: min(90vw, 620px);
    max-height: 340px; overflow-y: auto;
    scrollbar-width: auto;
    background: var(--bg-main); color: var(--text);
    border: 1px solid var(--border); border-radius: 6px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.35);
}
.ss-item {
    padding: 0.35rem 0.5rem; font-size: 0.88rem; cursor: pointer;
    line-height: 1.3;
}
.ss-item-active { background: rgba(110,168,254,0.18); }
.ss-item-selected { font-weight: 600; color: #6ea8fe; }
.ss-empty { padding: 0.4rem 0.5rem; font-size: 0.82rem; color: var(--text-muted); font-style: italic; }
.ss-item-ajout { color: #6ea8fe; font-weight: 600; border-bottom: 1px solid var(--border); }
.ss-item-ajout:hover { background: rgba(110,168,254,0.22); }
.ss-list::-webkit-scrollbar { width: 14px; }
.ss-list::-webkit-scrollbar-track { background: transparent; }
.ss-list::-webkit-scrollbar-thumb {
    background: var(--border); border-radius: 7px;
    border: 3px solid var(--bg-main);
}
.ss-list::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
.ms-root { display: flex; flex-direction: column; gap: 0.35rem; }
.ms-search {
    width: 100%; box-sizing: border-box;
    padding: 0.4rem 0.5rem; border-radius: 6px; border: 1px solid var(--border);
    background: var(--bg-main); color: var(--text); font-size: 0.88rem;
}
.ms-search:focus { outline: none; border-color: #6ea8fe; }
.ms-search::placeholder { color: var(--text-muted); }

.ms-tags { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.ms-tag {
    display: inline-flex; align-items: center; gap: 0.3rem;
    padding: 0.15rem 0.45rem; border-radius: 999px; cursor: pointer;
    border: 1px solid #4CAF50; background: rgba(76,175,80,0.16);
    color: var(--text); font-size: 0.78rem; line-height: 1.35; text-align: left;
}
.ms-tag:hover { background: rgba(244,67,54,0.18); border-color: #f44336; }
.ms-tag-x { color: var(--text-muted); font-size: 0.7rem; }

.ms-list {
    max-height: 240px; overflow-y: auto;
    border: 1px solid var(--border); border-radius: 6px;
    background: var(--bg-main); padding: 0.2rem;
    scrollbar-width: auto;
}
.ms-list::-webkit-scrollbar { width: 14px; }
.ms-list::-webkit-scrollbar-track { background: transparent; }
.ms-list::-webkit-scrollbar-thumb {
    background: var(--border); border-radius: 7px; border: 3px solid var(--bg-main);
}
.ms-list::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
.ms-item {
    display: flex; align-items: flex-start; gap: 0.4rem;
    padding: 0.32rem 0.4rem; border-radius: 4px; cursor: pointer;
    font-size: 0.88rem; line-height: 1.3;
}
.ms-item:hover { background: rgba(110,168,254,0.14); }
.ms-item-selected { background: rgba(76,175,80,0.14); font-weight: 600; }
.ms-item-selected:hover { background: rgba(76,175,80,0.22); }
.ms-check { flex: 0 0 0.9rem; color: #4CAF50; font-weight: 700; }
.ms-empty { padding: 0.4rem 0.5rem; font-size: 0.82rem; color: var(--text-muted); font-style: italic; }
.ms-item-ajout { color: #6ea8fe; font-weight: 600; border-bottom: 1px solid var(--border); }
.ms-item-ajout:hover { background: rgba(110,168,254,0.22); }
.ms-item-ajout .ms-check { color: #6ea8fe; }

.cascade-completion {
    display: flex; flex-direction: column; gap: 0.15rem;
    padding: 0.4rem 0.5rem; border-radius: 6px;
    background: rgba(110,168,254,0.08); border: 1px solid rgba(110,168,254,0.25);
}

.cascade-elargir {
    align-self: flex-start;
    background: none; border: none; padding: 0; cursor: pointer;
    color: #6ea8fe; font-size: 0.78rem; text-align: left;
}
.cascade-elargir:hover { text-decoration: underline; }
.cascade-elargir-note { color: var(--text-muted); font-size: 0.75rem; line-height: 1.35; }

.cascade-ordre { display: flex; gap: 0.75rem; }
.cascade-ordre .cascade-elargir { padding: 0.15rem 0.6rem; border: 1px solid rgba(110,168,254,0.35); border-radius: 6px; }
.cascade-ordre .cascade-elargir.active { background: rgba(110,168,254,0.18); font-weight: 600; }

.cascade-aptitudes { margin-top: 0.5rem; display: flex; flex-direction: column; gap: 0.2rem; }
.cascade-aptitudes > label { font-size: 0.82rem; }

.cascade-opt { font-weight: 400; color: var(--text-muted); }
.cascade-error { color: #f44336; font-size: 0.8rem; margin-bottom: 0.5rem; }
.cascade-recap { margin-top: 0.9rem; padding: 0.5rem 0.6rem; border-radius: 6px; background: rgba(76,175,80,0.12); color: var(--text); font-size: 0.82rem; }
.cascade-recap-muted { background: rgba(255,255,255,0.06); color: var(--text-muted); }
.cascade-recap-titre { font-weight: 600; margin-bottom: 0.25rem; }
.note-visee-recap { display: block; white-space: pre-wrap; line-height: 1.4; }

@media (max-width: 520px) {
    .note-modal-wrap { flex-direction: column; align-items: center; overflow-y: auto; max-height: 95vh; }
    .note-modal-wrap .modal-content { flex: 0 0 auto; }
    .cascade-panel { flex: 0 0 auto; width: 90vw; max-width: 90vw; }
}

.note-time { display: block; font-size: 0.7rem; font-weight: 600; opacity: 0.75; margin-bottom: 2px; }
.note-titre { margin-left: 8px; font-size: 0.85rem; font-weight: 700; color: #ffb74d; }
.note-titre-input { display: block; width: 100%; box-sizing: border-box; margin-bottom: 8px; }
.note-visee { display: block; font-size: 0.72rem; font-weight: 600; color: #4CAF50; margin-bottom: 2px; white-space: pre-wrap; line-height: 1.35; }

.trim-loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-style: italic;
}

.trimestre-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-card);
}

.trimestre-table {
    display: flex;
    width: 100%;
}

.trim-col {
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border);
    min-width: 86px;
    flex: 1;
}
.trim-col:last-child { border-right: none; }

.trim-col-fixed {
    min-width: 42px;
    max-width: 42px;
    position: sticky;
    left: 0;
    z-index: 3;
    background: var(--bg-card);
    border-right: 2px solid var(--border);
}

.trim-col-holiday {
    min-width: 52px;
    background: #1a1a3e;
}
.dark .trim-col-holiday { background: #0e0e28; }

.trim-cell {
    min-height: 58px;
    padding: 3px;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
    box-sizing: border-box;
    cursor: pointer;
    transition: background 0.15s;
}
.trim-cell:hover { background: var(--row-hover); }

.trim-cell-header {
    min-height: 36px;
    background: var(--primary);
    color: white;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: default;
}
.trim-cell-header:hover { background: var(--primary); }

.trim-corner {
    background: var(--bg-card);
    border-bottom: 2px solid var(--border);
}
.trim-corner:hover { background: var(--bg-card); }

.trim-cell-day {
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    cursor: default;
    background: var(--bg-card);
}
.trim-cell-day:hover { background: var(--bg-card); }

.trim-week-num { font-size: 0.7rem; font-weight: 700; display: block; }
.trim-week-date { font-size: 0.55rem; display: block; opacity: 0.85; white-space: nowrap; }

.trim-cell-holiday-span {
    flex: 1;
    color: rgba(255,255,255,0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 6px 0;
    cursor: default;
    border-bottom: none;
}

.trim-cell-hol {
    background: rgba(180, 50, 50, 0.18);
}
.dark .trim-cell-hol { background: rgba(120, 30, 30, 0.4); }

.trim-conge {
    font-size: 0.65rem;
    font-weight: 700;
    color: #c62828;
    text-align: center;
    width: 100%;
}

.trim-cell-today {
    background: rgba(102, 126, 234, 0.15) !important;
    border-left: 2px solid var(--primary);
}

.trim-cell-out {
    opacity: 0.2;
    pointer-events: none;
}

.trim-course {
    font-size: 0.58rem;
    color: white;
    padding: 1px 3px;
    border-radius: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
    box-sizing: border-box;
}

#blazor-error-ui { background: lightyellow; bottom: 0; box-shadow: 0 -1px 2px rgba(0,0,0,0.2); display: none; left: 0; padding: 0.6rem 1.25rem 0.7rem; position: fixed; width: 100%; z-index: 1000; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 0.75rem; top: 0.5rem; }

.loading-progress { position: relative; display: block; width: 8rem; height: 8rem; margin: 20vh auto 1rem auto; }
.loading-progress circle { fill: none; stroke: #e0e0e0; stroke-width: 0.6rem; transform-origin: 50% 50%; transform: rotate(-90deg); }
.loading-progress circle:last-child { stroke: #1b6ec2; stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%; transition: stroke-dasharray 0.05s ease-in-out; }
.loading-progress-text { position: absolute; text-align: center; font-weight: bold; inset: calc(20vh + 3.25rem) 0 auto 0.2rem; }
.loading-progress-text:after { content: var(--blazor-load-percentage-text, "Loading"); }

@media (max-width: 768px) {
    .calendar-container { padding: 0.5rem; }
    .day-cell { min-height: 60px; padding: 0.25rem; }
    .day-num { font-size: 0.9rem; }

    .view-mode-bar { padding: 3px; gap: 2px; }
    .view-btn { padding: 6px 2px; font-size: 0.72rem; }

    .nav-btn { padding: 0.4rem 0.7rem; font-size: 1rem; }
    .week-title { font-size: 0.9rem; }
    .period-dates-sub { font-size: 0.68rem; }

    .trim-col { min-width: 64px; }
    .trim-col-fixed { min-width: 36px; max-width: 36px; }
    .trim-cell { min-height: 48px; }
    .trim-cell-header { min-height: 32px; }
    .trim-cell-day { font-size: 0.65rem; }
    .trim-week-num { font-size: 0.62rem; }
    .trim-week-date { font-size: 0.5rem; }
}

.access-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg-main, #1a1a2e);
    padding: 1rem;
}

.access-card {
    background: var(--bg-card, #16213e);
    border-radius: 16px;
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    text-align: center;
}

.access-icon {
    font-size: 3rem;
    margin-bottom: 0.75rem;
}

.access-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 0.4rem 0;
}

.access-subtitle {
    color: var(--text-muted, #888);
    font-size: 0.95rem;
    margin: 0 0 1.8rem 0;
}

.access-form {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.access-input {
    background: var(--bg-main);
    border: 1px solid var(--border, #2a2a4a);
    border-radius: 8px;
    color: var(--text);
    font-size: 1rem;
    padding: 0.75rem 1rem;
    text-align: center;
    letter-spacing: 0.12em;
    outline: none;
    transition: border-color 0.2s;
}

.access-input:focus {
    border-color: #4a9eff;
}

.access-input-error {
    border-color: #e74c3c !important;
}

.access-error {
    color: #e74c3c;
    font-size: 0.85rem;
}

.access-card-offres {
    max-width: 900px;
    padding: 0;
    overflow: hidden;
}

.access-hero {
    background: linear-gradient(120deg, #4a9eff, #6c63ff 55%, #b06cff);
    padding: 2.5rem 1.5rem 4.5rem;
}

.access-langues {
    display: flex;
    justify-content: flex-end;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
}

.btn-access-langue {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.5);
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.3rem 0.6rem;
    touch-action: manipulation;
}

.btn-access-langue-actif {
    background: #fff;
    border-color: #fff;
    color: #6c63ff;
}

.access-hero .access-title {
    color: #fff;
    font-size: 2.4rem;
}

.access-hero .access-subtitle {
    color: rgba(255,255,255,0.9);
    margin: 0;
}

.access-dev-bandeau {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    max-width: 560px;
    margin: 0.8rem auto 1.2rem;
    padding: 0.8rem 1rem;
    background: rgba(22,33,62,0.35);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 12px;
    color: #fff;
    font-size: 0.85rem;
    line-height: 1.45;
    text-align: left;
}

.access-dev-icone {
    font-size: 1.4rem;
    line-height: 1;
}

.access-dev-titre {
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 0.2rem;
}

.access-dev-mention {
    margin-top: 0.3rem;
    font-weight: 600;
    color: rgba(255,255,255,0.85);
}

.access-offre-fictif {
    margin: -0.5rem 0 1rem;
    padding: 0.15rem 0.6rem;
    border: 1px solid var(--border, #2a2a4a);
    border-radius: 999px;
    color: var(--text-muted, #888);
    font-size: 0.72rem;
    letter-spacing: 0.03em;
}

.access-offres {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: -2.5rem;
    padding: 2rem 2rem 2.5rem;
    background: var(--bg-card, #16213e);
    border-radius: 40px 40px 0 0;
}

.access-offres .access-form {
    grid-column: 2;
    margin-top: 0.5rem;
}

.access-offre {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem 1rem;
    border: 1px solid var(--border, #2a2a4a);
    border-radius: 14px;
    box-shadow: 0 4px 18px rgba(0,0,0,0.18);
    color: var(--text);
    transition: border-color 0.2s;
}

.access-offre-actif {
    border-color: #6c63ff;
    box-shadow: 0 0 0 1px #6c63ff, 0 4px 18px rgba(108,99,255,0.3);
}

.access-offre-titre {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--primary);
}

.access-offre-duree {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    margin: 0.6rem 0 1rem;
}

.access-offre-nombre {
    font-size: 3.2rem;
    font-weight: 800;
    line-height: 1;
}

.access-offre-unite {
    color: var(--text-muted, #888);
    font-size: 0.9rem;
}

.access-offre-liste {
    flex: 1;
    list-style: none;
    margin: 0 0 1.2rem;
    padding: 0;
    font-size: 0.85rem;
    text-align: left;
}

.access-offre-liste li {
    padding: 0.3rem 0;
}

.access-offre-liste li::before {
    content: "✓";
    margin-right: 0.6rem;
    color: var(--primary);
    font-weight: 700;
}

.btn-access-offre {
    width: 75%;
    background: transparent;
    border: 1px solid #6c63ff;
    border-radius: 10px;
    color: var(--text);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.6rem 1rem;
    touch-action: manipulation;
}

.access-offre-actif .btn-access-offre {
    background: #6c63ff;
    color: #fff;
}

@media (max-width: 700px) {
    .access-offres {
        grid-template-columns: 1fr;
    }

    .access-offres .access-form {
        grid-column: 1;
    }
}

.btn-access-validate {
    background: linear-gradient(135deg, #4a9eff, #6c63ff);
    border: none;
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    transition: opacity 0.2s;
    margin-top: 0.4rem;
}

.btn-access-validate:hover:not(:disabled) {
    opacity: 0.88;
}

.btn-access-validate:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-access-logout {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-muted, #888);
    cursor: pointer;
    font-size: 0.88rem;
    padding: 0.6rem 1rem;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    touch-action: manipulation;
}
.btn-access-logout:hover {
    background: rgba(220,53,69,0.12);
    color: #e74c3c;
    border-color: #e74c3c;
}

.admin-page { padding: 1.5rem; max-width: 860px; margin: 0 auto; }
.admin-title { font-size: 1.4rem; font-weight: 700; color: var(--text); margin-bottom: 1.2rem; }
.admin-section-title { font-size: 1rem; font-weight: 600; color: var(--text); margin: 0 0 0.8rem 0; }

.admin-create-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.2rem;
    margin-bottom: 1.5rem;
}
.admin-create-form { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.admin-input {
    flex: 1;
    min-width: 150px;
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 0.9rem;
    padding: 0.55rem 0.8rem;
    outline: none;
}
.admin-input:focus { border-color: var(--primary); }
.btn-admin-create {
    background: var(--primary);
    border: none;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.55rem 1.2rem;
    white-space: nowrap;
}
.btn-admin-create:disabled { opacity: 0.5; cursor: not-allowed; }
.admin-create-msg { margin-top: 0.6rem; font-size: 0.85rem; }
.msg-ok { color: limegreen; }
.msg-err { color: #e74c3c; }

.admin-licenses-list { display: flex; flex-direction: column; gap: 0.6rem; }
.admin-loading, .admin-empty { color: var(--text-muted); padding: 1rem; text-align: center; }

.admin-license-row {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.8rem 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}
.row-revoked { opacity: 0.55; }

.lic-info { display: flex; align-items: center; gap: 0.6rem; flex: 1; min-width: 180px; }
.lic-code { font-family: monospace; font-weight: 700; font-size: 0.95rem; color: var(--text); }
.lic-label { font-size: 0.8rem; color: var(--text-muted); }
.lic-status { font-size: 0.72rem; padding: 2px 7px; border-radius: 10px; font-weight: 600; }
.status-disponible { background: rgba(50,205,50,0.15); color: limegreen; }
.status-utilisee  { background: rgba(102,126,234,0.15); color: var(--primary); }
.status-revoquee  { background: rgba(220,53,69,0.15); color: #e74c3c; }
.status-expiree   { background: rgba(255,165,0,0.15); color: orange; }

.lic-meta { display: flex; gap: 0.8rem; flex-wrap: wrap; font-size: 0.78rem; color: var(--text-muted); align-items: center; }
.lic-actions { display: flex; gap: 0.4rem; align-items: center; }

.btn-lic-revoke {
    background: rgba(220,53,69,0.1);
    border: 1px solid #e74c3c;
    border-radius: 5px;
    color: #e74c3c;
    cursor: pointer;
    font-size: 0.78rem;
    padding: 4px 10px;
}
.btn-lic-reactivate {
    background: rgba(50,205,50,0.1);
    border: 1px solid limegreen;
    border-radius: 5px;
    color: limegreen;
    cursor: pointer;
    font-size: 0.78rem;
    padding: 4px 10px;
}
.btn-lic-delete {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 5px;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.8rem;
    padding: 4px 8px;
}
.btn-lic-delete:hover { border-color: #e74c3c; color: #e74c3c; }

.admin-code-group {
    flex: 1;
    min-width: 150px;
    display: flex;
}
.admin-code-group .admin-input {
    flex: 1;
    min-width: 0;
    border-radius: 8px 0 0 8px !important;
}
.btn-generate-code {
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 0 8px 8px 0;
    padding: 0 0.75rem;
    font-size: 1.1rem;
    cursor: pointer;
    transition: filter 0.2s;
}
.btn-generate-code:hover { filter: brightness(1.15); }

.confirm-email-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    padding: 20px;
}
.confirm-card {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 48px 40px;
    text-align: center;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.confirm-logo {
    width: 72px;
    height: 72px;
    border-radius: 16px;
    margin-bottom: 12px;
}
.confirm-brand {
    font-size: 24px;
    font-weight: 700;
    color: #4f46e5;
    margin: 0 0 32px;
}
.confirm-state { margin-top: 8px; }
.confirm-icon { font-size: 52px; display: block; margin-bottom: 12px; }
.confirm-state h2 { margin: 0 0 10px; font-size: 20px; color: var(--text); }
.confirm-state p  { color: var(--text-muted); font-size: 15px; line-height: 1.6; margin: 0 0 24px; }
.confirm-spinner {
    width: 44px; height: 44px;
    border: 4px solid #e0e0e0;
    border-top-color: #4f46e5;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.btn-confirm-login {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 13px 32px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity .2s;
}
.btn-confirm-login:hover { opacity: .88; }

@media print {
    #app-root, .dark, .light {
        --bg-main: #ffffff;
        --bg-card: #ffffff;
        --text: #000000;
        --text-muted: #333333;
        --border: #999999;
        --row-hover: transparent;
        --modal-bg: #ffffff;
        --time-label-color: #333333;
        --day-cell-bg: #ffffff;
        background: #ffffff !important;
        color: #000000 !important;
    }

    .flyout, .flyout-overlay, .top-bar, .view-mode-bar, .print-bar,
    .report-bar, .report-flash,
    .nav-btn, .modal-overlay, #blazor-error-ui { display: none !important; }

    .print-header {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        gap: 1rem;
        margin-bottom: 3mm;
        padding-bottom: 1.5mm;
        border-bottom: 1px solid #999999;
        font-size: 9pt;
    }
    .print-header-app { font-weight: 700; font-size: 11pt; }
    .print-header-logo {
        height: 11mm; width: auto; margin-right: 2mm; vertical-align: middle;
        -webkit-print-color-adjust: exact; print-color-adjust: exact;
    }
    .print-header-identite { font-weight: 600; }

    .note-block, .note-mini { font-size: 11pt !important; }
    .note-time, .note-visee, .mini-time, .mini-course, .mini-text,
    .note-reporte, .mini-reporte { font-size: 10.5pt !important; }

    #app-root, .main-wrapper, .content-area, .calendar-container {
        display: block !important;
        width: 100% !important;
        max-width: none !important;
        min-height: 0 !important;
        height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
    }

    .trimestre-scroll { overflow: visible !important; }
    .time-row-vide { display: none !important; }
    .time-grid { grid-auto-rows: auto !important; }

    .note-block, .note-mini { background: #ffffff !important; color: #000000 !important; border: 1px solid #999999 !important; }
    .mini-course, .note-visee { color: #1b5e20 !important; }

    .note-reporte, .mini-reporte { color: #000000 !important; font-weight: 700 !important; }

    .course-block, .course-mini { -webkit-print-color-adjust: exact; print-color-adjust: exact; }

    .day-cell, .time-cell, .time-label, .note-block, .trim-cell { break-inside: avoid; page-break-inside: avoid; }

    .calendar-header { margin: 0 0 6mm !important; }
    .week-title { font-size: 1.1rem !important; }
}

.conges-page { display: flex; justify-content: center; padding: 1.5rem 1rem; }

.conges-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.5rem;
    width: 100%;
    max-width: 900px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.conges-title { margin: 0 0 0.35rem; color: var(--text); }
.conges-intro { margin: 0 0 1.2rem; font-size: 0.85rem; color: var(--text-muted); }
.conges-loading, .conges-vide { font-size: 0.85rem; color: var(--text-muted); padding: 0.5rem 0; }

.conges-section-title {
    margin: 1.4rem 0 0.5rem;
    font-weight: 600; font-size: 0.9rem; color: var(--text);
    border-bottom: 1px solid var(--border); padding-bottom: 0.35rem;
}

.conge-row {
    display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap;
    padding: 0.5rem; margin-bottom: 0.4rem;
    border: 1px solid var(--border); border-radius: 8px;
    background: var(--bg-main);
}
.conge-row-masquee { opacity: 0.55; }

.conge-nom {
    flex: 1 1 220px; min-width: 160px;
    padding: 4px 7px; border: 1px solid var(--border); border-radius: 6px;
    background: var(--bg-card); color: var(--text); font-size: 0.88rem;
}
.conge-dates { display: flex; align-items: center; gap: 0.35rem; }
.conge-dates label { font-size: 0.8rem; color: var(--text-muted); }
.conge-actions { display: flex; gap: 0.3rem; flex-wrap: wrap; }

.btn-conge {
    padding: 4px 10px; border: 1px solid var(--border); border-radius: 6px;
    background: var(--bg-card); color: var(--text); font-size: 0.8rem; cursor: pointer;
    transition: background 0.15s;
}
.btn-conge:hover { background: var(--row-hover); }
.btn-conge:disabled { opacity: 0.5; cursor: default; }
.btn-conge-reset { color: #dc3545; }

.conge-etat { font-size: 0.72rem; color: var(--text-muted); }

.conges-annee {
    margin: 0.9rem 0 0.4rem;
    font-size: 0.78rem; font-weight: 600; letter-spacing: 0.3px;
    color: var(--text-muted); text-transform: uppercase;
}

.lecons-page {
    padding: 1.2rem 1rem 3rem;
    display: flex; justify-content: center;
}

.lecons-card {
    width: 100%; max-width: 900px;
    background: var(--bg-card);
    border: 1px solid var(--border); border-radius: 10px;
    padding: 1.4rem 1.5rem 1.8rem;
}

.lecons-title { margin: 0 0 .4rem; font-size: 1.35rem; }

.lecons-intro {
    margin: 0 0 1.1rem;
    font-size: .88rem; line-height: 1.5; color: var(--text-muted);
}

.lecons-actions { margin-bottom: 1.1rem; }

.lecons-loading, .lecons-vide {
    padding: 1.1rem; text-align: center;
    font-size: .88rem; color: var(--text-muted);
}

.lecon-row {
    display: flex; align-items: center; gap: .8rem;
    padding: .7rem .8rem; margin-bottom: .5rem;
    border: 1px solid var(--border); border-radius: 8px;
}
.lecon-row:hover { background: var(--row-hover); }

.lecon-row-main { flex: 1; min-width: 0; cursor: pointer; }

.lecon-row-titre {
    font-weight: 600; font-size: .96rem;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.lecon-row-meta { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .35rem; }

.lecon-chip {
    padding: .1rem .45rem; border-radius: 999px;
    background: var(--row-hover); border: 1px solid var(--border);
    font-size: .72rem; color: var(--text-muted);
}

.lecon-row-btns { display: flex; gap: .35rem; flex-shrink: 0; }

.btn-lecon, .btn-lecon-new, .btn-lecon-add {
    padding: .34rem .7rem; border-radius: 6px; cursor: pointer;
    border: 1px solid var(--border); background: var(--bg-card); color: var(--text);
    font-size: .82rem; font-family: inherit;
}
.btn-lecon:hover:not(:disabled),
.btn-lecon-add:hover { background: var(--row-hover); }
.btn-lecon:disabled { opacity: .4; cursor: default; }

.btn-lecon-del { color: #c0392b; border-color: #c0392b55; }
.btn-lecon-del:hover:not(:disabled) { background: #c0392b18; }

.btn-lecon-new {
    padding: .45rem 1rem; font-size: .88rem; font-weight: 600;
    background: #2E7D32; border-color: #2E7D32; color: #ffffff;
}
.btn-lecon-new:hover { opacity: .88; }

.lecon-modal { max-width: 760px; width: 94vw; max-height: 88vh; overflow-y: auto; }

.lecon-grid {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: .7rem .9rem; margin: .9rem 0;
}
.lecon-champ-large { grid-column: 1 / -1; }

.lecon-champ { display: flex; flex-direction: column; gap: .22rem; }
.lecon-champ > span { font-size: .78rem; font-weight: 600; color: var(--text-muted); }
.lecon-champ-bloc { margin-bottom: .9rem; }

.lecon-input, .lecon-zone {
    width: 100%; box-sizing: border-box;
    padding: .4rem .55rem; border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg-main); color: var(--text);
    font-size: .88rem; font-family: inherit;
}
.lecon-zone { resize: vertical; line-height: 1.45; }

.lecon-phases-entete {
    display: flex; align-items: center; justify-content: space-between;
    gap: .8rem; margin: 1.1rem 0 .5rem;
    font-size: .82rem; font-weight: 600; letter-spacing: .3px;
    color: var(--text-muted); text-transform: uppercase;
}

.lecon-phase {
    border: 1px solid var(--border); border-radius: 8px;
    padding: .6rem .7rem; margin-bottom: .5rem;
}

.lecon-phase-entete {
    display: flex; align-items: flex-end; gap: .5rem; margin-bottom: .4rem;
}
.lecon-phase-num { font-weight: 600; font-size: .88rem; margin-right: auto; }

.lecon-phase-temps { display: flex; flex-direction: column; gap: .22rem; width: 110px; }
.lecon-phase-temps > span { font-size: .72rem; color: var(--text-muted); }

@media (max-width: 620px) {
    .lecon-grid { grid-template-columns: 1fr; }
    .lecon-row { flex-direction: column; align-items: stretch; }
    .lecon-row-btns { justify-content: flex-end; }
}

.lecon-print { display: none; }

@media print {
    body:has(.lecon-print) .lecons-page,
    body:has(.lecon-print) .print-header { display: none !important; }

    .lecon-print {
        display: block !important;
        color: #000000; background: #ffffff;
        font-size: 10.5pt; line-height: 1.45;
        border: 2pt solid #000000;
        padding: 6mm;
    }

    .lecon-print-entete {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 1rem;
        margin-bottom: 4mm;
        padding-bottom: 1.5mm;
        border-bottom: 1px solid #999999;
    }

    .lecon-print-marque { display: flex; align-items: center; }

    .lecon-print-logo {
        height: 9mm; width: auto; margin-right: 2mm;
        -webkit-print-color-adjust: exact; print-color-adjust: exact;
    }

    .lecon-print-app { font-weight: 700; font-size: 11pt; }
    .lecon-print-doc { font-weight: 700; font-size: 13pt; }
    .lecon-print-annee { font-size: 9pt; color: #5a5a5a; }

    .lecon-print-libelle {
        font-weight: 700; text-decoration: underline;
        margin-bottom: 2mm;
    }

    .lecon-print-centre { text-align: center; margin: 6mm 0 4mm; }

    .lecon-print-titre { font-size: 12pt; margin-bottom: 2mm; }
    .lecon-print-titre .lecon-print-libelle { display: inline; }
    .lecon-print-valeur { margin-left: 3mm; }

    .lecon-print-cadre {
        float: right; width: 95mm; margin: 0 0 4mm 5mm;
        border-collapse: collapse;
    }
    .lecon-print-cadre td {
        border: 1px solid #000000;
        padding: 1mm 2mm;
    }
    .lecon-print-cadre span { font-weight: 600; }

    .lecon-print-bloc { clear: both; padding-top: 2mm; margin-bottom: 4mm; }
    .lecon-print-contexte {
        white-space: pre-wrap;
        margin-left: 8mm; font-size: 10pt;
    }
    .lecon-print-phases { width: 100%; border-collapse: collapse; }
    .lecon-print-phases td { padding: 2.5mm 0; vertical-align: top; break-inside: avoid; }

    .lecon-print-phase-nom { width: 22mm; font-weight: 600; white-space: nowrap; }
    .lecon-print-phase-txt { white-space: pre-wrap; padding-right: 6mm; }
    .lecon-print-phase-tps { width: 55mm; white-space: pre-wrap; }
    .lecon-print-phase-tps span { font-weight: 600; }
}

.lecon-cascade {
    border: 1px solid var(--border); border-radius: 8px;
    padding: .7rem .8rem; margin-bottom: .6rem;
}

.garde-page { display: flex; flex-direction: row; flex-wrap: nowrap; height: calc(100vh - 56px); }

.garde-menu {
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    padding: 1rem;
    width: 300px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    color: var(--text);
    overflow-y: auto;
    max-height: calc(100vh - 56px);
    position: sticky;
    top: 0;
}

.garde-menu-item {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.7rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-main);
    color: var(--text);
    font-size: 0.95rem;
    text-align: left;
    cursor: pointer;
}

.garde-menu-item:hover { background: var(--row-hover); }
.garde-menu-item-actif { border-color: var(--primary); font-weight: 600; }
.garde-fleche { margin-left: auto; color: var(--text-muted); }

.garde-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.4rem 0.3rem 0.8rem 0.8rem;
    border-left: 2px solid var(--primary);
    margin-left: 0.5rem;
}

.garde-title { margin: 0 0 0.5rem; color: var(--text); }

.garde-section-title {
    font-weight: 600; font-size: 0.9rem;
    border-bottom: 1px solid var(--border); padding-bottom: 0.35rem;
}

.garde-check { display: flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; cursor: pointer; }
.garde-label { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.4rem; }

.garde-input {
    padding: 0.4rem; border-radius: 6px;
    border: 1px solid var(--border); background: var(--bg-main); color: var(--text);
}

.garde-color { width: 60px; height: 32px; border: none; background: none; cursor: pointer; }

.garde-emojis { display: flex; flex-wrap: wrap; gap: 0.3rem; max-height: 260px; overflow-y: auto; }

.garde-emoji-btn {
    width: 36px; height: 36px; font-size: 1.1rem;
    border: 1px solid var(--border); border-radius: 6px;
    background: var(--bg-main); cursor: pointer;
}

.garde-emoji-actif { border: 2px solid var(--primary); }

.garde-apercu-zone { flex: 1; position: relative; overflow: hidden; background: var(--bg-main); }

.garde-apercu-scroll {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    overflow: auto;
    display: flex;
    padding: 2rem 2rem 5rem;
}

.garde-zoom-boite { margin: auto; flex-shrink: 0; }

.garde-zoom-barre {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.35rem 0.6rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 999px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

.garde-zoom-btn {
    width: 30px; height: 30px;
    border: none; border-radius: 50%;
    background: var(--bg-main); color: var(--text);
    font-size: 1.1rem; line-height: 1;
    cursor: pointer;
}

.garde-zoom-btn:hover { background: var(--row-hover); }

.garde-zoom-slider { width: 140px; }

.garde-zoom-pourcent {
    min-width: 58px;
    border: none; background: none;
    color: var(--text); font-size: 0.85rem;
    cursor: pointer;
}

.garde-feuille {
    position: relative;
    background: #ffffff;
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
    transform-origin: top left;
    overflow: hidden;
}

.garde-cadre { position: absolute; box-sizing: border-box; }

.garde-emoji-ligne, .garde-emoji-colonne {
    position: absolute;
    display: flex;
    justify-content: space-between;
    align-items: center;
    line-height: 1;
    overflow: hidden;
}

.garde-emoji-colonne { flex-direction: column; }

.garde-ajout-textes { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.garde-petit-btn {
    padding: 0.3rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-main);
    color: var(--text);
    font-size: 0.8rem;
    cursor: pointer;
}

.garde-petit-btn:hover { border-color: var(--primary); }
.garde-btn-supprimer:hover { border-color: #e53935; color: #e53935; }

.garde-zone-ligne {
    width: 100%;
    padding: 0.35rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-main);
    color: var(--text);
    font-size: 0.85rem;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

.garde-zone-ligne-actif { border-color: var(--primary); font-weight: 600; }

.garde-texte {
    position: absolute;
    transform: translate(-50%, -50%);
    white-space: pre;
    text-align: center;
    line-height: 1.2;
    user-select: none;
    padding: 2px 4px;
    border: 1px dashed transparent;
}

.garde-texte-deplacable { cursor: move; }
.garde-texte-deplacable:hover { border-color: rgba(102, 126, 234, 0.5); }
.garde-texte-choisi { border-color: #667eea; }

.garde-repere-vertical, .garde-repere-horizontal {
    position: absolute;
    pointer-events: none;
    z-index: 5;
}

.garde-repere-vertical { top: 0; bottom: 0; border-left: 1px dashed rgba(102, 126, 234, 0.7); }
.garde-repere-horizontal { left: 0; right: 0; border-top: 1px dashed rgba(102, 126, 234, 0.7); }
.garde-repere-aligne { border-color: #e91e63; border-style: solid; }

.garde-retour { font-size: 0.85rem; color: var(--primary); text-decoration: none; }
.garde-retour:hover { text-decoration: underline; }

.garde-enregistrer {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.garde-btn-principal {
    padding: 0.55rem;
    border: none;
    border-radius: 8px;
    background: var(--primary);
    color: #ffffff;
    font-weight: 600;
    cursor: pointer;
}

.garde-btn-principal:hover { background: var(--primary-hover); }
.garde-btn-principal:disabled, .garde-petit-btn:disabled { opacity: 0.6; cursor: wait; }

.garde-info { font-size: 0.8rem; color: var(--text-muted); font-style: italic; }
.garde-erreur { font-size: 0.85rem; color: #e53935; }
.garde-succes { font-size: 0.85rem; color: #43a047; }

.garde-liste-page { padding: 1.5rem 2rem; color: var(--text); }
.garde-liste-intro { font-size: 0.9rem; color: var(--text-muted); margin: 0 0 1rem; }

.garde-liste-section {
    margin: 1.5rem 0 0.7rem;
    font-weight: 600; font-size: 0.95rem;
    border-bottom: 1px solid var(--border); padding-bottom: 0.35rem;
}

.garde-grille { display: flex; flex-wrap: wrap; gap: 1.2rem; }

.garde-carte {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
}

.garde-carte:hover { border-color: var(--primary); box-shadow: 0 4px 14px rgba(0,0,0,0.2); }

.garde-carte-apercu {
    width: 210px;
    height: 210px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.garde-carte-vide span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 147px;
    height: 208px;
    background: #ffffff;
    color: #999999;
    font-size: 3rem;
    border: 2px dashed #cccccc;
}

.garde-carte-nom { font-size: 0.9rem; max-width: 210px; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.garde-carte-supprimer {
    position: absolute;
    top: 6px;
    right: 6px;
    border: none;
    background: var(--bg-main);
    border-radius: 6px;
    padding: 2px 6px;
    cursor: pointer;
}

.garde-carte-supprimer:hover { background: #e53935; }

.garde-image {
    position: absolute;
    transform: translate(-50%, -50%);
    border: 1px dashed transparent;
}

.garde-image img { width: 100%; height: 100%; display: block; pointer-events: none; user-select: none; }
.garde-image-deplacable { cursor: move; }
.garde-image-deplacable:hover { border-color: rgba(102, 126, 234, 0.5); }
.garde-image-choisie { border-color: #667eea; }

.garde-poignee {
    position: absolute;
    right: -8px;
    bottom: -8px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #667eea;
    border: 2px solid #ffffff;
    cursor: nwse-resize;
}

.garde-images-grille {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.4rem;
    max-height: 300px;
    overflow-y: auto;
}

.garde-image-miniature {
    position: relative;
    aspect-ratio: 1;
    padding: 4px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.garde-image-miniature:hover { border-color: var(--primary); }
.garde-image-miniature img { max-width: 100%; max-height: 100%; }

.garde-miniature-supprimer {
    position: absolute;
    top: 2px;
    right: 2px;
    border: none;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.55);
    font-size: 0.7rem;
    padding: 1px 3px;
    cursor: pointer;
}

.garde-miniature-supprimer:hover { background: #e53935; }

.garde-poignee-rotation {
    position: absolute;
    top: -28px;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 16px;
    line-height: 13px;
    border-radius: 50%;
    background: #667eea;
    border: 2px solid #ffffff;
    color: #ffffff;
    font-size: 10px;
    text-align: center;
    cursor: grab;
    user-select: none;
}

.compte-danger { border: 1px solid #e53935; border-radius: 10px; padding: 0.9rem; }
.compte-danger .account-section-title { color: #e53935; }
.compte-danger-texte { font-size: 0.85rem; color: var(--text); margin-bottom: 0.7rem; }
.compte-danger-label { display: block; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.35rem; }

.compte-danger-input {
    width: 100%;
    padding: 0.45rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-main);
    color: var(--text);
}

.compte-danger-erreur { font-size: 0.85rem; color: #e53935; margin-top: 0.5rem; }
.compte-danger-boutons { display: flex; gap: 0.5rem; margin-top: 0.7rem; flex-wrap: wrap; }

.btn-compte-supprimer {
    padding: 0.5rem 0.9rem;
    border: none;
    border-radius: 8px;
    background: #e53935;
    color: #ffffff;
    font-weight: 600;
    cursor: pointer;
}

.btn-compte-supprimer:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-compte-annuler {
    padding: 0.5rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: none;
    color: var(--text);
    cursor: pointer;
}
