@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL,GRAD@24,500,0,0');

:root {
    color-scheme: light;
    --bg: #f6f8fb;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --ink: #101828;
    --text: #344054;
    --muted: #667085;
    --line: #e4e7ec;
    --line-strong: #cbd5e1;
    --brand: #0f766e;
    --brand-dark: #115e59;
    --brand-soft: #ccfbf1;
    --accent: #2563eb;
    --ok: #047857;
    --danger: #b42318;
    --danger-soft: #fef3f2;
    --shadow: 0 14px 34px rgba(16, 24, 40, 0.08);
    --radius: 8px;
}

/* ── Toast Bildirimi ────────────────────────────────────────── */
.toast-container {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 280px;
    max-width: 480px;
    padding: 13px 18px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 8px 28px rgba(16, 24, 40, 0.14);
    font-size: 14px;
    font-weight: 700;
    pointer-events: auto;
    animation: toast-in 0.28s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.toast.toast-success {
    color: #14532d;
    background: #f0fdf4;
    border-color: #86efac;
}

.toast.toast-error {
    color: #7f1d1d;
    background: #fef2f2;
    border-color: #fca5a5;
}

.toast.toast-out {
    animation: toast-out 0.22s ease forwards;
}

.toast-icon {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
}

.toast-success .toast-icon {
    background: #16a34a;
    color: #fff;
}

.toast-error .toast-icon {
    background: #dc2626;
    color: #fff;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(-16px) scale(0.94);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes toast-out {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(-10px) scale(0.96);
    }
}
/* ── /Toast ─────────────────────────────────────────────────── */

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
}

img,
svg,
canvas,
video {
    max-width: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    background:
        linear-gradient(180deg, #eef6f5 0, rgba(238, 246, 245, 0) 260px),
        var(--bg);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
}

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

a:hover {
    color: var(--brand-dark);
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 68px;
    padding: 12px max(22px, calc((100vw - 1180px) / 2));
    background: rgba(255, 255, 255, 0.88);
    border-bottom: 1px solid rgba(228, 231, 236, 0.9);
    backdrop-filter: blur(14px);
}

.topbar strong {
    display: block;
    color: var(--ink);
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 0;
}

.brand-lockup {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.topbar .brand-word {
    font-size: 22px;
    line-height: 1;
}

.topbar span {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 13px;
}

.topbar .exam-context {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    max-width: min(680px, 100%);
    margin-top: 5px;
    padding: 4px 8px;
    color: #115e59;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 7px;
    font-size: 14px;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.topbar .brand-word span {
    display: inline;
    margin-top: 0;
    font-size: inherit;
}

.topbar .brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 0;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    color: #16a34a;
    background: #eaf6ef;
    border: 1px solid #bfe5cd;
    border-radius: 8px;
    font-family: 'Material Symbols Rounded';
    font-size: 29px;
    font-weight: 500;
    line-height: 1;
}

.topbar .brand-word-primary {
    color: #0b2a4a;
}

.topbar .brand-word-accent {
    color: #16a34a;
}

.topbar nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.topbar nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 8px 11px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
}

.topbar nav a:hover {
    color: var(--brand-dark);
    border-color: #99f6e4;
}

.teacher-chip {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 7px 10px;
    color: var(--brand-dark);
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 850;
    line-height: 1.2;
    white-space: nowrap;
}

a.teacher-chip:hover {
    color: var(--brand-dark);
    border-color: #5eead4;
    background: #d1fae5;
}

.shell {
    width: min(1180px, calc(100% - 32px));
    margin: 26px auto;
}

.shell.narrow {
    width: min(720px, calc(100% - 32px));
}

.two-col {
    display: grid;
    grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.panel {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px;
}

.panel h1,
.panel h2 {
    margin: 0 0 18px;
    color: var(--ink);
    font-weight: 800;
    line-height: 1.2;
}

.panel h1 {
    font-size: 24px;
}

.panel h2 {
    font-size: 19px;
}

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

.panel-head h1,
.panel-head h2 {
    margin: 0;
}

.stack {
    display: grid;
    gap: 14px;
}

.grid-2,
.grid-3,
.reader-grid {
    display: grid;
    gap: 12px;
}

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

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

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

label {
    display: grid;
    gap: 6px;
    color: var(--text);
    font-size: 13px;
    font-weight: 750;
}

input,
select {
    width: 100%;
    min-width: 0;
    height: 42px;
    padding: 8px 11px;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    outline: none;
    font: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus,
select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.14);
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    min-width: 0;
    padding: 8px 14px;
    color: var(--text);
    background: #fff;
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    cursor: pointer;
    font: inherit;
    font-size: 14px;
    font-weight: 800;
    text-align: center;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.button:hover {
    color: var(--ink);
    background: var(--surface-soft);
    transform: translateY(-1px);
}

.button.primary {
    color: #fff;
    background: var(--brand);
    border-color: var(--brand);
}

.button.primary:hover {
    color: #fff;
    background: var(--brand-dark);
    border-color: var(--brand-dark);
}

.button.danger {
    color: var(--danger);
    background: #fff;
    border-color: #fecdca;
}

.button.danger:hover {
    color: #fff;
    background: var(--danger);
    border-color: var(--danger);
}

.button.small {
    min-height: 34px;
    padding: 6px 10px;
    font-size: 13px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.icon-actions,
.topbar nav {
    position: relative;
    overflow: visible;
    isolation: isolate;
}

.icon-actions,
.panel-head .actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

.icon-button,
.topbar nav a.icon-button {
    position: relative;
    width: 38px;
    min-width: 38px;
    height: 38px;
    min-height: 38px;
    padding: 0;
    border-radius: 8px;
    font-size: 17px;
    line-height: 1;
}

.icon-button:hover,
.icon-button:focus-visible,
.topbar nav a.icon-button:hover,
.topbar nav a.icon-button:focus-visible {
    z-index: 200;
}

.material-symbols-rounded.button-icon {
    font-family: 'Material Symbols Rounded';
    font-weight: normal;
    font-style: normal;
    font-size: 21px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    font-feature-settings: 'liga';
    -webkit-font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
}

.button-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1em;
    height: 1em;
    line-height: 1;
}

.icon-button::after,
.topbar nav a.icon-button::after {
    content: attr(data-label);
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    z-index: 3000;
    max-width: 170px;
    padding: 6px 8px;
    color: #fff;
    background: #101828;
    border-radius: 6px;
    box-shadow: 0 8px 22px rgba(16, 24, 40, 0.18);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.2;
    text-align: center;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -4px);
    transition: opacity 0.14s ease, transform 0.14s ease;
}

.icon-button:hover::after,
.icon-button:focus-visible::after,
.topbar nav a.icon-button:hover::after,
.topbar nav a.icon-button:focus-visible::after {
    opacity: 1;
    transform: translate(-50%, 0);
}

.topbar nav a.icon-button {
    width: auto;
    min-width: 58px;
    height: auto;
    min-height: 46px;
    flex-direction: column;
    gap: 3px;
    padding: 5px 8px 6px;
}

.topbar nav a.icon-button .sr-only {
    position: static;
    width: auto;
    height: auto;
    padding: 0;
    margin: 0;
    overflow: visible;
    clip: auto;
    color: inherit;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.1;
    white-space: nowrap;
}

.topbar nav a.icon-button::after {
    content: none;
    display: none;
}

.muted {
    color: var(--muted);
    font-size: 14px;
}

.notice {
    margin: 14px 0;
    padding: 12px 14px;
    border: 1px solid transparent;
    border-radius: 6px;
    font-weight: 750;
}

.notice.success {
    color: var(--ok);
    background: #ecfdf3;
    border-color: #abefc6;
}

.notice.danger {
    color: var(--danger);
    background: var(--danger-soft);
    border-color: #fecdca;
}

.auth-shell {
    display: grid;
    place-items: center;
    min-height: 100vh;
    width: min(820px, calc(100% - 32px));
    margin: 0 auto;
}

.auth-panel {
    width: 100%;
}

.auth-brand {
    margin-bottom: 18px;
}

.auth-foot {
    margin: 14px 0 0;
    text-align: center;
}

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

.login-box {
    padding: 14px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.login-box h2 {
    margin: 0;
    color: var(--ink);
    font-size: 16px;
}

@media (max-width: 720px) {
    .login-options {
        grid-template-columns: 1fr;
    }
}

.admin-shell {
    display: grid;
    gap: 16px;
}

.teacher-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    align-items: end;
}

.admin-teachers-table input {
    min-width: 150px;
    height: 36px;
    font-size: 13px;
}

.admin-teachers-table {
    min-width: 1180px;
}

.admin-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 300px;
}

