html {
    font-size: 14px;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

html {
    position: relative;
    min-height: 100%;
}

body {
    margin: 0;
    background: #f5f7fb;
    color: #1f2937;
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        sans-serif;
}

h1, h2, h3, h4, h5, h6,
.page-title,
.dashboard-title,
.section-title,
.brand-title,
.topbar-title,
.card-title,
.parent-welcome-label ~ h1,
.teacher-dashboard-header h1,
.parent-dashboard-header h1 {
    font-family:
        "Space Grotesk",
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    letter-spacing: -0.01em;
}



.app {
    min-height: 100vh;
    display: flex;
}


.sidebar {
    width: 250px;
    min-height: 100vh;
    background: #111827;
    color: white;

    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;

    display: flex;
    flex-direction: column;

    z-index: 1000;

    overflow-y: auto;
}

.sidebar-brand {
    height: 78px;

    display: flex;
    align-items: center;

    gap: 12px;

    padding: 0 22px;

    border-bottom:
        1px solid rgba(255,255,255,.08);
}

.brand-logo {
    width: 40px;
    height: 40px;

    border-radius: 12px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: linear-gradient(135deg, #4f46e5, #6d28d9);

    color: white;

    font-family: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 20px;
    font-weight: 700;
}

.brand-logo-img {
    width: 40px;
    height: 40px;

    border-radius: 12px;
    object-fit: cover;
}

.brand-title {
    font-size: 16px;
    font-weight: 700;
}

.brand-subtitle {
    font-size: 12px;
    color: #9ca3af;
}

.sidebar-nav {
    padding: 18px 14px;
}

.sidebar-section {
    color: #6b7280;

    font-size: 11px;
    font-weight: 700;

    letter-spacing: 1.2px;

    margin:

        22px 12px
        8px;
}

.sidebar-link {
    display: flex;
    align-items: center;

    min-height: 44px;

    padding: 10px 14px;

    margin-bottom: 4px;

    color: #cbd5e1;

    border-radius: 10px;

    text-decoration: none;

    transition: .2s;
}

.sidebar-link:hover {
    background: rgba(255,255,255,.07);
    color: white;
}

.sidebar-link.active {
    background: linear-gradient(135deg, #4f46e5, #6d28d9);
    color: white;

    font-weight: 600;
}



.main-wrapper {
    width: 100%;

    min-height: 100vh;

    margin-left: 250px;
}



.topbar {
    height: 78px;

    background: white;

    border-bottom: 1px solid #e5e7eb;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0 30px;

    position: sticky;
    top: 0;

    z-index: 900;
}

.topbar-title-group {
    display: flex;
    align-items: center;
    gap: 14px;
}

.topbar-title {
    margin: 0;

    font-weight: 700;

    color: #111827;
}

.btn-back {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #ffffff;
    color: #4b5563;
    cursor: pointer;
    font-size: 15px;
    transition: .2s ease;
}

.btn-back:hover {
    background: #f8fafc;
    transform: translateX(-2px);
}

.topbar-user {
    display: flex;
    align-items: center;

    gap: 20px;
}

.user-info {
    display: flex;
    align-items: center;

    gap: 10px;
}

.user-avatar {
    width: 38px;
    height: 38px;

    background: #eef2ff;
    color: #4f46e5;

    border-radius: 50%;

    display: flex;
    align-items: center;
    justify-content: center;

    font-weight: 800;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-email {
    font-size: 13px;
    font-weight: 600;
}

.user-role {
    font-size: 11px;
    color: #9ca3af;
}

.btn-logout {
    border: 1px solid #ef4444;

    background: transparent;

    color: #ef4444;

    padding: 7px 14px;

    border-radius: 8px;

    font-size: 13px;

    transition: .2s;
}

.btn-logout:hover {
    background: #ef4444;
    color: white;
}



.page-content {
    padding: 30px;
}

.card {
    border-radius: 14px !important;
}

.card.shadow-sm {
    box-shadow:
        0 4px 18px
        rgba(15, 23, 42, .06)
        !important;
}

.card-body {
    padding: 24px;
}


.table {
    margin-bottom: 0;
}

.table thead th {
    color: #6b7280;

    font-size: 12px;

    text-transform: uppercase;

    letter-spacing: .04em;

    border-bottom: 1px solid #e5e7eb;

    padding: 14px;
}

.table tbody td {
    padding: 15px 14px;

    vertical-align: middle;

    border-color: #f1f5f9;
}

.table-hover tbody tr:hover {
    background: #f8fafc;
}

.clickable-row {
    cursor: pointer;
}

.btn {
    border-radius: 9px;

    font-weight: 500;

    padding:
        8px 15px;
}

.btn-primary {
    background: #4f46e5;
    border-color: #4f46e5;
}

.btn-primary:hover {
    background: #4338ca;
    border-color: #4338ca;
}

.btn-outline-primary {
    color: #4f46e5;
    border-color: #4f46e5;
}

.btn-outline-primary:hover {
    background: #4f46e5;
    border-color: #4f46e5;
}

.form-control,
.form-select {
    border-radius: 9px;

    min-height: 42px;

    border-color: #d1d5db;
}

.form-control:focus,
.form-select:focus {
    border-color: #6366f1;

    box-shadow:
        0 0 0 .2rem
        rgba(99,102,241,.12);
}

.password-field {
    position: relative;
}

.password-field .form-control {
    padding-right: 40px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 4px;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
    padding: 0;
    border-radius: 6px;
}

.password-toggle:hover {
    color: #4f46e5;
    background: rgba(79, 70, 229, .08);
}

.password-toggle:focus-visible {
    outline: 2px solid #4f46e5;
    outline-offset: -2px;
}

.password-toggle svg {
    width: 18px;
    height: 18px;
}

.password-toggle .icon-eye-off {
    display: none;
}

.password-toggle.is-visible .icon-eye {
    display: none;
}

.password-toggle.is-visible .icon-eye-off {
    display: block;
}

html[data-theme="dark"] .password-toggle {
    color: #64748b;
}

html[data-theme="dark"] .password-toggle:hover {
    color: #818cf8;
    background: rgba(99, 102, 241, .14);
}

.form-label {
    font-size: 13px;

    font-weight: 600;

    color: #374151;
}

h1 {
    color: #111827;
}

.text-muted {
    color: #6b7280 !important;
}

.badge {
    padding: 6px 9px;

    border-radius: 7px;

    font-weight: 600;
}


.alert {
    border: none;

    border-radius: 12px;
}



@media (max-width: 992px) {

    .sidebar {
        width: 210px;
    }

    .main-wrapper {
        margin-left: 210px;
    }

}

@media (max-width: 768px) {

    .sidebar {
        display: none;
    }

    .main-wrapper {
        margin-left: 0;
    }

    .page-content {
        padding: 18px;
    }

    .topbar {
        padding: 0 18px;
    }

    .user-details {
        display: none;
    }

}

/* =========================
   DASHBOARD
========================= */

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;

    margin-bottom: 26px;
}

.dashboard-title {
    font-size: 28px;
    font-weight: 750;

    margin-bottom: 4px;
}

.dashboard-subtitle {
    margin: 0;

    color: #6b7280;
}

.dashboard-date {
    background: white;

    border: 1px solid #e5e7eb;

    border-radius: 10px;

    padding: 9px 14px;

    color: #6b7280;

    font-size: 13px;
}


/* STAT CARD */

.stat-card {
    background: white;

    min-height: 145px;

    border: 1px solid #eef0f4;

    border-radius: 15px;

    padding: 22px;

    display: flex;
    align-items: center;

    gap: 18px;

    box-shadow:
        0 4px 18px
        rgba(15, 23, 42, .05);

    transition:
        transform .2s,
        box-shadow .2s;
}

.stat-card:hover {
    transform: translateY(-3px);

    box-shadow:
        0 10px 25px
        rgba(15, 23, 42, .09);
}

.stat-icon {
    width: 52px;
    height: 52px;

    border-radius: 14px;

    display: flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    font-size: 13px;
    font-weight: 800;
}

.stat-students {
    background: #eef2ff;
    color: #4f46e5;
}

.stat-teachers {
    background: #ecfdf5;
    color: #059669;
}

.stat-groups {
    background: #fff7ed;
    color: #ea580c;
}

.stat-subjects {
    background: #fdf2f8;
    color: #db2777;
}

.stat-label {
    color: #6b7280;

    font-size: 13px;

    margin-bottom: 2px;
}

.stat-number {
    color: #111827;

    font-size: 30px;

    line-height: 1.1;

    font-weight: 750;
}

.stat-link {
    color: #6b7280;

    font-size: 11px;

    margin-top: 8px;
}


/* SECTION HEADER */

.section-header {
    display: flex;

    justify-content: space-between;
    align-items: center;

    margin-bottom: 20px;
}

.section-title {
    margin: 0;

    font-size: 17px;

    font-weight: 700;
}

.section-subtitle {
    margin: 4px 0 0;

    font-size: 12px;

    color: #9ca3af;
}


/* QUICK ACTIONS */

.quick-actions {
    display: grid;

    grid-template-columns:
        repeat(4, 1fr);

    gap: 14px;
}

.quick-action {
    display: flex;
    align-items: center;

    gap: 13px;

    border: 1px solid #e5e7eb;

    border-radius: 12px;

    padding: 15px;

    text-decoration: none;

    color: #111827;

    transition: .2s;
}

.quick-action:hover {
    border-color: #c7d2fe;

    background: #f8faff;

    transform: translateY(-1px);
}

.quick-action-icon {
    width: 36px;
    height: 36px;

    border-radius: 10px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #eef2ff;

    color: #4f46e5;

    font-size: 22px;
}

.quick-action strong {
    display: block;

    font-size: 13px;
}

.quick-action span {
    display: block;

    margin-top: 2px;

    color: #9ca3af;

    font-size: 11px;
}


/* LESSON TABLE */

.lesson-time {
    font-weight: 700;

    color: #111827;
}

.dashboard-badge {
    display: inline-block;

    padding: 5px 9px;

    border-radius: 7px;

    background: #eef2ff;

    color: #4338ca;

    font-size: 12px;

    font-weight: 600;
}


/* RECENT STUDENTS */

.recent-list {
    display: flex;

    flex-direction: column;
}

.recent-item {
    display: flex;
    align-items: center;

    gap: 12px;

    padding: 12px 4px;

    border-bottom: 1px solid #f1f5f9;

    color: #111827;

    text-decoration: none;

    transition: .2s;
}

.recent-item:last-child {
    border-bottom: none;
}

.recent-item:hover {
    padding-left: 8px;
}

.recent-avatar {
    width: 39px;
    height: 39px;

    border-radius: 10px;

    background: #eef2ff;

    color: #4f46e5;

    display: flex;
    align-items: center;
    justify-content: center;

    font-weight: 750;
}

.recent-info {
    display: flex;
    flex-direction: column;

    flex: 1;
}

.recent-info strong {
    font-size: 13px;
}

.recent-info span {
    color: #9ca3af;

    font-size: 11px;

    margin-top: 2px;
}

.recent-arrow {
    color: #9ca3af;
}


/* EMPTY */

.dashboard-empty {
    min-height: 180px;

    display: flex;
    flex-direction: column;

    align-items: center;
    justify-content: center;

    text-align: center;

    color: #9ca3af;
}

.dashboard-empty h6 {
    color: #374151;

    margin-top: 10px;
}

.dashboard-empty p {
    font-size: 13px;
}

.dashboard-empty-icon {
    width: 45px;
    height: 45px;

    border-radius: 50%;

    background: #f1f5f9;

    display: flex;
    align-items: center;
    justify-content: center;
}


/* RESPONSIVE */

@media (max-width: 1200px) {

    .quick-actions {
        grid-template-columns:
            repeat(2, 1fr);
    }

}

@media (max-width: 768px) {

    .dashboard-header {
        align-items: flex-start;
        flex-direction: column;

        gap: 12px;
    }

    .quick-actions {
        grid-template-columns: 1fr;
    }

}
/* =========================
   MANAGEMENT PAGES
========================= */

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    margin-bottom: 25px;
}

.page-title {
    margin: 0;

    font-size: 27px;
    font-weight: 750;
}

.page-subtitle {
    margin: 5px 0 0;

    color: #6b7280;
    font-size: 14px;
}


/* TOOLBAR */

.management-toolbar {
    display: flex;
    align-items: center;

    gap: 10px;

    margin-bottom: 22px;
}

.management-search {
    max-width: 380px;
    width: 100%;
}

.bulk-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 10px;

    padding: 10px 16px;
    margin-bottom: 16px;

    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;

    color: #991b1b;
}


/* PERSON */

.person-cell {
    display: flex;
    align-items: center;

    gap: 12px;
}

.person-avatar {
    width: 42px;
    height: 42px;

    border-radius: 11px;

    background: #eef2ff;
    color: #4f46e5;

    display: flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    font-weight: 750;
}

.person-name {
    font-weight: 650;

    color: #111827;
}

.person-id {
    margin-top: 2px;

    color: #9ca3af;

    font-size: 11px;
}

/* Parent contact list (Student Details, Admin + Teacher) */

.parent-contact-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 14px;
}

.parent-contact-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px;
    border: 1px solid #e6eaf0;
    border-radius: 10px;
    background: #f8fafc;
}

.parent-contact-name {
    font-weight: 650;
    color: #111827;
}

.parent-relation-badge {
    display: inline-flex;
    align-items: center;
    margin-left: 8px;
    padding: 2px 9px;
    border-radius: 999px;
    background: #ecfdf5;
    color: #15803d;
    font-size: 11px;
    font-weight: 700;
    vertical-align: middle;
}

.parent-contact-details {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.parent-contact-email {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #64748b;
    font-size: 13px;
}

.phone-action-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid #c7d2fe;
    background: #eef2ff;
    color: #4338ca;
    font-weight: 650;
    font-size: 13px;
    cursor: pointer;
}

.phone-action-trigger:hover {
    background: #e0e7ff;
}

.phone-action-menu {
    min-width: 170px;
}

/* Compact variant for a table cell (Teacher's My Students, Admin's
   Students list) - one line per parent, no card chrome. */
