/* =========================================================================
   IGNOU Examination Portal – application styles (Bootstrap 5.3 theme layer)
   ========================================================================= */
:root {
    --app-topbar-h: 60px;
    --app-sidebar-w: 270px;
    --app-sidebar-bg: #0f1d33;
    --app-sidebar-bg-2: #13284a;
    --app-sidebar-fg: #b8c4d6;
    --app-accent: #2f6fed;
    --bs-primary: #2f6fed;
    --bs-primary-rgb: 47, 111, 237;
    --bs-link-color: #2459c8;
    --bs-link-color-rgb: 36, 89, 200;
    --bs-body-bg: #f3f5f9;
    --bs-border-radius: .5rem;
}

body.app { background: var(--bs-body-bg); padding-top: var(--app-topbar-h); }

.btn-primary { --bs-btn-bg: var(--app-accent); --bs-btn-border-color: var(--app-accent); --bs-btn-hover-bg: #2459c8; --bs-btn-hover-border-color: #2459c8; --bs-btn-active-bg: #1e4aa6; }
.text-primary { color: var(--app-accent) !important; }

/* ---------- top bar ---------- */
.app-topbar { height: var(--app-topbar-h); z-index: 1040; }
.brand-badge { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: linear-gradient(135deg, #2f6fed, #6a4cf5); color: #fff; }
.avatar-sm { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
.avatar-lg { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; border: 3px solid rgba(255,255,255,.25); }
.avatar-empty { display: inline-grid; place-items: center; background: rgba(255,255,255,.1); color: #fff; font-size: 2rem; }

/* ---------- shell ---------- */
.app-shell { display: flex; min-height: calc(100vh - var(--app-topbar-h)); }
.app-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.app-main > .container-fluid { flex: 1 0 auto; }
.app-narrow { max-width: 1100px; }

/* ---------- sidebar ---------- */
.app-sidebar { background: linear-gradient(180deg, var(--app-sidebar-bg), var(--app-sidebar-bg-2)); color: var(--app-sidebar-fg); }
.app-sidebar .offcanvas-header { color: #fff; border-color: rgba(255,255,255,.1) !important; }
@media (min-width: 992px) {
    .app-sidebar { position: sticky; top: var(--app-topbar-h); height: calc(100vh - var(--app-topbar-h)); width: var(--app-sidebar-w); flex: 0 0 var(--app-sidebar-w); overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.2) transparent; }
}
@media (max-width: 991.98px) {
    .app-sidebar { --bs-offcanvas-width: 290px; }
}
.sidebar-user { border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar-nav .nav-header { font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: #6f86a8; padding: 1.1rem 1.25rem .35rem; }
.sidebar-nav .nav-link { display: flex; align-items: center; gap: .65rem; color: var(--app-sidebar-fg); padding: .5rem 1.25rem; font-size: .9rem; border-left: 3px solid transparent; transition: background .15s, color .15s; }
.sidebar-nav .nav-link:hover, .sidebar-nav .nav-link:focus { color: #fff; background: rgba(255,255,255,.06); }
.sidebar-nav .nav-link.active { color: #fff; background: rgba(47,111,237,.25); border-left-color: #5b8cff; }
.sidebar-nav .nav-link .fa-fw { opacity: .85; }
.sidebar-nav .caret { font-size: .7rem; transition: transform .2s; }
.sidebar-nav .nav-group:not(.collapsed) .caret { transform: rotate(180deg); }
.sidebar-nav .sub-nav { background: rgba(0,0,0,.15); }
.sidebar-nav .sub-nav .nav-link { padding: .4rem 1.25rem .4rem 3.1rem; font-size: .85rem; }

/* ---------- content ---------- */
.page-title { font-weight: 650; color: #1b2a41; }
.breadcrumb { --bs-breadcrumb-divider: '›'; }
.card { border-radius: .75rem; }
.card-header:first-child { border-radius: .75rem .75rem 0 0; }
.form-label { font-weight: 500; font-size: .9rem; margin-bottom: .3rem; }
.form-label .req { color: #dc3545; margin-left: 2px; }
.form-text { font-size: .8rem; }
.app-footer { margin-top: auto; }
.back-to-top { position: fixed; right: 1rem; bottom: 1rem; display: none; z-index: 1030; border-radius: 50%; width: 38px; height: 38px; }
.back-to-top.show { display: inline-block; }

/* stat tiles on dashboard */
.stat-tile { display: flex; align-items: center; gap: 1rem; padding: 1.1rem 1.2rem; border-radius: .9rem; color: #fff; text-decoration: none; min-height: 104px; box-shadow: 0 4px 14px rgba(15,29,51,.12); transition: transform .15s, box-shadow .15s; }
.stat-tile:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 8px 22px rgba(15,29,51,.18); }
.stat-tile .icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: rgba(255,255,255,.18); font-size: 1.4rem; flex: 0 0 52px; }
.stat-tile .value { font-size: 1.55rem; font-weight: 700; line-height: 1.1; }
.stat-tile .label { font-size: .85rem; opacity: .92; }
.bg-grad-1 { background: linear-gradient(135deg, #2f6fed, #5b8cff); }
.bg-grad-2 { background: linear-gradient(135deg, #e5484d, #ff7a7d); }
.bg-grad-3 { background: linear-gradient(135deg, #f08c00, #ffb347); }
.bg-grad-4 { background: linear-gradient(135deg, #12a150, #3fd48a); }
.bg-grad-5 { background: linear-gradient(135deg, #6a4cf5, #9b85ff); }
.bg-grad-6 { background: linear-gradient(135deg, #0b8fac, #36c6e0); }

/* tables */
.table-app { font-size: .875rem; }
.table-app thead th { background: #eef2f8; color: #34465f; font-weight: 600; white-space: nowrap; vertical-align: middle; }
.table-app td { vertical-align: middle; }
.table-app td.text-wrap-cell { min-width: 220px; white-space: normal; }
.doc-link { display: inline-flex; align-items: center; gap: .25rem; text-decoration: none; margin-right: .35rem; font-size: 1.05rem; }
.actions { white-space: nowrap; }
.actions .btn { --bs-btn-padding-y: .2rem; --bs-btn-padding-x: .45rem; --bs-btn-font-size: .8rem; }
div.dt-container .dt-buttons .btn { --bs-btn-padding-y: .25rem; --bs-btn-font-size: .8rem; }
div.dt-container { font-size: .875rem; }

/* profile view */
.profile-photo { width: 150px; height: 180px; object-fit: cover; border-radius: .6rem; border: 3px solid #fff; box-shadow: 0 4px 14px rgba(0,0,0,.12); }
.kv { display: grid; grid-template-columns: minmax(140px, 38%) 1fr; gap: .35rem 1rem; font-size: .92rem; }
.kv dt { color: #5d6b82; font-weight: 500; }
.kv dd { margin: 0; color: #1b2a41; word-break: break-word; }
@media (max-width: 575.98px) { .kv { grid-template-columns: 1fr; } .kv dd { margin-bottom: .5rem; } }

/* login */
.auth-page { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(1200px 600px at 10% 10%, #dfe8ff 0%, transparent 60%), radial-gradient(900px 500px at 90% 90%, #ece4ff 0%, transparent 60%), #f3f5f9; padding: 1rem; }
.auth-card { width: 100%; max-width: 420px; border-radius: 1rem; }

/* printable documents (CV, CAS, salary…) */
.doc-sheet { background: #fff; max-width: 1000px; margin: 0 auto; padding: 2rem; border-radius: .75rem; box-shadow: 0 2px 12px rgba(0,0,0,.06); }
.doc-sheet h2, .doc-sheet h3 { color: #1b2a41; }
.doc-sheet table { width: 100%; }
.doc-sheet .table th { background: #f2f5fa; }

@media print {
    body.app { padding-top: 0; background: #fff; }
    .app-topbar, .app-sidebar, .app-footer, .back-to-top, .no-print, .breadcrumb, .alert, .dt-buttons, .dt-search, .dt-length, .dt-paging, .dt-info { display: none !important; }
    .app-main > .container-fluid { padding: 0 !important; max-width: none; }
    .card, .doc-sheet { box-shadow: none !important; border: 0 !important; padding: 0 !important; }
    a[href]::after { content: none !important; }
    .actions, th.no-export, td.no-export { display: none !important; }
}

/* ===================== IGNOU portal ===================== */
.sidebar-nav .nav-logout { color: #ff9b9b; }
.sidebar-nav .nav-logout:hover { color: #fff; background: rgba(229,72,77,.25); }
.brand-badge-lg { width: 64px; height: 64px; font-size: 1.8rem; border-radius: 18px; }
.hero-ignou { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; padding: 1.4rem 1.6rem; border-radius: 1rem; color: #fff; background: linear-gradient(135deg, #0f1d33 0%, #213e7a 55%, #2f6fed 100%); box-shadow: 0 8px 24px rgba(15,29,51,.18); }
.hero-next { display: flex; flex-direction: column; padding: .8rem 1rem; border-radius: .8rem; background: rgba(255,255,255,.12); color: #fff; text-decoration: none; min-width: 230px; }
.hero-next:hover { background: rgba(255,255,255,.2); color: #fff; }
.step-card { display: flex; gap: .9rem; align-items: flex-start; padding: .9rem 1rem; border-radius: .9rem; background: #fff; border: 1px solid #e6eaf1; text-decoration: none; color: inherit; transition: border-color .15s, box-shadow .15s, transform .15s; }
.step-card:hover { border-color: #b9cbf5; box-shadow: 0 6px 18px rgba(15,29,51,.08); transform: translateY(-1px); color: inherit; }
.step-card .num { flex: 0 0 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: #e8efff; color: #2459c8; }
.step-card .t { font-weight: 600; color: #1b2a41; }
.step-card .d { font-size: .82rem; color: #5d6b82; }
.quick-link { display: flex; align-items: center; gap: .6rem; padding: .7rem .85rem; border: 1px solid #e6eaf1; border-radius: .7rem; background: #fff; color: #1b2a41; text-decoration: none; font-size: .9rem; height: 100%; }
.quick-link i { color: var(--app-accent); width: 1.2rem; text-align: center; }
.quick-link:hover { border-color: #b9cbf5; background: #f6f9ff; color: #1b2a41; }
.doc-btn { display: flex; gap: .9rem; align-items: center; padding: 1rem; border-radius: .8rem; border: 1px solid #d7e2f7; background: #f6f9ff; text-decoration: none; color: #1b2a41; height: 100%; }
.doc-btn i { font-size: 1.6rem; color: var(--app-accent); }
.doc-btn small { display: block; color: #5d6b82; }
.doc-btn:hover { background: #eaf1ff; color: #1b2a41; }
.empty-state { text-align: center; padding: 2.5rem 1rem; color: #5d6b82; }
.empty-state i { font-size: 2.4rem; opacity: .5; display: block; margin-bottom: .5rem; }
.room-table input { min-width: 3.4rem; }
.room-card .card-header { border-bottom: 1px solid #eef1f6; }
.dist-line.is-bad input { border-color: #dc3545; background: #fff5f5; }
.sticky-actions { position: sticky; bottom: 0; z-index: 5; background: rgba(243,245,249,.95); backdrop-filter: blur(4px); padding: .75rem 0; border-top: 1px solid #e3e7ef; }
.js-course.opt-set { background-color: #fff8db; }
.course-chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.course-chips span { background: #eef2f8; border-radius: 1rem; padding: .15rem .6rem; font-size: .82rem; }
.inv-cell input { min-width: 12rem; }

/* ---------- printable documents ---------- */
body.doc-body { background: #e9edf3; }
.doc-toolbar { position: sticky; top: 0; z-index: 20; background: #fff; border-bottom: 1px solid #dfe4ec; box-shadow: 0 2px 8px rgba(0,0,0,.05); }
.doc-wrap { padding: 1rem .5rem 3rem; }
.sheet { background: #fff; color: #000; margin: 0 auto 1.25rem; padding: 12mm; max-width: 210mm; box-shadow: 0 2px 10px rgba(0,0,0,.08); border-radius: 4px; break-after: page; page-break-after: always; font-size: 11pt; }
.doc-landscape .sheet { max-width: 297mm; }
.doc-legal .sheet { max-width: 216mm; }
.sheet:last-child { break-after: auto; page-break-after: auto; }
.doc-part { max-width: 297mm; margin: 1.5rem auto .5rem; font-size: 1rem; color: #fff; background: #6c4ce0; padding: .4rem .8rem; border-radius: .4rem; }
.doc-title { text-align: center; font-size: 1.15rem; font-weight: 700; margin-bottom: 1rem; }
.doc-title small { font-weight: 500; font-size: .9rem; }
.doc-table { --bs-table-bg: transparent; font-size: 10.5pt; }
.doc-table th { background: #f0f0f0 !important; vertical-align: middle; }
.doc-table caption { font-size: 11pt; }
.letterhead { display: flex; align-items: center; gap: 1rem; margin-bottom: .6rem; }
.letterhead .lh-logo { flex: 0 0 80px; text-align: center; }
.letterhead .lh-logo img { max-width: 80px; max-height: 80px; object-fit: contain; }
.letterhead .lh-text { flex: 1 1 auto; text-align: center; }
.letterhead .lh-1 { font-weight: 700; font-size: 13pt; }
.letterhead .lh-n { font-size: 11.5pt; font-weight: 600; }
.room-no { font-size: 14pt; font-weight: 800; }
.office-copy { font-size: 13pt; font-weight: 700; text-decoration: underline; }
.sign-block { text-align: right; margin-top: 1.2rem; }
.page-foot { text-align: right; margin-top: .8rem; font-size: 10pt; }
.course-line { display: flex; flex-wrap: wrap; justify-content: center; gap: .3rem 1.4rem; font-size: 15pt; margin-bottom: .6rem; }
.msp-table { width: 100%; font-size: 20pt; border-collapse: collapse; text-align: center; }
.msp-table th { border-bottom: 2px solid #000; padding: .2rem; }
.msp-table td { padding: .25rem; }
.msp-table tbody tr:nth-child(odd) td { background: #e8e8e8; }
.msp-manual { font-size: 18pt; }
.msp-all { font-size: 44pt; text-align: center; margin-top: 2.5rem; line-height: 1.3; }
.course-count { font-size: 10.5pt; margin: 0 auto .5rem; border-collapse: collapse; }
.course-count th, .course-count td { padding: .05rem .7rem; text-align: center; }
.course-count th { border-bottom: 1px solid #000; }
.course-count .gs { border-left: 1px solid #999; padding-left: 1.2rem; }
.plan-courses { line-height: 1.5; }
.plan-grid { width: 100%; border-collapse: collapse; table-layout: fixed; }
.plan-grid th, .plan-grid td { border: 1px solid #000; vertical-align: top; padding: .1rem .4rem; }
.plan-grid th { text-align: center; font-size: .85em; }
.plan-grid td { text-align: left; }
.plan-col { list-style: none; margin: 0; padding: 0; }
.plan-col li { padding: 0; line-height: 1.3; white-space: nowrap; overflow: hidden; }
.plan-col li.crs { font-size: .8em; font-weight: 700; font-style: italic; color: #333; line-height: 1.25; margin-top: .1em; }
.plan-col li.empty { color: transparent; }
.sign-gap { margin-top: 20mm; line-height: 1.5; }
@media screen and (max-width: 991.98px) {
    .room-plan:not(.fit-measure) .plan-col li { white-space: normal; overflow: visible; overflow-wrap: anywhere; }
}
.label-sheet { text-align: center; }
.label-date { font-size: 46pt; font-weight: 700; margin: 2.5rem 0 1.5rem; line-height: 1.2; }
.label-course { font-size: 16pt; }
.label-total { margin-top: 1rem; font-weight: 600; }
.slip-grid { width: 100%; border-collapse: collapse; table-layout: fixed; }
.slip-grid th { text-align: center; border-bottom: 1px solid #000; }
.slip-grid td { vertical-align: top; padding: .2rem; }
.slip { border: 1px solid #000; text-align: center; margin-bottom: .3rem; padding: .2rem; break-inside: avoid; }
.slip-no { font-size: 40pt; font-weight: 700; line-height: 1.05; }
.slip-foot { font-size: 8.5pt; line-height: 1.2; }
.row-label { border: 2px dotted #000; text-align: center; padding: 1.5rem; margin-bottom: 1.5rem; }
.row-label-no { font-size: 90pt; font-weight: 700; line-height: 1.1; }
.form-sheet { font-size: 11pt; }
.form-logo { width: 50px; height: auto; margin-bottom: .3rem; }
.form-table th { font-size: 9.5pt; text-align: center; }
.form-table tr.tall td { height: 9mm; }
.form-table tr.att-row td { height: 8.5mm; }
.form-table tr.bill-row td { height: 16mm; vertical-align: middle; }
.staff-sheet .staff-title { line-height: 1.45; }
.staff-sheet .form-table tr.tall td { height: var(--row-h, 9mm); padding-top: 0; padding-bottom: 0; vertical-align: middle; }
@media print, (min-width: 576px) { .staff-sheet .form-table td.nw { white-space: nowrap; } }
.staff-sheet.rows-compact .form-table { font-size: 9.5pt; }
.staff-sheet.rows-dense .form-table { font-size: 8.5pt; }
.staff-sheet.rows-tiny .form-table { font-size: 7.5pt; }
.staff-sheet.rows-dense .form-table td, .staff-sheet.rows-tiny .form-table td { line-height: 1.1; }
@media print { .staff-sheet { break-inside: avoid; page-break-inside: avoid; } }
/* abstract3.php – compact two-column abstract */
.abs-title { text-align: center; font-size: 12.5pt; font-weight: 700; margin: 0 0 .15rem; }
.abs-sub { text-align: center; font-size: 9.5pt; margin: 0 0 .5rem; }
.abs-cols { column-gap: 6mm; }
@media print, (min-width: 768px) { .abs-cols { column-count: 2; } }
.abs-block { margin-bottom: 3mm; }
.abs-block.abs-short { break-inside: avoid; page-break-inside: avoid; }
.abs-table thead, .abs-table thead tr { break-after: avoid; page-break-after: avoid; break-inside: avoid; }
.abs-table tbody tr { break-inside: avoid; page-break-inside: avoid; }
.abs-table tr.abs-total { break-before: avoid; page-break-before: avoid; }
.abs-table { --bs-table-bg: transparent; font-size: 9pt; text-align: center; margin: 0; line-height: 1.2; }
.abs-table > :not(caption) > * > * { padding: .5mm 1.2mm; }
.abs-table th { background: #f0f0f0 !important; font-size: 8.5pt; vertical-align: middle; }
.abs-table td.abs-tag { color: #444; font-size: 8pt; white-space: nowrap; }
.abs-table .abs-head th { background: #dde4f0 !important; font-size: 9pt; text-align: left; }
@media print { .abs-sheet { font-size: 9pt; } }
.boxed { display: inline-block; border: 1px solid #000; padding: .1rem .6rem; min-width: 5rem; text-align: center; }
.boxed-wide { min-width: 8rem; min-height: 1.6rem; vertical-align: middle; }
.dots { display: inline-block; min-width: 12rem; border-bottom: 1px dotted #000; }
.dots-cell { border-bottom: 1px dotted #000; width: 45%; }
u.fill { text-decoration: none; border-bottom: 1px dotted #555; font-weight: 700; padding: 0 .4rem; }
.text-justify { text-align: justify; }
.letter { font-size: 12pt; }
.obs-list > li { margin-bottom: .6rem; }
.check-sheet ol.cols-3 { columns: 3; font-size: 10pt; }
.sde th, .sde td { padding: .15rem; }

@media print {
    body.doc-body { background: #fff; }
    .doc-toolbar, .doc-part, .no-print { display: none !important; }
    .doc-wrap { padding: 0; }
    .sheet { box-shadow: none; border-radius: 0; margin: 0; padding: 0; max-width: none !important; }
    * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
@media (max-width: 575.98px) {
    .sheet { padding: 5mm; font-size: 10pt; }
    .msp-table { font-size: 13pt; }
    .label-date { font-size: 28pt; }
}