.admin-actions form {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.admin-filter-form {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.admin-filter-form input {
    width: min(320px, 100%);
}

@media (max-width: 720px) {
    .admin-shell .panel-head {
        align-items: stretch;
        flex-direction: column;
    }

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

    .admin-filter-form {
        justify-content: stretch;
    }

    .admin-filter-form input,
    .admin-filter-form .button,
    .teacher-form-grid .button {
        width: 100%;
    }

    .admin-teachers-table input {
        min-width: 132px;
    }

    .admin-actions {
        min-width: 260px;
    }
}

.expiry-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 4px 8px;
    color: var(--brand-dark);
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 850;
    white-space: nowrap;
}

.expiry-badge.is-critical {
    color: var(--danger);
    background: var(--danger-soft);
    border-color: #fecdca;
}

.profile-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.profile-summary > div {
    padding: 12px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.profile-summary span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.profile-summary strong {
    display: block;
    margin-top: 3px;
    color: var(--ink);
    font-size: 15px;
    overflow-wrap: anywhere;
}

.text-danger {
    color: var(--danger) !important;
}

.config-list {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 8px 12px;
    margin: 18px 0;
    padding: 14px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.config-list dt {
    color: var(--muted);
}

.config-list dd {
    margin: 0;
    color: var(--ink);
    font-weight: 800;
    overflow-wrap: anywhere;
}

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

.exam-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 14px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.exam-card h3 {
    margin: 0 0 4px;
    color: var(--ink);
    font-size: 16px;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.exam-date {
    display: inline-flex;
    align-items: center;
    margin-left: 8px;
    padding: 2px 7px;
    color: var(--brand-dark);
    background: var(--brand-soft);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    vertical-align: middle;
    white-space: nowrap;
}

.exam-card p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.exam-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

.scan-canvas {
    display: block;
    width: 100%;
    max-height: 460px;
    object-fit: contain;
    background:
        linear-gradient(45deg, #f1f5f9 25%, transparent 25%),
        linear-gradient(-45deg, #f1f5f9 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #f1f5f9 75%),
        linear-gradient(-45deg, transparent 75%, #f1f5f9 75%);
    background-color: #fff;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0;
    background-size: 20px 20px;
    border: 1px dashed #94a3b8;
    border-radius: 8px;
}

.answer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 10px;
}

.answer-key-shell {
    width: min(1320px, calc(100% - 32px));
}

.answer-key-panel {
    display: grid;
    gap: 16px;
}

.answer-key-panel .panel-head {
    margin-bottom: 0;
}

.answer-key-panel .panel-head p {
    margin: 5px 0 0;
}

.key-tabs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.key-tabs button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 14px;
    color: var(--text);
    background: #fff;
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    cursor: pointer;
    font: inherit;
    font-size: 14px;
    font-weight: 800;
}

.key-tabs button.active {
    color: #fff;
    background: #16a34a;
    border-color: #15803d;
    box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.16);
}

.key-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    color: var(--text);
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.key-summary strong {
    color: var(--ink);
    font-size: 15px;
}

.key-summary span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 750;
}

.key-form-grid {
    overflow-x: auto;
    padding: 14px;
    background: #eef2f6;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.key-column-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 12px;
    align-items: start;
}

.key-section-column {
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
}

.key-section-column .key-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 0;
    padding: 10px 12px;
    color: var(--ink);
    background: #f8fafc;
    border: 0;
    border-bottom: 1px solid var(--line);
    font-size: 13px;
    text-align: left;
}

.key-section-column .key-section-title strong {
    font-size: 13px;
    font-weight: 900;
    overflow-wrap: anywhere;
}

.key-section-column .key-section-title span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.key-section-questions {
    display: grid;
    gap: 1px;
    padding: 8px;
    background: #e5eaf0;
}

/* ── Bölüme toplu puan uygula çubuğu ── */
.key-section-bulk {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    padding: 6px 10px;
    background: #f1f5fb;
    border-bottom: 1px solid var(--line);
    justify-content: flex-end;
}

.bulk-score-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
    margin-right: 2px;
    letter-spacing: 0.02em;
}

/* Yanlış puan eksi prefix sarıcısı */
.score-minus-wrap {
    display: inline-flex;
    align-items: center;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    overflow: hidden;
    background: #fff;
}

.score-minus-prefix {
    padding: 0 4px;
    font-size: 13px;
    font-weight: 800;
    color: #dc2626;
    background: #fef2f2;
    border-right: 1px solid #fecaca;
    line-height: 1;
    align-self: stretch;
    display: flex;
    align-items: center;
    user-select: none;
}

.score-minus-wrap input {
    border: none !important;
    border-radius: 0 !important;
    outline: none;
    background: transparent;
}

.bulk-score-field {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: default;
}

.bulk-score-field .score-icon {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    line-height: 1;
}

.bulk-score-input {
    width: 40px;
    height: 26px;
    padding: 2px 4px;
    font-size: 12px;
    font-weight: 800;
    text-align: center;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
}

.key-bulk-apply {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 28px !important;
    height: 28px !important;
    padding: 0 !important;
    background: #16a34a !important;
    border-color: #15803d !important;
    color: #fff !important;
    border-radius: 7px !important;
    flex-shrink: 0;
    transition: box-shadow 0.2s ease;
}

.key-bulk-apply:hover {
    background: #15803d !important;
}

.key-bulk-apply:disabled {
    opacity: 0.75;
    cursor: default;
}

.key-omr-stage {
    display: flex;
    justify-content: center;
    min-width: max-content;
}

.key-paper {
    position: relative;
    width: 210mm;
    min-height: 297mm;
    padding: 10mm;
    background: #fff;
    box-shadow: 0 12px 30px rgba(16, 24, 40, 0.2);
    box-sizing: border-box;
    font-family: Inter, Arial, sans-serif;
}

.key-paper.a5 {
    width: 148mm;
    min-height: 210mm;
}

.key-paper.a6 {
    width: 105mm;
    min-height: 148mm;
    padding: 6mm;
}

.key-form-content {
    display: flex;
    flex-direction: column;
    min-height: calc(297mm - 20mm);
    height: 100%;
    padding: 5mm;
    border: 2px solid #000;
}

.key-paper.a5 .key-form-content {
    min-height: calc(210mm - 20mm);
}

.key-paper.a6 .key-form-content {
    min-height: calc(148mm - 12mm);
}

.key-omr-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1mm;
    padding-bottom: 1mm;
    border-bottom: 1px solid #000;
}