.parent-contact-list-compact {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.parent-contact-item-compact {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.parent-contact-item-compact .parent-relation-badge {
    margin-left: 0;
}


/* GROUP */

.group-badge {
    display: inline-block;

    padding: 6px 10px;

    background: #f0fdf4;
    color: #15803d;

    border-radius: 7px;

    font-size: 12px;
    font-weight: 600;
}


/* ACTION BUTTONS */

.action-buttons {
    display: flex;

    justify-content: flex-end;

    gap: 6px;
}

.action-btn {
    padding: 6px 10px;

    border-radius: 7px;

    text-decoration: none;

    font-size: 12px;
    font-weight: 600;

    transition: .15s;
}

.action-details {
    background: #f1f5f9;
    color: #475569;
}

.action-details:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.action-edit {
    background: #eef2ff;
    color: #4f46e5;
}

.action-edit:hover {
    background: #e0e7ff;
    color: #4338ca;
}

.action-delete {
    background: #fef2f2;
    color: #dc2626;
}

.action-delete:hover {
    background: #fee2e2;
    color: #b91c1c;
}


/* EMPTY */

.management-empty {
    min-height: 330px;

    display: flex;
    flex-direction: column;

    justify-content: center;
    align-items: center;

    text-align: center;
}

.management-empty-icon {
    width: 60px;
    height: 60px;

    display: flex;
    justify-content: center;
    align-items: center;

    border-radius: 16px;

    background: #eef2ff;
    color: #4f46e5;

    font-size: 26px;
    font-weight: 800;

    margin-bottom: 15px;
}

.management-empty h5 {
    margin-bottom: 5px;

    font-weight: 700;
}

.management-empty p {
    color: #9ca3af;

    font-size: 13px;
}


/* TABLE FOOTER */

.table-footer {
    display: flex;
    justify-content: flex-end;

    border-top: 1px solid #f1f5f9;

    padding-top: 15px;
    margin-top: 5px;

    color: #9ca3af;

    font-size: 12px;
}


@media (max-width: 768px) {

    .page-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .management-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .management-search {
        max-width: none;
    }

}
/* =========================
   CRUD FORM
========================= */

.form-page-header {
    margin-bottom: 25px;
}

.back-link {
    color: #6b7280;

    text-decoration: none;

    font-size: 13px;

    font-weight: 500;
}

.back-link:hover {
    color: #4f46e5;
}


/* FORM GRID */

.student-form-grid {
    display: grid;

    grid-template-columns:
        minmax(0, 2fr)
        minmax(300px, 1fr);

    gap: 22px;

    align-items: start;
}


/* FORM CARD */

.form-card {
    background: white;

    border: 1px solid #e5e7eb;

    border-radius: 15px;

    overflow: hidden;

    box-shadow:
        0 4px 18px
        rgba(15, 23, 42, .05);
}

.form-card-header {
    padding: 20px 22px;

    border-bottom: 1px solid #f1f5f9;
}

.form-card-header h5 {
    margin: 0;

    color: #111827;

    font-size: 16px;

    font-weight: 700;
}

.form-card-header p {
    margin: 4px 0 0;

    color: #9ca3af;

    font-size: 12px;
}

.form-card-body {
    padding: 22px;
}


/* PARENTS */

.parent-selector {
    display: flex;

    flex-direction: column;

    gap: 9px;

    max-height: 390px;

    overflow-y: auto;
}

.parent-option {
    display: flex;

    align-items: center;

    gap: 11px;

    padding: 11px;

    border: 1px solid #e5e7eb;

    border-radius: 10px;

    cursor: pointer;

    transition: .15s;
}

.parent-option:hover {
    border-color: #c7d2fe;

    background: #fafaff;
}

.parent-option input {
    width: 16px;
    height: 16px;

    accent-color: #4f46e5;
}

.parent-option-avatar {
    width: 37px;
    height: 37px;

    display: flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    border-radius: 10px;

    background: #eef2ff;
    color: #4f46e5;

    font-weight: 700;
}

.parent-option-info {
    display: flex;

    flex-direction: column;

    min-width: 0;
}

.parent-option-info strong {
    color: #111827;

    font-size: 13px;
}

.parent-option-info span {
    margin-top: 2px;

    color: #9ca3af;

    font-size: 11px;

    overflow: hidden;

    text-overflow: ellipsis;

    white-space: nowrap;
}


/* ACTIONS */

.form-actions {
    display: flex;

    justify-content: flex-end;

    gap: 10px;

    margin-top: 22px;

    padding: 18px 20px;

    background: white;

    border: 1px solid #e5e7eb;

    border-radius: 13px;
}


/* VALIDATION */

.field-validation-error {
    display: block;

    margin-top: 5px;

    font-size: 12px;
}

.validation-summary-valid {
    display: none;
}


/* RESPONSIVE */

@media (max-width: 1000px) {

    .student-form-grid {
        grid-template-columns: 1fr;
    }

}

@media (max-width: 600px) {

    .form-actions {
        flex-direction: column-reverse;
    }

    .form-actions .btn {
        width: 100%;
    }

}
/* =========================
   TEACHER MANAGEMENT
========================= */

.subject-badge {
    display: inline-block;

    padding: 6px 10px;

    border-radius: 7px;

    background: #fff7ed;
    color: #c2410c;

    font-size: 12px;
    font-weight: 600;
}


/* TEACHER FORM */

.teacher-form-grid {
    display: grid;

    grid-template-columns:
        minmax(0, 2fr)
        minmax(280px, 1fr)
        minmax(280px, 1fr);

    gap: 20px;

    align-items: start;
}


/* RELATIONS */

.relation-selector {
    display: flex;
    flex-direction: column;

    gap: 9px;

    max-height: 390px;

    overflow-y: auto;
}

.relation-option {
    display: flex;

    align-items: center;

    gap: 11px;

    padding: 11px;

    border: 1px solid #e5e7eb;

    border-radius: 10px;

    cursor: pointer;

    transition: .15s;
}

.relation-option:hover {
    background: #fafaff;

    border-color: #c7d2fe;
}

.relation-option input {
    width: 16px;
    height: 16px;

    flex-shrink: 0;

    accent-color: #4f46e5;
}

.relation-icon {
    width: 37px;
    height: 37px;

    display: flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    border-radius: 10px;

    background: #f0fdf4;
    color: #15803d;

    font-size: 16px;
    font-weight: 800;
}

.relation-icon.subject-icon {
    background: #fff7ed;
    color: #c2410c;
}

.relation-info {
    display: flex;
    flex-direction: column;
}

.relation-info strong {
    color: #111827;

    font-size: 13px;
}

.relation-info span {
    margin-top: 2px;

    color: #9ca3af;

    font-size: 11px;
}

.form-hint {
    margin-top: 5px;

    color: #9ca3af;

    font-size: 11px;
}


@media (max-width: 1300px) {

    .teacher-form-grid {
        grid-template-columns:
            minmax(0, 2fr)
            minmax(280px, 1fr);
    }

    .teacher-form-grid .form-card:last-child {
        grid-column:
            1 / -1;
    }

}


@media (max-width: 900px) {

    .teacher-form-grid {
        grid-template-columns: 1fr;
    }

    .teacher-form-grid .form-card:last-child {
        grid-column: auto;
    }

}
.parent-avatar {
    background: #fdf2f8;
    color: #db2777;
}

.student-mini {
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 2px;
}

.parent-form-grid {
    display: grid;
    grid-template-columns:
        minmax(0, 1.5fr)
        minmax(320px, 1fr);
    gap: 20px;
    align-items: start;
}

.student-relation-icon {
    background: #eef2ff;
    color: #4f46e5;
}

@media (max-width: 950px) {
    .parent-form-grid {
        grid-template-columns: 1fr;
    }
}
.group-avatar {
    background: #ecfdf5;
    color: #059669;
}

.subject-avatar {
    background: #fff7ed;
    color: #ea580c;
}

.count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 31px;
    height: 31px;

    padding: 0 9px;

    border-radius: 8px;

    background: #eef2ff;
    color: #4f46e5;

    font-size: 13px;
    font-weight: 700;
}

.teacher-badge {
    display: inline-block;

    margin-bottom: 4px;

    padding: 6px 9px;

    border-radius: 7px;

    background: #eef2ff;
    color: #4338ca;

    font-size: 12px;
    font-weight: 600;
}

.teacher-relation-icon {
    background: #ecfdf5;
    color: #059669;
}
.lesson-filters {
    display: grid;
    grid-template-columns:
        minmax(260px, 2fr)
        minmax(160px, 1fr)
        minmax(160px, 1fr)
        auto
        auto;
    gap: 10px;
    margin-bottom: 24px;
}

.lesson-search {
    min-width: 0;
}

.lesson-date {
    color: #111827;
    font-size: 13px;
    font-weight: 650;
}

.lesson-time-range {
    margin-top: 3px;
    color: #9ca3af;
    font-size: 11px;
}

.mini-avatar {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 9px;
    background: #eef2ff;
    color: #4f46e5;
    font-size: 11px;
    font-weight: 800;
}

.lesson-form-grid {
    display: grid;
    grid-template-columns:
        minmax(0, 1.5fr)
        minmax(320px, 1fr);
    gap: 20px;
    align-items: start;
}

.schedule-filters {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
}

.schedule-filters > div {
    min-width: 190px;
}

.schedule-list {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.schedule-day {
    overflow: hidden;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
}

.schedule-day-header {
    padding: 14px 18px;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
}

.schedule-day-name {
    color: #111827;
    font-size: 15px;
    font-weight: 750;
}

.schedule-day-count {
    margin-left: 8px;
    color: #9ca3af;
    font-size: 11px;
}

.schedule-row {
    display: grid;
    grid-template-columns:
        120px
        minmax(170px, 1fr)
        minmax(190px, 1fr)
        auto;
    align-items: center;
    gap: 18px;
    padding: 16px 18px;
    border-bottom: 1px solid #f1f5f9;
}

.schedule-row:last-child {
    border-bottom: none;
}

.schedule-row:hover {
    background: #fafbff;
}

.schedule-time {
    display: flex;
    flex-direction: column;
}

.schedule-time strong {
    color: #111827;
    font-size: 15px;
}

.schedule-time span {
    margin-top: 2px;
    color: #9ca3af;
    font-size: 11px;
}

.schedule-subject {
    display: flex;
    flex-direction: column;
}

.schedule-subject strong {
    color: #111827;
    font-size: 13px;
}

.schedule-subject span {
    margin-top: 3px;
    color: #6b7280;
    font-size: 11px;
}

.schedule-teacher {
    display: flex;
    align-items: center;
    gap: 9px;
    color: #374151;
    font-size: 13px;
}

@media (max-width: 1100px) {
    .lesson-filters {
        grid-template-columns: 1fr 1fr;
    }

    .lesson-search {
        grid-column: 1 / -1;
    }

    .schedule-row {
        grid-template-columns:
            100px
            1fr
            1fr;
    }

    .schedule-row .action-buttons {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }
}

@media (max-width: 800px) {
    .lesson-form-grid {
        grid-template-columns: 1fr;
    }

    .schedule-filters {
        align-items: stretch;
        flex-direction: column;
    }

    .schedule-filters > div {
        width: 100%;
    }

    .schedule-row {
        grid-template-columns: 1fr;
    }

    .schedule-row .action-buttons {
        grid-column: auto;
    }
}

@media (max-width: 600px) {
    .lesson-filters {
        grid-template-columns: 1fr;
    }

    .lesson-search {
        grid-column: auto;
    }
}
.readonly-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 12px;
    border-radius: 8px;
    background: #f1f5f9;
    color: #64748b;
    font-size: 12px;
    font-weight: 650;
}

.record-filters {
    display: grid;
    grid-template-columns:
        minmax(260px, 2fr)
        minmax(150px, 1fr)
        minmax(150px, 1fr)
        auto
        auto;
    gap: 10px;
    margin-bottom: 24px;
}

.record-search {
    min-width: 0;
}

.record-date {
    color: #111827;
    font-size: 13px;
    font-weight: 650;
}

.record-time {
    margin-top: 3px;
    color: #9ca3af;
    font-size: 11px;
}

.attendance-stats,
.grade-stats,
.salary-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 22px;
}

.attendance-stat,
.grade-stat,
.salary-stat {
    padding: 19px 20px;
    border: 1px solid #e5e7eb;
    border-radius: 13px;
    background: white;
    box-shadow:
        0 4px 16px
        rgba(15, 23, 42, .04);
}

.attendance-stat-value,
.grade-stat-value,
.salary-stat-value {
    color: #111827;
    font-size: 25px;
    font-weight: 750;
}

.attendance-stat-label,
.grade-stat-label,
.salary-stat-label {
    margin-top: 3px;
    color: #9ca3af;
    font-size: 12px;
}

.attendance-present {
    border-left: 4px solid #22c55e;
}

.attendance-late {
    border-left: 4px solid #f59e0b;
}

.attendance-absent {
    border-left: 4px solid #ef4444;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 7px;
    font-size: 11px;
    font-weight: 700;
}

.status-present {
    background: #ecfdf5;
    color: #15803d;
}

.status-absent {
    background: #fef2f2;
    color: #dc2626;
}

.status-late {
    background: #fffbeb;
    color: #b45309;
}

.status-excused {
    background: #eff6ff;
    color: #2563eb;
}

.grade-filters {
    display: grid;
    grid-template-columns:
        minmax(280px, 2fr)
        minmax(180px, 1fr)
        auto
        auto;
    gap: 10px;
    margin-bottom: 24px;
}

.grade-badge {
    display: inline-flex;
    min-width: 37px;
    height: 37px;
    padding: 0 8px;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 800;
    white-space: nowrap;
}

.grade-high {
    background: #ecfdf5;
    color: #15803d;
}

.grade-good {
    background: #eef2ff;
    color: #4f46e5;
}

.grade-low {
    background: #fff7ed;
    color: #c2410c;
}

/* Used wherever a blacklist threshold exists (regular exam sheets, Big
   Exam rankings) so every score reads the same regardless of value -
   only a blacklisted student's row/badge should stand out. */
.grade-neutral {
    background: #f1f5f9;
    color: #334155;
}

