/* Kaushal Vikas admin theme — saffron, navy and green, PMKVY portal style */
:root {
    --saffron: #f58220;
    --saffron-dark: #d96a0b;
    --saffron-soft: #fff3e8;
    --navy: #0b3c7d;
    --navy-dark: #072a59;
    --green: #138808;
    --green-soft: #e8f6e6;
    --red: #d63939;
    --bg: #f3f5fa;
    --text: #1f2937;
    --muted: #6b7280;
    --border: #e5e7eb;
    --sidebar-w: 250px;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: 'Poppins', 'Noto Sans', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
}
a { color: var(--navy); }

/* Tricolour strip */
.tricolor { height: 5px; background: linear-gradient(90deg, var(--saffron) 0 33.33%, #fff 33.33% 66.66%, var(--green) 66.66%); }

/* Top header */
.topbar {
    background: #fff;
    border-bottom: 3px solid var(--saffron);
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 24px; position: sticky; top: 0; z-index: 1030;
    box-shadow: 0 2px 8px rgba(11, 60, 125, .08);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-logo {
    width: 48px; height: 48px; border-radius: 50%;
    background: conic-gradient(var(--saffron) 0 33%, #fff 0 66%, var(--green) 0);
    display: grid; place-items: center; box-shadow: 0 0 0 2px var(--navy);
}
.brand-logo span {
    width: 34px; height: 34px; border-radius: 50%; background: var(--navy); color: #fff;
    display: grid; place-items: center; font-weight: 700; font-size: 13px;
}
.brand-text strong { display: block; color: var(--navy); font-size: 18px; line-height: 1.1; letter-spacing: .3px; }
.brand-text small { color: var(--saffron-dark); font-weight: 600; font-size: 12px; }
.topbar .user-chip { display: flex; align-items: center; gap: 10px; }
.avatar {
    width: 38px; height: 38px; border-radius: 50%; background: var(--saffron); color: #fff;
    display: grid; place-items: center; font-weight: 600;
}
.user-chip .meta { line-height: 1.2; text-align: right; }
.user-chip .meta b { display: block; color: var(--navy); }
.user-chip .meta small { color: var(--muted); }
.menu-toggle { display: none; border: 0; background: none; font-size: 26px; color: var(--navy); }

/* Shell */
.shell { display: flex; min-height: calc(100vh - 78px); }
.sidebar {
    width: var(--sidebar-w); flex-shrink: 0;
    background: linear-gradient(180deg, var(--navy) 0%, var(--navy-dark) 100%);
    padding: 18px 0;
}
.sidebar .label { color: rgba(255,255,255,.45); font-size: 11px; text-transform: uppercase; letter-spacing: 1.2px; padding: 12px 24px 6px; }
.sidebar a {
    display: flex; align-items: center; gap: 12px; color: rgba(255,255,255,.85);
    text-decoration: none; padding: 11px 24px; border-left: 4px solid transparent; transition: .15s;
}
.sidebar a i { font-size: 17px; }
.sidebar a:hover { background: rgba(255,255,255,.07); color: #fff; }
.sidebar a.active { background: rgba(245,130,32,.16); border-left-color: var(--saffron); color: #fff; font-weight: 600; }
.sidebar a.active i { color: var(--saffron); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.page-banner {
    background: linear-gradient(100deg, var(--navy) 0%, #1557a8 60%, var(--saffron) 140%);
    color: #fff; padding: 22px 28px; position: relative; overflow: hidden;
}
.page-banner::after {
    content: ""; position: absolute; right: -40px; top: -40px; width: 200px; height: 200px;
    border-radius: 50%; border: 28px solid rgba(255,255,255,.07);
}
.page-banner h1 { font-size: 22px; margin: 0; font-weight: 600; }
.page-banner .crumb { font-size: 12px; opacity: .8; margin-top: 4px; }
.page-banner .crumb a { color: #fff; }
.content { padding: 24px 28px; flex: 1; }

/* Cards */
.card-k {
    background: #fff; border-radius: 10px; border: 1px solid var(--border);
    box-shadow: 0 1px 3px rgba(0,0,0,.04); margin-bottom: 24px;
}
.card-k .card-head {
    padding: 14px 20px; border-bottom: 1px solid var(--border);
    display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
}
.card-k .card-head h2 { font-size: 16px; margin: 0; color: var(--navy); font-weight: 600; }
.card-k .card-head h2::before { content: ""; display: inline-block; width: 4px; height: 16px; background: var(--saffron); border-radius: 2px; margin-right: 10px; vertical-align: -2px; }
.card-k .card-body { padding: 20px; }

.stat {
    background: #fff; border-radius: 10px; padding: 18px 20px; border: 1px solid var(--border);
    border-top: 4px solid var(--c, var(--navy)); display: flex; align-items: center; gap: 16px; height: 100%;
}
.stat .ico { width: 52px; height: 52px; border-radius: 12px; display: grid; place-items: center; font-size: 24px; background: var(--cs, #e8eef8); color: var(--c, var(--navy)); }
.stat .num { font-size: 26px; font-weight: 700; color: var(--text); line-height: 1; }
.stat .lbl { color: var(--muted); font-size: 13px; margin-top: 4px; }
.stat.saffron { --c: var(--saffron); --cs: var(--saffron-soft); }
.stat.green { --c: var(--green); --cs: var(--green-soft); }
.stat.red { --c: var(--red); --cs: #fdecec; }

/* Tables */
.table-k { width: 100%; border-collapse: collapse; }
.table-k th { background: #f7f9fc; color: var(--navy); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; padding: 11px 14px; border-bottom: 2px solid var(--saffron); text-align: left; white-space: nowrap; }
.table-k td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table-k tr:hover td { background: #fffaf5; }
.table-wrap { overflow-x: auto; }

.badge-k { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; text-transform: capitalize; }
.badge-k.pending { background: var(--saffron-soft); color: var(--saffron-dark); }
.badge-k.verified, .badge-k.approved, .badge-k.success { background: var(--green-soft); color: var(--green); }
.badge-k.reject, .badge-k.rejected { background: #fdecec; color: var(--red); }
.badge-k.admin { background: #e8eef8; color: var(--navy); }
.badge-k.operator { background: var(--saffron-soft); color: var(--saffron-dark); }

/* Buttons & forms */
.btn-saffron { background: var(--saffron); border: 0; color: #fff; font-weight: 600; }
.btn-saffron:hover { background: var(--saffron-dark); color: #fff; }
.btn-navy { background: var(--navy); border: 0; color: #fff; }
.btn-navy:hover { background: var(--navy-dark); color: #fff; }
.form-control:focus, .form-select:focus { border-color: var(--saffron); box-shadow: 0 0 0 .2rem rgba(245,130,32,.2); }

.pagination .page-link { color: var(--navy); }
.pagination .active .page-link { background: var(--saffron); border-color: var(--saffron); color: #fff; }

/* Fingerprint button in the table */
.btn-fp {
    display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
    background: var(--saffron-soft); color: var(--saffron-dark); border: 1px solid #f6cfa8;
    border-radius: 20px; padding: 4px 6px 4px 12px; font-size: 13px; font-weight: 600; transition: .15s;
}
.btn-fp i { font-size: 16px; }
.btn-fp:hover { background: var(--saffron); color: #fff; border-color: var(--saffron); }
.fp-count { background: var(--green); color: #fff; border-radius: 12px; padding: 1px 8px; font-size: 11px; }
.fp-count.part { background: var(--saffron-dark); }

/* Fingerprint chips on the detail page */
.fp-chip {
    border: 1px solid var(--border); background: #fff; color: var(--navy); border-radius: 8px;
    padding: 6px 12px; font-weight: 600; transition: .15s;
}
.fp-chip:hover { border-color: var(--saffron); color: var(--saffron-dark); background: var(--saffron-soft); }
.fp-chip.missing { color: #b0b5bd; border-style: dashed; background: #f7f7f8; text-decoration: line-through; }

/* Fingerprint viewer popup */
.fp-modal { border: 0; border-radius: 14px; overflow: hidden; }
.fp-modal .modal-header {
    background: linear-gradient(100deg, var(--navy) 0%, #1557a8 70%, var(--saffron) 150%);
    color: #fff; border-bottom: 3px solid var(--saffron);
}
.fp-modal .modal-title { font-weight: 600; }
.fp-modal .fp-sub { opacity: .85; }
.fp-tabs { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-bottom: 18px; }
.fp-tab {
    border: 1px solid var(--border); background: #fff; color: var(--navy); border-radius: 22px;
    padding: 7px 16px; font-weight: 600; font-size: 13px; transition: .15s;
}
.fp-tab:hover { border-color: var(--saffron); color: var(--saffron-dark); }
.fp-tab.active { background: var(--saffron); border-color: var(--saffron); color: #fff; box-shadow: 0 3px 10px rgba(245,130,32,.35); }
.fp-tab.missing { color: #b0b5bd; border-style: dashed; }
.fp-tab.missing.active { background: #9ca3af; border-color: #9ca3af; color: #fff; box-shadow: none; }
.fp-tab-all { background: var(--navy); border-color: var(--navy); color: #fff; }
.fp-tab-all.active { background: var(--navy-dark); border-color: var(--navy-dark); box-shadow: 0 3px 10px rgba(11,60,125,.35); }

.fp-single { display: flex; align-items: center; justify-content: center; gap: 16px; }
.fp-stage {
    width: 300px; height: 340px; max-width: 70vw; border-radius: 12px; background: #fff;
    border: 2px solid var(--border); box-shadow: inset 0 0 0 6px #f7f9fc;
    display: grid; place-items: center; position: relative; overflow: hidden;
}
.fp-stage img { max-width: 92%; max-height: 92%; object-fit: contain; }
.fp-loader, .fp-missing { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 8px; }
.fp-missing { color: #9ca3af; background: #f7f7f8; }
.fp-missing i { font-size: 42px; }
[hidden] { display: none !important; }
.fp-nav {
    width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--border); background: #fff;
    color: var(--navy); font-size: 20px; display: grid; place-items: center; flex-shrink: 0; transition: .15s;
}
.fp-nav:hover { background: var(--saffron); border-color: var(--saffron); color: #fff; }
.fp-caption { text-align: center; margin-top: 12px; color: var(--navy); font-weight: 600; }

.fp-grid { display: none; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.fp-modal .show-all .fp-grid, #fingerModal.show-all .fp-grid { display: grid; }
#fingerModal.show-all .fp-single, #fingerModal.show-all .fp-caption { display: none; }
.fp-cell { margin: 0; text-align: center; cursor: zoom-in; }
.fp-cell img, .fp-cell-empty {
    width: 100%; aspect-ratio: 316 / 354; object-fit: contain; background: #fff;
    border: 2px solid var(--border); border-radius: 10px; transition: .15s;
}
.fp-cell:hover img { border-color: var(--saffron); transform: translateY(-2px); }
.fp-cell-empty { display: grid; place-items: center; color: #c4c8ce; font-size: 26px; background: #f7f7f8; border-style: dashed; }
.fp-cell.none { cursor: default; }
.fp-cell figcaption { font-size: 12px; font-weight: 600; color: var(--navy); margin-top: 6px; }

@media (max-width: 576px) {
    .fp-grid { grid-template-columns: repeat(3, 1fr); }
    .fp-stage { width: 220px; height: 250px; }
    .fp-nav { width: 36px; height: 36px; }
    .fp-tab { padding: 6px 11px; font-size: 12px; }
}

.news-item { padding: 12px 0; border-bottom: 1px dashed var(--border); }
.news-item:last-child { border-bottom: 0; }
.news-item small { color: var(--muted); }

.detail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.detail-grid div small { display: block; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .4px; }
.detail-grid div b { font-weight: 500; word-break: break-word; }

.footer { background: var(--navy-dark); color: rgba(255,255,255,.7); text-align: center; padding: 14px; font-size: 12px; }
.footer b { color: var(--saffron); }

/* Login */
.login-page { min-height: 100vh; display: flex; flex-direction: column; }
.login-wrap { flex: 1; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-hero {
    background: linear-gradient(135deg, var(--navy) 0%, #1557a8 55%, var(--saffron) 120%);
    color: #fff; padding: 60px; display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden;
}
.login-hero::before, .login-hero::after { content: ""; position: absolute; border-radius: 50%; border: 40px solid rgba(255,255,255,.06); }
.login-hero::before { width: 380px; height: 380px; right: -120px; top: -120px; }
.login-hero::after { width: 260px; height: 260px; left: -80px; bottom: -80px; border-color: rgba(245,130,32,.25); }
.login-hero h1 { font-size: 38px; font-weight: 700; margin: 18px 0 8px; }
.login-hero h1 span { color: var(--saffron); }
.login-hero .hindi { font-size: 20px; opacity: .9; }
.login-hero .tags { display: flex; gap: 10px; margin-top: 28px; flex-wrap: wrap; }
.login-hero .tags span { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25); padding: 6px 14px; border-radius: 20px; font-size: 13px; }
.login-form-side { display: grid; place-items: center; padding: 40px 16px; background: #fff; }
.login-box { width: 100%; max-width: 400px; }
.login-box h2 { color: var(--navy); font-weight: 700; font-size: 26px; }
.login-box h2 + p { color: var(--muted); }
.login-box .input-group-text { background: var(--saffron-soft); color: var(--saffron-dark); border-color: #f3d9c2; }

@media (max-width: 991px) {
    .menu-toggle { display: block; }
    .sidebar { position: fixed; top: 78px; bottom: 0; left: 0; z-index: 1020; transform: translateX(-100%); transition: transform .2s; }
    .sidebar.open { transform: none; }
    .content { padding: 16px; }
    .page-banner { padding: 18px 16px; }
    .topbar { padding: 10px 16px; }
    .user-chip .meta { display: none; }
    .login-wrap { grid-template-columns: 1fr; }
    .login-hero { padding: 36px 24px; }
    .login-hero h1 { font-size: 28px; }
}
@media (max-width: 480px) {
    .brand-text small { display: none; }
}
