body {
    font-family: "Segoe UI", Tahoma, sans-serif;
    color: #1f2937;
    background:
        radial-gradient(circle at top left, rgba(34, 197, 94, 0.12), transparent 28%),
        radial-gradient(circle at top right, rgba(59, 130, 246, 0.16), transparent 32%),
        linear-gradient(180deg, #f4f8ff 0%, #eef6f2 100%);
}

@page {
    size: A4 portrait;
    margin: 12mm;
}

.bg-soft {
    background: linear-gradient(135deg, #f4f7fb 0%, #d9e7ff 100%);
}

.small-box {
    border-radius: 1rem;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.12);
}

.report-sheet {
    max-width: 900px;
}

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

.report-toolbar {
    max-width: 980px;
    margin: 20px auto 0;
    display: flex;
    gap: 10px;
}

.report-btn {
    display: inline-block;
    padding: 10px 16px;
    border-radius: 8px;
    text-decoration: none;
    color: #fff;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    border-color: #1d4ed8;
}

.btn-success {
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    border-color: #15803d;
}

.btn-light {
    background: #e5e7eb;
    color: #111827;
}

.main-header.navbar {
    background: linear-gradient(90deg, #ffffff 0%, #eff6ff 45%, #ecfeff 100%);
    border-bottom: 1px solid #dbeafe;
}

.main-sidebar {
    background: linear-gradient(180deg, #16324f 0%, #1d4b73 55%, #24506e 100%) !important;
}

.brand-link {
    background: rgba(255, 255, 255, 0.06);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12) !important;
}

.nav-sidebar .nav-link {
    border-radius: 12px;
    margin: 4px 10px;
    color: rgba(255, 255, 255, 0.86) !important;
    transition: all 0.2s ease;
}

.nav-sidebar .nav-link:hover,
.nav-sidebar .nav-link.active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.95), rgba(16, 185, 129, 0.9)) !important;
    color: #fff !important;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.18);
}

.nav-sidebar .nav-header {
    color: rgba(191, 219, 254, 0.85) !important;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 14px 18px 6px;
}

.content-wrapper {
    background: transparent;
}

.card {
    border: 0;
    border-radius: 18px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
    overflow: hidden;
}

.card-header {
    background: linear-gradient(135deg, #f8fbff 0%, #eef8f3 100%);
    border-bottom: 1px solid #d9e8f5;
}

.table {
    --bs-table-bg: transparent;
}

.table thead th {
    background: #e0ecff;
    border-bottom-width: 1px;
    color: #15304b;
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
    background: rgba(239, 246, 255, 0.56);
}

.table-bordered > :not(caption) > * > * {
    border-color: #d8e3f1;
}

.form-control,
.form-select {
    border-radius: 12px;
    border-color: #cbd5e1;
    box-shadow: none;
}

.form-control:focus,
.form-select:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 0.2rem rgba(96, 165, 250, 0.18);
}

.alert {
    border: 0;
    border-radius: 14px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

.bg-primary {
    background: linear-gradient(135deg, #2563eb 0%, #0ea5e9 100%) !important;
}

.bg-success {
    background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%) !important;
}

.bg-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%) !important;
}

.bg-info {
    background: linear-gradient(135deg, #0891b2 0%, #14b8a6 100%) !important;
}

.report-page {
    width: 210mm;
    min-height: 297mm;
    margin: 12px auto 30px;
    background: #fff;
    padding: 18mm 16mm;
    box-shadow: 0 8px 30px rgba(15, 23, 42, 0.08);
}

.pdf-export .report-page {
    width: auto;
    min-height: auto;
    margin: 0;
    box-shadow: none;
    padding: 7mm 7mm 6mm;
}

.page-break {
    page-break-after: always;
}

.school-header {
    width: 100%;
    border-bottom: 5px double #111827;
    padding-bottom: 10px;
    margin-bottom: 16px;
}

.school-header-table {
    border-collapse: collapse;
}

.school-logo-wrap {
    width: 108px;
    padding-right: 12px;
    vertical-align: middle;
}

.school-logo-wrap-right {
    padding-right: 0;
    padding-left: 12px;
    text-align: right;
}

.school-logo {
    width: 88px;
    height: 88px;
    object-fit: contain;
}

.school-identity {
    width: auto;
    text-align: center;
    vertical-align: middle;
}

.school-line {
    margin-bottom: 2px;
}

.school-topline {
    font-size: 15px;
    line-height: 1.1;
    letter-spacing: 0.2px;
}

.school-contact {
    font-size: 13px;
    line-height: 1.35;
}

.school-name {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 0.4px;
}

.student-meta {
    width: 100%;
    margin-bottom: 18px;
    border-collapse: collapse;
}

.student-meta td {
    padding: 4px 6px;
    font-size: 13px;
}

.report-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 10px;
}

