/* ===== FONTS ===== */
@font-face {
    font-family: 'Vazir';
    src: url('../fonts/Vazir-Regular-FD.woff2') format('woff2');
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: 'Vazir';
    src: url('../fonts/Vazir-Medium-FD.woff2') format('woff2');
    font-weight: 500;
    font-display: swap;
}

@font-face {
    font-family: 'Vazir';
    src: url('../fonts/Vazir-Bold-FD.woff2') format('woff2');
    font-weight: 700;
    font-display: swap;
}

@font-face {
    font-family: 'Vazir';
    src: url('../fonts/Vazir-Black-FD.woff2') format('woff2');
    font-weight: 900;
    font-display: swap;
}

/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Vazir', Tahoma, sans-serif;
}

body {
    background: #f0f4f8;
    color: #2d3436;
    min-height: 100vh;
    line-height: 1.7;
    overflow-x: hidden;
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f0f0f0;
}

::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #7b2ff7;
}

::selection {
    background: #7b2ff7;
    color: #fff;
}

/* پیش فرض دسکتاپ: دکمه همبرگری مخفی */
.hamburger-btn {
    display: none;
}

.sidebar-overlay {
    display: none;
}

/* ===== HEADER ===== */
.header {
    background: #ffffff;
    border-bottom: 2px solid #e8ecf1;
    padding: 16px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.06);
    gap: 15px;
}

.header-right {
    min-width: 0;
    flex: 1;
    overflow: hidden;
}

.header h1 {
    font-size: 22px;
    font-weight: 900;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.date-display {
    font-size: 14px;
    font-weight: 500;
    color: #636e72;
    background: #f0f4f8;
    padding: 8px 16px;
    border-radius: 10px;
}

/* ===== LAYOUT ===== */
.app-container {
    display: flex;
    min-height: calc(100vh - 66px);
}

.sidebar {
    width: 230px;
    background: #ffffff;
    border-left: 2px solid #e8ecf1;
    padding: 20px 0;
    flex-shrink: 0;
    box-shadow: -3px 0 15px rgba(0, 0, 0, 0.04);
}

.sidebar-item {
    padding: 14px 25px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.25s;
    border-right: 4px solid transparent;
    font-size: 14px;
    font-weight: 500;
    color: #636e72;
    margin: 2px 8px;
    border-radius: 0 12px 12px 0;
}

.sidebar-item:hover {
    background: #f0f4f8;
    color: #2d3436;
}

.sidebar-item.active {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.08));
    border-right-color: #764ba2;
    color: #764ba2;
    font-weight: 700;
}

.sidebar-item .icon {
    font-size: 20px;
    width: 28px;
    text-align: center;
}

.main-content {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    background: #f0f4f8;
    min-width: 0;
}

.page {
    display: none;
    animation: fadeSlideIn 0.45s ease;
}

.page.active {
    display: block;
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-title {
    font-size: 24px;
    font-weight: 900;
    margin-bottom: 25px;
    color: #2d3436;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ===== CARDS ===== */
.card {
    background: #ffffff;
    border-radius: 18px;
    padding: 25px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.06);
    border: 1px solid #e8ecf1;
}

.card-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 18px;
    color: #2d3436;
}

/* ===== STAT CARDS ===== */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 18px;
    margin-bottom: 25px;
}

.stat-card {
    background: #ffffff;
    border-radius: 18px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    border: 1px solid #e8ecf1;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 4px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 18px 18px 0 0;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

.stat-card .stat-icon {
    font-size: 38px;
    margin-bottom: 8px;
}

.stat-card .stat-number {
    font-size: 36px;
    font-weight: 900;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-card .stat-label {
    font-size: 13px;
    color: #999;
    margin-top: 5px;
    font-weight: 500;
}

/* ===== DASHBOARD ===== */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.dash-section {
    background: #ffffff;
    border-radius: 18px;
    padding: 25px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.06);
    border: 1px solid #e8ecf1;
}

.section-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f0f4f8;
}

.warning-title {
    color: #e67e22;
}

.danger-title {
    color: #e74c3c;
}

/* ===== FORMS ===== */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 700;
    color: #636e72;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    max-width: 400px;
    padding: 12px 16px;
    background: #f8f9fa;
    border: 2px solid #e8ecf1;
    border-radius: 12px;
    color: #2d3436;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: all 0.3s;
}

.form-group textarea {
    max-width: 100%;
    resize: vertical;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #764ba2;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(118, 75, 162, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #b2bec3;
}

.form-row {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
}

.form-row .form-group {
    flex: 1;
    min-width: 200px;
}

