/* STES Staff KYC - additions on top of base.css (light "app" theme tokens). */

.app-main .panel { margin-bottom: 20px; }

/* Overall progress */
.progress { height: 8px; background: var(--paper-2); border-radius: 20px; overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: var(--primary-color, #2563eb);
    border-radius: 20px; transition: width .35s ease; }

.badge.idle { background: var(--paper-2); color: var(--muted-2); }
.badge.warn { background: #fdf3d8; color: #8a6100; }

/* Tabs - one page, one step per tab; the declaration is always last. */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 18px; padding-bottom: 2px; }
.tab { display: inline-flex; align-items: center; gap: 7px; border: 1.5px solid var(--rule);
    background: #fff; color: var(--ink-soft); border-radius: 999px; padding: 7px 14px;
    font: inherit; font-size: 0.83rem; font-weight: 500; cursor: pointer; white-space: nowrap;
    transition: background .15s, border-color .15s, color .15s; }
.tab:hover { border-color: var(--primary-color, #2563eb); color: var(--ink); }
.tab.active { background: var(--primary-color, #2563eb); border-color: var(--primary-color, #2563eb); color: #fff; }
.tab-dot { display: inline-block; width: 15px; height: 15px; line-height: 15px; text-align: center;
    border-radius: 50%; font-size: 0.62rem; font-weight: 700; }
.tab-dot.todo { background: var(--paper-2); border: 1.5px solid var(--rule); box-sizing: border-box; }
.tab-dot.ok   { background: #16a34a; color: #fff; }
.tab-dot.opt  { background: var(--paper-2); color: var(--muted-2); }
.tab.active .tab-dot.todo { background: rgba(255,255,255,.25); border-color: rgba(255,255,255,.6); }
.tab.active .tab-dot.opt  { background: rgba(255,255,255,.25); color: #fff; }
.tab-panel[hidden] { display: none; }

/* Step navigation under the panels */
.tab-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px;
    margin: 4px 0 32px; }
.tab-nav .btn-ghost, .tab-nav .btn-primary { min-width: 150px; }
.tab-nav-pos { font-size: 0.78rem; color: var(--muted-2); white-space: nowrap; }

@media (max-width: 560px) {
    .tab-nav .btn-ghost, .tab-nav .btn-primary { min-width: 0; flex: 1 1 0; }
    .tab-nav-pos { display: none; }
}

/* Per-field cross-check pills (record vs source, and source vs source) */
.chk-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chk { font-size: 0.72rem; border-radius: 5px; padding: 3px 8px; border: 1px solid transparent; }
.chk.ok  { background: #e8f5ec; color: #1a6b36; border-color: #b6ddc3; }
.chk.bad { background: var(--bad-bg); color: var(--bad-fg); border-color: #e0aca6; }
.chk.na  { background: var(--paper-2); color: var(--muted-2); border-color: var(--rule); }

.notice.warn { background: #fdf3d8; border-color: #e8cf94; color: #7a5600; }
.notice.ok   { background: #e8f5ec; border-color: #b6ddc3; color: #1a6b36; }

/* Login: one code box per registered contact */
.otp-channel { margin-bottom: 14px; text-align: left; }
.otp-channel .otp-to { color: var(--muted-2); font-weight: 400; }
.otp-row { display: flex; gap: 8px; align-items: stretch; }
.otp-row .otp-input { flex: 1 1 auto; margin: 0; }
.otp-row .otp-verify { flex: 0 0 auto; white-space: nowrap; }
.otp-note { font-size: 0.72rem; color: var(--bad-fg); margin-top: 4px; }
.otp-note.ok { color: #1a6b36; }
.otp-channel.undeliverable .otp-input { opacity: .55; }
.otp-channel.verified .otp-input { opacity: .7; border-color: #b6ddc3; background: #f2fbf5; }
.otp-input.bad { border-color: var(--bad-fg); }

/* Employment particulars: one confirmable row each */
.emp-attest-list { border: 1px solid var(--rule, #e6e2d8); border-radius: 8px; padding: 4px 14px; }
.emp-attest-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; margin: 0;
    border-bottom: 1px solid var(--rule, #efece4); cursor: pointer; }
.emp-attest-row:last-child { border-bottom: 0; }
.emp-attest-row input { flex: 0 0 auto; margin: 0; }
.emp-attest-row .ea-k { flex: 0 0 160px; color: var(--muted-2); }
.emp-attest-row .ea-v { flex: 1 1 auto; font-weight: 600; }
@media (max-width: 560px) {
    .emp-attest-row { flex-wrap: wrap; }
    .emp-attest-row .ea-k { flex-basis: auto; }
}

/* Salary breakdown */
.sal-card .sal-cols { display: flex; gap: 28px; flex-wrap: wrap; }
.sal-card .sal-cols > div { flex: 1 1 240px; }
.sal-h { font-weight: 600; margin-bottom: 6px; }
.sal-line { display: flex; justify-content: space-between; gap: 16px; padding: 4px 0; }
.sal-totals { margin-top: 12px; border-top: 1px dashed var(--rule, #ccc); padding-top: 8px; }
.sal-line.strong { font-weight: 700; border-top: 1px solid var(--rule, #e6e2d8); margin-top: 4px; padding-top: 8px; }

/* Declaration */
.declaration { margin-top: 14px; padding: 16px 18px; border: 1.5px solid var(--rule);
    border-radius: 9px; background: var(--paper); font-size: 0.86rem; line-height: 1.65;
    color: var(--ink); max-height: 340px; overflow-y: auto; }

/* Section cards */
.sections-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 12px; margin-top: 14px; }
.sec-card { border: 1.5px solid var(--rule); border-radius: 9px; padding: 14px; background: #fff; }
.sec-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sec-title { font-weight: 600; color: var(--ink); font-size: 0.95rem; }
.sec-from { font-size: 0.68rem; text-transform: uppercase; letter-spacing: .06em;
    color: var(--muted-2); margin-top: 2px; }
.sec-detail { margin-top: 10px; display: grid; gap: 8px; }
.sec-detail .k { display: block; font-size: 0.62rem; text-transform: uppercase; letter-spacing: .06em;
    color: var(--muted-2); margin-bottom: 1px; }
.sec-detail > div { font-size: 0.82rem; color: var(--ink); word-break: break-word; }
.sec-warn { margin-top: 8px; font-size: 0.75rem; color: var(--bad-fg);
    background: var(--bad-bg); border: 1px solid #e0aca6; border-radius: 6px; padding: 6px 9px; }

/* Comparison table (record vs verified) */
.unmask-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8rem;
    color: var(--ink-soft); cursor: pointer; white-space: nowrap; }
.cmp-table { width: 100%; }
.cmp-table td { vertical-align: top; }
.cmp-field { font-weight: 600; color: var(--ink); white-space: nowrap; }
.cmp-note { font-size: 0.7rem; color: var(--muted-2); margin-top: 3px; }

/* Mobile: the 4-column compare table is unreadable when scrolled sideways, so stack
   each row into a labelled card (field name as the card header, value per line). */
@media (max-width: 640px) {
    .cmp-wrap { overflow-x: visible; border: 0; background: transparent; }
    .cmp-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    .cmp-table, .cmp-table tbody, .cmp-table tr, .cmp-table td { display: block; width: 100%; }
    .cmp-table tr { border: 1.5px solid var(--rule); border-radius: 10px; background: #fff;
        margin-bottom: 12px; padding: 4px 12px; }
    .cmp-table td { border-top: 0; padding: 8px 0; display: flex; gap: 14px;
        justify-content: space-between; align-items: baseline; text-align: right; }
    .cmp-table td::before { content: attr(data-label); flex: 0 0 40%; text-align: left;
        font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.06em;
        color: var(--muted-2); font-weight: 600; }
    .cmp-table td.cmp-field { white-space: normal; text-align: left; font-size: 0.95rem;
        border-bottom: 1px solid var(--rule); padding-bottom: 8px; }
    .cmp-table td.cmp-field::before { content: none; }
    .cmp-table .cmp-note, .cmp-table .cmp-warn { text-align: right; }
}
.cmp-warn { font-size: 0.72rem; color: var(--bad-fg); background: var(--bad-bg);
    border: 1px solid #e0aca6; border-radius: 5px; padding: 4px 7px; margin-top: 5px; }
.cmp-check { display: inline-flex; align-items: flex-start; gap: 7px; font-size: 0.8rem;
    color: var(--ink-soft); cursor: pointer; }
.cmp-check input { margin-top: 2px; }

/* Photo section */
.photo-row { display: flex; gap: 20px; margin-top: 14px; flex-wrap: wrap; align-items: flex-start; }
.photo-preview { width: 165px; height: 212px; flex: 0 0 auto; border: 1.5px dashed var(--rule);
    border-radius: 8px; background: var(--paper-2); display: flex; align-items: center; justify-content: center;
    color: var(--muted-2); font-size: 0.78rem; overflow: hidden; }
.photo-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-controls { flex: 1 1 260px; display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; }
.photo-controls .btn-ghost, .photo-controls .btn-primary { height: 38px; }
.photo-controls .error-message { flex-basis: 100%; }

/* In-app camera + passport guide overlay */
.cam-box { background: #fff; border-radius: 12px; padding: 18px; width: 100%; max-width: 380px;
    color: var(--ink); }
.cam-stage { position: relative; width: 100%; aspect-ratio: 413 / 531; background: #111;
    border-radius: 8px; overflow: hidden; }
.cam-stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
    transform: scaleX(-1); }              /* mirror preview only; captured frame stays un-mirrored */
.cam-guide { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.cam-guide .cg-frame { fill: none; stroke: rgba(255,255,255,.5); stroke-width: 2; stroke-dasharray: 6 5; }
.cam-guide .cg-head  { fill: none; stroke: #4ade80; stroke-width: 2.5; }
.cam-guide .cg-eye,
.cam-guide .cg-center { stroke: rgba(255,255,255,.55); stroke-width: 1.5; stroke-dasharray: 4 4; }
.cam-hint { font-size: 0.8rem; color: var(--ink-soft); margin: 12px 0 4px; text-align: center; }

/* Additional details */
.extra-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 20px; }
.extra-sub { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 12px 20px;
    padding: 12px 14px; border: 1px dashed var(--rule); border-radius: 8px; background: var(--paper); }
.ex-locked { font-size: 0.9rem; color: var(--ink); padding: 7px 0; }

@media (max-width: 560px) {
    .app-main { padding: 20px 14px 50px; }
    .kv-grid { grid-template-columns: 1fr; }
    .extra-grid, .extra-sub { grid-template-columns: 1fr; }
}