.key-header-left,
.key-header-right {
    flex: 1;
    font-size: 10px;
    font-weight: 800;
}

.key-header-right {
    text-align: right;
}

.key-header-center {
    flex: 2;
    text-align: center;
    font-size: 13px;
    font-weight: 900;
}

.key-student-info-section {
    display: flex;
    gap: 3mm;
    margin-bottom: 2mm;
}

.key-info-box {
    flex: 1.2;
    padding: 3mm;
    border: 1px solid #000;
}

.key-info-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    margin-bottom: 2mm;
    font-size: 9px;
}

.key-info-row span {
    margin-bottom: 1mm;
}

.key-write-line {
    width: 100%;
    height: 3mm;
    border-bottom: 1px dotted #666;
}

.key-coding-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5mm;
    border: 1px solid #000;
}

.key-group-area {
    align-self: flex-start;
}

.key-coding-title {
    margin-bottom: 1.5mm;
    font-size: 9px;
    font-weight: 900;
}

.key-coding-grid {
    display: flex;
    gap: 0.8mm;
}

.key-coding-col {
    display: flex;
    flex-direction: column;
    gap: 0.8mm;
}

.key-write-box {
    width: 3.5mm;
    height: 3.8mm;
    margin-bottom: 0.8mm;
    border: 1px solid #000;
}

.key-student-number-bubble {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #000;
    border-radius: 999px;
    background: #fff;
    color: #111;
}

.key-student-number-bubble {
    width: 3.2mm;
    height: 3.2mm;
    font-size: 6px;
}

.key-group-bubbles {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5mm;
}

.key-questions-area {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 2mm;
}

.key-paper.a5 .key-questions-area {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.key-paper.a6 .key-questions-area {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.key-question-col {
    display: flex;
    flex-direction: column;
}

.key-section-title {
    margin-bottom: 1.5mm;
    padding: 1mm 0;
    background: #eee;
    border: 1px solid #000;
    font-size: 10px;
    font-weight: 900;
    text-align: center;
}

.key-q-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    min-height: 36px;
    margin-bottom: 0;
    padding: 5px 8px;
    background: #fff;
    border-radius: 6px;
    font-size: 13px;
    transition: background 0.12s ease;
}

.key-q-row.has-selection {
    background: #f0fdf4;
    border-left: 3px solid #16a34a;
    padding-left: 5px;
}

.key-q-row.has-selection .key-q-num {
    color: #15803d;
    font-weight: 900;
}

.key-q-num {
    width: 32px;
    margin-right: 8px;
    text-align: right;
    font-weight: 900;
}

.key-answer-options {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    margin-right: auto;
}

.key-answer-bubble {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    margin-right: 0;
    padding: 0;
    color: #374151;
    background: #fff;
    border: 1.5px solid #9ca3af;
    border-radius: 999px;
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.key-score-field {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    width: auto;
    margin-left: 4px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    flex-shrink: 0;
}

.key-score-field span {
    white-space: nowrap;
}

.key-score-field .score-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 1;
}

.key-score-field .score-icon svg {
    display: block;
    width: 15px;
    height: 15px;
}

.key-score-field input {
    width: 44px;
    height: 26px;
    padding: 2px 4px;
    font-size: 12px;
    font-weight: 800;
    text-align: center;
}

.key-answer-bubble:hover {
    background: #f0fdf4;
    border-color: #16a34a;
    color: #15803d;
}

.key-answer-bubble.active,
.key-answer-bubble.is-selected,
.key-answer-bubble[data-selected="true"] {
    color: #fff !important;
    background: #16a34a !important;
    border-color: #15803d !important;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.28) !important;
    transform: scale(1.1);
    font-weight: 900;
}

.key-answer-bubble.selected-group {
    color: #fff;
    background: var(--brand);
    border-color: #000;
}

.key-section {
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.key-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 11px;
    background: #f1f5f9;
    border-bottom: 1px solid var(--line);
}

.key-section-head strong {
    color: var(--ink);
    font-size: 13px;
    font-weight: 900;
    overflow-wrap: anywhere;
}

.key-section-head span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
    white-space: nowrap;
}

