/* Additions for the PHP version (the template's style.css is unchanged) */
.flash-wrap { padding-top: 16px; }
.flash-wrap .alert { margin-bottom: 8px; }
.nav-logout { color: var(--red); }
a.user-chip { text-decoration: none; }
.inline-form { display: inline; margin: 0; }
.stack > * + * { margin-top: 12px; }
.table td .btn + .btn, .table td form + form, .table td .btn + form, .table td form + .btn { margin-left: 4px; }
.table td form { display: inline; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 16px; }
.pay-qr-img { max-width: 220px; width: 100%; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.pay-thumb-img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.protected-note, .protected-note * { -webkit-user-select: none; user-select: none; }
.protected-note { position: relative; overflow: hidden; }
.note-hidden .protected-note > :not(.note-watermark) { filter: blur(14px); }
.fb-live-card .fb-opt { cursor: pointer; width: 100%; text-align: left; font: inherit; }
.fb-live-card .fb-opt[aria-pressed="true"] { outline: 3px solid var(--blue); }
.fb-opt.is-correct { border-color: var(--green); background: var(--green-soft); }
.fb-opt.is-wrong { border-color: var(--red); background: var(--red-soft); }
.admin-panel .table td, .admin-panel .table th { vertical-align: top; }
.q-preview { max-width: 520px; }
.dist-table .form-control { min-width: 70px; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
a.admin-tab { display: flex; align-items: center; gap: 6px; text-decoration: none; }
.sub-chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0; }
.sub-add .form-control { max-width: 170px; min-height: 34px; padding: 4px 10px; }
.tn-card { padding: 14px 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-2); display: grid; gap: 10px; }
.tn-upload { padding-top: 10px; border-top: 1px dashed var(--border); }
.tn-upload select.form-control { max-width: 240px; min-height: 36px; padding: 4px 10px; background: var(--surface); }
.sub-row { padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); display: grid; gap: 8px; }
.quick-upload .form-control { max-width: 230px; min-height: 36px; padding: 4px 10px; background: var(--surface); }
.setup-table { table-layout: auto; }
.setup-table th, .setup-table td { padding: 6px 6px; }
.setup-table .form-control { width: 62px; min-height: 32px; padding: 3px 6px; display: block; }
.setup-table td .small { display: block; font-size: .72rem; line-height: 1.2; }
.setup-table thead th { text-align: center; white-space: nowrap; font-size: .85rem; }
.setup-table .es-part { min-width: 150px; max-width: 260px; white-space: normal; overflow-wrap: anywhere; }
.te-warn { color: var(--amber); }
.es-topic-head th { background: var(--green-soft); color: var(--heading); text-align: left !important; }
.es-part { padding-left: 22px !important; }
.es-na { display: inline-block; min-width: 62px; text-align: center; }
.pdf-note { display: grid; gap: 12px; }
.pdf-page { width: 100%; height: auto; border: 1px solid var(--border); border-radius: 8px; background: #fff; pointer-events: none; }
.docx-note img, .file-note img { pointer-events: none; -webkit-user-drag: none; }
.mini-stat { font-size: .85rem; color: var(--text-muted); }
/* ---------- Site logo (round badge) ---------- */
.site-logo { object-fit: contain; border-radius: 50%; }
.brand-logo.site-logo { width: 46px; height: 46px; }
.footer-logo.site-logo { width: 110px; height: 110px; }
.login-logo { display: block; width: 150px; height: 150px; margin-bottom: 14px; filter: drop-shadow(0 6px 18px rgba(0, 0, 0, .25)); }
@media (max-width: 600px) { .login-logo { width: 110px; height: 110px; margin-inline: auto; } }

/* ---------- Model Set cards ---------- */
.ms-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); gap: 22px; }
.ms-card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; transition: transform .18s ease, box-shadow .18s ease; }
.ms-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.ms-head { position: relative; padding: 22px 20px 44px; color: #fff; background: var(--hero-grad); }
.ms-head::after { content: ""; position: absolute; inset: 0; background: url("../assets/images/hero-pattern.svg") center / 220px repeat; opacity: .12; pointer-events: none; }
.ms-set-no { position: absolute; top: 14px; right: 16px; z-index: 1; font-size: .72rem; font-weight: 800; letter-spacing: .12em; padding: 4px 10px; border-radius: 999px; background: rgba(255, 255, 255, .2); border: 1px solid rgba(255, 255, 255, .35); }
.ms-head-row { position: relative; z-index: 1; display: flex; align-items: center; gap: 14px; padding-right: 54px; }
.ms-icon { flex: none; display: grid; place-items: center; width: 54px; height: 54px; border-radius: 16px; font-size: 1.7rem; background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .35); }
.ms-icon img { width: 100%; height: 100%; object-fit: contain; padding: 4px; border-radius: inherit; background: #fff; }
.ms-title { margin: 0; color: #fff; font-size: 1.22rem; line-height: 1.3; }
.ms-sub { margin: 3px 0 0; font-size: .88rem; opacity: .9; }
.ms-stats { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: -28px 16px 0; }
.ms-stat { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 10px 6px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.ms-stat-icon { font-size: 1.1rem; }
.ms-stat strong { font-size: 1.45rem; line-height: 1.2; color: var(--heading); }
.ms-stat span:last-child { font-size: .78rem; color: var(--text-muted); }
.ms-body { display: flex; flex-direction: column; gap: 14px; padding: 18px 18px 20px; flex: 1; }
.ms-label { margin: 0; font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
.ms-sections { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ms-section { --c: var(--blue); --c-soft: var(--blue-soft); display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border-left: 4px solid var(--c); }
.ms-section.c1 { --c: var(--green); --c-soft: var(--green-soft); }
.ms-section.c2 { --c: var(--amber); --c-soft: var(--amber-soft); }
.ms-section.c3 { --c: #7c3aed; --c-soft: #efe7ff; }
.ms-section.c4 { --c: var(--red); --c-soft: var(--red-soft); }
.ms-section.c5 { --c: #0891b2; --c-soft: #dff5fa; }
.ms-letter { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; font-weight: 800; color: var(--c); background: var(--c-soft); }
.ms-section-main { flex: 1; min-width: 0; }
.ms-section-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.ms-topic { font-weight: 700; color: var(--heading); overflow-wrap: anywhere; }
.ms-topic small { font-weight: 500; color: var(--text-muted); }
.ms-marks { flex: none; font-size: .82rem; font-weight: 700; color: var(--c); }
.ms-bar { height: 6px; margin: 6px 0 4px; border-radius: 999px; background: var(--border); overflow: hidden; }
.ms-bar span { display: block; height: 100%; border-radius: inherit; background: var(--c); }
.ms-detail { font-size: .8rem; color: var(--text-muted); }
.ms-rules { list-style: none; margin: 0; padding: 12px 14px; border-radius: 12px; background: var(--amber-soft); font-size: .86rem; display: grid; gap: 4px; }
.ms-best { margin: 0; padding: 10px 14px; border-radius: 12px; background: var(--green-soft); font-size: .9rem; }
.ms-start { margin-top: auto; width: 100%; min-height: 52px; font-size: 1.05rem; font-weight: 800; color: #fff; border: 0; background: var(--hero-grad); box-shadow: 0 6px 18px rgba(15, 122, 74, .28); }
.ms-start:hover { filter: brightness(1.07); color: #fff; }
.ms-card form { margin-top: auto; }
/* ---------- Model Set paper (like the printed question paper) ---------- */
.model-paper { color: #111; }
.mp-head { text-align: center; padding-bottom: 8px; margin-bottom: 10px; border-bottom: 1.5px solid #111; }
.mp-title { margin: 0; font-size: 1.3rem; font-weight: 800; line-height: 1.4; color: #111; }
.mp-set { margin: 4px 0 2px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.mp-date { margin: 0 0 6px; font-weight: 600; }
.mp-key { display: block; text-align: left; margin: 0 0 2px; }
.mp-row { display: flex; justify-content: space-between; gap: 12px; font-weight: 700; }
.mp-subjects { margin: 6px 0 0; font-weight: 700; }
.mp-section { margin: 14px 0 2px; font-size: 1.08rem; font-weight: 800; text-align: center; text-decoration: underline; text-underline-offset: 4px; }
.mp-sub { margin-bottom: 6px; }
.mp-khanda { margin: 18px 0 6px; font-size: 1.05rem; font-weight: 800; text-decoration: underline; text-underline-offset: 4px; }
.mp-subject { display: flex; justify-content: space-between; font-weight: 800; padding-bottom: 2px; margin: 12px 0 6px; border-bottom: 1px dashed #555; }
.model-paper .q-item { margin: 0 0 8px; padding: 0; border: 0; }
.model-paper .q-text .q-body, .model-paper .q-subjective .q-main, .model-paper .q-subjective > .q-body { font-weight: 700; }
.model-paper .q-subjective .q-sub { font-weight: 500; }
.exam-sheet .paper-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; margin: 0 0 0 2.2em; }
.exam-sheet .paper-opts .option-btn { display: flex; align-items: baseline; gap: 6px; min-height: 0; padding: 1px 8px; line-height: 1.45; border: 1px solid transparent; border-radius: 6px; background: none; box-shadow: none; font-weight: 500; cursor: pointer; }
.exam-sheet .paper-opts .option-btn:hover { background: var(--surface-2); }
.exam-sheet .paper-opts .option-btn.selected { background: var(--green-soft); border-color: var(--green); font-weight: 700; }
.paper-key { flex: none; }
@media (max-width: 560px) { .exam-sheet .paper-opts { grid-template-columns: 1fr; margin-left: 1.6em; } .mp-title { font-size: 1.1rem; } }
.subj-topic { text-align: left; font-size: 1.02rem; font-weight: 800; color: var(--heading); margin: 14px 0 6px; padding-bottom: 3px; border-bottom: 1px dashed var(--border); }
.q-subjective .q-body .q-subs { margin-top: 4px; }
.sheet-section-title.section-center { text-align: center; display: block; }
.video-frame video { position: absolute; inset: 0; width: 100%; height: 100%; background: #000; }
.note-upload, #addQuestion { margin-bottom: 18px; }
.key-inline { white-space: nowrap; font-weight: 700; }
.key-inline strong { color: var(--red); }
.ms-simple { max-width: 640px; margin-inline: auto; text-align: center; display: grid; gap: 14px; padding: 28px 22px; }
.ms-simple-line { margin: 0; font-size: 1.1rem; font-weight: 700; color: var(--heading); }
.ms-simple .ms-start { width: 100%; }
.te-stats { grid-template-columns: repeat(2, minmax(0, 160px)); margin: 8px 0 0; }
@media (prefers-reduced-motion: reduce) { .ms-card, .ms-card:hover { transition: none; transform: none; } }

@media print { .site-header, .site-footer, .live-banner, .no-print { display: none !important; } }
