/* Maldives School Management System - Styles */

/* Root Variables */
:root {
    --primary-green: #1a5f3a;
    --primary-green-dark: #0f3d24;
    --primary-green-light: #2d8659;
    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;
    --info: #17a2b8;
    --light: #f8f9fa;
    --dark: #343a40;
    --white: #ffffff;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --sidebar-width: 260px;
    --header-height: 70px;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--gray-800);
    background: var(--gray-100);
}

/* Dhivehi Text */
.text-dhivehi,
.dhivehi {
    font-family: 'MV Waheed', 'Noto Sans Thaana', Arial, sans-serif;
    direction: rtl;
    font-size: 1.1em;
}

/* System Settings Styles */
.settings-container {
    max-width: 1200px;
    margin: 0 auto;
}

.settings-card {
    background: var(--white);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 24px;
    overflow: hidden;
}

.settings-card .card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-200);
}

.settings-card .card-header h2 {
    margin: 0 0 8px 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--primary-green);
}

.settings-card .card-description {
    margin: 0;
    color: var(--gray-600);
    font-size: 14px;
}

.settings-card .card-body {
    padding: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--gray-700);
}

.form-group .required {
    color: var(--danger);
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.15s ease-in-out;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(26, 95, 58, 0.1);
}

.form-control-file {
    display: block;
    width: 100%;
    padding: 8px 0;
}

.form-text {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--gray-600);
}

.form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

.col-md-4 {
    flex: 0 0 33.333%;
}

.col-md-8 {
    flex: 0 0 66.666%;
}

.form-divider {
    height: 1px;
    background: var(--gray-200);
    margin: 24px 0;
}

.form-actions {
    margin-top: 24px;
    display: flex;
    gap: 12px;
    align-items: center;
}

.preview-section {
    margin-top: 24px;
    padding: 20px;
    background: var(--gray-100);
    border-radius: 6px;
}

.preview-section h3 {
    margin: 0 0 16px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-700);
}

.preview-boxes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.preview-box {
    background: var(--white);
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    padding: 16px;
}

.preview-box h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.preview-login {
    text-align: center;
    padding: 20px;
}

.preview-logo-placeholder {
    font-size: 48px;
    margin-bottom: 12px;
}

.preview-system-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-green);
}

.preview-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--primary-green);
    border-radius: 4px;
}

.preview-header-logo {
    font-size: 24px;
}

.preview-header-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--white);
}

.current-logo-section {
    margin-bottom: 24px;
}

.current-logo-section h3 {
    margin: 0 0 12px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-700);
}

.logo-preview-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px;
    background: var(--gray-100);
    border-radius: 6px;
    border: 2px dashed var(--gray-300);
}

.current-logo {
    max-width: 200px;
    max-height: 200px;
    object-fit: contain;
}

.preview-logo-img {
    max-width: 120px;
    max-height: 120px;
    object-fit: contain;
    margin: 0 auto;
    display: block;
}

.preview-logo-img-small {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.password-input-wrapper {
    position: relative;
}

.btn-toggle-password {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 16px;
}

.btn-toggle-password:hover {
    opacity: 0.7;
}

.info-box {
    padding: 12px 16px;
    background: #e7f3ff;
    border-left: 4px solid var(--info);
    border-radius: 4px;
    margin: 16px 0;
    font-size: 14px;
}

.info-card {
    background: #f8f9fa;
    border: 1px solid var(--gray-300);
}

.smtp-providers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.provider-box {
    background: var(--white);
    padding: 16px;
    border-radius: 6px;
    border: 1px solid var(--gray-300);
}

.provider-box h4 {
    margin: 0 0 12px 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--primary-green);
}

.provider-box ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.provider-box ul li {
    padding: 4px 0;
    font-size: 13px;
    color: var(--gray-700);
}

.provider-box ul li strong {
    color: var(--gray-800);
}

.alert {
    padding: 12px 16px;
    margin-bottom: 20px;
    border-radius: 4px;
    font-size: 14px;
}

.alert-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.alert-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary-green);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-green-dark);
}

.btn-secondary {
    background: var(--gray-600);
    color: var(--white);
}

.btn-secondary:hover {
    background: var(--gray-700);
}

