/* Thème admin — ambiance école joyeuse (polices chargées dans layouts/admin.blade.php) */

:root {
    --school-sky: #4dabf7;
    --school-sky-dark: #339af0;
    --school-sun: #ffd43b;
    --school-sun-dark: #fab005;
    --school-grass: #69db7c;
    --school-grass-dark: #51cf66;
    --school-berry: #ff6b9d;
    --school-lilac: #b197fc;
    --school-cream: #fff9ed;
    --school-cream-dark: #fff0c4;
    --school-ink: #2d3748;
    --school-muted: #64748b;
    --school-white: #ffffff;
    --school-shadow: 0 8px 24px rgba(45, 55, 72, 0.08);
    --school-radius: 1.25rem;
    --font-display: 'Fredoka', system-ui, sans-serif;
    --font-body: 'Nunito', system-ui, sans-serif;
}

* {
    box-sizing: border-box;
}

.school-body {
    font-family: var(--font-body);
    color: var(--school-ink);
    min-height: 100vh;
    background-color: var(--school-cream);
    background-image:
        radial-gradient(circle at 12% 8%, rgba(77, 171, 247, 0.18) 0%, transparent 42%),
        radial-gradient(circle at 88% 12%, rgba(255, 212, 59, 0.22) 0%, transparent 38%),
        radial-gradient(circle at 75% 85%, rgba(105, 219, 124, 0.15) 0%, transparent 40%),
        url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='2' cy='2' r='1.2' fill='%23ffd43b' opacity='0.35'/%3E%3C/svg%3E");
    background-size: auto, auto, auto, 24px 24px;
}

.school-header {
    background: linear-gradient(135deg, var(--school-sky) 0%, #74c0fc 45%, var(--school-lilac) 100%);
    color: var(--school-white);
    box-shadow: 0 4px 20px rgba(51, 154, 240, 0.35);
    position: relative;
    overflow: hidden;
}

.school-header::before,
.school-header::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    pointer-events: none;
}

.school-header::before {
    width: 120px;
    height: 120px;
    top: -40px;
    right: 8%;
}

.school-header::after {
    width: 80px;
    height: 80px;
    bottom: -30px;
    left: 15%;
}

.school-header-inner {
    max-width: 72rem;
    margin: 0 auto;
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    position: relative;
    z-index: 1;
}

.school-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: inherit;
}

.school-brand-icon {
    font-size: 2.25rem;
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
    animation: school-wave 2.5s ease-in-out infinite;
}

@keyframes school-wave {
    0%, 100% { transform: rotate(-3deg); }
    50% { transform: rotate(6deg); }
}

.school-brand-title {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.15;
    display: block;
}

.school-brand-sub {
    font-size: 0.75rem;
    opacity: 0.92;
    font-weight: 600;
}

.school-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.school-user button {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.5);
    color: white;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.8rem;
    transition: background 0.15s;
}

.school-user button:hover {
    background: rgba(255, 255, 255, 0.35);
}

/* ——— Layout sidebar + contenu ——— */
.school-app {
    display: flex;
    min-height: 100vh;
}

.school-sidebar {
    width: 17.5rem;
    flex-shrink: 0;
    background: var(--school-white);
    border-right: 3px solid var(--school-cream-dark);
    box-shadow: 4px 0 20px rgba(45, 55, 72, 0.06);
    display: flex;
    flex-direction: column;
    padding: 1.25rem 0.85rem;
    position: sticky;
    top: 0;
    align-self: flex-start;
    height: 100vh;
    overflow-y: auto;
    z-index: 200;
}

.school-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    text-decoration: none;
    color: var(--school-ink);
    padding: 0.5rem 0.65rem 1rem;
    border-bottom: 2px dashed var(--school-cream-dark);
    margin-bottom: 0.25rem;
}

.school-sidebar-brand .school-brand-title {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.2;
    display: block;
    color: var(--school-ink);
}

.school-sidebar-brand .school-brand-sub {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--school-muted);
}

.school-sidebar-brand .school-brand-icon {
    font-size: 2rem;
    animation: school-wave 2.5s ease-in-out infinite;
}

.school-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    flex: 1;
    padding: 0.5rem 0;
}

.school-sidebar-footer {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 2px dashed var(--school-cream-dark);
}

.school-sidebar-user {
    font-size: 0.85rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
    padding: 0 0.65rem;
}

.school-sidebar-logout {
    width: 100%;
    padding: 0.5rem 0.85rem;
    border-radius: 0.75rem;
    border: 2px solid var(--school-cream-dark);
    background: var(--school-cream);
    font-family: inherit;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    color: var(--school-ink);
    transition: background 0.15s;
}

.school-sidebar-logout:hover {
    background: #ffe8e8;
    border-color: #ffc9c9;
}

.school-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.school-main {
    flex: 1;
    width: 100%;
    max-width: 56rem;
    margin: 0 auto;
    padding: 1.25rem 1.5rem 2rem;
}

.school-body--sidebar .school-content .school-main {
    max-width: none;
    padding: 1.5rem 2rem 2rem;
}

.school-mobile-bar {
    display: none;
    padding: 0.75rem 1rem;
    background: var(--school-white);
    border-bottom: 2px solid var(--school-cream-dark);
}

.school-menu-toggle {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.5rem 1rem;
    border-radius: 0.75rem;
    border: 2px solid var(--school-sky);
    background: white;
    color: var(--school-sky-dark);
    cursor: pointer;
}

.school-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(45, 55, 72, 0.35);
    z-index: 150;
}

.school-nav-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    padding: 0.65rem 0.85rem;
    border-radius: 0.85rem;
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
    color: var(--school-ink);
    background: transparent;
    border: 2px solid transparent;
    transition: background 0.12s, transform 0.12s, border-color 0.12s;
}

.school-nav-icon {
    font-size: 1.15rem;
    line-height: 1;
    width: 1.5rem;
    text-align: center;
    flex-shrink: 0;
}

.school-nav-link:hover {
    background: var(--school-cream);
    transform: translateX(3px);
}

.school-nav-link--active {
    background: var(--school-sky);
    color: white;
    border-color: var(--school-sky-dark);
}

.school-nav-link--cta {
    background: linear-gradient(135deg, var(--school-grass), var(--school-grass-dark));
    color: white;
    border-color: #40c057;
    box-shadow: 0 4px 14px rgba(64, 192, 87, 0.35);
}

.school-nav-link--cta.school-nav-link--active {
    background: linear-gradient(135deg, #40c057, #2f9e44);
}

.school-page-title {
    font-family: var(--font-display);
    font-size: 1.85rem;
    font-weight: 700;
    color: var(--school-ink);
    margin: 0 0 0.35rem;
}

.school-page-sub {
    color: var(--school-muted);
    margin-bottom: 1.75rem;
    font-weight: 600;
}

.school-card {
    background: var(--school-white);
    border-radius: var(--school-radius);
    box-shadow: var(--school-shadow);
    padding: 1.5rem;
    border: 3px solid var(--school-cream-dark);
    position: relative;
    overflow: hidden;
}

.school-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--school-sky), var(--school-sun), var(--school-grass));
}

.school-card--sky::before { background: var(--school-sky); }
.school-card--sun::before { background: var(--school-sun); }
.school-card--grass::before { background: var(--school-grass); }
.school-card--berry::before { background: var(--school-berry); }
.school-card--lilac::before { background: var(--school-lilac); }

/* Bulles d'aide (?) : ne pas couper le contenu */
.school-card:has(.school-help) {
    overflow: visible;
}

.school-check-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 700;
    cursor: pointer;
    margin-bottom: 1rem;
}

.school-check-row input[type="checkbox"] {
    width: 1.15rem;
    height: 1.15rem;
    accent-color: var(--school-lilac);
}

.school-bus-fields[hidden] {
    display: none !important;
}

.school-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.school-stat {
    background: var(--school-white);
    border-radius: var(--school-radius);
    padding: 1.25rem;
    border: 3px solid var(--school-cream-dark);
    box-shadow: var(--school-shadow);
    text-decoration: none;
    color: inherit;
    display: block;
    transition: transform 0.15s, border-color 0.15s;
}

.school-stat:hover {
    transform: translateY(-3px) scale(1.01);
    border-color: var(--school-sky);
}

.school-stat-icon {
    font-size: 1.75rem;
    margin-bottom: 0.35rem;
}

.school-stat-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--school-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.school-stat-value {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--school-sky-dark);
    line-height: 1.2;
}

.school-stat-link {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--school-sky-dark);
    margin-top: 0.5rem;
}

.school-section-title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--school-sky-dark);
    margin: 0 0 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.school-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
    color: var(--school-ink);
}

.school-input,
.school-select,
.school-textarea {
    width: 100%;
    border: 2px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 0.55rem 0.85rem;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    background: #fafafa;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.school-input:focus,
.school-select:focus,
.school-textarea:focus {
    outline: none;
    border-color: var(--school-sky);
    box-shadow: 0 0 0 3px rgba(77, 171, 247, 0.25);
    background: white;
}

.school-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.65rem 1.35rem;
    border-radius: 999px;
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: transform 0.12s, box-shadow 0.12s;
}

.school-btn:hover {
    transform: translateY(-2px);
}

.school-btn-primary {
    background: linear-gradient(135deg, var(--school-sky), var(--school-sky-dark));
    color: white;
    box-shadow: 0 6px 18px rgba(51, 154, 240, 0.4);
}

.school-btn-success {
    background: linear-gradient(135deg, var(--school-grass), var(--school-grass-dark));
    color: white;
    box-shadow: 0 6px 18px rgba(64, 192, 87, 0.35);
}

.school-btn-sun {
    background: linear-gradient(135deg, var(--school-sun), var(--school-sun-dark));
    color: #5c4a00;
    box-shadow: 0 6px 18px rgba(250, 176, 5, 0.35);
}

.school-btn-outline {
    background: white;
    color: var(--school-sky-dark);
    border: 2px solid var(--school-sky);
}

.school-btn-ghost {
    background: var(--school-cream);
    color: var(--school-ink);
    border: 2px solid var(--school-cream-dark);
}

.school-btn-block {
    width: 100%;
}

.school-link-back {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--school-sky-dark);
    font-weight: 700;
    text-decoration: none;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.school-link-back:hover {
    text-decoration: underline;
}

.school-table-wrap {
    background: var(--school-white);
    border-radius: var(--school-radius);
    box-shadow: var(--school-shadow);
    border: 3px solid var(--school-cream-dark);
    overflow: hidden;
}

