* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #3F51B5;
    --primary-dark: #303F9F;
    --accent-color: #E91E63;
    --background: #F5F5F5;
    --card-background: #FFFFFF;
    --text-primary: #212121;
    --text-secondary: #757575;
    --border-color: #E0E0E0;
    --success-color: #4CAF50;
    --error-color: #F44336;
}

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Roboto', sans-serif;
    background: #ffffff;
    color: var(--text-primary);
}

/* Views */
.view {
    display: none;
    min-height: 100vh;
    background-color: var(--background);
}

.view.active {
    display: block;
}

/* App Bar */
.app-bar {
    background-color: var(--primary-color);
    color: white;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    position: sticky;
    top: 0;
    z-index: 100;
}

.app-bar h2 {
    font-size: 20px;
    font-weight: 500;
    flex: 1;
    margin-left: 8px;
}

.app-bar-actions {
    display: flex;
    gap: 4px;
}

/* Icon Buttons */
.icon-btn {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.icon-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.icon-btn .material-symbols-outlined {
    font-size: 24px;
}

/* ===================== LOGIN PAGE - CLEAN & CLEAR ===================== */

#loginView {
    background: #ffffff;
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

/* Soft pastel blobs - very light */
.login-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.bg-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    animation: floatShape 14s ease-in-out infinite;
}

.shape-1 {
    display: none;
}

.shape-2 {
    display: none;
}

.shape-3 {
    display: none;
}

.shape-4 {
    display: none;
}

.shape-5 {
    display: none;
}

.login-bg::before {
    display: none;
}

@keyframes floatShape {

    0%,
    100% {
        transform: translateY(0) scale(1);
    }

    50% {
        transform: translateY(-20px) scale(1.04);
    }
}

/* Login container */
.login-container {
    position: relative;
    z-index: 1;
    max-width: 400px;
    margin: 0 auto;
    padding: 20px 24px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 16px;
}

/* Header */
.login-header {
    text-align: center;
    animation: slideDown 0.6s ease-out both;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Logo */
.login-logo {
    width: 76px;
    height: 76px;
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    box-shadow: 0 6px 24px rgba(63, 81, 181, 0.35);
    transition: transform 0.3s;
    background: linear-gradient(135deg, #3F51B5, #1A237E);
}

.login-logo:hover {
    transform: scale(1.06);
}

.login-logo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 20px;
    filter: brightness(1.1) saturate(0.8);
    mix-blend-mode: luminosity;
}

/* Brand image */
.login-brand-bottom {
    text-align: center;
    margin-top: -2px;
    animation: slideDown 0.6s ease-out 0.1s both;
}

.login-brand-img {
    width: 70%;
    max-width: 240px;
    height: auto;
    border-radius: 10px;
    /* logo_text.png has a transparent background, so it shows true blue on any
       background — no filter/blend tricks needed. */
    transition: transform 0.3s;
}

.login-brand-img:hover {
    transform: scale(1.03);
}

/* Card - solid white */
.login-card {
    background: #ffffff;
    border-radius: 24px;
    padding: 28px 28px 24px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.10), 0 2px 8px rgba(0, 0, 0, 0.06);
    animation: slideUp 0.6s ease-out 0.15s both;
    position: relative;
    overflow: hidden;
}

/* Colourful top accent bar */
.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #3F51B5, #5C6BC0, #1A237E);
    border-radius: 24px 24px 0 0;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-card-title {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a2e;
    background: none;
    -webkit-text-fill-color: #1a1a2e;
    margin-bottom: 4px;
}

.login-card-subtitle {
    font-size: 13px;
    color: #757575;
    margin-bottom: 24px;
}

/* Form */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Input wrapper */
.input-field {
    position: relative;
    display: flex;
    align-items: center;
    background: #f5f5f5;
    border: 1.5px solid #e0e0e0;
    border-radius: 12px;
    padding: 0 14px;
    transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
}

.input-field:focus-within {
    border-color: #3F51B5;
    box-shadow: 0 0 0 3px rgba(63, 81, 181, 0.12);
    background: #fff;
}

.input-icon {
    font-size: 20px;
    color: #9e9e9e;
    pointer-events: none;
    flex-shrink: 0;
    margin-right: 10px;
    transition: color 0.25s;
}