.report-table th,
.report-table td {
    border: 1px solid #111827;
    padding: 4px 3px;
    vertical-align: top;
}

.report-table th {
    background: #e5eefc;
    text-align: center;
}

.subject-name {
    font-weight: 700;
    margin-bottom: 4px;
}

.subject-block {
    margin-bottom: 16px;
}

.subject-heading {
    margin-bottom: 8px;
}

.subject-meta,
.muted {
    color: #4b5563;
    font-size: 12px;
}

.score-cell {
    text-align: center;
    font-weight: 700;
    font-size: 12px;
    vertical-align: middle !important;
    background: #f3f4f6;
}

.description-cell {
    line-height: 1.35;
    font-size: 9.8px;
    word-break: break-word;
}

.report-table-horizontal th,
.report-table-horizontal td {
    text-align: center;
}

.report-table-horizontal .description-cell {
    text-align: left;
}

.objective-list {
    margin: 0;
    padding-left: 18px;
}

.objective-list li {
    margin-bottom: 6px;
}

.no-bullet {
    list-style: none;
    padding-left: 0;
}

.attendance-box {
    margin-top: 16px;
    border: 1px solid #111827;
    padding: 12px;
}

.report-footer-grid {
    display: table;
    width: 100%;
    table-layout: fixed;
    border-spacing: 10px 0;
    margin-top: 16px;
}

.report-footer-grid > .attendance-box {
    display: table-cell;
    vertical-align: top;
    margin-top: 0;
}

.attendance-box-split {
    width: 34%;
}

.note-box {
    width: 66%;
}

.section-title {
    margin: 0 0 10px;
    font-size: 16px;
    font-weight: 700;
}

.attendance-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 10px;
}

.attendance-table td {
    padding: 4px 6px;
    border: 1px solid #111827;
    font-size: 13px;
}

.homeroom-note {
    font-size: 13px;
    line-height: 1.5;
    min-height: 86px;
    border: 1px solid #111827;
    padding: 8px 10px;
}

.signature-box {
    text-align: center;
    vertical-align: top;
    font-size: 12px;
}

.signature-right {
    text-align: center;
}

.signature-space {
    height: 42px;
}

.signature-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    margin-top: 14px;
}

.signature-table td {
    width: 50%;
    padding: 0;
    vertical-align: top;
}

.report-title {
    text-align: center;
    font-size: 18px;
    font-weight: 700;
    margin: 12px 0 16px;
}

.report-subject-table td {
    font-size: 9.8px;
}

.report-subject-table th,
.report-subject-table td {
    padding: 4px 3px;
}

.compact-score {
    font-size: 11px;
}

.report-subject-table {
    table-layout: fixed;
}

.report-subject-table .col-no,
.report-subject-table .col-subject,
.report-subject-table .col-tp,
.report-subject-table .col-score,
.report-subject-table .col-description {
    word-break: break-word;
}

.quick-link {
    display: block;
    padding: 14px 16px;
    border-radius: 16px;
    text-align: center;
    text-decoration: none;
    font-weight: 600;
    color: #15304b;
    background: linear-gradient(135deg, #eff6ff 0%, #ecfdf5 100%);
    border: 1px solid #d9e8f5;
}

.quick-link:hover {
    color: #0f172a;
    transform: translateY(-1px);
}

@media print {
    body {
        background: #fff;
    }

    .report-page {
        margin: 0;
        width: auto;
        min-height: auto;
        box-shadow: none;
        padding: 0;
    }

    .card {
        border: 1px solid #ddd;
    }
}