.btn-success {
    background: var(--success);
    color: var(--white);
}

.btn-success:hover {
    background: #218838;
}

.icon {
    font-style: normal;
}

@media (max-width: 768px) {
    .settings-container {
        padding: 0;
    }

    .settings-card {
        border-radius: 0;
        margin-bottom: 16px;
    }

    .settings-card .card-body {
        padding: 16px;
    }

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

    .form-row .form-group {
        margin-bottom: 20px;
    }

    .preview-boxes {
        grid-template-columns: 1fr;
    }

    .smtp-providers-grid {
        grid-template-columns: 1fr;
    }

    .form-actions {
        flex-direction: column;
        width: 100%;
    }

    .form-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Login Page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--primary-green-light) 100%);
}

.login-container {
    width: 100%;
    max-width: 450px;
    padding: 20px;
}

.login-card {
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    padding: 40px;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.school-logo {
    font-size: 64px;
    margin-bottom: 15px;
}

.login-header h1 {
    font-size: 24px;
    color: var(--primary-green);
    margin-bottom: 5px;
}

.login-header p.dhivehi {
    color: var(--gray-600);
    font-size: 16px;
}

.login-form {
    margin-top: 20px;
}

.login-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--gray-300);
    font-size: 12px;
    color: var(--gray-600);
}

