/* =========================================================
   XPlatform — Student Card v1.0
   ========================================================= */

/* ---------- Общие элементы страницы ---------- */

.xp-student-page {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.xp-student-page *,
.xp-student-page *::before,
.xp-student-page *::after {
    box-sizing: border-box;
}

/* ---------- Hero ---------- */

.xp-student-hero {
    position: relative;
    overflow: hidden;
    padding: 32px;
    color: #ffffff;
    border-radius: 24px;
    background:
        radial-gradient(
            circle at 92% 12%,
            rgba(255, 255, 255, 0.18),
            transparent 28%
        ),
        linear-gradient(
            135deg,
            #4338ca 0%,
            #6366f1 48%,
            #2563eb 100%
        );
    box-shadow: 0 18px 50px rgba(67, 56, 202, 0.18);
}

.xp-student-hero::after {
    content: "";
    position: absolute;
    right: -80px;
    bottom: -110px;
    width: 250px;
    height: 250px;
    border: 42px solid rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    pointer-events: none;
}

.xp-student-hero-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
}

.xp-student-hero-main {
    display: flex;
    align-items: center;
    gap: 20px;
    min-width: 0;
}

.xp-student-hero-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 76px;
    height: 76px;
    flex-shrink: 0;
    font-size: 34px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.14);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.xp-student-hero-text {
    min-width: 0;
}

.xp-student-hero-label {
    margin-bottom: 7px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.xp-student-hero-title {
    margin: 0;
    overflow-wrap: anywhere;
    color: #ffffff;
    font-size: 32px;
    line-height: 1.18;
    font-weight: 800;
}

.xp-student-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    margin-top: 12px;
}

.xp-student-hero-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: rgba(255, 255, 255, 0.86);
    font-size: 14px;
    font-weight: 600;
}

.xp-student-hero-meta-icon {
    opacity: 0.92;
}

.xp-student-hero-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    flex-shrink: 0;
}

.xp-student-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 16px;
    border: 1px solid transparent;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease,
        background 0.18s ease,
        border-color 0.18s ease;
}

.xp-student-action:hover {
    transform: translateY(-1px);
    text-decoration: none;
}

.xp-student-action-primary {
    color: #3730a3;
    background: #ffffff;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.14);
}

.xp-student-action-primary:hover {
    color: #312e81;
    background: #f8fafc;
}

.xp-student-action-secondary {
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.10);
}

.xp-student-action-secondary:hover {
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.42);
    background: rgba(255, 255, 255, 0.17);
}

/* ---------- Заголовки секций ---------- */

.xp-student-summary,
.xp-student-homework-section {
    padding: 24px;
    border: 1px solid #e5eaf2;
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.06);
}

.xp-student-section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

.xp-student-section-label {
    margin-bottom: 5px;
    color: #4f46e5;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.xp-student-section-title {
    margin: 0;
    color: #172033;
    font-size: 23px;
    line-height: 1.25;
    font-weight: 800;
}

.xp-student-section-description {
    max-width: 440px;
    margin: 0;
    color: #64748b;
    font-size: 14px;
    line-height: 1.5;
    text-align: right;
}

/* ---------- KPI ---------- */

.xp-student-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.xp-student-kpi-card {
    position: relative;
    min-width: 0;
    min-height: 154px;
    padding: 20px;
    overflow: hidden;
    border: 1px solid #e5eaf2;
    border-radius: 18px;
    background: #ffffff;
    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease,
        border-color 0.18s ease;
}

.xp-student-kpi-card::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 82px;
    height: 82px;
    border-radius: 0 0 0 82px;
    background: rgba(79, 70, 229, 0.05);
}

.xp-student-kpi-card:hover {
    transform: translateY(-2px);
    border-color: #d8def0;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
}

.xp-student-kpi-top {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.xp-student-kpi-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border-radius: 12px;
    font-size: 18px;
    background: #eef2ff;
}

.xp-student-kpi-name {
    color: #475569;
    font-size: 13px;
    line-height: 1.35;
    font-weight: 700;
}

.xp-student-kpi-value {
    position: relative;
    z-index: 1;
    margin-top: 20px;
    overflow-wrap: anywhere;
    color: #172033;
    font-size: 30px;
    line-height: 1.1;
    font-weight: 800;
}

.xp-student-kpi-caption {
    position: relative;
    z-index: 1;
    margin-top: 7px;
    color: #94a3b8;
    font-size: 12px;
    line-height: 1.4;
}

.xp-student-kpi-homework {
    border-top: 4px solid #4f46e5;
}

.xp-student-kpi-homework .xp-student-kpi-icon {
    color: #4338ca;
    background: #eef2ff;
}

.xp-student-kpi-attendance {
    border-top: 4px solid #16a34a;
}

.xp-student-kpi-attendance .xp-student-kpi-icon {
    color: #15803d;
    background: #ecfdf3;
}

