/* ============================================================
   UK QURAN - GLOBAL STYLES & THEMING
   ============================================================ */

:root {
    color-scheme: light;
    --primary-orange: #F29C38;
    --bg-light: #F4F5F7;
    --text-dark: #333333;
    --text-muted: #888888;
    --white: #FFFFFF;
    
    /* Badge / Pill variables */
    --badge-bg: #FFFFFF;
    --badge-border: rgba(16,24,40,0.06);
    --badge-shadow: 0 2px 6px rgba(16,24,40,0.04);
    --pill-label-color: #5C4B37;
    --pill-count-bg: #F4F5F7;
    --pill-count-color: #333333;
    --pill-gap: 8px;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

@media (hover: none) and (pointer: coarse) {
    a:focus, button:focus, input:focus, select:focus, textarea:focus, [tabindex]:focus {
        outline: none;
    }
}

/* --- FIXED BACKGROUND (NO MOBILE SCROLL GAPS) --- */
html {
    height: 100%;
    background-color: #0d1322;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Outfit', sans-serif;
    min-height: 100vh;
    min-height: 100dvh; /* Fixes dynamic address bar gap on mobile phones */
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #0d1322;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background: linear-gradient(rgba(10, 15, 26, 0.65), rgba(10, 15, 26, 0.65)),
                url("images/Background/download.webp") center center / cover no-repeat;
    z-index: 0;
    pointer-events: none;
}

/* ============================================================
   2. LANDING & LOGIN CARD CONTAINER (RESPONSIVE)
   ============================================================ */

.login-container {
    position: relative;
    z-index: 2;
    width: min(450px, 92vw);
    border-radius: 24px;
    padding: 36px 32px;
    text-align: center;
    
    /* Glassmorphism Styling */
    background: rgba(17, 24, 39, 0.78);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);

    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.3s ease;
}

@media (max-width: 480px) {
    body {
        padding: 10px 0;
    }
    .login-container {
        width: 94vw;
        padding: 28px 20px;
        border-radius: 20px;
    }
}

/* Logo & Header */
.header {
    margin-top: 0;
    margin-bottom: 24px;
    text-align: center;
    color: white;
    width: 100%;
}

.header h1 {
    margin: 10px 0 0;
    font-size: clamp(1.8rem, 3vw, 2.2rem);
    letter-spacing: -0.02em;
    font-weight: 700;
}

.logo {
    width: 72px;
    height: 72px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.4);
}

.logo img {
    border-radius: 50%;
    border: 3px solid #ffffff;
    object-fit: cover;
}

/* ============================================================
   3. LANDING CONTENT & BUTTONS
   ============================================================ */

.landing-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
    animation: fadeIn 0.4s ease;
}

.landing-title {
    color: #fff;
    font-size: clamp(1.6rem, 2.5vw, 2rem);
    font-weight: 700;
    margin: 0 0 8px;
}

.landing-subtitle {
    color: #e2e8f0;
    font-size: 1.1rem;
    margin: 0 0 16px;
    font-weight: 500;
}

.landing-description {
    color: #cbd5e1;
    line-height: 1.6;
    margin: 0 0 28px;
    font-size: 0.95rem;
    max-width: 380px;
}

.landing-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    align-items: center;
}

.btn-primary1 {
    width: 100%;
    height: 48px;
    border-radius: 14px;
    background: #1e293b;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
    margin: 0;
    box-sizing: border-box;
}

.btn-primary1:hover {
    background: #334155;
    transform: translateY(-1px);
}

.btn-guest {
    width: 100%;
    height: 48px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-sizing: border-box;
    margin: 0;
}

.btn-guest:hover {
    background: rgba(255, 255, 255, 0.22);
    transform: translateY(-1px);
}

.btn-primary {
    width: 100%;
    padding: 16px 18px;
    border-radius: 16px;
    background: #111827;
    color: #ffffff;
    border: none;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 18px 40px rgba(17, 24, 39, 0.16);
}

.btn-primary:hover {
    transform: translateY(-1px);
}

/* ============================================================
   4. LOGIN FORM & INPUT CONTROLS
   ============================================================ */

