:root {
    --bg: #f4f7fb;
    --surface: #ffffff;
    --surface-soft: #eef4ff;
    --surface-muted: #f8fbff;
    --text: #10233f;
    --muted: #5f7088;
    --primary: #1f4fd7;
    --primary-soft: #dfe9ff;
    --primary-deep: #173da8;
    --success: #0f8a5f;
    --warning: #d97706;
    --danger: #c2410c;
    --border: #d9e4f2;
    --shadow: 0 18px 44px rgba(16, 35, 63, 0.08);
    --shadow-soft: 0 10px 24px rgba(16, 35, 63, 0.06);
}

.maintenance-top-actions {
    justify-content: flex-end;
}

.maintenance-grid,
.maintenance-issues,
.maintenance-actions {
    display: grid;
    gap: 16px;
}

.maintenance-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 18px;
}

.maintenance-card,
.maintenance-issue {
    padding: 20px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    box-shadow: var(--shadow-soft);
}

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

.maintenance-card-head h3 {
    margin: 0;
    font-size: 17px;
}

.maintenance-card p,
.maintenance-issue p {
    margin: 0;
    color: var(--muted);
    line-height: 1.7;
}

.maintenance-details {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(31, 79, 215, 0.10);
    color: var(--muted);
    font-size: 13px;
    line-height: 1.7;
    word-break: break-word;
}

.maintenance-status-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 84px;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 800;
    border: 1px solid transparent;
}

.maintenance-status-chip.ok {
    color: var(--success);
    background: rgba(15, 138, 95, 0.12);
    border-color: rgba(15, 138, 95, 0.18);
}

.maintenance-status-chip.warning {
    color: var(--warning);
    background: rgba(217, 119, 6, 0.10);
    border-color: rgba(217, 119, 6, 0.16);
}

.maintenance-status-chip.error {
    color: var(--danger);
    background: rgba(194, 65, 12, 0.10);
    border-color: rgba(194, 65, 12, 0.16);
}

.maintenance-status-chip.info {
    color: var(--primary);
    background: rgba(31, 79, 215, 0.10);
    border-color: rgba(31, 79, 215, 0.16);
}

.maintenance-issues {
    margin-top: 18px;
}

.maintenance-issue {
    border-inline-start: 5px solid transparent;
}

.maintenance-issue.critical,
.maintenance-issue.error {
    border-inline-start-color: var(--danger);
}

.maintenance-issue.warning {
    border-inline-start-color: var(--warning);
}

.maintenance-issue.info {
    border-inline-start-color: var(--primary);
}

.maintenance-issue strong {
    display: block;
    margin-bottom: 8px;
    font-size: 16px;
}

.maintenance-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 18px;
}

.maintenance-action-card {
    padding: 16px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    box-shadow: var(--shadow-soft);
}

.maintenance-action-card .btn-secondary {
    width: 100%;
}

.maintenance-action-help {
    margin: 12px 4px 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.7;
}

@media (max-width: 980px) {
    .maintenance-grid,
    .maintenance-actions {
        grid-template-columns: 1fr;
    }
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Tajawal", sans-serif;
    background:
        radial-gradient(circle at top right, rgba(31, 79, 215, 0.10), transparent 28%),
        linear-gradient(180deg, #f8fbff 0%, var(--bg) 100%);
    color: var(--text);
    direction: rtl;
}

a {
    color: inherit;
}

.page-shell {
    min-height: 100vh;
    padding: 32px 16px 48px;
}

.container {
    max-width: 1080px;
    margin: 0 auto;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    padding: 14px 18px;
    border: 1px solid rgba(217, 228, 242, 0.8);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-soft);
}

.topbar-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--muted);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.portal-action-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 16px;
    border-radius: 999px;
    background: linear-gradient(135deg, #1f4fd7 0%, #173da8 100%);
    color: #ffffff;
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
    box-shadow: 0 12px 26px rgba(31, 79, 215, 0.20);
}

.hero-actions {
    margin-top: 18px;
}

.hero-link-btn {
    min-width: 240px;
}