.input-field:focus-within .input-icon {
    color: #3F51B5;
}

.input-field input {
    flex: 1;
    padding: 14px 0;
    background: transparent;
    border: none;
    color: #1a1a2e;
    font-size: 15px;
    font-family: 'Roboto', sans-serif;
    outline: none;
}

.input-field input::placeholder {
    color: #bdbdbd;
}

.input-field input:focus {
    caret-color: #3F51B5;
}

.input-line {
    display: none;
}

/* Password toggle */
.toggle-password {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #9e9e9e;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    transition: color 0.2s;
}

.toggle-password:hover {
    color: #3F51B5;
}

.toggle-password .material-symbols-outlined {
    font-size: 20px;
}

/* Forgot */
.login-options {
    display: flex;
    justify-content: flex-end;
    margin-top: -4px;
}

.forgot-link {
    font-size: 13px;
    color: #757575;
    text-decoration: none;
    transition: color 0.2s;
}

.forgot-link:hover {
    color: #3F51B5;
}

/* Sign In button */
.btn-login {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 15px 24px;
    background: linear-gradient(135deg, #3F51B5, #1A237E);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    font-family: 'Roboto', sans-serif;
    cursor: pointer;
    letter-spacing: 0.5px;
    margin-top: 4px;
    box-shadow: 0 4px 18px rgba(63, 81, 181, 0.30);
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(63, 81, 181, 0.45);
}

.btn-login:active {
    transform: translateY(0);
    box-shadow: 0 3px 10px rgba(63, 81, 181, 0.25);
}

.btn-login .material-symbols-outlined {
    font-size: 20px;
    transition: transform 0.2s;
}

.btn-login:hover .material-symbols-outlined {
    transform: translateX(4px);
}

/* Footer */
.login-footer {
    text-align: center;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid #f0f0f0;
}

.login-footer p {
    font-size: 13px;
    color: #9e9e9e;
}

.login-footer a {
    color: #3F51B5;
    font-weight: 600;
    text-decoration: none;
    transition: opacity 0.2s;
}

.login-footer a:hover {
    opacity: 0.75;
}

/* Legacy input-group styles (used in other forms) */




.input-group {
    margin-bottom: 24px;
}

.input-group label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 12px;
    border: none;
    border-bottom: 2px solid var(--border-color);
    font-size: 16px;
    font-family: 'Roboto', sans-serif;
    background: transparent;
    transition: border-color 0.2s;
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-bottom-color: var(--primary-color);
}

.input-group select {
    cursor: pointer;
}

