.student-table td,
.student-table th {
    vertical-align: middle !important;
}

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

.student-wizard-wrap {
    border: 1px solid #e9f0d8;
}

.wizard-header {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 16px;
    direction: rtl;
}

.wizard-step {
    border: 1px solid #d9e5b8;
    background: #f7faee;
    color: #516329;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 600;
}

.wizard-step.is-active {
    background: #a5c422;
    border-color: #a5c422;
    color: #fff;
}

.wizard-step.is-done {
    background: #e7f4c8;
}

.wizard-panel {
    display: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.wizard-panel.is-active {
    display: grid;
}

.field-help {
    display: block;
    color: #6e7b52;
    margin-top: 4px;
    font-size: 12px;
}

.jalali-date-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

#school_class_search {
    direction: rtl;
}

#exam_number_block,
#semester_block,
#period_block,
#certificate_block {
    transition: all 0.2s ease;
}

.student-form-grid .check-group {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
}

.summary-note {
    background: #f7faee;
    border: 1px dashed #c3d58f;
    border-radius: 8px;
    padding: 12px;
    color: #55633a;
    font-size: 13px;
}

.wizard-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: flex-start;
    margin-top: 6px;
    direction: rtl;
}

.student-list-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.student-toolbar-row {
    align-items: flex-start;
    gap: 12px;
}

.student-list-filter {
    display: grid;
    grid-template-columns: minmax(260px, 1.2fr) minmax(210px, 0.9fr) minmax(240px, 1fr) 120px 110px;
    align-items: end;
    gap: 10px;
    flex: 1 1 100%;
    width: 100%;
    background: #ffffff;
    border: 1px solid #dfe8c9;
    border-radius: 14px;
    padding: 10px 12px;
    box-shadow: 0 8px 18px rgba(56, 74, 31, 0.08);
}

.student-filter-block {
    min-width: 0;
}

.student-filter-block--term {
    grid-column: 1 / -1;
}

.student-filter-label {
    font-size: 11px;
    font-weight: 700;
    color: #617441;
    margin-bottom: 4px;
}

.student-filter-label--empty {
    visibility: hidden;
}

.student-list-filter .form-control {
    height: 40px;
    border: 1px solid #d3dcc0;
    border-radius: 10px;
    box-shadow: none;
}

.student-list-filter .form-control:focus {
    border-color: #8ea73b;
    box-shadow: 0 0 0 3px rgba(165, 196, 34, 0.15);
}

.student-level-tabs {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #cedbb0;
    border-radius: 10px;
    background: linear-gradient(180deg, #f9fced 0%, #eef6d9 100%);
    height: 40px;
    padding: 2px 4px;
    box-sizing: border-box;
}

.student-level-chip {
    border: none;
    background: transparent;
    color: #5d6f33;
    height: 32px;
    padding: 0 14px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    min-width: 72px;
    text-align: center;
    transition: all 0.2s ease;
}

.student-level-chip:hover {
    background: rgba(165, 196, 34, 0.2);
}

.student-level-chip.is-active {
    background: #a5c422;
    color: #ffffff;
}

.student-list-year-combo {
    min-width: 0;
}

.student-year-combo {
    position: relative;
}

.student-year-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: right;
    cursor: pointer;
    gap: 8px;
    height: 40px;
    border: 1px solid #d3dcc0;
    border-radius: 10px;
    background: #ffffff;
}

.student-year-arrow {
    color: #5f6b7a;
    flex: 0 0 auto;
}

.student-year-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 30;
    background: #fff;
    border: 1px solid #d8dde5;
    border-radius: 10px;
    box-shadow: 0 10px 22px rgba(12, 33, 57, 0.12);
    padding: 10px;
}