/* Lets a parent spot their own child at a glance in a shared ranking
   or leaderboard that lists every student. No !important, so a
   blacklisted row's (also !important) dark background still wins if
   a student happens to be both. */
tr.big-exam-row-mine td,
tr.leaderboard-row-mine td,
tr.exam-row-mine td {
    background: #eef2ff;
}

.my-child-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 8px;
    padding: 2px 9px;
    border-radius: 999px;
    background: #6366f1;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    vertical-align: middle;
}

.my-child-badge i {
    font-size: 10px;
}

/* Row background for a student scoring below the configured blacklist
   threshold on a regular exam sheet or its history (same treatment as
   the Big Exam rankings' .big-exam-blacklisted). */
tr.exam-blacklisted td {
    background: #1f2430 !important;
    color: #cbd5e1;
}

html[data-theme="dark"] tr.exam-blacklisted td {
    background: #05070c !important;
    color: #94a3b8;
}

tr.exam-blacklisted .exam-average {
    color: #ef4444;
}

/* .person-name/.record-date/.person-id each set their own dark text
   color for the normal light-theme table (meant for a white/light row
   background), which the blacklisted row's always-dark background
   never overrides on its own - without this, the name and date read as
   near-black on near-black. Same specificity as the dark-theme rules
   for these classes (features.css), so which one wins is decided by
   source order: this file loads first, so the dark-theme override
   (declared later, in features.css) still applies its own color when
   the app itself is in dark mode - this rule only takes effect in the
   default light theme. */
tr.exam-blacklisted .person-name,
tr.exam-blacklisted .record-date {
    color: #f1f5f9 !important;
}

tr.exam-blacklisted .person-id {
    color: #94a3b8 !important;
}

/* Same problem, different wrapper: the exam-entry sheet's student name
   uses .teacher-attendance-student strong instead of .person-name, with
   its own dark-on-light default color. Same source-order trick as
   above - the dark-theme override for this selector is declared later
   in this same file, so it still wins there; this only fixes light
   theme. */
tr.exam-blacklisted .teacher-attendance-student strong {
    color: #f1f5f9 !important;
}

.salary-period {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 20px;
    margin-bottom: 20px;
    border: 1px solid #e5e7eb;
    border-radius: 13px;
    background: white;
}

.salary-period-label {
    color: #9ca3af;
    font-size: 11px;
}

.salary-period-value {
    margin-top: 2px;
    color: #111827;
    font-size: 18px;
    font-weight: 750;
}

.salary-filter {
    display: flex;
    gap: 9px;
}

.salary-filter .form-select {
    min-width: 135px;
}

.salary-total-card {
    border-left: 4px solid #4f46e5;
}

.salary-avatar {
    background: #ecfdf5;
    color: #059669;
}

.salary-amount {
    display: inline-block;
    padding: 7px 11px;
    border-radius: 8px;
    background: #ecfdf5;
    color: #047857;
    font-weight: 750;
}

.salary-total {
    color: #4f46e5;
    font-size: 17px;
}

.management-table tfoot td {
    padding: 17px 14px;
    border-top: 2px solid #e5e7eb;
    background: #fafafa;
}

@media (max-width: 1000px) {
    .attendance-stats,
    .grade-stats,
    .salary-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .record-filters,
    .grade-filters {
        grid-template-columns: 1fr 1fr;
    }

    .record-search {
        grid-column: 1 / -1;
    }
}

@media (max-width: 700px) {
    .attendance-stats,
    .grade-stats,
    .salary-stats {
        grid-template-columns: 1fr;
    }

    .record-filters,
    .grade-filters {
        grid-template-columns: 1fr;
    }

    .record-search {
        grid-column: auto;
    }

    .salary-period {
        align-items: stretch;
        flex-direction: column;
    }

    .salary-filter {
        flex-direction: column;
    }

    .salary-filter .form-select {
        width: 100%;
    }
}
.teacher-dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 25px;
}

.teacher-welcome-label {
    margin-bottom: 4px;
    color: #4f46e5;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.teacher-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 17px;
    margin-bottom: 22px;
}

.teacher-stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 135px;
    padding: 20px;
    border: 1px solid #e5e7eb;
    border-radius: 15px;
    background: white;
    color: #111827;
    text-decoration: none;
    box-shadow:
        0 4px 18px
        rgba(15, 23, 42, .045);
    transition:
        transform .18s ease,
        box-shadow .18s ease,
        border-color .18s ease;
}

.teacher-stat-card:hover {
    transform: translateY(-3px);
    border-color: #c7d2fe;
    box-shadow:
        0 10px 28px
        rgba(15, 23, 42, .08);
    color: #111827;
}

.teacher-stat-icon {
    width: 51px;
    height: 51px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 14px;
    font-size: 12px;
    font-weight: 800;
}

.teacher-stat-groups {
    background: #ecfdf5;
    color: #059669;
}

.teacher-stat-students {
    background: #eef2ff;
    color: #4f46e5;
}

.teacher-stat-lessons {
    background: #fff7ed;
    color: #ea580c;
}

.teacher-stat-salary {
    background: #fdf2f8;
    color: #db2777;
}

.teacher-stat-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.teacher-stat-label {
    color: #6b7280;
    font-size: 12px;
}

.teacher-stat-number {
    margin-top: 2px;
    color: #111827;
    font-size: 27px;
    line-height: 1.2;
    font-weight: 760;
}

.teacher-salary-number {
    font-size: 22px;
}

.teacher-stat-link {
    margin-top: 7px;
    color: #9ca3af;
    font-size: 11px;
}

.teacher-quick-card {
    margin-bottom: 22px;
    padding: 22px;
    border: 1px solid #e5e7eb;
    border-radius: 15px;
    background: white;
    box-shadow:
        0 4px 18px
        rgba(15, 23, 42, .045);
}

.teacher-quick-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.teacher-quick-action {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
    padding: 14px;
    border: 1px solid #e5e7eb;
    border-radius: 11px;
    color: #111827;
    text-decoration: none;
    transition: .18s ease;
}

.teacher-quick-action:hover {
    border-color: #c7d2fe;
    background: #fafaff;
    transform: translateY(-1px);
    color: #111827;
}

.teacher-quick-icon {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 10px;
    background: #ecfdf5;
    color: #059669;
    font-size: 10px;
    font-weight: 800;
}

.teacher-quick-grade {
    background: #eef2ff;
    color: #4f46e5;
}

.teacher-quick-topic {
    background: #fff7ed;
    color: #ea580c;
}

.teacher-quick-schedule {
    background: #fdf2f8;
    color: #db2777;
}

.teacher-quick-action strong {
    display: block;
    color: #111827;
    font-size: 13px;
}

.teacher-quick-action span {
    display: block;
    margin-top: 2px;
    color: #9ca3af;
    font-size: 10px;
}

.teacher-quick-arrow {
    margin-left: auto;
    color: #cbd5e1;
    font-size: 17px;
}

.teacher-lessons {
    display: flex;
    flex-direction: column;
}

.teacher-lesson-row {
    display: grid;
    grid-template-columns:
        85px
        minmax(130px, .8fr)
        minmax(180px, 1.2fr)
        minmax(130px, .8fr)
        auto;
    align-items: center;
    gap: 18px;
    padding: 17px 4px;
    border-bottom: 1px solid #f1f5f9;
}

.teacher-lesson-row:last-child {
    border-bottom: 0;
}

.teacher-lesson-row:hover {
    background: #fafbff;
}

.teacher-lesson-time {
    display: flex;
    flex-direction: column;
}

.teacher-lesson-time strong {
    color: #111827;
    font-size: 15px;
}

.teacher-lesson-time span {
    margin-top: 2px;
    color: #9ca3af;
    font-size: 11px;
}

.teacher-lesson-main {
    display: flex;
    flex-direction: column;
}

.teacher-lesson-title {
    color: #111827;
    font-size: 13px;
    font-weight: 700;
}

.teacher-lesson-group {
    margin-top: 3px;
    color: #4f46e5;
    font-size: 11px;
    font-weight: 600;
}

.teacher-lesson-topic {
    display: flex;
    flex-direction: column;
    color: #374151;
    font-size: 12px;
}

.teacher-lesson-topic strong {
    margin-top: 3px;
    font-size: 12px;
    font-weight: 600;
}

.teacher-lesson-small-label {
    color: #9ca3af;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.teacher-status-pending {
    background: #f1f5f9;
    color: #64748b;
}

.teacher-lesson-actions {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
}

.teacher-grade-button {
    background: #fff7ed;
    color: #c2410c;
}

.teacher-grade-button:hover {
    background: #ffedd5;
    color: #9a3412;
}

.teacher-empty {
    min-height: 230px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.teacher-empty-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 13px;
    border-radius: 50%;
    background: #ecfdf5;
    color: #059669;
    font-size: 22px;
    font-weight: 800;
}

.teacher-empty h5 {
    margin-bottom: 5px;
    color: #111827;
    font-size: 16px;
    font-weight: 700;
}

.teacher-empty p {
    margin-bottom: 14px;
    color: #9ca3af;
    font-size: 12px;
}

@media (max-width: 1200px) {
    .teacher-stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .teacher-quick-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .teacher-lesson-row {
        grid-template-columns:
            80px
            1fr
            1fr;
    }

    .teacher-lesson-attendance {
        grid-column: 2;
    }

    .teacher-lesson-actions {
        grid-column: 3;
    }
}

@media (max-width: 700px) {
    .teacher-dashboard-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .teacher-stat-grid {
        grid-template-columns: 1fr;
    }

    .teacher-quick-grid {
        grid-template-columns: 1fr;
    }

    .teacher-lesson-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .teacher-lesson-attendance,
    .teacher-lesson-actions {
        grid-column: auto;
    }

    .teacher-lesson-actions {
        justify-content: flex-start;
    }
}
.teacher-count-label {
    display: inline-flex;
    align-items: center;
    padding: 8px 13px;
    border: 1px solid #e5e7eb;
    border-radius: 9px;
    background: white;
    color: #64748b;
    font-size: 12px;
    font-weight: 650;
}

.teacher-groups-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.teacher-group-card {
    display: flex;
    flex-direction: column;
    min-height: 210px;
    padding: 21px;
    border: 1px solid #e5e7eb;
    border-radius: 15px;
    background: white;
    color: #111827;
    text-decoration: none;
    box-shadow:
        0 4px 18px
        rgba(15, 23, 42, .045);
    transition:
        transform .18s ease,
        box-shadow .18s ease,
        border-color .18s ease;
}

.teacher-group-card:hover {
    transform: translateY(-3px);
    border-color: #c7d2fe;
    box-shadow:
        0 10px 28px
        rgba(15, 23, 42, .08);
    color: #111827;
}

.teacher-group-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.teacher-group-icon {
    width: 43px;
    height: 43px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: #ecfdf5;
    color: #059669;
    font-size: 19px;
    font-weight: 800;
}

.teacher-group-arrow {
    color: #cbd5e1;
    font-size: 20px;
}

.teacher-group-name {
    margin-top: 20px;
    color: #111827;
    font-size: 20px;
    font-weight: 750;
}

.teacher-group-subtitle {
    margin-top: 3px;
    color: #9ca3af;
    font-size: 11px;
}

.teacher-group-bottom {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 20px;
}

.teacher-group-bottom > div {
    display: flex;
    flex-direction: column;
}

.teacher-group-bottom strong {
    color: #111827;
    font-size: 18px;
}

.teacher-group-bottom span {
    color: #9ca3af;
    font-size: 10px;
}

.teacher-open-label {
    color: #4f46e5 !important;
    font-weight: 650;
}

.teacher-details-header {
    margin-bottom: 24px;
}

.teacher-big-group-icon {
    width: 58px;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 15px;
    background: #ecfdf5;
    color: #059669;
    font-size: 13px;
    font-weight: 800;
}

.teacher-group-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 16px;
    max-width: 650px;
    margin-bottom: 22px;
}

.teacher-today-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 22px;
}

@media (max-width: 700px) {
    .teacher-today-stats {
        grid-template-columns: 1fr;
    }
}

.teacher-info-stat {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px;
    border: 1px solid #e5e7eb;
    border-radius: 13px;
    background: white;
}

.teacher-info-stat-icon {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 11px;
    background: #eef2ff;
    color: #4f46e5;
    font-size: 10px;
    font-weight: 800;
}

.teacher-info-stat > div:last-child {
    display: flex;
    flex-direction: column;
}

.teacher-info-stat span {
    color: #9ca3af;
    font-size: 11px;
}

.teacher-info-stat strong {
    margin-top: 1px;
    color: #111827;
    font-size: 21px;
}

.subject-color {
    background: #fff7ed !important;
    color: #ea580c !important;
}

.teacher-subject-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.teacher-subject-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border: 1px solid #fed7aa;
    border-radius: 10px;
    background: #fffaf5;
    color: #9a3412;
    font-size: 12px;
    font-weight: 650;
}

.teacher-subject-chip-icon {
    width: 27px;
    height: 27px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    background: #ffedd5;
    font-size: 8px;
    font-weight: 800;
}

.teacher-simple-empty {
    padding: 22px;
    border: 1px dashed #d1d5db;
    border-radius: 10px;
    color: #9ca3af;
    text-align: center;
    font-size: 12px;
}

.teacher-student-summary {
    display: flex;
    gap: 35px;
    margin-bottom: 20px;
    padding-bottom: 18px;
    border-bottom: 1px solid #f1f5f9;
}

.teacher-student-summary > div {
    display: flex;
    flex-direction: column;
}

.teacher-student-summary span {
    color: #9ca3af;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.teacher-student-summary strong {
    margin-top: 2px;
    color: #111827;
    font-size: 21px;
}

.teacher-student-profile {
    display: flex;
    align-items: center;
    gap: 15px;
}

.teacher-student-avatar {
    width: 61px;
    height: 61px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 16px;
    background: #eef2ff;
    color: #4f46e5;
    font-size: 20px;
    font-weight: 800;
}

.teacher-student-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 22px;
}

.teacher-student-stat {
    display: flex;
    align-items: center;
    gap: 13px;
    min-height: 105px;
    padding: 17px;
    border: 1px solid #e5e7eb;
    border-radius: 13px;
    background: white;
}

.teacher-student-stat-icon {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 11px;
    font-size: 9px;
    font-weight: 800;
}