.school-table {
    width: 100%;
    font-size: 0.875rem;
    border-collapse: collapse;
}

.school-table thead {
    background: linear-gradient(90deg, #e7f5ff, #fff9db);
}

.school-table th {
    padding: 0.85rem 1rem;
    text-align: left;
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--school-ink);
}

.school-table td {
    padding: 0.75rem 1rem;
    border-top: 2px dashed #f1f5f9;
}

.school-table tbody tr:hover {
    background: #f8fafc;
}

.school-table a {
    color: var(--school-sky-dark);
    font-weight: 700;
    text-decoration: none;
}

.school-table a:hover {
    text-decoration: underline;
}

.school-alert {
    border-radius: var(--school-radius);
    padding: 0.85rem 1.15rem;
    margin-bottom: 1.25rem;
    font-weight: 700;
    border: 2px solid;
}

.school-alert-success {
    background: #ebfbee;
    border-color: var(--school-grass);
    color: #2b8a3e;
}

.school-alert-error {
    background: #fff5f5;
    border-color: #ff8787;
    color: #c92a2a;
}

.school-alert-warn {
    background: #fff9db;
    border-color: var(--school-sun);
    color: #862e00;
}

.school-banner-access {
    background: linear-gradient(135deg, #fff4e6 0%, #ffe8cc 100%);
    border: 2px solid #fd7e14;
    border-radius: var(--school-radius-sm);
    padding: 0.85rem 1rem;
    color: #9c4a00;
    font-weight: 600;
    font-size: 0.9rem;
}

.school-banner-allergy {
    background: linear-gradient(90deg, #fff9db, #ffe8cc);
    border: 3px solid var(--school-sun);
    border-radius: var(--school-radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.school-login-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 120px);
}

.school-login-card {
    max-width: 26rem;
    width: 100%;
    text-align: center;
}

.school-login-card .school-brand-icon {
    font-size: 4rem;
    display: block;
    margin-bottom: 0.5rem;
}

.school-login-card h1 {
    font-family: var(--font-display);
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
}

.school-empty {
    text-align: center;
    padding: 2.5rem 1rem;
}

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

.school-footer {
    text-align: center;
    padding: 1rem 1.5rem 1.5rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--school-muted);
    margin-top: auto;
}

@media (max-width: 960px) {
    .school-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        transform: translateX(-105%);
        transition: transform 0.25s ease;
        box-shadow: 8px 0 32px rgba(0, 0, 0, 0.15);
    }

    .school-sidebar.is-open {
        transform: translateX(0);
    }

    .school-sidebar-backdrop {
        display: block;
    }

    .school-sidebar-backdrop[hidden] {
        display: none;
    }

    .school-mobile-bar {
        display: block;
    }

    .school-body--sidebar .school-content .school-main {
        padding: 1rem 1.25rem 1.5rem;
    }
}

.school-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.school-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.school-pre {
    font-size: 0.75rem;
    background: var(--school-cream);
    padding: 1rem;
    border-radius: 0.75rem;
    overflow-x: auto;
    border: 2px dashed var(--school-cream-dark);
}

.school-photo {
    width: 5rem;
    height: 5rem;
    border-radius: 1rem;
    object-fit: cover;
    border: 3px solid var(--school-sun);
}

.school-dl dt {
    color: var(--school-muted);
    font-weight: 700;
    font-size: 0.8rem;
}

.school-dl dd {
    font-weight: 600;
    margin: 0 0 0.5rem;
}

.school-grid-2 {
    display: grid;
    gap: 1rem;
}

.school-toolbar .school-page-sub {
    margin-bottom: 0;
}

@media (min-width: 768px) {
    .school-grid-2 {
        grid-template-columns: repeat(2, 1fr);
    }

    .school-form-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .school-form-grid .span-2 {
        grid-column: span 2;
    }
}

.school-form-stack > * + * {
    margin-top: 1.25rem;
}

.school-input-affix {
    position: relative;
}

.school-input-affix .school-input {
    padding-right: 4.5rem;
}

.school-input-affix span {
    position: absolute;
    right: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--school-muted);
    font-size: 0.75rem;
    font-weight: 800;
    pointer-events: none;
}

.school-hint {
    font-size: 0.8rem;
    color: var(--school-muted);
    margin-top: 0.35rem;
    font-weight: 600;
}

.bus-lines-layout {
    align-items: start;
}

@media (min-width: 980px) {
    .bus-lines-layout {
        grid-template-columns: minmax(18rem, 0.78fr) minmax(0, 1.35fr);
    }
}

.bus-line-item {
    border: 2px solid #e8eef7;
    border-radius: 0.85rem;
    background: #fff;
    overflow: hidden;
}

.bus-line-item + .bus-line-item {
    margin-top: 0.75rem;
}

.bus-line-item[open] {
    border-color: rgba(77, 171, 247, 0.45);
    box-shadow: 0 10px 24px rgba(45, 55, 72, 0.07);
}

.bus-line-summary {
    display: grid;
    grid-template-columns: minmax(12rem, 1fr) auto auto;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1rem;
    cursor: pointer;
    list-style: none;
}

.bus-line-summary::-webkit-details-marker {
    display: none;
}

