body { background: #f5f6f8; }
.table thead th { white-space: nowrap; background: #f8f9fa; }
.progress-lg { height: 26px; }
.metric { background: #f8f9fa; border-radius: 10px; padding: 10px 8px; min-height: 72px; }
.metric span { display:block; font-size:1.45rem; font-weight:700; }
.metric small { display:block; color:#6c757d; }
.court-status-wrap { max-height:360px; overflow-y:auto; }
.status-COMPLETED, .status-PROCESSING, .status-ERROR, .status-NOT_SITTING { font-weight:700; }
.status-WAITING, .status-NOT_SITTING { color:#6c757d; }

.upcoming-table { font-size: .93rem; }
.upcoming-table td { vertical-align: top; }
.aphc-case-link {
    border: 0;
    background: transparent;
    padding: 0;
    color: #0000ee;
    text-decoration: underline;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}
.aphc-case-link:hover { color: #551a8b; }
.aphc-status-pending { color: red !important; font-weight: 700; }
.aphc-status-good { color: green !important; font-weight: 700; }

/* APHC-inspired Case Details overlay */
body.aphc-modal-open { overflow: hidden; }
.aphc-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0,0,0,.47);
    padding: 16px;
    overflow: hidden;
}
.aphc-overlay.show { display: flex; justify-content: center; align-items: flex-start; }
.aphc-modal {
    width: min(1100px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    margin: 0 auto;
    background: #fff;
    box-shadow: 0 3px 18px rgba(0,0,0,.35);
    display: flex;
    flex-direction: column;
    font-family: Arial, Helvetica, sans-serif;
}
.aphc-modal-head {
    position: relative;
    padding: 20px 22px 16px;
    border-bottom: 1px solid #ddd;
    background: #fff;
}
.aphc-modal-head h2 {
    margin: 0;
    font-size: 30px;
    font-weight: 400;
    color: #000;
}
.aphc-x {
    position: absolute;
    right: 14px;
    top: 8px;
    border: 0;
    background: transparent;
    color: #c8c8c8;
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
}
.aphc-modal-body {
    overflow-y: auto;
    padding: 26px 14px 0;
    background: #fff;
}
.aphc-modal-foot {
    display: flex;
    justify-content: flex-end;
    padding: 14px 16px;
    border-top: 1px solid #ddd;
    background: #fff;
}
.aphc-section-title {
    border: 1px solid #ddd;
    border-bottom: 0;
    padding: 9px 10px;
    text-align: center;
    color: #0000ee;
    font-size: 18px;
    font-weight: 700;
    background: #fff;
}
.aphc-detail-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 28px;
    color: #111;
    font-size: 17px;
}
.aphc-detail-table th,
.aphc-detail-table td {
    border: 1px solid #ddd;
    padding: 9px 10px;
    text-align: left;
    vertical-align: top;
    background: #fff;
}
.aphc-detail-table th { font-weight: 400; width: 18%; }
.aphc-detail-table td { font-weight: 700; width: 32%; }
.aphc-repeat-table thead th { font-weight: 400; background: #fff; width: auto; }
.aphc-repeat-table tbody td { font-weight: 700; width: auto; }
.aphc-prayer {
    border: 1px solid #ddd;
    padding: 10px;
    margin-bottom: 28px;
    min-height: 56px;
    white-space: pre-wrap;
    font-size: 17px;
    font-weight: 700;
    color: #343400;
    background: #fff;
}
.aphc-empty {
    border: 1px solid #ddd;
    padding: 14px;
    margin-bottom: 28px;
    color: #6c757d;
    background: #fff;
}
.aphc-sync-note {
    text-align: right;
    font-size: 12px;
    color: #777;
    margin: -12px 0 18px;
}

@media (max-width: 760px) {
    .aphc-overlay { padding: 0; }
    .aphc-modal { width: 100vw; max-height: 100vh; }
    .aphc-modal-head h2 { font-size: 24px; }
    .aphc-detail-table { font-size: 14px; }
    .aphc-detail-table th, .aphc-detail-table td { min-width: 145px; }
}

/* Version II: closer APHC Case Details visual treatment */
.aphc-modal {
    border: 1px solid #bdbdbd;
}
.aphc-modal-body {
    scrollbar-gutter: stable;
}
.aphc-section-title {
    letter-spacing: 0;
}
.aphc-detail-table th {
    color: #111;
}
.aphc-detail-table td {
    color: #111;
}
.aphc-repeat-table tbody td {
    white-space: pre-wrap;
}
.aphc-source-note {
    margin: -12px 0 6px;
    text-align: right;
    font-size: 12px;
    color: #777;
}
.aphc-modal-foot .btn {
    border-radius: 4px;
    background: #fff;
}

/* Version II preserved APHC HTML snapshot */
.aphc-source-html { color:#111; font-family:Arial, Helvetica, sans-serif; font-size:15px; }
.aphc-source-html table { width:100% !important; border-collapse:collapse !important; margin-bottom:22px; background:#fff; }
.aphc-source-html th,
.aphc-source-html td { border:1px solid #ddd !important; padding:8px 10px !important; vertical-align:top !important; background:#fff !important; }
.aphc-source-html th { font-weight:600; }
.aphc-source-html a { color:#0000ee; text-decoration:underline; }
.aphc-source-html .text-primary,
.aphc-source-html [style*="blue"] { color:#0000ee !important; }
.aphc-source-html img { max-width:100%; height:auto; }
.aphc-source-html .table-responsive { overflow-x:auto; }
.run-management-note { font-size:.85rem; color:#6c757d; }
.portal-nav{background:linear-gradient(90deg,#14213d,#243b67)}
.hero-card{background:linear-gradient(120deg,#14213d,#284b7a);color:white;border-radius:18px;padding:28px 30px;display:flex;justify-content:space-between;align-items:center;box-shadow:0 10px 30px rgba(20,33,61,.18)}
.hero-card h1{font-weight:750;margin:.2rem 0}.eyebrow{font-size:.75rem;letter-spacing:.16em;opacity:.75}.stat-card{background:white;border:1px solid #e7eaf0;border-radius:14px;padding:18px;box-shadow:0 5px 18px rgba(30,50,80,.06);height:100%}.stat-label{font-size:.78rem;text-transform:uppercase;letter-spacing:.05em;color:#667085}.stat-value{font-size:2rem;font-weight:800;color:#14213d}.bar-row{display:flex;justify-content:space-between;padding:10px 0;border-bottom:1px solid #eef0f4}.login-card{max-width:430px;margin-top:8vh}.font-monospace{font-size:.82rem}


body{background:#f4f7fb}
.portal-shell{min-height:100vh}
.topbar{background:linear-gradient(135deg,#082d57,#0d4b83);color:#fff}
.topbar .brand{font-weight:800;letter-spacing:.2px}
.topbar a{color:#eaf3ff;text-decoration:none}
.hero{background:linear-gradient(135deg,#0b3768,#14629d);color:#fff;border-radius:18px;padding:24px;box-shadow:0 14px 34px rgba(9,54,99,.16)}
.stat-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(155px,1fr));gap:14px}
.stat-card{background:#fff;border:0;border-radius:16px;padding:18px;box-shadow:0 8px 22px rgba(20,45,75,.07)}
.stat-value{font-size:1.7rem;font-weight:800;color:#0c477e}
.panel{background:#fff;border-radius:16px;box-shadow:0 8px 22px rgba(20,45,75,.07);padding:18px}
.case-link{color:#075aa6;font-weight:700;text-decoration:underline;cursor:pointer}
.badge-yes{background:#d9f7e8;color:#087044}.badge-no{background:#fff1c9;color:#805a00}
.pill{display:inline-block;padding:.3rem .65rem;border-radius:999px;font-weight:700;font-size:.78rem}
.nav-tabs-v42 a.active{background:rgba(255,255,255,.15);border-radius:8px}
.modal-v42{position:fixed;inset:0;background:rgba(0,0,0,.48);display:none;align-items:center;justify-content:center;padding:20px;z-index:9999}
.modal-v42.open{display:flex}.modal-card{background:#fff;width:min(1100px,96vw);max-height:90vh;overflow:auto;border-radius:16px}
.detail-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:10px}
.detail-cell{border:1px solid #e5eaf0;border-radius:10px;padding:10px}
.detail-label{font-size:.72rem;text-transform:uppercase;color:#6c7887;font-weight:800}
.login-card{max-width:430px;margin:50px auto}
@media(max-width:700px){.hero{padding:18px}.desktop-only{display:none}}