.teacher-student-stat > div:last-child {
    display: flex;
    flex-direction: column;
}

.teacher-student-stat span {
    color: #9ca3af;
    font-size: 10px;
}

.teacher-student-stat strong {
    margin-top: 1px;
    color: #111827;
    font-size: 20px;
}

.teacher-student-stat small {
    margin-top: 2px;
    color: #9ca3af;
    font-size: 9px;
}

.attendance-color {
    background: #ecfdf5;
    color: #059669;
}

.grade-color {
    background: #eef2ff;
    color: #4f46e5;
}

.lessons-color {
    background: #fdf2f8;
    color: #db2777;
}

@media (max-width: 1100px) {
    .teacher-groups-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .teacher-student-stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 700px) {
    .teacher-groups-grid {
        grid-template-columns: 1fr;
    }

    .teacher-group-stats {
        grid-template-columns: 1fr;
    }

    .teacher-student-stat-grid {
        grid-template-columns: 1fr;
    }

    .teacher-student-summary {
        gap: 20px;
    }
}
.teacher-attendance-stats,
.teacher-grade-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 22px;
}

.teacher-attendance-stat,
.teacher-grade-stat {
    display: flex;
    align-items: center;
    gap: 13px;
    min-height: 100px;
    padding: 17px;
    border: 1px solid #e5e7eb;
    border-radius: 13px;
    background: white;
    box-shadow:
        0 4px 16px
        rgba(15, 23, 42, .04);
}

.teacher-attendance-stat-icon,
.teacher-grade-stat-icon {
    width: 43px;
    height: 43px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 11px;
    font-size: 19px;
    font-weight: 800;
}

.teacher-attendance-stat > div:last-child,
.teacher-grade-stat > div:last-child {
    display: flex;
    flex-direction: column;
}

.teacher-attendance-stat span,
.teacher-grade-stat span {
    color: #9ca3af;
    font-size: 10px;
}

.teacher-attendance-stat strong,
.teacher-grade-stat strong {
    margin-top: 2px;
    color: #111827;
    font-size: 22px;
}

.attendance-all {
    background: #eef2ff;
    color: #4f46e5;
}

.attendance-complete {
    background: #ecfdf5;
    color: #059669;
}

.attendance-partial {
    background: #fffbeb;
    color: #d97706;
}

.attendance-pending {
    background: #fef2f2;
    color: #dc2626;
}

.grade-stat-lessons {
    background: #eef2ff;
    color: #4f46e5;
}

.grade-stat-records {
    background: #fff7ed;
    color: #ea580c;
}

.grade-stat-active {
    background: #ecfdf5;
    color: #059669;
}

.grade-stat-complete {
    background: #fdf2f8;
    color: #db2777;
}

.teacher-student-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 31px;
    height: 31px;
    padding: 0 9px;
    border-radius: 8px;
    background: #f1f5f9;
    color: #475569;
    font-size: 12px;
    font-weight: 750;
}

.teacher-lesson-form-header {
    display: flex;
    align-items: center;
    gap: 15px;
}

.teacher-lesson-form-icon {
    width: 58px;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 15px;
    background: #ecfdf5;
    color: #059669;
    font-size: 25px;
    font-weight: 800;
}

.grade-form-icon {
    background: #eef2ff;
    color: #4f46e5;
}

.teacher-lesson-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    color: #6b7280;
    font-size: 11px;
}

.teacher-attendance-list {
    display: flex;
    flex-direction: column;
}

.teacher-attendance-row {
    display: grid;
    grid-template-columns:
        minmax(210px, 1fr)
        minmax(500px, 1.7fr);
    align-items: center;
    gap: 20px;
    padding: 15px 4px;
    border-bottom: 1px solid #f1f5f9;
}

.teacher-attendance-row:last-child {
    border-bottom: 0;
}

.teacher-attendance-student {
    display: flex;
    align-items: center;
    gap: 11px;
}

.teacher-attendance-student > div:last-child {
    display: flex;
    flex-direction: column;
}

.teacher-attendance-student strong {
    color: #111827;
    font-size: 13px;
}

.teacher-attendance-student span {
    margin-top: 2px;
    color: #9ca3af;
    font-size: 10px;
}

.teacher-status-selector {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 7px;
}

.teacher-status-option {
    position: relative;
    margin: 0;
    cursor: pointer;
}

.teacher-status-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.teacher-status-option span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 39px;
    padding: 7px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 9px;
    background: white;
    color: #64748b;
    font-size: 11px;
    font-weight: 650;
    transition: .15s;
}

.teacher-status-option:hover span {
    background: #f8fafc;
}

.status-option-present input:checked + span {
    border-color: #86efac;
    background: #ecfdf5;
    color: #15803d;
}

.status-option-absent input:checked + span {
    border-color: #fca5a5;
    background: #fef2f2;
    color: #dc2626;
}

.status-option-late input:checked + span {
    border-color: #fcd34d;
    background: #fffbeb;
    color: #b45309;
}

.status-option-excused input:checked + span {
    border-color: #93c5fd;
    background: #eff6ff;
    color: #2563eb;
}

@media (max-width: 1050px) {
    .teacher-attendance-stats,
    .teacher-grade-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .teacher-attendance-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    .teacher-attendance-stats,
    .teacher-grade-stats {
        grid-template-columns: 1fr;
    }

    .teacher-status-selector {
        grid-template-columns: repeat(2, 1fr);
    }
}
.teacher-topic-stats,
.teacher-schedule-stats,
.teacher-salary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 22px;
}

.teacher-topic-stat,
.teacher-schedule-stat,
.teacher-salary-card {
    display: flex;
    align-items: center;
    gap: 13px;
    min-height: 105px;
    padding: 18px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: white;
    box-shadow:
        0 4px 16px
        rgba(15, 23, 42, .04);
}

.teacher-topic-stat-icon,
.teacher-schedule-stat-icon,
.teacher-salary-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 11px;
    font-size: 19px;
    font-weight: 800;
}

.teacher-topic-stat > div:last-child,
.teacher-schedule-stat > div:last-child,
.teacher-salary-card > div:last-child {
    display: flex;
    flex-direction: column;
}

.teacher-topic-stat span,
.teacher-schedule-stat span,
.teacher-salary-card span {
    color: #9ca3af;
    font-size: 10px;
}

.teacher-topic-stat strong,
.teacher-schedule-stat strong,
.teacher-salary-card strong {
    margin-top: 2px;
    color: #111827;
    font-size: 22px;
}

.teacher-salary-card small {
    margin-top: 3px;
    color: #9ca3af;
    font-size: 9px;
}

.topic-total {
    background: #eef2ff;
    color: #4f46e5;
}

.topic-complete {
    background: #ecfdf5;
    color: #059669;
}

.topic-pending {
    background: #fef2f2;
    color: #dc2626;
}

.topic-subjects {
    background: #fff7ed;
    color: #ea580c;
}

.teacher-topic-text {
    max-width: 320px;
    color: #374151;
    font-size: 12px;
    line-height: 1.5;
}

.topic-form-icon {
    background: #fff7ed;
    color: #ea580c;
}

.topic-edit-layout {
    display: grid;
    grid-template-columns:
        minmax(0, 1.7fr)
        minmax(280px, .8fr);
    gap: 20px;
    align-items: start;
}

.teacher-topic-textarea {
    min-height: 155px;
    resize: vertical;
}

.teacher-topic-info-card {
    padding: 20px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: white;
}

.teacher-topic-info-title {
    margin-bottom: 15px;
    color: #111827;
    font-size: 15px;
    font-weight: 700;
}

.teacher-topic-info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
}

.teacher-topic-info-row:last-child {
    border-bottom: 0;
}

.teacher-topic-info-row span {
    color: #9ca3af;
    font-size: 11px;
}

.teacher-topic-info-row strong {
    color: #374151;
    font-size: 12px;
    text-align: right;
}

.schedule-lessons {
    background: #eef2ff;
    color: #4f46e5;
}

.schedule-groups {
    background: #ecfdf5;
    color: #059669;
}

.schedule-subjects {
    background: #fff7ed;
    color: #ea580c;
}

.schedule-days {
    background: #fdf2f8;
    color: #db2777;
}

.teacher-week {
    display: flex;
    flex-direction: column;
    gap: 17px;
}

.teacher-schedule-day {
    overflow: hidden;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: white;
    box-shadow:
        0 4px 16px
        rgba(15, 23, 42, .035);
}

.teacher-schedule-day-header {
    padding: 15px 19px;
    border-bottom: 1px solid #e5e7eb;
    background: #f8fafc;
}

.teacher-schedule-day-name {
    color: #111827;
    font-size: 15px;
    font-weight: 750;
}

.teacher-schedule-day-date,
.parent-schedule-day-date {
    margin-left: 8px;
    color: #94a3b8;
    font-size: 12px;
    font-weight: 500;
}

.teacher-schedule-day-count {
    margin-top: 2px;
    color: #9ca3af;
    font-size: 10px;
}

.teacher-schedule-day-body {
    padding: 4px 18px;
}

.teacher-schedule-item {
    display: grid;
    grid-template-columns:
        70px
        4px
        minmax(180px, 1fr)
        minmax(130px, auto)
        minmax(100px, auto);
    align-items: center;
    gap: 15px;
    min-height: 78px;
    border-bottom: 1px solid #f1f5f9;
}

.teacher-schedule-item:last-child {
    border-bottom: 0;
}

.teacher-schedule-time {
    display: flex;
    flex-direction: column;
}

.teacher-schedule-time strong {
    color: #111827;
    font-size: 14px;
}

.teacher-schedule-time span {
    margin-top: 2px;
    color: #9ca3af;
    font-size: 10px;
}

.teacher-schedule-line {
    width: 3px;
    height: 38px;
    border-radius: 4px;
    background: #4f46e5;
}

.teacher-schedule-main {
    display: flex;
    flex-direction: column;
}

.teacher-schedule-subject {
    color: #111827;
    font-size: 13px;
    font-weight: 700;
}

.teacher-schedule-group {
    margin-top: 3px;
    color: #9ca3af;
    font-size: 10px;
}

.teacher-salary-filter-card {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 25px;
    padding: 19px 21px;
    margin-bottom: 20px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: white;
}

.teacher-salary-period-label {
    color: #9ca3af;
    font-size: 10px;
}

.teacher-salary-period {
    margin-top: 3px;
    color: #111827;
    font-size: 19px;
    font-weight: 750;
}

.teacher-salary-filter {
    display: flex;
    align-items: flex-end;
    gap: 9px;
}

.teacher-salary-filter > div {
    display: flex;
    flex-direction: column;
}

.teacher-salary-filter label {
    margin-bottom: 5px;
    color: #6b7280;
    font-size: 10px;
    font-weight: 650;
}

.teacher-salary-filter .form-select {
    min-width: 135px;
}

.salary-lessons-icon {
    background: #eef2ff;
    color: #4f46e5;
}

.salary-hours-icon {
    background: #fff7ed;
    color: #ea580c;
}

.salary-rate-icon {
    background: #fdf2f8;
    color: #db2777;
}

.salary-total-icon {
    background: #ecfdf5;
    color: #059669;
}

.teacher-salary-total-card {
    border-color: #a7f3d0;
    background: #f7fffb;
}

.teacher-salary-total-card strong {
    color: #047857;
}

.teacher-salary-calculation {
    padding: 22px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: white;
    box-shadow:
        0 4px 16px
        rgba(15, 23, 42, .035);
}

.teacher-salary-calculation-title {
    margin-bottom: 20px;
    color: #111827;
    font-size: 15px;
    font-weight: 700;
}

.teacher-salary-formula {
    display: flex;
    align-items: center;
    gap: 18px;
}

.teacher-formula-item {
    min-width: 150px;
    padding: 16px;
    border-radius: 11px;
    background: #f8fafc;
}

.teacher-formula-item span {
    display: block;
    color: #9ca3af;
    font-size: 10px;
}

.teacher-formula-item strong {
    display: block;
    margin-top: 4px;
    color: #111827;
    font-size: 20px;
}

.teacher-formula-symbol {
    color: #9ca3af;
    font-size: 22px;
    font-weight: 700;
}

.teacher-formula-result {
    background: #ecfdf5;
}

.teacher-formula-result strong {
    color: #047857;
}

@media (max-width: 1050px) {
    .teacher-topic-stats,
    .teacher-schedule-stats,
    .teacher-salary-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .topic-edit-layout {
        grid-template-columns: 1fr;
    }

    .teacher-schedule-item {
        grid-template-columns:
            65px
            4px
            1fr;
    }

    .teacher-schedule-item > div:nth-child(4),
    .teacher-schedule-item > div:nth-child(5) {
        display: none;
    }
}

@media (max-width: 700px) {
    .teacher-topic-stats,
    .teacher-schedule-stats,
    .teacher-salary-grid {
        grid-template-columns: 1fr;
    }

    .teacher-salary-filter-card {
        align-items: stretch;
        flex-direction: column;
    }

    .teacher-salary-filter {
        align-items: stretch;
        flex-direction: column;
    }

    .teacher-salary-filter .form-select {
        width: 100%;
    }

    .teacher-salary-formula {
        align-items: stretch;
        flex-direction: column;
    }

    .teacher-formula-symbol {
        text-align: center;
    }

    .teacher-formula-item {
        width: 100%;
    }
}
.parent-dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}

.parent-welcome-label {
    margin-bottom: 4px;
    color: #db2777;
    font-size: 11px;
    font-weight: 750;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.parent-summary-bar {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    overflow: hidden;
    margin-bottom: 20px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #e5e7eb;
}

.parent-summary-bar > div {
    display: flex;
    flex-direction: column;
    padding: 18px 20px;
    background: white;
}

.parent-summary-bar span {
    color: #9ca3af;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.parent-summary-bar strong {
    margin-top: 3px;
    color: #111827;
    font-size: 23px;
}

.parent-children-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.parent-child-card {
    overflow: hidden;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    background: white;
    box-shadow:
        0 4px 18px
        rgba(15, 23, 42, .045);
}

.parent-child-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 20px;
    border-bottom: 1px solid #f1f5f9;
}

