/* ============================================================
   LANDSCHOOL — couche d'amélioration visuelle (chargée après site.css)
   Icônes d'en-tête, cartes, tableaux, formulaires, boutons, mises en page.
   ============================================================ */
:root {
    --shadow-sm: 0 1px 2px rgba(13,43,82,.06), 0 1px 3px rgba(13,43,82,.05);
    --shadow-md: 0 4px 14px rgba(13,43,82,.09);
    --shadow-lg: 0 14px 40px rgba(13,43,82,.16);
    --ring: 0 0 0 3px rgba(84,122,163,.28);
}

/* ---------- Titres avec icône ---------- */
.h-ico {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; margin-right: 11px; vertical-align: middle;
    border-radius: 10px; color: #fff;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    box-shadow: var(--shadow-sm);
}
.h-ico svg { width: 18px; height: 18px; stroke: currentColor; }
.panel-head h2 .h-ico {
    width: 26px; height: 26px; margin-right: 9px; border-radius: 8px;
    background: var(--primary-tint); color: var(--primary); box-shadow: none;
}
.panel-head h2 .h-ico svg { width: 15px; height: 15px; }
.page-head h1 { display: flex; align-items: center; letter-spacing: -.2px; }

/* ---------- Panneaux ---------- */
.panel {
    border-radius: 14px; box-shadow: var(--shadow-sm); overflow: hidden;
    transition: box-shadow .2s ease;
}
.panel:hover { box-shadow: var(--shadow-md); }
.panel-head {
    background: linear-gradient(180deg, #FBFCFE 0%, #F3F6FA 100%);
    border-bottom: 1px solid var(--border);
    position: relative;
}
.panel-head::after {
    content: ""; position: absolute; left: 0; bottom: -1px; width: 64px; height: 3px;
    background: var(--gold); border-radius: 0 3px 0 0;
}

/* ---------- KPI ---------- */
.kpi-card {
    border-radius: 14px; box-shadow: var(--shadow-sm); position: relative;
    transition: transform .18s ease, box-shadow .18s ease;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.kpi-ico {
    width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
    background: var(--primary-tint); color: var(--primary); flex: none;
}
.kpi-ico svg { width: 18px; height: 18px; }
.kpi-card.k-gold .kpi-ico { background: #FBF1DA; color: var(--gold-dark); }
.kpi-card.k-danger .kpi-ico { background: var(--danger-tint); color: var(--danger); }
.kpi-card.k-success { border-top-color: var(--success); }
.kpi-card.k-success .kpi-ico { background: var(--success-tint); color: var(--success); }
.kpi-card.k-teal .kpi-ico { background: var(--secondary-tint); color: var(--secondary); }
.kpi-card.k-primary { border-top-color: var(--primary); }
.kpi-value { font-size: 26px; letter-spacing: -.3px; }

/* ---------- Boutons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    cursor: pointer; transition: background .15s, box-shadow .15s, transform .08s, border-color .15s;
}
.btn:hover:not(:disabled) { box-shadow: var(--shadow-sm); border-color: var(--secondary); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn svg { width: 14px; height: 14px; }
.btn-primary { background: linear-gradient(180deg, #14396C 0%, var(--primary) 100%); }
.btn-export { border-color: var(--secondary); color: var(--secondary); }
.btn-export:hover:not(:disabled) { background: var(--secondary-tint); }

/* ---------- Tableaux ---------- */
.panel .table-wrap { max-height: 70vh; overflow: auto; }
table.data thead th { position: sticky; top: 0; z-index: 2; letter-spacing: .4px; }
table.data thead th:first-child { border-top-left-radius: 0; }
table.data tbody tr { transition: background .12s; }
table.data tbody td { border-bottom-color: #E8EDF3; }
.search-bar { align-items: center; flex-wrap: wrap; }
.search-bar input { border-radius: 10px; padding-left: 36px; min-width: 220px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238C9AAC' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M21 21l-4.3-4.3'/%3E%3C/svg%3E") no-repeat 11px center / 16px; }
.dt-pagination { background: #FAFBFD; }
.dt-page-btn { transition: background .15s; cursor: pointer; }
.dt-page-btn:disabled { opacity: .45; cursor: not-allowed; }
.badge-avg { display: inline-block; padding: 3px 10px; border-radius: 999px; font-weight: 700; font-size: 12px; }
.badge-avg.ok { background: var(--success-tint); color: var(--success); }
.badge-avg.ko { background: var(--danger-tint); color: var(--danger); }

/* ---------- Formulaires ---------- */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field input, .field select, .field textarea, .search-bar input {
    transition: border-color .15s, box-shadow .15s; background-color: #fff;
}
.field input:focus, .field select:focus, .field textarea:focus, .search-bar input:focus {
    outline: none; border-color: var(--secondary); box-shadow: var(--ring);
}
.field input:disabled, .field select:disabled { background: #F1F4F8; color: var(--text-faint); }
.radio-stack { display: flex; flex-direction: column; gap: 6px; }
.radio-line { display: flex; align-items: center; gap: 8px; font-size: 13px; text-transform: none !important; font-weight: 500 !important; color: var(--text) !important; cursor: pointer; }
.hint-box { border-radius: 10px; box-shadow: var(--shadow-sm); }

/* ---------- Modales ---------- */
.modal-box { border-radius: 16px; box-shadow: var(--shadow-lg); animation: ls-pop .18s ease; }
.modal-head { background: linear-gradient(180deg, #FBFCFE, #F3F6FA); border-bottom: 1px solid var(--border); }
@keyframes ls-pop { from { transform: translateY(8px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Mises en page ---------- */
.split-3-9 { display: grid; grid-template-columns: minmax(230px, 3fr) 9fr; gap: 20px; align-items: start; }
.split-3-9 > section { min-width: 0; }
.filter-panel { position: sticky; top: 12px; }
@media (max-width: 960px) { .split-3-9 { grid-template-columns: 1fr; } .filter-panel { position: static; } }
.empty-state { text-align: center; padding: 48px 18px; color: var(--text-muted); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty-ico { width: 54px; height: 54px; border-radius: 16px; background: var(--primary-tint); color: var(--primary); display: flex; align-items: center; justify-content: center; }
.empty-ico svg { width: 26px; height: 26px; }

/* ---------- Profil ---------- */
.profile-grid { display: grid; grid-template-columns: minmax(240px, 3fr) 9fr; gap: 20px; align-items: start; }
@media (max-width: 960px) { .profile-grid { grid-template-columns: 1fr; } }
.profile-card { text-align: center; padding: 28px 18px; }
.profile-avatar {
    width: 84px; height: 84px; margin: 0 auto 12px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 700; color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--secondary)); box-shadow: var(--shadow-md);
    border: 3px solid var(--gold);
}
.profile-name { font-size: 18px; font-weight: 700; color: var(--primary); }

/* ---------- En-tête applicatif ---------- */
.user-chip { transition: background .15s; border-radius: 12px; }
.user-chip:hover { background: rgba(255,255,255,.08); }
.nav-item { transition: background .15s, padding-left .15s; }

/* ---------- Onglets avec icônes ---------- */
.inscr-tab { display: inline-flex; align-items: center; gap: 8px; }
.tab-ico { display: inline-flex; }
.tab-ico svg { width: 15px; height: 15px; stroke: currentColor; fill: none; }
.stat-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-bottom: 16px; }
.stat-group { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; }
.stat-group h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); margin: 0 0 10px; display: flex; align-items: center; gap: 6px; }
.stat-group h3 svg { width: 14px; height: 14px; stroke: currentColor; fill: none; }
.stat-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 5px 0; font-size: 13px; cursor: pointer; border-radius: 6px; }
.stat-row:hover { background: rgba(13,43,82,.05); }
.stat-row.active { background: rgba(13,43,82,.10); font-weight: 700; }
.stat-row .stat-bar { flex: 1; height: 6px; background: var(--border); border-radius: 4px; overflow: hidden; }
.stat-row .stat-bar > i { display: block; height: 100%; background: var(--primary); }
.stat-row b { min-width: 28px; text-align: right; }

/* ---- Loader global (BusyOverlay) ---- */
.busy-bar { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 5000; overflow: hidden; background: rgba(13,43,82,.12); }
.busy-bar::after { content: ""; position: absolute; top: 0; bottom: 0; width: 35%; background: var(--gold, #C9972B); animation: busy-slide 1s ease-in-out infinite; }
@keyframes busy-slide { 0% { left: -35%; } 100% { left: 100%; } }
.busy-pill { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 5001; display: flex; align-items: center; gap: 8px; padding: 7px 14px; background: #fff; border: 1px solid var(--border-strong, #D7DEE8); border-radius: 999px; box-shadow: 0 4px 16px rgba(13,43,82,.18); font-size: 12.5px; font-weight: 600; color: var(--navy, #0D2B52); pointer-events: none; animation: busy-in .15s ease-out; }
.busy-pill .spinner { margin-right: 0; width: 16px; height: 16px; }
@keyframes busy-in { from { opacity: 0; transform: translate(-50%, -6px); } to { opacity: 1; transform: translate(-50%, 0); } }
@media (max-width: 600px) { .busy-pill-txt { display: none; } .busy-pill { padding: 8px; } }
/* Retour immédiat sur le bouton cliqué (voir js/busy.js) */
button.btn-pending:not(:has(.spinner))::before, .btn.btn-pending:not(:has(.spinner))::before { content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 7px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; vertical-align: -2px; opacity: .85; }
button.btn-pending, .btn.btn-pending { cursor: progress; }

/* ---- Journal d'audit ---- */
.audit-json { background: #F4F6FA; border: 1px solid var(--border, #E1E6EF); border-radius: 8px; padding: 10px 12px; font-size: 12px; max-height: 240px; overflow: auto; white-space: pre-wrap; word-break: break-word; }

/* ---- Import élèves (compact, 2 colonnes 50/50, sans coins arrondis) ---- */
.import-panel { padding: 0; border-radius: 0; }
.import-row { display: flex; flex-wrap: wrap; }
.import-col { flex: 0 0 50%; max-width: 50%; box-sizing: border-box; padding: 14px 16px; display: flex; flex-direction: column; gap: 14px; }
.import-col + .import-col { border-left: 1px solid var(--border, #E1E6EF); }
.import-zone { border: 1px solid var(--border, #E1E6EF); border-radius: 0; padding: 12px 14px; background: #fff; display: flex; flex-direction: column; gap: 8px; }
.import-zone-title { font-weight: 700; color: var(--navy, #0D2B52); display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.import-step { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 0; background: var(--navy, #0D2B52); color: #fff; font-size: 11px; }
.import-zone .field { margin: 0; }
.import-zone select, .import-zone input, .import-zone .btn { border-radius: 0; }
.import-preview { max-height: 280px; overflow: auto; }
@media (max-width: 800px) { .import-col { flex: 0 0 100%; max-width: 100%; } .import-col + .import-col { border-left: none; } }

/* Attestation administrative : panneau de contrôle (col-3) + aperçu PDF (col-9) */
.att-row { display: grid; grid-template-columns: minmax(250px, 3fr) 9fr; gap: 16px; align-items: start; margin-bottom: 16px; }
.att-row .field { margin-bottom: 10px; }
.att-row .field select, .att-row .field input { width: 100%; }
@media (max-width: 900px) { .att-row { grid-template-columns: 1fr; } }

/* ---------- Filtres d'en-tête (année académique / période) ---------- */
.flt{display:inline-flex;align-items:center;gap:8px;background:#fff;border:1px solid var(--border-strong);border-radius:10px;padding:5px 6px 5px 12px;color:var(--primary);}
.flt .tab-ico svg{width:15px;height:15px;stroke:currentColor;fill:none;}
.flt-lbl{font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.04em;color:var(--text-muted);white-space:nowrap;}
.flt select{border:none;background:var(--secondary-tint,#EEF3FA);color:var(--primary);font-weight:700;font-size:13px;padding:7px 10px;border-radius:7px;cursor:pointer;min-width:130px;outline:none;}
.flt:focus-within{border-color:var(--primary);box-shadow:0 0 0 3px rgba(13,43,82,.12);}

/* ---- Performance de l'école (même bleu que l'UI Promoteur) ---- */
.page-head.perf-hero { background: linear-gradient(120deg, #0D2B52 0%, #1c4a85 60%, #547AA3 100%); color: #fff; border: 0; border-radius: 16px; padding: 18px 22px; margin-bottom: 14px; box-shadow: 0 6px 18px rgba(13,43,82,.18); }
.perf-hero h1 { color: #fff; } .perf-hero .h-ico { background: rgba(255,255,255,.16); color: #fff; } .perf-hero .page-sub { color: rgba(255,255,255,.85); }
.perf-hero .btn { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.35); color: #fff; } .perf-hero .btn:hover { background: rgba(255,255,255,.24); }
.perf-filters { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; background: #fff; border: 1px solid var(--border, #e5e7eb); border-radius: 14px; padding: 10px 16px; margin-bottom: 14px; box-shadow: 0 2px 10px rgba(13,43,82,.05); }
.perf-f { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; color: #0D2B52; }
.perf-f select { border: 1px solid var(--border-strong, #cbd5e1); border-radius: 9px; padding: 8px 12px; font-weight: 700; color: #0D2B52; background: #f3f7fc; min-width: 200px; }
.perf-note { margin-left: auto; font-size: 11.5px; color: #6b7280; }
.perf-kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 14px; }
.perf-kpi { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--border, #e5e7eb); border-radius: 14px; padding: 14px; box-shadow: 0 2px 10px rgba(13,43,82,.05); }
.perf-kpi small { display: block; font-size: 11.5px; color: #6b7280; } .perf-kpi b { font-size: 20px; color: #0D2B52; }
.perf-ico { width: 38px; height: 38px; border-radius: 11px; background: #eaf1fb; color: #0D2B52; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.perf-ico svg { width: 19px; height: 19px; }
.perf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.perf-row { display: grid; grid-template-columns: 150px 1fr 90px; gap: 10px; align-items: center; margin-bottom: 9px; font-size: 12.5px; }
.perf-lbl { color: #1f2937; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.perf-track { height: 10px; background: #eaf1fb; border-radius: 6px; overflow: hidden; } .perf-track i { display: block; height: 100%; background: linear-gradient(90deg, #1c4a85, #0D2B52); border-radius: 6px; }
.perf-val { text-align: right; font-weight: 700; color: #0D2B52; }
.perf-tablewrap { overflow-x: auto; }
.perf-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.perf-table th { background: #f3f7fc; color: #0D2B52; text-align: left; padding: 9px 10px; border-bottom: 2px solid #d5e2f3; white-space: nowrap; }
.perf-table td { padding: 8px 10px; border-bottom: 1px solid #eef2f8; }
.perf-badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-weight: 700; font-size: 11.5px; }
.perf-badge.ok { background: #e3f4ea; color: #16794a; } .perf-badge.mid { background: #fdf3dc; color: #946200; } .perf-badge.bad { background: #fbe6e6; color: #b32d2d; }
@media (max-width: 1100px) { .perf-kpis { grid-template-columns: repeat(3, 1fr); } .perf-grid { grid-template-columns: 1fr; } }
@media (max-width: 600px) { .perf-kpis { grid-template-columns: repeat(2, 1fr); } .perf-row { grid-template-columns: 100px 1fr 70px; } }

/* ---- Attestations : actions par icônes ---- */
.att-acts { display: inline-flex; gap: 6px; }
.att-ic { width: 30px; height: 30px; border-radius: 9px; border: 1px solid var(--border, #dde3ec); background: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: all .15s; padding: 0; }
.att-ic:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 3px 8px rgba(13,43,82,.15); }
.att-ic:disabled { opacity: .35; cursor: not-allowed; }
.att-word { color: #1d5fa8; } .att-word:hover { background: #e8f1fb; }
.att-pdf { color: #b3261e; } .att-pdf:hover { background: #fcebea; }
.att-cancel { color: #946200; } .att-cancel:hover:not(:disabled) { background: #fdf3dc; }
.att-del { color: #6b7280; } .att-del:hover { background: #f1f3f6; color: #b3261e; }
.att-ic::before { content: none !important; }
