/* ==========================================================================
   Jeanne — direction artistique commune (chargée après Tailwind et styles.css)
   Bleu → indigo pour les actions, fond gris très clair, cartes blanches,
   Outfit pour les titres, Inter pour le texte.
   ========================================================================== */
:root {
    --brand-1: #2563eb;
    --brand-2: #4f46e5;
    --ink: #0f172a;
    --text: #334155;
    --muted: #64748b;
    --line: #e9eef5;
    --surface: #f5f7fb;
    --radius-card: 20px;
    --shadow-card: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 16px -8px rgba(15, 23, 42, 0.06);
}

body { background: var(--surface); color: var(--text); -webkit-font-smoothing: antialiased; }
.bg-ambient-circle { display: none; }
h1, h2, h3, h4, .font-display { font-family: 'Outfit', sans-serif; letter-spacing: -0.01em; }

/* ---- Structure ----------------------------------------------------------- */
.app-main { background: var(--surface); }
.app-header { background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.app-sidebar { background: #fff; border-right: 1px solid var(--line); }

.brand-mark {
    width: 34px; height: 34px; border-radius: 11px;
    background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
    color: #fff; display: inline-flex; align-items: center; justify-content: center;
    box-shadow: 0 6px 16px -6px rgba(79, 70, 229, 0.55);
}
.brand-name { font-family: 'Outfit', sans-serif; font-weight: 800; font-size: 1.3rem; color: var(--ink); letter-spacing: -0.02em; }

/* ---- Menu latéral -------------------------------------------------------- */
.nav-section { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: #94a3b8; padding: 14px 12px 6px; }
.nav-item { color: var(--muted) !important; font-weight: 500; }
.nav-item:hover { background: #f8fafc !important; color: var(--ink) !important; }
.nav-item ion-icon { font-size: 1.15rem; }
.nav-item .active-indicator { display: none; }
.nav-item.active { background: linear-gradient(135deg, #eff6ff, #eef2ff) !important; color: #1d4ed8 !important; font-weight: 700 !important; }
.nav-item.active ion-icon { color: #2563eb; }

/* barre du bas (mobile) */
.mobile-tab-btn { padding: 4px 6px; border-radius: 12px; min-width: 52px; }
.mobile-tab-btn.text-blue-600 { color: #1d4ed8 !important; }

/* ---- En-tête de page ------------------------------------------------------ */
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.page-head-main { display: flex; align-items: center; gap: 14px; min-width: 0; }
.page-icon { width: 48px; height: 48px; border-radius: 16px; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; flex-shrink: 0; }
.page-title { font-family: 'Outfit', sans-serif; font-weight: 800; font-size: 1.65rem; line-height: 1.15; color: var(--ink); letter-spacing: -0.02em; }
.page-sub { font-size: 0.875rem; color: var(--muted); margin-top: 2px; }
@media (max-width: 640px) {
    .page-title { font-size: 1.4rem; }
    .page-icon { width: 42px; height: 42px; border-radius: 14px; font-size: 1.2rem; }
}
.tint-blue { background: #eff6ff; color: #2563eb; }
.tint-indigo { background: #eef2ff; color: #4f46e5; }
.tint-emerald { background: #ecfdf5; color: #059669; }
.tint-sky { background: #f0f9ff; color: #0284c7; }
.tint-rose { background: #fff1f2; color: #e11d48; }
.tint-violet { background: #f5f3ff; color: #7c3aed; }
.tint-slate { background: #f1f5f9; color: #475569; }
.tint-amber { background: #fffbeb; color: #d97706; }

/* ---- Cartes --------------------------------------------------------------- */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-card); box-shadow: var(--shadow-card); }
.card-pad { padding: 22px; }
@media (max-width: 640px) { .card-pad { padding: 18px; } }
.card-title { font-family: 'Outfit', sans-serif; font-weight: 700; font-size: 1.05rem; color: var(--ink); display: flex; align-items: center; gap: 10px; }
.card-title .page-icon { width: 34px; height: 34px; border-radius: 11px; font-size: 1.05rem; }
.card-sub { font-size: 0.8rem; color: var(--muted); margin-top: 4px; }

/* les cartes blanches existantes prennent le même style */
#view-settings > .bg-white, #view-stats > .bg-white, #view-revision .bg-white.rounded-2xl, #exams-list > .bg-white {
    border-color: var(--line) !important; border-radius: var(--radius-card) !important; box-shadow: var(--shadow-card) !important;
}

/* ---- Boutons ---------------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 700; font-size: 0.875rem; border-radius: 14px; padding: 10px 16px; transition: all .15s ease; white-space: nowrap; }
.btn:active { transform: scale(0.98); }
.btn-primary { color: #fff; background: linear-gradient(135deg, var(--brand-1), var(--brand-2)); box-shadow: 0 8px 20px -10px rgba(37, 99, 235, 0.7); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-soft { color: var(--text); background: #fff; border: 1px solid var(--line); }
.btn-soft:hover { background: #f8fafc; color: var(--ink); }
.btn-ghost { color: var(--muted); }
.btn-ghost:hover { background: #f1f5f9; color: var(--ink); }
.btn-block { width: 100%; padding: 13px 16px; }

/* ---- Champs ----------------------------------------------------------------- */
.field,
#view-settings input[type="text"], #view-settings input[type="password"], #view-settings select,
.modal input[type="text"], .modal input[type="number"], .modal input[type="date"], .modal input[type="time"],
.modal input[type="password"], .modal select, .modal textarea, #timer-details {
    width: 100%; background: #f8fafc !important; border: 1px solid var(--line) !important; border-radius: 14px !important;
    padding: 12px 14px !important; font-size: 0.875rem; color: var(--ink); outline: none; transition: all .15s ease;
}
.field:focus,
#view-settings input:focus, #view-settings select:focus,
.modal input:focus, .modal select:focus, .modal textarea:focus, #timer-details:focus {
    background: #fff !important; border-color: #93c5fd !important; box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12) !important;
}
.field-label, #view-settings label, .modal label { font-size: 11px !important; font-weight: 700 !important; text-transform: uppercase; letter-spacing: 0.06em; color: #94a3b8 !important; margin-bottom: 6px !important; display: block; }

/* ---- Fenêtres (modales) ---------------------------------------------------------- */
.modal { background: rgba(15, 23, 42, 0.45) !important; backdrop-filter: blur(6px); }
.modal > div { border-radius: 24px !important; border-color: var(--line) !important; box-shadow: 0 30px 60px -20px rgba(15, 23, 42, 0.35) !important; }
.modal h3 { font-family: 'Outfit', sans-serif; font-weight: 800 !important; }
.detail-popover { border-radius: 24px !important; }

/* ---- Agenda ---------------------------------------------------------------------- */
.timetable-grid { border-color: var(--line) !important; border-radius: var(--radius-card) !important; box-shadow: var(--shadow-card); background: #fff; }

/* ---- Divers ------------------------------------------------------------------------ */
.stat-hero { border-radius: 24px; padding: 24px; color: #fff; position: relative; overflow: hidden; }
.stat-hero::after { content: ''; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%; background: rgba(255, 255, 255, 0.1); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; border: 1px solid transparent; }
