/*
 * Panneau : fiche élève (lecture seule), registre complet des élèves et
 * rapports (fenêtres du tableau « Étudiants et encaissement »).
 * Consomme les jetons --itc-* de design-system.css.
 */

/* ── Boutons ──────────────────────────────────────────────────────────── */

.records-toolbar {
    display: flex;
    gap: 10px;
    margin-left: auto;
    flex-wrap: wrap;
}

.btn-records {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: var(--itc-radius-sm, 8px);
    border: 1px solid var(--itc-border-blue, rgba(58, 102, 190, 0.55));
    background: rgba(255, 255, 255, 0.04);
    color: #e2e8f0;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.btn-records:hover {
    border-color: var(--gold, #d4af37);
    color: var(--gold, #d4af37);
    transform: translateY(-1px);
}

.btn-records-gold {
    background: var(--itc-gold-500, #dab63e);
    border-color: var(--itc-gold-500, #dab63e);
    color: #0c183f;
}

.btn-records-gold:hover {
    background: var(--itc-gold-400, #ffe066);
    border-color: var(--itc-gold-400, #ffe066);
    color: #0c183f;
}

.btn-records:disabled {
    opacity: 0.55;
    cursor: wait;
    transform: none;
}

.btn-records:focus-visible,
.registry-name:focus-visible,
.records-field select:focus-visible,
.records-field input:focus-visible {
    outline: var(--itc-focus-ring, 2px solid #ffe066);
    outline-offset: 2px;
}

/* ── Fenêtres ─────────────────────────────────────────────────────────── */

.modal-content.records-modal {
    background: var(--itc-navy-950, #0c183f);
    border: 1px solid var(--itc-border-blue, rgba(58, 102, 190, 0.55));
    border-top: 3px solid var(--gold, #d4af37);
    border-radius: 14px;
    color: #e2e8f0;
    padding: 26px 28px;
    max-height: 92vh;
}

.modal-content.records-modal-sheet { width: 820px; max-width: calc(100vw - 32px); }
.modal-content.records-modal-wide { width: 1240px; max-width: calc(100vw - 32px); }
.modal-content.records-modal-reports { width: 900px; max-width: calc(100vw - 32px); }

.records-kicker {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--gold, #d4af37);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-bottom: 14px;
}

.records-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: #ffffff;
    margin: 0 0 18px;
}

.records-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid rgba(58, 102, 190, 0.25);
}

/* ── Fiche élève ──────────────────────────────────────────────────────── */

.sheet-head {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 22px;
}

.sheet-avatar {
    flex: 0 0 64px;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f1d36b, #c79a1e);
    color: #0c183f;
    font-size: 1.35rem;
    font-weight: 800;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.25);
}

.sheet-head-text h3 {
    margin: 0 0 8px;
    font-size: 1.4rem;
    font-weight: 800;
    color: #ffffff;
}

.sheet-head-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.sheet-chip {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #a9b8de;
    font-size: 0.72rem;
    font-weight: 700;
}

.sheet-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    border: 1px solid transparent;
}

.sheet-pill i { font-size: 0.62rem; }
.sheet-pill.is-gold { background: rgba(212, 175, 55, 0.14); border-color: rgba(212, 175, 55, 0.35); color: var(--gold, #d4af37); }
.sheet-pill.is-success { background: rgba(0, 200, 81, 0.12); border-color: rgba(0, 200, 81, 0.35); color: #34d399; }
.sheet-pill.is-danger { background: rgba(239, 68, 68, 0.14); border-color: rgba(255, 68, 68, 0.4); color: #ff6b6b; }
.sheet-pill.is-muted { background: rgba(255, 255, 255, 0.04); border-color: rgba(255, 255, 255, 0.14); color: #8ea0cc; }

.sheet-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.sheet-card {
    background: rgba(19, 37, 87, 0.45);
    border: 1px solid rgba(58, 102, 190, 0.3);
    border-radius: 12px;
    padding: 16px 18px;
    min-width: 0;
}

.sheet-card-wide { grid-column: 1 / -1; }

.sheet-card h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
    color: var(--gold, #d4af37);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.sheet-card h4 .sheet-status { margin-left: auto; letter-spacing: 0.03em; text-transform: none; }
.sheet-status.is-full { background: rgba(0, 200, 81, 0.12); border-color: rgba(0, 200, 81, 0.35); color: #34d399; }
.sheet-status.is-partial { background: rgba(245, 158, 11, 0.14); border-color: rgba(245, 158, 11, 0.4); color: #fbbf24; }
.sheet-status.is-none { background: rgba(239, 68, 68, 0.14); border-color: rgba(255, 68, 68, 0.4); color: #ff6b6b; }

.sheet-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 14px;
    padding: 8px 0;
    border-bottom: 1px dashed rgba(148, 163, 184, 0.16);
    font-size: 0.86rem;
}

.sheet-row:last-child { border-bottom: 0; }

.sheet-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #8ea0cc;
    white-space: nowrap;
}

.sheet-label i { width: 14px; text-align: center; color: #6b7fb3; }

.sheet-value {
    color: #ffffff;
    font-weight: 600;
    text-align: right;
    overflow-wrap: anywhere;
}

.sheet-row-pills {
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 6px;
    padding-top: 12px;
}

.sheet-empty {
    color: #6b7fb3;
    font-weight: 400;
    font-style: italic;
}

.sheet-tiles {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.sheet-tile {
    border-radius: 10px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.sheet-tile span {
    display: block;
    color: #8ea0cc;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.sheet-tile b {
    color: #ffffff;
    font-size: 1.15rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.sheet-tile.is-paid b { color: var(--success, #00c851); }
.sheet-tile.is-debt b { color: var(--danger, #ff4444); }

.sheet-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 14px 0 6px;
}

.sheet-progress-track {
    flex: 1;
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.sheet-progress-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #f1d36b, var(--gold, #d4af37));
}

.sheet-progress b { color: #ffffff; font-size: 0.85rem; }

.sheet-payments,
.records-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.sheet-payments { margin-top: 12px; }

.sheet-payments th,
.records-table th {
    text-align: left;
    padding: 9px 10px;
    color: #8ea0cc;
    background: var(--itc-navy-800, #132557);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
}

.sheet-payments td,
.records-table td {
    padding: 9px 10px;
    border-bottom: 1px solid rgba(58, 102, 190, 0.16);
    color: #d6def5;
    vertical-align: middle;
}

.sheet-payments .num,
.records-table .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.records-table .nowrap { white-space: nowrap; }
.records-table .is-paid { color: var(--success, #00c851); font-weight: 700; }
.records-table .is-debt { color: var(--danger, #ff4444); font-weight: 700; }
.records-table tbody tr:nth-child(even) { background: rgba(19, 37, 87, 0.3); }
.records-table tbody tr:hover { background: rgba(59, 95, 217, 0.14); }

/* ── Registre ─────────────────────────────────────────────────────────── */

.records-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
    margin-bottom: 14px;
}

.records-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 220px;
    color: #8ea0cc;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.records-field-grow { flex: 1; }

.records-field select,
.records-field input {
    padding: 10px 12px;
    border-radius: var(--itc-radius-sm, 8px);
    border: 1px solid var(--itc-border-blue, rgba(58, 102, 190, 0.55));
    background: var(--itc-navy-800, #132557);
    color: #ffffff;
    font: inherit;
    font-size: 0.88rem;
    letter-spacing: 0;
    text-transform: none;
}

.records-controls-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.records-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.records-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
    font-size: 0.78rem;
    font-weight: 700;
}

.records-chip.is-paid { color: #34d399; border-color: rgba(0, 200, 81, 0.35); }
.records-chip.is-debt { color: #ff6b6b; border-color: rgba(255, 68, 68, 0.4); }

.records-table-shell {
    max-height: 56vh;
    overflow: auto;
    border: 1px solid rgba(58, 102, 190, 0.3);
    border-radius: 10px;
}

.records-table-shell .records-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
}

.registry-name {
    background: none;
    border: 0;
    padding: 0;
    color: #ffffff;
    font: inherit;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
}

.registry-name:hover { color: var(--gold, #d4af37); text-decoration: underline; }

.registry-empty {
    text-align: center;
    color: #8ea0cc;
    padding: 28px 10px !important;
}

/* ── Rapports ─────────────────────────────────────────────────────────── */

.records-tiles {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 14px;
}

.records-tile {
    border-radius: 12px;
    padding: 14px 16px;
    background: rgba(19, 37, 87, 0.45);
    border: 1px solid rgba(58, 102, 190, 0.3);
}

.records-tile span {
    display: block;
    color: #8ea0cc;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.records-tile b {
    color: #ffffff;
    font-size: 1.2rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.records-tile.is-info b { color: var(--gold, #d4af37); }
.records-tile.is-paid b { color: var(--success, #00c851); }
.records-tile.is-debt b { color: var(--danger, #ff4444); }

.records-panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 14px;
}

.records-panel {
    background: rgba(19, 37, 87, 0.3);
    border: 1px solid rgba(58, 102, 190, 0.25);
    border-radius: 12px;
    padding: 14px 16px;
}

.records-panel h4 {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin: 0 0 12px;
    color: var(--gold, #d4af37);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.records-panel h4 em {
    margin-left: auto;
    font-style: normal;
    color: #ffffff;
    letter-spacing: 0;
    text-transform: none;
    font-size: 0.8rem;
}

.records-bar {
    display: grid;
    grid-template-columns: 150px 1fr 34px;
    align-items: center;
    gap: 10px;
    padding: 5px 0;
    font-size: 0.8rem;
}

.records-bar-label { color: #c3cdea; }
.records-bar b { text-align: right; color: #ffffff; }

.records-bar-track {
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.records-bar-fill { height: 100%; border-radius: inherit; }
.records-bar-fill.is-paid { background: linear-gradient(90deg, #34d399, var(--success, #00c851)); }
.records-bar-fill.is-gold { background: linear-gradient(90deg, #f1d36b, var(--gold, #d4af37)); }
.records-bar-fill.is-debt { background: linear-gradient(90deg, #ff6b6b, var(--danger, #ff4444)); }

.records-note {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 14px 0 0;
    color: #8ea0cc;
    font-size: 0.8rem;
}

@media (max-width: 720px) {
    .modal-content.records-modal { padding: 22px 16px; }
    .sheet-grid,
    .records-panels { grid-template-columns: 1fr; }
    .sheet-tiles,
    .records-tiles { grid-template-columns: 1fr 1fr; }
    .records-toolbar { margin-left: 0; width: 100%; }
    .records-toolbar .btn-records { flex: 1; justify-content: center; min-height: 44px; }
    .records-field { min-width: 0; width: 100%; }
    .records-bar { grid-template-columns: 110px 1fr 30px; }
}