.parent-child-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.parent-child-avatar {
    width: 47px;
    height: 47px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 13px;
    background: #fdf2f8;
    color: #db2777;
    font-size: 16px;
    font-weight: 800;
}

.parent-child-profile h4 {
    margin: 0;
    color: #111827;
    font-size: 16px;
    font-weight: 750;
}

.parent-child-profile span {
    display: block;
    margin-top: 3px;
    color: #9ca3af;
    font-size: 11px;
}

.parent-profile-link {
    color: #4f46e5;
    font-size: 11px;
    font-weight: 650;
    text-decoration: none;
}

.parent-child-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 18px 20px;
}

.parent-child-stat {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 13px;
    border-radius: 11px;
    background: #f8fafc;
}

.parent-child-stat-icon,
.parent-student-stat-icon {
    width: 39px;
    height: 39px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 10px;
    font-size: 17px;
    font-weight: 800;
}

.parent-child-stat > div:last-child,
.parent-student-stat > div:last-child {
    display: flex;
    flex-direction: column;
}

.parent-child-stat span,
.parent-student-stat span {
    color: #9ca3af;
    font-size: 9px;
}

.parent-child-stat strong,
.parent-student-stat strong {
    margin-top: 1px;
    color: #111827;
    font-size: 19px;
}

.parent-student-stat small {
    margin-top: 2px;
    color: #9ca3af;
    font-size: 9px;
}

.parent-attendance-icon {
    background: #ecfdf5;
    color: #059669;
}

.parent-grade-icon {
    background: #eef2ff;
    color: #4f46e5;
}

.parent-lessons-icon {
    background: #fff7ed;
    color: #ea580c;
}

.parent-age-icon {
    background: #fdf2f8;
    color: #db2777;
}

.parent-missed-alert {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 20px 18px;
    padding: 12px 14px;
    border-radius: 10px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
    font-size: 13px;
    font-weight: 600;
}

.parent-card-section {
    padding: 0 20px 18px;
}

.parent-card-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.parent-card-section-header > span {
    color: #6b7280;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.parent-card-section-header a {
    color: #4f46e5;
    font-size: 10px;
    text-decoration: none;
}

.parent-recent-grades {
    display: flex;
    flex-direction: column;
}

.parent-recent-grade {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 46px;
    border-bottom: 1px solid #f1f5f9;
}

.parent-recent-grade:last-child {
    border-bottom: 0;
}

.parent-recent-grade > div {
    display: flex;
    flex-direction: column;
}

.parent-recent-grade strong {
    color: #374151;
    font-size: 11px;
}

.parent-recent-grade div span {
    margin-top: 2px;
    color: #9ca3af;
    font-size: 9px;
}

.parent-no-grades {
    padding: 16px;
    border-radius: 9px;
    background: #f8fafc;
    color: #9ca3af;
    font-size: 11px;
    text-align: center;
}

.parent-child-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    border-top: 1px solid #e5e7eb;
    background: #e5e7eb;
}

.parent-child-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 52px;
    background: #fff;
    color: #475569;
    font-size: 10px;
    font-weight: 650;
    text-decoration: none;
    transition: .15s;
}

.parent-child-action:hover {
    background: #fafaff;
    color: #4f46e5;
}

.parent-action-icon {
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 800;
}

.parent-action-schedule {
    background: #fff7ed;
    color: #ea580c;
}

.parent-action-grades {
    background: #eef2ff;
    color: #4f46e5;
}

.parent-action-attendance {
    background: #ecfdf5;
    color: #059669;
}

.parent-action-progress {
    background: #fdf2f8;
    color: #db2777;
}

.parent-action-subject {
    background: #fff7ed;
    color: #c2410c;
}

.parent-action-topic {
    background: #eff6ff;
    color: #2563eb;
}

.parent-empty {
    min-height: 330px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.parent-empty-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    border-radius: 16px;
    background: #fdf2f8;
    color: #db2777;
    font-size: 26px;
    font-weight: 800;
}

.parent-empty h5 {
    margin-bottom: 5px;
    color: #111827;
    font-weight: 700;
}

.parent-empty p {
    margin: 0;
    color: #9ca3af;
    font-size: 12px;
}

.parent-child-details-header {
    margin-bottom: 24px;
}

.parent-student-profile {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 17px;
}

.parent-student-avatar {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 17px;
    background: #fdf2f8;
    color: #db2777;
    font-size: 21px;
    font-weight: 800;
}

.parent-student-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    color: #9ca3af;
    font-size: 10px;
}

.parent-student-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 22px;
}

.parent-student-stat {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 105px;
    padding: 17px;
    border: 1px solid #e5e7eb;
    border-radius: 13px;
    background: white;
    box-shadow:
        0 4px 16px
        rgba(15, 23, 42, .04);
}

.parent-details-grid {
    display: grid;
    grid-template-columns:
        minmax(280px, .8fr)
        minmax(0, 1.5fr);
    gap: 20px;
    align-items: start;
}

.parent-info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 14px 0;
    border-bottom: 1px solid #f1f5f9;
}

.parent-info-row:last-child {
    border-bottom: 0;
}

.parent-info-row span {
    color: #9ca3af;
    font-size: 11px;
}

.parent-info-row strong {
    color: #374151;
    font-size: 12px;
    text-align: right;
}

.parent-access-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.parent-access-card {
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 67px;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    color: #111827;
    text-decoration: none;
    transition: .15s;
}

.parent-access-card:hover {
    border-color: #c7d2fe;
    background: #fafaff;
    color: #111827;
}

.parent-access-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 9px;
    font-size: 16px;
    font-weight: 800;
}

.parent-access-card > div:nth-child(2) {
    display: flex;
    flex-direction: column;
}

.parent-access-card strong {
    font-size: 11px;
}

.parent-access-card span {
    margin-top: 2px;
    color: #9ca3af;
    font-size: 9px;
}

.parent-access-arrow {
    margin-left: auto;
    color: #cbd5e1;
}

@media (max-width: 1100px) {
    .parent-children-grid {
        grid-template-columns: 1fr;
    }

    .parent-student-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 800px) {
    .parent-dashboard-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .parent-summary-bar {
        grid-template-columns: 1fr;
    }

    .parent-details-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .parent-child-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .parent-child-stats {
        grid-template-columns: 1fr;
    }

    .parent-child-actions {
        grid-template-columns: repeat(2, 1fr);
    }

    .parent-student-stats {
        grid-template-columns: 1fr;
    }

    .parent-access-grid {
        grid-template-columns: 1fr;
    }
}
.parent-grade-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 22px;
}

.parent-grade-stat {
    display: flex;
    align-items: center;
    gap: 13px;
    min-height: 105px;
    padding: 18px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: white;
    box-shadow:
        0 4px 16px
        rgba(15, 23, 42, .04);
}

.parent-grade-stat-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 11px;
    font-size: 19px;
    font-weight: 800;
}

.parent-grade-stat > div:last-child {
    display: flex;
    flex-direction: column;
}

.parent-grade-stat span {
    color: #9ca3af;
    font-size: 10px;
}

.parent-grade-stat strong {
    margin-top: 2px;
    color: #111827;
    font-size: 22px;
}

.parent-grade-average {
    background: #eef2ff;
    color: #4f46e5;
}

.parent-grade-total {
    background: #ecfdf5;
    color: #059669;
}

.parent-grade-high {
    background: #fff7ed;
    color: #ea580c;
}

.parent-grade-subjects {
    background: #fdf2f8;
    color: #db2777;
}

.parent-subject-average-grid {
    display: grid;
    grid-template-columns:
        repeat(auto-fit, minmax(180px, 1fr));
    gap: 11px;
}

.parent-subject-average-card {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 13px;
    border: 1px solid #e5e7eb;
    border-radius: 11px;
    background: #fafafa;
}

.parent-subject-average-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 9px;
    background: #fff7ed;
    color: #ea580c;
    font-size: 16px;
    font-weight: 800;
}

.parent-subject-average-card > div:last-child {
    display: flex;
    flex-direction: column;
}

.parent-subject-average-card span {
    color: #6b7280;
    font-size: 10px;
}

.parent-subject-average-card strong {
    margin-top: 2px;
    color: #111827;
    font-size: 18px;
}

.parent-small-empty {
    padding: 22px;
    border: 1px dashed #d1d5db;
    border-radius: 10px;
    color: #9ca3af;
    text-align: center;
    font-size: 11px;
}

.parent-attendance-overview {
    display: grid;
    grid-template-columns:
        minmax(300px, 1fr)
        minmax(0, 1.5fr);
    gap: 17px;
    margin-bottom: 22px;
}

.parent-attendance-main-card {
    display: flex;
    align-items: center;
    gap: 20px;
    min-height: 165px;
    padding: 22px;
    border: 1px solid #a7f3d0;
    border-radius: 15px;
    background: #f7fffb;
}

.parent-attendance-circle {
    width: 95px;
    height: 95px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 8px solid #d1fae5;
    border-top-color: #10b981;
    border-radius: 50%;
}

.parent-attendance-circle > div {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.parent-attendance-circle strong {
    color: #047857;
    font-size: 19px;
}

.parent-attendance-circle span {
    color: #6b7280;
    font-size: 8px;
}

.parent-attendance-main-info {
    display: flex;
    flex-direction: column;
}

.parent-attendance-main-info > span {
    color: #6b7280;
    font-size: 11px;
}

.parent-attendance-main-info strong {
    margin-top: 3px;
    color: #047857;
    font-size: 30px;
}

.parent-attendance-main-info small {
    margin-top: 4px;
    color: #9ca3af;
    font-size: 9px;
}

.parent-attendance-mini-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.parent-attendance-mini {
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 75px;
    padding: 14px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: white;
}

.parent-attendance-mini-icon {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 9px;
    font-size: 17px;
    font-weight: 800;
}

.parent-attendance-mini > div:last-child {
    display: flex;
    flex-direction: column;
}

.parent-attendance-mini span {
    color: #9ca3af;
    font-size: 9px;
}

.parent-attendance-mini strong {
    margin-top: 1px;
    color: #111827;
    font-size: 18px;
}

.parent-progress-student {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: 6px;
}

.parent-progress-student strong {
    color: #374151;
    font-size: 13px;
}

.parent-progress-hero {
    display: grid;
    grid-template-columns:
        1fr
        1px
        1fr;
    align-items: center;
    margin-bottom: 18px;
    padding: 25px;
    border: 1px solid #e5e7eb;
    border-radius: 15px;
    background: white;
    box-shadow:
        0 4px 16px
        rgba(15, 23, 42, .04);
}

.parent-progress-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.parent-progress-score-label {
    color: #9ca3af;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.parent-progress-score-value {
    margin-top: 5px;
    color: #111827;
    font-size: 36px;
    font-weight: 800;
}

.parent-progress-score-detail {
    margin-top: 3px;
    color: #9ca3af;
    font-size: 9px;
}

.parent-progress-divider {
    width: 1px;
    height: 70px;
    background: #e5e7eb;
}

.parent-progress-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 22px;
}

.parent-progress-stat {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 90px;
    padding: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: white;
}

.parent-progress-stat-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 10px;
    font-size: 17px;
    font-weight: 800;
}

.parent-progress-stat > div:last-child {
    display: flex;
    flex-direction: column;
}

.parent-progress-stat span {
    color: #9ca3af;
    font-size: 9px;
}

.parent-progress-stat strong {
    margin-top: 1px;
    color: #111827;
    font-size: 20px;
}

.progress-present {
    background: #ecfdf5;
    color: #059669;
}

.progress-late {
    background: #fffbeb;
    color: #d97706;
}

.progress-absent {
    background: #fef2f2;
    color: #dc2626;
}

.progress-excused {
    background: #eff6ff;
    color: #2563eb;
}

.parent-progress-subjects {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.parent-progress-subject {
    padding: 15px 0;
    border-bottom: 1px solid #f1f5f9;
}

.parent-progress-subject:last-child {
    border-bottom: 0;
}

.parent-progress-subject-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 10px;
}

.parent-progress-subject-header > div:first-child {
    display: flex;
    flex-direction: column;
}

.parent-progress-subject-header strong {
    color: #111827;
    font-size: 13px;
}

.parent-progress-subject-header span {
    margin-top: 2px;
    color: #9ca3af;
    font-size: 9px;
}

.parent-progress-subject-score {
    color: #4f46e5;
    font-size: 18px;
    font-weight: 750;
}

.parent-progress-subject-score span {
    color: #9ca3af;
    font-size: 9px;
    font-weight: 500;
}

.parent-progress-bar {
    width: 100%;
    height: 7px;
    overflow: hidden;
    border-radius: 20px;
    background: #f1f5f9;
}

.parent-progress-bar-value {
    height: 100%;
    border-radius: 20px;
    background: #4f46e5;
}