/* App Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--primary-green);
    color: var(--white);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    z-index: 1000;
}

.sidebar-header {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.school-logo-small {
    font-size: 32px;
}

.sidebar-header h2 {
    font-size: 18px;
    font-weight: 600;
}


.sidebar-nav {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav > ul > li {
    margin-bottom: 5px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}

.sidebar-nav a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
}

.sidebar-nav a.active {
    background: rgba(255, 255, 255, 0.15);
    color: var(--white);
    border-left: 3px solid var(--white);
}

.sidebar-nav .icon {
    font-size: 18px;
}

.nav-section {
    margin-bottom: 5px;
}

.nav-section-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s, color 0.2s;
}

.nav-section-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
}

.nav-section-toggle.active {
    background: rgba(255, 255, 255, 0.12);
    color: var(--white);
}

.toggle-icon {
    font-size: 12px;
    margin-left: auto;
    transition: transform 0.2s ease;
}

.nav-submenu {
    list-style: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background: rgba(0, 0, 0, 0.15);
}

.nav-submenu.open {
    max-height: 500px;
    transition: max-height 0.4s ease-in;
}

.nav-submenu li {
    margin-bottom: 0;
}

.nav-submenu a {
    padding: 10px 20px 10px 50px;
    font-size: 14px;
}

.nav-submenu a .icon {
    font-size: 16px;
}

.nav-submenu a:hover {
    background: rgba(255, 255, 255, 0.15);
}

.nav-submenu a.active {
    background: rgba(255, 255, 255, 0.2);
    border-left: 3px solid var(--white);
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    transition: background 0.2s;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.top-header {
    height: var(--header-height);
    background: var(--white);
    border-bottom: 1px solid var(--gray-300);
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left h1 {
    font-size: 24px;
    color: var(--primary-green);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.language-selector {
    position: relative;
}

.language-selector .language-toggle {
    padding: 8px 12px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    background: var(--white);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-700);
    transition: all 0.2s ease;
    min-width: 140px;
}

.language-selector .language-toggle:hover {
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(26, 95, 58, 0.1);
}

.language-selector .language-toggle:focus {
    outline: none;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(26, 95, 58, 0.1);
}

.header-user-profile {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 8px 16px;
    background: var(--gray-100);
    border-radius: 8px;
    border: 1px solid var(--gray-300);
}

.header-user-profile .user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-green);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
}

.header-user-profile .user-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.header-user-profile .user-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.2;
}

.header-user-profile .user-role {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.2;
}

.btn-logout {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--danger);
    color: var(--white);
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s ease;
}

.btn-logout:hover {
    background: #c82333;
    color: var(--white);
}

.btn-logout .icon {
    font-size: 16px;
}

.content-area {
    flex: 1;
    padding: 30px;
}

/* Dashboard Grid */
.dashboard-grid {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.stat-card {
    background: var(--white);
    border-radius: 12px;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #2563eb !important;
}

.stat-icon svg {
    color: var(--white);
    stroke: var(--white);
}

.stat-primary .stat-icon {
    background: #2563eb !important;
}

.stat-success .stat-icon {
    background: #2563eb !important;
}

.stat-warning .stat-icon {
    background: #2563eb !important;
}

.stat-danger .stat-icon {
    background: #2563eb !important;
}

.stat-info .stat-icon {
    background: #2563eb !important;
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 32px;
    font-weight: bold;
    color: var(--gray-800);
    line-height: 1;
}

.stat-label {
    font-size: 14px;
    color: var(--gray-600);
    margin-top: 5px;
}

.dashboard-content {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 30px;
}

.dashboard-content.full-width {
    grid-template-columns: 1fr;
}

.dashboard-main {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.dashboard-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Cards */
.card {
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.card-header {
    padding: 20px 25px;
    border-bottom: 1px solid var(--gray-200);
    background: var(--gray-50);
}

.card-header h3 {
    font-size: 18px;
    color: var(--primary-green);
    font-weight: 600;
}

.card-body {
    padding: 25px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--gray-700);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 500;
    color: var(--gray-700);
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.help-text {
    font-size: 12px;
    color: var(--gray-600);
    margin-top: 6px;
    margin-left: 28px;
}

.teachers-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form-control,
.form-control-sm {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control-sm {
    padding: 6px 10px;
    font-size: 13px;
}

.form-control:focus,
.form-control-sm:focus {
    outline: none;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(26, 95, 58, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.form-inline {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    transition: background 0.2s, transform 0.1s;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--primary-green);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-green-dark);
}

.btn-success {
    background: var(--success);
    color: var(--white);
}

.btn-warning {
    background: var(--warning);
    color: var(--gray-800);
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

.btn-info {
    background: var(--info);
    color: var(--white);
}

.btn-secondary {
    background: var(--gray-500);
    color: var(--white);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-block {
    width: 100%;
    margin-bottom: 10px;
}

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: var(--gray-100);
}

.data-table th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: var(--gray-700);
    border-bottom: 2px solid var(--gray-300);
}

.data-table td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--gray-200);
}

.data-table tbody tr:hover {
    background: var(--gray-50);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success {
    background: rgba(40, 167, 69, 0.15);
    color: var(--success);
}

.badge-danger {
    background: rgba(220, 53, 69, 0.15);
    color: var(--danger);
}

.badge-warning {
    background: rgba(255, 193, 7, 0.15);
    color: #856404;
}

.badge-info {
    background: rgba(23, 162, 184, 0.15);
    color: var(--info);
}

.badge-primary {
    background: rgba(26, 95, 58, 0.15);
    color: var(--primary-green);
}

.badge-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}

.badge-present {
    background: rgba(40, 167, 69, 0.15);
    color: var(--success);
}

.badge-absent {
    background: rgba(220, 53, 69, 0.15);
    color: var(--danger);
}

.badge-late {
    background: rgba(255, 193, 7, 0.15);
    color: #856404;
}

.badge-excused {
    background: rgba(23, 162, 184, 0.15);
    color: var(--info);
}

/* Grade Badges */
.badge-grade-A {
    background: rgba(40, 167, 69, 0.15);
    color: var(--success);
}

.badge-grade-B {
    background: rgba(23, 162, 184, 0.15);
    color: var(--info);
}

.badge-grade-C {
    background: rgba(255, 193, 7, 0.15);
    color: #856404;
}

.badge-grade-D,
.badge-grade-E,
.badge-grade-F {
    background: rgba(220, 53, 69, 0.15);
    color: var(--danger);
}

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.alert-success {
    background: rgba(40, 167, 69, 0.1);
    color: var(--success);
    border-left: 4px solid var(--success);
}

.alert-error,
.alert-danger {
    background: rgba(220, 53, 69, 0.1);
    color: var(--danger);
    border-left: 4px solid var(--danger);
}

.alert-warning {
    background: rgba(255, 193, 7, 0.1);
    color: #856404;
    border-left: 4px solid var(--warning);
}

.alert-info {
    background: rgba(23, 162, 184, 0.1);
    color: var(--info);
    border-left: 4px solid var(--info);
}

/* Schedule List */
.schedule-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.schedule-item {
    display: flex;
    gap: 20px;
    padding: 15px;
    background: var(--gray-50);
    border-radius: 8px;
    border-left: 4px solid var(--primary-green);
}

.schedule-badge {
    background: var(--primary-green);
    color: var(--white);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    align-self: flex-start;
}

.schedule-time {
    font-weight: 600;
    color: var(--primary-green);
    min-width: 120px;
}

.schedule-details {
    flex: 1;
}

.schedule-subject {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 4px;
}

.schedule-class,
.schedule-teacher,
.schedule-room {
    font-size: 13px;
    color: var(--gray-600);
}

.schedule-actions {
    display: flex;
    align-items: center;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    overflow-y: auto;
    padding: 20px;
}

.modal-content {
    background: var(--white);
    max-width: 700px;
    margin: 50px auto;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 20px;
    color: var(--primary-green);
}

.close {
    font-size: 28px;
    color: var(--gray-600);
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    color: var(--gray-800);
}

.modal-body {
    padding: 25px;
}

.modal-footer {
    padding: 20px 25px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.page-header h2 {
    font-size: 28px;
    color: var(--primary-green);
}

/* Children Grid */
.children-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.child-card {
    background: var(--gray-50);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--gray-200);
}

.child-header {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--gray-200);
}

.child-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary-green);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
}