/* Buttons */
.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.btn-secondary {
    background-color: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-secondary:hover {
    background-color: rgba(63, 81, 181, 0.1);
}

.btn-full {
    width: 100%;
}

.login-links {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.login-links a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 14px;
}

.login-links a:hover {
    text-decoration: underline;
}

/* Content Area */
.content {
    padding: 16px;
    padding-bottom: 140px;
}

/* Search Bar */
.search-bar {
    background: white;
    padding: 8px 16px;
    border-bottom: 1px solid var(--border-color);
}

.search-bar input {
    width: 100%;
    padding: 8px;
    border: none;
    font-size: 16px;
    font-family: 'Roboto', sans-serif;
}

.search-bar input:focus {
    outline: none;
}

/* Class Card */
.class-card {
    background: var(--card-background);
    padding: 16px;
    margin-bottom: 12px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: box-shadow 0.2s;
}

.class-card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.class-card h3 {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.class-card p {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Student Card */
.student-card {
    background: var(--card-background);
    padding: 16px;
    margin-bottom: 12px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: box-shadow 0.2s;
}

.student-card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.student-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.student-info-card {
    flex: 1;
}

.student-info-card h4 {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 4px;
}

.student-info-card p {
    font-size: 14px;
    color: var(--text-secondary);
}

.student-status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.student-status.present {
    background-color: #E3F2FD;
    color: var(--primary-color);
}

.student-status.dues {
    background-color: #FFEBEE;
    color: var(--error-color);
}

.student-status.disabled {
    background-color: #ECEFF1;
    color: #607D8B;
}

/* Disabled (inactive) student: greyed out but still visible/clickable */
.student-card--inactive {
    opacity: 0.55;
    filter: grayscale(0.6);
}

/* FAB (Floating Action Button) */
.fab {
    position: fixed;
    bottom: 90px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: var(--accent-color);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
    z-index: 999;
}

.fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

.fab .material-symbols-outlined {
    font-size: 28px;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--card-background);
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.nav-item {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    transition: color 0.2s;
    flex: 1;
}

.nav-item:hover,
.nav-item.active {
    color: var(--primary-color);
}

.nav-item .material-symbols-outlined {
    font-size: 24px;
}

.nav-item span:last-child {
    font-size: 12px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    /* Must sit above the fixed bottom-nav (1000) and FAB (999); otherwise those
       overlay the lower part of any modal and swallow clicks on its buttons,
       so the panel looks open but its options aren't clickable. */
    z-index: 1100;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--card-background);
    padding: 24px;
    border-radius: 8px;
    max-width: 400px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.modal-content h3 {
    font-size: 20px;
    font-weight: 500;
    margin-bottom: 20px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

/* Settings Menu */
.settings-menu {
    max-width: 320px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.menu-list {
    display: flex;
    flex-direction: column;
}

.menu-item {
    background: none;
    border: none;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: background-color 0.2s;
    border-radius: 4px;
    text-align: left;
}

.menu-item:hover {
    background-color: var(--background);
}

.menu-item .material-symbols-outlined {
    color: var(--text-secondary);
}

.menu-item span:last-child {
    font-size: 16px;
    color: var(--text-primary);
}

/* Student Form */
.student-form {
    max-width: 600px;
    margin: 0 auto;
}

.avatar-placeholder {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background-color: var(--background);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    color: var(--text-secondary);
}

.avatar-placeholder .material-symbols-outlined {
    font-size: 48px;
}

/* Student Detail */
.student-detail-card {
    background: var(--card-background);
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.avatar-large {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.avatar-large .material-symbols-outlined {
    font-size: 64px;
}

.student-detail-card h3 {
    text-align: center;
    font-size: 24px;
    font-weight: 500;
    margin-bottom: 24px;
}

.student-info {
    margin-bottom: 24px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.info-row .label {
    color: var(--text-secondary);
    font-size: 14px;
}

.info-row span:last-child {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
}

/* Fees Section */
.fees-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 2px solid var(--border-color);
}

.fees-section h4 {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 16px;
}

.fees-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.fee-item {
    background: var(--background);
    padding: 16px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.fee-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.fee-value {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
}

.fees-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.fees-actions button {
    flex: 1;
}

/* Test Form */
.test-form {
    max-width: 600px;
    margin: 0 auto;
}

/* Attendance */
.date-picker-section {
    background: var(--card-background);
    padding: 16px;
    margin-bottom: 16px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.date-picker-btn {
    background: none;
    border: none;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-family: 'Roboto', sans-serif;
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px;
    width: 100%;
}

.date-picker-btn:hover {
    background-color: var(--background);
    border-radius: 4px;
}

.attendance-item {
    background: var(--card-background);
    padding: 16px;
    margin-bottom: 12px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.attendance-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
}

.attendance-header h4 {
    flex: 1;
    font-size: 16px;
    font-weight: 500;
}

.send-absent-btn {
    background: none;
    border: none;
    color: var(--error-color);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s, transform 0.15s;
    flex-shrink: 0;
}

.send-absent-btn:hover {
    background-color: rgba(244, 67, 54, 0.1);
    transform: scale(1.15);
}

.send-absent-btn .material-symbols-outlined {
    font-size: 20px;
}

.attendance-buttons {
    display: flex;
    gap: 8px;
}

.attendance-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s;
}

.attendance-btn.present {
    background-color: var(--primary-color);
    color: white;
}

.attendance-btn.absent {
    background-color: var(--error-color);
    color: white;
}

.attendance-btn.leave {
    background-color: #FF9800;
    color: white;
}

.attendance-btn.others {
    background-color: #9E9E9E;
    color: white;
}

.attendance-btn:not(.present):not(.absent):not(.leave):not(.others) {
    background-color: var(--background);
    color: var(--text-primary);
}

.attendance-btn:hover {
    opacity: 0.8;
}

/* Test Card */
.test-card {
    background: var(--card-background);
    padding: 16px;
    margin-bottom: 12px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: box-shadow 0.2s;
}

.test-card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.test-card h4 {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 8px;
}

.test-card p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.subject-tag {
    display: inline-block;
    padding: 4px 12px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

/* Test Detail */
.test-info-card {
    background: var(--card-background);
    padding: 16px;
    margin-bottom: 16px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.test-info-card p {
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.test-result-item {
    background: var(--card-background);
    padding: 16px;
    margin-bottom: 12px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.test-result-item h4 {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.test-result-inputs {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 12px;
    align-items: start;
}

.test-result-inputs input {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
}

.test-result-inputs input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-secondary);
}

.empty-state .material-symbols-outlined {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-state p {
    font-size: 16px;
}

/* Fees View Styles */
.fee-card {
    background: var(--card-background);
    padding: 16px;
    margin-bottom: 12px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: box-shadow 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.fee-card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.fee-card-content {
    flex: 1;
}

.fee-card h4 {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.fee-amount {
    font-size: 14px;
    color: var(--text-secondary);
}

.fee-due-value {
    color: var(--error-color);
    font-weight: 500;
}

.fee-status-badge {
    padding: 6px 16px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

/* Student Fee Detail View */
.fee-detail-form {
    max-width: 600px;
    margin: 0 auto;
}

.fee-payments-section {
    margin: 24px 0;
    padding: 16px;
    background: var(--background);
    border-radius: 8px;
}

.fee-payments-section h4 {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.fee-payment-entry {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 12px;
    padding: 8px;
    background: white;
    border-radius: 4px;
}

.fee-payment-entry input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    font-family: 'Roboto', sans-serif;
}

.fee-payment-entry input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.fee-payment-entry .payment-date {
    flex: 1.2;
}

.fee-payment-entry .payment-amount {
    flex: 1;
}

.btn-remove-payment {
    background: none;
    border: none;
    color: var(--error-color);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.btn-remove-payment:hover {
    background-color: rgba(244, 67, 54, 0.1);
}

.btn-remove-payment .material-symbols-outlined {
    font-size: 20px;
}

.btn-add-payment {
    background: none;
    border: 2px dashed var(--primary-color);
    color: var(--primary-color);
    padding: 12px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 8px auto;
    width: 48px;
    height: 48px;
    transition: background-color 0.2s;
}

.btn-add-payment:hover {
    background-color: rgba(63, 81, 181, 0.05);
}

.btn-add-payment .material-symbols-outlined {
    font-size: 24px;
}

.fee-summary {
    margin: 24px 0;
}

.date-input-wrapper {
    display: flex;
    gap: 12px;
    align-items: center;
}

.date-input-wrapper input[type="date"] {
    flex: 1;
}

.btn-clear-date {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 14px;
    padding: 8px 12px;
    border-radius: 4px;
    transition: background-color 0.2s;
    white-space: nowrap;
}

.btn-clear-date:hover {
    background-color: rgba(63, 81, 181, 0.1);
}

.fee-action-buttons {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.btn-save-fee,
.btn-send-receipt {
    flex: 1;
    padding: 14px 24px;
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
}

#feesDueDisplay {
    background-color: var(--background);
    font-weight: 500;
    color: var(--error-color);
}

/* Responsive */

@media (max-width: 768px) {
    .content {
        /* keep a large bottom padding so the last row clears the fixed bottom nav */
        padding: 12px 12px 140px;
    }

    .fab {
        bottom: 80px;
        right: 16px;
    }
}

/* NOTE: desktop / tablet responsive overrides live at the END of this file so
   they win over later equal-specificity base rules (e.g. the SAAS grids). */

/* ===================== SAAS PLATFORM STYLES ===================== */

/* --- Trial Banner --- */
.trial-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: linear-gradient(90deg, #FF6F00, #FF8F00);
    color: white;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.trial-banner .material-symbols-outlined {
    font-size: 20px;
}

.trial-banner-btn {
    margin-left: auto;
    background: white;
    color: #FF6F00;
    border: none;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s;
}

.trial-banner-btn:hover {
    opacity: 0.85;
}

/* When banner is visible, push views down */
body.has-trial-banner .view.active {
    padding-top: 44px;
}

/* --- Trial Expired Screen --- */
.expired-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 40px 24px;
    text-align: center;
    background: linear-gradient(135deg, #1a1a4e, #3F51B5);
    color: white;
}

.expired-icon {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
}

.expired-icon .material-symbols-outlined {
    font-size: 52px;
    color: white;
}

.expired-container h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 12px;
}

.expired-container p {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.75);
    max-width: 300px;
}

/* --- Section Titles --- */
.section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    margin-top: 8px;
}

.section-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    margin-top: -8px;
}

/* --- Dashboard Status Card --- */
.status-card {
    border-radius: 12px;
    padding: 14px 18px;
    margin-bottom: 16px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-card.trial {
    background: linear-gradient(135deg, #FFF3E0, #FFE0B2);
    color: #E65100;
    border: 1px solid #FFCC80;
}

.status-card.active {
    background: linear-gradient(135deg, #E8F5E9, #C8E6C9);
    color: #2E7D32;
    border: 1px solid #A5D6A7;
}

.status-card.expired {
    background: linear-gradient(135deg, #FFEBEE, #FFCDD2);
    color: #C62828;
    border: 1px solid #EF9A9A;
}

/* --- Stats Grid --- */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.stat-card {
    border-radius: 16px;
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-card .material-symbols-outlined {
    font-size: 32px;
    opacity: 0.9;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
}

.stat-label {
    font-size: 12px;
    opacity: 0.85;
    font-weight: 500;
}

.stat-blue {
    background: linear-gradient(135deg, #1565C0, #1976D2);
}

.stat-green {
    background: linear-gradient(135deg, #2E7D32, #388E3C);
}

.stat-orange {
    background: linear-gradient(135deg, #E65100, #F57C00);
}

.stat-red {
    background: linear-gradient(135deg, #B71C1C, #D32F2F);
}

/* --- Wallet Mini Card (Dashboard) --- */
.wallet-mini-card {
    background: var(--card-background);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.wallet-mini-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    font-size: 14px;
    color: var(--text-primary);
}

.wallet-mini-row .material-symbols-outlined {
    font-size: 20px;
    color: var(--primary-color);
}

.wallet-mini-value {
    margin-left: auto;
    font-weight: 700;
    font-size: 16px;
    color: var(--primary-color);
}

.btn-recharge-mini {
    width: 100%;
    margin-top: 12px;
    padding: 10px;
    background: linear-gradient(135deg, #3F51B5, #5C6BC0);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-recharge-mini:hover {
    opacity: 0.9;
}

/* --- Quick Actions --- */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.quick-action-btn {
    background: var(--card-background);
    border: none;
    border-radius: 12px;
    padding: 16px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 11px;
    font-family: 'Roboto', sans-serif;
    color: var(--text-secondary);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    transition: all 0.2s;
}

.quick-action-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.quick-action-btn .material-symbols-outlined {
    font-size: 26px;
}

/* --- Subscription Plan Cards --- */
.plan-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 8px;
}

.plan-card {
    background: var(--card-background);
    border-radius: 16px;
    padding: 20px 16px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 2px solid transparent;
    position: relative;
    transition: all 0.2s;
}

.plan-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.plan-popular {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, #E8EAF6, #F3F4FF);
}

.plan-best {
    border-color: #E91E63;
    background: linear-gradient(135deg, #FCE4EC, #FFF0F5);
}

.plan-badge {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-color);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 12px;
    border-radius: 20px;
    white-space: nowrap;
}

.plan-best .plan-badge {
    background: #E91E63;
}

.plan-duration {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    margin-top: 8px;
}

.plan-price {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 6px;
}

.plan-best .plan-price {
    color: #E91E63;
}

.plan-desc {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 14px;
}

.btn-subscribe {
    width: 100%;
    padding: 10px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.plan-best .btn-subscribe {
    background: #E91E63;
}

.btn-subscribe:hover {
    opacity: 0.85;
}

.current-plan-banner {
    border-radius: 12px;
    padding: 14px 18px;
    margin-bottom: 16px;
    font-size: 14px;
    font-weight: 500;
    background: linear-gradient(135deg, #E8F5E9, #C8E6C9);
    color: #2E7D32;
    border: 1px solid #A5D6A7;
}

/* --- Add-On Cards --- */
.addon-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.addon-card {
    background: var(--card-background);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.addon-card .material-symbols-outlined {
    font-size: 28px;
    color: var(--primary-color);
}

.addon-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.addon-price {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.btn-addon {
    margin-left: auto;
    padding: 8px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
    white-space: nowrap;
}

.btn-addon:hover {
    opacity: 0.85;
}

/* --- Message Wallet --- */
.wallet-balance-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.wallet-balance-card {
    border-radius: 16px;
    padding: 24px 16px;
    text-align: center;
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.wallet-sms {
    background: linear-gradient(135deg, #1565C0, #1976D2);
}

.wallet-wa {
    background: linear-gradient(135deg, #1B5E20, #25D366);
}

.wallet-balance-card .material-symbols-outlined {
    font-size: 36px;
    margin-bottom: 8px;
}

.wallet-balance-value {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 4px;
}

.wallet-balance-label {
    font-size: 12px;
    opacity: 0.85;
}

.wallet-rate-note {
    text-align: center;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

/* Recharge type toggle */
.recharge-type-toggle {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    background: var(--background);
    border-radius: 10px;
    padding: 4px;
}

.recharge-type-btn {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    background: transparent;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.recharge-type-btn.active {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 2px 8px rgba(63, 81, 181, 0.3);
}

/* Recharge packages */
.recharge-packages {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.recharge-card {
    background: var(--card-background);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    border: 2px solid transparent;
    position: relative;
    transition: all 0.2s;
}

.recharge-card:hover {
    border-color: var(--primary-color);
}

.recharge-popular {
    border-color: #E91E63;
}

.recharge-badge {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: #E91E63;
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 20px;
}

.recharge-messages {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    margin-top: 6px;
}

.recharge-amount {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 12px;
}

.btn-recharge-pkg {
    width: 100%;
    padding: 8px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-recharge-pkg:hover {
    opacity: 0.85;
}

/* Transaction history */
.transaction-item {
    background: var(--card-background);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.transaction-item .tx-label {
    font-size: 14px;
    color: var(--text-primary);
}

.transaction-item .tx-date {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.transaction-item .tx-amount {
    font-size: 15px;
    font-weight: 700;
    color: var(--primary-color);
}

/* --- Reports --- */
.report-class-card {
    background: var(--card-background);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.report-class-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.report-bar-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.report-bar-label {
    font-size: 12px;
    color: var(--text-secondary);
    width: 60px;
    flex-shrink: 0;
}

.report-bar-track {
    flex: 1;
    height: 8px;
    background: var(--background);
    border-radius: 4px;
    overflow: hidden;
}

.report-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s ease;
}

.report-bar-fill.present {
    background: #4CAF50;
}

.report-bar-fill.absent {
    background: #F44336;
}

.report-bar-fill.leave {
    background: #FF9800;
}

.report-bar-pct {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    width: 36px;
    text-align: right;
}

.fee-report-card {
    background: var(--card-background);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Fees collection summary banner (top of the Fees list) */
.fees-collection-summary {
    background: var(--card-background);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    display: flex;
    justify-content: space-between;
    text-align: center;
}

.fees-collection-summary .fcs-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.fees-collection-summary .fcs-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.fees-collection-summary .fcs-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.fees-collection-summary .fcs-collected {
    color: #4caf50;
}

.fees-collection-summary .fcs-due {
    color: #e53935;
}

.fee-report-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.fee-report-sub {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.fee-report-due {
    font-size: 18px;
    font-weight: 700;
    color: var(--error-color);
}

/* --- Notifications --- */
.notif-balance-row {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--card-background);
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    flex-wrap: wrap;
}

.notif-balance-row .material-symbols-outlined {
    font-size: 20px;
    color: var(--primary-color);
}

.notif-count-row {
    background: #E8EAF6;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    color: var(--primary-color);
    font-weight: 500;
}

.notif-history-item {
    background: var(--card-background);
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 10px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.notif-history-item .nh-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
}

.notif-history-item .nh-class {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-color);
}

.notif-history-item .nh-date {
    font-size: 12px;
    color: var(--text-secondary);
}

.notif-history-item .nh-msg {
    font-size: 14px;
    color: var(--text-primary);
}

.notif-history-item .nh-meta {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ─── Register View - compact layout ─── */
#registerView .login-container {
    justify-content: flex-start;
    padding-top: 24px;
    gap: 8px;
    overflow-y: auto;
}

#registerView .login-brand-top {
    width: 80px;
    height: 80px;
    margin: 0 auto;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

#registerView .login-brand-top .login-logo-img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 18px;
}

#registerView .login-brand-bottom {
    margin-top: 0;
}

#registerView .login-brand-img {
    max-width: 160px;
}

#registerView .login-card {
    padding: 20px 24px 16px;
}

#registerView .login-card-subtitle {
    margin-bottom: 16px;
}

#registerView .input-field {
    margin-bottom: 4px;
}

#registerView .login-form .input-field input {
    padding: 10px 12px 10px 40px;
    font-size: 14px;
}

#registerView .btn-login {
    margin-top: 8px;
    padding: 12px;
}

/* App dialog (alert/confirm/prompt replacement) */
.app-dialog {
    max-width: 380px;
}

#appDialogMessage {
    white-space: pre-wrap;
    font-size: 15px;
    line-height: 1.45;
    color: var(--text-primary);
}

.app-dialog-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Roboto', sans-serif;
    margin-top: 14px;
}

.app-dialog-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Template picker preview box */
.tpl-preview {
    background: var(--background);
    border-radius: 8px;
    padding: 12px;
    font-size: 14px;
    line-height: 1.45;
    white-space: pre-wrap;
    color: var(--text-primary);
    min-height: 48px;
    border: 1px solid var(--border-color);
}

#tplPickerType {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Roboto', sans-serif;
    background: #fff;
}

/* ===================== DESKTOP & TABLET (>= 769px) =====================
   Placed last so these overrides beat later equal-specificity base rules. */
@media (min-width: 769px) {

    /* Fill the whole window with the app background so the UI no longer
       looks like a narrow box floating on a white page */
    body {
        background: var(--background);
    }

    /* App bar spans the full width; its content aligns to a centred column */
    .app-bar {
        padding-left: max(24px, calc((100% - 1200px) / 2));
        padding-right: max(24px, calc((100% - 1200px) / 2));
    }

    /* Main content sits in a centred column with comfortable gutters
       (top/bottom padding kept from the base .content rule) */
    .content {
        padding-left: max(24px, calc((100% - 1200px) / 2));
        padding-right: max(24px, calc((100% - 1200px) / 2));
    }

    /* Card lists flow into responsive multi-column grids. Non-card children
       (section headers, date pickers, empty states) span the full row so the
       reused #studentsList tabs keep laying out correctly. */
    #classesList,
    #studentsList,
    #testsList,
    #feesList {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 16px;
        align-content: start;
    }

    #classesList>*,
    #studentsList>*,
    #testsList>*,
    #feesList>* {
        grid-column: 1 / -1;
    }

    #classesList>.class-card,
    #studentsList>.student-card,
    #studentsList>.test-card,
    #studentsList>.fee-card,
    #testsList>.test-card,
    #feesList>.fee-card {
        grid-column: auto;
        margin-bottom: 0;
    }

    /* Inner dashboard / subscription / wallet grids use the extra width */
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }

    .quick-actions {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }

    .plan-cards,
    .recharge-packages {
        grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    }

    /* Detail / info cards stay readable instead of stretching across the page */
    .student-detail-card,
    .test-info-card {
        max-width: 760px;
        margin-left: auto;
        margin-right: auto;
    }

    /* Bottom nav: full-width bar with its items clustered in the centre */
    .bottom-nav {
        justify-content: center;
        gap: 12px;
    }

    .nav-item {
        flex: 0 0 auto;
        min-width: 130px;
        border-radius: 8px;
    }

    .nav-item:hover {
        background-color: rgba(63, 81, 181, 0.06);
    }

    /* Floating action button hugs the bottom-right of the centred column */
    .fab {
        right: max(24px, calc((100% - 1200px) / 2 + 24px));
    }
}