form {
    display: flex;
    flex-direction: column;
    width: 100%;
    text-align: left;
    box-sizing: border-box;
}

.form-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    width: 100%;
}

.btn-back {
    background: transparent;
    border: none;
    color: #cbd5e1;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
}

.btn-back:hover {
    color: #ffffff;
    text-decoration: underline;
}

.form-title {
    font-size: 1rem;
    font-weight: 700;
    color: #ffffff;
}

label1, label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.85rem;
    color: #e2e8f0;
    font-weight: 600;
    margin-left: 0;
}

input, input.nameinput {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    margin-bottom: 18px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.95);
    color: #0f172a;
    font-family: inherit;
    font-size: 0.95rem;
    box-sizing: border-box;
    margin-left: 0;
}

input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

.password-container {
    position: relative;
    width: 100%;
    margin-bottom: 24px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
}

.password-container input {
    width: 100%;
    height: 48px;
    padding: 0 44px 0 16px;
    margin-bottom: 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.95);
    color: #0f172a;
    font-size: 0.95rem;
    box-sizing: border-box;
    margin-left: 0;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.password-toggle .icon-eye {
    width: 18px;
    height: 18px;
    fill: currentColor;
    display: block;
}

.password-toggle .icon-eye-slash {
    display: none;
}

.password-toggle.is-visible .icon-eye-open {
    display: none;
}

.password-toggle.is-visible .icon-eye-slash {
    display: block;
}

.footer {
    margin-top: 28px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
}

.footer p {
    margin: 0;
}

/* ============================================================
   5. PRELOADER OVERLAY
   ============================================================ */

.preloader {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(rgba(10, 15, 26, 0.75), rgba(10, 15, 26, 0.75)),
                url("images/Background/download.webp") center center / cover no-repeat;
    z-index: 99999;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.preloader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
}

.preloader-logo {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    border: 4px solid white;
}

.preloader-title {
    color: white;
    margin: 0;
    font-size: 32px;
    font-weight: 700;
}

.preloader-text {
    color: white;
    font-size: 16px;
    opacity: 0.9;
}

/* Loaders */
.loader-inline1 {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255,255,255,0.3);
    border-top: 2.5px solid #ffffff;
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
    vertical-align: middle;
}

.loader-inline5 {
    display: inline-block;
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255,255,255,0.2);
    border-top: 3px solid white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { 
    from { transform: rotate(0deg); } 
    to { transform: rotate(360deg); } 
}

/* ============================================================
   6. PWA INSTALL PROMPT & TOASTS
   ============================================================ */

.a2hs-prompt {
    position: fixed;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%);
    width: min(420px, 92%);
    z-index: 9999;
}

.a2hs-card {
    background: rgba(255, 255, 255, 0.97);
    border-radius: 24px;
    box-shadow: 0 22px 60px rgba(15, 23, 42, 0.14);
    border: 1px solid rgba(15, 23, 42, 0.08);
    padding: 18px 18px 14px;
}

.a2hs-content {
    display: flex;
    align-items: center;
    gap: 14px;
}

.a2hs-icon {
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: #111827;
    color: #ffffff;
    font-size: 22px;
}

.a2hs-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
}

.a2hs-description {
    margin: 6px 0 0;
    color: #475569;
    font-size: 0.92rem;
    line-height: 1.4;
}