.child-info h4 {
    font-size: 18px;
    color: var(--primary-green);
    margin-bottom: 5px;
}

.child-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.child-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.child-actions {
    display: flex;
    gap: 10px;
}

/* Student Profile */
.student-profile {
    text-align: center;
}

.student-avatar-large {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--primary-green);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    font-weight: bold;
    margin: 0 auto 15px;
}

/* Quick Actions */
.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px;
    background: var(--gray-50);
    border-radius: 8px;
    text-decoration: none;
    color: var(--gray-800);
    transition: background 0.2s, transform 0.1s;
}

.quick-action-btn:hover {
    background: var(--gray-200);
    transform: translateY(-2px);
}

.quick-action-btn .icon {
    font-size: 32px;
}

/* Status Items */
.status-item {
    padding: 12px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.status-success {
    background: rgba(40, 167, 69, 0.1);
    color: var(--success);
}

.status-warning {
    background: rgba(255, 193, 7, 0.1);
    color: #856404;
}

/* Overview Items */
.overview-item {
    padding: 15px 0;
    border-bottom: 1px solid var(--gray-200);
}

.overview-item:last-child {
    border-bottom: none;
}

.overview-label {
    font-size: 13px;
    color: var(--gray-600);
    margin-bottom: 5px;
}

.overview-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-800);
}

/* Task Items */
.task-item {
    padding: 12px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.task-warning {
    background: rgba(255, 193, 7, 0.1);
}

.task-info {
    background: rgba(23, 162, 184, 0.1);
}

/* Utilities */
.text-muted {
    color: var(--gray-600);
}

.mt-3 {
    margin-top: 20px;
}

.mr-2 {
    margin-right: 10px;
}

.mr-3 {
    margin-right: 15px;
}

/* Responsive */
@media (max-width: 992px) {
    .dashboard-content {
        grid-template-columns: 1fr;
    }

    .stats-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        position: relative;
        height: auto;
    }

    .main-content {
        margin-left: 0;
    }

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

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

    .children-grid {
        grid-template-columns: 1fr;
    }
}

/* Classes Page Styles */
.page-header {
    background: var(--white);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.page-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.page-header h2 {
    font-size: 24px;
    color: var(--primary-green);
    margin-bottom: 4px;
}

.text-muted {
    color: var(--gray-600);
    font-size: 14px;
}

.classes-page {
    margin: -30px;
    padding: 30px;
}


.class-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-green);
}

.class-card-header {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--primary-green-light) 100%);
    color: var(--white);
    padding: 20px 16px;
    text-align: center;
}

.class-info {
    width: 100%;
}


.class-stats {
    display: flex;
    justify-content: space-around;
    gap: 12px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.stat-icon {
    font-size: 24px;
    opacity: 0.9;
}

.stat-value {
    font-size: 14px;
    font-weight: 600;
    opacity: 0.95;
}

.class-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    gap: 8px;
    background: var(--gray-50);
    border-top: 1px solid var(--gray-200);
}

