* { box-sizing: border-box; }
body {
    font-family: -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    margin: 0;
    background: #eef1f4;
    color: #1f2937;
}
.wrap { max-width: 760px; margin: 0 auto; padding: 24px 16px 60px; }

/* --- Search form --- */
.search-card {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    margin-bottom: 24px;
}
.search-card h1 { font-size: 20px; margin-top: 0; }
.search-card label { display: block; margin-top: 14px; font-size: 14px; font-weight: 600; }
.search-card select, .search-card input[type=text] {
    width: 100%;
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 15px;
    margin-top: 4px;
}
.search-card button {
    margin-top: 18px;
    background: #1d4ed8;
    color: #fff;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    width: 100%;
}
.notice {
    text-align: center;
    padding: 30px 20px;
    font-size: 20px;
    font-weight: 700;
    color: #6b7280;
}

/* --- Result card --- */
.result-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    overflow: hidden;
    margin-bottom: 20px;
}
.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px 0;
}
.result-header .logo-block { display: flex; align-items: center; gap: 10px; }
.result-header img.logo { height: 48px; width: auto; }
.result-header .inst-name { font-weight: 800; font-size: 18px; }
.result-header .inst-tagline { font-size: 12px; color: #6b7280; }
.result-summary {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px 24px;
    gap: 20px;
    flex-wrap: wrap;
}
.result-summary table td { padding: 2px 10px 2px 0; font-size: 14px; vertical-align: top; }
.result-summary table td.label { font-weight: 600; color: #374151; white-space: nowrap; }
.student-name { font-size: 24px; font-weight: 800; margin: 0 0 6px; }
.student-photo {
    width: 100px; height: 120px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}
.info-table { width: 100%; border-collapse: collapse; padding: 0 24px 10px; }
.info-table td { padding: 10px 24px; border-top: 1px solid #f1f5f9; font-size: 14px; }
.info-table td.label { font-weight: 600; color: #374151; width: 160px; }
.grade-sheet-header {
    background: #16a34a;
    color: #fff;
    text-align: center;
    padding: 14px;
    font-size: 20px;
    font-weight: 800;
    margin-top: 10px;
}
.grade-table { width: 100%; border-collapse: collapse; }
.grade-table th, .grade-table td { padding: 10px 14px; border-bottom: 1px solid #f1f5f9; font-size: 14px; text-align: left; }
.grade-table th { background: #f8fafc; }
.grade-table .num-col { width: 40px; }
.status-passed { color: #166534; font-weight: 700; }
.status-failed { color: #991b1b; font-weight: 700; }
.print-bar { text-align: center; margin: 16px 0; }
.print-bar button {
    background: #374151; color: #fff; border: none; padding: 10px 20px;
    border-radius: 8px; cursor: pointer; font-size: 14px;
}
.back-link { display: block; text-align: center; margin-top: 10px; color: #1d4ed8; text-decoration: none; }

@media print {
    body { background: #fff; }
    .no-print { display: none !important; }
    .wrap { max-width: 100%; padding: 0; }
    .result-card { box-shadow: none; border-radius: 0; }
}