.student-year-list {
    margin-top: 8px;
    max-height: 220px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.student-year-option {
    width: 100%;
    border: 1px solid #d8dde5;
    border-radius: 8px;
    background: #fff;
    text-align: right;
    padding: 8px 10px;
    font-size: 13px;
    color: #1f2a37;
    cursor: pointer;
}

.student-year-option:hover {
    border-color: #76a6ff;
    background: #eef4ff;
}

.student-year-option.is-selected {
    border-color: #2563eb;
    background: #dbeafe;
    color: #1d4ed8;
}

.student-year-status {
    margin-top: 8px;
    font-size: 12px;
    color: #667085;
}

.student-term-filter {
    min-width: 260px;
    border: 1px solid #cfdcb0;
    border-radius: 12px;
    background: #ffffff;
    padding: 9px 10px;
    box-shadow: inset 0 1px 0 #f6faec;
}

.student-term-filter.is-disabled {
    opacity: 0.65;
}

.student-term-title {
    font-size: 12px;
    font-weight: 700;
    color: #3e5120;
    margin-bottom: 7px;
}

.student-term-help {
    font-size: 12px;
    color: #6d7c50;
    margin-bottom: 7px;
}

.student-term-options {
    display: grid;
    gap: 7px;
}

.student-term-options--semester {
    grid-template-columns: repeat(2, minmax(96px, 1fr));
}

.student-term-options--period {
    grid-template-columns: repeat(3, minmax(88px, 1fr));
}

.student-term-options[hidden] {
    display: none !important;
}

.student-term-help[hidden] {
    display: none !important;
}

.student-term-option {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    border: 1px solid #d4debc;
    border-radius: 10px;
    background: #f9fcef;
    padding: 7px 9px;
    font-size: 12px;
    color: #314417;
    margin-bottom: 0;
    cursor: pointer;
    transition: all 0.15s ease;
}

.student-term-option:hover {
    border-color: #abc568;
    background: #f1f8dc;
}

.student-term-option input[type='checkbox'] {
    margin: 0;
    width: 14px;
    height: 14px;
    accent-color: #8fae2f;
}

.student-term-option-text {
    font-weight: 600;
    line-height: 1.2;
}

.student-filter-search {
    width: 100%;
}

.student-filter-size {
    width: 100%;
    min-width: 0 !important;
    max-width: none;
}

.student-filter-submit,
.student-create-btn {
    height: 40px;
    min-width: 92px;
    border-radius: 10px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    padding: 0 16px;
}

.student-list-filter .student-filter-submit {
    background: #a5c422;
    border-color: #90ab1d;
    color: #ffffff;
}

.student-list-filter .student-filter-submit:hover,
.student-list-filter .student-filter-submit:focus {
    background: #93b11e;
    border-color: #829d1b;
    color: #ffffff;
}

.student-list-head .student-create-btn {
    background: #eef5da;
    border-color: #c9db94;
    color: #49601f;
    box-shadow: 0 8px 16px rgba(73, 96, 31, 0.14);
}

.student-list-head .student-create-btn:hover,
.student-list-head .student-create-btn:focus {
    background: #dceabc;
    border-color: #b8cd7d;
    color: #3d5219;
}

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

    .wizard-panel,
    .wizard-panel.is-active {
        grid-template-columns: 1fr;
    }

    .jalali-date-grid {
        grid-template-columns: 1fr;
    }

    .student-list-filter {
        grid-template-columns: 1fr;
        align-items: end;
    }

    .student-filter-block--term {
        grid-column: auto;
    }

    .student-level-tabs {
        width: 100%;
        justify-content: space-between;
    }

    .student-list-year-combo {
        width: 100%;
    }

    .student-term-filter {
        width: 100%;
    }

    .student-term-options--period {
        grid-template-columns: repeat(2, minmax(88px, 1fr));
    }

    .student-filter-search {
        width: 100%;
    }

    .student-filter-size,
    .student-filter-submit {
        width: 100%;
    }

    .student-list-head {
        flex-direction: column;
        align-items: stretch;
    }

    .student-list-head .student-create-btn {
        width: 100%;
    }
}