.date-input-row {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

/* ===== BUTTONS ===== */
.btn {
    padding: 12px 28px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(118, 75, 162, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #00b894, #00a381);
    color: #fff;
}

.btn-success:hover {
    box-shadow: 0 6px 25px rgba(0, 184, 148, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: #fff;
}

.btn-danger:hover {
    box-shadow: 0 6px 25px rgba(231, 76, 60, 0.4);
}

.btn-warning {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: #fff;
}

.btn-warning:hover {
    box-shadow: 0 6px 25px rgba(243, 156, 18, 0.4);
}

.btn-outline {
    background: transparent;
    border: 2px solid #764ba2;
    color: #764ba2;
}

.btn-outline:hover {
    background: rgba(118, 75, 162, 0.05);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 12px;
    border-radius: 10px;
}

.btn-xs {
    padding: 5px 12px;
    font-size: 11px;
    border-radius: 8px;
}

/* ===== TABLE ===== */
.table-container {
    border-radius: 14px;
    overflow: hidden;
    overflow-x: auto;
    border: 1px solid #e8ecf1;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 500px;
}

thead th {
    background: linear-gradient(135deg, #f8f9fa, #eef0f5);
    padding: 14px 16px;
    text-align: right;
    font-size: 12px;
    font-weight: 700;
    color: #636e72;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    border-bottom: 2px solid #e8ecf1;
}

tbody td {
    padding: 13px 16px;
    border-bottom: 1px solid #f0f4f8;
    font-size: 14px;
    vertical-align: middle;
}

tbody tr:hover {
    background: #fafbfc;
}

tbody tr:last-child td {
    border-bottom: none;
}

.actions-cell {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* ===== BADGES ===== */
.badge {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 25px;
    font-size: 12px;
    font-weight: 700;
}

.badge-success {
    background: #e6f9f0;
    color: #00a381;
}

.badge-danger {
    background: #fde8e8;
    color: #c0392b;
}

.badge-warning {
    background: #fef3e0;
    color: #e67e22;
}

.badge-info {
    background: #e3f2fd;
    color: #2196f3;
}

.badge-purple {
    background: #f0e6ff;
    color: #764ba2;
}

/* ===== SCORE ===== */
.score-display {
    font-size: 18px;
    font-weight: 900;
}

.score-positive {
    color: #00a381;
}

.score-negative {
    color: #e74c3c;
}

/* ===== SEARCH ===== */
.search-box {
    background: #ffffff;
    border-radius: 14px;
    padding: 12px 18px;
    margin-bottom: 15px;
    border: 2px solid #e8ecf1;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

.search-box::before {
    content: '🔍';
    font-size: 18px;
    opacity: 0.6;
    flex-shrink: 0;
}

.search-box input {
    flex: 1;
    max-width: 100%;
    border: none;
    background: transparent;
    padding: 8px 4px;
    font-size: 14px;
    outline: none;
    box-shadow: none;
    min-width: 0;
}

.search-box input:focus {
    border: none;
    background: transparent;
    box-shadow: none;
}

.search-box-clear {
    background: #f0f4f8;
    border: none;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    cursor: pointer;
    color: #636e72;
    font-size: 13px;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
    padding: 0;
    line-height: 1;
    font-family: inherit;
}

.search-box-clear:hover {
    background: #e74c3c;
    color: #fff;
    transform: scale(1.1);
}

.search-box.has-value .search-box-clear {
    display: flex;
}

/* ===== MODAL ===== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: #fff;
    border-radius: 22px;
    padding: 35px;
    width: 90%;
    max-width: 500px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15);
    animation: modalIn 0.35s ease;
}

@keyframes modalIn {
    from {
        transform: scale(0.9) translateY(20px);
        opacity: 0;
    }

    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 900;
}

.modal-close {
    background: #f0f4f8;
    border: none;
    color: #636e72;
    font-size: 22px;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.modal-close:hover {
    background: #e74c3c;
    color: #fff;
}

/* ===== NOTIFICATION ===== */
.notification {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    padding: 15px 30px;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 700;
    z-index: 2000;
    opacity: 0;
    transition: all 0.4s;
    pointer-events: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.notification.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.notification.success {
    background: #00b894;
    color: #fff;
}

.notification.error {
    background: #e74c3c;
    color: #fff;
}

.notification.warning {
    background: #f39c12;
    color: #fff;
}

/* ===== TAB BUTTONS ===== */
.tab-buttons {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 10px 22px;
    background: #fff;
    border: 2px solid #e8ecf1;
    border-radius: 12px;
    color: #636e72;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    transition: all 0.3s;
}

.tab-btn:hover {
    border-color: #764ba2;
    color: #764ba2;
}

.tab-btn.active {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.08));
    border-color: #764ba2;
    color: #764ba2;
}

/* ===== REMINDER CARDS ===== */
.reminder-card {
    background: #fff;
    border-radius: 14px;
    padding: 18px 22px;
    margin-bottom: 12px;
    border: 2px solid #e8ecf1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    transition: all 0.3s;
}

.reminder-card:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
}

.reminder-card.overdue {
    border-color: #f8c9c5;
    background: #fff5f5;
}

.reminder-card.today {
    border-color: #fde5b7;
    background: #fffbf0;
}

.reminder-info {
    flex: 1;
    min-width: 200px;
}

.reminder-info h4 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 5px;
}

.reminder-info p {
    font-size: 13px;
    color: #636e72;
}

.reminder-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.postpone-info {
    margin-top: 5px;
    font-size: 11px;
    color: #b2bec3;
    font-style: italic;
}

/* ===== ATTENDANCE ===== */
.attendance-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    background: #ffffff;
    border-radius: 14px;
    margin-bottom: 8px;
    border: 2px solid #e8ecf1;
    transition: all 0.3s;
    flex-wrap: wrap;
}

.attendance-row:hover {
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.05);
}

.attendance-row .student-name {
    flex: 1;
    font-size: 14px;
    font-weight: 700;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.attendance-buttons {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.att-btn {
    padding: 8px 16px;
    border: 2px solid #e8ecf1;
    border-radius: 10px;
    background: transparent;
    color: #b2bec3;
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    transition: all 0.3s;
    white-space: nowrap;
}

.att-btn.present {
    background: #e6f9f0;
    border-color: #00b894;
    color: #00a381;
}

.att-btn.absent {
    background: #fde8e8;
    border-color: #e74c3c;
    color: #c0392b;
}

.att-btn.late {
    background: #fef3e0;
    border-color: #f39c12;
    color: #e67e22;
}

@media (max-width: 768px) {
    .attendance-row {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 14px 16px;
    }

    .attendance-row .student-name {
        font-size: 15px;
        font-weight: 900;
        white-space: normal;
        text-align: center;
        padding-bottom: 8px;
        border-bottom: 1px solid #f0f4f8;
    }

    .attendance-buttons {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
        width: 100%;
    }

    .att-btn {
        padding: 12px 8px;
        font-size: 13px;
        font-weight: 900;
        text-align: center;
        border-radius: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* ===== PENALTY ===== */
.penalty-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #ffffff;
    border-radius: 14px;
    margin-bottom: 10px;
    border: 2px solid #e8ecf1;
    gap: 10px;
    flex-wrap: wrap;
}

.penalty-item .penalty-text {
    flex: 1;
    min-width: 200px;
}

/* ===== PROFILE ===== */
.student-profile {
    background: #ffffff;
    border-radius: 18px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.06);
    border: 1px solid #e8ecf1;
}

.student-profile h3 {
    margin-bottom: 8px;
    font-weight: 900;
    font-size: 20px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.profile-stat {
    text-align: center;
    padding: 18px 15px;
    background: #f8f9fa;
    border-radius: 14px;
    border: 1px solid #e8ecf1;
}

.profile-stat .label {
    font-size: 12px;
    color: #999;
    margin-bottom: 5px;
    font-weight: 700;
}

.profile-stat .value {
    font-size: 24px;
    font-weight: 900;
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: #b2bec3;
}

.empty-state .empty-icon {
    font-size: 50px;
    margin-bottom: 12px;
}

.empty-state p {
    font-size: 14px;
}

/* ===== DATEPICKER ===== */
.datepicker-input {
    cursor: pointer !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23764ba2' stroke-width='2'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: 12px center !important;
    padding-left: 40px !important;
}

.jdp-container {
    position: fixed;
    z-index: 99999;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.25);
    border: 2px solid #e8ecf1;
    padding: 18px;
    width: 300px;
    user-select: none;
    animation: modalIn 0.25s ease;
    max-height: calc(100vh - 20px);
    overflow-y: auto;
}

.jdp-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.jdp-header button {
    background: #f0f4f8;
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
    color: #636e72;
    transition: all 0.2s;
    font-family: inherit;
}

.jdp-header button:hover {
    background: #764ba2;
    color: #fff;
}

.jdp-title {
    font-size: 15px;
    font-weight: 900;
    color: #2d3436;
}

.jdp-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 8px;
}

.jdp-weekday {
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    color: #b2bec3;
    padding: 5px;
}

.jdp-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
}

.jdp-day {
    text-align: center;
    padding: 8px 4px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #2d3436;
    transition: all 0.2s;
}

.jdp-day:hover {
    background: #f0f4f8;
}

.jdp-day.today {
    background: #e3f2fd;
    color: #2196f3;
    font-weight: 900;
}

.jdp-day.selected {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    font-weight: 900;
}

.jdp-day.empty {
    cursor: default;
    visibility: hidden;
}

.jdp-day.disabled {
    color: #ddd;
    cursor: default;
}

.jdp-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f0f4f8;
}

.jdp-footer button {
    padding: 6px 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    transition: all 0.2s;
}

.jdp-btn-today {
    background: #e3f2fd;
    color: #2196f3;
}

.jdp-btn-today:hover {
    background: #2196f3;
    color: #fff;
}

.jdp-btn-close {
    background: #f0f4f8;
    color: #636e72;
}

.jdp-btn-close:hover {
    background: #e74c3c;
    color: #fff;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .date-display {
        display: none;
    }

    .hamburger-btn {
        display: inline-flex !important;
        background: #f0f4f8;
        border: 2px solid #e8ecf1;
        font-size: 22px;
        width: 42px;
        height: 42px;
        border-radius: 12px;
        cursor: pointer;
        color: #2d3436;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        line-height: 1;
        padding: 0;
        font-family: inherit;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1000;
        backdrop-filter: blur(2px);
    }

    .sidebar-overlay.active {
        display: block !important;
    }

    .sidebar {
        position: fixed !important;
        top: 0 !important;
        right: -280px !important;
        width: 260px !important;
        height: 100vh !important;
        height: 100dvh !important;
        z-index: 1001 !important;
        transition: right 0.3s ease !important;
        box-shadow: -5px 0 25px rgba(0, 0, 0, 0.15) !important;
        padding-top: 20px !important;
        display: block !important;
        background: #fff !important;
        overflow-y: auto !important;
        border-left: none !important;
    }

    .sidebar.active {
        right: 0 !important;
    }

    .main-content {
        padding: 15px;
        width: 100%;
    }

    .header h1 {
        font-size: 16px;
    }

    .header {
        padding: 12px 15px;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        max-width: 100%;
    }

    .stat-card .stat-number {
        font-size: 28px;
    }

    .form-row {
        flex-direction: column;
    }

    .form-row .form-group {
        min-width: 100%;
    }

    table {
        font-size: 12px;
    }

    thead th,
    tbody td {
        padding: 10px;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .note-delete {
        position: relative;
        bottom: auto;
        left: auto;
        opacity: 1;
        margin-top: 10px;
    }
}

/* ===== STUDENT PICKER (Live Search Select) ===== */
.student-picker {
    position: relative;
    max-width: 400px;
}

.student-picker-input {
    width: 100%;
    padding: 12px 16px;
    background: #f8f9fa;
    border: 2px solid #e8ecf1;
    border-radius: 12px;
    color: #2d3436;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: all 0.3s;
    cursor: text;
}

.student-picker-input:focus {
    border-color: #764ba2;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(118, 75, 162, 0.1);
}

.student-picker-input.has-value {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08), rgba(118, 75, 162, 0.05));
    border-color: #764ba2;
    font-weight: 700;
    color: #764ba2;
}

.student-picker-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 5px);
    right: 0;
    left: 0;
    background: #fff;
    border: 2px solid #e8ecf1;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    max-height: 250px;
    overflow-y: auto;
    z-index: 100;
    animation: modalIn 0.2s ease;
}

.student-picker-dropdown.active {
    display: block;
}

.student-picker-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    border-bottom: 1px solid #f0f4f8;
    display: flex;
    align-items: center;
    gap: 10px;
}

.student-picker-item:last-child {
    border-bottom: none;
}

.student-picker-item:hover,
.student-picker-item.highlighted {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.08));
    color: #764ba2;
    font-weight: 700;
}

.student-picker-item.no-result {
    color: #b2bec3;
    cursor: default;
    text-align: center;
    font-style: italic;
}

.student-picker-item.no-result:hover {
    background: transparent;
    color: #b2bec3;
    font-weight: normal;
}

.student-picker-item .avatar {
    width: 30px;
    height: 30px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.student-picker-clear {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: #f0f4f8;
    border: none;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    cursor: pointer;
    color: #636e72;
    font-size: 14px;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.student-picker-clear:hover {
    background: #e74c3c;
    color: #fff;
}

.student-picker.has-value .student-picker-clear {
    display: flex;
}

/* ===== DATE TAGS ===== */
.date-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 5px;
}

.date-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 14px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
    border: 2px solid;
    transition: all 0.2s;
}

