:root {
    --ink: #1f2933;
    --muted: #667085;
    --line: #202020;
    --soft-line: #d8dde6;
    --panel: #ffffff;
    --page: #f1f4f8;
    --header: #263746;
    --accent: #1f6fb2;
    --danger: #b42318;
    --success: #067647;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--page);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
}

a {
    color: var(--accent);
    text-decoration: none;
}

.main-head,
.footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 14px 34px;
    background: #fff;
    border-bottom: 1px solid var(--soft-line);
}

.brand,
.admin-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand img {
    max-height: 56px;
    max-width: 180px;
}

.brand small,
.admin-logo small,
.admin-topbar small {
    display: block;
    color: var(--muted);
    margin-top: 2px;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border: 2px solid var(--header);
    color: var(--header);
    font-weight: 700;
    letter-spacing: 0;
}

.support {
    text-align: right;
    line-height: 1.45;
}

.exam-page {
    min-height: calc(100vh - 152px);
    padding: 42px 16px;
}

.search-card {
    width: min(520px, 100%);
    margin: 0 auto;
    background: var(--panel);
    border: 1px solid var(--soft-line);
    box-shadow: 0 10px 28px rgba(28, 39, 49, 0.08);
}

.search-heading {
    padding: 18px 22px;
    color: #fff;
    background: var(--header);
    text-align: center;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0;
}

.search-body {
    padding: 24px;
}

.field {
    margin-bottom: 16px;
}

.field label {
    display: block;
    margin-bottom: 7px;
    font-weight: 700;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    min-height: 38px;
    padding: 8px 10px;
    border: 1px solid #b8c0cc;
    border-radius: 2px;
    font: inherit;
    background: #fff;
}

.field textarea {
    min-height: 78px;
    resize: vertical;
}

.captcha-row {
    display: grid;
    grid-template-columns: 145px 1fr;
    gap: 10px;
    align-items: center;
}

.captcha-box {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    background: #eef2f6;
    border: 1px dashed #9aa7b5;
    font-weight: 700;
    color: #263746;
}

.button-set {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 18px;
}

.btn,
button,
.print {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 8px 16px;
    border: 0;
    border-radius: 2px;
    background: var(--accent);
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.btn.secondary,
button.secondary {
    background: #6b7280;
}

.btn.danger,
button.danger {
    background: var(--danger);
}

.alert {
    margin: 0 0 18px;
    padding: 11px 14px;
    border-left: 4px solid var(--accent);
    background: #eef6ff;
}

.alert.error {
    border-color: var(--danger);
    background: #fff1f0;
}

.alert.success {
    border-color: var(--success);
    background: #ecfdf3;
}

.footer {
    border-top: 1px solid var(--soft-line);
    border-bottom: 0;
    color: var(--muted);
    font-size: 13px;
}

.footer-links {
    display: flex;
    gap: 14px;
}

.result-wrap {
    width: min(760px, calc(100vw - 20px));
    margin: 22px auto;
    position: relative;
}

.result-sheet {
    position: relative;
    overflow: hidden;
    background: #fff;
    border: 1px solid #000;
    padding: 10px;
}

.watermark {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    color: rgba(180, 35, 24, 0.14);
    font-size: 52px;
    font-weight: 800;
    transform: rotate(-25deg);
    text-align: center;
    z-index: 0;
}

.result-sheet > *:not(.watermark) {
    position: relative;
    z-index: 1;
}

.result-sheet table {
    width: 100%;
    border-collapse: collapse;
}

.result-meta td {
    vertical-align: middle;
    font-size: 12px;
}

.result-title {
    margin: 10px 0;
    padding: 9px;
    text-align: center;
    background: #3e3e3e;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
}

.student-grid{
    display:grid;
    grid-template-columns:1fr 235px;
    gap:12px;
    align-items:start;
}

.details-table{
    width:100%;
}

.photo-id-row{
    width:235px;
}

.photo-id-row table{
    width:100%;
    border-collapse:collapse;
}

.photo-id-row table{
    width:auto;
    border-collapse:collapse;
}

.photo-id-row td{
    width:110px;
    padding:0 6px 0 0;
    vertical-align:top;
}

.photo-box,
.verify-box{
    white-space:normal;
    overflow:hidden;
    word-break:break-word;
}

.marks-table {
    margin-top: 18px;
    border: 1px solid var(--line);
}

.marks-table th,
.marks-table td {
    border-left: 1px solid var(--line);
    border-top: 1px solid var(--line);
    padding: 7px;
    font-size: 12px;
    text-align: left;
}

.marks-table tr:first-child th {
    border-top: 0;
}

.marks-table th:first-child,
.marks-table td:first-child {
    border-left: 0;
}

.marks-table th {
    font-size: 13px;
}

.marks-table .num {
    text-align: right;
}

.summary-row td {
    background: #efefef;
    text-align: center;
    font-weight: 700;
}

.note-area {
    margin-top: 14px;
    font-size: 12px;
    line-height: 1.45;
    text-align: center;
}

.button-section {
    margin: 14px 0 30px;
    text-align: center;
}

.admin-body {
    background: #eef2f6;
}

.admin-shell {
    display: grid;
    grid-template-columns: 250px 1fr;
    min-height: 100vh;
}

.admin-sidebar {
    background: #17212b;
    color: #fff;
    padding: 18px;
}

.admin-sidebar .brand-mark {
    border-color: #fff;
    color: #fff;
}

.admin-sidebar nav {
    display: grid;
    gap: 6px;
    margin-top: 24px;
}

.admin-sidebar a {
    padding: 10px 12px;
    color: #e5ebf2;
    border-radius: 4px;
}

.admin-sidebar a:hover {
    background: rgba(255, 255, 255, 0.09);
}

.admin-main {
    padding: 22px;
}

.admin-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding: 16px 18px;
    background: #fff;
    border: 1px solid var(--soft-line);
}