@media (max-width: 1050px) {
    .parent-grade-stats,
    .parent-progress-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .parent-attendance-overview {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 650px) {
    .parent-grade-stats,
    .parent-progress-stats {
        grid-template-columns: 1fr;
    }

    .parent-attendance-mini-grid {
        grid-template-columns: 1fr;
    }

    .parent-attendance-main-card {
        align-items: flex-start;
        flex-direction: column;
    }

    .parent-progress-hero {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .parent-progress-divider {
        width: 100%;
        height: 1px;
    }
}
.parent-schedule-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 22px;
}

.parent-schedule-stat {
    display: flex;
    align-items: center;
    gap: 13px;
    min-height: 100px;
    padding: 17px;
    border: 1px solid #e5e7eb;
    border-radius: 13px;
    background: white;
    box-shadow:
        0 4px 16px
        rgba(15, 23, 42, .04);
}

.parent-schedule-stat-icon {
    width: 43px;
    height: 43px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 11px;
    font-size: 19px;
    font-weight: 800;
}

.parent-schedule-stat > div:last-child {
    display: flex;
    flex-direction: column;
}

.parent-schedule-stat span {
    color: #9ca3af;
    font-size: 9px;
}

.parent-schedule-stat strong {
    margin-top: 2px;
    color: #111827;
    font-size: 21px;
}

.parent-schedule-lessons {
    background: #eef2ff;
    color: #4f46e5;
}

.parent-schedule-subjects {
    background: #fff7ed;
    color: #ea580c;
}

.parent-schedule-teachers {
    background: #ecfdf5;
    color: #059669;
}

.parent-schedule-days {
    background: #fdf2f8;
    color: #db2777;
}

.parent-week-schedule {
    display: flex;
    flex-direction: column;
    gap: 17px;
}

.parent-schedule-day {
    overflow: hidden;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: white;
    box-shadow:
        0 4px 16px
        rgba(15, 23, 42, .035);
}

.parent-schedule-day-header {
    padding: 15px 19px;
    border-bottom: 1px solid #e5e7eb;
    background: #f8fafc;
}

.parent-schedule-day-header > div {
    display: flex;
    flex-direction: column;
}

.parent-schedule-day-header strong {
    color: #111827;
    font-size: 15px;
}

.parent-schedule-day-header span {
    margin-top: 2px;
    color: #9ca3af;
    font-size: 9px;
}

.parent-schedule-day-body {
    padding: 3px 18px;
}

.parent-schedule-row {
    display: grid;
    grid-template-columns:
        70px
        3px
        minmax(150px, 1fr)
        minmax(120px, auto)
        minmax(190px, auto);
    align-items: center;
    gap: 15px;
    min-height: 80px;
    border-bottom: 1px solid #f1f5f9;
}

.parent-schedule-row:last-child {
    border-bottom: 0;
}

.parent-schedule-time {
    display: flex;
    flex-direction: column;
}

.parent-schedule-time strong {
    color: #111827;
    font-size: 14px;
}

.parent-schedule-time span {
    margin-top: 2px;
    color: #9ca3af;
    font-size: 10px;
}

.parent-schedule-marker {
    width: 3px;
    height: 40px;
    border-radius: 10px;
    background: #db2777;
}

.parent-schedule-info {
    display: flex;
    flex-direction: column;
}

.parent-schedule-info strong {
    color: #111827;
    font-size: 12px;
}

.parent-schedule-info span {
    margin-top: 2px;
    color: #9ca3af;
    font-size: 9px;
}

.parent-schedule-teacher {
    display: flex;
    align-items: center;
    gap: 8px;
}

.parent-schedule-teacher > div:last-child {
    display: flex;
    flex-direction: column;
}

.parent-schedule-teacher span {
    color: #9ca3af;
    font-size: 8px;
}

.parent-schedule-teacher strong {
    margin-top: 1px;
    color: #374151;
    font-size: 10px;
    font-weight: 650;
}

.parent-subject-summary {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.parent-subject-summary > div {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 200px;
    padding: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: white;
}

.parent-subject-summary-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 10px;
    background: #fff7ed;
    color: #ea580c;
    font-size: 17px;
    font-weight: 800;
}

.parent-subject-teacher-icon {
    background: #ecfdf5;
    color: #059669;
}

.parent-subject-summary > div > div:last-child {
    display: flex;
    flex-direction: column;
}

.parent-subject-summary span {
    color: #9ca3af;
    font-size: 9px;
}

.parent-subject-summary strong {
    color: #111827;
    font-size: 20px;
}

.parent-subject-grid {
    display: grid;
    grid-template-columns:
        repeat(3, minmax(0, 1fr));
    gap: 17px;
}

.parent-subject-card {
    padding: 20px;
    border: 1px solid #e5e7eb;
    border-radius: 15px;
    background: white;
    box-shadow:
        0 4px 16px
        rgba(15, 23, 42, .04);
}

.parent-subject-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.parent-subject-card-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    background: #fff7ed;
    color: #ea580c;
    font-size: 19px;
    font-weight: 800;
}

.parent-subject-card-badge {
    padding: 5px 9px;
    border-radius: 7px;
    background: #f8fafc;
    color: #9ca3af;
    font-size: 8px;
    font-weight: 650;
    text-transform: uppercase;
}

.parent-subject-card h4 {
    margin: 18px 0 3px;
    color: #111827;
    font-size: 17px;
    font-weight: 750;
}

.parent-subject-card > p {
    margin: 0;
    color: #9ca3af;
    font-size: 10px;
}

.parent-subject-teachers {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 18px;
    padding-top: 15px;
    border-top: 1px solid #f1f5f9;
}

.parent-subject-teachers-title {
    margin-bottom: 2px;
    color: #9ca3af;
    font-size: 8px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.parent-subject-teacher {
    display: flex;
    align-items: center;
    gap: 8px;
}

.parent-subject-teacher span {
    color: #374151;
    font-size: 10px;
    font-weight: 600;
}

.parent-topic-stats {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(180px, 1fr))
        minmax(240px, 1.3fr);
    gap: 15px;
    margin-bottom: 22px;
}

.parent-topic-stat {
    display: flex;
    align-items: center;
    gap: 13px;
    min-height: 100px;
    padding: 17px;
    border: 1px solid #e5e7eb;
    border-radius: 13px;
    background: white;
}

.parent-topic-stat-icon {
    width: 43px;
    height: 43px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 11px;
    font-size: 19px;
    font-weight: 800;
}

.parent-topic-stat > div:last-child {
    display: flex;
    flex-direction: column;
}

.parent-topic-stat span {
    color: #9ca3af;
    font-size: 9px;
}

.parent-topic-stat strong {
    margin-top: 2px;
    color: #111827;
    font-size: 20px;
}

.parent-topic-total {
    background: #eff6ff;
    color: #2563eb;
}

.parent-topic-subject {
    background: #fff7ed;
    color: #ea580c;
}

.parent-topic-date {
    background: #fdf2f8;
    color: #db2777;
}

.parent-topic-latest-text {
    font-size: 15px !important;
}

.parent-topic-timeline {
    display: flex;
    flex-direction: column;
}

.parent-topic-row {
    display: grid;
    grid-template-columns:
        52px
        20px
        minmax(0, 1fr);
    gap: 12px;
}

.parent-topic-date-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 15px;
}

.parent-topic-date-box strong {
    color: #111827;
    font-size: 18px;
}

.parent-topic-date-box span {
    color: #9ca3af;
    font-size: 9px;
    text-transform: uppercase;
}

.parent-topic-line {
    position: relative;
    display: flex;
    justify-content: center;
}

.parent-topic-line::after {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e5e7eb;
    content: "";
}

.parent-topic-dot {
    position: relative;
    z-index: 1;
    width: 10px;
    height: 10px;
    margin-top: 22px;
    border: 2px solid white;
    border-radius: 50%;
    background: #db2777;
    box-shadow: 0 0 0 2px #fbcfe8;
}

.parent-topic-content {
    margin-bottom: 14px;
    padding: 15px 17px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fafafa;
}

.parent-topic-content-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.parent-topic-full-date {
    color: #9ca3af;
    font-size: 9px;
}

.parent-topic-content h5 {
    margin: 12px 0 4px;
    color: #111827;
    font-size: 13px;
    line-height: 1.5;
    font-weight: 650;
}

.parent-topic-time {
    color: #9ca3af;
    font-size: 9px;
}

@media (max-width: 1100px) {
    .parent-schedule-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .parent-subject-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .parent-schedule-row {
        grid-template-columns:
            65px
            3px
            1fr
            auto;
    }

    .parent-schedule-teacher {
        grid-column: 3 / -1;
        padding-bottom: 12px;
    }
}

@media (max-width: 700px) {
    .parent-schedule-stats,
    .parent-topic-stats {
        grid-template-columns: 1fr;
    }

    .parent-subject-grid {
        grid-template-columns: 1fr;
    }

    .parent-subject-summary {
        flex-direction: column;
    }

    .parent-subject-summary > div {
        width: 100%;
    }

    .parent-schedule-row {
        grid-template-columns:
            55px
            3px
            1fr;
        gap: 10px;
        padding: 12px 0;
    }

    .parent-schedule-row > div:nth-child(4) {
        display: none;
    }

    .parent-schedule-teacher {
        grid-column: 3;
    }

    .parent-topic-content-header {
        align-items: flex-start;
        flex-direction: column;
    }
}
.theme-toggle {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0;
    border: 1px solid #e5e7eb;
    border-radius: 11px;
    background: white;
    cursor: pointer;
    font-size: 17px;
    transition:
        background .2s ease,
        border-color .2s ease,
        transform .2s ease;
}

.theme-toggle:hover {
    background: #f8fafc;
    transform: translateY(-1px);
}

html,
body,
.topbar,
.page-content,
.card,
.form-card,
.management-table,
.form-control,
.form-select {
    transition:
        background-color .2s ease,
        border-color .2s ease,
        color .2s ease;
}

html[data-theme="dark"] {
    color-scheme: dark;
}

html[data-theme="dark"] body {
    background: #0b1120;
    color: #e5e7eb;
}

html[data-theme="dark"] .main-wrapper {
    background: #0b1120;
}

html[data-theme="dark"] .page-content {
    background: #0b1120;
}

html[data-theme="dark"] .topbar {
    border-color: #253047;
    background: #111827;
}

html[data-theme="dark"] .topbar-title h4 {
    color: #f8fafc;
}

html[data-theme="dark"] .user-info strong {
    color: #f8fafc;
}

html[data-theme="dark"] .user-info span {
    color: #94a3b8;
}

html[data-theme="dark"] .user-avatar {
    background: #312e81;
    color: #c7d2fe;
}

html[data-theme="dark"] .theme-toggle {
    border-color: #334155;
    background: #1e293b;
}

html[data-theme="dark"] .theme-toggle:hover {
    background: #334155;
}

html[data-theme="dark"] .logout-btn {
    border-color: #7f1d1d;
    background: transparent;
    color: #f87171;
}

html[data-theme="dark"] .logout-btn:hover {
    background: #450a0a;
}

html[data-theme="dark"] .page-title,
html[data-theme="dark"] .dashboard-title,
html[data-theme="dark"] .section-title,
html[data-theme="dark"] .person-name {
    color: #f8fafc;
}

html[data-theme="dark"] .page-subtitle,
html[data-theme="dark"] .dashboard-subtitle,
html[data-theme="dark"] .section-subtitle,
html[data-theme="dark"] .person-id,
html[data-theme="dark"] .record-time {
    color: #94a3b8;
}

html[data-theme="dark"] .card,
html[data-theme="dark"] .form-card,
html[data-theme="dark"] .teacher-quick-card,
html[data-theme="dark"] .teacher-group-card,
html[data-theme="dark"] .teacher-info-stat,
html[data-theme="dark"] .teacher-student-stat,
html[data-theme="dark"] .teacher-attendance-stat,
html[data-theme="dark"] .teacher-grade-stat,
html[data-theme="dark"] .teacher-topic-stat,
html[data-theme="dark"] .teacher-schedule-stat,
html[data-theme="dark"] .teacher-salary-card,
html[data-theme="dark"] .teacher-topic-info-card,
html[data-theme="dark"] .teacher-schedule-day,
html[data-theme="dark"] .teacher-salary-filter-card,
html[data-theme="dark"] .teacher-salary-calculation,
html[data-theme="dark"] .parent-child-card,
html[data-theme="dark"] .parent-student-stat,
html[data-theme="dark"] .parent-grade-stat,
html[data-theme="dark"] .parent-attendance-main-card,
html[data-theme="dark"] .parent-attendance-mini,
html[data-theme="dark"] .parent-progress-hero,
html[data-theme="dark"] .parent-progress-stat,
html[data-theme="dark"] .parent-schedule-stat,
html[data-theme="dark"] .parent-schedule-day,
html[data-theme="dark"] .parent-subject-card,
html[data-theme="dark"] .parent-topic-stat,
html[data-theme="dark"] .parent-topic-content {
    border-color: #253047 !important;
    background: #111827 !important;
    color: #e5e7eb;
    box-shadow:
        0 4px 18px
        rgba(0, 0, 0, .18);
}

html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .attendance-stat,
html[data-theme="dark"] .grade-stat,
html[data-theme="dark"] .salary-stat {
    border-color: #253047;
    background: #111827;
}

html[data-theme="dark"] .stat-number,
html[data-theme="dark"] .attendance-stat-value,
html[data-theme="dark"] .grade-stat-value,
html[data-theme="dark"] .salary-stat-value {
    color: #f8fafc;
}

html[data-theme="dark"] .stat-label,
html[data-theme="dark"] .stat-link,
html[data-theme="dark"] .attendance-stat-label,
html[data-theme="dark"] .grade-stat-label,
html[data-theme="dark"] .salary-stat-label {
    color: #94a3b8;
}

html[data-theme="dark"] .form-card-header h5 {
    color: #f8fafc;
}

html[data-theme="dark"] .teacher-stat-card {
    border-color: #253047;
    background: #111827;
    color: #f8fafc;
}

html[data-theme="dark"] .teacher-stat-card:hover {
    border-color: #4f46e5;
    background: #172033;
    color: #f8fafc;
}

html[data-theme="dark"] .teacher-stat-number,
html[data-theme="dark"] .teacher-stat-card strong {
    color: #f8fafc;
}

html[data-theme="dark"] .teacher-stat-label,
html[data-theme="dark"] .teacher-stat-link {
    color: #94a3b8;
}

html[data-theme="dark"] .teacher-quick-action,
html[data-theme="dark"] .parent-access-card {
    border-color: #334155;
    background: #172033;
    color: #f8fafc;
}

html[data-theme="dark"] .teacher-quick-action:hover,
html[data-theme="dark"] .parent-access-card:hover {
    border-color: #6366f1;
    background: #1e293b;
    color: #f8fafc;
}

html[data-theme="dark"] .teacher-quick-action strong,
html[data-theme="dark"] .parent-access-card strong {
    color: #f8fafc;
}

html[data-theme="dark"] .teacher-group-name,
html[data-theme="dark"] .teacher-lesson-title,
html[data-theme="dark"] .teacher-schedule-subject,
html[data-theme="dark"] .parent-child-profile h4,
html[data-theme="dark"] .parent-subject-card h4,
html[data-theme="dark"] .parent-topic-content h5 {
    color: #f8fafc;
}

html[data-theme="dark"] .teacher-group-subtitle,
html[data-theme="dark"] .teacher-lesson-time span,
html[data-theme="dark"] .teacher-schedule-group,
html[data-theme="dark"] .parent-child-profile span,
html[data-theme="dark"] .parent-subject-card p,
html[data-theme="dark"] .parent-topic-time {
    color: #94a3b8;
}

