/* ================================================================
   SCHOOL FEES CHECKER – Global Stylesheet
   Dark glassmorphism theme with traffic-light accent palette
   ================================================================ */

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── CSS Custom Properties ── */
:root {
    --bg-primary:    #0a0e1a;
    --bg-secondary:  #111827;
    --bg-card:       rgba(17, 24, 39, 0.7);
    --bg-glass:      rgba(255, 255, 255, 0.04);
    --border-glass:  rgba(255, 255, 255, 0.08);
    --text-primary:  #f1f5f9;
    --text-secondary:#94a3b8;
    --text-muted:    #64748b;

    /* Traffic Light */
    --green:    #22c55e;
    --green-bg: rgba(34,197,94,0.12);
    --yellow:   #eab308;
    --yellow-bg:rgba(234,179,8,0.12);
    --red:      #ef4444;
    --red-bg:   rgba(239,68,68,0.12);

    /* Accent */
    --accent:     #6366f1;
    --accent-hover:#818cf8;
    --accent-bg:  rgba(99,102,241,0.12);

    /* Sizes */
    --sidebar-w: 260px;
    --radius:    12px;
    --radius-sm: 8px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

/* ── LAYOUT ── */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-w);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-glass);
    padding: 2rem 0;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    transition: transform 0.3s ease;
}
.sidebar-brand {
    padding: 0 1.5rem 2rem;
    border-bottom: 1px solid var(--border-glass);
    margin-bottom: 1rem;
}
.sidebar-brand h2 {
    font-size: 1.15rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent), #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.sidebar-brand span {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: block;
    margin-top: 2px;
}
.sidebar-nav { flex: 1; padding: 0 0.75rem; }
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    margin-bottom: 2px;
}
.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: var(--bg-glass);
    color: var(--text-primary);
}
.sidebar-nav a.active {
    background: var(--accent-bg);
    color: var(--accent-hover);
}
.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-glass);
}
.sidebar-footer a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--red);
    font-size: 0.85rem;
    font-weight: 500;
}

/* Main Content Area */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-w);
    padding: 2rem 2.5rem;
}
.page-header {
    margin-bottom: 2rem;
}
.page-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
}
.page-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 4px;
}

/* ── CARDS ── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius);
    padding: 1.5rem;
    backdrop-filter: blur(12px);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

/* Stat Cards Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}
.stat-card {
    padding: 1.25rem 1.5rem;
}
.stat-card .stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}
.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 800;
    margin-top: 0.25rem;
}
.stat-card.green  { border-left: 3px solid var(--green);  }
.stat-card.green .stat-value  { color: var(--green); }
.stat-card.yellow { border-left: 3px solid var(--yellow); }
.stat-card.yellow .stat-value { color: var(--yellow); }
.stat-card.red    { border-left: 3px solid var(--red);    }
.stat-card.red .stat-value    { color: var(--red); }
.stat-card.accent { border-left: 3px solid var(--accent); }
.stat-card.accent .stat-value { color: var(--accent-hover); }

/* ── TABLES ── */
.table-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius);
    overflow: hidden;
    backdrop-filter: blur(12px);
}
table {
    width: 100%;
    border-collapse: collapse;
}
thead {
    background: rgba(255,255,255,0.03);
}
th {
    padding: 0.85rem 1.25rem;
    text-align: left;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-glass);
}
td {
    padding: 0.85rem 1.25rem;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border-glass);
}
tr:last-child td { border-bottom: none; }
tr:hover td {
    background: rgba(255,255,255,0.02);
}