.tile-action-btn {
    background: transparent;
    border: none;
    padding: 10px;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.2s ease, color 0.2s ease;
    color: var(--gray-600);
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-width: 0;
}

.tile-action-btn:hover {
    background: var(--primary-green);
    color: var(--white);
}

.tile-action-btn .icon {
    font-size: 20px;
    display: block;
}

.class-card-body {
    padding: 16px;
}

.subjects-section {
    margin-top: 0;
}

.teachers-section {
    margin-top: 0;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--gray-200);
}

.subjects-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--gray-200);
}

.subjects-header h4 {
    font-size: 16px;
    color: var(--primary-green);
    font-weight: 600;
}

.subjects-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.no-subjects {
    text-align: center;
    color: var(--gray-500);
    padding: 20px;
    font-style: italic;
}

.subject-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--gray-100);
    border-radius: 8px;
    border-left: 3px solid var(--primary-green);
}

.subject-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.subject-name {
    font-weight: 600;
    color: var(--gray-800);
    font-size: 14px;
}

.subject-code {
    font-size: 12px;
    color: var(--gray-600);
    background: var(--white);
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
    width: fit-content;
}

.subject-teacher {
    font-size: 13px;
    color: var(--gray-600);
}

.subject-actions {
    display: flex;
    gap: 6px;
}

.btn-icon-sm {
    background: var(--white);
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-icon-sm:hover {
    background: var(--gray-200);
    border-color: var(--gray-400);
}

.btn-icon-sm .icon {
    font-size: 14px;
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    background: var(--white);
    border-radius: 12px;
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 20px;
    color: var(--gray-700);
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--gray-600);
    margin-bottom: 24px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 6px;
}

.btn-success {
    background: var(--success);
    color: var(--white);
    border: none;
}

.btn-success:hover {
    background: #218838;
}

.required {
    color: var(--danger);
}

.modal.show {
    display: block;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-200);
}

.modal-header h3 {
    font-size: 20px;
    color: var(--primary-green);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--gray-600);
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: var(--gray-800);
}

.modal-content form {
    padding: 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 20px;
    border-top: 1px solid var(--gray-200);
    margin-top: 20px;
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    background: var(--white);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 3000;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
    max-width: 400px;
}

.notification.show {
    opacity: 1;
    transform: translateY(0);
}

.notification-success {
    border-left: 4px solid var(--success);
    color: var(--success);
}

.notification-error {
    border-left: 4px solid var(--danger);
    color: var(--danger);
}

.notification-warning {
    border-left: 4px solid var(--warning);
    color: #856404;
}

.notification-info {
    border-left: 4px solid var(--info);
    color: var(--info);
}

@media (min-width: 1600px) {
    .classes-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

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

@media (max-width: 767px) {
    .classes-grid {
        grid-template-columns: 1fr !important;
    }

    .page-header-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .class-title {
        font-size: 16px;
    }

    .stat-icon {
        font-size: 20px;
    }

    .stat-value {
        font-size: 12px;
    }

    .class-card-footer {
        padding: 8px;
    }

    .tile-action-btn {
        padding: 8px;
    }

    .tile-action-btn .icon {
        font-size: 18px;
    }
}

@media (max-width: 599px) {
    .classes-grid {
        grid-template-columns: 1fr;
    }

    .subjects-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .subject-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .subject-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

/* Staff Management Styles */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 30px;
    gap: 20px;
}

.page-header h2 {
    font-size: 28px;
    margin: 0 0 8px 0;
    color: var(--primary-green);
}

.header-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.action-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn-icon {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 6px;
    border-radius: 4px;
    transition: background 0.2s;
}

.btn-icon:hover {
    background: var(--gray-200);
}

.btn-icon.btn-danger:hover {
    background: rgba(220, 53, 69, 0.1);
}

.text-muted {
    color: var(--text-secondary);
    font-size: 14px;
}

.alert {
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.alert-success {
    background: rgba(40, 167, 69, 0.1);
    border: 1px solid rgba(40, 167, 69, 0.3);
    color: var(--success);
}

.alert-danger {
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.3);
    color: var(--danger);
}

/* View Student Modal - Plaintext styles */
.form-control-plaintext {
    padding: 8px 12px;
    background: var(--gray-100);
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    min-height: 38px;
    display: block;
    width: 100%;
    color: var(--gray-800);
    font-weight: 500;
}

.form-control-plaintext.text-dhivehi {
    text-align: right;
}

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

    .header-actions {
        width: 100%;
    }

    .header-actions .btn {
        flex: 1;
    }
}