.bus-line-summary__main {
    min-width: 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.bus-line-summary__main strong {
    font-size: 1rem;
}

.bus-line-summary__desc {
    flex-basis: 100%;
    color: var(--school-muted);
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.35;
}

.bus-line-summary__prices {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
}

.bus-line-price {
    min-width: 7.2rem;
    padding: 0.5rem 0.65rem;
    border-radius: 0.65rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.bus-line-price span {
    display: block;
    color: var(--school-muted);
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.bus-line-price strong {
    display: block;
    margin-top: 0.1rem;
    color: var(--school-ink);
    font-size: 0.86rem;
    line-height: 1.2;
}

.bus-line-summary__action {
    padding: 0.45rem 0.7rem;
    border-radius: 999px;
    background: var(--school-cream);
    border: 2px solid var(--school-cream-dark);
    color: var(--school-sky-dark);
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
}

.bus-line-edit {
    padding: 1rem;
    border-top: 2px dashed #edf2f7;
    background: #fbfdff;
}

.bus-line-empty {
    padding: 1rem;
    border: 2px dashed var(--school-cream-dark);
    border-radius: 0.85rem;
    background: var(--school-cream);
}

@media (max-width: 860px) {
    .bus-line-summary {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .bus-line-summary__prices {
        justify-content: stretch;
    }

    .bus-line-price {
        flex: 1 1 9rem;
    }

    .bus-line-summary__action {
        justify-self: start;
    }
}

/* Paramètres école */
.settings-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.settings-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.settings-summary-card {
    display: block;
    position: relative;
    min-height: 7rem;
    padding: 1rem;
    border-radius: 0.9rem;
    background: #fff;
    border: 2px solid var(--school-cream-dark);
    box-shadow: var(--school-shadow);
    color: inherit;
    text-decoration: none;
}

.settings-summary-card:hover {
    border-color: var(--school-sky);
}

.settings-summary-card__icon {
    position: absolute;
    top: 0.75rem;
    right: 0.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.7rem;
    font-size: 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.settings-summary-card__label {
    display: block;
    padding-right: 2.4rem;
    color: var(--school-muted);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.settings-summary-card strong {
    display: block;
    margin-top: 0.35rem;
    font-family: var(--font-display);
    font-size: 1.55rem;
    line-height: 1.05;
    color: var(--school-sky-dark);
}

.settings-summary-card span:last-child {
    display: block;
    margin-top: 0.35rem;
    color: var(--school-muted);
    font-size: 0.8rem;
    font-weight: 700;
}

.settings-summary-card--warning {
    border-color: #ffc078;
    background: #fff9f0;
}

.settings-summary-card--warning strong {
    color: #d9480f;
}

.settings-summary-card--classes {
    border-color: rgba(77, 171, 247, 0.38);
    background: linear-gradient(135deg, #fff, #f0f8ff);
}

.settings-summary-card--classes .settings-summary-card__icon {
    background: #e7f5ff;
    border-color: #a5d8ff;
}

.settings-summary-card--offers {
    border-color: rgba(255, 193, 7, 0.48);
    background: linear-gradient(135deg, #fff, #fff9db);
}

.settings-summary-card--offers .settings-summary-card__icon {
    background: #fff4e6;
    border-color: #ffc078;
}

.settings-summary-card--billing {
    border-color: rgba(105, 219, 124, 0.48);
    background: linear-gradient(135deg, #fff, #ebfbee);
}

.settings-summary-card--billing .settings-summary-card__icon {
    background: #ebfbee;
    border-color: #8ce99a;
}

.settings-summary-card--qr {
    border-color: rgba(177, 151, 252, 0.5);
    background: linear-gradient(135deg, #fff, #f3f0ff);
}

.settings-summary-card--qr .settings-summary-card__icon {
    background: #f3f0ff;
    border-color: #d0bfff;
}

.settings-nav {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: 0.65rem 0;
    margin-bottom: 1rem;
    background: rgba(255, 249, 237, 0.88);
    backdrop-filter: blur(8px);
}

.settings-nav__item {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    min-height: 2.1rem;
    padding: 0.32rem 0.62rem;
    border-radius: 999px;
    border: 2px solid var(--school-cream-dark);
    background: #fff;
    color: var(--school-ink);
    font-size: 0.78rem;
    font-weight: 800;
    text-decoration: none;
}

.settings-nav__item span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.18rem;
    height: 1.18rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.78);
    font-size: 0.72rem;
}

.settings-nav__item:hover {
    transform: translateY(-1px);
}

.settings-nav__item--classes {
    border-color: #a5d8ff;
    background: #e7f5ff;
    color: #1864ab;
}

.settings-nav__item--offers {
    border-color: #ffd8a8;
    background: #fff4e6;
    color: #d9480f;
}

.settings-nav__item--billing {
    border-color: #b2f2bb;
    background: #ebfbee;
    color: #2b8a3e;
}

.settings-nav__item--qr {
    border-color: #d0bfff;
    background: #f3f0ff;
    color: #5f3dc4;
}

.settings-nav__item--canteen {
    border-color: #ffe066;
    background: #fff9db;
    color: #a16207;
}

.settings-nav__item--staff {
    border-color: #ffc9c9;
    background: #fff0f6;
    color: #a61e4d;
}

.settings-grid {
    display: grid;
    gap: 1rem;
    margin-bottom: 1rem;
}

@media (min-width: 1100px) {
    .settings-grid {
        grid-template-columns: minmax(0, 1fr) minmax(22rem, 0.82fr);
    }

    .settings-grid--primary {
        grid-template-columns: minmax(30rem, 0.98fr) minmax(24rem, 1.02fr);
    }
}

.settings-panel {
    scroll-margin-top: 5rem;
}

.settings-panel--wide {
    margin-bottom: 1rem;
    scroll-margin-top: 5rem;
}

.settings-panel--wide > .school-card {
    max-width: none !important;
}

.settings-panel__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.settings-panel__header .school-section-title {
    margin-bottom: 0.35rem;
}

.settings-add-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.75rem;
    align-items: center;
}

.settings-class-list .class-sortable-item {
    margin-bottom: 0.45rem;
}

.settings-class-list .js-delete-class {
    padding: 0.35rem 0.7rem;
    font-size: 0.78rem;
}

@media (max-width: 720px) {
    .settings-page-header {
        flex-direction: column;
    }

    .settings-page-header .school-btn {
        width: 100%;
    }

    .settings-nav {
        position: static;
    }

    .settings-add-row {
        grid-template-columns: 1fr;
    }

    .settings-add-row .school-btn {
        width: 100%;
    }

    .settings-class-list .class-sortable-item {
        display: grid;
        grid-template-columns: auto auto minmax(0, 1fr);
    }

    .settings-class-list .js-delete-class {
        grid-column: 3;
        justify-self: start;
    }
}

.school-pagination-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.65rem;
    margin: 1.25rem 0;
}

.school-pagination-info {
    margin: 0;
    font-size: 0.85rem;
    color: var(--school-muted);
    font-weight: 600;
    text-align: center;
}

.school-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

.school-pagination__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    min-height: 2.25rem;
    padding: 0.35rem 0.75rem;
    border-radius: 0.55rem;
    border: 1px solid var(--school-border, #dbe4f0);
    background: #fff;
    color: var(--school-text, #1e3a5f);
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.school-pagination__btn:hover:not(.is-disabled):not(.is-active) {
    background: var(--school-bg-soft, #f4f8fc);
    border-color: var(--school-primary, #2563eb);
    color: var(--school-primary, #2563eb);
}

.school-pagination__btn.is-active {
    background: var(--school-primary, #2563eb);
    border-color: var(--school-primary, #2563eb);
    color: #fff;
    cursor: default;
}

.school-pagination__btn.is-disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.school-pagination__dots {
    padding: 0 0.25rem;
    color: var(--school-muted);
    font-weight: 700;
}

/* Aide contextuelle (? au survol) */
.school-section-title-row {
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 0.35rem 0.5rem;
    margin-bottom: 1rem;
}

.school-section-title-row .school-section-title {
    margin-bottom: 0;
}

.school-label-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.2rem 0.35rem;
    margin-bottom: 0.4rem;
}

.school-label-row .school-label {
    margin-bottom: 0;
}

.school-label-row--actions {
    margin-top: 0.35rem;
    margin-bottom: 0.25rem;
}

.school-help {
    position: relative;
    display: inline-flex;
    vertical-align: middle;
    flex-shrink: 0;
}

.school-help__btn {
    width: 1.4rem;
    height: 1.4rem;
    border-radius: 50%;
    border: 2px solid var(--school-sky-dark, #3b82c4);
    background: #fff;
    color: var(--school-sky-dark, #3b82c4);
    font-weight: 800;
    font-size: 0.8rem;
    line-height: 1;
    padding: 0;
    cursor: help;
    font-family: var(--font-display, Fredoka, sans-serif);
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.06);
    transition: transform 0.15s ease, background 0.15s ease;
}

.school-help__btn:hover,
.school-help__btn:focus {
    outline: none;
    background: var(--school-sky, #e8f4fc);
    transform: scale(1.08);
}

.school-help__popover {
    position: absolute;
    z-index: 200;
    top: calc(100% + 0.5rem);
    left: 0;
    width: min(22rem, calc(100vw - 2.5rem));
    max-height: min(70vh, 24rem);
    overflow-y: auto;
    padding: 0.85rem 1rem;
    border-radius: 0.85rem;
    border: 2px solid var(--school-sky-dark, #3b82c4);
    background: #fff;
    box-shadow: 0 12px 28px rgba(30, 58, 90, 0.18);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--school-ink, #2d3748);
    line-height: 1.45;
    text-align: left;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s ease, visibility 0.15s ease;
}

.school-help__popover::before {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 0.45rem;
    border: 7px solid transparent;
    border-bottom-color: var(--school-sky-dark, #3b82c4);
}

.school-help:hover .school-help__popover,
.school-help:focus-within .school-help__popover {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.school-help__lead {
    margin: 0 0 0.65rem;
    font-size: 0.82rem;
}

.school-help__heading {
    margin: 0.5rem 0 0.25rem;
    font-family: var(--font-display, Fredoka, sans-serif);
    font-size: 0.8rem;
    color: var(--school-sky-dark, #3b82c4);
}

.school-help__list {
    margin: 0 0 0.35rem;
    padding-left: 1.1rem;
}

.school-help__list--ordered {
    padding-left: 1.25rem;
}

.school-help__list li + li {
    margin-top: 0.2rem;
}

.school-help__note {
    margin: 0.5rem 0 0;
    font-size: 0.72rem;
    color: var(--school-muted, #718096);
}

/* Liste classes réordonnable (paramètres) */
.class-sortable-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.class-sortable-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.6rem;
    margin-bottom: 0.35rem;
    background: var(--school-cream);
    border-radius: 0.65rem;
    border: 2px solid transparent;
    cursor: grab;
}

.class-sortable-item.is-dragging {
    opacity: 0.65;
    border-color: var(--school-sky-dark);
    cursor: grabbing;
}

.class-sortable-handle {
    color: var(--school-muted);
    font-weight: 800;
    font-size: 0.85rem;
    user-select: none;
    flex-shrink: 0;
    cursor: grab;
}

.class-sortable-move {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    flex-shrink: 0;
}

.class-sort-btn {
    padding: 0.15rem 0.4rem !important;
    font-size: 0.7rem !important;
    line-height: 1;
    min-width: 1.6rem;
}

.class-sortable-input {
    flex: 1;
    min-width: 0;
}

.school-help__popover kbd {
    display: inline-block;
    padding: 0.1rem 0.35rem;
    border-radius: 0.25rem;
    border: 1px solid #cbd5e0;
    background: var(--school-cream, #fffbeb);
    font-size: 0.7rem;
    font-family: inherit;
}

/* Pagination Laravel */
.school-main nav[role="navigation"] {
    margin-top: 1rem;
}

.school-main nav[role="navigation"] a,
.school-main nav[role="navigation"] span {
    border-radius: 999px !important;
    font-weight: 700;
}

/* Fiche élève — profil */
.school-student-profile__hero {
    display: grid;
    gap: 1.25rem;
    align-items: center;
    margin-bottom: 1.5rem;
}

@media (min-width: 640px) {
    .school-student-profile__hero {
        grid-template-columns: auto 1fr auto;
    }
}

.school-student-profile__avatar {
    position: relative;
    width: 6.5rem;
    height: 6.5rem;
    border-radius: 1.25rem;
    overflow: hidden;
    background: linear-gradient(145deg, var(--school-sky-light, #e8f4fc), var(--school-lilac-light, #f3e8ff));
    border: 3px solid var(--school-sky, #4dabf7);
    box-shadow: 0 4px 14px rgba(45, 74, 111, 0.12);
}

.school-student-profile__avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.school-student-profile__avatar-img.is-hidden {
    display: none;
}

.school-student-profile__avatar-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--school-ink, #2d4a6f);
}

.school-student-profile__avatar-fallback.is-hidden {
    display: none;
}

.school-student-profile__role {
    margin: 0 0 0.35rem;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--school-muted);
}

.school-student-profile__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.school-chip {
    display: inline-block;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    background: var(--school-cream, #fffbeb);
    border: 2px solid var(--school-cream-dark, #fde68a);
    color: var(--school-ink);
}

.school-chip--sky {
    background: var(--school-sky-light, #e8f4fc);
    border-color: var(--school-sky, #4dabf7);
}

.school-student-profile__balance {
    text-align: left;
    padding: 1rem 1.15rem;
    border-radius: 1rem;
    background: linear-gradient(135deg, #ecfdf3 0%, #d3f9d8 100%);
    border: 2px solid var(--school-grass, #51cf66);
    min-width: 10rem;
}

@media (min-width: 640px) {
    .school-student-profile__balance {
        text-align: right;
    }
}

.school-student-profile__balance-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--school-grass-dark, #2b8a3e);
    margin-bottom: 0.15rem;
}

.school-student-profile__balance-value {
    font-family: var(--font-display);
    font-size: 1.65rem;
    font-weight: 700;
    color: var(--school-grass-dark, #2b8a3e);
    line-height: 1.1;
}

.school-student-profile__balance-value small {
    font-size: 0.85rem;
    font-weight: 700;
}

.school-student-profile__facts {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: 1fr;
    margin-bottom: 1.5rem;
}

@media (min-width: 640px) {
    .school-student-profile__facts {
        grid-template-columns: repeat(2, 1fr);
    }
}

.school-info-tile {
    padding: 0.85rem 1rem;
    border-radius: 0.85rem;
    background: rgba(255, 255, 255, 0.65);
    border: 2px solid rgba(45, 74, 111, 0.08);
}

.school-info-tile--wide {
    grid-column: 1 / -1;
}

.school-info-tile__label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--school-muted);
    margin-bottom: 0.2rem;
}

.school-info-tile__value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--school-ink);
    line-height: 1.35;
}

.school-student-profile__contacts-title {
    margin: 0 0 0.75rem;
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--school-muted);
}

.school-contact-card {
    padding: 1rem 1.1rem;
    border-radius: 1rem;
    background: #fff;
    border: 2px solid rgba(45, 74, 111, 0.1);
    margin-bottom: 0.65rem;
}

.school-contact-card:last-child {
    margin-bottom: 0;
}

.school-contact-card__head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.school-contact-card__name {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--school-ink);
}

.school-contact-card__relation {
    margin: 0.15rem 0 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--school-muted);
}

.school-contact-card__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    flex-shrink: 0;
}

.school-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.school-badge--urgent {
    background: #fff5f5;
    color: #c92a2a;
    border: 1px solid #ffc9c9;
}

.school-badge--info {
    background: var(--school-sky-light, #e8f4fc);
    color: var(--school-ink);
    border: 1px solid var(--school-sky, #4dabf7);
}

.school-contact-card__lines {
    list-style: none;
    margin: 0;
    padding: 0;
}

.school-contact-card__lines li + li {
    margin-top: 0.35rem;
}

.school-contact-link {
    font-weight: 700;
    color: var(--school-sky-dark, #1971c2);
    text-decoration: none;
    word-break: break-word;
}

.school-contact-link:hover {
    text-decoration: underline;
}

/* —— Cartes PVC élèves (liste) —— */
.student-pvc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(17.5rem, 1fr));
    gap: 1.25rem;
}

.student-pvc-card {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    aspect-ratio: 1.586 / 1;
    min-height: 12.75rem;
    padding: 0;
    border-radius: 0.85rem;
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 55%, #eef4ff 100%);
    border: 2px solid rgba(51, 154, 240, 0.22);
    box-shadow:
        0 4px 14px rgba(45, 55, 72, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.95);
    color: inherit;
    overflow: hidden;
}

.student-pvc-card--back {
    background: linear-gradient(155deg, #edf2ff 0%, #ffffff 45%, #f8fafc 100%);
    overflow: hidden;
}

.student-pvc-flip {
    perspective: 1200px;
    aspect-ratio: 1.586 / 1;
    min-height: 12.75rem;
    border-radius: 0.85rem;
}

.student-pvc-flip--low-balance {
    box-shadow:
        0 0 0 3px rgba(253, 126, 20, 0.35),
        0 4px 14px rgba(45, 55, 72, 0.1);
}

.student-pvc-flip--low-balance .student-pvc-card {
    border-color: rgba(253, 126, 20, 0.65);
}

.student-pvc-flip:hover .student-pvc-card:not(.student-pvc-card--back) {
    border-color: rgba(51, 154, 240, 0.45);
    box-shadow:
        0 12px 28px rgba(51, 154, 240, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.student-pvc-flip__inner {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 12.75rem;
    transform-style: preserve-3d;
    transition: transform 0.55s cubic-bezier(0.4, 0.2, 0.2, 1);
}

.student-pvc-flip.is-flipped .student-pvc-flip__inner {
    transform: rotateY(180deg);
}

.student-pvc-flip__face {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.student-pvc-flip__face--front {
    z-index: 2;
}

.student-pvc-flip__face--back {
    transform: rotateY(180deg);
    z-index: 1;
}

.student-pvc-flip:not(.is-flipped) .student-pvc-flip__face--back {
    pointer-events: none;
}

.student-pvc-flip.is-flipped .student-pvc-flip__face--front {
    pointer-events: none;
    z-index: 1;
}

.student-pvc-flip.is-flipped .student-pvc-flip__face--back {
    z-index: 2;
}

.student-pvc-card__header--back {
    background: linear-gradient(90deg, #495057 0%, #343a40 100%);
    flex-wrap: wrap;
    gap: 0.25rem 0.4rem;
}

.student-pvc-card__alert-badge {
    position: absolute;
    top: 2.1rem;
    right: 0.45rem;
    z-index: 5;
    font-size: 0.58rem;
    font-weight: 800;
    padding: 0.15rem 0.4rem;
    border-radius: 999px;
    background: #fff5f5;
    color: #c92a2a;
    border: 1px solid rgba(201, 42, 42, 0.25);
}

.student-pvc-flip__btn--back {
    position: relative;
    z-index: 3;
    flex-shrink: 0;
    margin-right: auto;
    padding: 0.12rem 0.35rem;
    font-size: 0.58rem;
    border-color: rgba(255, 255, 255, 0.45);
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    cursor: pointer;
}

.student-pvc-flip__btn--back:hover {
    background: rgba(255, 255, 255, 0.22);
    border-color: #fff;
    color: #fff;
}

.student-pvc-card__back-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.3rem 0.5rem 0.45rem;
    min-height: 0;
    z-index: 2;
}

.student-pvc-card__qr {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem;
    background: #fff;
    border-radius: 0.5rem;
    border: 2px solid rgba(51, 154, 240, 0.2);
    box-shadow: 0 2px 8px rgba(45, 55, 72, 0.08);
    width: 5.75rem;
    height: 5.75rem;
    flex-shrink: 0;
}

.student-pvc-card__qr img,
.student-pvc-card__qr canvas {
    display: block;
    width: 5rem !important;
    height: 5rem !important;
    max-width: 5rem;
    max-height: 5rem;
}

.student-pvc-card__back-text {
    text-align: center;
    flex-shrink: 0;
    width: 100%;
    line-height: 1.2;
}

.student-pvc-card__back-title {
    margin: 0;
    font-size: 0.58rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--school-muted);
}

.student-pvc-card__back-name {
    margin: 0.12rem 0 0;
    font-size: 0.68rem;
    font-weight: 800;
    color: var(--school-ink);
    line-height: 1.15;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.student-pvc-card__back-class {
    margin: 0.08rem 0 0;
    font-size: 0.62rem;
    font-weight: 700;
    color: var(--school-sky-dark);
    line-height: 1.15;
}

.student-pvc-card__footer--back {
    justify-content: center;
    gap: 0.65rem;
}

.student-pvc-card__footer--back .student-pvc-flip__btn {
    margin-left: 0;
}

.student-pvc-flip__btn {
    flex-shrink: 0;
    margin-left: auto;
    padding: 0.2rem 0.45rem;
    border-radius: 999px;
    border: 2px solid rgba(51, 154, 240, 0.35);
    background: #fff;
    color: var(--school-sky-dark);
    font-size: 0.62rem;
    font-weight: 800;
    cursor: pointer;
    font-family: var(--font-body);
    transition: background 0.15s ease, border-color 0.15s ease;
}

.student-pvc-flip__btn:hover {
    background: #e7f5ff;
    border-color: var(--school-sky-dark);
}

.student-pvc-card__profile-link {
    flex-shrink: 0;
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--school-sky-dark);
    text-decoration: none;
}

.student-pvc-card__profile-link:hover {
    text-decoration: underline;
}

.student-pvc-card__stat-value--warn {
    color: #c92a2a;
}

.student-pvc-card__shine {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        115deg,
        transparent 38%,
        rgba(255, 255, 255, 0.55) 48%,
        transparent 58%
    );
    opacity: 0.35;
    pointer-events: none;
    z-index: 1;
}

.student-pvc-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.65rem;
    background: linear-gradient(90deg, var(--card-header-bg, var(--school-sky-dark)) 0%, var(--card-header-bg-end, #5c7cfa) 100%);
    color: var(--card-header-text, #fff);
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    z-index: 2;
}

.student-pvc-card__header-brand {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.04rem;
}

.student-pvc-card__school {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.student-pvc-card__school-year {
    font-size: 0.5rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    opacity: 0.92;
    text-transform: none;
    line-height: 1.1;
}

.student-pvc-card__school-logo-wrap {
    flex-shrink: 0;
    position: relative;
    width: 2.35rem;
    height: 2.35rem;
}

.student-pvc-card__school-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 0.35rem;
    background: #fff;
    padding: 0.12rem;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
    display: block;
}

.student-pvc-card__school-logo.is-hidden,
.student-pvc-card__school-logo-fallback.is-hidden {
    display: none;
}

.student-pvc-card__school-logo-fallback {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.28rem;
    background: rgba(255, 255, 255, 0.95);
    color: var(--school-sky-dark);
    font-family: var(--font-display);
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.student-pvc-card__matricule {
    flex-shrink: 0;
    font-family: ui-monospace, 'Cascadia Code', monospace;
    font-size: 0.6rem;
    padding: 0.12rem 0.35rem;
    border-radius: 0.25rem;
    background: var(--card-matricule-bg, rgba(255, 255, 255, 0.2));
}

.student-pvc-card__body {
    display: flex;
    align-items: stretch;
    gap: 0.65rem;
    padding: 0.65rem 0.75rem 0.45rem;
    flex: 1;
    min-height: 0;
    z-index: 2;
}

.student-pvc-card__photo-wrap {
    flex-shrink: 0;
    width: 4.1rem;
    aspect-ratio: 3 / 4;
    border-radius: 0.45rem;
    overflow: hidden;
    background: linear-gradient(160deg, #e7f5ff 0%, #dbe4ff 100%);
    border: 2px solid rgba(51, 154, 240, 0.25);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6);
    position: relative;
}

.student-pvc-card__photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
}

.student-pvc-card__photo.is-hidden,
.student-pvc-card__photo-fallback.is-hidden {
    display: none;
}

.student-pvc-card__photo-fallback {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--school-sky-dark);
    background: linear-gradient(160deg, #e7f5ff 0%, #dbe4ff 100%);
}

.student-pvc-card__identity-wrap {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.student-pvc-card__identity {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.student-pvc-card__first-name {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--card-text, var(--school-ink));
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.student-pvc-card__last-name {
    margin: 0.1rem 0 0;
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: var(--card-accent, var(--school-sky-dark));
    line-height: 1.15;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.student-pvc-card__class {
    margin: 0.35rem 0 0;
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--school-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.student-pvc-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.65rem;
    margin: 0.3rem 0 0;
    padding: 0;
}

.student-pvc-card__meta-item {
    display: inline-flex;
    align-items: baseline;
    gap: 0.2rem;
    font-size: 0.58rem;
    line-height: 1.2;
    color: var(--school-ink-muted, #495057);
}

.student-pvc-card__meta-item dt {
    margin: 0;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    font-size: 0.5rem;
    color: var(--school-muted);
}

.student-pvc-card__meta-item dd {
    margin: 0;
    font-weight: 700;
    color: var(--school-ink, #212529);
}

.student-pvc-card__footer--empty {
    min-height: 0.35rem;
    border-top-style: dashed;
}

.student-pvc-card__class--muted {
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    font-style: italic;
}

.student-pvc-card__footer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.65rem 0.55rem;
    border-top: 1px dashed rgba(51, 154, 240, 0.2);
    background: rgba(255, 255, 255, 0.55);
    z-index: 2;
}

.student-pvc-card__stat {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.68rem;
    font-weight: 800;
    color: var(--school-ink);
    min-width: 0;
}

.student-pvc-card__stat--bus {
    color: var(--school-grass-dark);
}

.student-pvc-card__stat-icon {
    font-size: 0.75rem;
    line-height: 1;
}

.student-pvc-card__stat-value {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.student-pvc-card__stat-value small {
    font-size: 0.62rem;
    font-weight: 700;
    color: var(--school-muted);
}

/* Bascule cartes / tableau */
.student-view-toggle {
    display: inline-flex;
    border-radius: 999px;
    border: 2px solid rgba(51, 154, 240, 0.25);
    overflow: hidden;
    background: #fff;
    margin-left: auto;
}

.student-view-toggle__btn {
    border: 0;
    background: transparent;
    padding: 0.45rem 0.85rem;
    font-size: 0.78rem;
    font-weight: 800;
    font-family: var(--font-body);
    color: var(--school-muted);
    cursor: pointer;
}

.student-view-toggle__btn.is-active {
    background: linear-gradient(135deg, var(--school-sky-dark), #5c7cfa);
    color: #fff;
}

.school-table-row--warn {
    background: rgba(255, 243, 224, 0.55);
}

/* Page dédiée impression cartes (layout minimal, sans sidebar) */
.school-body--card-print {
    padding: 1.25rem;
    min-height: 100vh;
    background: var(--school-cream, #fff9db);
}

/* Impression cartes PVC */
.school-print-toolbar {
    margin-bottom: 1.25rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    align-items: center;
}

.student-pvc-print-sheet {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Imprimante carte Evolis / Matica — une face par page (85 × 55 mm) */
.student-pvc-print-sheet--card {
    gap: 1rem;
}

.student-pvc-print-card-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 55mm;
    padding: 0.5rem 0;
}

.student-pvc-print-card-page .student-pvc-flip__face {
    position: relative;
    inset: auto;
    transform: none !important;
    backface-visibility: visible;
    -webkit-backface-visibility: visible;
}

.student-pvc-print-card-page .student-pvc-card {
    width: 85mm;
    height: 55mm;
    min-height: 55mm;
    max-height: 55mm;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
}

.student-pvc-print-card-page .student-pvc-card__header {
    padding: 0.3rem 0.5rem;
    font-size: 0.54rem;
}

.student-pvc-print-card-page .student-pvc-card__matricule {
    font-size: 0.52rem;
}

.student-pvc-print-card-page .student-pvc-card__school-year {
    font-size: 0.46rem;
}

.student-pvc-print-card-page .student-pvc-card__meta-item {
    font-size: 0.5rem;
}

.student-pvc-print-card-page .student-pvc-card__meta-item dt {
    font-size: 0.46rem;
}

.student-pvc-print-card-page .student-pvc-card--back .student-pvc-card__back-body {
    gap: 0.2rem;
    padding: 0.25rem 0.45rem 0.4rem;
}

.student-pvc-print-card-page .student-pvc-card__qr {
    width: 5.1rem;
    height: 5.1rem;
    padding: 0.28rem;
}

.student-pvc-print-card-page .student-pvc-card__qr img,
.student-pvc-print-card-page .student-pvc-card__qr canvas {
    width: 4.55rem !important;
    height: 4.55rem !important;
    max-width: 4.55rem;
    max-height: 4.55rem;
}

.student-pvc-print-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    page-break-inside: avoid;
}

.student-pvc-print-slot {
    position: relative;
}

.student-pvc-print-slot .student-pvc-flip__face {
    position: relative;
    inset: auto;
    transform: none !important;
    backface-visibility: visible;
    -webkit-backface-visibility: visible;
}

.student-pvc-print-label {
    display: block;
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--school-muted);
    margin-bottom: 0.35rem;
}

/* Aperçu impression — même gabarit que @media print */
.student-pvc-print-slot .student-pvc-card {
    width: 85.6mm;
    height: 54mm;
    min-height: 54mm;
    max-height: 54mm;
    aspect-ratio: auto;
    overflow: hidden;
}

.student-pvc-print-slot .student-pvc-card__header {
    padding: 0.28rem 0.45rem;
    font-size: 0.52rem;
}

.student-pvc-print-slot .student-pvc-card__matricule {
    font-size: 0.5rem;
}

.student-pvc-print-slot .student-pvc-card--back .student-pvc-card__back-body {
    gap: 0.15rem;
    padding: 0.2rem 0.4rem 0.35rem;
}

.student-pvc-print-slot .student-pvc-card__qr {
    width: 4.85rem;
    height: 4.85rem;
    padding: 0.25rem;
}

.student-pvc-print-slot .student-pvc-card__qr img,
.student-pvc-print-slot .student-pvc-card__qr canvas {
    width: 4.35rem !important;
    height: 4.35rem !important;
    max-width: 4.35rem;
    max-height: 4.35rem;
}

.student-pvc-print-slot .student-pvc-card__back-title {
    font-size: 0.48rem;
}

.student-pvc-print-slot .student-pvc-card__back-name {
    font-size: 0.58rem;
}

.student-pvc-print-slot .student-pvc-card__back-class {
    font-size: 0.54rem;
}

@media (max-width: 480px) {
    .student-pvc-grid {
        grid-template-columns: 1fr;
    }

    .student-pvc-flip,
    .student-pvc-card {
        aspect-ratio: auto;
        min-height: 11rem;
    }

    .student-pvc-print-pair {
        grid-template-columns: 1fr;
    }

    .student-view-toggle {
        margin-left: 0;
        width: 100%;
    }

    .student-view-toggle__btn {
        flex: 1;
    }
}

@media print {
    .no-print,
    .school-sidebar,
    .school-sidebar-backdrop,
    .school-header,
    .school-mobile-bar,
    .school-footer,
    .school-alert,
    .school-print-toolbar {
        display: none !important;
    }

    .school-main {
        margin: 0 !important;
        padding: 0 !important;
        max-width: none !important;
    }

    .school-body {
        background: #fff !important;
    }

    /* Page d'impression cartes : uniquement les faces PVC, sans chrome admin */
    .school-body--card-print {
        margin: 0 !important;
        padding: 0 !important;
        min-height: 0 !important;
        background: #fff !important;
    }

    .school-body--card-print .school-print-toolbar {
        display: none !important;
    }

    .school-body--card-print .student-pvc-print-sheet {
        margin: 0;
        padding: 0;
        gap: 0;
    }

    .student-pvc-print-sheet--card {
        gap: 0;
    }

    .student-pvc-print-sheet--card .student-pvc-print-card-page {
        width: 85mm;
        height: 55mm;
        min-height: 55mm;
        max-height: 55mm;
        margin: 0;
        padding: 0;
        page-break-after: always;
        break-after: page;
        display: flex;
        justify-content: center;
        align-items: center;
        overflow: hidden;
    }

    .student-pvc-print-sheet--card .student-pvc-print-card-page:last-child {
        page-break-after: auto;
        break-after: auto;
    }

    .student-pvc-print-sheet--card .student-pvc-print-card-page .student-pvc-card {
        width: 85mm;
        height: 55mm;
        min-height: 55mm;
        max-height: 55mm;
        box-shadow: none;
        border-radius: 2mm;
    }

    .student-pvc-print-pair {
        grid-template-columns: 85.6mm 85.6mm;
        gap: 4mm;
        margin-bottom: 6mm;
    }

    .student-pvc-print-slot .student-pvc-card {
        width: 85.6mm;
        height: 54mm;
        min-height: 54mm;
        aspect-ratio: auto;
        box-shadow: none;
        page-break-inside: avoid;
        overflow: hidden;
    }

    .student-pvc-print-slot .student-pvc-card__header {
        padding: 0.28rem 0.45rem;
        font-size: 0.52rem;
    }

    .student-pvc-print-slot .student-pvc-card__matricule {
        font-size: 0.5rem;
    }

    .student-pvc-print-slot .student-pvc-card--back .student-pvc-card__back-body {
        justify-content: center;
        gap: 0.15rem;
        padding: 0.2rem 0.4rem 0.35rem;
    }

    .student-pvc-print-slot .student-pvc-card__qr {
        width: 4.85rem;
        height: 4.85rem;
        padding: 0.25rem;
    }

    .student-pvc-print-slot .student-pvc-card__qr img,
    .student-pvc-print-slot .student-pvc-card__qr canvas {
        width: 4.35rem !important;
        height: 4.35rem !important;
        max-width: 4.35rem;
        max-height: 4.35rem;
    }

    .student-pvc-print-slot .student-pvc-card__back-title {
        font-size: 0.48rem;
    }

    .student-pvc-print-slot .student-pvc-card__back-name {
        font-size: 0.58rem;
    }

    .student-pvc-print-slot .student-pvc-card__back-class {
        font-size: 0.54rem;
    }

    .student-pvc-print-label {
        color: #666;
    }
}

@page card-face {
    size: 85mm 55mm;
    margin: 0;
}

@media print {
    .student-pvc-print-sheet--card .student-pvc-print-card-page {
        page: card-face;
    }

    /* Conserver dégradés, pastilles et liseré en tête sans cocher « Graphiques d'arrière-plan » */
    .school-body--card-print,
    .school-body--card-print * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
    }

    .school-body--card-print .student-pvc-card__header:not(.student-pvc-card__header--back) {
        background-color: var(--card-header-bg, #339af0) !important;
    }

    .school-body--card-print .student-pvc-card__header--back {
        background-color: var(--card-header-bg, #495057) !important;
    }

    .school-body--card-print .student-pvc-card__class-accent {
        background-color: hsl(var(--class-hue, 210) 75% 55%) !important;
    }

    .school-body--card-print .student-pvc-card__matricule {
        background-color: rgba(255, 255, 255, 0.28) !important;
    }

    .school-body--card-print .student-pvc-card__class:not(.student-pvc-card__class--muted) {
        background-color: hsl(var(--class-hue, 210) 85% 92%) !important;
    }

    .school-body--card-print .student-pvc-card__school-logo {
        background-color: #fff !important;
    }
}

@page card-face-portrait {
    size: 55mm 85mm;
    margin: 0;
}

@media print {
    .student-pvc-print-sheet--card.student-pvc-print-sheet--portrait .student-pvc-print-card-page {
        page: card-face-portrait;
    }

    .student-pvc-print-sheet--card.student-pvc-print-sheet--portrait .student-pvc-print-card-page {
        width: 55mm;
        height: 85mm;
        min-height: 85mm;
        max-height: 85mm;
    }

    .student-pvc-print-sheet--card.student-pvc-print-sheet--portrait .student-pvc-print-card-page .student-pvc-card {
        width: 55mm;
        height: 85mm;
        min-height: 85mm;
        max-height: 85mm;
    }

    .student-pvc-print-sheet--portrait .student-pvc-card--photo-small .student-pvc-card__photo-wrap {
        width: 30mm;
        max-width: 30mm;
    }

    .student-pvc-print-sheet--portrait .student-pvc-card--photo-medium .student-pvc-card__photo-wrap {
        width: 35mm;
        max-width: 35mm;
    }

    .student-pvc-print-sheet--portrait .student-pvc-card--photo-large .student-pvc-card__photo-wrap {
        width: 34mm;
        max-width: 34mm;
    }

    .student-pvc-print-sheet--portrait .student-pvc-card--qr-small .student-pvc-card__qr {
        width: 30mm;
        height: 30mm;
        max-width: 30mm;
        max-height: 30mm;
    }

    .student-pvc-print-sheet--portrait .student-pvc-card--qr-medium .student-pvc-card__qr {
        width: 35mm;
        height: 35mm;
        max-width: 35mm;
        max-height: 35mm;
    }

    .student-pvc-print-sheet--portrait .student-pvc-card--qr-large .student-pvc-card__qr {
        width: 40mm;
        height: 40mm;
        max-width: 40mm;
        max-height: 40mm;
    }

    .student-pvc-print-sheet--portrait .student-pvc-card--qr-small .student-pvc-card__qr img,
    .student-pvc-print-sheet--portrait .student-pvc-card--qr-small .student-pvc-card__qr canvas {
        width: 26mm !important;
        height: 26mm !important;
        max-width: 26mm;
        max-height: 26mm;
    }

    .student-pvc-print-sheet--portrait .student-pvc-card--qr-medium .student-pvc-card__qr img,
    .student-pvc-print-sheet--portrait .student-pvc-card--qr-medium .student-pvc-card__qr canvas {
        width: 31mm !important;
        height: 31mm !important;
        max-width: 31mm;
        max-height: 31mm;
    }

    .student-pvc-print-sheet--portrait .student-pvc-card--qr-large .student-pvc-card__qr img,
    .student-pvc-print-sheet--portrait .student-pvc-card--qr-large .student-pvc-card__qr canvas {
        width: 36mm !important;
        height: 36mm !important;
        max-width: 36mm;
        max-height: 36mm;
    }
}

.hidden {
    display: none !important;
}

/* ============================================================
   Élèves — refonte UX cartes (lisibilité, identité, actions, a11y)
   ============================================================ */

/* Cartes de liste un peu plus hautes pour accueillir badges/solde/complétude/actions.
   (Ne touche pas l'impression : celle-ci utilise .student-pvc-print-*.) */
.student-pvc-grid {
    grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
}

.student-pvc-grid .student-pvc-flip {
    position: relative;
    aspect-ratio: auto;
    min-height: 18rem;
}

.student-pvc-grid .student-pvc-flip__inner {
    min-height: 18rem;
}

/* —— Carte verticale (impression portrait 55×85 mm) —— */
.student-pvc-card--portrait .student-pvc-card__body {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0.3rem 0.45rem 0.2rem;
    gap: 0.28rem;
}

.student-pvc-card--portrait .student-pvc-card__photo-wrap {
    width: 72%;
    max-width: 40mm;
    min-width: 4.75rem;
    border-width: 2px;
}

/* Tailles photo — paysage */
.student-pvc-card--photo-small:not(.student-pvc-card--portrait) .student-pvc-card__photo-wrap {
    width: 3.2rem;
}

.student-pvc-card--photo-medium:not(.student-pvc-card--portrait) .student-pvc-card__photo-wrap {
    width: 4.1rem;
}

.student-pvc-card--photo-large:not(.student-pvc-card--portrait) .student-pvc-card__photo-wrap {
    width: 5rem;
}

/* Tailles photo — portrait */
.student-pvc-card--photo-small.student-pvc-card--portrait .student-pvc-card__photo-wrap {
    width: 55%;
    max-width: 30mm;
    min-width: 3.5rem;
}

.student-pvc-card--photo-medium.student-pvc-card--portrait .student-pvc-card__photo-wrap {
    width: 64%;
    max-width: 35mm;
    min-width: 4rem;
}

.student-pvc-card--photo-large.student-pvc-card--portrait .student-pvc-card__photo-wrap {
    width: 62%;
    max-width: 34mm;
    min-width: 0;
}

.student-pvc-card--portrait .student-pvc-card__photo-fallback {
    font-size: 1.85rem;
}

.student-pvc-card--portrait .student-pvc-card__identity {
    align-items: center;
    width: 100%;
}

.student-pvc-card--portrait .student-pvc-card__identity-wrap {
    align-items: center;
    width: 100%;
}

.student-pvc-card--portrait .student-pvc-card__first-name,
.student-pvc-card--portrait .student-pvc-card__last-name {
    white-space: normal;
    text-align: center;
}

.student-pvc-card--portrait .student-pvc-card__class {
    align-self: center;
}

.student-pvc-card--portrait .student-pvc-card__meta {
    justify-content: center;
    flex-shrink: 0;
}

.student-pvc-card--portrait .student-pvc-card__meta-item {
    font-size: 0.54rem;
}

.student-pvc-card--portrait .student-pvc-card__back-text {
    flex-shrink: 0;
    margin-top: 0.15rem;
}

.student-pvc-card--portrait .student-pvc-card__footer {
    justify-content: center;
}

.student-pvc-card--portrait .student-pvc-card__header {
    padding: 0.38rem 0.5rem;
}

.student-pvc-card--portrait .student-pvc-card__school-logo-wrap {
    width: 2rem;
    height: 2rem;
}

.student-pvc-card--portrait .student-pvc-card__school {
    font-size: 0.52rem;
    white-space: normal;
    line-height: 1.15;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.student-pvc-card--portrait .student-pvc-card__back-body {
    justify-content: center;
    padding: 0.3rem 0.45rem 0.35rem;
    gap: 0.22rem;
}

.student-pvc-card--portrait .student-pvc-card__qr {
    width: 72%;
    max-width: 42mm;
    height: auto;
    aspect-ratio: 1;
    padding: 0.28rem;
}

/* Tailles QR — paysage */
.student-pvc-card--qr-small:not(.student-pvc-card--portrait) .student-pvc-card__qr {
    width: 4.5rem;
    height: 4.5rem;
}

.student-pvc-card--qr-small:not(.student-pvc-card--portrait) .student-pvc-card__qr img,
.student-pvc-card--qr-small:not(.student-pvc-card--portrait) .student-pvc-card__qr canvas {
    width: 3.9rem !important;
    height: 3.9rem !important;
}

.student-pvc-card--qr-medium:not(.student-pvc-card--portrait) .student-pvc-card__qr {
    width: 5.75rem;
    height: 5.75rem;
}

.student-pvc-card--qr-large:not(.student-pvc-card--portrait) .student-pvc-card__qr {
    width: 6.5rem;
    height: 6.5rem;
}

.student-pvc-card--qr-large:not(.student-pvc-card--portrait) .student-pvc-card__qr img,
.student-pvc-card--qr-large:not(.student-pvc-card--portrait) .student-pvc-card__qr canvas {
    width: 5.8rem !important;
    height: 5.8rem !important;
}

/* Tailles QR — portrait */
.student-pvc-card--qr-small.student-pvc-card--portrait .student-pvc-card__qr {
    width: 55%;
    max-width: 30mm;
}

.student-pvc-card--qr-medium.student-pvc-card--portrait .student-pvc-card__qr {
    width: 64%;
    max-width: 35mm;
}

.student-pvc-card--qr-large.student-pvc-card--portrait .student-pvc-card__qr {
    width: 72%;
    max-width: 42mm;
}

.student-pvc-card--portrait .student-pvc-card__qr img,
.student-pvc-card--portrait .student-pvc-card__qr canvas {
    width: 100% !important;
    height: 100% !important;
    max-width: none;
    max-height: none;
}

.student-pvc-card--portrait .student-pvc-card__back-title {
    font-size: 0.52rem;
}

.student-pvc-card--portrait .student-pvc-card__back-name {
    font-size: 0.64rem;
}

.student-pvc-card--portrait .student-pvc-card__back-class {
    font-size: 0.58rem;
}

.student-pvc-print-sheet--portrait .student-pvc-print-card-page {
    min-height: 85mm;
}

.student-pvc-print-sheet--portrait .student-pvc-print-card-page .student-pvc-card {
    width: 55mm;
    height: 85mm;
    min-height: 85mm;
    max-height: 85mm;
}

/* —— Liseré couleur par classe + matricule plus discret —— */
.student-pvc-card__class-accent {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg,
        hsl(var(--class-hue, 210) 75% 55%),
        hsl(calc(var(--class-hue, 210) + 30) 78% 62%));
    z-index: 3;
}

.student-pvc-card__matricule {
    opacity: 0.85;
    font-size: 0.55rem;
}

/* —— Avatar de repli coloré déterministe (contraste AA pour grandes initiales) —— */
.student-pvc-card__photo-fallback {
    background: linear-gradient(150deg,
        hsl(var(--avatar-hue, 210) 72% 60%),
        hsl(calc(var(--avatar-hue, 210) + 25) 70% 46%));
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* —— Classe en pastille colorée (code couleur par classe) —— */
.student-pvc-card__class {
    display: inline-block;
    align-self: flex-start;
    max-width: 100%;
    margin: 0.32rem 0 0;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: hsl(var(--class-hue, 210) 65% 30%);
    background: hsl(var(--class-hue, 210) 85% 95%);
    border: 1px solid hsl(var(--class-hue, 210) 70% 82%);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.student-pvc-card__class--muted {
    color: var(--school-muted);
    background: #f1f3f5;
    border-color: #e9ecef;
    text-transform: none;
    font-style: italic;
    font-weight: 600;
}

/* —— Badges de statut —— */
.student-pvc-card__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.35rem;
}

.student-pvc-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    font-size: 0.55rem;
    font-weight: 800;
    line-height: 1;
    padding: 0.18rem 0.4rem;
    border-radius: 999px;
    background: #eef2ff;
    color: #3b4ba8;
    border: 1px solid rgba(91, 124, 250, 0.25);
    white-space: nowrap;
}

.student-pvc-badge--bus { background: #e6fcf5; color: #0b7285; border-color: rgba(11, 114, 133, 0.22); }
.student-pvc-badge--canteen { background: #fff4e6; color: #d9480f; border-color: rgba(217, 72, 15, 0.22); }
.student-pvc-badge--birthday { background: #fff0f6; color: #a61e4d; border-color: rgba(166, 30, 77, 0.22); }
.student-pvc-badge--new { background: #fff9db; color: #7a5c00; border-color: rgba(133, 100, 4, 0.28); }

/* —— Solde mis en avant —— */
.student-pvc-card__balance-banner {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0.1rem 0.6rem 0;
    padding: 0.28rem 0.55rem;
    border-radius: 0.6rem;
    background: linear-gradient(135deg, hsl(145 68% 95%), hsl(145 62% 90%));
    border: 1px solid hsl(145 50% 80%);
    z-index: 2;
}

.student-pvc-card__balance-banner.is-low {
    background: linear-gradient(135deg, #fff4e6, #ffe8cc);
    border-color: rgba(253, 126, 20, 0.5);
}

.student-pvc-card__balance-icon { font-size: 0.95rem; line-height: 1; }

.student-pvc-card__balance-amount {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1;
    color: var(--school-grass-dark);
}

.student-pvc-card__balance-banner.is-low .student-pvc-card__balance-amount { color: #e8590c; }
.student-pvc-card__balance-amount small { font-size: 0.6rem; font-weight: 700; color: var(--school-muted); }

.student-pvc-card__balance-bus {
    margin-left: auto;
    font-size: 0.66rem;
    font-weight: 800;
    color: var(--school-grass-dark);
    white-space: nowrap;
}

/* —— Barre de complétude de fiche —— */
.student-pvc-card__completeness {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0.3rem 0.6rem 0;
    z-index: 2;
}

.student-pvc-card__completeness-track {
    flex: 1;
    height: 5px;
    border-radius: 999px;
    background: #e9ecef;
    overflow: hidden;
}

.student-pvc-card__completeness-fill {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--school-grass), var(--school-grass-dark));
}

.student-pvc-card__completeness-label {
    font-size: 0.54rem;
    font-weight: 700;
    color: var(--school-muted);
    white-space: nowrap;
}

/* —— Actions rapides sur carte —— */
.student-pvc-card__footer--actions {
    gap: 0.3rem;
    flex-wrap: wrap;
    row-gap: 0.25rem;
}

.student-pvc-card__action-form { display: contents; }

.student-pvc-card__action {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    padding: 0.2rem 0.4rem;
    border-radius: 999px;
    border: 2px solid rgba(51, 154, 240, 0.3);
    background: #fff;
    color: var(--school-sky-dark);
    font-size: 0.6rem;
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    font-family: var(--font-body);
}

.student-pvc-card__action:hover { background: #e7f5ff; border-color: var(--school-sky-dark); }
.student-pvc-card__action--credit { color: var(--school-grass-dark); border-color: rgba(64, 192, 87, 0.4); }
.student-pvc-card__action--credit:hover { background: #ebfbee; border-color: var(--school-grass-dark); }
.student-pvc-card__action--revoke { color: #c92a2a; border-color: rgba(201, 42, 42, 0.4); }
.student-pvc-card__action--revoke:hover { background: #fff5f5; border-color: #c92a2a; }
.student-pvc-card__action--restore { color: #2b8a3e; border-color: rgba(43, 138, 62, 0.4); }
.student-pvc-card__action--restore:hover { background: #ebfbee; border-color: #2b8a3e; }

/* —— Carte révoquée —— */
.student-pvc-flip--revoked .student-pvc-card__photo,
.student-pvc-flip--revoked .student-pvc-card__photo-fallback {
    filter: grayscale(1);
}

.student-pvc-card--revoked::after {
    content: "RÉVOQUÉE";
    position: absolute;
    top: 48%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-13deg);
    background: rgba(201, 42, 42, 0.92);
    color: #fff;
    font-family: var(--font-display);
    font-weight: 900;
    letter-spacing: 0.14em;
    font-size: 0.82rem;
    padding: 0.18rem 1.3rem;
    border-radius: 0.3rem;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
    z-index: 6;
    pointer-events: none;
}

/* —— Sélection multiple —— */
.student-pvc-select {
    position: absolute;
    top: 0.4rem;
    left: 0.4rem;
    z-index: 12;
    display: none;
    cursor: pointer;
}

#student-cards-root.is-selecting .student-pvc-select { display: block; }

.student-pvc-select__input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.student-pvc-select__box {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 0.4rem;
    background: #fff;
    border: 2px solid var(--school-sky-dark);
    color: transparent;
    font-weight: 900;
    font-size: 0.9rem;
    line-height: 1;
    box-shadow: 0 2px 6px rgba(45, 55, 72, 0.25);
}

.student-pvc-select__input:checked + .student-pvc-select__box {
    background: var(--school-sky-dark);
    color: #fff;
}

.student-pvc-flip.is-selected {
    outline: 3px solid var(--school-sky-dark);
    outline-offset: 2px;
    border-radius: 0.85rem;
}

/* —— Barre de résultats + barre de sélection —— */
.student-results-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.student-results-bar__count {
    margin: 0;
    font-size: 0.85rem;
    color: var(--school-muted);
}

.student-results-bar__count strong { color: var(--school-ink); }

.student-selection-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    padding: 0.6rem 0.9rem;
    border-radius: 0.85rem;
    background: linear-gradient(135deg, #e7f5ff, #d0ebff);
    border: 2px solid rgba(51, 154, 240, 0.35);
}

.student-selection-bar__count {
    font-weight: 800;
    color: var(--school-sky-dark);
    font-size: 0.9rem;
}

/* —— Regroupement par classe —— */
.student-class-section { margin-bottom: 1.5rem; }

.student-class-heading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 0.75rem;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 800;
    color: var(--school-ink);
}

.student-class-heading::before {
    content: "";
    width: 0.85rem;
    height: 0.85rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--school-sky), var(--school-sky-dark));
}

.student-class-heading__count {
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--school-sky-dark);
    background: #e7f5ff;
    border: 1px solid rgba(51, 154, 240, 0.25);
    padding: 0.08rem 0.5rem;
    border-radius: 999px;
}

/* —— Boutons compacts + état désactivé —— */
.school-btn-sm {
    padding: 0.4rem 0.85rem;
    font-size: 0.8rem;
}

.school-btn.is-disabled,
.school-btn[aria-disabled="true"] {
    opacity: 0.5;
    pointer-events: none;
    box-shadow: none;
    transform: none;
}

/* —— Accessibilité : focus clavier visible —— */
.student-pvc-flip__btn:focus-visible,
.student-pvc-card__action:focus-visible,
.student-pvc-card__profile-link:focus-visible,
.student-view-toggle__btn:focus-visible,
.student-results-bar button:focus-visible,
.student-selection-bar a:focus-visible,
.student-selection-bar button:focus-visible,
.student-pvc-select__input:focus-visible + .student-pvc-select__box {
    outline: 3px solid var(--school-sun-dark);
    outline-offset: 2px;
}

/* —— Accessibilité : respect de prefers-reduced-motion —— */
@media (prefers-reduced-motion: reduce) {
    .student-pvc-flip__inner { transition: none !important; }
    .student-pvc-card__shine { display: none; }
    .school-btn { transition: none; }
    .school-btn:hover { transform: none; }
}

/* ====================================================================
   Catalogue cantine — pastilles, sélecteur de formule, réactivation
   ==================================================================== */
.canteen-item {
    background: var(--school-cream);
    padding: 0.75rem;
    border-radius: 0.75rem;
    margin-bottom: 0.5rem;
}
.canteen-item__deactivate { margin-top: 0.4rem; }

.canteen-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.5rem;
}
.canteen-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.4;
    border: 1px solid transparent;
    white-space: nowrap;
}
.canteen-chip--allergen { color: #c92a2a; background: #fff5f5; border-color: rgba(201, 42, 42, 0.25); }
.canteen-chip--day { color: var(--school-sky-dark); background: #e7f5ff; border-color: rgba(28, 126, 214, 0.18); }
.canteen-chip--code { color: var(--school-muted); background: #f1f5f9; border-color: #e2e8f0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.canteen-chip--item { color: #5f3dc4; background: #f3f0ff; border-color: rgba(95, 61, 196, 0.18); }

/* Sélecteur d'articles de formule (cases à cocher accessibles) */
.canteen-formula-picker {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
    gap: 0.4rem;
    max-height: 16rem;
    overflow-y: auto;
    padding: 0.25rem;
    border: 1px solid var(--school-cream-dark);
    border-radius: 0.75rem;
    background: #fff;
}
.canteen-pick {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.6rem;
    border-radius: 0.6rem;
    border: 1px solid transparent;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.15s, border-color 0.15s;
}
.canteen-pick:hover { background: var(--school-cream); }
.canteen-pick.is-checked { background: #ebfbee; border-color: rgba(43, 138, 62, 0.35); }
.canteen-pick input { flex: 0 0 auto; width: 1.05rem; height: 1.05rem; accent-color: var(--school-grass-dark); }
.canteen-pick__name { flex: 1; font-weight: 600; color: var(--school-ink); }
.canteen-pick__price { flex: 0 0 auto; font-weight: 700; color: var(--school-muted); font-size: 0.78rem; }

.canteen-formula-sum {
    margin: 0.6rem 0 0;
    padding: 0.5rem 0.75rem;
    border-radius: 0.6rem;
    background: var(--school-cream);
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--school-ink);
}
.canteen-formula-sum.is-deal { background: #ebfbee; color: #2b8a3e; }
.canteen-formula-sum.is-loss { background: #fff5f5; color: #c92a2a; }

/* Carte formule (liste) */
.canteen-formula {
    background: var(--school-cream);
    padding: 1rem;
    border-radius: 0.75rem;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.canteen-formula__main { flex: 1; min-width: 12rem; }
.canteen-formula__title { display: flex; align-items: baseline; gap: 0.5rem; flex-wrap: wrap; margin: 0; }
.canteen-formula__price { font-weight: 800; color: var(--school-sky-dark); }
.canteen-formula__note { margin: 0.4rem 0 0; font-size: 0.78rem; font-weight: 600; color: var(--school-muted); }
.canteen-formula__note--deal { color: #2b8a3e; }
.canteen-formula__note--loss { color: #c92a2a; }

/* Section « Désactivés » repliable */
.canteen-deactivated {
    margin-top: 1.5rem;
    background: #fff;
    border: 2px dashed var(--school-cream-dark);
    border-radius: 1rem;
    padding: 0.5rem 1rem;
}
.canteen-deactivated__summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-family: var(--font-display);
    font-size: 1.05rem;
    color: var(--school-ink);
    padding: 0.5rem 0;
    list-style: none;
}
.canteen-deactivated__summary::-webkit-details-marker { display: none; }
.canteen-deactivated__count {
    display: inline-block;
    min-width: 1.4rem;
    text-align: center;
    padding: 0.05rem 0.45rem;
    border-radius: 999px;
    background: var(--school-muted);
    color: #fff;
    font-size: 0.8rem;
}
.canteen-deactivated__hint { font-family: var(--font-body); font-size: 0.78rem; font-weight: 600; color: var(--school-muted); }
.canteen-deactivated__heading { font-family: var(--font-display); font-size: 0.95rem; color: var(--school-muted); margin: 0.75rem 0 0.4rem; }
.canteen-deactivated__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.65rem;
    border-radius: 0.6rem;
    background: var(--school-cream);
    margin-bottom: 0.4rem;
}
.canteen-deactivated__label { display: flex; flex-direction: column; }
.canteen-deactivated__meta { font-size: 0.76rem; color: var(--school-muted); font-weight: 600; }

/* Accessibilité : focus clavier visible sur les contrôles cantine */
.canteen-pick input:focus-visible,
.canteen-deactivated__summary:focus-visible {
    outline: 3px solid var(--school-sun-dark);
    outline-offset: 2px;
}

/* —— Paramètres : personnalisation cartes élèves —— */
.settings-nav__item--card {
    --settings-accent: #b197fc;
}

.card-template-editor {
    display: grid;
    grid-template-columns: minmax(16rem, 22rem) 1fr;
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 960px) {
    .card-template-editor {
        grid-template-columns: 1fr;
    }
}

.card-template-fieldset {
    border: 1px dashed rgba(0, 0, 0, 0.12);
    border-radius: 0.75rem;
    padding: 0.85rem 1rem 1rem;
    margin: 0 0 1rem;
}

.card-template-fieldset legend {
    font-weight: 800;
    font-size: 0.82rem;
    padding: 0 0.35rem;
    color: var(--school-ink);
}

.card-template-orientation {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.card-template-colors {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr));
    gap: 0.65rem;
}

.card-template-color {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--school-muted);
}

.card-template-color__input {
    width: 100%;
    height: 2.25rem;
    padding: 0.15rem;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 0.45rem;
    cursor: pointer;
    background: #fff;
}

.card-template-checks {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.card-template-checks label {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-weight: 700;
    font-size: 0.88rem;
}

.card-template-editor__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 0.5rem;
}

.card-template-preview-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    align-items: start;
}

.card-template-preview-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    width: 100%;
}

/* Même gabarit que l'impression PVC : 85×55 mm (paysage) ou 55×85 mm (portrait) */
.card-template-preview-scale {
    width: 100%;
    max-width: 18rem;
    aspect-ratio: 85 / 55;
}

.card-template-preview-grid--portrait .card-template-preview-scale {
    max-width: 13rem;
    aspect-ratio: 55 / 85;
}

.card-template-preview-scale .student-pvc-card {
    width: 100%;
    height: 100%;
    aspect-ratio: unset;
    min-height: 0;
    overflow: hidden;
}

.card-template-preview-scale .student-pvc-flip__face {
    position: relative;
    width: 100%;
    height: 100%;
    transform: none;
    backface-visibility: visible;
}

.card-template-preview-scale .student-pvc-card__body,
.card-template-preview-scale .student-pvc-card__back-body {
    min-height: 0;
    overflow: hidden;
}

.school-logo-upload__preview-wrap {
    margin-bottom: 0.75rem;
    padding: 0.65rem;
    border-radius: 0.65rem;
    background: #f8fafc;
    border: 1px dashed rgba(0, 0, 0, 0.12);
    display: inline-block;
    max-width: 100%;
}

.school-logo-upload__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.65rem;
}

/* —— Cartes élèves : personnalisation « pro » (palettes, contraste, repères d'impression) —— */
.card-template-fieldset .mt-2 { margin-top: 0.6rem; }

.card-template-orientation label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 700;
}

.card-palette-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.85rem;
}
.card-palette {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.3rem 0.6rem 0.3rem 0.4rem;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 999px;
    background: #fff;
    cursor: pointer;
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--school-ink);
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.05s;
}
.card-palette:hover { border-color: var(--school-lilac); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); }
.card-palette:active { transform: translateY(1px); }
.card-palette__swatches { display: inline-flex; }
.card-palette__swatch {
    width: 0.95rem;
    height: 0.95rem;
    border-radius: 50%;
    border: 2px solid #fff;
    margin-left: -0.35rem;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
}
.card-palette__swatch:first-child { margin-left: 0; }

.card-template-color__controls {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.card-template-color__hex {
    width: 100%;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 0.4rem;
    padding: 0.2rem 0.4rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: lowercase;
    color: var(--school-ink);
}

.card-contrast {
    margin-top: 0.85rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.85rem;
}
.card-contrast__title {
    width: 100%;
    margin: 0 0 0.15rem;
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--school-muted);
}
.card-contrast__item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--school-muted);
}
.card-contrast__item strong {
    padding: 0.05rem 0.45rem;
    border-radius: 999px;
    font-variant-numeric: tabular-nums;
    background: #f1f3f5;
    color: var(--school-ink);
}
.card-contrast__item.is-good strong { background: #ebfbee; color: #2b8a3e; }
.card-contrast__item.is-warn strong { background: #fff9db; color: #e67700; }
.card-contrast__item.is-bad strong { background: #fff5f5; color: #c92a2a; }

.card-template-preview-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.6rem;
}
.card-safezone-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--school-muted);
    cursor: pointer;
}

/* Liseré « zone de sécurité » 3 mm — aperçu de l'éditeur uniquement. */
.card-template-preview-grid.show-safezone .student-pvc-card::after {
    content: '';
    position: absolute;
    inset: 5px;
    border: 1px dashed rgba(0, 0, 0, 0.35);
    border-radius: 7px;
    pointer-events: none;
    z-index: 6;
}

.student-pvc-card__meta-item--full {
    flex-basis: 100%;
    width: 100%;
    min-width: 0;
}

.card-template-editor__actions {
    position: sticky;
    bottom: 0;
    align-items: center;
    padding: 0.6rem 0 0.4rem;
    background: linear-gradient(to top, rgba(255, 255, 255, 0.97) 65%, rgba(255, 255, 255, 0));
    z-index: 4;
}
.card-template-editor__dirty {
    margin-right: auto;
    font-size: 0.76rem;
    font-weight: 800;
    color: #e67700;
}

.card-palette:focus-visible,
.card-template-color__hex:focus-visible,
.card-template-color__input:focus-visible,
.card-safezone-toggle input:focus-visible,
.card-template-orientation input:focus-visible,
.card-template-checks input:focus-visible {
    outline: 3px solid var(--school-sun-dark);
    outline-offset: 2px;
}

/* —— Documentation intégrée (guide d'utilisation) —— */
.school-nav-link--doc { margin-top: 0.35rem; }

.doc-section { scroll-margin-top: 1rem; }

.doc-lead {
    font-size: 1.02rem;
    line-height: 1.55;
    color: var(--school-ink);
    margin: 0 0 1rem;
}

.doc-toc {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
    gap: 0.5rem;
}
.doc-toc a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.7rem;
    border-radius: 0.6rem;
    background: var(--school-cream);
    font-weight: 700;
    color: var(--school-ink);
    text-decoration: none;
    border: 1px solid transparent;
    transition: border-color 0.15s, background 0.15s, transform 0.05s;
}
.doc-toc a:hover { border-color: var(--school-lilac); background: #fff; }
.doc-toc a:active { transform: translateY(1px); }
.doc-toc__emoji { font-size: 1.1rem; line-height: 1; }

.doc-permalink {
    opacity: 0;
    font-size: 0.85rem;
    color: var(--school-muted);
    text-decoration: none;
    margin-left: 0.4rem;
    transition: opacity 0.15s;
}
.doc-section:hover .doc-permalink,
.doc-permalink:focus-visible { opacity: 0.6; }

.doc-h3 {
    font-family: var(--font-display, inherit);
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--school-ink);
    margin: 0.2rem 0 0.55rem;
}

.doc-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: start;
}
@media (max-width: 820px) {
    .doc-cols { grid-template-columns: 1fr; gap: 1rem; }
}

.doc-steps {
    list-style: none;
    counter-reset: docstep;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.doc-steps li {
    counter-increment: docstep;
    position: relative;
    padding-left: 2.2rem;
    line-height: 1.45;
}
.doc-steps li::before {
    content: counter(docstep);
    position: absolute;
    left: 0;
    top: 0;
    width: 1.55rem;
    height: 1.55rem;
    border-radius: 50%;
    background: var(--school-sky-dark, #1c7ed6);
    color: #fff;
    font-weight: 800;
    font-size: 0.82rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.doc-bullets {
    margin: 0;
    padding-left: 1.15rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.doc-bullets li { line-height: 1.45; }

.doc-example {
    background: #f8fafc;
    border: 1px dashed rgba(0, 0, 0, 0.14);
    border-radius: 0.6rem;
    padding: 0.7rem 0.85rem;
    font-size: 0.9rem;
    line-height: 1.5;
}

.doc-callout {
    border-radius: 0.6rem;
    padding: 0.6rem 0.8rem;
    font-size: 0.88rem;
    line-height: 1.5;
    margin-top: 0.6rem;
    border-left: 4px solid;
}
.doc-callout--tip { background: #ebfbee; border-color: #2b8a3e; }
.doc-callout--warn { background: #fff5f5; border-color: #c92a2a; }
.doc-callout--info { background: #e7f5ff; border-color: #1c7ed6; }

.doc-diagram { overflow-x: auto; padding: 0.4rem 0; }
.doc-diagram svg { display: block; margin: 0 auto; max-width: 100%; height: auto; }

.doc-pill {
    display: inline-block;
    padding: 0.05rem 0.5rem;
    border-radius: 999px;
    background: var(--school-cream-dark, #fff0c4);
    font-size: 0.74rem;
    font-weight: 800;
    color: var(--school-ink);
}

.doc-glossary {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
    gap: 0.5rem 1.5rem;
    margin: 0;
}
.doc-glossary dt { font-weight: 800; color: var(--school-ink); }
.doc-glossary dd { margin: 0.1rem 0 0; font-size: 0.9rem; line-height: 1.45; color: var(--school-muted); }

.doc-faq details {
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}
.doc-faq summary {
    cursor: pointer;
    font-weight: 800;
    color: var(--school-ink);
    padding: 0.6rem 0;
    list-style-position: inside;
}
.doc-faq summary:hover { color: var(--school-sky-dark, #1c7ed6); }
.doc-faq p { margin: 0.1rem 0 0.75rem; line-height: 1.55; }

.doc-backtop { text-align: center; margin: 0.5rem 0 0; }
.doc-backtop a { font-weight: 700; color: var(--school-muted); text-decoration: none; }
.doc-backtop a:hover { color: var(--school-ink); }

.doc-toc a:focus-visible,
.doc-faq summary:focus-visible {
    outline: 3px solid var(--school-sun-dark);
    outline-offset: 2px;
}