.date-tag small {
    font-size: 11px;
    font-weight: 500;
    opacity: 0.8;
}

.date-tag:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.date-tag-danger {
    background: #fde8e8;
    border-color: #f8c9c5;
    color: #c0392b;
}

.date-tag-warning {
    background: #fef3e0;
    border-color: #fde5b7;
    color: #e67e22;
}

.date-tag-success {
    background: #e6f9f0;
    border-color: #b8ecd3;
    color: #00a381;
}

/* ===== PAGINATION ===== */
.pagination-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 20px;
    padding: 15px 20px;
    background: #fafbfc;
    border-radius: 14px;
    border: 1px solid #e8ecf1;
}

.pagination-info {
    font-size: 13px;
    color: #636e72;
    font-weight: 500;
}

.pagination-info strong {
    color: #764ba2;
    font-weight: 900;
    margin: 0 3px;
}

.pagination {
    display: flex;
    gap: 5px;
    align-items: center;
    flex-wrap: wrap;
}

.pg-btn {
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border: 2px solid #e8ecf1;
    background: #fff;
    border-radius: 10px;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    color: #636e72;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.pg-btn:hover:not(:disabled):not(.active) {
    border-color: #764ba2;
    color: #764ba2;
    transform: translateY(-2px);
}

.pg-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pg-btn.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 3px 10px rgba(118, 75, 162, 0.3);
}

.pg-num {
    min-width: 40px;
}

.pg-dots {
    padding: 0 8px;
    color: #b2bec3;
    font-weight: 900;
    font-size: 16px;
}

@media (max-width: 600px) {
    .pagination-wrapper {
        flex-direction: column;
    }

    .pagination-info {
        text-align: center;
    }
}

/* ===== NOTES ===== */
.note-item {
    position: relative;
    padding: 15px 20px;
    border-radius: 12px;
    margin-bottom: 12px;
    border-right: 5px solid #e8ecf1;
    background: #fafbfc;
    transition: all 0.3s;
}

.note-item:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.note-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 12px;
    color: #999;
}

.note-date {
    font-weight: 700;
}

.note-body {
    font-size: 14px;
    color: #2d3436;
    line-height: 1.8;
}

.note-delete {
    position: absolute;
    bottom: 15px;
    left: 20px;
    opacity: 0;
    transition: opacity 0.2s;
}

.note-item:hover .note-delete {
    opacity: 1;
}

/* رنگ بندی یادداشت ها */
.note-normal {
    border-right-color: #b2bec3;
    background: #f8f9fa;
}

.note-success {
    border-right-color: #00b894;
    background: #e6f9f0;
}

.note-danger {
    border-right-color: #e74c3c;
    background: #fde8e8;
}

.note-warning {
    border-right-color: #f39c12;
    background: #fef3e0;
}

.note-info {
    border-right-color: #2196f3;
    background: #e3f2fd;
}

@media (max-width: 768px) {
    .note-delete {
        position: relative;
        bottom: auto;
        left: auto;
        opacity: 1;
        margin-top: 10px;
    }
}

/* ===== TRASH ===== */
.trash-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 16px 20px;
    background: #ffffff;
    border-radius: 14px;
    margin-bottom: 10px;
    border: 2px solid #e8ecf1;
    transition: all 0.3s;
    flex-wrap: wrap;
}

.trash-item:hover {
    border-color: #764ba2;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.trash-icon {
    font-size: 32px;
    width: 55px;
    height: 55px;
    background: #f0f4f8;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.trash-info {
    flex: 1;
    min-width: 200px;
}

.trash-type {
    font-size: 12px;
    font-weight: 700;
    color: #764ba2;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.trash-desc {
    font-size: 15px;
    font-weight: 700;
    color: #2d3436;
    margin-bottom: 5px;
}

.trash-date {
    font-size: 12px;
    color: #999;
}

.trash-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* ===== ACTIVITIES GRADING ===== */
.grading-card {
    background: #fff;
    border: 2px solid #e8ecf1;
    border-radius: 14px;
    padding: 15px 20px;
    margin-bottom: 12px;
    transition: all 0.3s;
}

.grading-card:hover {
    border-color: #764ba2;
    box-shadow: 0 4px 15px rgba(118, 75, 162, 0.08);
}

.gc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f0f4f8;
    padding-bottom: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.gc-name {
    font-size: 16px;
    font-weight: 900;
    color: #2d3436;
}

.gc-type-select {
    padding: 6px 12px;
    border-radius: 10px;
    border: 2px solid #e8ecf1;
    background: #f8f9fa;
    font-size: 13px;
    font-weight: 700;
    outline: none;
    color: #636e72;
    cursor: pointer;
}

.gc-type-select:focus {
    border-color: #764ba2;
}

.gc-desc-area {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.grade-btn {
    flex: 1;
    min-width: 100px;
    padding: 10px;
    border: 2px solid #e8ecf1;
    border-radius: 10px;
    background: #fff;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    color: #636e72;
}

.grade-btn:hover {
    background: #f8f9fa;
}

.grade-exc.active {
    background: #00b894;
    border-color: #00b894;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 184, 148, 0.3);
}

.grade-good.active {
    background: #2196f3;
    border-color: #2196f3;
    color: #fff;
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

.grade-acc.active {
    background: #f39c12;
    border-color: #f39c12;
    color: #fff;
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.3);
}

.grade-need.active {
    background: #e74c3c;
    border-color: #e74c3c;
    color: #fff;
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

.gc-num-area {
    display: flex;
    gap: 15px;
    margin-bottom: 12px;
    align-items: center;
}

.num-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.num-input-group label {
    font-size: 13px;
    font-weight: 700;
    color: #636e72;
}

.gc-input {
    width: 80px;
    padding: 8px;
    border: 2px solid #e8ecf1;
    border-radius: 8px;
    text-align: center;
    font-weight: 900;
    font-family: inherit;
    outline: none;
}

.gc-input:focus {
    border-color: #764ba2;
}

.gc-input-note {
    width: 100%;
    padding: 10px 15px;
    background: #f8f9fa;
    border: 2px solid transparent;
    border-radius: 10px;
    font-size: 13px;
    outline: none;
    transition: all 0.2s;
}

.gc-input-note:focus {
    background: #fff;
    border-color: #764ba2;
}

/* مخفی کردن منطقه چاپ روی مانیتور */
#printArea {
    display: none;
}

/* ===== PRINT STYLES (PDF EXPORT) ===== */
@media print {

    /* مخفی کردن کامل تمام عناصر سایت */
    body>*:not(#printArea) {
        display: none !important;
    }

    html,
    body {
        margin: 0 !important;
        padding: 0 !important;
        background: #fff !important;
        height: auto !important;
        overflow: visible !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
    }

    /* نمایش فقط منطقه چاپ هنگام پرینت */
    #printArea {
        display: block !important;
        position: static !important;
        width: 100%;
        color: #000;
        font-size: 12pt;
        margin: 0;
        padding: 0;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
    }

    /* تنظیمات صفحه */
    @page {
        size: A4 portrait;
        margin: 1.5cm;
    }

    /* اجبار تمام عناصر داخل چاپ به رعایت رنگ‌ها */
    #printArea * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
    }

    /* ظاهر نامه رسمی */
    .print-header {
        text-align: center;
        border-bottom: 2px solid #000;
        padding-bottom: 10px;
        margin-bottom: 20px;
    }

    .print-header h1 {
        font-size: 18pt;
        margin-bottom: 5px;
    }

    .print-header h2 {
        font-size: 14pt;
        font-weight: normal;
        margin-bottom: 10px;
    }

    .print-student-info {
        display: flex;
        justify-content: space-between;
        font-weight: bold;
    }

    .print-section {
        margin-bottom: 20px;
        page-break-inside: auto !important;
        /* اجازه به شکستن طبیعی بخش در بین صفحات */
    }

    .print-table tr {
        page-break-inside: avoid !important;
        /* جلوگیری از نصف شدن و شکستن زشت ردیف‌های تکی جدول */
    }

    .print-section h3 {
        font-size: 13pt;
        border-bottom: 1px solid #aaa;
        padding-bottom: 5px;
        margin-bottom: 10px;
    }

    .print-table {
        width: 100%;
        border-collapse: collapse;
        font-size: 11pt;
        border: 2px solid #000;
    }

    .print-table th,
    .print-table td {
        border: 1px solid #000;
        padding: 6px 8px;
        text-align: right;
    }

    .print-table th {
        background-color: #f0f0f0 !important;
        -webkit-print-color-adjust: exact;
        /* چاپ رنگ پس زمینه */
    }

    .print-table tbody tr:last-child td {
        border-bottom: 2px solid #000;
    }

    .print-badge {
        display: inline-block;
        border: 1px solid #000;
        padding: 2px 6px;
        border-radius: 4px;
        font-size: 10pt;
    }

    .text-center {
        text-align: center !important;
    }

    /* امضاها */
    .print-signatures {
        display: flex;
        justify-content: space-between;
        margin-top: 50px;
        padding-top: 20px;
    }

    .print-signatures div {
        text-align: center;
        width: 200px;
    }
}