html[data-theme="dark"] .teacher-student-summary {
    border-color: #253047;
}

html[data-theme="dark"] .teacher-student-summary strong {
    color: #f8fafc;
}

html[data-theme="dark"] .teacher-student-summary span {
    color: #94a3b8;
}

html[data-theme="dark"] .teacher-schedule-day-header,
html[data-theme="dark"] .parent-schedule-day-header {
    border-color: #253047;
    background: #172033;
}

html[data-theme="dark"] .teacher-schedule-day-name,
html[data-theme="dark"] .parent-schedule-day-header strong {
    color: #f8fafc;
}

html[data-theme="dark"] .teacher-schedule-item,
html[data-theme="dark"] .parent-schedule-row,
html[data-theme="dark"] .teacher-attendance-row {
    border-color: #253047;
}

html[data-theme="dark"] .teacher-attendance-student strong {
    color: #f8fafc;
}

html[data-theme="dark"] .teacher-status-option span {
    border-color: #334155;
    background: #172033;
    color: #cbd5e1;
}

html[data-theme="dark"] .teacher-status-option:hover span {
    background: #1e293b;
}

html[data-theme="dark"] .topic-edit-layout .form-card {
    background: #111827;
}

html[data-theme="dark"] .teacher-topic-info-row {
    border-color: #253047;
}

html[data-theme="dark"] .teacher-topic-info-title,
html[data-theme="dark"] .teacher-topic-info-row strong {
    color: #f8fafc;
}

html[data-theme="dark"] .salary-period {
    border-color: #253047;
    background: #111827;
}

html[data-theme="dark"] .salary-period-value {
    color: #f8fafc;
}

html[data-theme="dark"] .salary-total {
    color: #a5b4fc;
}

html[data-theme="dark"] .parent-summary-bar {
    border-color: #253047;
    background: #253047;
}

html[data-theme="dark"] .parent-summary-bar > div {
    background: #111827;
}

html[data-theme="dark"] .parent-summary-bar strong {
    color: #f8fafc;
}

html[data-theme="dark"] .parent-child-header {
    border-color: #253047;
}

html[data-theme="dark"] .parent-child-stat {
    background: #172033;
}

html[data-theme="dark"] .parent-child-stat strong {
    color: #f8fafc;
}

html[data-theme="dark"] .parent-card-section-header > span {
    color: #94a3b8;
}

html[data-theme="dark"] .parent-missed-alert {
    background: #422006;
    color: #fcd34d;
    border-color: #92400e;
}

html[data-theme="dark"] .parent-recent-grade {
    border-color: #253047;
}

html[data-theme="dark"] .parent-recent-grade strong {
    color: #e5e7eb;
}

html[data-theme="dark"] .parent-no-grades {
    background: #172033;
    color: #94a3b8;
}

html[data-theme="dark"] .parent-child-actions {
    border-color: #253047;
    background: #253047;
}

html[data-theme="dark"] .parent-child-action {
    background: #111827;
    color: #cbd5e1;
}

html[data-theme="dark"] .parent-child-action:hover {
    background: #172033;
    color: #818cf8;
}

html[data-theme="dark"] .parent-info-row {
    border-color: #253047;
}

html[data-theme="dark"] .parent-info-row strong {
    color: #f8fafc;
}

html[data-theme="dark"] .parent-subject-average-card {
    border-color: #334155;
    background: #172033;
}

html[data-theme="dark"] .parent-subject-average-card span {
    color: #cbd5e1;
}

html[data-theme="dark"] .parent-subject-average-card strong {
    color: #f8fafc;
}

html[data-theme="dark"] .parent-progress-score-value {
    color: #f8fafc;
}

html[data-theme="dark"] .parent-progress-divider {
    background: #334155;
}

html[data-theme="dark"] .parent-progress-subject {
    border-color: #253047;
}

html[data-theme="dark"] .parent-progress-subject-header strong {
    color: #f8fafc;
}

html[data-theme="dark"] .parent-progress-bar {
    background: #334155;
}

html[data-theme="dark"] .parent-subject-summary > div {
    border-color: #253047;
    background: #111827;
}

html[data-theme="dark"] .parent-subject-summary strong {
    color: #f8fafc;
}

html[data-theme="dark"] .parent-subject-teachers {
    border-color: #253047;
}

html[data-theme="dark"] .parent-subject-teacher span {
    color: #e5e7eb;
}

html[data-theme="dark"] .parent-topic-line::after {
    background: #334155;
}

html[data-theme="dark"] .table {
    --bs-table-bg: transparent;
    --bs-table-color: #e5e7eb;
    --bs-table-border-color: #253047;
    --bs-table-hover-bg: #172033;
    --bs-table-hover-color: #f8fafc;

    color: #e5e7eb;
}

html[data-theme="dark"] .table thead th {
    border-color: #253047;
    color: #94a3b8;
}

html[data-theme="dark"] .table tbody td {
    border-color: #253047;
    color: #e5e7eb;
}

html[data-theme="dark"] .management-table tfoot td {
    border-color: #334155;
    background: #172033;
}

html[data-theme="dark"] .lesson-date {
    color: #f8fafc;
}

html[data-theme="dark"] .student-mini {
    color: #cbd5e1;
}

html[data-theme="dark"] .teacher-info-stat strong {
    color: #f8fafc;
}

html[data-theme="dark"] .btn-outline-primary {
    color: #a5b4fc;
    border-color: #6366f1;
}

html[data-theme="dark"] .btn-outline-primary:hover {
    color: #fff;
    background: #6366f1;
    border-color: #6366f1;
}

html[data-theme="dark"] .performance-rank {
    color: #a5b4fc;
}

html[data-theme="dark"] .parent-card-section-header a,
html[data-theme="dark"] .parent-profile-link,
html[data-theme="dark"] .parent-progress-subject-score,
html[data-theme="dark"] .teacher-lesson-group,
html[data-theme="dark"] .teacher-welcome-label {
    color: #a5b4fc;
}

html[data-theme="dark"] .teacher-group-bottom strong {
    color: #f8fafc;
}

html[data-theme="dark"] .teacher-open-label {
    color: #a5b4fc !important;
}

html[data-theme="dark"] .teacher-group-card:hover {
    color: #f8fafc;
}

html[data-theme="dark"] .teacher-student-stat strong,
html[data-theme="dark"] .teacher-grade-stat strong,
html[data-theme="dark"] .teacher-attendance-stat strong,
html[data-theme="dark"] .teacher-schedule-stat strong,
html[data-theme="dark"] .teacher-topic-stat strong,
html[data-theme="dark"] .teacher-salary-card strong,
html[data-theme="dark"] .teacher-schedule-time strong,
html[data-theme="dark"] .parent-student-stat strong,
html[data-theme="dark"] .parent-grade-stat strong,
html[data-theme="dark"] .parent-attendance-mini strong,
html[data-theme="dark"] .parent-progress-stat strong,
html[data-theme="dark"] .parent-schedule-stat strong,
html[data-theme="dark"] .parent-schedule-time strong,
html[data-theme="dark"] .parent-schedule-info strong,
html[data-theme="dark"] .parent-topic-stat strong,
html[data-theme="dark"] .parent-topic-date-box strong,
html[data-theme="dark"] .parent-progress-student strong,
html[data-theme="dark"] .parent-schedule-teacher strong {
    color: #f8fafc;
}

html[data-theme="dark"] .dashboard-empty h6,
html[data-theme="dark"] .schedule-teacher,
html[data-theme="dark"] .teacher-topic-text {
    color: #cbd5e1;
}

html[data-theme="dark"] .teacher-salary-period,
html[data-theme="dark"] .teacher-salary-calculation-title,
html[data-theme="dark"] .parent-empty h5 {
    color: #f8fafc;
}

html[data-theme="dark"] .record-date {
    color: #f8fafc;
}

html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select {
    border-color: #334155;
    background-color: #172033;
    color: #f8fafc;
}

html[data-theme="dark"] .form-control:focus,
html[data-theme="dark"] .form-select:focus {
    border-color: #6366f1;
    background-color: #172033;
    color: #f8fafc;
    box-shadow:
        0 0 0 .2rem
        rgba(99, 102, 241, .15);
}

html[data-theme="dark"] .form-control::placeholder {
    color: #64748b;
}

html[data-theme="dark"] .form-label,
html[data-theme="dark"] label {
    color: #cbd5e1;
}

html[data-theme="dark"] .form-select option {
    background: #172033;
    color: #f8fafc;
}

html[data-theme="dark"] .btn-light {
    border-color: #334155;
    background: #1e293b;
    color: #e5e7eb;
}

html[data-theme="dark"] .btn-light:hover {
    background: #334155;
    color: white;
}

html[data-theme="dark"] .btn-outline-secondary {
    border-color: #475569;
    color: #cbd5e1;
}

html[data-theme="dark"] .text-muted {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .bg-light {
    background: #172033 !important;
    color: #e5e7eb !important;
}

html[data-theme="dark"] .border-bottom,
html[data-theme="dark"] .border-top {
    border-color: #253047 !important;
}

html[data-theme="dark"] .teacher-simple-empty,
html[data-theme="dark"] .parent-small-empty {
    border-color: #475569;
    background: #172033;
    color: #94a3b8;
}

html[data-theme="dark"] .readonly-badge,
html[data-theme="dark"] .teacher-count-label {
    border-color: #334155;
    background: #172033;
    color: #cbd5e1;
}

html[data-theme="dark"] .action-details {
    background: #1e293b;
    color: #cbd5e1;
}

html[data-theme="dark"] .action-details:hover {
    background: #334155;
    color: white;
}

html[data-theme="dark"] .parent-attendance-circle {
    border-color: #064e3b;
    border-top-color: #34d399;
}

html[data-theme="dark"] .parent-attendance-main-info strong {
    color: #34d399;
}

html[data-theme="dark"] .teacher-salary-total-card {
    border-color: #065f46 !important;
    background: #10231e !important;
}

html[data-theme="dark"] .teacher-formula-item {
    background: #172033;
}

html[data-theme="dark"] .teacher-formula-item strong {
    color: #f8fafc;
}

html[data-theme="dark"] .teacher-formula-result {
    background: #10231e;
}

html[data-theme="dark"] .teacher-formula-result strong {
    color: #34d399;
}
.btn-theme {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #ffffff;
    cursor: pointer;
    font-size: 17px;
    transition: .2s ease;
}

.btn-theme:hover {
    background: #f8fafc;
    transform: translateY(-1px);
}

html[data-theme="dark"] {
    color-scheme: dark;
}

html[data-theme="dark"] body,
html[data-theme="dark"] .app,
html[data-theme="dark"] .main-wrapper,
html[data-theme="dark"] .page-content {
    background: #0f172a;
    color: #e5e7eb;
}

html[data-theme="dark"] .topbar {
    background: #111827;
    border-color: #334155;
}

html[data-theme="dark"] .topbar-title,
html[data-theme="dark"] .page-title,
html[data-theme="dark"] .dashboard-title,
html[data-theme="dark"] .section-title,
html[data-theme="dark"] .person-name {
    color: #f8fafc;
}

html[data-theme="dark"] .page-subtitle,
html[data-theme="dark"] .dashboard-subtitle,
html[data-theme="dark"] .section-subtitle,
html[data-theme="dark"] .person-id,
html[data-theme="dark"] .record-time {
    color: #94a3b8;
}

html[data-theme="dark"] .user-email {
    color: #f8fafc;
}

html[data-theme="dark"] .user-role {
    color: #94a3b8;
}

html[data-theme="dark"] .btn-theme {
    border-color: #334155;
    background: #1e293b;
}

html[data-theme="dark"] .btn-theme:hover {
    background: #334155;
}

html[data-theme="dark"] .btn-back {
    border-color: #334155;
    background: #1e293b;
    color: #94a3b8;
}

html[data-theme="dark"] .btn-back:hover {
    background: #334155;
}

html[data-theme="dark"] .card,
html[data-theme="dark"] .form-card,
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .teacher-stat-card,
html[data-theme="dark"] .teacher-quick-card,
html[data-theme="dark"] .teacher-group-card,
html[data-theme="dark"] .teacher-info-stat,
html[data-theme="dark"] .teacher-student-stat,
html[data-theme="dark"] .teacher-attendance-stat,
html[data-theme="dark"] .teacher-grade-stat,
html[data-theme="dark"] .teacher-topic-stat,
html[data-theme="dark"] .teacher-schedule-stat,
html[data-theme="dark"] .teacher-salary-card,
html[data-theme="dark"] .teacher-topic-info-card,
html[data-theme="dark"] .teacher-schedule-day,
html[data-theme="dark"] .teacher-salary-filter-card,
html[data-theme="dark"] .teacher-salary-calculation,
html[data-theme="dark"] .attendance-stat,
html[data-theme="dark"] .grade-stat,
html[data-theme="dark"] .salary-stat,
html[data-theme="dark"] .parent-child-card,
html[data-theme="dark"] .parent-student-stat,
html[data-theme="dark"] .parent-grade-stat,
html[data-theme="dark"] .parent-attendance-main-card,
html[data-theme="dark"] .parent-attendance-mini,
html[data-theme="dark"] .parent-progress-hero,
html[data-theme="dark"] .parent-progress-stat,
html[data-theme="dark"] .parent-schedule-stat,
html[data-theme="dark"] .parent-schedule-day,
html[data-theme="dark"] .parent-subject-card,
html[data-theme="dark"] .parent-topic-stat,
html[data-theme="dark"] .parent-topic-content {
    background: #111827 !important;
    border-color: #334155 !important;
    color: #e5e7eb;
}

html[data-theme="dark"] .stat-number,
html[data-theme="dark"] .teacher-stat-number,
html[data-theme="dark"] .attendance-stat-value,
html[data-theme="dark"] .grade-stat-value,
html[data-theme="dark"] .salary-stat-value {
    color: #f8fafc;
}

html[data-theme="dark"] .table {
    --bs-table-bg: transparent;
    --bs-table-color: #e5e7eb;
    --bs-table-border-color: #334155;
    --bs-table-hover-bg: #1e293b;
    --bs-table-hover-color: #ffffff;

    color: #e5e7eb;
}

html[data-theme="dark"] .table th {
    color: #94a3b8;
    border-color: #334155;
}

html[data-theme="dark"] .table td {
    color: #e5e7eb;
    border-color: #334155;
}

html[data-theme="dark"] .record-date {
    color: #f8fafc;
}

html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select {
    background: #1e293b;
    border-color: #475569;
    color: #f8fafc;
}

html[data-theme="dark"] .form-control::placeholder {
    color: #64748b;
}

html[data-theme="dark"] .form-control:focus,
html[data-theme="dark"] .form-select:focus {
    background: #1e293b;
    border-color: #6366f1;
    color: #ffffff;
    box-shadow: 0 0 0 .2rem rgba(99, 102, 241, .15);
}

html[data-theme="dark"] .form-select option {
    background: #1e293b;
    color: #f8fafc;
}

html[data-theme="dark"] label,
html[data-theme="dark"] .form-label {
    color: #cbd5e1;
}

html[data-theme="dark"] .text-muted {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .bg-light {
    background: #1e293b !important;
    color: #e5e7eb !important;
}

html[data-theme="dark"] .btn-light {
    background: #1e293b;
    border-color: #475569;
    color: #e5e7eb;
}

html[data-theme="dark"] .btn-light:hover {
    background: #334155;
    color: #ffffff;
}

html[data-theme="dark"] .teacher-count-label,
html[data-theme="dark"] .readonly-badge {
    background: #1e293b;
    border-color: #334155;
    color: #cbd5e1;
}

html[data-theme="dark"] .teacher-quick-action,
html[data-theme="dark"] .parent-access-card {
    background: #1e293b;
    border-color: #334155;
    color: #e5e7eb;
}

html[data-theme="dark"] .teacher-quick-action strong,
html[data-theme="dark"] .parent-access-card strong {
    color: #f8fafc;
}

html[data-theme="dark"] .teacher-schedule-day-header,
html[data-theme="dark"] .parent-schedule-day-header {
    background: #1e293b;
    border-color: #334155;
}

html[data-theme="dark"] .teacher-simple-empty,
html[data-theme="dark"] .parent-small-empty {
    background: #1e293b;
    border-color: #475569;
    color: #94a3b8;
}

html[data-theme="dark"] .parent-summary-bar {
    background: #334155;
    border-color: #334155;
}

html[data-theme="dark"] .parent-summary-bar > div {
    background: #111827;
}

html[data-theme="dark"] .parent-child-stat,
html[data-theme="dark"] .parent-subject-average-card,
html[data-theme="dark"] .teacher-formula-item {
    background: #1e293b;
    border-color: #334155;
}

html[data-theme="dark"] .parent-child-action {
    background: #111827;
    color: #cbd5e1;
}

html[data-theme="dark"] .parent-child-action:hover {
    background: #1e293b;
}

html[data-theme="dark"] .parent-topic-line::after {
    background: #475569;
}

html[data-theme="dark"] .parent-progress-bar {
    background: #334155;
}

.journal-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
    margin-bottom: 20px;
}

.journal-filters > div {
    min-width: 150px;
}

.journal-table-wrap {
    max-height: 70vh;
    overflow: auto;
}

.journal-table {
    border-collapse: separate;
    border-spacing: 0;
}

.journal-table th,
.journal-table td {
    white-space: nowrap;
    text-align: center;
}

.journal-sticky-col {
    position: sticky;
    left: 0;
    z-index: 2;
    background: #ffffff;
    text-align: left !important;
    min-width: 160px;
}

.journal-table thead .journal-sticky-col {
    z-index: 3;
}

.journal-date-col {
    font-size: 11px;
    color: #64748b;
    min-width: 44px;
}

.journal-cell {
    padding: 4px !important;
}

.journal-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border-radius: 6px;
    text-decoration: none;
    cursor: pointer;
}