.key-question-list {
    display: grid;
    gap: 1px;
    padding: 8px;
    background: #eef2f6;
}

.key-question {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 5px 7px;
    background: #fff;
}

.key-question > strong {
    color: var(--text);
    font-size: 13px;
    text-align: right;
}

.key-options {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
}

.key-options button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    color: var(--text);
    background: #fff;
    border: 1px solid #aebccc;
    border-radius: 999px;
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    font-weight: 900;
}

.key-options button.active {
    color: #fff;
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.answer-item {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 8px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 7px;
}

.answer-item strong {
    color: var(--text);
    font-size: 13px;
}

.answer-options {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.answer-options button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 29px;
    height: 29px;
    color: var(--text);
    background: #fff;
    border: 1px solid #bdc7d4;
    border-radius: 999px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 800;
}

.answer-options button.active {
    color: #fff;
    background: var(--brand);
    border-color: var(--brand);
}

.print-body {
    background: #d9e0e8;
}

.print-actions {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px;
    background: rgba(246, 248, 251, 0.92);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(12px);
}

.omr-page {
    position: relative;
    width: 794px;
    height: 1123px;
    margin: 24px auto 28px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(20, 31, 43, 0.18);
    overflow: hidden;
}

.marker {
    position: absolute;
    display: block;
    background: #111;
}

.compact-omr {
    font-family: Arial, Helvetica, sans-serif;
}

.form-info-box {
    position: absolute;
    left: 112px;
    top: 36px;
    width: 570px;
    height: 108px;
    border: 1.5px solid #222;
    font-size: 18px;
}

.form-info-box div {
    height: 36px;
    padding: 6px 12px;
    border-bottom: 1.5px solid #222;
}

.form-info-box div:last-child {
    border-bottom: 0;
}

.identity-code-box {
    position: absolute;
    left: 104px;
    top: 178px;
    width: 132px;
    min-height: 236px;
    padding: 10px 8px;
    display: grid;
    align-content: start;
    gap: 12px;
    border: 1.5px solid #222;
    font-size: 13px;
    text-align: center;
}

.identity-code-box .group-code,
.identity-code-box .student-no-code {
    display: grid;
    gap: 8px;
    justify-items: center;
}

.identity-code-box .code-row {
    justify-content: center;
}

.identity-code-box .digit-grid {
    width: 100%;
    gap: 4px;
}

.identity-code-box .digit-grid span,
.identity-code-box .code-row span {
    width: 15px;
    height: 15px;
    font-size: 9px;
}

.identity-code-box.no-group {
    align-content: center;
}

.section-header {
    position: absolute;
    display: grid;
    justify-items: center;
    gap: 1px;
    min-height: 34px;
    font-size: 12px;
    line-height: 1.15;
    text-align: center;
}

.section-header strong {
    font-size: 13px;
}

.section-header span {
    font-size: 9px;
}

.section-header em {
    margin-top: 2px;
    font-style: normal;
    font-size: 11px;
    word-spacing: 9px;
}

.form-title {
    position: absolute;
    left: 90px;
    top: 34px;
    width: 610px;
    text-align: center;
}

.form-title h1 {
    margin: 0 0 7px;
    font-size: 26px;
}

.form-title p {
    margin: 0 0 7px;
    font-size: 15px;
}

.student-box {
    position: absolute;
    left: 70px;
    top: 96px;
    display: grid;
    grid-template-columns: 160px 280px 120px;
    gap: 14px;
    font-size: 14px;
}

.student-box div {
    border-bottom: 1px solid #111;
    padding-bottom: 10px;
}

.question-row {
    position: absolute;
    height: 18px;
    font-size: 11px;
}

.qno {
    position: absolute;
    left: 0;
    top: -6px;
    width: 26px;
    text-align: right;
    font-weight: 700;
}

.bubble,
.bubble-label {
    position: absolute;
}

.bubble {
    border: 1.5px solid #111;
    border-radius: 999px;
}

.bubble-label {
    display: none;
    top: 8px;
    width: 14px;
    text-align: center;
    font-size: 8px;
}

.designer-layout {
    grid-template-columns: minmax(360px, 620px) minmax(320px, 1fr);
}

.designer-panel {
    display: grid;
    gap: 22px;
}

.panel-head.compact {
    margin-bottom: 10px;
}

.panel-head.compact h2 {
    font-size: 16px;
}

.section-builder,
.section-list {
    display: grid;
    gap: 10px;
}

.section-card {
    display: grid;
    gap: 12px;
    padding: 12px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.section-card-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: end;
}

.preview-wrap {
    display: grid;
    gap: 10px;
}

.preview-paper {
    position: relative;
    width: 100%;
    max-width: 430px;
    aspect-ratio: 794 / 1123;
    margin: 0 auto;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(16, 24, 40, 0.12);
    font-size: 10px;
}

.preview-svg {
    display: block;
    width: 100%;
    height: 100%;
}

.preview-actions {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.mini-head {
    position: absolute;
    left: 12%;
    top: 4%;
    width: 76%;
    text-align: center;
}

.mini-head h3 {
    margin: 8px 0 2px;
    font-size: 16px;
    line-height: 1.15;
}

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

.mini-line {
    padding-bottom: 7px;
    border-bottom: 1px solid #111;
    text-align: left;
}

.mini-meta {
    position: absolute;
    left: 8%;
    top: 16%;
    right: 8%;
    display: grid;
    grid-template-columns: 95px 1fr;
    gap: 14px;
}

.mini-meta strong,
.mini-sections strong {
    display: block;
    margin-bottom: 4px;
    font-size: 9px;
}

.mini-bubble {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 12px;
    height: 12px;
    margin: 0 3px 3px 0;
    border: 1px solid #111;
    border-radius: 999px;
    vertical-align: middle;
}

.mini-bubble span {
    transform: translateY(10px);
    font-size: 6px;
}

.mini-digits {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(18px, 1fr));
    gap: 4px;
}

.mini-digit {
    display: grid;
    justify-items: center;
}

.mini-digit strong {
    margin-bottom: 2px;
}

.mini-sections {
    position: absolute;
    left: 8%;
    top: 32%;
    right: 8%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px 12px;
    padding: 8px;
    border: 1px solid #111;
}

.mini-sections span {
    display: block;
    color: var(--muted);
    font-size: 8px;
}

.mini-questions {
    position: absolute;
    left: 7%;
    right: 7%;
    top: 45%;
    bottom: 6%;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    gap: 8px;
}

.mini-question-col {
    display: grid;
    align-content: start;
    gap: 5px;
}

.mini-question {
    display: grid;
    grid-template-columns: 18px 1fr;
    align-items: center;
    gap: 4px;
}

.mini-question strong {
    text-align: right;
    font-size: 8px;
}

.student-name-line {
    margin: 0 auto 12px;
    padding-bottom: 10px;
    width: 440px;
    border-bottom: 1px solid #111;
    text-align: left;
    font-size: 14px;
}

.coding-strip {
    position: absolute;
    left: 70px;
    top: 122px;
    right: 70px;
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 22px;
    font-size: 14px;
}

.group-code,
.student-no-code {
    display: grid;
    gap: 8px;
}

.code-row {
    display: flex;
    gap: 8px;
}

.code-row span,
.digit-grid span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border: 1.5px solid #111;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
}