.announcement-marquee {
    position: relative;
    overflow: hidden;
    margin-bottom: 18px;
    min-height: 54px;
    border-radius: 18px;
    border: 1px solid #cfe0ff;
    background: linear-gradient(135deg, #ecf3ff 0%, #f7fbff 100%);
    box-shadow: var(--shadow-soft);
}

.announcement-track {
    position: absolute;
    top: 50%;
    white-space: nowrap;
    font-size: 16px;
    font-weight: 800;
    color: var(--primary-deep);
    transform: translateY(-50%);
    animation: announcement-slide-ltr 16s linear infinite;
}

@keyframes announcement-slide-ltr {
    from {
        transform: translate(-100%, -50%);
    }
    to {
        transform: translate(100vw, -50%);
    }
}

.lang-badge,
.status-badge,
.school-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    background: var(--surface);
    border: 1px solid var(--border);
}

.hero-card,
.panel,
.step-card,
.request-card,
.empty-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: var(--shadow);
}

.hero-card {
    padding: 34px;
    margin-bottom: 24px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(247, 251, 255, 0.98) 100%);
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 14px;
    font-weight: 800;
    margin-bottom: 16px;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

.review-grid {
    display: grid;
    grid-template-columns: 1.3fr 0.9fr;
    gap: 24px;
}

.hero-card h1,
.panel h2 {
    margin: 0 0 12px;
    font-size: clamp(26px, 4vw, 34px);
    line-height: 1.3;
}

.hero-card p,
.panel p,
.request-card p,
.field-help {
    color: var(--muted);
}