/* جلوگیری از اسکرول body هنگام باز بودن سایدبار */
body.no-scroll {
    overflow: hidden !important;
}


/* ===== HOMEWORK PROGRESS ===== */
.hw-progress-wrapper {
    margin-top: 12px;
    background: #f8f9fa;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid #e8ecf1;
}

.hw-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: #636e72;
    font-weight: 700;
    margin-bottom: 6px;
}

.hw-progress-header strong {
    color: #2d3436;
    font-weight: 900;
}

.hw-progress-bar {
    width: 100%;
    height: 8px;
    background: #e8ecf1;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
}

.hw-progress-fill {
    height: 100%;
    border-radius: 20px;
    transition: width 0.5s ease, background 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.hw-status-badges {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.hw-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.hw-status-badge strong {
    font-size: 13px;
    font-weight: 900;
}


/* ===== GROUPS ===== */
.group-set-card {
    background: #fff;
    border-radius: 14px;
    padding: 18px 22px;
    margin-bottom: 12px;
    border: 2px solid #e8ecf1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    transition: all 0.3s;
}

.group-set-card:hover {
    border-color: #764ba2;
    box-shadow: 0 4px 15px rgba(118, 75, 162, 0.1);
    transform: translateY(-2px);
}

.group-set-card.permanent {
    border-right: 5px solid #667eea;
}

.group-set-card.temporary {
    border-right: 5px solid #f39c12;
}

.group-set-info h4 {
    font-size: 16px;
    font-weight: 900;
    margin-bottom: 5px;
}

.group-set-info p {
    font-size: 13px;
    color: #636e72;
}

.group-set-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* گروه کارت‌ها */
.groups-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}

.group-card {
    background: #fff;
    border-radius: 16px;
    padding: 18px;
    border: 3px solid transparent;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
}

.group-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.1);
}