/* ===========================
   CLASSES PAGE - TILE GRID
   =========================== */

.classes-page {
    padding: 30px;
    margin: -30px;
    --class-blue: #2563eb;
    --class-blue-dark: #1d4ed8;
    --class-blue-soft: #eff6ff;
    --class-border: #dbe5f0;
    --class-text: #1f2937;
    --class-muted: #6b7280;
    --class-bg: #f8fbff;
}

.class-page-header-card {
    background: #ffffff;
    border: 1px solid var(--class-border);
    border-radius: 16px;
    padding: 24px 28px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
    margin-bottom: 24px;
}

.class-page-header-card .page-header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.class-page-header-card h2 {
    margin: 0 0 6px;
    font-size: 22px;
    font-weight: 700;
    color: var(--primary-green);
}

.class-page-header-card .text-muted {
    margin: 0;
    color: var(--class-muted);
    font-size: 14px;
}

.classes-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    align-items: start;
}

.class-grid-item {
    min-width: 0;
}

.class-card {
    background: #ffffff;
    border: 1px solid var(--class-border);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(37, 99, 235, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.class-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 40px rgba(37, 99, 235, 0.12);
    border-color: #bfd4ff;
}

.class-card-header {
    padding: 22px 20px 14px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    border-bottom: 1px solid #edf2f7;
}

.class-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 10px;
    background: #eef2f7;
    color: #334155;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    margin-bottom: 14px;
}

.class-title {
    margin: 0;
    font-size: 24px;
    line-height: 1.2;
    font-weight: 700;
    color: var(--class-text);
}

.class-subtitle {
    margin: 8px 0 0;
    color: var(--class-muted);
    font-size: 14px;
}

.class-card-body {
    padding: 18px 20px 20px;
}

.class-stats {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.class-stats .stat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border: 1px solid #edf2f7;
    border-radius: 14px;
    background: #ffffff;
}

.stat-icon-circle {
    width: 46px;
    height: 46px;
    min-width: 46px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--class-blue);
    color: #ffffff;
    font-size: 20px;
    box-shadow: 0 8px 16px rgba(37, 99, 235, 0.18);
}

.stat-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.class-stats .stat-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--class-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.class-stats .stat-value {
    font-size: 22px;
    font-weight: 800;
    line-height: 1.2;
    color: var(--class-text);
}

.class-card-footer {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    padding: 16px 20px 20px;
    border-top: 1px solid #edf2f7;
    background: #fbfdff;
}

.tile-action-btn {
    border: 1px solid #dbe5f0;
    background: #ffffff;
    color: #334155;
    border-radius: 12px;
    padding: 10px 8px;
    min-height: 52px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: all 0.2s ease;
    font-size: 12px;
    font-weight: 600;
}

.tile-action-btn .icon {
    font-size: 16px;
    line-height: 1;
}

.tile-action-btn:hover {
    background: var(--class-blue);
    border-color: var(--class-blue);
    color: #ffffff;
}

.tile-action-btn.danger:hover {
    background: #dc2626;
    border-color: #dc2626;
    color: #ffffff;
}

.class-details-panel {
    display: none;
    margin-top: 14px;
}

.class-details-panel.show {
    display: block;
}

.details-card {
    background: #ffffff;
    border: 1px solid var(--class-border);
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.teachers-section,
.subjects-section {
    margin: 0;
}

.teachers-section {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #edf2f7;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.section-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--class-text);
}

.subjects-list,
.teachers-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.subject-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    border: 1px solid #e7eef7;
    border-radius: 14px;
    background: #fafcff;
}

.subject-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.subject-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--class-text);
}