.school-name-banner {
    display: inline-flex;
    align-items: center;
    min-height: 46px;
    margin: 0 0 14px;
    padding: 0 16px;
    border-radius: 14px;
    background: linear-gradient(135deg, #edf4ff 0%, #dfe9ff 100%);
    border: 1px solid #c9d9ff;
    color: var(--primary-deep);
    font-size: 16px;
    font-weight: 800;
}

.school-card {
    background: linear-gradient(135deg, #f7faff 0%, #eef4ff 100%);
    border-radius: 20px;
    padding: 20px;
    border: 1px solid #d9e6ff;
}

.school-card h3 {
    margin: 0 0 8px;
    font-size: 18px;
}

.school-card-footer {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid rgba(31, 79, 215, 0.12);
    color: var(--muted);
    font-size: 14px;
    line-height: 1.7;
}

.meta-list {
    margin: 18px 0 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 10px;
}

.meta-list li {
    color: var(--muted);
}

.meta-list strong {
    color: var(--text);
}

.steps-grid,
.requests-list,
.info-strip {
    display: grid;
    gap: 16px;
}

.info-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 24px;
}

.operations-grid-four {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.traffic-list,
.database-cards {
    display: grid;
    gap: 16px;
}

.traffic-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.database-cards {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.traffic-card {
    padding: 20px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    box-shadow: var(--shadow-soft);
}

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

.traffic-head h3 {
    margin: 0;
    font-size: 18px;
}

.traffic-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 14px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

.info-card {
    padding: 20px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    box-shadow: var(--shadow-soft);
}

.info-card.compact {
    min-height: 100%;
}

.info-card-title {
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

.info-card-value {
    margin: 10px 0 8px;
    color: var(--text);
    font-size: 24px;
    font-weight: 800;
}

.info-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.7;
}

.steps-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 24px;
}

.steps-grid.single-step-card {
    grid-template-columns: 1fr;
}

.step-card {
    padding: 22px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.step-number {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 800;
    margin-bottom: 12px;
}

.step-card h3,
.request-card h3 {
    margin: 0 0 8px;
    font-size: 18px;
}

.merged-step-card {
    padding: 24px;
}

.merged-step-header {
    margin-bottom: 18px;
}

.merged-step-header h3 {
    margin: 0 0 6px;
    font-size: 20px;
}

.merged-step-header p {
    margin: 0;
}

.merged-steps-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.merged-step-item {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 16px;
    border-radius: 18px;
    background: #fff;
    border: 1px solid #dce7f5;
}

.merged-step-item h4 {
    margin: 0 0 6px;
    font-size: 17px;
}

.merged-step-item p {
    margin: 0;
    color: var(--muted);
    line-height: 1.7;
}

.panel {
    padding: 28px;
}

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

.section-heading p {
    margin: 0;
}

.section-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 999px;
    background: var(--surface-soft);
    border: 1px solid #cadcff;
    color: var(--primary-deep);
    font-size: 13px;
    font-weight: 800;
}

.review-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: end;
    margin-bottom: 16px;
}

.toolbar-field {
    min-width: 180px;
    flex: 1;
    display: grid;
    gap: 8px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.form-grid.nested {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-section {
    padding: 20px;
    border-radius: 20px;
    background: var(--surface-muted);
    border: 1px solid #dce7f5;
}

.form-section-head {
    margin-bottom: 16px;
}

.form-section-head h3 {
    margin: 0 0 6px;
    font-size: 19px;
}

.form-section-head p {
    margin: 0;
    color: var(--muted);
}

.form-group {
    display: grid;
    gap: 8px;
}

.form-group.full {
    grid-column: 1 / -1;
}

.requested-time-group {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.requested-time-group label {
    width: 100%;
    text-align: center;
}

.requested-time-group input[type="time"] {
    width: 180px;
    min-width: 180px;
    max-width: 180px;
    margin-inline: auto;
    padding-inline: 10px;
    text-align: center;
    direction: ltr;
}

.student-options-list {
    display: grid;
    gap: 10px;
}

.student-option {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    font: inherit;
    text-align: right;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.student-option:hover {
    border-color: #b8cdfa;
    box-shadow: var(--shadow-soft);
}

.student-option.active {
    background: #f4f8ff;
    border-color: #9bb6f9;
    box-shadow: 0 0 0 4px rgba(31, 79, 215, 0.08);
}

.student-option-name {
    font-weight: 800;
}

.student-option-meta {
    color: var(--muted);
    font-size: 14px;
    font-weight: 600;
}

label {
    font-size: 14px;
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px 16px;
    min-height: 52px;
    font: inherit;
    background: #fff;
    color: var(--text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #9bb6f9;
    box-shadow: 0 0 0 4px rgba(31, 79, 215, 0.10);
}

textarea {
    min-height: 110px;
    resize: vertical;
}

.inline-row {
    display: flex;
    gap: 12px;
    align-items: end;
}

.inline-row .form-group {
    flex: 1;
}

.button-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.btn,
.btn-secondary,
.btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    border-radius: 14px;
    padding: 0 18px;
    border: none;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    text-decoration: none;
}

.btn {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 10px 22px rgba(31, 79, 215, 0.22);
}

.btn-secondary {
    background: var(--surface-soft);
    color: var(--primary);
    border: 1px solid #cadcff;
}

.btn.is-complete,
.btn-secondary.is-complete,
.btn-danger.is-complete {
    background: #16a34a;
    color: #ffffff;
    border: 1px solid #15803d;
    box-shadow: 0 10px 22px rgba(22, 163, 74, 0.22);
}

.btn-danger {
    background: #fff2ec;
    color: var(--danger);
    border: 1px solid #ffd7c7;
}

.btn:disabled,
.btn-secondary:disabled,
.btn-danger:disabled {
    opacity: 0.65;
    cursor: wait;
}

.button-row-primary .btn {
    min-width: 220px;
}

.hint-box,
.note-box {
    border-radius: 16px;
    padding: 16px;
    margin-top: 16px;
}

.hint-box {
    background: #f8fbff;
    border: 1px dashed #c9d9f1;
}

.note-box {
    background: #fff8e8;
    border: 1px solid #fde7b2;
}

.status-box {
    border-radius: 16px;
    padding: 14px 16px;
    font-weight: 700;
    border: 1px solid var(--border);
    background: #f8fbff;
}

.status-box.info {
    color: var(--text);
    background: #f8fbff;
    border-color: #c9d9f1;
}

.status-box.success {
    color: var(--success);
    background: #ecfdf5;
    border-color: #bbf7d0;
}

.status-box.warning {
    color: var(--warning);
    background: #fff7ed;
    border-color: #fed7aa;
}

.status-box.error {
    color: var(--danger);
    background: #fff1f2;
    border-color: #fecdd3;
}

.hidden {
    display: none;
}

.hint-box strong,
.note-box strong {
    display: block;
    margin-bottom: 6px;
}

.request-card,
.empty-card {
    padding: 22px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.requests-list {
    margin-top: 16px;
}

.request-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.request-details {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.request-details span {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 12px;
    border-radius: 999px;
    background: #f8fbff;
    border: 1px solid #dce7f5;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

.status-badge.pending {
    color: var(--warning);
    background: #fff7ed;
    border-color: #fed7aa;
}

.status-badge.approved {
    color: var(--success);
    background: #ecfdf5;
    border-color: #bbf7d0;
}

.time-badge {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 12px;
    border-radius: 999px;
    background: #dcfce7;
    border: 1px solid #86efac;
    color: #166534;
    font-size: 14px;
    font-weight: 800;
}

.status-badge.rejected {
    color: var(--danger);
    background: #fff7ed;
    border-color: #fdba74;
}

.footer-note {
    margin-top: 24px;
    text-align: center;
    color: var(--muted);
    font-size: 14px;
}

.report-shell {
    display: grid;
    gap: 24px;
    margin-top: 24px;
}

.report-hero-grid {
    grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
    align-items: stretch;
}

.report-hero-side {
    display: flex;
}

.student-preview-card {
    padding: 18px 20px;
    border-radius: 20px;
    border: 1px solid #dce7f5;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    box-shadow: var(--shadow-soft);
}

.student-preview-head,
.student-preview-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.student-preview-head {
    justify-content: space-between;
    margin-bottom: 10px;
}

.student-preview-head strong {
    font-size: 20px;
}

.student-preview-meta span {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 12px;
    border-radius: 999px;
    background: #f5f8ff;
    border: 1px solid #dbe6f7;
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
}

.student-report-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(250px, 0.6fr);
    gap: 18px;
    padding: 28px;
    border-radius: 28px;
    border: 1px solid #d8e4f5;
    background:
        radial-gradient(circle at top left, rgba(31, 79, 215, 0.14), transparent 28%),
        linear-gradient(135deg, #ffffff 0%, #f7fbff 100%);
    box-shadow: var(--shadow);
}

.student-report-label {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 14px;
    border-radius: 999px;
    background: #e3edff;
    color: var(--primary-deep);
    font-size: 13px;
    font-weight: 800;
}

.student-report-main h2 {
    margin: 16px 0 8px;
    font-size: clamp(28px, 4vw, 38px);
    line-height: 1.2;
}

.student-report-main p {
    margin: 0 0 20px;
    color: var(--muted);
    font-size: 15px;
    font-weight: 600;
}

.student-report-meta-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.student-report-meta-card {
    padding: 16px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid #dce7f5;
}

.student-report-meta-card span {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.student-report-meta-card strong {
    display: block;
    font-size: 18px;
    line-height: 1.6;
}

.student-report-side {
    display: grid;
    gap: 12px;
    align-content: start;
}

.hero-pill-card {
    padding: 18px;
    border-radius: 22px;
    color: #fff;
    box-shadow: var(--shadow-soft);
}

.hero-pill-card span {
    display: block;
    margin-bottom: 10px;
    font-size: 13px;
    font-weight: 700;
    opacity: 0.9;
}

.hero-pill-card strong {
    display: block;
    font-size: 28px;
    line-height: 1.2;
}

.hero-pill-card-blue {
    background: linear-gradient(135deg, #235cff 0%, #1a44c4 100%);
}

.hero-pill-card-pink {
    background: linear-gradient(135deg, #ec4899 0%, #be185d 100%);
}

.hero-pill-card-emerald {
    background: linear-gradient(135deg, #10b981 0%, #0f8a5f 100%);
}

.report-top-grid {
    display: grid;
    grid-template-columns: minmax(300px, 0.9fr) minmax(0, 1.1fr);
    gap: 18px;
}

.today-status-card,
.report-summary-card,
.chart-card,
.certificate-card,
.follow-up-alert-card,
.student-card-panel,
.history-panel,
.rich-history-item {
    border-radius: 22px;
    border: 1px solid #dce7f5;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: var(--shadow-soft);
}

.today-status-card {
    padding: 22px;
    background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
}

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

.today-status-body {
    display: grid;
    gap: 10px;
}

.today-status-value {
    font-size: 30px;
    font-weight: 800;
    color: var(--text);
}

.today-status-time {
    color: var(--primary);
    font-size: 15px;
    font-weight: 800;
}

.today-status-body p {
    margin: 0;
    line-height: 1.8;
}

.summary-cards-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
}

.report-summary-card {
    padding: 18px;
}

.report-summary-card span {
    display: block;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.report-summary-card strong {
    display: block;
    margin: 10px 0 8px;
    font-size: 30px;
    line-height: 1;
}

.report-summary-card p {
    margin: 0;
    font-size: 13px;
    color: var(--muted);
    line-height: 1.7;
}

.tone-present {
    background: linear-gradient(180deg, #f0fdf4 0%, #ffffff 100%);
}

.tone-late {
    background: linear-gradient(180deg, #fff7ed 0%, #ffffff 100%);
}

.tone-absence {
    background: linear-gradient(180deg, #fff1f2 0%, #ffffff 100%);
}

.tone-behavior {
    background: linear-gradient(180deg, #faf5ff 0%, #ffffff 100%);
}

.tone-permission {
    background: linear-gradient(180deg, #eff6ff 0%, #ffffff 100%);
}

.report-chart-grid,
.report-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.chart-card {
    padding: 20px;
}

.chart-card h3 {
    margin: 0 0 14px;
    font-size: 19px;
}

.certificate-card {
    padding: 28px;
    text-align: center;
    background:
        radial-gradient(circle at top, rgba(255, 215, 0, 0.22), transparent 30%),
        linear-gradient(135deg, #fffdf5 0%, #ffffff 100%);
}

.certificate-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 18px;
    border-radius: 999px;
    background: #fef3c7;
    color: #92400e;
    font-size: 14px;
    font-weight: 800;
}

.certificate-card h2 {
    margin: 18px 0 10px;
    font-size: 32px;
}

.certificate-card p {
    margin: 0;
    font-size: 16px;
    line-height: 1.9;
    color: var(--muted);
}

.follow-up-alert-card {
    padding: 22px;
    background: linear-gradient(135deg, #fff7ed 0%, #fff1f2 100%);
    border-color: #fed7aa;
}

.follow-up-alert-card strong {
    display: block;
    margin-bottom: 8px;
    font-size: 24px;
    color: #9a3412;
}

.follow-up-alert-card p {
    margin: 0;
    color: #9a3412;
    line-height: 1.9;
    font-weight: 700;
}

.student-card-panel {
    padding: 22px;
}

.student-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.mini-stat {
    padding: 18px;
    border-radius: 20px;
    color: #fff;
    min-height: 126px;
}

.mini-stat span {
    display: block;
    font-size: 13px;
    font-weight: 700;
    opacity: 0.92;
}

.mini-stat strong {
    display: block;
    margin-top: 14px;
    font-size: 28px;
    line-height: 1.3;
}

.mini-stat-wide {
    grid-column: span 2;
}

.mini-stat-red { background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%); }
.mini-stat-amber { background: linear-gradient(135deg, #f59e0b 0%, #b45309 100%); }
.mini-stat-violet { background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%); }
.mini-stat-cyan { background: linear-gradient(135deg, #06b6d4 0%, #0e7490 100%); }
.mini-stat-green { background: linear-gradient(135deg, #22c55e 0%, #15803d 100%); }
.mini-stat-blue { background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%); }
.mini-stat-pink { background: linear-gradient(135deg, #ec4899 0%, #be185d 100%); }
.mini-stat-emerald { background: linear-gradient(135deg, #10b981 0%, #047857 100%); }
.mini-stat-orange { background: linear-gradient(135deg, #f97316 0%, #c2410c 100%); }
.mini-stat-sky { background: linear-gradient(135deg, #38bdf8 0%, #2563eb 100%); }

.student-history-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.history-panel {
    padding: 18px;
}

.history-panel h4 {
    margin: 0 0 14px;
    font-size: 18px;
}

.history-list,
.history-list-rich {
    display: grid;
    gap: 10px;
}

.history-item,
.rich-history-item {
    padding: 14px 16px;
}

.history-item strong,
.rich-history-item strong {
    display: block;
    margin-bottom: 8px;
    font-size: 16px;
}

.history-item span,
.rich-history-item span {
    display: block;
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 6px;
}

.rich-history-item p {
    margin: 0;
    color: var(--text);
    line-height: 1.8;
}

@media (max-width: 900px) {
    .page-shell {
        padding: 20px 14px 32px;
    }

    .hero-grid,
    .review-grid,
    .info-strip,
    .steps-grid,
    .form-grid,
    .merged-steps-list,
    .report-hero-grid,
    .report-top-grid,
    .report-chart-grid,
    .report-detail-grid,
    .student-history-grid,
    .student-report-hero {
        grid-template-columns: 1fr;
    }

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

    .hero-card,
    .panel {
        padding: 20px;
        border-radius: 20px;
    }

    .section-heading {
        flex-direction: column;
    }

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

    .student-report-meta-grid,
    .student-stats-grid,
    .summary-cards-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .page-shell {
        padding: 12px 12px 24px;
    }

    .topbar {
        gap: 10px;
        margin-bottom: 16px;
        padding: 12px 14px;
    }

    .topbar-title {
        font-size: 14px;
        text-align: center;
    }

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

    .lang-badge,
    .school-chip,
    .status-badge,
    .portal-action-link {
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    .hero-card,
    .panel,
    .step-card,
    .request-card,
    .form-section,
    .info-card,
    .school-card {
        padding: 16px;
        border-radius: 18px;
    }

    .merged-step-card,
    .merged-step-item {
        padding: 16px;
    }

    .hero-card h1,
    .panel h2 {
        margin-bottom: 10px;
        line-height: 1.4;
    }

    .school-name-banner {
        width: 100%;
        justify-content: center;
        text-align: center;
        font-size: 15px;
    }

    .school-card {
        padding: 16px;
        border-radius: 16px;
    }

    .step-card h3,
    .request-card h3,
    .school-card h3 {
        font-size: 17px;
    }

    .merged-step-item {
        gap: 12px;
    }

    .announcement-track {
        font-size: 14px;
    }

    .merged-step-item h4 {
        font-size: 16px;
    }

    .form-grid {
        gap: 14px;
    }

    .button-row {
        flex-direction: column;
        gap: 10px;
    }

    .student-option {
        align-items: flex-start;
        flex-direction: column;
    }

    .btn,
    .btn-secondary,
    .btn-danger {
        width: 100%;
        min-height: 50px;
    }

    .request-details {
        gap: 8px;
    }

    .requested-time-group input[type="time"] {
        width: 160px;
        min-width: 160px;
        max-width: 160px;
        padding-inline: 8px;
    }

    .student-report-hero,
    .today-status-card,
    .chart-card,
    .student-card-panel {
        padding: 16px;
        border-radius: 18px;
    }

    .student-report-main h2 {
        font-size: 26px;
    }

    .student-report-meta-grid,
    .student-stats-grid,
    .summary-cards-grid {
        grid-template-columns: 1fr;
    }

    .mini-stat-wide {
        grid-column: span 1;
    }

    .request-details span,
    .section-badge {
        width: 100%;
    }

    input,
    select,
    textarea,
    .status-box,
    .hint-box,
    .note-box,
    .form-section {
        border-radius: 12px;
    }

    textarea {
        min-height: 120px;
    }
}
