* { margin:0; padding:0; box-sizing:border-box; }
body { font-family:Arial,sans-serif; background:#f3f6fb; color:#17243a; }
[hidden] { display:none !important; }
.app { min-height:100vh; }
.topbar { background:blue; color:white; padding:18px 22px; display:flex; justify-content:space-between; align-items:center; }
.topbar h2 { font-size:19px; letter-spacing:.5px; }
.topbar p { font-size:12px; margin-top:5px; opacity:.8; }
.menu-btn { background:transparent; border:1px solid white; color:white; padding:7px 12px; font-size:20px; border-radius:5px; cursor:pointer; }
.layout { display:flex; min-height:calc(100vh - 70px); }
.sidebar { width:245px; flex:0 0 245px; background:#102f60; color:white; padding:20px 12px; display:flex; flex-direction:column; }
.organization { padding:15px; border-bottom:1px solid #36547c; margin-bottom:15px; }
.organization span { display:block; font-size:10px; opacity:.7; margin-bottom:7px; }
.organization strong { font-size:14px; }
.sidebar nav { display:flex; flex-direction:column; gap:6px; }
.nav-btn { background:transparent; color:white; border:0; text-align:left; padding:13px 12px; border-radius:6px; font-size:13px; cursor:pointer; }
.nav-btn:hover,.nav-btn.active { background:#28518a; }
.logout-btn { margin-top:auto; padding:12px; background:#28518a; color:white; border:0; border-radius:6px; cursor:pointer; }
.main-content { flex:1; padding:25px; min-width:0; }
.page { display:none; }
.page.active { display:block; }
.page-heading { display:flex; justify-content:space-between; align-items:center; margin-bottom:25px; }
.page-heading h1 { font-size:25px; color:#102f60; }
.page-heading p { font-size:13px; color:#778398; margin-top:7px; }
.stats { display:grid; grid-template-columns:repeat(4,1fr); gap:15px; margin-bottom:22px; }
.stat-card,.panel { background:white; padding:20px; border-radius:9px; box-shadow:0 2px 12px rgba(20,40,70,.05); }
.stat-card span { font-size:12px; color:#758198; }
.stat-card h2 { margin-top:12px; font-size:28px; color:#102f60; }
.panel { margin-bottom:20px; }
.panel h3 { font-size:16px; margin-bottom:18px; }
.quick-actions { display:flex; flex-wrap:wrap; gap:12px; }
.primary-btn,.secondary-btn { border:0; padding:12px 17px; border-radius:5px; cursor:pointer; font-size:13px; }
.primary-btn { background:#102f60; color:white; }
.primary-btn:hover { background:#214a82; }
.primary-btn:disabled { opacity:.65; cursor:not-allowed; }
.secondary-btn { background:#e8eef7; color:#102f60; }
.empty-message { color:#8a94a5; font-size:13px; padding:12px 0; }
.form-grid { display:grid; grid-template-columns:1fr 1fr; gap:18px; }
.form-group { display:flex; flex-direction:column; gap:8px; margin-bottom:17px; min-width:0; }
.form-group label { font-size:13px; font-weight:bold; color:#34445c; }
.form-group input,.form-group select,.form-group textarea { width:100%; min-width:0; padding:12px; border:1px solid #dce2eb; border-radius:5px; outline:none; font-size:13px; background:white; color:#17243a; }
.form-group input:focus,.form-group select:focus,.form-group textarea:focus { border-color:#28518a; }
.form-group input[readonly] { background:#f1f4f8; color:#58677d; }
.form-group input:disabled { background:#f1f4f8; cursor:not-allowed; }
.form-group textarea { min-height:90px; resize:vertical; }
.full { grid-column:1/-1; }
.form-section-title { color:#102f60; font-size:15px; border-bottom:1px solid #e7edf5; padding-bottom:10px; margin:24px 0 18px; }
.form-section-title:first-child { margin-top:0; }
.field-help { display:block; color:#758198; font-size:11px; line-height:1.5; margin-top:8px; }
.warning-text { color:#9a5b00; }
.management-option { background:#f1f5fb; padding:15px; border-radius:6px; margin:10px 0 20px; }
.management-option label { font-size:13px; }
.management-option small { display:block; margin-top:8px; color:#718097; line-height:1.5; }
.submit-btn { width:100%; padding:14px; margin-top:18px; }
.form-message { margin-top:15px; font-size:13px; line-height:1.5; }
.verify-panel { max-width:700px; }
.verify-panel .form-group { margin-bottom:15px; }
#verificationResult { margin-top:20px; }
.result-box { padding:15px; border-radius:6px; background:#f1f5fb; font-size:14px; line-height:1.7; overflow-wrap:anywhere; }
.notice { padding:16px 18px; border-radius:8px; margin-bottom:18px; font-size:13px; line-height:1.55; }
.info-notice { background:#eaf2ff; border-left:4px solid #28518a; color:#23436e; }
.info-notice p { margin-top:5px; }
.card-fields-note { background:#f5f7fb; border:1px solid #e1e8f2; border-radius:7px; padding:15px; margin-top:16px; font-size:13px; line-height:1.55; }
.card-fields-note p { margin-top:5px; color:#596980; }
.auth-screen { min-height:100vh; display:flex; align-items:center; justify-content:center; padding:24px; background:#f3f6fb; }
.auth-card { width:100%; max-width:440px; background:#fff; padding:32px; border-radius:12px; box-shadow:0 8px 30px rgba(20,40,70,.10); }
.auth-brand { color:#102f60; font-size:20px; font-weight:800; letter-spacing:.4px; }
.auth-subtitle { color:#778398; font-size:13px; margin:8px 0 30px; }
.auth-card h1 { color:#102f60; font-size:24px; margin-bottom:8px; }
.auth-help { color:#778398; font-size:13px; line-height:1.5; margin-bottom:24px; }
.auth-submit { width:100%; padding:14px; }
.auth-loading { min-height:100vh; display:flex; align-items:center; justify-content:center; color:#102f60; font-weight:bold; padding:20px; }
.auth-user { color:#dce8f8; font-size:11px; margin-top:8px; overflow-wrap:anywhere; }
#loginMessage { line-height:1.5; }
.table-wrap { width:100%; overflow-x:auto; }
.data-table { width:100%; border-collapse:collapse; font-size:12px; min-width:650px; }
.data-table th,.data-table td { text-align:left; padding:12px 10px; border-bottom:1px solid #e8edf4; vertical-align:middle; }
.data-table th { color:#53627a; background:#f7f9fc; font-size:11px; text-transform:uppercase; letter-spacing:.3px; }
.status-pill { display:inline-block; padding:5px 8px; border-radius:20px; font-size:11px; text-transform:capitalize; background:#edf0f5; color:#46556b; }
.status-active { background:#e7f6ed; color:#17663a; }
.status-suspended { background:#fff4df; color:#8b5700; }
.status-revoked,.status-expired { background:#fdebea; color:#a52a24; }
.status-select { padding:7px; border:1px solid #dce2eb; border-radius:5px; background:#fff; text-transform:capitalize; }
@media(max-width:900px) { .stats { grid-template-columns:repeat(2,1fr); } }
@media(max-width:650px) {
  .layout { display:block; }
  .sidebar { display:none; width:100%; }
  .sidebar.show { display:flex; }
  .main-content { padding:16px; }
  .stats { grid-template-columns:1fr 1fr; gap:10px; }
  .stat-card { padding:15px; }
  .stat-card h2 { font-size:23px; }
  .form-grid { grid-template-columns:1fr; gap:0; }
  .full { grid-column:auto; }
  .page-heading h1 { font-size:21px; }
}
@media(max-width:480px) { .auth-card { padding:24px 20px; } }
.app-footer { background:blue; border-top:1px solid #e3e9f1; padding:18px 20px; text-align:center; line-height:1.6; }
.footer-brand { color:#102f60; font-size:15px; font-weight:800; letter-spacing:2px; }
.footer-tagline { color:#28518a; font-size:12px; font-weight:600; letter-spacing:.3px; }
.footer-year { color:white; font-size:14px; margin-top:4px; }


/* Passport photo shown in authenticated ID verification results. */
.verification-photo-wrap {
    display: flex;
    justify-content: center;
    margin: 0 0 18px;
}
.verification-photo {
    display: block;
    width: 132px;
    height: 160px;
    object-fit: cover;
    border-radius: 10px;
    border: 2px solid #d7e0eb;
    background: #f3f6fa;
}


/* T-KEL logo branding */
.auth-brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
}
.auth-brand img {
    display: block;
    width: min(100%, 190px);
    height: auto;
    border-radius: 7px;
}
.auth-brand span {
    color: #102f60;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: .4px;
}
.topbar-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}
.topbar-brand img {
    display: block;
    width: 86px;
    height: auto;
    flex: 0 0 auto;
    border-radius: 5px;
}
.topbar-brand h2 { font-size: 19px; }
.footer-logo {
    display: block;
    width: 112px;
    max-width: 45%;
    height: auto;
    margin: 0 auto 8px;
    border-radius: 5px;
}
@media(max-width:480px) {
    .topbar { padding: 13px 14px; }
    .topbar-brand { gap: 9px; }
    .topbar-brand img { width: 66px; }
    .topbar-brand h2 { font-size: 15px; }
    .topbar-brand p { font-size: 10px; }
}


/* Verification preview: photo first, complete image, card details underneath. */
.verification-card-preview {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    max-width: 460px;
    margin: 18px auto 0;
    padding: 18px;
    background: #ffffff;
    border: 2px solid #153f91;
    border-radius: 12px;
    box-shadow: 0 5px 18px rgba(16, 47, 96, .10);
    overflow: hidden;
}
.verification-status {
    order: 0;
    margin: -18px -18px 18px;
    padding: 12px 14px;
    text-align: center;
    color: #ffffff;
    background: #153f91;
    font-weight: 800;
    font-size: 13px;
    letter-spacing: .4px;
}
.verification-status.is-active { background: #176b3a; }
.verification-status.needs-attention { background: #9a5a00; }
.verification-photo-wrap {
    order: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 190px;
    margin: 0 auto 18px;
    padding: 8px;
    box-sizing: border-box;
    background: #f3f6fa;
    border: 1px solid #d7e0eb;
    border-radius: 8px;
}
.verification-photo {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 260px;
    object-fit: contain;
    object-position: center center;
    border: 0;
    border-radius: 4px;
    background: #ffffff;
}
.verification-photo-placeholder {
    order: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 190px;
    margin: 0 auto 18px;
    padding: 12px;
    box-sizing: border-box;
    color: #52627a;
    background: #f3f6fa;
    border: 1px dashed #9aaac0;
    border-radius: 8px;
    text-align: center;
}
.verification-details {
    order: 2;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    width: 100%;
}
.verification-detail {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 9px 4px;
    border-bottom: 1px solid #e5eaf1;
    overflow-wrap: anywhere;
}
.verification-detail span {
    color: #62718a;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .45px;
}
.verification-detail strong {
    color: #142b4d;
    font-size: 14px;
    font-weight: 700;
}
.verification-note {
    order: 3;
    display: block;
    margin-top: 14px;
    color: #6b7789;
    line-height: 1.5;
}
@media(max-width:480px) {
    .verification-card-preview {
        max-width: 100%;
        padding: 14px;
    }
    .verification-status { margin: -14px -14px 14px; }
    .verification-photo-wrap { min-height: 170px; }
    .verification-photo { max-height: 240px; }
}


/* QR scanner and the two verification methods */
.verify-method-card {
    padding: 16px;
    margin: 0 0 14px;
    border: 1px solid #dce4ef;
    border-radius: 10px;
    background: #ffffff;
}
.verify-method-card h3 {
    margin: 0 0 12px;
    color: #153f91;
    font-size: 17px;
}
.verify-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 14px 0;
    color: #738198;
    font-size: 12px;
    font-weight: 800;
}
.verify-divider::before,
.verify-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #dce4ef;
}
.scanner-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.qr-scanner {
    width: 100%;
    max-width: 420px;
    margin: 16px auto 8px;
    overflow: hidden;
    border: 2px solid #153f91;
    border-radius: 12px;
    background: #101828;
}
.qr-scanner video {
    width: 100% !important;
    height: auto !important;
    object-fit: cover;
}
#qrScannerMessage {
    margin-top: 10px;
}


/* Organization onboarding and account recovery */
.auth-extra { margin-top: 22px; padding-top: 18px; border-top: 1px solid #e7edf5; text-align: center; }
.auth-extra p { color: #596980; font-size: 13px; margin-bottom: 10px; }
.auth-form-title { color: #102f60; font-size: 21px; margin: 8px 0 12px; }
.auth-link-btn { display: block; margin: 12px auto 0; padding: 7px 10px; border: 0; background: transparent; color: #28518a; text-decoration: underline; font-size: 13px; cursor: pointer; }
.auth-submit { display: block; width: 100%; }


/* T-KEL AUTHENTICATOR — FULL SCREEN RESPONSIVE LAYOUT */

.auth-screen {
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 0;
    display: flex;
    align-items: stretch;
    justify-content: stretch;
}

.auth-card {
    width: 100%;
    max-width: none;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    padding: clamp(20px, 4vw, 55px);
    border-radius: 0;
    box-shadow: none;
    background: #ffffff;
}

.auth-card form {
    width: 100%;
}

.auth-card .form-group {
    width: 100%;
}

.auth-card .form-group input,
.auth-card .form-group select,
.auth-card .form-group textarea {
    width: 100%;
    font-size: 16px;
    min-height: 48px;
}

.auth-card .auth-submit {
    width: 100%;
    min-height: 50px;
}

.auth-brand img {
    max-width: 240px;
}

@media (max-width: 650px) {
    .auth-card {
        padding: 22px 16px;
    }

    .auth-brand img {
        max-width: 190px;
    }
}


/* Login and registration footer */
.auth-screen {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 0;
}

.auth-card {
    flex: 1 0 auto;
    min-height: 0;
    width: 100%;
    max-width: none;
    border-radius: 0;
    box-shadow: none;
}

.auth-footer {
    width: 100%;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 20px 15px;
    background: #0000ff;
    color: #ffffff;
    text-align: center;
}

.auth-footer img {
    width: 85px;
    max-width: 35%;
    height: auto;
    border-radius: 5px;
    margin-bottom: 5px;
}

.auth-footer strong {
    font-size: 16px;
    letter-spacing: 2px;
}

.auth-footer span {
    font-size: 12px;
}

.auth-footer small {
    font-size: 11px;
    margin-top: 5px;
}


/* Keep the loading element out of the page layout */
#authLoading[hidden] {
    display: none !important;
}

/* Show loading only when JavaScript activates it */
#authLoading:not([hidden]) {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    background: #f2f5fc;
    color: #17345f;
}