.a2hs-actions {
    margin-top: 16px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.a2hs-ios-tip {
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #334155;
    font-size: 0.92rem;
    line-height: 1.5;
}

.btn-link {
    border: none;
    background: transparent;
    color: black;
    font-weight: 700;
    cursor: pointer;
    padding: 0;
    margin-left: 10px;
}

.toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    background: #333;
    color: #fff;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.success { background: #137333; }
.toast.error { background: #b71c1c; }

.hidden { display: none !important; }

/* ============================================================
   7. RESPONSIVE DASHBOARD APP LAYOUT (MOBILE, TABLET & DESKTOP)
   ============================================================ */

/* --- 100% EDGE-TO-EDGE FULL SCREEN DASHBOARD --- */
.app-container {
    width: 100% !important;
    min-width: 100vw;
    max-width: 100vw !important;
    margin: 0 !important;
    padding: 0 0 120px 0 !important;
    background-color: var(--bg-light) !important;
    min-height: 100vh;
    min-height: 100dvh;
    border-radius: 0 !important;
    box-shadow: none !important;
    position: relative;
    box-sizing: border-box;
    z-index: 10;
}

.dash-header,
.greeting,
.summary-section,
.student-search-section,
.student-list,
.student-action-card,
.action-cards-grid,
.table-container {
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
}

@media (max-width: 1140px) {
    .app-container {
        margin: 12px auto;
        border-radius: 18px;
    }
}

@media (max-width: 768px) {
    .app-container {
        max-width: 100%;
        margin: 0;
        border-radius: 0;
        min-height: 100vh;
        box-shadow: none;
    }
}

/* --- DASHBOARD HEADER --- */
.dash-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 24px 32px; 
    background: var(--white); 
    border-bottom: 1px solid #eaeaea; 
}

@media (max-width: 480px) {
    .dash-header { padding: 18px 20px; }
}

.user-info { display: flex; align-items: center; gap: 15px; }
.user-info .avatar { 
    font-size: 30px; 
    background: var(--primary-orange); 
    border-radius: 50%; 
    width: 50px; 
    height: 50px; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
}
.user-info h2 { margin: 0; font-size: 18px; color: #5C4B37; font-weight: 600; }
.user-info p { margin: 2px 0 0; font-size: 12px; color: #8E785C; }
.icon-btn { background: none; border: none; cursor: pointer; color: #8E785C; display: flex; justify-content: center; align-items: center; padding: 8px; border-radius: 50%; transition: background-color 0.2s; }
.icon-btn:hover { background-color: rgba(142, 120, 92, 0.1); }

/* --- GREETING SECTION --- */
.greeting { padding: 24px 32px 10px; }
.greeting h1 { color: #5C4B37; font-size: 24px; margin: 0 0 6px; font-weight: 700; }
.greeting p { color: var(--text-muted); font-size: 14px; margin: 0; }

@media (max-width: 480px) {
    .greeting { padding: 18px 20px 0; }
    .greeting h1 { font-size: 20px; }
}

/* --- TEACHER SUMMARY SECTION --- */
.summary-section { 
    display: grid; 
    grid-template-columns: 1fr 1fr 1.2fr; 
    gap: 16px; 
    padding: 24px 32px 16px; 
}

.summary-card { 
    background: #ECECEC; 
    padding: 16px; 
    border-radius: 18px; 
    display: flex; 
    flex-direction: column; 
    justify-content: space-between; 
    height: 100px; 
    box-sizing: border-box; 
}
.summary-card.highlight-green { background: #82EE85; color: #004d40; }
.summary-label { font-size: 11px; font-weight: 600; color: #888888; line-height: 1.2; }
.summary-card.highlight-green .summary-label { color: #004d40; opacity: 0.85; }
.summary-value { margin: 0; font-size: 28px; font-weight: bold; color: #333333; }
.summary-card.highlight-green .summary-value { color: #004d40; }

.action-buttons { display: flex; flex-direction: column; gap: 8px; justify-content: space-between; height: 100px; }
.btn-light { background: #FFF3E0; border: none; font-weight: bold; color: #D88212; cursor: pointer; height: calc(50% - 4px); display: flex; justify-content: center; align-items: center; border-radius: 12px; font-size: 12px; font-family: inherit; box-sizing: border-box; }
.btn-outline { background: white; border: 1px solid #146c43; color: #146c43; font-weight: bold; cursor: pointer; height: calc(50% - 4px); display: flex; justify-content: center; align-items: center; border-radius: 12px; font-size: 12px; font-family: inherit; box-sizing: border-box; transition: background 0.2s; }
.btn-outline:hover { background: #f4f5f7; }

@media (max-width: 600px) {
    .summary-section { grid-template-columns: 1fr 1fr 1.2fr; gap: 10px; padding: 16px 20px; }
    .summary-card { height: 90px; padding: 12px; }
    .summary-value { font-size: 24px; }
    .action-buttons { height: 90px; }
}

/* --- STUDENT CARDS GRID (DESKTOP / TABLET RESPONSIVE) --- */
.student-search-section { padding: 0 32px 16px; }
.student-search-input {
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 0;
    padding: 14px 18px;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    background: var(--white);
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.student-search-input:focus {
    outline: none;
    border-color: var(--primary-orange);
    box-shadow: 0 0 0 3px rgba(242, 156, 56, 0.12);
}

.student-list { 
    padding: 0 17px; 
    display: flex; 
    flex-direction: column; 
    gap: 16px; 
}

/* Desktop 2-Column Grid for Teacher Student List */
@media (min-width: 768px) {
    .student-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    .student-search-section { padding: 0 17px 20px; }
}

.student-card { background: var(--white); border-radius: 16px; padding: 18px; border-left: 5px solid #2e7d32; box-shadow: 0 4px 15px rgba(0,0,0,0.04); }
.empty-state { background: var(--white); border-radius: 16px; padding: 24px; text-align: center; color: var(--text-muted); box-shadow: 0 2px 10px rgba(0,0,0,0.03); grid-column: span 2; }
.student-card.absent { border-left: 5px solid #EA4335; }

.sc-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; cursor: pointer; }
.sc-info { display: flex; align-items: center; gap: 12px; }
.sc-info .av { background: #ffcc80; width: 42px; height: 42px; border-radius: 50%; display: flex; justify-content: center; align-items: center; font-weight: bold;}
.sc-info h4 { margin: 0; font-size: 16px;}
.student-meta { margin: 3px 0 0; font-size: 12px; color: #888888; font-weight: 500; }

.sc-actions { display: flex; align-items: center; gap: 10px; }
.icon-btn-delete { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 10px; border: 1px solid rgba(183, 28, 28, 0.25); background: #fff5f5; color: #b71c1c; cursor: pointer; transition: background 0.15s ease; }
.icon-btn-delete:hover { background: #ffe3e3; }

.toggle-p-a { display: flex; background: #f1f3f4; border-radius: 20px; overflow: hidden; }
.toggle-p-a button { border: none; padding: 6px 14px; font-size: 12px; font-weight: bold; cursor: pointer; background: transparent; color: #aaa; }
.toggle-p-a .active-p { background: #80e27e; color: #004d40; }
.toggle-p-a .active-a { background: #ff8a80; color: #b71c1c; }

.sc-bottom { display: none; flex-direction: column; gap: 12px; }
.student-card.expanded .sc-bottom { display: flex; }
.remark-input { width: 100%; box-sizing: border-box; border: 1px solid #eaeaea; border-radius: 10px; padding: 10px; font-size: 13px; }

/* --- ACTION CARDS & BANNER BUTTONS (STUDENT & GUEST) --- */
.student-action-card { background: white; margin: 20px 32px; border-radius: 20px; padding: 24px; box-shadow: 0 4px 20px rgba(0,0,0,0.05); }
.student-action-card h3 { margin: 0 0 20px; font-size: 17px; color: #5C4B37; display: flex; align-items: center; gap: 8px; cursor: pointer; }

@media (max-width: 768px) {
    .student-action-card { margin: 16px 20px; padding: 18px; }
}

/* Action Rows Grid Layout for Tablet/Desktop */
.student-action-row { 
    display: flex; 
    padding: 0 17px 16px; 
    width: 100%;
}

/* Multi-column Action Banner Layout for Desktop/Tablet */
@media (min-width: 640px) {
    .action-cards-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 20px;
        padding: 0 32px 20px;
    }
    .action-cards-grid .student-action-row {
        padding: 0;
    }
}

.btn-squareq { 
    width: 100%; display: flex; align-items: center; justify-content: start; min-height: 120px; 
    border-radius: 20px; border: 1px solid #fff; 
    background-image: url(images/Banner/banner-2-reverse.webp); background-size: cover; background-position: center; 
    color: black; font-weight: 700; cursor: pointer; font-size: 15px; padding: 0 18px; box-shadow: 0 10px 25px rgba(0,0,0,0.04); 
}
.btn-squarew { 
    width: 100%; display: flex; align-items: center; justify-content: start; min-height: 120px; 
    border-radius: 20px; border: 1px solid #fff; 
    background-image: url(images/Banner/banner-2-reverse.webp); background-size: cover; background-position: center; 
    color: black; font-weight: 700; cursor: pointer; font-size: 15px; padding: 0 18px; box-shadow: 0 10px 25px rgba(0,0,0,0.04); 
}


/* --- RELATIVE BANNER PATH FIXES FOR SUBFOLDERS --- */
.btn-square1 { 
    width: 100%; display: flex; align-items: center; justify-content: end; min-height: 120px; 
    border-radius: 20px; border: 1px solid #fff; 
    background-image: url(images/Banner/banner-3.webp); background-size: cover; background-position: center; 
    color: black; font-weight: 700; cursor: pointer; font-size: 15px; padding: 0 18px; box-shadow: 0 10px 25px rgba(0,0,0,0.04); 
}

.btn-square3 { 
    width: 100%; display: flex; align-items: center; justify-content: end; min-height: 120px; 
    border-radius: 20px; border: 1px solid #fff; 
    background-image: url(images/Banner/banner-3.webp); background-size: cover; background-position: center; 
    color: black; font-weight: 700; cursor: pointer; font-size: 15px; padding: 0 18px; box-shadow: 0 10px 25px rgba(0,0,0,0.04); 
}

.lesson-1 { 
    background-image: url(images/Banner/lesson-1-banner.webp); 
    background-size: cover; background-position: center; border-radius: 18px; padding: 16px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); 
}

.qiraat { 
    height: 100px; background-image: url(images/Banner/banner-3-reverse.webp); 
    background-size: cover; background-position: center; border-radius: 18px; padding: 16px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); 
}

/* Fallback image paths for nested component files */
.app-container .btn-squareq { background-image: url(../../images/Banner/banner-2-reverse.webp); }
.app-container .btn-squarew { background-image: url(../../images/Banner/banner-2-reverse.webp); }
.app-container .btn-square1 { background-image: url(../../images/Banner/banner-3.webp); }
.app-container .btn-square3 { background-image: url(../../images/Banner/banner-3.webp); }
.app-container .lesson-1 { background-image: url(../../images/Banner/lesson-1-banner.webp); }
.app-container .qiraat { background-image: url(../../images/Banner/banner-3-reverse.webp); }

/* --- RESPONSIVE VIDEO GRID (THAJWEED PAGE) --- */
.video-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 16px;
    width: 100%;
}

@media (max-width: 500px) {
    .video-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

.video-card { 
    width: 100% !important; 
    display: flex; 
    flex-direction: column; 
    gap: 10px; 
    background: #ffffff; 
    border-radius: 18px; 
    padding: 14px; 
    box-shadow: 0 10px 25px rgba(0,0,0,0.06); 
}

.thumb-wrap { position: relative; width: 100%; max-width: 100%; }
.video-thumb { width: 100%; height: 120px; object-fit: cover; border-radius: 12px; display: block; }

/* --- FULL-WIDTH FLOATING SAVE BAR --- */
.save-container { 
    position: fixed; 
    bottom: 0; 
    left: 0;
    right: 0;
    width: 100vw; 
    padding: 16px 24px; 
    box-sizing: border-box; 
    background: rgba(244, 245, 247, 0.95); 
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    z-index: 100; 
    display: flex;
    justify-content: center;
}

.save-container .btn-primary,
.save-container button {
    max-width: 1200px;
    width: 100%;
    height: 50px;
    margin: 0 auto;
    border-radius: 14px;
    background: #111827 !important;
    color: #ffffff !important;
    border: none !important;
    font-weight: 700;
}

@media (max-width: 768px) {
    .save-container { 
        max-width: 100%; 
        padding: 16px 20px; 
    }
}

/* Clean Spacing for Student Daily Input Cards on Desktop */
@media (min-width: 768px) {
    .stepper-row, 
    .attendance-toggle-row, 
    .heard-by-row {
        max-width: 650px; /* Limits super-wide stretching on large monitors */
        margin-left: auto;
        margin-right: auto;
    }
}

/* ============================================================
   8. MODALS, TABLES & PRINT STYLES
   ============================================================ */

.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.65);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
    z-index: 9999;
    backdrop-filter: blur(4px);
    overflow-y: auto;
}
.modal-overlay.hidden { display: none !important; }
body.modal-open { overflow: hidden; }

.modal-content { 
    background: var(--white); 
    padding: 28px; 
    border-radius: 20px; 
    width: 100%; 
    max-width: 440px; 
    box-shadow: 0 20px 50px rgba(0,0,0,0.3); 
}

.modal-content h3 { margin: 0 0 16px 0; color: #5C4B37; font-size: 20px; }
.modal-actions { display: flex; gap: 12px; margin-top: 24px; }
.modal-actions button { flex: 1; padding: 14px; border-radius: 12px; }

.btn-danger { background: #b71c1c; color: #fff; border: none; padding: 12px 20px; border-radius: 12px; font-weight: 600; cursor: pointer; }
.btn-danger:disabled { opacity: 0.6; cursor: not-allowed; }

/* Reports Page */
.reports-filters { display: flex; gap: 16px; padding: 20px 32px 10px; }
.filter-group { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.filter-group label { font-size: 12px; color: #888; font-weight: 600; }
.filter-group select { padding: 12px 16px; border-radius: 10px; border: 1px solid #ddd; font-family: inherit; font-size: 14px; background: white; }

.reports-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 10px 32px 16px; }
.full-width-card { grid-column: span 2; background: #FFF3E0; padding: 20px 24px; border-radius: 16px; }
.flex-title { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #888; font-weight: 600;}
.full-width-card h2 { margin: 6px 0 0; color: #D88212; font-size: 28px; }

.half-card-blue { background: #E8F0FE; padding: 18px; border-radius: 16px; }
.half-card-blue span { font-size: 12px; color: #1967D2; font-weight: 600; }
.half-card-blue p { margin: 6px 0 0; color: #1967D2; font-weight: bold; font-size: 20px;}

.half-card-green { background: #E6F4EA; padding: 18px; border-radius: 16px; }
.half-card-green span { font-size: 12px; color: #137333; font-weight: 600; }
.half-card-green p { margin: 6px 0 0; color: #137333; font-weight: bold; font-size: 20px;}

.table-container { padding: 0 0px; overflow-x: auto; margin-bottom: 120px; }
.excel-table { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 600px; font-size: 13px; text-align: center; background: white; }
.excel-table th, .excel-table td { border: 1px solid #ddd; padding: 12px 10px; }
.excel-table .th-orange { background-color: var(--primary-orange); color: white; padding: 14px;}
.excel-table .th-blue { background-color: #4A90E2; color: white; font-weight: 600; }
.excel-table td { color: #333; }

.excel-table thead .sticky-col,
.excel-table thead th:first-child {
    position: relative; left: 0; z-index: 3; color: #ffffff; font-weight: 600; box-shadow: 2px 0 4px rgba(0,0,0,0.08);
}

.excel-table tbody .sticky-col,
.excel-table tbody td:first-child {
    position: relative; left: 0; z-index: 2; background-color: #ffffff; color: #333333; font-weight: bold; text-align: left; box-shadow: 2px 0 4px rgba(0,0,0,0.06);
}

@media print {
    .dash-header, .reports-filters, .save-container, .icon-btn { display: none !important; }
    body, .app-container { background: white !important; box-shadow: none !important; max-width: 100% !important; margin: 0 !important; padding: 0 !important; }
    .table-container { overflow: visible !important; margin-bottom: 0 !important; padding: 0 !important; }
    .excel-table tr { page-break-inside: avoid; break-inside: avoid; }
    @page { size: landscape; margin: 1cm; }
}

/* 1. Prevent sibling cards in the grid row from stretching when one card expands */
@media (min-width: 768px) {
    .student-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        align-items: start !important; /* CRITICAL FIX for card expansion bug */
        gap: 20px;
    }
}

/* 2. Expanded Card Form Container */
.student-card .sc-bottom {
    display: none;
    flex-direction: column;
    gap: 14px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #f1f5f9;
}

.student-card.expanded .sc-bottom {
    display: flex;
}

/* 3. Progress Rows & Dropdowns (Gray background box + White pill select) */
.student-card .progress-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.student-card .progress-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
    padding: 10px 16px;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    width: 100%;
    box-sizing: border-box;
}

.student-card .progress-item span {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
}

.page-select {
    height: 38px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #0f172a;
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
}

/* 4. Dark Labels & Light Gray Rounded Text Inputs */
.student-card label,
.student-card .heard-by-row label,
.student-card .sc-bottom label {
    display: block !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    color: #374151 !important; /* Dark legible text */
    margin-bottom: 6px !important;
}

.student-card input[type="text"],
.student-card .remark-input {
    width: 100% !important;
    height: 44px !important;
    padding: 10px 16px !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    background: #f8fafc !important; /* Soft light gray background */
    color: #0f172a !important;
    font-size: 14px !important;
    font-family: inherit !important;
    box-sizing: border-box !important;
    margin-bottom: 0 !important;
}

.student-card input[type="text"]::placeholder,
.student-card .remark-input::placeholder {
    color: #94a3b8 !important;
}

.student-card input[type="text"]:focus,
.student-card .remark-input:focus {
    outline: none !important;
    border-color: #4A90E2 !important;
    background: #ffffff !important;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.15) !important;
}

/* 5. Solid Blue "View Monthly Progress" Button */
.student-card .btn-monthly-progress,
.btn-monthly-progress {
    width: 100% !important;
    height: 44px !important;
    border-radius: 12px !important;
    background: #4A90E2 !important; /* Matches Netlify Blue Button */
    color: #ffffff !important;
    border: none !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    margin-top: 4px !important;
    transition: background 0.2s ease !important;
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.25) !important;
}

.student-card .btn-monthly-progress:hover,
.btn-monthly-progress:hover {
    background: #2563eb !important;
}

/* --- FIX MODAL LABELS & REAL-TIME VALIDATION HINTS --- */
.modal-content label {
    display: block !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    color: #374151 !important; /* Dark, bold, legible labels */
    margin-bottom: 6px !important;
    margin-top: 10px !important;
}

.modal-content input[type="text"],
.modal-content input[type="email"],
.modal-content input[type="password"] {
    width: 100% !important;
    height: 44px !important;
    padding: 0 14px !important;
    border: 1px solid #d1d5db !important;
    border-radius: 10px !important;
    background: #ffffff !important;
    color: #111827 !important;
    font-size: 14px !important;
    box-sizing: border-box !important;
    margin-bottom: 4px !important;
}

.modal-content input.input-error {
    border-color: #b71c1c !important;
    background: #fff5f5 !important;
}

.field-hint {
    display: block;
    font-size: 12px;
    color: #8E785C;
    margin-bottom: 10px;
}

.field-hint.valid {
    color: #137333 !important; /* Green for valid input */
}

.field-hint.error {
    color: #b71c1c !important; /* Red for invalid input */
}

.copy-button {
    border: 1px solid #c5cdd6;
    background: #ffffff;
    color: #1f2937;
    border-radius: 12px;
    padding: 10px 16px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s ease, border-color 0.2s ease;
}
.copy-button:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}
.pay-button {
    border: 1px solid #FFFFFF;
    background: #4b89c6;
    color: #ffffff;
    border-radius: 12px;
    padding: 10px 16px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s ease, border-color 0.2s ease;
}
.pay-button:hover {
    background:#2568aa;
    border-color: #FFFFFF;
}
.shareQr-button {
    border: 1px solid #FFFFFF;
    background: #4b89c6;
    color: #ffffff;
    border-radius: 12px;
    padding: 10px 16px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s ease, border-color 0.2s ease;
}
.shareQr-button:hover {
    background:#2568aa;
    border-color: #FFFFFF;
}



.donation-upi-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px;
    background: #f8f9fb;
    border: 1px solid #e3e7ed;
    border-radius: 14px;
    margin-top: 12px;
}
.donation-upi-row1 {
    
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px;
    background: #f8f9fb;
    border: 1px solid #e3e7ed;
    border-radius: 14px;
    margin-top: 12px;
}
.donation-upi-text {
    flex: 1;
    font-size: 14px;
    color: #2b2b2b;
    word-break: break-all;
}