/* ── STATUS BADGES ── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0.3rem 0.75rem;
    border-radius: 50px;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}
.badge-green  { background: var(--green-bg);  color: var(--green);  }
.badge-yellow { background: var(--yellow-bg); color: var(--yellow); }
.badge-red    { background: var(--red-bg);    color: var(--red);    }
.badge-accent { background: var(--accent-bg); color: var(--accent-hover); }
.badge-muted  { background: rgba(100,116,139,0.15); color: var(--text-muted); }

.dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    display: inline-block;
}
.dot-green  { background: var(--green);  box-shadow: 0 0 6px var(--green);  }
.dot-yellow { background: var(--yellow); box-shadow: 0 0 6px var(--yellow); }
.dot-red    { background: var(--red);    box-shadow: 0 0 6px var(--red);    }

/* ── BUTTONS ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.25rem;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-primary {
    background: linear-gradient(135deg, var(--accent), #7c3aed);
    color: #fff;
}
.btn-primary:hover {
    transform: translateY(-1px) scale(1.05);
    background: linear-gradient(135deg, #818cf8, var(--accent));
    box-shadow: 0 4px 20px rgba(99,102,241,0.3);
}
.btn-success {
    background: linear-gradient(135deg, var(--green), #16a34a);
    color: #fff;
}
.btn-success:hover {
    transform: translateY(-1px) scale(1.05);
    background: linear-gradient(135deg, #34d399, var(--green));
    box-shadow: 0 4px 20px rgba(34,197,94,0.3);
}
.btn-danger {
    background: linear-gradient(135deg, var(--red), #dc2626);
    color: #fff;
}
.btn-outline {
    background: transparent;
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
}
.btn-outline:hover {
    background: var(--bg-glass);
    color: var(--text-primary);
    transform: scale(1.05);
}
.btn-sm { padding: 0.4rem 0.85rem; font-size: 0.8rem; }

/* ── FORMS ── */
.form-group {
    margin-bottom: 1.25rem;
}
.form-group label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}
.form-control {
    width: 100%;
    padding: 0.7rem 1rem;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    transition: border-color 0.2s ease;
}
.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-bg);
}
.form-control::placeholder { color: var(--text-muted); }
select.form-control { 
    cursor: pointer; 
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1rem;
}
select.form-control option {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    padding: 10px;
}
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* ── LOGIN PAGE ── */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    background-image:
        radial-gradient(ellipse at 20% 50%, rgba(99,102,241,0.08) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 20%, rgba(124,58,237,0.06) 0%, transparent 50%);
}
.login-card {
    width: 100%;
    max-width: 420px;
    padding: 2.5rem;
    text-align: center;
}
.login-card h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}
.login-card .subtitle {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 2rem;
}
.login-card .form-group { text-align: left; }
.login-card .btn { width: 100%; justify-content: center; padding: 0.85rem; }

/* ── LOCKED PAGE ── */
.locked-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    background-image:
        radial-gradient(ellipse at 50% 50%, rgba(239,68,68,0.06) 0%, transparent 60%);
}
.locked-card {
    width: 100%;
    max-width: 480px;
    padding: 3rem;
    text-align: center;
}
.locked-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}
.locked-card h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--red);
    margin-bottom: 0.5rem;
}
.locked-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}
.payment-box {
    background: rgba(239,68,68,0.06);
    border: 1px solid rgba(239,68,68,0.2);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin: 1.5rem 0;
    text-align: left;
}
.payment-box h3 {
    font-size: 0.85rem;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 1rem;
    letter-spacing: 0.5px;
}
.payment-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    font-size: 0.9rem;
}
.payment-row:last-child { border-bottom: none; }
.payment-row .label { color: var(--text-muted); }
.payment-row .value { font-weight: 600; color: var(--text-primary); }
.payment-amount {
    font-size: 2rem;
    font-weight: 800;
    color: var(--red);
    margin: 0.5rem 0;
}

/* ── ALERT BANNERS ── */
.alert-banner {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.alert-warning {
    background: var(--yellow-bg);
    border: 1px solid rgba(234,179,8,0.25);
    color: var(--yellow);
}
.alert-danger {
    background: var(--red-bg);
    border: 1px solid rgba(239,68,68,0.25);
    color: var(--red);
}
.alert-success {
    background: var(--green-bg);
    border: 1px solid rgba(34,197,94,0.25);
    color: var(--green);
}
.alert-info {
    background: var(--accent-bg);
    border: 1px solid rgba(99,102,241,0.25);
    color: var(--accent-hover);
}

/* ── FLASH MESSAGES ── */
.flash-messages {
    margin-bottom: 1.5rem;
}

/* ── PROGRESS BAR ── */
.progress-bar-wrapper {
    background: rgba(255,255,255,0.05);
    border-radius: 50px;
    height: 10px;
    overflow: hidden;
    margin-top: 0.5rem;
}
.progress-bar-fill {
    height: 100%;
    border-radius: 50px;
    background: linear-gradient(90deg, var(--accent), var(--green));
    transition: width 0.6s ease;
}

/* ── SHARE MESSAGE BOX ── */
.share-box {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius);
    padding: 1.25rem;
    font-size: 0.9rem;
    line-height: 1.7;
    white-space: pre-wrap;
    position: relative;
}
.share-box .copy-hint {
    position: absolute;
    top: 0.5rem; right: 0.75rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ── MODAL ── */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    z-index: 500;
    align-items: center;
    justify-content: center;
}
.modal-overlay.show { display: flex; }
.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius);
    padding: 2rem;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
}
.modal-content h2 {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
}

/* ── PRINT MEDIA ── */
@media print {
    .sidebar, .page-header, .btn, .flash-messages, .modal-overlay, .share-box {
        display: none !important;
    }
    .app-wrapper { display: block; }
    .main-content { margin-left: 0; padding: 0; }
    body { background: white; color: black; }
    .card { 
        border: 1px solid #ddd; 
        box-shadow: none !important; 
        transform: none !important; 
        background: white; 
        color: black;
    }
    .print-only { display: block !important; }
}
.print-only { display: none; }