.group-card-header {
    padding: 12px 15px;
    border-radius: 12px;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.group-card-header h4 {
    font-size: 16px;
    font-weight: 900;
    display: flex;
    align-items: center;
    gap: 6px;
}

.group-card-header .group-count {
    background: rgba(255, 255, 255, 0.25);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}

.group-actions {
    display: flex;
    gap: 4px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.group-members-list {
    flex: 1;
    background: #f8f9fa;
    border-radius: 10px;
    padding: 10px;
    min-height: 60px;
    max-height: 250px;
    overflow-y: auto;
}

.group-member {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    border-radius: 8px;
    background: #fff;
    margin-bottom: 5px;
    font-size: 13px;
    border: 1px solid #e8ecf1;
    transition: all 0.2s;
}

.group-member:hover {
    background: #fafbfc;
    border-color: #764ba2;
}

.group-member .member-name {
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 5px;
}

.group-member.is-leader {
    background: linear-gradient(135deg, rgba(243, 156, 18, 0.1), rgba(230, 126, 34, 0.05));
    border-color: #f39c12;
}

.leader-badge {
    background: #f39c12;
    color: #fff;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 900;
}

.member-actions {
    display: flex;
    gap: 4px;
}

.mem-btn {
    background: none;
    border: 1px solid transparent;
    padding: 3px 6px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.mem-btn:hover {
    background: #f0f4f8;
    border-color: #e8ecf1;
}

.group-score-display {
    text-align: center;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 10px;
    margin-top: 10px;
    font-size: 13px;
    font-weight: 700;
    border: 1px solid #e8ecf1;
}

.unassigned-panel {
    background: #fff3cd;
    border: 2px dashed #f39c12;
    border-radius: 14px;
    padding: 15px 20px;
}

.unassigned-panel h4 {
    color: #856404;
    margin-bottom: 10px;
    font-weight: 900;
}

.unassigned-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.unassigned-item {
    background: #fff;
    border: 1px solid #f39c12;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    color: #856404;
}

/* رنگ‌های انتخابی */
.color-option {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.2s;
}

.color-option:hover {
    transform: scale(1.1);
}

.color-option.selected {
    border-color: #2d3436;
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

/* پروفایل گروه‌ها */
.profile-groups-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.profile-group-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 12px;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.profile-group-tag small {
    background: rgba(255, 255, 255, 0.25);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
}

/* چاپ گروه‌ها */
@media print {
    .print-groups-container {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .print-group-card {
        border: 2px solid #000;
        border-radius: 10px;
        padding: 10px 15px;
        page-break-inside: avoid;
    }

    .print-group-card h4 {
        font-size: 14pt;
        margin-bottom: 8px;
        padding-bottom: 5px;
        border-bottom: 1px solid #000;
    }

    .print-group-card ul {
        list-style: none;
        padding: 0;
        margin: 0;
    }

    .print-group-card li {
        padding: 3px 0;
        font-size: 11pt;
    }
}

/* ============================================
   ===== GLOBAL PAGE BLOCKING LOADER =========
   ============================================ */

.page-blocking-loader {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(240, 244, 248, 0.75);
    /* پس‌زمینه نیمه شفاف همرنگ تم اصلی */
    backdrop-filter: blur(6px);
    /* افکت تاری بسیار شیک شیشه‌ای */
    -webkit-backdrop-filter: blur(6px);
    z-index: 99999;
    /* بالاترین اولویت لایه‌ها */
    justify-content: center;
    align-items: center;
    transition: opacity 0.25s ease;
}

/* کلاس کمکی برای فعال‌سازی لودر با انیمیشن نرم */
.page-blocking-loader.active {
    display: flex;
    animation: pblFadeIn 0.2s ease-out;
}

@keyframes pblFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.pbl-box {
    text-align: center;
    padding: 30px;
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 15px 45px rgba(118, 75, 162, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.8);
    min-width: 200px;
    animation: pblScaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes pblScaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* اسپینر دایره‌ای مدرن و دو رنگ */
.pbl-spinner {
    display: inline-block;
    width: 50px;
    height: 50px;
    border: 4px solid #e8ecf1;
    border-top-color: #764ba2;
    /* بنفش اصلی */
    border-right-color: #667eea;
    /* آبی مکمل */
    border-radius: 50%;
    animation: pblSpin 0.9s cubic-bezier(0.6, 0.2, 0, 0.8) infinite;
    margin-bottom: 15px;
}

@keyframes pblSpin {
    to {
        transform: rotate(360deg);
    }
}

.pbl-text {
    font-size: 13px;
    font-weight: 800;
    color: #2d3436;
    letter-spacing: -0.2px;
}

/* ============================================
   ===== SAVE TOAST (نوتیفیکیشن ذخیره) =====
   ============================================ */
.save-toast {
    position: fixed;
    bottom: 30px;
    left: 30px;
    background: linear-gradient(135deg, #00b894, #00a381);
    color: #fff;
    padding: 14px 24px;
    border-radius: 14px;
    font-size: 13px;
    font-weight: 800;
    box-shadow: 0 10px 30px rgba(0, 184, 148, 0.35);
    z-index: 999999;
    display: flex;
    align-items: center;
    gap: 8px;
    transform: translateX(-120%);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    pointer-events: none;
    letter-spacing: -0.2px;
    min-width: 180px;
    justify-content: center;
}

.save-toast.show {
    transform: translateX(0);
    opacity: 1;
}

.save-toast.error {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    box-shadow: 0 10px 30px rgba(231, 76, 60, 0.35);
}

.save-toast.info {
    background: linear-gradient(135deg, #2196f3, #1565c0);
    box-shadow: 0 10px 30px rgba(33, 150, 243, 0.35);
}

@media (max-width: 600px) {
    .save-toast {
        left: 15px;
        right: 15px;
        bottom: 15px;
        min-width: unset;
    }
}

/* ===== REGIONAL / LOCAL LOADER ===== */
.local-loading-parent {
    position: relative !important;
}

.local-loader-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: inherit;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    animation: pblFadeIn 0.2s ease-out;
}

.local-loader-spinner {
    display: inline-block;
    width: 35px;
    height: 35px;
    border: 3px solid #e8ecf1;
    border-top-color: #764ba2;
    border-right-color: #667eea;
    border-radius: 50%;
    animation: pblSpin 0.8s linear infinite;
}

/* ===== RANDOM PICKER ===== */
.random-slot-item {
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.3);
    transition: none;
    user-select: none;
    white-space: nowrap;
}

.random-slot-item.center {
    color: #fff;
    font-size: 28px;
    text-shadow: 0 2px 15px rgba(0, 0, 0, 0.3);
}

.random-results-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.random-result-item {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    background: #fff;
    border-radius: 14px;
    border: 2px solid #e8ecf1;
    animation: randomResultIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    transition: all 0.3s;
    flex-shrink: 0;
}

.random-result-item:hover {
    border-color: #764ba2;
    box-shadow: 0 4px 15px rgba(118, 75, 162, 0.1);
    transform: translateY(-2px);
}

@keyframes randomResultIn {
    from {
        opacity: 0;
        transform: translateY(15px) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.random-result-number {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 900;
    flex-shrink: 0;
    box-shadow: 0 3px 10px rgba(118, 75, 162, 0.3);
}

.random-result-name {
    font-size: 15px;
    font-weight: 900;
    color: #2d3436;
    white-space: nowrap;
}

.random-result-item:nth-child(1) .random-result-number {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    box-shadow: 0 3px 10px rgba(243, 156, 18, 0.3);
}

.random-result-item:nth-child(2) .random-result-number {
    background: linear-gradient(135deg, #b2bec3, #95a5a6);
    box-shadow: 0 3px 10px rgba(149, 165, 166, 0.3);
}

.random-result-item:nth-child(3) .random-result-number {
    background: linear-gradient(135deg, #e67e22, #d35400);
    box-shadow: 0 3px 10px rgba(230, 126, 34, 0.3);
}

@media (max-width: 768px) {
    .random-result-item {
        padding: 10px 14px;
    }

    .random-result-number {
        width: 32px;
        height: 32px;
        font-size: 14px;
        border-radius: 8px;
    }

    .random-result-name {
        font-size: 14px;
    }

    .random-slot-item {
        font-size: 18px;
    }

    .random-slot-item.center {
        font-size: 22px;
    }
}

/* ===== RANDOM PICKER CONTROLS ===== */
.random-controls {
    display: flex;
    align-items: flex-end;
    gap: 15px;
    flex-wrap: wrap;
}

.random-count-box {
    flex: 0 0 auto;
}

.random-count-box label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 700;
    color: #636e72;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.random-count-box input {
    width: 110px;
    text-align: center;
    font-size: 20px;
    font-weight: 900;
    padding: 12px 16px;
    background: #f8f9fa;
    border: 2px solid #e8ecf1;
    border-radius: 12px;
    color: #764ba2;
    font-family: inherit;
    outline: none;
    transition: all 0.3s;
}

.random-count-box input:focus {
    border-color: #764ba2;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(118, 75, 162, 0.1);
}

.random-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    flex: 1;
    min-width: 200px;
}

.random-buttons .btn {
    flex: 0 1 auto;
}

@media (max-width: 600px) {
    .random-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .random-count-box {
        width: 100%;
    }

    .random-count-box input {
        width: 100%;
    }

    .random-buttons {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .random-buttons .btn {
        width: 100%;
        justify-content: center;
        padding: 12px;
        font-size: 13px;
    }
}

/* ===== WEEKLY SCHEDULE ===== */
.schedule-container {
    background: #fff;
    border-radius: 18px;
    padding: 15px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.06);
    border: 1px solid #e8ecf1;
}

.schedule-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 4px;
    min-width: 700px;
}

.schedule-table thead th {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    padding: 12px 8px;
    text-align: center;
    font-size: 13px;
    font-weight: 900;
    border-radius: 10px;
    border: none;
    text-transform: none;
    letter-spacing: 0;
}

.schedule-table tbody td {
    padding: 0;
    border: none;
    height: 90px;
    vertical-align: middle;
}

.schedule-period-cell {
    background: linear-gradient(135deg, #f8f9fa, #eef0f5);
    color: #764ba2;
    text-align: center;
    font-weight: 900;
    font-size: 15px;
    border-radius: 10px;
    padding: 10px 5px;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.schedule-period-cell small {
    display: block;
    font-size: 10px;
    color: #999;
    font-weight: 500;
    margin-top: 3px;
}

.schedule-cell {
    background: #fafbfc;
    border: 2px dashed #e8ecf1;
    border-radius: 10px;
    cursor: pointer;
    padding: 8px;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: all 0.25s;
    color: #b2bec3;
    font-size: 20px;
    min-height: 80px;
    position: relative;
}

.schedule-cell:hover {
    border-color: #764ba2;
    background: #fff;
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(118, 75, 162, 0.15);
}

.schedule-cell.filled {
    border-style: solid;
    color: #fff;
    font-size: 13px;
    font-weight: 900;
    padding: 8px 10px;
}

.schedule-cell.filled .schedule-cell-title {
    font-size: 14px;
    font-weight: 900;
    line-height: 1.3;
    margin-bottom: 4px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
    word-break: break-word;
}

.schedule-cell.filled .schedule-cell-note {
    font-size: 11px;
    font-weight: 500;
    opacity: 0.9;
    line-height: 1.3;
    word-break: break-word;
}

.schedule-cell .empty-icon {
    opacity: 0.3;
    font-size: 24px;
}

@media (max-width: 768px) {
    .schedule-container {
        padding: 8px;
    }

    .schedule-table {
        border-spacing: 2px;
    }

    .schedule-table thead th {
        padding: 8px 4px;
        font-size: 11px;
    }

    .schedule-table tbody td {
        height: 70px;
    }

    .schedule-period-cell {
        font-size: 12px;
        padding: 5px 2px;
    }

    .schedule-period-cell small {
        font-size: 9px;
    }

    .schedule-cell {
        min-height: 60px;
        padding: 4px;
        font-size: 16px;
    }

    .schedule-cell.filled .schedule-cell-title {
        font-size: 11px;
    }

    .schedule-cell.filled .schedule-cell-note {
        font-size: 9px;
    }
}

/* ===== PRINT SCHEDULE ===== */
.print-schedule-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    border: 2px solid #000;
}

.print-schedule-table th,
.print-schedule-table td {
    border: 2px solid #000;
    padding: 10px 8px;
    text-align: center;
    font-size: 11pt;
    vertical-align: middle;
    height: 60px;
}

.print-schedule-table th {
    background-color: #ddd !important;
    -webkit-print-color-adjust: exact;
    font-weight: bold;
    font-size: 12pt;
}

.print-schedule-table .period-col {
    background-color: #f0f0f0 !important;
    -webkit-print-color-adjust: exact;
    font-weight: bold;
}

.print-schedule-cell {
    font-weight: bold;
}

.print-schedule-cell small {
    display: block;
    font-weight: normal;
    font-size: 9pt;
    margin-top: 3px;
}

/* ===== ATTENDANCE QUICK STATS ===== */
#attendanceQuickStats {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.att-stat {
    flex: 1;
    min-width: 130px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: #fff;
    border-radius: 14px;
    border: 2px solid #e8ecf1;
    transition: all 0.3s;
}

.att-stat:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
}

.att-stat-icon {
    font-size: 26px;
    flex-shrink: 0;
}

.att-stat-num {
    font-size: 22px;
    font-weight: 900;
    line-height: 1.2;
}

.att-stat-label {
    font-size: 11px;
    font-weight: 700;
    color: #999;
    margin-top: 2px;
}

.att-stat-success {
    border-color: #b8ecd3;
    background: linear-gradient(135deg, #e6f9f0, #fff);
}

.att-stat-success .att-stat-num {
    color: #00a381;
}

.att-stat-danger {
    border-color: #f8c9c5;
    background: linear-gradient(135deg, #fde8e8, #fff);
}

.att-stat-danger .att-stat-num {
    color: #c0392b;
}

.att-stat-warning {
    border-color: #fde5b7;
    background: linear-gradient(135deg, #fef3e0, #fff);
}

.att-stat-warning .att-stat-num {
    color: #e67e22;
}

.att-stat-neutral {
    border-color: #e8ecf1;
    background: linear-gradient(135deg, #f8f9fa, #fff);
}

.att-stat-neutral .att-stat-num {
    color: #636e72;
}

@media (max-width: 600px) {
    #attendanceQuickStats {
        gap: 8px;
    }

    .att-stat {
        flex: 1 1 calc(50% - 8px);
        min-width: unset;
        padding: 10px 12px;
        gap: 8px;
    }

    .att-stat-icon {
        font-size: 22px;
    }

    .att-stat-num {
        font-size: 18px;
    }
}

/* ===== HOMEWORK ASSIGN STUDENTS LIST ===== */
.hw-assign-students-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-height: 200px;
    overflow-y: auto;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 2px solid #e8ecf1;
}

.hw-assign-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid #e8ecf1;
    background: #fff;
    color: #636e72;
    user-select: none;
}

.hw-assign-chip:hover {
    border-color: #764ba2;
    color: #764ba2;
}

.hw-assign-chip.selected {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-color: #764ba2;
    color: #fff;
    box-shadow: 0 2px 8px rgba(118, 75, 162, 0.25);
}

.hw-assign-chip .chip-check {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    flex-shrink: 0;
    transition: all 0.2s;
    background: #fff;
}

.hw-assign-chip.selected .chip-check {
    background: #fff;
    border-color: #fff;
    color: #764ba2;
}

/* ===== SCHEDULE SUBJECT CHIPS ===== */
.schedule-subject-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-height: 250px;
    overflow-y: auto;
    padding: 5px;
}

.schedule-subject-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s;
    border: 3px solid transparent;
    background: #fff;
    color: #fff;
    user-select: none;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.schedule-subject-chip:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.schedule-subject-chip.selected {
    border-color: #2d3436;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.schedule-subject-chip.selected::after {
    content: '✓';
    background: #fff;
    color: #2d3436;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 900;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.schedule-subject-chip.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.schedule-subject-chip .order-num {
    background: rgba(255, 255, 255, 0.9);
    color: #2d3436;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 900;
}

/* دکمه رنگ در جدول درس‌ها */
.subject-color-badge {
    display: inline-block;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* ===== DARK MODE (PROJECTOR) ===== */
body.dark-mode {
    background: #1a1a2e !important;
    color: #e0e0e0 !important;
}

body.dark-mode .header {
    background: #16213e !important;
    border-bottom-color: #0f3460 !important;
}

body.dark-mode .header h1 {
    -webkit-text-fill-color: #e94560;
    background: linear-gradient(135deg, #e94560, #f39c12);
    -webkit-background-clip: text;
}

body.dark-mode .sidebar {
    background: #16213e !important;
    border-left-color: #0f3460 !important;
}

body.dark-mode .sidebar-item {
    color: #b0b0b0;
}

body.dark-mode .sidebar-item:hover {
    background: #1a1a2e;
    color: #fff;
}

body.dark-mode .sidebar-item.active {
    background: rgba(233, 69, 96, 0.15);
    border-right-color: #e94560;
    color: #e94560;
}

body.dark-mode .main-content {
    background: #1a1a2e !important;
}

body.dark-mode .card,
body.dark-mode .dash-section,
body.dark-mode .stat-card {
    background: #16213e !important;
    border-color: #0f3460 !important;
    color: #e0e0e0;
}

body.dark-mode .card-title,
body.dark-mode .section-title,
body.dark-mode .page-title {
    color: #fff !important;
}

body.dark-mode .stat-card .stat-number {
    background: linear-gradient(135deg, #e94560, #f39c12);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

body.dark-mode .stat-card .stat-label {
    color: #888;
}

body.dark-mode .stat-card::before {
    background: linear-gradient(135deg, #e94560, #f39c12);
}

body.dark-mode .form-group label {
    color: #aaa;
}

body.dark-mode .form-group input,
body.dark-mode .form-group select,
body.dark-mode .form-group textarea {
    background: #1a1a2e;
    border-color: #0f3460;
    color: #e0e0e0;
}

body.dark-mode .form-group input:focus,
body.dark-mode .form-group select:focus,
body.dark-mode .form-group textarea:focus {
    border-color: #e94560;
    background: #0f1629;
    box-shadow: 0 0 0 4px rgba(233, 69, 96, 0.15);
}

body.dark-mode .form-group input::placeholder,
body.dark-mode .form-group textarea::placeholder {
    color: #555;
}

body.dark-mode .search-box {
    background: #16213e;
    border-color: #0f3460;
}

body.dark-mode .search-box input {
    color: #e0e0e0;
}

body.dark-mode .table-container {
    border-color: #0f3460;
}

body.dark-mode thead th {
    background: linear-gradient(135deg, #0f3460, #16213e) !important;
    color: #e0e0e0;
    border-bottom-color: #0f3460;
}

body.dark-mode tbody td {
    border-bottom-color: #0f3460;
    color: #e0e0e0;
}

body.dark-mode tbody tr:hover {
    background: #1a1a2e;
}

body.dark-mode .reminder-card,
body.dark-mode .penalty-item,
body.dark-mode .attendance-row,
body.dark-mode .trash-item,
body.dark-mode .grading-card {
    background: #16213e;
    border-color: #0f3460;
    color: #e0e0e0;
}

body.dark-mode .reminder-card.overdue {
    border-color: #e94560;
    background: rgba(233, 69, 96, 0.1);
}

body.dark-mode .reminder-card.today {
    border-color: #f39c12;
    background: rgba(243, 156, 18, 0.1);
}

body.dark-mode .reminder-info h4 {
    color: #fff;
}

body.dark-mode .reminder-info p,
body.dark-mode .penalty-text small {
    color: #888;
}

body.dark-mode .attendance-row .student-name {
    color: #fff;
}

body.dark-mode .att-btn {
    border-color: #0f3460;
    color: #888;
    background: #1a1a2e;
}

body.dark-mode .att-btn.present {
    background: rgba(0, 184, 148, 0.2);
    border-color: #00b894;
    color: #00b894;
}

body.dark-mode .att-btn.absent {
    background: rgba(233, 69, 96, 0.2);
    border-color: #e94560;
    color: #e94560;
}

body.dark-mode .att-btn.late {
    background: rgba(243, 156, 18, 0.2);
    border-color: #f39c12;
    color: #f39c12;
}

body.dark-mode .tab-btn {
    background: #16213e;
    border-color: #0f3460;
    color: #888;
}

body.dark-mode .tab-btn:hover,
body.dark-mode .tab-btn.active {
    border-color: #e94560;
    color: #e94560;
    background: rgba(233, 69, 96, 0.1);
}

body.dark-mode .modal {
    background: #16213e;
    color: #e0e0e0;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
}

body.dark-mode .modal-header h3 {
    color: #fff;
}

body.dark-mode .modal-close {
    background: #1a1a2e;
    color: #888;
}

body.dark-mode .modal-close:hover {
    background: #e94560;
    color: #fff;
}

body.dark-mode .modal-overlay {
    background: rgba(0, 0, 0, 0.7);
}

body.dark-mode .notification {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

body.dark-mode .date-display {
    background: #0f3460;
    color: #e0e0e0;
}

body.dark-mode .badge {
    opacity: 0.95;
}

body.dark-mode .student-profile {
    background: #16213e;
    border-color: #0f3460;
}

body.dark-mode .student-profile h3 {
    background: linear-gradient(135deg, #e94560, #f39c12);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

body.dark-mode .profile-stat {
    background: #1a1a2e;
    border-color: #0f3460;
}

body.dark-mode .profile-stat .label {
    color: #777;
}

body.dark-mode .note-item {
    background: #1a1a2e;
}

body.dark-mode .note-normal {
    border-right-color: #555;
    background: #1a1a2e;
}

body.dark-mode .note-success {
    border-right-color: #00b894;
    background: rgba(0, 184, 148, 0.1);
}

body.dark-mode .note-danger {
    border-right-color: #e94560;
    background: rgba(233, 69, 96, 0.1);
}

body.dark-mode .note-warning {
    border-right-color: #f39c12;
    background: rgba(243, 156, 18, 0.1);
}

body.dark-mode .note-info {
    border-right-color: #2196f3;
    background: rgba(33, 150, 243, 0.1);
}

body.dark-mode .note-header {
    color: #888;
}

body.dark-mode .note-body {
    color: #e0e0e0;
}

body.dark-mode .pagination-wrapper {
    background: #16213e;
    border-color: #0f3460;
}

body.dark-mode .pagination-info {
    color: #888;
}

body.dark-mode .pagination-info strong {
    color: #e94560;
}

body.dark-mode .pg-btn {
    border-color: #0f3460;
    background: #1a1a2e;
    color: #888;
}

body.dark-mode .pg-btn:hover:not(:disabled):not(.active) {
    border-color: #e94560;
    color: #e94560;
}

body.dark-mode .pg-btn.active {
    background: linear-gradient(135deg, #e94560, #f39c12);
    border-color: transparent;
    color: #fff;
}

body.dark-mode .student-picker-input {
    background: #1a1a2e;
    border-color: #0f3460;
    color: #e0e0e0;
}

body.dark-mode .student-picker-dropdown {
    background: #16213e;
    border-color: #0f3460;
}

body.dark-mode .student-picker-item {
    border-bottom-color: #0f3460;
    color: #e0e0e0;
}

body.dark-mode .student-picker-item:hover,
body.dark-mode .student-picker-item.highlighted {
    background: rgba(233, 69, 96, 0.15);
    color: #e94560;
}

body.dark-mode .jdp-container {
    background: #16213e;
    border-color: #0f3460;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.5);
}

body.dark-mode .jdp-title {
    color: #fff;
}

body.dark-mode .jdp-weekday {
    color: #888;
}

body.dark-mode .jdp-day {
    color: #e0e0e0;
}

body.dark-mode .jdp-day:hover {
    background: #0f3460;
}

body.dark-mode .jdp-day.today {
    background: rgba(233, 69, 96, 0.2);
    color: #e94560;
}

body.dark-mode .jdp-day.selected {
    background: linear-gradient(135deg, #e94560, #f39c12);
    color: #fff;
}

body.dark-mode .jdp-header button {
    background: #1a1a2e;
    color: #e0e0e0;
}

body.dark-mode .jdp-header button:hover {
    background: #e94560;
    color: #fff;
}

body.dark-mode .jdp-footer {
    border-top-color: #0f3460;
}

body.dark-mode .schedule-container {
    background: #16213e;
    border-color: #0f3460;
}

body.dark-mode .schedule-cell {
    background: #1a1a2e;
    border-color: #0f3460;
    color: #888;
}

body.dark-mode .schedule-cell:hover {
    border-color: #e94560;
    background: #0f1629;
}

body.dark-mode .schedule-period-cell {
    background: linear-gradient(135deg, #0f3460, #16213e);
    color: #e94560;
}

body.dark-mode .schedule-period-cell small {
    color: #666;
}

body.dark-mode .group-set-card {
    background: #16213e;
    border-color: #0f3460;
    color: #e0e0e0;
}

body.dark-mode .group-set-info h4 {
    color: #fff;
}

body.dark-mode .group-set-info p {
    color: #888;
}

body.dark-mode .group-card {
    background: #16213e;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.3);
}

body.dark-mode .group-members-list {
    background: #1a1a2e;
}

body.dark-mode .group-member {
    background: #16213e;
    border-color: #0f3460;
    color: #e0e0e0;
}

body.dark-mode .group-member:hover {
    background: #0f1629;
    border-color: #e94560;
}

body.dark-mode .group-score-display {
    background: #1a1a2e;
    border-color: #0f3460;
    color: #e0e0e0;
}

body.dark-mode .unassigned-panel {
    background: rgba(243, 156, 18, 0.1);
    border-color: #f39c12;
}

body.dark-mode .gc-header {
    border-bottom-color: #0f3460;
}

body.dark-mode .gc-name {
    color: #fff;
}

body.dark-mode .gc-type-select {
    background: #1a1a2e;
    border-color: #0f3460;
    color: #e0e0e0;
}

body.dark-mode .gc-input {
    border-color: #0f3460;
    background: #1a1a2e;
    color: #e0e0e0;
}

body.dark-mode .gc-input-note {
    background: #1a1a2e;
    color: #e0e0e0;
}

body.dark-mode .gc-input-note:focus {
    background: #0f1629;
    border-color: #e94560;
}

body.dark-mode .grade-btn {
    border-color: #0f3460;
    background: #1a1a2e;
    color: #888;
}

body.dark-mode .grade-btn:hover {
    background: #0f1629;
}

body.dark-mode .att-stat {
    background: #16213e;
    border-color: #0f3460;
}

body.dark-mode .att-stat-success {
    border-color: #00b894;
    background: rgba(0, 184, 148, 0.1);
}

body.dark-mode .att-stat-danger {
    border-color: #e94560;
    background: rgba(233, 69, 96, 0.1);
}

body.dark-mode .att-stat-warning {
    border-color: #f39c12;
    background: rgba(243, 156, 18, 0.1);
}

body.dark-mode .att-stat-neutral {
    border-color: #0f3460;
    background: #1a1a2e;
}

body.dark-mode .hw-progress-wrapper {
    background: #1a1a2e;
    border-color: #0f3460;
}

body.dark-mode .hw-progress-header {
    color: #888;
}

body.dark-mode .hw-progress-header strong {
    color: #fff;
}

body.dark-mode .hw-progress-bar {
    background: #0f3460;
}

body.dark-mode .page-blocking-loader {
    background: rgba(10, 10, 30, 0.8);
}

body.dark-mode .pbl-box {
    background: #16213e;
    border-color: #0f3460;
}

body.dark-mode .pbl-text {
    color: #e0e0e0;
}

body.dark-mode .local-loader-overlay {
    background: rgba(26, 26, 46, 0.8);
}

body.dark-mode .schedule-subject-chip {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body.dark-mode .hw-assign-students-list {
    background: #1a1a2e;
    border-color: #0f3460;
}

body.dark-mode .hw-assign-chip {
    border-color: #0f3460;
    background: #16213e;
    color: #e0e0e0;
}

body.dark-mode .hw-assign-chip:hover {
    border-color: #e94560;
    color: #e94560;
}

body.dark-mode .random-result-item {
    background: #16213e;
    border-color: #0f3460;
    color: #e0e0e0;
}

body.dark-mode .random-result-name {
    color: #fff;
}

body.dark-mode .btn-outline {
    border-color: #e94560;
    color: #e94560;
}

body.dark-mode .btn-outline:hover {
    background: rgba(233, 69, 96, 0.1);
}

body.dark-mode .search-box-clear {
    background: #0f3460;
    color: #888;
}

body.dark-mode .search-box-clear:hover {
    background: #e94560;
    color: #fff;
}

body.dark-mode .student-picker-clear {
    background: #0f3460;
    color: #888;
}

body.dark-mode .color-option {
    border-color: transparent;
}

body.dark-mode .color-option.selected {
    border-color: #fff;
}

/* ===== ATTENDANCE NOTE ===== */
.att-note {
    width: 100%;
    flex-basis: 100%;
    font-size: 12px;
    color: #e67e22;
    font-weight: 600;
    margin-top: 8px;
    padding: 8px 12px;
    background: #fef3e0;
    border-radius: 8px;
    border: 1px solid #fde5b7;
    line-height: 1.5;
    order: 99;
}

/* ===== NOTIFICATION BELL & PANEL ===== */
.notif-bell-btn {
    position: relative;
    background: linear-gradient(135deg, #f0f4f8, #e8ecf1);
    border: 2px solid #e8ecf1;
    height: 40px;
    min-width: 40px;
    border-radius: 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    padding: 0 8px;
    flex-shrink: 0;
    gap: 5px;
}

.notif-count-inline {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 900;
    min-width: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(118, 75, 162, 0.3);
    font-family: inherit;
}

.notif-bell-btn.has-high .notif-count-inline {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    box-shadow: 0 2px 6px rgba(231, 76, 60, 0.4);
}

.notif-bell-btn.has-medium .notif-count-inline {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    box-shadow: 0 2px 6px rgba(243, 156, 18, 0.4);
}

.notif-bell-btn.has-low .notif-count-inline {
    background: linear-gradient(135deg, #2196f3, #1565c0);
    box-shadow: 0 2px 6px rgba(33, 150, 243, 0.4);
}

.notif-bell-btn:hover {
    border-color: #764ba2;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.05));
    transform: scale(1.05);
}

.notif-bell-btn.has-alerts {
    animation: bellShake 2.5s infinite;
    border-color: #e74c3c;
    background: linear-gradient(135deg, #fde8e8, #fff);
}

@keyframes bellShake {

    0%,
    92%,
    100% {
        transform: rotate(0);
    }

    93%,
    97% {
        transform: rotate(-10deg);
    }

    95%,
    99% {
        transform: rotate(10deg);
    }
}

.notif-bell-icon {
    font-size: 20px;
}

.notif-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: #fff;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    padding: 0 6px;
    font-size: 11px;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(231, 76, 60, 0.4);
    animation: badgePulse 1.5s ease-in-out infinite;
}

@keyframes badgePulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

/* Overlay */
.notif-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(3px);
    z-index: 9998;
    animation: pblFadeIn 0.2s ease;
}

.notif-overlay.active {
    display: block;
}

/* Panel */
.notif-panel {
    display: none;
    position: fixed;
    top: 70px;
    left: 15px;
    width: 420px;
    max-width: calc(100vw - 30px);
    height: 600px;
    max-height: calc(100vh - 90px);
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.2);
    border: 1px solid #e8ecf1;
    z-index: 9999;
    flex-direction: column;
    overflow: hidden;
    animation: notifSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.notif-panel.active {
    display: flex;
}

@keyframes notifSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.notif-panel-header {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.notif-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 900;
    transition: all 0.2s;
}

.notif-close-btn:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: rotate(90deg);
}

.notif-tabs {
    display: flex;
    gap: 4px;
    padding: 10px 12px;
    background: #f8f9fa;
    border-bottom: 1px solid #e8ecf1;
    overflow-x: auto;
    flex-shrink: 0;
}

.notif-tab {
    flex: 1;
    min-width: fit-content;
    padding: 8px 12px;
    background: #fff;
    border: 2px solid #e8ecf1;
    border-radius: 10px;
    color: #636e72;
    cursor: pointer;
    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
    transition: all 0.25s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    white-space: nowrap;
}

.notif-tab:hover {
    border-color: #764ba2;
    color: #764ba2;
}

.notif-tab.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-color: #764ba2;
    color: #fff;
    box-shadow: 0 3px 10px rgba(118, 75, 162, 0.3);
}

.tab-count {
    background: rgba(0, 0, 0, 0.1);
    padding: 2px 7px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 900;
    min-width: 20px;
}

.notif-tab.active .tab-count {
    background: rgba(255, 255, 255, 0.3);
}

.notif-list {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 12px;
    min-height: 0;
}

.notif-item {
    background: #fafbfc;
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 8px;
    border: 2px solid #e8ecf1;
    cursor: pointer;
    transition: all 0.25s;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    position: relative;
    overflow: hidden;
}

.notif-item::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 4px;
    background: var(--notif-color, #764ba2);
}

.notif-item:hover {
    background: #fff;
    border-color: var(--notif-color, #764ba2);
    transform: translateX(-3px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.notif-icon-box {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--notif-bg, #f0f4f8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.notif-content {
    flex: 1;
    min-width: 0;
}

.notif-title {
    font-size: 14px;
    font-weight: 900;
    color: #2d3436;
    margin-bottom: 4px;
    line-height: 1.4;
}

.notif-text {
    font-size: 13px;
    color: #636e72;
    margin-bottom: 5px;
    line-height: 1.6;
    word-break: break-word;
}

.notif-meta {
    font-size: 11px;
    color: #b2bec3;
    font-weight: 600;
}

.notif-empty {
    text-align: center;
    padding: 60px 20px;
    color: #b2bec3;
}

.notif-empty .empty-icon {
    font-size: 60px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.notif-empty h4 {
    font-size: 16px;
    color: #636e72;
    margin-bottom: 8px;
    font-weight: 900;
}

.notif-empty p {
    font-size: 13px;
    line-height: 1.8;
}

.notif-footer {
    padding: 10px 15px;
    background: #f8f9fa;
    border-top: 1px solid #e8ecf1;
    display: flex;
    justify-content: center;
    flex-shrink: 0;
}

.notif-refresh-btn {
    background: transparent;
    border: 2px solid #e8ecf1;
    color: #636e72;
    padding: 6px 18px;
    border-radius: 10px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s;
}

.notif-refresh-btn:hover {
    border-color: #764ba2;
    color: #764ba2;
    background: rgba(118, 75, 162, 0.05);
}

/* Responsive - موبایل */
@media (max-width: 600px) {
    .notif-panel {
        top: 55px;
        left: 5px;
        right: 5px;
        width: auto;
        bottom: 5px;
        max-height: none;
        border-radius: 14px;
        display: none;
        flex-direction: column;
    }

    .notif-panel.active {
        display: flex;
    }

    .notif-panel-header {
        padding: 12px 15px;
        flex-shrink: 0;
    }

    .notif-panel-header h3 {
        font-size: 15px;
    }

    .notif-tabs {
        padding: 8px;
        gap: 3px;
        flex-shrink: 0;
    }

    .notif-tab {
        padding: 7px 10px;
        font-size: 10px;
    }

    .tab-count {
        font-size: 9px;
        padding: 1px 5px;
    }

    .notif-list {
        padding: 8px;
        max-height: none;
        flex: 1;
        overflow-y: auto;
    }

    .notif-item {
        padding: 12px 14px;
    }

    .notif-icon-box {
        width: 38px;
        height: 38px;
        font-size: 20px;
    }

    .notif-title {
        font-size: 13px;
    }

    .notif-text {
        font-size: 12px;
    }

    .notif-footer {
        flex-shrink: 0;
        padding: 8px 12px;
    }

    .notif-bell-btn {
        height: 38px;
        min-width: 38px;
        padding: 0 6px;
    }

    .notif-bell-btn.has-count {
        padding: 0 10px 0 8px;
    }

    .notif-count-inline {
        font-size: 12px;
        padding: 2px 8px;
        min-width: 22px;
    }

    .notif-bell-icon {
        font-size: 18px;
    }
}

/* ارتفاع خیلی کم (موبایل landscape) */
@media (max-height: 500px) {
    .notif-panel {
        top: 50px;
        bottom: 5px;
        max-height: none;
    }

    .notif-panel-header {
        padding: 10px 15px;
    }

    .notif-panel-header h3 {
        font-size: 14px;
    }

    .notif-tabs {
        padding: 6px 8px;
    }

    .notif-tab {
        padding: 6px 10px;
        font-size: 10px;
    }

    .notif-item {
        padding: 10px 12px;
        margin-bottom: 6px;
    }

    .notif-icon-box {
        width: 34px;
        height: 34px;
        font-size: 18px;
    }

    .notif-title {
        font-size: 12px;
    }

    .notif-text {
        font-size: 11px;
    }

    .notif-meta {
        font-size: 10px;
    }
}

/* Dark Mode */
body.dark-mode .notif-panel {
    background: #16213e;
    border-color: #0f3460;
}

body.dark-mode .notif-tabs {
    background: #1a1a2e;
    border-bottom-color: #0f3460;
}

body.dark-mode .notif-tab {
    background: #16213e;
    border-color: #0f3460;
    color: #888;
}

body.dark-mode .notif-tab.active {
    background: linear-gradient(135deg, #e94560, #f39c12);
    border-color: transparent;
    color: #fff;
}

body.dark-mode .notif-item {
    background: #1a1a2e;
    border-color: #0f3460;
}

body.dark-mode .notif-item:hover {
    background: #0f1629;
}

body.dark-mode .notif-title {
    color: #fff;
}

body.dark-mode .notif-text {
    color: #b0b0b0;
}

body.dark-mode .notif-footer {
    background: #1a1a2e;
    border-top-color: #0f3460;
}

body.dark-mode .notif-refresh-btn {
    background: #16213e;
    border-color: #0f3460;
    color: #888;
}

body.dark-mode .notif-bell-btn {
    background: linear-gradient(135deg, #0f3460, #16213e);
    border-color: #0f3460;
}

/* ===== CUSTOM SWITCH BUTTON ===== */
.notif-switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 24px;
    flex-shrink: 0;
}

.notif-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.notif-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #b2bec3;
    transition: .3s;
}

.notif-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

.notif-switch input:checked+.notif-slider {
    background-color: #e74c3c;
    /* رنگ قرمز برای غیرفعال‌ها */
}

.notif-switch input:checked+.notif-slider:before {
    transform: translateX(22px);
}

.notif-slider.round {
    border-radius: 24px;
}

.notif-slider.round:before {
    border-radius: 50%;
}

/* هماهنگی سوییچ با تم تاریک */
body.dark-mode .notif-slider {
    background-color: #0f3460;
}

body.dark-mode .notif-switch input:checked+.notif-slider {
    background-color: #e94560;
}

/* هماهنگی کادر پیش‌نمایش با تم تاریک */
body.dark-mode #reportPreviewContent {
    background: #1a1a2e !important;
    border-color: #0f3460 !important;
}

/* ===== REPORT PREVIEW MODAL - FLEX LAYOUT ===== */
.report-preview-modal {
    max-width: 900px !important;
    width: 95% !important;
    max-height: 92vh !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 20px !important;
    overflow: hidden !important;
}

.report-preview-content {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding: 15px;
    border: 2px solid #e8ecf1;
    border-radius: 14px;
    background: #fff;
    margin-bottom: 15px;
}

.report-preview-content table {
    width: 100%;
    min-width: 500px;
}

.report-preview-actions {
    flex-shrink: 0;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
    padding-top: 10px;
    border-top: 1px solid #e8ecf1;
}

/* ریسپانسیو موبایل */
@media (max-width: 768px) {
    .report-preview-modal {
        max-width: 98% !important;
        width: 98% !important;
        max-height: 95vh !important;
        padding: 15px !important;
    }

    .report-preview-content {
        padding: 10px;
    }

    .report-preview-actions {
        justify-content: center;
    }

    .report-preview-actions .btn {
        flex: 1;
        min-width: 120px;
        justify-content: center;
    }
}

@media (max-height: 500px) {
    .report-preview-modal {
        max-height: 98vh !important;
        padding: 10px !important;
    }
}

/* تم دارک */
body.dark-mode .report-preview-content {
    background: #1a1a2e !important;
    border-color: #0f3460 !important;
    color: #e0e0e0;
}

body.dark-mode .report-preview-actions {
    border-top-color: #0f3460;
}

/* ===== QUICK FILTER BUTTONS ===== */
.quick-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
    padding: 12px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.04), rgba(118, 75, 162, 0.02));
    border-radius: 14px;
    border: 1px solid #e8ecf1;
}

.quick-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    background: #fff;
    border: 2px solid #e8ecf1;
    border-radius: 20px;
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    font-weight: 800;
    color: #636e72;
    transition: all 0.25s;
    white-space: nowrap;
}

.quick-filter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

.quick-filter-btn.active {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: scale(1.05);
}

.qf-count {
    background: rgba(0, 0, 0, 0.08);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 900;
    min-width: 20px;
    text-align: center;
}

.quick-filter-btn.active .qf-count {
    background: rgba(255, 255, 255, 0.3);
}

@media (max-width: 600px) {
    .quick-filter-row {
        gap: 6px;
        padding: 10px;
    }

    .quick-filter-btn {
        padding: 6px 10px;
        font-size: 11px;
    }

    .qf-count {
        font-size: 10px;
        padding: 1px 6px;
    }
}

/* تم دارک */
body.dark-mode .quick-filter-row {
    background: linear-gradient(135deg, rgba(233, 69, 96, 0.08), rgba(243, 156, 18, 0.04));
    border-color: #0f3460;
}

body.dark-mode .quick-filter-btn {
    background: #16213e;
    border-color: #0f3460;
    color: #b0b0b0;
}

body.dark-mode .qf-count {
    background: rgba(255, 255, 255, 0.1);
}

/* ===== LUCKY WHEEL ===== */
#wheelCanvas {
    border-radius: 50%;
    box-shadow: 0 0 0 8px #f39c12, 0 0 0 12px #e67e22, 0 10px 30px rgba(0, 0, 0, 0.15);
}

@media (max-width: 768px) {
    #page-wheel>div:nth-child(3) {
        grid-template-columns: 1fr !important;
    }

    #wheelContainer {
        width: 260px !important;
        height: 260px !important;
    }

    #wheelCanvas {
        width: 260px !important;
        height: 260px !important;
    }
}

/* تم دارک */
body.dark-mode #wheelCanvas {
    box-shadow: 0 0 0 8px #e94560, 0 0 0 12px #c0392b, 0 10px 30px rgba(0, 0, 0, 0.4);
}