.digit-grid {
    display: grid;
    gap: 8px;
}

.digit-grid div {
    display: grid;
    justify-items: center;
    gap: 4px;
}

.digit-grid em {
    font-style: normal;
    font-size: 10px;
    font-weight: 700;
}

.form-sections {
    position: absolute;
    left: 70px;
    top: 236px;
    right: 70px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 18px;
    padding: 10px;
    border: 1px solid #111;
    font-size: 11px;
}

.form-sections div {
    display: grid;
    gap: 2px;
}

.form-sections span {
    color: #333;
}

@media (max-width: 900px) {
    .topbar {
        position: static;
        align-items: flex-start;
        flex-direction: column;
        padding: 14px 18px;
    }

    body[data-page="answer-key"] .topbar,
    body[data-page="reader"] .topbar,
    body[data-page="results"] .topbar {
        align-items: center;
        flex-direction: row;
    }

    .shell {
        width: min(100% - 24px, 720px);
        margin: 18px auto;
    }

    .two-col,
    .designer-layout,
    .grid-2,
    .grid-3,
    .reader-grid {
        grid-template-columns: 1fr;
    }

    .panel {
        padding: 18px;
    }

    .panel-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .panel-head .button {
        width: 100%;
    }

    .exam-card {
        grid-template-columns: 1fr;
    }

    .exam-actions {
        justify-content: stretch;
    }

    .exam-actions .button {
        flex: 1 1 92px;
    }

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

    .section-card-head {
        grid-template-columns: 1fr;
    }

    .preview-paper {
        max-width: 100%;
    }

    .mini-meta,
    .mini-sections {
        grid-template-columns: 1fr;
    }

    .mini-sections {
        top: 36%;
    }

    .mini-questions {
        top: 52%;
    }
}

@media (max-width: 520px) {
    body {
        font-size: 14px;
    }

    .toast-container {
        left: 12px;
        right: 12px;
        transform: none;
        align-items: stretch;
    }

    .toast {
        min-width: 0;
        max-width: none;
    }

    body[data-page="answer-key"] .topbar,
    body[data-page="reader"] .topbar,
    body[data-page="results"] .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .topbar nav {
        width: 100%;
    }

    body[data-page="answer-key"] .topbar nav,
    body[data-page="reader"] .topbar nav,
    body[data-page="results"] .topbar nav {
        width: 100%;
    }

    .topbar nav a {
        flex: 1 1 auto;
    }

    .panel h1 {
        font-size: 21px;
    }

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

    .button {
        width: 100%;
    }

    .button.icon-button,
    .topbar nav a.icon-button {
        width: 38px;
        flex: 0 0 38px;
    }

    .topbar nav a.icon-button {
        width: auto;
        flex: 0 0 auto;
    }

    .print-actions .button {
        width: auto;
    }

    .results-toolbar > div,
    .results-toolbar .search-input,
    .results-toolbar .class-filter {
        width: 100%;
    }

    .results-toolbar .button {
        flex: 1 1 140px;
    }
}

@media print {
    .print-actions {
        display: none;
    }

    body,
    .print-body {
        background: #fff;
    }

    .omr-page {
        margin: 0;
        box-shadow: none;
    }
}

/* ── Öğrenci Yönetimi ───────────────────────────────────────── */
.students-shell {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
    width: min(1280px, calc(100% - 32px));
}

.students-sidebar {
    display: grid;
    gap: 16px;
}

.students-list-panel {
    display: grid;
    gap: 14px;
}

.form-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.search-input {
    height: 36px;
    min-width: 200px;
    padding: 6px 10px;
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    font: inherit;
    font-size: 13px;
    outline: none;
    transition: border-color 0.15s;
    width: auto;
}

.search-input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.class-filter {
    height: 36px;
    width: auto;
    min-width: 130px;
    padding: 6px 10px;
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    font: inherit;
    font-size: 13px;
    cursor: pointer;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    color: #fff;
    background: var(--brand);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    vertical-align: middle;
    margin-left: 6px;
}

.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.students-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

.students-table thead tr {
    background: var(--surface-soft);
    border-bottom: 2px solid var(--line);
}

.students-table th {
    padding: 10px 12px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-align: left;
    white-space: nowrap;
}