.subject-code {
    display: inline-flex;
    width: fit-content;
    padding: 4px 8px;
    border-radius: 8px;
    background: #eef2ff;
    color: #4338ca;
    font-size: 11px;
    font-weight: 700;
}

.subject-teacher {
    font-size: 13px;
    color: var(--class-muted);
}

.item-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.subject-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-icon-sm {
    width: 36px;
    height: 36px;
    border: 1px solid #dbe5f0;
    background: #ffffff;
    border-radius: 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-icon-sm:hover {
    background: var(--class-blue);
    border-color: var(--class-blue);
    color: #ffffff;
}

.btn-icon-sm.danger:hover {
    background: #dc2626;
    border-color: #dc2626;
    color: #ffffff;
}

.empty-message {
    margin: 0;
    padding: 18px;
    text-align: center;
    color: var(--class-muted);
    border: 1px dashed #dbe5f0;
    border-radius: 12px;
    background: #fbfdff;
}

.empty-state {
    background: #ffffff;
    border: 1px solid var(--class-border);
    border-radius: 18px;
    padding: 50px 20px;
    text-align: center;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.empty-state-icon {
    font-size: 54px;
    margin-bottom: 10px;
}

.empty-state h3 {
    margin: 0 0 6px;
    color: var(--class-text);
    font-size: 22px;
}

.empty-state p {
    margin: 0 0 20px;
    color: var(--class-muted);
}

.modal-large {
    max-width: 950px;
}

.modal-help-text {
    margin-left: 0;
    margin-bottom: 16px;
    display: block;
}

.students-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 18px;
    margin-top: 20px;
}

.student-card {
    border: 1px solid #dbe5f0;
    border-radius: 14px;
    padding: 16px;
    background: #fbfdff;
}

.student-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e7eef7;
}

.student-subjects {
    margin-top: 10px;
}

.student-subject-title {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.subject-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.subject-checkboxes .checkbox-label {
    margin: 0;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: #ffffff;
    transition: all 0.2s ease;
}

.subject-checkboxes .checkbox-label:hover {
    border-color: #dbe5f0;
    background: #f8fbff;
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 3000;
    min-width: 260px;
    max-width: 420px;
    padding: 14px 18px;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.14);
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.25s ease;
}

.notification.show {
    opacity: 1;
    transform: translateY(0);
}

.notification-success {
    border-left: 4px solid #16a34a;
    color: #166534;
}

.notification-error {
    border-left: 4px solid #dc2626;
    color: #991b1b;
}

.notification-warning {
    border-left: 4px solid #d97706;
    color: #92400e;
}

.notification-info {
    border-left: 4px solid var(--class-blue);
    color: var(--class-blue-dark);
}

/* buttons inside this page */
.classes-page .btn {
    border-radius: 12px;
}

.classes-page .btn-primary {
    background: var(--primary-green);
    color: #ffffff;
}

.classes-page .btn-primary:hover {
    background: var(--primary-green-dark);
}

.classes-page .btn-success {
    background: var(--class-blue);
    color: #ffffff;
    border: none;
}

.classes-page .btn-success:hover {
    background: var(--class-blue-dark);
}

.classes-page .btn-sm {
    padding: 8px 12px;
    font-size: 12px;
}

/* responsive */
@media (max-width: 1399px) {
    .classes-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 1199px) {
    .classes-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .classes-page {
        padding: 20px;
        margin: -20px;
    }

    .class-page-header-card .page-header-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .classes-grid {
        grid-template-columns: 1fr;
    }

    .class-card-footer {
        grid-template-columns: repeat(2, 1fr);
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .subject-item {
        flex-direction: column;
        align-items: stretch;
    }

    .subject-actions {
        justify-content: flex-end;
    }
}

@media (max-width: 480px) {
    .class-card-footer {
        grid-template-columns: 1fr 1fr;
    }

    .tile-action-btn {
        min-height: 48px;
        font-size: 11px;
    }

    .class-title {
        font-size: 20px;
    }
}

.classes-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(280px, 1fr));
    gap: 24px;
    align-items: start;
}

.class-grid-item {
    width: 100%;
    min-width: 0;
}