.panel {
    background: #fff;
    border: 1px solid var(--soft-line);
    margin-bottom: 18px;
}

.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--soft-line);
}

.panel-head h1,
.panel-head h2 {
    margin: 0;
    font-size: 20px;
}

.panel-body {
    padding: 16px;
}

.grid-2,
.grid-3,
.grid-4 {
    display: grid;
    gap: 14px;
}

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

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

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

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 10px;
    border-bottom: 1px solid var(--soft-line);
    text-align: left;
    vertical-align: top;
}

.data-table th {
    background: #f8fafc;
    font-size: 13px;
}

.table-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.mini-input {
    width: 72px;
}

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

.checkbox-line {
    display: grid;
    grid-template-columns: 20px 1fr 80px;
    align-items: center;
    gap: 8px;
}

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

.stat-card {
    padding: 18px;
    background: #fff;
    border: 1px solid var(--soft-line);
}

.stat-card strong {
    display: block;
    font-size: 28px;
}

.login-box {
    width: min(420px, calc(100vw - 24px));
    margin: 9vh auto;
    background: #fff;
    border: 1px solid var(--soft-line);
}

.login-box h1 {
    margin: 0;
    padding: 18px 20px;
    color: #fff;
    background: var(--header);
    font-size: 20px;
}

.muted {
    color: var(--muted);
}

@media (max-width: 820px) {
    .main-head,
    .footer,
    .admin-topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .support {
        text-align: left;
    }

    .admin-shell {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        position: static;
    }

    .grid-2,
    .grid-3,
    .grid-4,
    .stat-grid,
    .student-grid {
        grid-template-columns: 1fr;
    }

    .checkbox-list {
        grid-template-columns: 1fr;
    }
}

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

    .hidden-print,
    .button-section {
        display: none !important;
    }

    .result-wrap {
        width: 100%;
        margin: 0;
    }

    .result-sheet {
        border: 1px solid #000;
        box-shadow: none;
    }
    @media (max-width:820px){

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

.photo-id-row{
    width:100%;
    margin-top:15px;
}

.photo-id-row table{
    margin:auto;
}

}
}