.students-table tbody tr {
    border-bottom: 1px solid var(--line);
    transition: background 0.1s;
}

.students-table tbody tr:last-child {
    border-bottom: none;
}

.students-table tbody tr:hover {
    background: #f8fafc;
}

.students-table td {
    padding: 9px 12px;
    color: var(--ink);
    vertical-align: middle;
}

.students-table .col-check {
    width: 36px;
    text-align: center;
}

.students-table .col-actions {
    width: 176px;
    white-space: nowrap;
}

.students-table td.col-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
}

.students-table td.col-actions .icon-button {
    width: 50px;
    min-width: 50px;
    height: 44px;
    min-height: 44px;
    flex-direction: column;
    gap: 2px;
    padding: 4px 5px;
}

.students-table td.col-actions .icon-button::after {
    content: none;
    display: none;
}

.students-table td.col-actions .icon-button .button-icon {
    font-size: 18px;
}

.students-table td.col-actions .icon-button .sr-only {
    position: static;
    width: auto;
    height: auto;
    padding: 0;
    margin: 0;
    overflow: visible;
    clip: auto;
    color: inherit;
    font-size: 10px;
    font-weight: 800;
    line-height: 1.05;
    white-space: nowrap;
}

.students-table .cell-no {
    font-weight: 800;
    color: var(--brand);
}

.students-table .cell-notes {
    color: var(--muted);
    font-size: 12px;
}

.table-empty {
    padding: 32px !important;
    text-align: center;
    color: var(--muted);
    font-size: 14px;
}

.csv-textarea {
    display: block;
    width: 100%;
    min-height: 110px;
    padding: 9px 11px;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    font: inherit;
    font-size: 13px;
    font-family: 'Courier New', monospace;
    resize: vertical;
    outline: none;
    transition: border-color 0.15s;
}

.csv-textarea:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

@media (max-width: 860px) {
    .students-shell {
        grid-template-columns: 1fr;
    }
}
/* ── /Öğrenci Yönetimi ──────────────────────────────────────── */

/* ── OMR Okuyucu ────────────────────────────────────────────── */
.omr-shell {
    display: grid;
    grid-template-columns: 360px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
    width: min(1300px, calc(100% - 32px));
}

.omr-sidebar {
    display: grid;
    gap: 16px;
}

.omr-camera-panel {
    display: grid;
    gap: 12px;
}

.camera-viewport {
    position: relative;
    width: 100%;
    aspect-ratio: 4/3;
    background: #111;
    border-radius: 8px;
    overflow: hidden;
}