.class-card {
    width: 100%;
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
    border: 1px solid #dbe5e4;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.class-card-header {
    background: linear-gradient(135deg, #1f8b4c 0%, #17683a 100%);
    color: #fff;
    padding: 22px 20px;
}

.class-title {
    margin: 0 0 18px;
    font-size: 30px;
    font-weight: 700;
    text-align: center;
}

.class-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    align-items: center;
}

.stat-item {
    text-align: center;
}

.stat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    margin-bottom: 8px;
    border-radius: 50%;
    background: #2f6df6;
    font-size: 24px;
}

.stat-value {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: #17324d;
}

.class-card-footer {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background: #f7f7f7;
    border-top: 1px solid #e3e3e3;
}

.tile-action-btn {
    border: 0;
    background: transparent;
    padding: 14px 10px;
    cursor: pointer;
    font-size: 18px;
    transition: background 0.2s ease;
}

.tile-action-btn:hover {
    background: #eaf3ff;
}

.class-details-panel {
    width: 100%;
    margin-top: 12px;
    background: #fff;
    border: 1px solid #dbe5e4;
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

@media (max-width: 1200px) {
    .classes-grid {
        grid-template-columns: repeat(2, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    .classes-grid {
        grid-template-columns: 1fr;
    }
}

.classes-page {
    margin: -30px;
    padding: 30px;
}

.class-page-header-card {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.page-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.classes-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(280px, 1fr));
    gap: 24px;
    align-items: start;
}

.class-grid-item {
    width: 100%;
    min-width: 0;
}

.class-card {
    width: 100%;
    background: #fff;
    border: 1px solid #dbe5e4;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}

.class-card-header {
    background: linear-gradient(135deg, #1f8b4c 0%, #17683a 100%);
    color: #fff;
    padding: 22px 20px;
}

.class-info {
    width: 100%;
}

.class-title {
    margin: 0 0 18px;
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    color: #fff;
}

.class-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    align-items: center;
}

.stat-item {
    text-align: center;
}

.stat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    margin-bottom: 8px;
    border-radius: 50%;
    background: #2f6df6;
    font-size: 24px;
}

.class-card .stat-value {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}

.class-card-footer {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background: #f7f7f7;
    border-top: 1px solid #e3e3e3;
    gap: 0;
}

.tile-action-btn {
    border: 0;
    background: transparent;
    padding: 14px 10px;
    cursor: pointer;
    font-size: 18px;
    transition: background 0.2s ease;
}

.tile-action-btn:hover {
    background: #eaf3ff;
}

.class-details-panel {
    display: none;
    width: 100%;
    margin-top: 12px;
    background: #fff;
    border: 1px solid #dbe5e4;
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.05);
}

.class-card-body {
    padding: 16px;
}

.teachers-section {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--gray-200);
}

.subjects-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--gray-200);
}

.subjects-list,
.teachers-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.subject-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--gray-100);
    border-radius: 8px;
    border-left: 3px solid var(--primary-green);
}

.subject-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.subject-name {
    font-weight: 600;
    color: var(--gray-800);
    font-size: 14px;
}

.subject-code {
    font-size: 12px;
    color: var(--gray-600);
    background: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
    width: fit-content;
}

.subject-teacher {
    font-size: 13px;
    color: var(--gray-600);
}

.subject-actions {
    display: flex;
    gap: 6px;
}

.btn-icon-sm {
    background: #fff;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
}

.no-subjects {
    text-align: center;
    color: var(--gray-500);
    padding: 20px;
    font-style: italic;
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    background: #fff;
    border-radius: 12px;
}

.modal-large {
    max-width: 900px;
}

.students-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.student-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    background: #f9f9f9;
}

.student-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
}

.student-subjects {
    margin-top: 10px;
}

.subject-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.subject-checkboxes .checkbox-label {
    margin: 0;
    padding: 6px;
    border-radius: 4px;
    transition: background 0.2s;
}

.subject-checkboxes .checkbox-label:hover {
    background: #fff;
}

.text-muted {
    color: #666;
    text-align: center;
    padding: 20px;
}

@media (max-width: 1200px) {
    .classes-grid {
        grid-template-columns: repeat(2, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    .classes-grid {
        grid-template-columns: 1fr;
    }

    .page-header-content {
        flex-direction: column;
        align-items: flex-start;
    }
}