/* Football Academy — Student/Parent Portal
   Self-contained stylesheet, scoped entirely to --fa-* custom properties
   set by FaPortalController::themeTokensStyle(). No Bootstrap dependency —
   works identically regardless of which theme is active. */

.fa-portal-page, .fa-portal-nav {
    font-family: var(--fa-font, Inter, system-ui, sans-serif);
    color: var(--fa-text, #1e293b);
}

.fa-portal-container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

/* ── Top nav ─────────────────────────────────────────────────────────── */
.fa-portal-nav {
    background: var(--fa-surface, #fff);
    border-bottom: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
}
.fa-portal-nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .75rem;
    padding: 1.1rem 1.25rem;
}
.fa-portal-brand {
    font-weight: 900;
    font-size: 1.15rem;
    color: var(--fa-primary-dark, #1b5e20);
    text-transform: uppercase;
    letter-spacing: -0.01em;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: .5rem;
}
.fa-portal-nav-links {
    display: flex;
    align-items: center;
    gap: .35rem;
    flex-wrap: wrap;
}
.fa-portal-nav-link {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: 0.55rem 1rem;
    border-radius: 50px;
    color: var(--fa-text-muted, #64748b);
    text-decoration: none;
    font-weight: 700;
    font-size: .85rem;
    transition: background 0.2s ease, color 0.2s ease;
}
.fa-portal-nav-link:hover {
    background: #f1f8e9;
    color: var(--fa-primary-dark, #1b5e20);
}
.fa-portal-nav-link.active {
    background: var(--fa-primary-light, #e8f5e9);
    color: var(--fa-primary-dark, #1b5e20);
}
.fa-portal-nav-logout {
    color: #d32f2f;
}
.fa-portal-nav-logout:hover {
    background: #ffebee;
    color: #c62828;
}

/* Hamburger toggle — hidden on desktop, shown only in the mobile media query below. */
.fa-portal-nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    font-size: 1.4rem;
    color: var(--fa-primary-dark, #1b5e20);
    cursor: pointer;
    padding: .3rem .5rem;
    line-height: 1;
}
/* Close (×) button inside the drawer — hidden until the drawer is a drawer. */
.fa-portal-nav-close {
    display: none;
    align-self: flex-end;
    background: none;
    border: none;
    font-size: 1.3rem;
    color: var(--fa-text-muted, #64748b);
    cursor: pointer;
    padding: .25rem;
    margin-bottom: .5rem;
}
.fa-portal-nav-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(13, 27, 46, .4);
    z-index: 1040;
    opacity: 0;
    transition: opacity .25s ease;
}
.fa-portal-nav-backdrop.show { display: block; opacity: 1; }

/* ── Sticky Footer Layout (ensures background fits viewport) ─────────── */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
}

#main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ── Page layout ─────────────────────────────────────────────────────── */
.fa-portal-page {
    padding: 3.5rem 0 5rem;
    background: linear-gradient(135deg, #f4fbf0 0%, #eef7e8 100%);
    flex: 1;
}
.fa-portal-title {
    font-size: 1.85rem;
    font-weight: 900;
    margin: 0 0 1.5rem;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    text-transform: uppercase;
    letter-spacing: -0.02em;
}

.fa-mt-4 { margin-top: 2rem; }
.fa-mb-4 { margin-bottom: 2rem; }
.fa-text-muted { color: var(--fa-text-muted, #64748b); }
.fa-text-center { text-align: center; }

/* ── Cards ───────────────────────────────────────────────────────────── */
.fa-card {
    background: var(--fa-surface, #fff);
    border: none;
    border-radius: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
    overflow: hidden;
}
.fa-card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #f1f5f9;
    font-weight: 800;
    font-size: 1.05rem;
    color: var(--fa-primary-dark, #1b5e20);
    display: flex;
    align-items: center;
    gap: .6rem;
}
.fa-card-body {
    padding: 1.5rem;
}

/* ── Player cards (dashboard grid) ──────────────────────────────────── */
.fa-portal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}
.fa-player-card {
    display: flex;
    flex-direction: column;
    padding: 1.35rem;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.fa-player-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.06);
}
.fa-player-card-top {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}
.fa-player-card-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--fa-primary-light, #e8f5e9);
    color: var(--fa-primary-dark, #1b5e20);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}
.fa-player-card-avatar img { width: 100%; height: 100%; object-fit: cover; }
.fa-player-card-body h3 {
    margin: 0 0 .4rem;
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--fa-text, #1e293b);
}
.fa-player-card-meta {
    display: flex;
    align-items: center;
    gap: .6rem;
    font-size: .82rem;
    color: var(--fa-text-muted, #64748b);
    margin-bottom: .5rem;
    flex-wrap: wrap;
}
.fa-player-card-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .6rem 1.2rem;
    margin-top: 0.9rem;
    padding-top: 0.9rem;
    border-top: 1px solid #f1f5f9;
}
.fa-player-card-links a {
    font-size: .85rem;
    font-weight: 700;
    color: var(--fa-primary, #16a34a);
    text-decoration: none;
    transition: color 0.2s ease;
}
.fa-player-card-links a:hover {
    color: var(--fa-primary-dark, #15803d);
    text-decoration: underline;
}

/* ── Tables ──────────────────────────────────────────────────────────── */
.fa-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .9rem;
}
.fa-table th {
    text-align: left;
    padding: 0.8rem 1rem;
    border-bottom: 2px solid #e8f5e9;
    color: var(--fa-text-muted, #64748b);
    font-weight: 800;
    font-size: .74rem;
    text-transform: uppercase;
    letter-spacing: .06em;
}
.fa-table td {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    color: var(--fa-text, #334155);
}
.fa-table tbody tr:last-child td { border-bottom: none; }
.fa-table { overflow-x: auto; display: block; }
.fa-table thead, .fa-table tbody { display: table; width: 100%; table-layout: fixed; }

/* ── Badges ──────────────────────────────────────────────────────────── */
.fa-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: .72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.fa-badge-success { background: #e8f5e9; color: #1b5e20; }
.fa-badge-danger  { background: #ffebee; color: #c62828; }
.fa-badge-warning { background: #fff8e1; color: #f57f17; }
.fa-badge-muted   { background: #f1f5f9; color: #64748b; }
.fa-nav-badge     { padding: .05rem .45rem; margin-left: .15rem; font-size: .7rem; vertical-align: middle; }

/* ── Alerts ──────────────────────────────────────────────────────────── */
.fa-alert {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: 1rem 1.25rem;
    border-radius: 14px;
    margin-bottom: 1.5rem;
    font-size: .92rem;
    font-weight: 600;
    border: none;
}
.fa-alert-success { background: #e8f5e9; color: #1b5e20; }
.fa-alert-danger  { background: #ffebee; color: #c62828; }
.fa-alert-info    { background: #e3f2fd; color: #0d47a1; }

/* ── Forms ───────────────────────────────────────────────────────────── */
.fa-form-group { margin-bottom: 1.25rem; flex: 1; min-width: 200px; }
.fa-form-row { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.fa-label { display: block; font-size: .82rem; font-weight: 700; margin-bottom: .45rem; color: var(--fa-text, #1e293b); }
.fa-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #cbd5e1;
    border-radius: 14px;
    font-size: .92rem;
    font-family: inherit;
    background: #f8fafc;
    color: var(--fa-text, #1e293b);
    transition: border-color 0.22s ease, background-color 0.22s ease, box-shadow 0.22s ease;
}
.fa-input:focus {
    outline: none;
    border-color: var(--fa-primary, #16a34a);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(var(--fa-primary-rgb, 22, 163, 74), .12);
}
textarea.fa-input { resize: vertical; }

.fa-filter-bar {
    display: flex;
    align-items: flex-end;
    gap: 1.25rem;
    flex-wrap: wrap;
    background: var(--fa-surface, #fff);
    border: none;
    border-radius: 20px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
}
.fa-filter-bar .fa-form-group { margin-bottom: 0; min-width: 160px; }

/* ── Buttons ─────────────────────────────────────────────────────────── */
.fa-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    padding: 0.8rem 1.6rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: .85rem;
    border: none;
    cursor: pointer;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.fa-btn-primary {
    background: var(--fa-primary, #16a34a);
    color: #fff;
    box-shadow: 0 4px 12px rgba(var(--fa-primary-rgb, 22, 163, 74), 0.15);
}
.fa-btn-primary:hover {
    background: var(--fa-primary-dark, #15803d);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(var(--fa-primary-rgb, 22, 163, 74), 0.25);
}
/* ── Auth pages (login / forgot / reset) ────────────────────────────── */
.fa-portal-auth-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem 0;
}

.fa-portal-auth-card {
    width: 100%;
    max-width: 450px;
    background: var(--fa-surface, #fff);
    border: none;
    border-radius: 24px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.06), 0 5px 15px rgba(0,0,0,0.04);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Image side panel styling */
.fa-portal-auth-side-image {
    display: none;
}

/* Form side panel styling */
.fa-portal-auth-side-form {
    flex: 1;
    padding: 3rem 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.fa-portal-auth-header {
    text-align: left;
    margin-bottom: 2rem;
}

.fa-portal-badge-pill {
    display: inline-block;
    padding: 0.35rem 0.85rem;
    background: var(--fa-primary-light, #e8f5e9);
    color: var(--fa-primary-dark, #1b5e20);
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-radius: 50px;
    margin-bottom: 0.85rem;
}

.fa-portal-auth-header h1 {
    font-size: 1.85rem;
    font-weight: 900;
    margin: 0 0 .5rem;
    color: var(--fa-primary-dark, #1b5e20);
    text-transform: uppercase;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

.fa-portal-auth-header p {
    font-size: .9rem;
    color: var(--fa-text-muted, #64748b);
    margin: 0;
    line-height: 1.45;
}

.fa-portal-auth-footer {
    text-align: left;
    margin-top: 1.5rem;
    font-size: .88rem;
    position: relative;
    z-index: 10;
}

.fa-portal-auth-footer a {
    color: var(--fa-primary, #16a34a);
    font-weight: 700;
    text-decoration: none;
    transition: color 0.2s ease;
    position: relative;
    z-index: 11;
    display: inline-block;
}

.fa-portal-auth-footer a:hover {
    color: var(--fa-primary-dark, #15803d);
    text-decoration: underline;
}

/* Input & button refinements for premium feel */
.fa-form-group .fa-input {
    border: 1px solid #cbd5e1;
    padding: 0.8rem 1.1rem;
    font-size: 0.92rem;
    border-radius: 14px;
    background: #f8fafc;
}

.fa-form-group .fa-input:focus {
    border-color: var(--fa-primary, #16a34a);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(var(--fa-primary-rgb, 22, 163, 74), 0.12);
}

.fa-btn-primary {
    border-radius: 50px;
    padding: 0.85rem 1.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 4px 12px rgba(var(--fa-primary-rgb, 22, 163, 74), 0.15);
    transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.fa-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(var(--fa-primary-rgb, 22, 163, 74), 0.28);
}

.fa-btn-primary:active {
    transform: translateY(0);
}

/* ── Toast notifications (replaces browser alert()) ─────────────────── */
.fa-toast-stack {
    position: fixed;
    top: 1.25rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: .6rem;
    width: min(380px, calc(100vw - 2rem));
    pointer-events: none;
}
.fa-toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: .65rem;
    background: var(--fa-surface, #fff);
    color: var(--fa-text, #1e293b);
    border-radius: 14px;
    padding: .85rem 1rem;
    box-shadow: 0 12px 32px rgba(13, 27, 46, .18);
    border-left: 4px solid var(--fa-primary, #16a34a);
    font-size: .88rem;
    font-weight: 600;
    line-height: 1.4;
    opacity: 0;
    transform: translateY(-12px);
    transition: opacity .25s ease, transform .25s ease;
}
.fa-toast.show { opacity: 1; transform: translateY(0); }
.fa-toast-icon { font-size: 1.1rem; margin-top: .05rem; flex-shrink: 0; }
.fa-toast-close {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--fa-text-muted, #64748b);
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 0 0 0 .5rem;
    flex-shrink: 0;
}
.fa-toast-success { border-left-color: #16a34a; }
.fa-toast-success .fa-toast-icon { color: #16a34a; }
.fa-toast-warning { border-left-color: #f59e0b; }
.fa-toast-warning .fa-toast-icon { color: #f59e0b; }
.fa-toast-danger  { border-left-color: #dc2626; }
.fa-toast-danger  .fa-toast-icon { color: #dc2626; }
.fa-toast-info    { border-left-color: #0284c7; }
.fa-toast-info    .fa-toast-icon { color: #0284c7; }

@media (max-width: 480px) {
    .fa-toast-stack { top: .75rem; width: calc(100vw - 1.5rem); }
}

/* Responsive layout adjustments */
@media (min-width: 768px) {
    .fa-portal-auth-card {
        max-width: 860px;
        flex-direction: row;
        min-height: 520px;
    }

    .fa-portal-auth-side-image {
        display: flex;
        justify-content: center;
        align-items: flex-end;
        flex: 1.15;
        position: relative;
        background: linear-gradient(135deg, #a5e75c 0%, #4c8a14 100%);
        overflow: hidden;
        padding: 0;
    }

    /* Curved grass hill overlay at the bottom */
    .fa-portal-auth-side-image::after {
        content: "";
        position: absolute;
        bottom: 0;
        left: -10%;
        right: -10%;
        height: 100px;
        background: #5da01b;
        border-radius: 50% 50% 0 0 / 20px 20px 0 0;
        z-index: 2;
    }

    /* Backlight radial glow behind the player */
    .fa-portal-auth-decor-glow {
        position: absolute;
        width: 320px;
        height: 320px;
        background: radial-gradient(circle, rgba(255, 255, 255, 0.35) 0%, rgba(255, 255, 255, 0) 70%);
        top: 45%;
        left: 50%;
        transform: translate(-50%, -50%);
        z-index: 1;
        pointer-events: none;
    }

    /* The transparent character image */
    .fa-portal-auth-player-img {
        position: relative;
        z-index: 3;
        height: 85%;
        max-height: 420px;
        max-width: 90%;
        object-fit: contain;
        transition: transform 0.45s cubic-bezier(0.25, 1, 0.5, 1);
        pointer-events: none;
        filter: drop-shadow(0 8px 15px rgba(0, 0, 0, 0.12));
    }

    /* Ground shadow under player feet */
    .fa-portal-auth-player-shadow {
        position: absolute;
        bottom: 12px;
        width: 130px;
        height: 10px;
        background: rgba(0, 0, 0, 0.22);
        border-radius: 50%;
        z-index: 2;
        filter: blur(4px);
        transition: transform 0.45s ease, opacity 0.45s ease;
        pointer-events: none;
    }

    /* Hover animations (gaming/lifting effect) */
    .fa-portal-auth-card:hover .fa-portal-auth-player-img {
        transform: translateY(-10px) scale(1.03);
    }

    .fa-portal-auth-card:hover .fa-portal-auth-player-shadow {
        transform: scale(0.8);
        opacity: 0.5;
    }

    .fa-portal-auth-side-form {
        flex: 1;
        padding: 3.5rem 3rem;
    }
}

@media (max-width: 640px) {
    .fa-portal-nav-inner { padding: .9rem 1.1rem; }
    .fa-portal-nav-toggle { display: inline-flex; }

    /* The nav becomes a right-side slide-in drawer, off-screen until .open. */
    .fa-portal-nav-links {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: min(300px, 82vw);
        background: var(--fa-surface, #fff);
        flex-direction: column;
        align-items: stretch;
        gap: .3rem;
        padding: 1.25rem 1.1rem 2rem;
        transform: translateX(100%);
        transition: transform .3s cubic-bezier(.4,0,.2,1);
        z-index: 1050;
        box-shadow: -8px 0 32px rgba(13, 27, 46, .15);
        overflow-y: auto;
    }
    .fa-portal-nav-links.open { transform: translateX(0); }
    .fa-portal-nav-close { display: block; }
    .fa-portal-nav-link {
        width: 100%;
        justify-content: flex-start;
        border-radius: 12px;
        padding: .85rem 1rem;
        font-size: .92rem;
    }
    .fa-portal-nav-logout { margin-top: auto; border-top: 1px solid #f1f5f9; padding-top: 1rem; }

    .fa-form-row { flex-direction: column; gap: 0; }
}

/* ── Small screens: general spacing ─────────────────────────────────── */
@media (max-width: 600px) {
    .fa-portal-container { padding: 0 .9rem; }
    .fa-portal-page { padding: 2rem 0 3rem; }
    .fa-portal-title { font-size: 1.4rem; }
    .fa-card-header { padding: 1rem 1.1rem; }
    .fa-card-body { padding: 1.1rem; }
    .fa-filter-bar { padding: 1rem; gap: .9rem; }
    .fa-filter-bar .fa-form-group { min-width: 0; flex: 1 1 100%; }
    .fa-filter-bar .fa-btn { width: 100%; }
    .fa-attn-filter-form { gap: .9rem; }
    .fa-attn-range-group { width: 100%; }
    .fa-attn-range-btn { flex: 1 1 auto; text-align: center; padding: .55rem .6rem; }
    .fa-attn-filter-player { width: 100%; }
    .fa-attn-filter-form .fa-form-group { width: 100%; }
    .fa-attn-filter-form .fa-btn { width: 100%; }
    .fa-attn-range-display { margin-left: 0; }
    .fa-attn-monthly-table td:last-child { width: auto; }
    .fa-attn-pct-bar { min-width: 50px; max-width: 90px; }
    .fa-player-card-top { flex-wrap: wrap; }

    /* Data tables become stacked "cards" of label:value rows instead of
       squeezing a 4-6 column table into a phone-width viewport. Every <td>
       needs a matching data-label attribute (see attendance.php, fees.php,
       dashboard.php) — the label is drawn from that attribute, not the
       (now hidden) <thead>. */
    .fa-table thead { display: none; }
    .fa-table, .fa-table tbody, .fa-table tr, .fa-table td {
        display: block;
        width: 100%;
    }
    .fa-table tr {
        border: 1px solid #f1f5f9;
        border-radius: 14px;
        margin-bottom: .75rem;
        padding: .2rem .9rem;
    }
    .fa-table tbody tr:last-child { margin-bottom: 0; }
    .fa-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 1rem;
        padding: .6rem 0;
        border-bottom: 1px solid #f8fafc;
        text-align: right;
    }
    .fa-table td:last-child { border-bottom: none; }
    .fa-table td::before {
        content: attr(data-label);
        font-weight: 800;
        font-size: .68rem;
        text-transform: uppercase;
        letter-spacing: .05em;
        color: var(--fa-text-muted, #64748b);
        text-align: left;
        flex-shrink: 0;
    }
    .fa-table td[data-label=""]::before { content: none; }

    .fa-portal-auth-wrap { padding: 1.5rem 0; }
    .fa-portal-auth-card { border-radius: 18px; }
    .fa-portal-auth-side-form { padding: 2rem 1.25rem; }
    .fa-portal-auth-header h1 { font-size: 1.5rem; }
}

/* ── Request Kit modal: image column separator ──────────────────────── */
.fa-krq-image-col { border-top: 1px solid #e5e7eb; }
@media (min-width: 768px) {
    .fa-krq-image-col { border-top: none; border-left: 1px solid #e5e7eb; }
}

/* ── Attendance: quick-range filter ───────────────────────────────────── */
.fa-attn-filter-form { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.fa-attn-range-group { display: flex; gap: .5rem; flex-wrap: wrap; }
.fa-attn-range-btn {
    display: inline-block;
    padding: .55rem 1.1rem;
    border-radius: 50px;
    font-size: .84rem;
    font-weight: 700;
    text-decoration: none;
    color: var(--fa-text, #334155);
    background: #f1f5f9;
    border: 1px solid transparent;
    transition: background .15s, color .15s;
}
.fa-attn-range-btn:hover { background: #e2e8f0; }
.fa-attn-range-btn.is-active {
    background: var(--fa-primary, #16a34a);
    color: #fff;
}
.fa-attn-filter-player { margin-bottom: 0; min-width: 180px; }
.fa-attn-range-display {
    margin-left: auto;
    font-size: .84rem;
    font-weight: 600;
    color: var(--fa-text-muted, #64748b);
    white-space: nowrap;
}

/* Custom-range fields always drop to their own full-width row, so From/To
   never end up split across two unevenly-sized lines (flex-wrap otherwise
   breaks wherever it runs out of horizontal space). */
.fa-attn-custom-row {
    flex: 1 1 100%;
    display: flex;
    align-items: flex-end;
    gap: 1.25rem;
    flex-wrap: wrap;
}
.fa-attn-custom-row .fa-form-group { flex: 1 1 160px; min-width: 160px; margin-bottom: 0; }
.fa-attn-custom-row .fa-attn-range-display { margin-left: auto; }

/* ── Attendance: monthly overview % bar ───────────────────────────────── */
.fa-attn-monthly-table th:last-child,
.fa-attn-monthly-table td:last-child { min-width: 170px; width: 26%; }
.fa-attn-pct-bar-wrap { display: flex; align-items: center; gap: .6rem; }
.fa-attn-pct-bar { flex: 1 1 auto; min-width: 70px; height: 7px; background: #f1f5f9; border-radius: 6px; overflow: hidden; }
.fa-attn-pct-bar-fill { height: 100%; background: var(--fa-primary, #16a34a); border-radius: 6px; }
.fa-attn-pct-label { font-size: .84rem; font-weight: 700; color: var(--fa-text, #1e293b); white-space: nowrap; }

/* ── Attendance: summary strip ──────────────────────────────────────── */
.fa-attn-summary-card { margin-bottom: 1.5rem; }
.fa-attn-summary { display: flex; gap: 1.75rem; flex-wrap: wrap; margin-bottom: 1rem; }
.fa-attn-stat-num { font-size: 1.4rem; font-weight: 800; color: var(--fa-text, #1e293b); }
.fa-attn-stat-label { font-size: .78rem; color: var(--fa-text-muted, #64748b); font-weight: 600; }
.fa-attn-progress { height: 6px; border-radius: 6px; background: #f1f5f9; overflow: hidden; }
.fa-attn-progress-bar { height: 100%; background: #16a34a; border-radius: 6px; }

.fa-attn-c-present { color: #15803d; }
.fa-attn-c-absent  { color: #dc2626; }
.fa-attn-c-late    { color: #b45309; }
.fa-attn-c-excused { color: #2563eb; }
.fa-attn-c-present-bg { background: #22c55e; }
.fa-attn-c-absent-bg  { background: #ef4444; }
.fa-attn-c-late-bg    { background: #f59e0b; }
.fa-attn-c-excused-bg { background: #3b82f6; }

/* ── Attendance: calendar (week-block month grid) ─────────────────────── */
.fa-attn-cal-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1rem; }
.fa-attn-cal-card .fa-card-header { padding: .7rem .9rem; font-size: .88rem; }
.fa-attn-cal-card .fa-card-body { padding: .6rem; }
.fa-attn-cal-row { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); gap: 3px; margin-bottom: 3px; }
.fa-attn-cal-head { font-size: .62rem; font-weight: 800; color: var(--fa-text-muted, #64748b); text-transform: uppercase; text-align: center; margin-bottom: 5px; letter-spacing: .02em; }
.fa-attn-cal-cell {
    position: relative;
    aspect-ratio: 1 / 1;
    min-height: 24px;
    border-radius: 5px;
    background: #f8fafc;
    border: 1px solid #eef2f6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .66rem;
    font-weight: 700;
    color: #334155;
}
.fa-attn-cal-cell.is-empty { background: transparent; border: none; }
.fa-attn-cal-cell.is-outside { opacity: .4; }
.fa-attn-cal-cell.is-today { box-shadow: inset 0 0 0 2px var(--fa-primary, #16a34a); }
.fa-attn-cal-cell.is-present { background: #e8f5e9; border-color: #a5d6a7; color: #1b5e20; }
.fa-attn-cal-cell.is-absent  { background: #ffebee; border-color: #ef9a9a; color: #c62828; }
.fa-attn-cal-cell.is-late    { background: #fff8e1; border-color: #ffe082; color: #f57f17; }
.fa-attn-cal-cell.is-excused { background: #e3f2fd; border-color: #90caf9; color: #0d47a1; }
.fa-attn-cal-cell.is-clickable { cursor: pointer; }
.fa-attn-cal-cell.is-clickable:hover { filter: brightness(0.96); }
.fa-attn-note-dot {
    position: absolute; top: 2px; right: 2px; width: 5px; height: 5px;
    border-radius: 50%; background: #1e293b;
}

.fa-attn-legend {
    display: flex; gap: 1.25rem; flex-wrap: wrap; align-items: center;
    font-size: .82rem; color: var(--fa-text-muted, #64748b); font-weight: 600;
    background: var(--fa-surface, #fff);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
    padding: .9rem 1.25rem;
    margin: 0 0 1.5rem;
}
.fa-attn-legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: .4rem; vertical-align: middle; }

/* ── Attendance: click-to-view popover for a day cell ─────────────────── */
.fa-attn-pop {
    position: fixed; z-index: 3000; max-width: 240px; min-width: 170px;
    background: var(--fa-surface, #fff); border: 1px solid #e2e8f0; border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,.18); padding: 12px 14px 10px; font-size: .82rem; display: none;
}
.fa-attn-pop.show { display: block; }
.fa-attn-pop-close {
    position: absolute; top: 4px; right: 8px; cursor: pointer; color: #94a3b8;
    font-size: 1.1rem; line-height: 1; background: none; border: none; padding: 4px;
}
.fa-attn-pop-date { font-weight: 800; margin-bottom: 5px; padding-right: 14px; color: var(--fa-text, #1e293b); }
.fa-attn-pop-row { margin-bottom: 3px; color: var(--fa-text, #334155); }
.fa-attn-pop-row strong { color: var(--fa-text-muted, #64748b); font-weight: 700; }

@media (max-width: 900px) {
    .fa-attn-cal-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .fa-attn-cal-grid { grid-template-columns: 1fr; gap: .75rem; }
    .fa-attn-summary { gap: 1.1rem; }
    .fa-attn-stat-num { font-size: 1.15rem; }
    .fa-attn-cal-cell { min-height: 30px; font-size: .74rem; border-radius: 7px; }
    .fa-attn-cal-head { font-size: .6rem; }
}
