/* Shreshta Scheme - theme */
:root {
    --navy: #14315c;
    --navy-dark: #0d2244;
    --saffron: #e07b12;
    --saffron-soft: #fdf1e2;
    --ink: #1c2633;
    --muted: #64707f;
    --line: #dde3ec;
    --bg: #f3f5f9;
    --bs-primary: #14315c;
    --bs-primary-rgb: 20, 49, 92;
    --bs-link-color: #1a4a8f;
    --bs-link-color-rgb: 26, 74, 143;
    --bs-body-font-size: 0.925rem;
}

body { background: var(--bg); color: var(--ink); min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }

.btn-primary { --bs-btn-bg: var(--navy); --bs-btn-border-color: var(--navy); --bs-btn-hover-bg: var(--navy-dark); --bs-btn-hover-border-color: var(--navy-dark); --bs-btn-active-bg: var(--navy-dark); --bs-btn-active-border-color: var(--navy-dark); --bs-btn-disabled-bg: var(--navy); --bs-btn-disabled-border-color: var(--navy); }
.btn-outline-primary { --bs-btn-color: var(--navy); --bs-btn-border-color: var(--navy); --bs-btn-hover-bg: var(--navy); --bs-btn-hover-border-color: var(--navy); --bs-btn-active-bg: var(--navy); --bs-btn-active-border-color: var(--navy); }
.form-control:focus, .form-select:focus { border-color: #6f8fc0; box-shadow: 0 0 0 .2rem rgba(20, 49, 92, .15); }
.form-check-input:checked { background-color: var(--navy); border-color: var(--navy); }
.page-link { color: var(--navy); }
.active > .page-link { background: var(--navy); border-color: var(--navy); }

/* ---------- Brand header ---------- */
.app-brand { background: var(--navy); color: #fff; padding: .6rem 0; border-bottom: 3px solid var(--saffron); }
.brand-link { display: flex; align-items: center; gap: .7rem; color: #fff; text-decoration: none; min-width: 0; }
.brand-mark { flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--saffron); color: #fff; font-weight: 700; font-size: 1.25rem; display: inline-flex; align-items: center; justify-content: center; font-family: Georgia, 'Times New Roman', serif; }
.brand-mark-lg { width: 58px; height: 58px; font-size: 1.8rem; }
.brand-name { display: block; font-weight: 700; font-size: 1.12rem; line-height: 1.15; letter-spacing: .2px; }
.brand-tag { display: block; font-size: .78rem; opacity: .82; line-height: 1.2; }
.user-chip { font-size: .85rem; white-space: nowrap; display: inline-flex; align-items: center; gap: .4rem; }
.role-pill { font-size: .66rem; font-weight: 700; padding: .12rem .45rem; border-radius: 20px; letter-spacing: .5px; }
.role-admin { background: var(--saffron); color: #fff; }
.role-user { background: rgba(255, 255, 255, .2); color: #fff; }

.app-nav { background: #fff; border-bottom: 1px solid var(--line); padding-top: 0; padding-bottom: 0; }
.app-nav .nav-link { color: var(--ink); padding: .7rem .85rem !important; font-weight: 500; border-bottom: 3px solid transparent; white-space: nowrap; }
.app-nav .nav-link:hover { color: var(--navy); background: #f5f7fb; }
.app-nav .nav-link.active { color: var(--navy); border-bottom-color: var(--saffron); }
.app-nav .navbar-toggler { border: 0; font-size: .95rem; padding: .6rem 0; color: var(--navy); }
.app-nav .navbar-toggler:focus { box-shadow: none; }

.app-footer { text-align: center; font-size: .8rem; color: var(--muted); padding: 1rem; border-top: 1px solid var(--line); background: #fff; }

/* ---------- Page head ---------- */
.page-title { font-size: 1.35rem; font-weight: 700; margin: 0; color: var(--navy); }
.page-sub { color: var(--muted); font-size: .88rem; }

/* ---------- Cards / form ---------- */
.card { border-color: var(--line); border-radius: 10px; }
.card-header { background: #fff; font-weight: 600; border-bottom-color: var(--line); border-radius: 10px 10px 0 0 !important; }
.form-section .card-header { color: var(--navy); }
.sec-no { display: inline-flex; width: 24px; height: 24px; align-items: center; justify-content: center; border-radius: 50%; background: var(--navy); color: #fff; font-size: .78rem; margin-right: .35rem; }
.form-label { font-weight: 500; margin-bottom: .25rem; font-size: .88rem; }
.req { color: #c62828; font-weight: 700; }

.doc-box { border: 1px dashed #b9c3d3; border-radius: 8px; padding: .7rem .8rem; background: #fafbfd; height: 100%; }
.doc-box.has-file { border-style: solid; border-color: #9fd3b0; background: #f4fbf6; }
.doc-box.has-error { border-color: #dc3545; background: #fff7f7; }
.doc-current { font-size: .78rem; color: #1b7a3d; text-decoration: none; white-space: nowrap; font-weight: 600; }
.doc-current:hover { text-decoration: underline; }
.doc-none { font-size: .78rem; color: #b26a00; white-space: nowrap; }
.doc-optional .doc-box { opacity: .75; }
.aadhaar-group { border: 1px solid var(--line); border-radius: 8px; padding: .8rem; background: #fff; }

.form-actions { position: sticky; bottom: 0; z-index: 5; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: .7rem .9rem; display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; justify-content: space-between; box-shadow: 0 -4px 14px rgba(20, 49, 92, .08); }
.status-strip { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: .6rem .9rem; }
.force-card { background: #fffaf0; }

/* ---------- Badges ---------- */
.badge { font-weight: 600; }
.badge-final { background: #e3f4e8; color: #17693a; border: 1px solid #b5dfc3; }
.badge-pending { background: #fff3d6; color: #8a5a00; border: 1px solid #f1d591; }
.badge-forced { background: #ffe6d1; color: #a3470a; border: 1px solid #f4bf94; }
.badge-missing { background: #fdecea; color: #a12622; border: 1px solid #f3c2bf; font-weight: 500; margin-bottom: 2px; }
.badge-soft { background: #e9eef6; color: var(--navy); border: 1px solid #cdd8ea; }

/* ---------- Stat cards ---------- */
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: .9rem 1rem; height: 100%; display: block; text-decoration: none; color: inherit; border-left: 4px solid var(--navy); transition: box-shadow .15s; }
a.stat-card:hover { box-shadow: 0 4px 14px rgba(20, 49, 92, .12); color: inherit; }
.stat-card .stat-num { font-size: 1.75rem; font-weight: 700; line-height: 1.1; color: var(--navy); font-variant-numeric: tabular-nums; }
.stat-card .stat-label { color: var(--muted); font-size: .82rem; margin-top: .15rem; }
.stat-card.s-green { border-left-color: #2e9455; }
.stat-card.s-amber { border-left-color: #e0a112; }
.stat-card.s-orange { border-left-color: var(--saffron); }
.stat-card.s-red { border-left-color: #cf4a3f; }

/* ---------- Tables ---------- */
.table-wrap { background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.table-report { margin: 0; font-size: .84rem; }
.table-report > :not(caption) > * > * { padding: .4rem .45rem; }
.table-report thead th { background: #eef2f8; color: var(--navy); font-weight: 600; white-space: nowrap; border-bottom: 1px solid #cfd8e6; vertical-align: middle; }
.table-report th.sortable a { color: inherit; text-decoration: none; display: block; }
.table-report th.sortable a:hover { color: var(--saffron); }
.table-report th.sortable .bi { font-size: .7rem; opacity: .55; }
.table-report th.sorted .bi { opacity: 1; color: var(--saffron); }
.table-report td { vertical-align: middle; }
.table-report .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table-report .nowrap { white-space: nowrap; }
.table-report .sub { font-size: .76rem; color: var(--muted); line-height: 1.2; }
.card > .table-responsive .table-report th:first-child, .card > .table-responsive .table-report td:first-child { padding-left: 1rem; }
.card > .table-responsive .table-report th:last-child, .card > .table-responsive .table-report td:last-child { padding-right: 1rem; }
.row-actions { white-space: nowrap; }
/* Action column hamesha dikhe, table side me scroll ho tab bhi */
.table-report th.col-action, .table-report td.col-action { position: sticky; right: 0; box-shadow: -6px 0 8px -6px rgba(20, 49, 92, .18); }
.table-report td.col-action { background: #fff; }
.table-report.table-hover tbody tr:hover td.col-action { background: #f2f4f7; }
.row-actions .btn { padding: .15rem .4rem; }
.filter-card .form-label { font-size: .78rem; color: var(--muted); margin-bottom: .15rem; }
.result-bar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: space-between; margin-bottom: .6rem; }
.rank-1 td:first-child, .rank-2 td:first-child, .rank-3 td:first-child { font-weight: 700; color: var(--saffron); }
.marks-grid input { min-width: 90px; }
.marks-grid .m-pct { font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; }

/* ---------- Login ---------- */
.login-body { background: linear-gradient(160deg, var(--navy-dark) 0%, var(--navy) 55%, #24508f 100%); display: flex; align-items: center; justify-content: center; padding: 1rem; }
.login-wrap { width: 100%; max-width: 400px; }
.login-card { background: #fff; border-radius: 14px; overflow: hidden; box-shadow: 0 18px 50px rgba(0, 0, 0, .3); }
.login-head { text-align: center; padding: 1.6rem 1.2rem 1.1rem; border-bottom: 3px solid var(--saffron); background: #f8fafd; }
.login-head h1 { font-size: 1.4rem; font-weight: 700; color: var(--navy); margin: .6rem 0 .15rem; }
.login-head p { margin: 0; color: var(--muted); font-size: .88rem; }
.login-form { padding: 1.4rem 1.5rem 1.6rem; }
.login-note { text-align: center; color: rgba(255, 255, 255, .65); font-size: .78rem; margin-top: .9rem; }

/* ---------- Delete (danger) ---------- */
.danger-card { border: 2px solid #dc3545; }
.danger-card .card-header { background: #dc3545; color: #fff; }
#confirmText { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: 3px; font-weight: 700; max-width: 260px; }

/* ---------- Application form (view / print) ---------- */
.sheet { background: #fff; max-width: 210mm; margin: 0 auto; border: 1px solid var(--line); padding: 12mm; color: #000; font-size: 12.5px; }
.sheet-head { display: flex; align-items: center; gap: 12px; border-bottom: 3px double var(--navy); padding-bottom: 8px; margin-bottom: 10px; }
.sheet-head .brand-mark { width: 52px; height: 52px; font-size: 1.6rem; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.sheet-head h1 { font-size: 21px; font-weight: 700; margin: 0; color: var(--navy); letter-spacing: .3px; }
.sheet-head p { margin: 0; font-size: 12.5px; color: #333; }
.sheet-title { text-align: center; font-weight: 700; font-size: 14px; letter-spacing: 1px; text-transform: uppercase; background: #eef2f8; border: 1px solid #c9d3e3; padding: 4px; margin-bottom: 10px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.sheet-top { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 10px; }
.sheet-top .meta { flex: 1; }
.photo-box { width: 35mm; height: 45mm; border: 1px solid #444; display: flex; align-items: center; justify-content: center; text-align: center; font-size: 10.5px; color: #555; overflow: hidden; flex: none; }
.photo-box img { width: 100%; height: 100%; object-fit: cover; }
.sheet table.kv { width: 100%; border-collapse: collapse; margin-bottom: 10px; }
.sheet table.kv th, .sheet table.kv td { border: 1px solid #9aa5b5; padding: 4px 7px; vertical-align: top; }
.sheet table.kv th { width: 21%; background: #f4f6fa; font-weight: 600; text-align: left; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.sheet table.kv td { width: 29%; word-break: break-word; }
.sheet h2 { font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--navy); margin: 0 0 4px; }
.sign-row { display: flex; gap: 12px; margin-bottom: 10px; }
.sign-box { flex: 1; border: 1px solid #9aa5b5; text-align: center; }
.sign-box .img { height: 24mm; display: flex; align-items: center; justify-content: center; padding: 3px; font-size: 10.5px; color: #555; }
.sign-box .img img { max-height: 100%; max-width: 100%; object-fit: contain; }
.sign-box .cap { border-top: 1px solid #9aa5b5; font-size: 11px; padding: 2px; background: #f4f6fa; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.doc-check { columns: 2; list-style: none; padding: 0; margin: 0 0 10px; font-size: 12px; }
.doc-check li { padding: 1px 0; }
.doc-check .yes { color: #17693a; }
.doc-check .no { color: #a12622; }
.sheet-foot { display: flex; justify-content: space-between; gap: 20px; margin-top: 16mm; font-size: 11.5px; }
.sheet-foot div { flex: 1; border-top: 1px solid #333; padding-top: 3px; text-align: center; }
.sheet-note { font-size: 10.5px; color: #555; margin-top: 8px; text-align: center; }

@media (max-width: 575.98px) {
    .brand-tag { display: none; }
    .user-chip { font-size: .78rem; }
    .sheet { padding: 5mm; }
    .sheet-top { flex-direction: column-reverse; align-items: center; }
    .sheet-top .meta { width: 100%; }
}

@media print {
    @page { size: A4 landscape; margin: 8mm; }   /* reports: landscape. Application form apna portrait size khud set karta hai */
    body { background: #fff !important; display: block; min-height: 0; }
    main { padding: 0 !important; }
    .sheet-foot { margin-top: 11mm; }
    .sheet-note { margin-top: 4px; }
    .sign-box .img { height: 21mm; }
    .sheet table.kv, .sheet-top table.kv { margin-bottom: 7px; }
    .sheet { border: 0; padding: 0; max-width: none; margin: 0; }
    .table-wrap { border: 0; }
    .table-report { font-size: 9.5px; }
    .table-report > :not(caption) > * > * { padding: .2rem .3rem; }
    .table-report .sub { font-size: 8.5px; }
    .table-report th.sortable .bi { display: none; }
    .table-responsive { overflow: visible !important; }
    .page-sub { display: none; }
    .badge { border: 0 !important; padding: 0; background: none !important; color: #000 !important; font-size: 9px; }
    .table-report .d-print-none { display: none !important; }
    a { text-decoration: none; color: inherit; }
}

@media (max-width: 767.98px) {
    .form-actions { justify-content: flex-end; padding: .5rem .6rem; }
    .form-actions .btn { padding: .3rem .55rem; font-size: .85rem; }
}

/* ---------- Registration form: beech me A4 jaisa box ---------- */
.form-box { max-width: 900px; margin: 0 auto; }
.form-paper { background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 28px rgba(20, 49, 92, .09); padding: 1.6rem 1.9rem .6rem; margin-bottom: 1rem; }
.paper-head { display: flex; align-items: center; gap: .8rem; border-bottom: 3px double var(--navy); padding-bottom: .7rem; }
.paper-head .brand-mark { width: 46px; height: 46px; font-size: 1.4rem; }
.paper-name { font-size: 1.25rem; font-weight: 700; color: var(--navy); line-height: 1.15; }
.paper-tag { font-size: .82rem; color: var(--muted); }
.paper-reg { margin-left: auto; text-align: right; font-size: .75rem; color: var(--muted); line-height: 1.25; }
.paper-reg b { display: block; font-size: .95rem; color: var(--ink); }
.paper-title { text-align: center; font-weight: 700; font-size: .9rem; letter-spacing: 1.5px; text-transform: uppercase; color: var(--navy); background: #eef2f8; border: 1px solid #d3dcea; border-radius: 4px; padding: .3rem; margin: .8rem 0 1rem; }
.form-paper .form-section { border: 0; border-radius: 0; margin-bottom: .4rem !important; }
.form-paper .form-section .card-header { padding: .45rem 0; border-bottom: 1px solid var(--line); border-radius: 0 !important; font-size: .98rem; }
.form-paper .form-section .card-body { padding: .9rem 0 1.1rem; }
.form-box .doc-box > .d-flex { flex-wrap: wrap; }
@media (max-width: 575.98px) {
    .form-paper { padding: 1rem .9rem .3rem; border-radius: 8px; }
    .paper-tag { display: none; }
}

/* ---------- Public form (apply.php) ---------- */
.hp-field { position: absolute !important; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.declare-box { padding-top: 1.1rem; padding-bottom: 1.1rem; }
.cap-q { font-size: 1.05rem; color: var(--navy); letter-spacing: 1px; white-space: nowrap; }
.ack-paper { max-width: 640px; margin-left: auto; margin-right: auto; padding-bottom: 1.4rem; }
.ack-ok { display: flex; align-items: center; gap: .8rem; background: #e9f7ee; border: 1px solid #b5dfc3; border-radius: 8px; padding: .8rem 1rem; margin-bottom: 1rem; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.ack-ok .bi { font-size: 2rem; color: #1f8a4c; line-height: 1; }
.ack-ok-title { font-weight: 700; font-size: 1.05rem; color: #17693a; }
.ack-ok-sub { font-size: .82rem; color: var(--muted); }
.ack-reg { text-align: center; border: 2px dashed var(--navy); border-radius: 8px; padding: .7rem; margin-bottom: 1rem; }
.ack-reg span { display: block; font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.ack-reg b { font-size: 1.7rem; color: var(--navy); letter-spacing: 1.5px; font-variant-numeric: tabular-nums; }
.ack-table th { width: 38%; font-weight: 600; color: var(--muted); }
.badge-online { background: #e4eefc; color: #1a4a8f; border: 1px solid #bcd2f3; font-size: .66rem; }
.link-box { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.link-box input { flex: 1 1 280px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85rem; background: #f7f9fc; }
@media print {
    .form-paper.ack-paper { box-shadow: none; border: 1px solid #999; }
}