.xp-student-kpi-progress {
    border-top: 4px solid #0284c7;
}

.xp-student-kpi-progress .xp-student-kpi-icon {
    color: #0369a1;
    background: #e0f2fe;
}

.xp-student-kpi-rating {
    border-top: 4px solid #d97706;
}

.xp-student-kpi-rating .xp-student-kpi-icon {
    color: #b45309;
    background: #fff7ed;
}

/* ---------- Информация и быстрые действия ---------- */

.xp-student-details-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 20px;
}

.xp-student-panel {
    min-width: 0;
    padding: 24px;
    border: 1px solid #e5eaf2;
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.06);
}

.xp-student-panel-header {
    display: flex;
    align-items: center;
    gap: 13px;
    margin-bottom: 20px;
}

.xp-student-panel-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    border-radius: 13px;
    background: #eef2ff;
    font-size: 20px;
}

.xp-student-panel-title {
    margin: 0;
    color: #172033;
    font-size: 18px;
    line-height: 1.3;
    font-weight: 800;
}

.xp-student-panel-subtitle {
    margin: 4px 0 0;
    color: #94a3b8;
    font-size: 13px;
    line-height: 1.4;
}

.xp-student-profile-list {
    margin: 0;
}

.xp-student-profile-row {
    display: grid;
    grid-template-columns: 130px minmax(0, 1fr);
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid #edf1f5;
}

.xp-student-profile-row:first-child {
    padding-top: 0;
}

.xp-student-profile-row:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.xp-student-profile-row dt {
    margin: 0;
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
}

.xp-student-profile-row dd {
    margin: 0;
    min-width: 0;
    overflow-wrap: anywhere;
    color: #1e293b;
    font-size: 14px;
    line-height: 1.5;
    font-weight: 600;
}

.xp-student-profile-email {
    color: #4f46e5 !important;
}

.xp-student-quick-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.xp-student-quick-action {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 13px;
    padding: 14px 15px;
    color: #172033;
    border: 1px solid #e6eaf0;
    border-radius: 15px;
    background: #fbfcff;
    text-decoration: none;
    transition:
        transform 0.18s ease,
        border-color 0.18s ease,
        background 0.18s ease,
        box-shadow 0.18s ease;
}

.xp-student-quick-action:hover {
    transform: translateY(-1px);
    color: #172033;
    border-color: #cfd7e6;
    background: #ffffff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.07);
    text-decoration: none;
}

.xp-student-quick-action-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: #eef2ff;
    font-size: 19px;
}

.xp-student-quick-action-content {
    min-width: 0;
}

.xp-student-quick-action-content strong {
    display: block;
    color: #172033;
    font-size: 14px;
    line-height: 1.35;
}

.xp-student-quick-action-content small {
    display: block;
    margin-top: 3px;
    color: #94a3b8;
    font-size: 12px;
    line-height: 1.4;
}

.xp-student-quick-action-arrow {
    color: #64748b;
    font-size: 18px;
    transition: transform 0.18s ease;
}

.xp-student-quick-action:hover .xp-student-quick-action-arrow {
    transform: translateX(3px);
}

/* ---------- Домашние задания ---------- */

.xp-student-homework-heading {
    margin-bottom: 18px;
}

.xp-student-homework-panel {
    min-width: 0;
    overflow: hidden;
    border: 1px solid #e5eaf2;
    border-radius: 18px;
    background: #ffffff;
}

.xp-student-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.xp-student-homework-table {
    width: 100%;
    min-width: 1120px;
    margin: 0;
    border-collapse: collapse;
    font-size: 13px;
}

.xp-student-homework-table th {
    padding: 13px 14px;
    color: #64748b;
    background: #f8fafc;
    border-bottom: 1px solid #e5eaf2;
    font-size: 11px;
    line-height: 1.35;
    font-weight: 800;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.035em;
    white-space: nowrap;
}

.xp-student-homework-table td {
    padding: 15px 14px;
    color: #334155;
    border-bottom: 1px solid #edf1f5;
    vertical-align: top;
}

.xp-student-homework-table tbody tr {
    transition: background 0.16s ease;
}

.xp-student-homework-table tbody tr:hover {
    background: #fafbff;
}

.xp-student-homework-table tbody tr:last-child td {
    border-bottom: 0;
}

.xp-student-table-center {
    text-align: center !important;
}

.xp-student-table-action-heading {
    text-align: right !important;
}

.xp-student-homework-date {
    color: #1e293b;
    font-weight: 700;
    white-space: nowrap;
}

.xp-student-homework-topic {
    max-width: 190px;
    margin-top: 4px;
    color: #94a3b8;
    font-size: 12px;
    line-height: 1.4;
}

.xp-student-homework-name {
    max-width: 220px;
    color: #172033;
    font-weight: 700;
    line-height: 1.45;
}

