/* ==========================================================
   STATUS PAGE (template/status.html)
========================================================== */

.status-shell { max-width: 1180px; width: 94%; margin: -30px auto 45px; position: relative; z-index: 3; }
.status-card { background: #fff; border-radius: 20px; box-shadow: 0 14px 40px rgba(17, 61, 48, .12); border: 1px solid #dbe8e3; overflow: hidden; }
.status-head { padding: 24px 30px; background: linear-gradient(135deg, #075943, #0a6b51); color: #fff; display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.status-head h2 { margin: 0; font-size: 27px; }
.status-head p { margin: 6px 0 0; opacity: .88; }
.status-head-icon { font-size: 30px; }

.search-area { padding: 28px 30px; }
.search-box { display: grid; grid-template-columns: 1fr 1fr auto; gap: 14px; align-items: end; }
.search-box .field label { font-size: 15px; color: #244b3f; }
.search-box .field input { font-size: 17px; padding: 13px 15px; border-radius: 11px; background: #fbfdfc; }
.status-btn { border: 0; border-radius: 11px; padding: 0 28px; height: 50px; background: var(--green); color: #fff; font: 700 17px var(--font-latin); cursor: pointer; min-width: 160px; }
[lang="ur"] .status-btn { font-family: var(--font-urdu-ui); }
.status-btn:hover { background: #034d3a; }
.status-btn:disabled { opacity: .6; cursor: wait; }
.error-box { display: none; background: #fff1f1; color: #a52a2a; border: 1px solid #efcaca; border-radius: 10px; padding: 13px 15px; margin-top: 18px; }
.error-box.show { display: block; }

.empty-state { text-align: center; padding: 40px 20px 50px; color: #71827c; }
.empty-state .big { font-size: 44px; margin-bottom: 10px; }

.result { border-top: 1px solid #e3ece8; }
.result-top { padding: 26px 30px; background: #f8fbfa; display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.result-title { display: flex; align-items: center; gap: 14px; min-width: 0; }
.result-icon { width: 52px; height: 52px; flex: none; border-radius: 50%; display: grid; place-items: center; background: #dff2e9; color: #087052; font-size: 26px; font-weight: 800; }
.result-icon.bad { background: #fde3e0; color: #b93e33; }
.result-icon.warn { background: #fff0d6; color: #8c5300; }
.result-title h3 { margin: 0 0 5px; font-size: 23px; }
.result-title p { margin: 0; color: #5f716b; line-height: 1.7; }
.app-no { background: #fff; border: 1px solid #cfe0d9; border-radius: 10px; padding: 12px 16px; text-align: center; flex: none; }
.app-no small { display: block; color: #71827c; margin-bottom: 4px; }
.app-no strong { font-size: 19px; color: var(--green); display: block; }

.result-body { padding: 26px 30px 30px; }
.block-title { margin: 26px 0 6px; font-size: 16px; color: var(--green); }

.dept-message { margin-bottom: 20px; padding: 14px 16px; background: #eef6ff; border: 1px solid #c9def8; border-inline-start: 4px solid var(--blue); border-radius: 10px; }
.dept-message.attention { background: #fff7e8; border-color: #f0d6a6; border-inline-start-color: var(--orange); }
.dept-message strong { display: block; margin-bottom: 4px; font-size: 14px; }
.dept-message p { margin: 0; line-height: 1.8; white-space: pre-line; }

.info-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 8px; }
.info-item { background: #f7faf9; border: 1px solid #dce8e4; border-radius: 12px; padding: 13px 15px; min-width: 0; }
.info-item span { display: block; color: #74857f; font-size: 13px; margin-bottom: 5px; }
.info-item strong { font-size: 15px; color: #254b40; word-break: break-word; }
.info-item.ok { background: #eef9f2; border-color: #cfe8da; }
.info-item.wait { background: #fff9ec; border-color: #f0e2bd; }

/* timeline: 7 stages, horizontal on desktop */
.timeline { list-style: none; padding: 0; margin: 18px 0 8px; display: grid; grid-template-columns: repeat(7, 1fr); position: relative; }
.timeline::before { content: ""; position: absolute; top: 18px; inset-inline: 7%; height: 3px; background: #dbe7e2; z-index: 0; }
.timeline-item { position: relative; text-align: center; z-index: 1; padding: 0 4px; }
.timeline-dot {
    width: 36px; height: 36px; border-radius: 50%; margin: 0 auto 10px; background: #e2ebe7; border: 5px solid #fff;
    box-shadow: 0 0 0 1px #cbdcd5; display: grid; place-items: center; color: #7a8b85; font-weight: 700; font-size: 14px;
}
.timeline-item strong { display: block; font-size: 13px; color: #304f46; line-height: 1.4; }
.timeline-item small { display: block; color: #84938e; margin-top: 3px; font-size: 12px; }
.timeline-item.done .timeline-dot { background: #0a7758; color: #fff; box-shadow: 0 0 0 1px #0a7758; }
.timeline-item.active .timeline-dot { background: var(--blue); color: #fff; box-shadow: 0 0 0 1px var(--blue), 0 0 0 6px rgba(25, 118, 201, .15); }
.timeline-item.warn .timeline-dot { background: var(--orange); color: #fff; box-shadow: 0 0 0 1px var(--orange), 0 0 0 6px rgba(229, 138, 11, .15); }
.timeline-item.bad .timeline-dot { background: var(--red); color: #fff; box-shadow: 0 0 0 1px var(--red), 0 0 0 6px rgba(212, 75, 63, .15); }
.timeline-item.active small, .timeline-item.warn small { color: #155f99; font-weight: 700; }
.timeline-item.bad small { color: #b93e33; font-weight: 700; }
.timeline-item.done small { color: #0a7758; }

.action-strip { margin: 16px 0 0; }

.table-wrap { overflow-x: auto; }
.simple-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.simple-table th { background: #eef6f2; color: var(--green); text-align: start; padding: 10px 12px; font-size: 13px; white-space: nowrap; }
.simple-table td { padding: 10px 12px; border-bottom: 1px solid #e6eeeb; vertical-align: middle; }
.simple-table tbody tr:hover td { background: #f7fbf9; }

.history { list-style: none; margin: 0; padding: 0; }
.history li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px dashed #e0e9e5; }
.history li:last-child { border-bottom: 0; }
.h-dot { width: 11px; height: 11px; flex: none; border-radius: 50%; background: var(--green); margin-top: 6px; }
.history strong { display: block; font-size: 14px; }
.history small { color: #7a8b85; }
.history p { margin: 4px 0 0; font-size: 13.5px; color: #40564f; white-space: pre-line; }

.download-panel { margin-top: 24px; padding: 18px 20px; background: #edf8f2; border: 1px solid #cfe8da; border-radius: 14px; display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.download-panel h4 { margin: 0 0 5px; color: var(--green); font-size: 18px; }
.download-panel p { margin: 0; color: #64756f; font-size: 14px; }
.download-btn { display: inline-block; text-decoration: none; background: var(--green); color: #fff; border-radius: 10px; padding: 13px 22px; font-weight: 700; white-space: nowrap; }
.download-btn:hover { background: #034d3a; }

@media (max-width: 900px) {
    .info-grid { grid-template-columns: repeat(2, 1fr); }
    .search-box { grid-template-columns: 1fr; }
    .status-btn { width: 100%; }
    .result-top, .download-panel { flex-direction: column; align-items: flex-start; }
    .app-no { align-self: stretch; }

    /* timeline turns vertical */
    .timeline { grid-template-columns: 1fr; gap: 0; margin-inline: 4px; }
    .timeline::before { top: 18px; bottom: 18px; inset-inline: auto; inset-inline-start: 22px; width: 3px; height: auto; }
    .timeline-item { display: grid; grid-template-columns: 46px 1fr; text-align: start; align-items: center; padding: 8px 0; column-gap: 8px; }
    .timeline-dot { margin: 0; grid-row: span 2; }
    .timeline-item strong { align-self: end; }
    .timeline-item small { align-self: start; margin-top: 0; }
}
@media (max-width: 560px) {
    .status-shell { width: 100%; margin-top: -20px; padding: 0 8px; }
    .status-card { border-radius: 14px; }
    .status-head { padding: 18px 16px; }
    .status-head h2 { font-size: 22px; }
    .search-area, .result-body { padding: 18px 14px; }
    .result-top { padding: 18px 14px; }
    .info-grid { grid-template-columns: 1fr; }
    .result-title h3 { font-size: 20px; }

    /* tables become stacked cards */
    .stack-mobile thead { display: none; }
    .stack-mobile, .stack-mobile tbody, .stack-mobile tr, .stack-mobile td { display: block; width: 100%; }
    .stack-mobile tr { border: 1px solid #dfe9e5; border-radius: 10px; margin-bottom: 10px; padding: 6px 10px; }
    .stack-mobile td { border: 0; padding: 5px 0; display: flex; justify-content: space-between; gap: 12px; text-align: end; }
    .stack-mobile td::before { content: attr(data-label); font-weight: 700; color: #74857f; text-align: start; font-size: 12.5px; }
    .stack-mobile td:empty { display: none; }
}

/* ── simplified status page: CNIC-only search, 3-stage timeline, PDF unlock ── */
.search-box.one { grid-template-columns: 1fr auto; }
.timeline.three { grid-template-columns: repeat(3, 1fr); }
.timeline.three::before { inset-inline: 16.6%; }
.download-panel.stack { flex-direction: column; align-items: stretch; }
.pdf-form { display: flex; gap: 10px; flex-wrap: wrap; }
.pdf-form input { flex: 1 1 200px; min-height: 46px; padding: 9px 12px; border: 1px solid #cbd9d6; border-radius: 10px; font: 16px Arial, sans-serif; background: #fff; }
.download-btn.as-button { border: 0; cursor: pointer; font: inherit; font-weight: 700; min-height: 46px; }
.download-btn.as-button:disabled { opacity: .6; }
@media (max-width: 900px) {
    .timeline.three { grid-template-columns: 1fr; }
    .timeline.three::before { inset-inline-start: 22px; inset-inline-end: auto; }
}
@media (max-width: 560px) { .search-box.one { grid-template-columns: 1fr; } }
