/**
 * erp-report-card.css v1.1.0
 * @package EducationResultPortal
 */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&family=Roboto+Condensed:wght@400;700&display=swap');

:root {
    --erp-primary:   #1a4480;
    --erp-accent:    #2563eb;
    --erp-border:    #c8d0db;
    --erp-text:      #1d1d1d;
    --erp-light:     #555;
    --erp-row-alt:   #f4f6fa;
    --erp-font:      'Roboto','Arial',sans-serif;
    --erp-font-cond: 'Roboto Condensed','Arial Narrow',sans-serif;
    --erp-fs:        8.5pt;
}

/* ── Search form ─────────────────────────────────────────────────────────────── */
.erp-search-wrap  { max-width:640px; margin:32px auto; padding:0 16px; }
.erp-search-card  { background:#fff; border:1px solid #dde2ec; border-radius:8px; padding:32px; box-shadow:0 2px 12px rgba(0,0,0,.08); }
.erp-search-title { margin:0 0 24px; font-size:22px; font-weight:700; color:var(--erp-primary); text-align:center; }
.erp-form-row     { display:grid; grid-template-columns:1fr 1fr; gap:16px; margin-bottom:16px; }
.erp-form-group   { display:flex; flex-direction:column; gap:6px; }
.erp-form-group label { font-size:13px; font-weight:600; }
.erp-required     { color:#d63638; }
.erp-input        { padding:9px 12px; border:1px solid #c3c4c7; border-radius:4px; font-size:14px; width:100%; box-sizing:border-box; }
.erp-input:focus  { outline:none; border-color:var(--erp-accent); box-shadow:0 0 0 2px rgba(37,99,235,.15); }
.erp-form-footer  { margin-top:20px; text-align:center; }
.erp-btn          { display:inline-block; padding:10px 28px; border-radius:5px; font-size:14px; font-weight:600; cursor:pointer; border:none; transition:background .15s; text-decoration:none; }
.erp-btn-primary  { background:var(--erp-primary); color:#fff; }
.erp-btn-primary:hover { background:#0f2d5a; }
.erp-btn-secondary{ background:#f0f0f1; color:var(--erp-text); border:1px solid #c3c4c7; }
.erp-not-found    { background:#fce8e8; border:1px solid #d63638; border-radius:4px; padding:12px 16px; color:#d63638; margin-top:16px; text-align:center; }

/* ── Print action bar ────────────────────────────────────────────────────────── */
.erp-print-actions { text-align:center; margin:24px 0 16px; display:flex; justify-content:center; gap:12px; }

/* ── A4 card wrapper ─────────────────────────────────────────────────────────── */
.erp-report-card { font-family:var(--erp-font); font-size:var(--erp-fs); color:var(--erp-text); max-width:900px; margin:0 auto 40px; }
.erp-a4 { background:#fff; border:1px solid #ccc; padding:8mm 10mm; box-shadow:0 4px 24px rgba(0,0,0,.12); }

/* Header */
.erp-header { display:flex; align-items:center; justify-content:space-between; gap:12px; padding-bottom:6px; border-bottom:2px solid var(--erp-primary); margin-bottom:4px; }
.erp-header-text { flex:1; text-align:center; }
.erp-institution-name { font-size:17pt; font-weight:700; color:var(--erp-primary); margin:0 0 2px; }
.erp-institution-slogan { font-style:italic; font-size:8pt; color:var(--erp-primary); opacity:.85; }
.erp-institution-meta { font-size:7.5pt; color:var(--erp-light); margin:0; line-height:1.4; }
.erp-logo { width:64px; height:64px; object-fit:contain; }
.erp-logo-placeholder { width:64px; height:64px; border:2px dashed #c3c4c7; border-radius:50%; }
.erp-logo-placeholder--opt { opacity:.25; }

/* Student banner */
.erp-student-banner { text-align:center; padding:4px 0; margin-bottom:5px; }
.erp-student-banner span { font-size:13pt; font-weight:700; }

/* Section wrapper */
.erp-section { margin-bottom:5px; }
.erp-section-title { background:#e8edf5; text-align:center; font-size:9.5pt; font-weight:700; color:var(--erp-primary); margin:0 0 3px; padding:3px 8px; border:1px solid var(--erp-border); letter-spacing:.4px; }
.erp-section-title--dark { background:var(--erp-primary); color:#fff; border-color:var(--erp-primary); -webkit-print-color-adjust:exact; print-color-adjust:exact; }

/* Details */
.erp-details-inner { display:flex; gap:10px; align-items:flex-start; }
.erp-photo-col { flex:0 0 88px; }
.erp-student-photo { width:68px; height:80px; object-fit:cover; border:1px solid var(--erp-border); display:block; margin-bottom:4px; }
.erp-photo-placeholder { background:#f6f7f7; }
.erp-photo-meta { width:88px; font-size:6pt; border-collapse:collapse; }
.erp-photo-meta td { padding:1px 2px; border:1px solid var(--erp-border); line-height:1.3; }
.erp-details-table { flex:1; border-collapse:collapse; font-size:7.5pt; width:100%; }
.erp-details-table th,.erp-details-table td { border:1px solid var(--erp-border); padding:3px 6px; line-height:1.4; }
.erp-details-table th { background:#f0f3f8; font-weight:600; width:17%; white-space:nowrap; -webkit-print-color-adjust:exact; print-color-adjust:exact; }

/* Grade table */
.erp-grade-wrapper { display:flex; gap:6px; align-items:flex-start; }
.erp-grade-table-wrap { flex:1; overflow-x:auto; }
.erp-grade-table { border-collapse:collapse; width:100%; font-size:6.5pt; font-family:var(--erp-font-cond); }
.erp-grade-table thead tr { background:var(--erp-primary); color:#fff; -webkit-print-color-adjust:exact; print-color-adjust:exact; }
.erp-grade-table th { padding:3px 2px; text-align:center; border:1px solid rgba(255,255,255,.2); font-size:6pt; line-height:1.3; }
.erp-th-subject { text-align:left !important; padding-left:4px !important; }
.erp-grade-table tbody tr:nth-child(even) { background:var(--erp-row-alt); }
.erp-grade-table tbody td { border:1px solid var(--erp-border); padding:2px 3px; line-height:1.4; }
.tc { text-align:center; }
.tl { text-align:left; padding-left:4px !important; }
.fw { font-weight:700; }
.erp-grade-cell { font-weight:700; color:var(--erp-primary); }

/* Dev panel */
.erp-dev-panel { flex:0 0 158px; display:flex; flex-direction:column; gap:4px; }
.erp-dev-title { background:var(--erp-primary); color:#fff; font-size:7pt; font-weight:700; text-align:center; padding:3px 4px; -webkit-print-color-adjust:exact; print-color-adjust:exact; }
.erp-dev-table { border-collapse:collapse; width:100%; font-size:6.5pt; }
.erp-dev-table th { background:#e8edf5; border:1px solid var(--erp-border); padding:3px 4px; font-size:6pt; font-weight:600; text-align:left; -webkit-print-color-adjust:exact; print-color-adjust:exact; }
.erp-dev-table td { border:1px solid var(--erp-border); padding:2px 4px; line-height:1.4; }
.erp-rating--excellent { color:#00a32a; font-weight:600; }
.erp-rating--good      { color:#2563eb; }
.erp-rating--improving { color:#dba617; }
.erp-rating--poor      { color:#d63638; }

/* Chart */
.erp-chart-section { border:1px solid var(--erp-border); padding:5px; margin-bottom:5px; }
#erp-score-chart { width:100% !important; max-height:110px; }

/* Overview */
.erp-overview-table { border-collapse:collapse; width:100%; font-size:7.5pt; background:#e8edf5; -webkit-print-color-adjust:exact; print-color-adjust:exact; }
.erp-overview-table th,.erp-overview-table td { border:1px solid var(--erp-border); padding:4px 8px; }
.erp-overview-table th { background:#d0d8ea; font-weight:600; white-space:nowrap; }

/* Remarks */
.erp-remarks-section { border:1px solid var(--erp-border); padding:5px 8px; font-size:7.5pt; }
.erp-remarks-row { margin-bottom:4px; }
.erp-remarks-table { width:100%; border-collapse:collapse; }
.erp-remarks-table td { padding:2px 4px; vertical-align:top; }
.erp-remarks-label { font-weight:600; white-space:nowrap; width:160px; }
.erp-sig-row { margin-bottom:6px; }
.erp-sig-block { min-width:160px; }
.erp-sig-name { font-weight:600; margin:0 0 2px; font-size:7.5pt; }
.erp-sig-line { height:30px; border-bottom:1px solid var(--erp-text); margin-bottom:2px; display:flex; align-items:flex-end; }
.erp-sig-img { max-height:28px; max-width:110px; object-fit:contain; }
.erp-sig-label { font-size:6.5pt; color:var(--erp-light); margin:0; }

/* ── @media print ────────────────────────────────────────────────────────────── */
@media print {
    @page { size:A4 portrait; margin:8mm; }

    body * { visibility:hidden; }
    .erp-a4, .erp-a4 * { visibility:visible; }

    #wpadminbar,.site-header,.site-footer,nav,.widget-area,.no-print { display:none !important; }

    .erp-a4 {
        position:fixed; top:0; left:0; width:100%;
        margin:0; padding:6mm 8mm; border:none; box-shadow:none;
        font-size:var(--erp-fs); background:#fff; color:#000;
    }

    .erp-grade-table tbody tr { page-break-inside:avoid; break-inside:avoid; }
    .erp-remarks-section { page-break-inside:avoid; break-inside:avoid; }
    a::after { content:none !important; }

    .erp-grade-table thead tr,
    .erp-section-title--dark,
    .erp-dev-title,
    .erp-details-table th,
    .erp-dev-table th,
    .erp-overview-table th,
    .erp-overview-table { -webkit-print-color-adjust:exact !important; print-color-adjust:exact !important; }
}

/* ── Responsive ──────────────────────────────────────────────────────────────── */
@media screen and (max-width:600px) {
    .erp-form-row { grid-template-columns:1fr; }
    .erp-details-inner,.erp-grade-wrapper { flex-direction:column; }
    .erp-dev-panel { flex:none; width:100%; }
}