.journal-cell-empty {
    background: #f1f5f9;
    color: #94a3b8;
}

html[data-theme="dark"] .journal-sticky-col {
    background: #0f172a;
}

html[data-theme="dark"] .journal-date-col {
    color: #94a3b8;
}

html[data-theme="dark"] .journal-cell-empty {
    background: #1e293b;
    color: #64748b;
}

html[data-theme="dark"] .border-bottom,
html[data-theme="dark"] .border-top {
    border-color: #334155 !important;
}

.achievement-badges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.achievement-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 18px 12px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.achievement-badge-icon {
    font-size: 32px;
    line-height: 1;
    margin-bottom: 10px;
}

.achievement-badge-name {
    font-size: 12px;
    font-weight: 700;
    color: #334155;
}

.achievement-badge-desc {
    font-size: 11px;
    color: #64748b;
    margin-top: 4px;
}

.achievement-badge-earned {
    background: #fffbeb;
    border-color: #fde68a;
}

.achievement-badge-earned:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(217, 119, 6, 0.15);
}

.achievement-badge-locked {
    opacity: 0.5;
}

.achievement-badge-locked .achievement-badge-icon {
    filter: grayscale(1);
}

html[data-theme="dark"] .achievement-badge {
    background: #1e293b;
    border-color: #334155;
}

html[data-theme="dark"] .achievement-badge-name {
    color: #e2e8f0;
}

html[data-theme="dark"] .achievement-badge-desc {
    color: #94a3b8;
}

html[data-theme="dark"] .achievement-badge-earned {
    background: #422006;
    border-color: #92400e;
}

.leaderboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.leaderboard-rank-cell {
    width: 44px;
}

.leaderboard-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 800;
    background: #f1f5f9;
    color: #64748b;
}

.leaderboard-rank-1 {
    background: #fef3c7;
    color: #b45309;
}

.leaderboard-rank-2 {
    background: #e2e8f0;
    color: #475569;
}

.leaderboard-rank-3 {
    background: #fed7aa;
    color: #9a3412;
}

html[data-theme="dark"] .leaderboard-rank {
    background: #1e293b;
    color: #94a3b8;
}

html[data-theme="dark"] .leaderboard-rank-1 {
    background: #422006;
    color: #fbbf24;
}

html[data-theme="dark"] .leaderboard-rank-2 {
    background: #334155;
    color: #cbd5e1;
}

html[data-theme="dark"] .leaderboard-rank-3 {
    background: #431407;
    color: #fb923c;
}

.calendar-month-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 18px;
}

.calendar-month-label {
    font-size: 16px;
    font-weight: 700;
    min-width: 160px;
    text-align: center;
}

.calendar-grid {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    overflow: hidden;
}

.calendar-grid-head {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
}

.calendar-grid-head-cell {
    padding: 10px;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
}

.calendar-grid-body {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.calendar-grid-cell {
    min-height: 110px;
    padding: 8px;
    border-right: 1px solid #f1f5f9;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.calendar-grid-cell-blank {
    background: #fafbfc;
}

.calendar-grid-cell-today {
    background: #eef2ff;
}

.calendar-grid-day-number {
    font-size: 12px;
    font-weight: 700;
    color: #475569;
}

.calendar-event-chip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    padding: 3px 6px;
    border-radius: 6px;
    background: #eef2ff;
    color: #4338ca;
    font-size: 11px;
    font-weight: 650;
}

.calendar-event-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calendar-event-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.calendar-event-actions a {
    color: inherit;
    text-decoration: none;
    opacity: 0.7;
}

.calendar-event-actions a:hover {
    opacity: 1;
}

.calendar-add-event {
    font-size: 11px;
    color: #94a3b8;
    text-decoration: none;
    margin-top: auto;
}

.calendar-add-event:hover {
    color: #4f46e5;
}

@media (max-width: 700px) {
    .calendar-grid-cell {
        min-height: 70px;
    }

    .calendar-grid-day-number {
        font-size: 10px;
    }

    .calendar-event-title {
        max-width: 60px;
    }
}

html[data-theme="dark"] .calendar-grid {
    background: #111827;
    border-color: #253047;
}

html[data-theme="dark"] .calendar-grid-head {
    background: #172033;
    border-color: #253047;
}

html[data-theme="dark"] .calendar-grid-head-cell {
    color: #94a3b8;
}

html[data-theme="dark"] .calendar-grid-cell {
    border-color: #253047;
}

html[data-theme="dark"] .calendar-grid-cell-blank {
    background: #0d1424;
}

html[data-theme="dark"] .calendar-grid-cell-today {
    background: #1e2a4a;
}

html[data-theme="dark"] .calendar-grid-day-number {
    color: #cbd5e1;
}

html[data-theme="dark"] .calendar-event-chip {
    background: #312e81;
    color: #c7d2fe;
}

.activity-log-list {
    display: flex;
    flex-direction: column;
}

.activity-log-row {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 12px 4px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 13px;
}

.activity-log-row:last-child {
    border-bottom: none;
}

.activity-log-time {
    font-weight: 700;
    color: #111827;
    min-width: 42px;
}

.activity-log-date {
    color: #9ca3af;
    font-size: 11px;
    min-width: 50px;
}

.activity-log-message {
    color: #374151;
}

html[data-theme="dark"] .activity-log-row {
    border-color: #253047;
}

html[data-theme="dark"] .activity-log-time {
    color: #f8fafc;
}

html[data-theme="dark"] .activity-log-message {
    color: #cbd5e1;
}

.ai-assistant {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1200;
}

.ai-assistant-toggle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #4f46e5, #6d28d9);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 28px rgba(79, 70, 229, .35);
    cursor: pointer;
    position: relative;
}

.ai-assistant-toggle:hover {
    filter: brightness(1.08);
}

.ai-assistant-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    min-width: 18px;
    height: 18px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #f5f7fb;
}

.ai-assistant-panel {
    position: absolute;
    right: 0;
    bottom: 68px;
    width: 360px;
    max-width: calc(100vw - 48px);
    height: 500px;
    max-height: calc(100vh - 120px);
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, .18);
    border: 1px solid #eef0f3;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ai-assistant-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid #eef0f3;
    flex-shrink: 0;
}

.ai-assistant-header-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ai-assistant-avatar {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, #4f46e5, #6d28d9);
    color: #fff;
    font-family: "Space Grotesk", -apple-system, sans-serif;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ai-assistant-title {
    font-size: 13px;
    font-weight: 700;
    color: #111827;
    line-height: 1.3;
}

.ai-assistant-subtitle {
    font-size: 10.5px;
    color: #9ca3af;
    line-height: 1.3;
}

.ai-assistant-close {
    border: none;
    background: transparent;
    font-size: 20px;
    line-height: 1;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px 6px;
}

.ai-assistant-close:hover {
    color: #4b5563;
}

.ai-assistant-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ai-assistant-msg {
    display: flex;
}

.ai-assistant-msg-user {
    justify-content: flex-end;
    align-items: center;
    gap: 5px;
}

.ai-assistant-edit {
    width: 22px;
    height: 22px;
    border: none;
    background: transparent;
    color: #9ca3af;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 6px;
    cursor: pointer;
    opacity: 0;
    transition: opacity .12s ease, background .12s ease, color .12s ease;
}

.ai-assistant-msg-user:hover .ai-assistant-edit {
    opacity: 1;
}

.ai-assistant-edit:hover {
    background: #eef2ff;
    color: #4f46e5;
}

.ai-assistant-msg-assistant {
    justify-content: flex-start;
}

.ai-assistant-bubble {
    max-width: 82%;
    padding: 9px 13px;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
}

.ai-assistant-msg-user .ai-assistant-bubble {
    background: linear-gradient(135deg, #4f46e5, #6d28d9);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.ai-assistant-msg-assistant .ai-assistant-bubble {
    background: #f1f3f7;
    color: #1f2937;
    border-bottom-left-radius: 4px;
}

.ai-assistant-msg-thinking .ai-assistant-bubble {
    color: #9ca3af;
}

.ai-assistant-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    border-top: 1px solid #eef0f3;
    flex-shrink: 0;
}

.ai-assistant-input {
    flex: 1;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 9px 12px;
    font-size: 13px;
    outline: none;
}

.ai-assistant-input:focus {
    border-color: #4f46e5;
}

.ai-assistant-send {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, #4f46e5, #6d28d9);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

.ai-assistant-send:hover {
    filter: brightness(1.08);
}

.ai-assistant-mic {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #4b5563;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.ai-assistant-mic:hover {
    background: #f8fafc;
    border-color: #c7d2fe;
}

.ai-assistant-mic.listening {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #dc2626;
    animation: ai-assistant-mic-pulse 1.1s ease-in-out infinite;
}

.ai-assistant-mic:disabled {
    opacity: .4;
    cursor: not-allowed;
}

@keyframes ai-assistant-mic-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, .28); }
    50% { box-shadow: 0 0 0 6px rgba(220, 38, 38, 0); }
}

@media (max-width: 480px) {
    .ai-assistant {
        right: 16px;
        bottom: 16px;
    }

    .ai-assistant-panel {
        width: calc(100vw - 32px);
    }
}

html[data-theme="dark"] .ai-assistant-panel {
    background: #131b2e;
    border-color: #253047;
}

html[data-theme="dark"] .ai-assistant-header {
    border-color: #253047;
}

html[data-theme="dark"] .ai-assistant-title {
    color: #f8fafc;
}

html[data-theme="dark"] .ai-assistant-close {
    color: #64748b;
}

html[data-theme="dark"] .ai-assistant-msg-assistant .ai-assistant-bubble {
    background: #1e293b;
    color: #e2e8f0;
}

html[data-theme="dark"] .ai-assistant-input {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}

html[data-theme="dark"] .ai-assistant-mic {
    background: #1e293b;
    border-color: #334155;
    color: #94a3b8;
}

html[data-theme="dark"] .ai-assistant-mic:hover {
    background: #253047;
}

html[data-theme="dark"] .ai-assistant-edit {
    color: #64748b;
}

html[data-theme="dark"] .ai-assistant-edit:hover {
    background: #253047;
    color: #a5b4fc;
}

html[data-theme="dark"] .ai-assistant-badge {
    border-color: #0b1120;
}

.attendance-chart.attendance-chart-month {
    gap: 3px;
    overflow-x: auto;
}

.attendance-chart-month .attendance-bar-column {
    min-width: 8px;
}

.attendance-chart-month .attendance-bar-label {
    font-size: 9px;
    white-space: nowrap;
}