.xp-student-homework-deadline,
.xp-student-last-attempt {
    color: #475569;
    white-space: nowrap;
}

.xp-student-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    max-width: 180px;
    padding: 6px 9px;
    border-radius: 999px;
    font-size: 11px;
    line-height: 1.2;
    font-weight: 800;
    white-space: normal;
}

.xp-student-attempt-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 30px;
    padding: 0 8px;
    color: #3730a3;
    border-radius: 10px;
    background: #eef2ff;
    font-size: 13px;
    font-weight: 800;
}

.xp-student-grade {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 54px;
    padding: 7px 9px;
    color: #166534;
    border-radius: 10px;
    background: #ecfdf3;
    font-size: 13px;
    font-weight: 800;
}

.xp-student-comment-cell {
    max-width: 240px;
}

.xp-student-comment {
    max-width: 240px;
    color: #475569;
    font-size: 12px;
    line-height: 1.5;
    white-space: pre-line;
}

.xp-student-empty-value {
    color: #94a3b8;
    font-size: 12px;
}

.xp-student-table-action {
    text-align: right;
    white-space: nowrap;
}

.xp-student-open-quiz {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 11px;
    color: #4338ca;
    border: 1px solid #c7d2fe;
    border-radius: 10px;
    background: #eef2ff;
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
    transition:
        transform 0.16s ease,
        background 0.16s ease,
        border-color 0.16s ease;
}

.xp-student-open-quiz:hover {
    transform: translateY(-1px);
    color: #3730a3;
    border-color: #a5b4fc;
    background: #e0e7ff;
    text-decoration: none;
}

/* ---------- Пустое состояние ---------- */

.xp-student-empty-state {
    padding: 44px 24px;
    text-align: center;
}

.xp-student-empty-state-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    margin: 0 auto 15px;
    border-radius: 18px;
    background: #eef2ff;
    font-size: 27px;
}

.xp-student-empty-state h4 {
    margin: 0;
    color: #172033;
    font-size: 18px;
    font-weight: 800;
}

.xp-student-empty-state p {
    max-width: 520px;
    margin: 8px auto 0;
    color: #64748b;
    font-size: 14px;
    line-height: 1.55;
}

/* ---------- Существующий список учеников ---------- */

.xp-content-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 24px;
}

.xp-content-header h3 {
    margin: 0;
}

.xp-student-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.xp-student-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 18px;
    background: #ffffff;
    border: 1px solid #dbeafe;
    border-radius: 14px;
    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.xp-student-card:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.05);
}

.xp-student-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    font-size: 22px;
    background: #dbeafe;
    border-radius: 50%;
}

.xp-student-info {
    flex: 1;
    min-width: 0;
}

.xp-student-name {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.4;
    color: #172033;
}

.xp-student-email {
    margin-top: 4px;
    overflow-wrap: anywhere;
    font-size: 14px;
    color: #64748b;
}

.xp-student-actions {
    flex-shrink: 0;
}

/* ---------- Адаптивность ---------- */

@media (max-width: 1180px) {
    .xp-student-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .xp-student-hero-content {
        align-items: flex-start;
    }

    .xp-student-hero-actions {
        max-width: 270px;
    }
}

@media (max-width: 900px) {
    .xp-student-hero-content {
        flex-direction: column;
    }

    .xp-student-hero-actions {
        width: 100%;
        max-width: none;
        justify-content: flex-start;
    }

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

    .xp-student-section-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .xp-student-section-description {
        max-width: none;
        text-align: left;
    }
}

@media (max-width: 640px) {
    .xp-student-page {
        gap: 16px;
    }

    .xp-student-hero {
        padding: 22px;
        border-radius: 18px;
    }

    .xp-student-hero-main {
        align-items: flex-start;
        gap: 14px;
    }

    .xp-student-hero-avatar {
        width: 56px;
        height: 56px;
        border-radius: 16px;
        font-size: 25px;
    }

    .xp-student-hero-title {
        font-size: 24px;
    }

    .xp-student-hero-meta {
        flex-direction: column;
        gap: 7px;
    }

    .xp-student-hero-actions {
        flex-direction: column;
    }

    .xp-student-action {
        width: 100%;
    }

    .xp-student-summary,
    .xp-student-panel,
    .xp-student-homework-section {
        padding: 18px;
        border-radius: 16px;
    }

    .xp-student-kpi-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .xp-student-kpi-card {
        min-height: 138px;
    }

    .xp-student-profile-row {
        grid-template-columns: 1fr;
        gap: 5px;
    }

    .xp-student-section-title {
        font-size: 20px;
    }

    .xp-student-quick-action {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .xp-student-quick-action-arrow {
        display: none;
    }

    .xp-content-header,
    .xp-student-card {
        align-items: flex-start;
        flex-direction: column;
    }

    .xp-student-actions {
        width: 100%;
    }
}