.camera-viewport video {
    display: none;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.camera-viewport canvas {
    display: none;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.camera-hint {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #94a3b8;
}

.camera-hint span { font-size: 48px; }

.camera-hint p {
    margin: 0;
    font-size: 13px;
    text-align: center;
    padding: 0 16px;
}

.camera-status {
    position: absolute;
    bottom: 8px;
    left: 8px;
    right: 8px;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    transition: background 0.2s;
}

.camera-status--scanning { background: rgba(245,158,11,0.88); color: #fff; }
.camera-status--ok       { background: rgba(22,163,74,0.88);  color: #fff; }
.camera-status--error    { background: rgba(220,38,38,0.88);  color: #fff; }

.omr-divider {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 12px;
}

.omr-divider::before,
.omr-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--line);
}

.photo-upload-label {
    display: block;
    text-align: center;
    cursor: pointer;
}

.photo-upload-label .button {
    width: 100%;
}

/* Cevap paneli */
.omr-answers-panel {
    display: grid;
    gap: 12px;
}

.omr-stats {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.omr-answer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
}

.omr-section-block {
    background: #fff;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    overflow: hidden;
}

.omr-section-label {
    padding: 7px 10px;
    background: #f1f5f9;
    border-bottom: 1px solid var(--line);
    font-size: 12px;
    font-weight: 900;
    color: var(--ink);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.omr-row {
    display: flex;
    align-items: center;
    padding: 4px 8px;
    gap: 6px;
    border-bottom: 1px solid #f1f5f9;
}

.omr-row:last-child { border-bottom: none; }

.omr-qnum {
    width: 26px;
    text-align: right;
    font-size: 12px;
    font-weight: 800;
    color: var(--muted);
    flex-shrink: 0;
}

.omr-opts {
    display: flex;
    gap: 4px;
}

.omr-bubble {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border: 1.5px solid #9ca3af;
    border-radius: 50%;
    background: #fff;
    color: #374151;
    font: inherit;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s, color 0.12s, transform 0.12s;
}

.omr-bubble:hover {
    border-color: var(--brand);
    background: #f0fdf4;
    color: var(--brand);
}

.omr-bubble.omr-sel {
    background: #16a34a;
    border-color: #15803d;
    color: #fff;
    transform: scale(1.08);
}

.omr-bubble.omr-double {
    background: #fef2f2;
    border-color: #dc2626;
    color: #dc2626;
}

.student-lookup-result {
    margin-top: 8px;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
}

.student-lookup-result.found {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #86efac;
}

.student-lookup-result.not-found {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fca5a5;
}

@media (max-width: 900px) {
    .omr-shell {
        grid-template-columns: 1fr;
    }
}
/* ── /OMR Okuyucu ───────────────────────────────────────────── */

/* ── Sonuç Sayfası ──────────────────────────────────────────── */
.results-shell {
    display: grid;
    gap: 16px;
    width: min(1400px, calc(100% - 32px));
}

.results-stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.stat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 18px 12px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: var(--shadow);
    gap: 4px;
}

.stat-val { font-size: 28px; font-weight: 900; color: var(--ink); line-height: 1; }
.stat-lbl { font-size: 12px; color: var(--muted); font-weight: 700; text-align: center; }
.stat-card--ok .stat-val     { color: #16a34a; }
.stat-card--danger .stat-val { color: #dc2626; }

.results-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 12px 16px;
}

.results-main-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 16px;
    align-items: start;
}

.results-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
}

.results-table thead tr {
    background: #f0f4fa;
    position: sticky;
    top: 0;
    z-index: 2;
}

.results-table th {
    padding: 10px 10px;
    color: #4b5563;
    font-size: 11px;
    font-weight: 800;
    text-align: left;
    white-space: nowrap;
    border-bottom: 2px solid #d1d9e6;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.results-table th.col-score,
.results-table th.col-rank {
    text-align: center;
}

.results-table tbody tr {
    border-bottom: 1px solid var(--line);
    transition: background 0.12s ease;
}

.results-table tbody tr:nth-child(even) {
    background: #fafbfd;
}

.results-table tbody tr:hover {
    background: #eef4ff;
}

.results-table tbody tr:last-child td {
    border-bottom: none;
}

.results-table td {
    padding: 8px 10px;
    vertical-align: middle;
    border-bottom: 1px solid #edf0f5;
}

.results-table .col-check { width: 32px; text-align: center; }
.results-table .col-num   { text-align: center; font-weight: 800; }
.results-table .col-score { min-width: 64px; text-align: center; }
.results-table .col-rank  { width: 52px; text-align: center; }

/* ── Rank Badge ── */
.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 26px;
    padding: 0 5px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
}

.rank-gold {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #78350f;
    box-shadow: 0 1px 4px rgba(245,158,11,0.4);
}

.rank-silver {
    background: linear-gradient(135deg, #d1d5db, #9ca3af);
    color: #1f2937;
    box-shadow: 0 1px 4px rgba(156,163,175,0.4);
}

.rank-bronze {
    background: linear-gradient(135deg, #d97706, #b45309);
    color: #fff;
    box-shadow: 0 1px 4px rgba(180,83,9,0.35);
}

.rank-default {
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.cell-no     { font-weight: 800; color: var(--brand); }
.score-ok    { color: #16a34a; }
.score-wrong { color: #dc2626; }
.score-blank { color: var(--muted); }
.score-total { color: var(--ink); font-size: 14px !important; }

.group-badge {
    display: inline-flex; align-items: center; justify-content: center;
    width: 24px; height: 24px; background: var(--brand-soft);
    color: var(--brand-dark); border-radius: 6px; font-size: 11px; font-weight: 900;
}

.analysis-grid { display: grid; gap: 5px; max-height: 520px; overflow-y: auto; }
.analysis-row {
    display: grid;
    grid-template-columns: 28px 1fr 36px 70px;
    align-items: center; gap: 6px; font-size: 12px;
}
.analysis-qno { text-align: right; font-weight: 800; color: var(--muted); }
.analysis-bar-wrap { background: #e5e7eb; border-radius: 4px; height: 10px; overflow: hidden; }
.analysis-bar { height: 100%; border-radius: 4px; }
.bar-ok  { background: #16a34a; }
.bar-mid { background: #f59e0b; }
.bar-low { background: #dc2626; }
.analysis-pct    { font-weight: 800; color: var(--ink); }
.analysis-detail { font-size: 11px; white-space: nowrap; }

.modal-backdrop {
    position: fixed; inset: 0; background: rgba(0,0,0,0.5);
    z-index: 1000; display: flex; align-items: center;
    justify-content: center; padding: 16px;
}

/* ── Karne Modalı ── */
.report-modal-box {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 24px 72px rgba(0,0,0,0.28);
    width: min(900px, calc(100vw - 32px));
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.report-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: #f8fafc;
    border-bottom: 1px solid var(--line);
    flex-shrink: 0;
}

.report-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
    font-size: 15px;
    color: var(--ink);
}

.report-modal-body {
    overflow-y: auto;
    flex: 1;
}

/* ── Karne Header ── */
.rpt-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 24px 16px;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%);
    color: #fff;
}

.rpt-header-left { flex: 1; min-width: 0; }

.rpt-title {
    font-size: 12px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 4px;
}

.rpt-student-name {
    font-size: 22px;
    font-weight: 900;
    color: #fff;
    line-height: 1.2;
    margin-bottom: 10px;
    overflow-wrap: anywhere;
}

body[data-page="student-portal"] .rpt-title {
    color: #fff;
    font-size: 24px;
    font-weight: 900;
    line-height: 1.15;
    text-transform: none;
    letter-spacing: 0;
    margin-bottom: 7px;
    overflow-wrap: anywhere;
}

body[data-page="student-portal"] .rpt-student-name {
    color: #cbd5e1;
    font-size: 13px;
    font-weight: 800;
    margin-bottom: 10px;
}

.rpt-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    font-size: 13px;
    color: #cbd5e1;
}

.rpt-meta strong { color: #e2e8f0; }

.rpt-score-bubble {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 96px;
    padding: 14px 20px;
    background: rgba(255,255,255,0.1);
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 14px;
    backdrop-filter: blur(8px);
    flex-shrink: 0;
    gap: 2px;
}

.rpt-score-val {
    font-size: 30px;
    font-weight: 900;
    color: #4ade80;
    line-height: 1;
}

.rpt-score-lbl {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.rpt-rank-lbl {
    font-size: 12px;
    color: #fbbf24;
    font-weight: 800;
    margin-top: 4px;
}

/* ── Toplam özet bar ── */
.rpt-totals {
    display: flex;
    align-items: center;
    gap: 0;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.rpt-total-item {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 800;
    border-right: 1px solid #e2e8f0;
}

.rpt-total-item:last-child { border-right: none; }
.rpt-total-ok    { color: #16a34a; }
.rpt-total-wrong { color: #dc2626; }
.rpt-total-blank { color: #64748b; }

/* ── Bölüm başlığı ── */
.rpt-section-title {
    padding: 14px 24px 6px;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #64748b;
}

/* ── Tablo sarmalayıcı ── */
.rpt-table-wrap {
    padding: 0 16px 16px;
    overflow-x: auto;
    max-height: 380px;
    overflow-y: auto;
}

/* ── Rapor tabloları ── */
.rpt-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}

.rpt-table thead tr {
    background: #f0f4fa;
    position: sticky;
    top: 0;
}

.rpt-table th {
    padding: 9px 12px;
    font-size: 11px;
    font-weight: 800;
    color: #4b5563;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 2px solid #d1d9e6;
    white-space: nowrap;
}

.rpt-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #edf0f5;
    vertical-align: middle;
}

.rpt-table tbody tr:last-child td { border-bottom: none; }
.rpt-table tbody tr:nth-child(even) { background: #fafbfd; }
.rpt-table tbody tr:hover { background: #eef4ff; }

.col-ctr { text-align: center; }

.sect-name   { font-weight: 700; color: var(--ink); }
.rpt-ok  { color: #16a34a; font-weight: 800; }
.rpt-wr  { color: #dc2626; font-weight: 800; }
.rpt-bl  { color: #64748b; font-weight: 700; }
.rpt-net { color: #1d4ed8; font-weight: 900; }

/* Soru detay tablosu */
.rpt-qno  { font-weight: 900; color: #374151; min-width: 44px; }
.rpt-sect-lbl { font-size: 12px; color: #64748b; }
.rpt-ans  { font-weight: 900; font-size: 15px; }
.rpt-key  { font-weight: 900; font-size: 15px; color: #374151; }
.rpt-result-icon { line-height: 0; }
.rpt-dash { color: #94a3b8; }

.rpt-row-ok    td { background: #f0fdf4 !important; }
.rpt-row-wrong td { background: #fef2f2 !important; }
.rpt-row-blank td { background: #fafafa !important; }

.rpt-row-ok    .rpt-ans { color: #16a34a; }
.rpt-row-wrong .rpt-ans { color: #dc2626; }
.rpt-row-blank .rpt-ans { color: #94a3b8; }

.student-results-shell {
    width: min(1120px, calc(100% - 32px));
}

.student-report-list {
    display: grid;
    gap: 16px;
}

.student-report-card {
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
}

.student-report-details {
    border-top: 1px solid var(--line);
}

.student-report-details summary {
    padding: 12px 16px;
    color: var(--brand-dark);
    background: #f8fafc;
    cursor: pointer;
    font-size: 13px;
    font-weight: 850;
}

.student-report-details[open] summary {
    border-bottom: 1px solid var(--line);
}

/* ── Print / PDF ── */
@media print {
    /* Diğer tüm sayfa elementlerini gizle */
    body > *:not(#detailModal) { display: none !important; }
    .report-modal-head { display: none !important; }

    /* Modal backdrop’ı print için resetle */
    #detailModal {
        position: static !important;
        background: none !important;
        padding: 0 !important;
        display: block !important;
        z-index: auto !important;
    }

    .report-modal-box {
        width: 100% !important;
        max-width: 100% !important;
        max-height: none !important;
        box-shadow: none !important;
        border-radius: 0 !important;
    }

    .report-modal-body {
        overflow: visible !important;
        max-height: none !important;
    }

    .rpt-table-wrap {
        max-height: none !important;
        overflow: visible !important;
    }

    .rpt-header {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .rpt-table tbody tr:nth-child(even) {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
}

@media (max-width: 960px) {
    .results-main-grid { grid-template-columns: 1fr; }
}
/* ── /Sonuç Sayfası ─────────────────────────────────────────── */

/* ── OMR Onay Modalı ────────────────────────────────────────── */
.omr-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    display: flex;
    align-items: stretch;
    justify-content: center;
    padding: 12px;
}

.omr-modal-box {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 24px 80px rgba(0,0,0,0.4);
    width: min(960px, 100%);
    max-height: calc(100vh - 24px);
    overflow: hidden;
}

.omr-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--line);
    flex-shrink: 0;
    flex-wrap: wrap;
}

.omr-modal-head h3 { margin: 0; font-size: 17px; }

.omr-modal-canvas-wrap {
    flex: 1;
    overflow: auto;
    background: #e5e7eb;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 12px;
}

.omr-modal-canvas-wrap canvas {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 6px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}
/* ── /OMR Onay Modalı ───────────────────────────────────────── */

/* ── Tespit Edilen Meta ─────────────────────────────────────── */
.detected-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 10px;
}

.detected-meta-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.detected-meta-lbl {
    color: var(--muted);
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
}

.omr-hint-txt {
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: 7px;
    padding: 8px 12px;
    font-size: 12px;
    line-height: 1.5;
    margin: 0 0 10px;
}

.omr-hint-txt a { color: var(--brand-dark); font-weight: 700; }

.prefill-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 420px;
    gap: 18px;
    align-items: start;
}

.prefill-controls {
    grid-column: 1 / -1;
}

.prefill-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.7fr 1fr;
    gap: 12px;
}

.prefill-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 14px;
}

.prefill-actions-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.prefill-group-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.prefill-actions-divider {
    width: 1px;
    height: 24px;
    background: var(--line);
    margin: 0 4px;
    flex-shrink: 0;
}

/* Boş form indirme paneli */
.prefill-blank-panel .panel-head {
    border-bottom: 1px solid var(--line);
    padding-bottom: 12px;
    margin-bottom: 0;
}

.prefill-blank-actions {
    display: flex;
    gap: 10px;
    padding: 14px 20px;
    align-items: center;
}

.prefill-preview-panel {
    position: sticky;
    top: 82px;
}

.prefill-preview-wrap {
    max-height: calc(100vh - 190px);
    overflow: auto;
    display: flex;
    justify-content: center;
    padding: 18px;
    background: #94a3b8;
    border-radius: 8px;
}

.prefill-preview-wrap .paper {
    transform: scale(0.45);
    transform-origin: top center;
    margin-bottom: -610px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.28);
}

.prefill-text {
    font-weight: 800;
    font-size: 11px;
    line-height: 1;
    padding-left: 2mm;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.prefill-digit-box {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 8px;
}

.student-number-bubble.prefill-marked {
    background: #111;
    color: #111;
    box-shadow: inset 0 0 0 0.55mm #111;
}

.prefill-print-stage {
    position: fixed;
    left: -10000px;
    top: 0;
    width: 230mm;
    min-height: 320mm;
    background: #fff;
    pointer-events: none;
}

.prefill-print-stage .paper {
    box-shadow: none;
    transform: none;
}

@media (max-width: 1100px) {
    .prefill-shell {
        grid-template-columns: 1fr;
    }

    .prefill-preview-panel {
        position: static;
    }

    .prefill-grid {
        grid-template-columns: 1fr;
    }
}
/* ── /Tespit Edilen Meta ────────────────────────────────────── */
