/* =====================================================================
   PHSA Portal — shared design system for the Candidate, College and
   Admin panels (navy/gold brand established in admin/login.php).
   Loaded alongside Bootstrap 4.5.2 + Font Awesome 4.7 (CDN).
   ===================================================================== */

:root {
    --phsa-navy: #0a2647;
    --phsa-navy-light: #1a4a7a;
    --phsa-gold: #d4af37;
    --phsa-gold-light: #f5c542;
    --phsa-green: #0b3d24;
    --phsa-bg: #f4f7fb;
    --phsa-text-muted: #6c7a8a;
    --phsa-border: #dde1e6;
    --phsa-success: #28a745;
    --phsa-danger: #dc3545;
    --phsa-warning: #e0a800;
}

body.phsa-body {
    background: var(--phsa-bg);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #33414e;
}

/* ---- Official government identification strip (all portals) ---- */
.phsa-gov-strip {
    background: var(--phsa-green);
    color: rgba(255,255,255,0.92);
    font-size: 0.72rem;
    letter-spacing: 0.2px;
    padding: 4px 1.2rem;
    text-align: center;
}
.phsa-gov-strip i { color: var(--phsa-gold-light); margin-right: 5px; }

/* ---- Top navbar (all portals) ---- */
.phsa-navbar {
    background: var(--phsa-navy);
    border-bottom: 3px solid var(--phsa-gold);
    padding: 0.6rem 1.2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1030;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}
.phsa-navbar .brand { display: flex; align-items: center; gap: 0.7rem; color: #fff; text-decoration: none; }
.phsa-navbar .brand img { height: 40px; width: 40px; object-fit: contain; background: #fff; border-radius: 50%; padding: 3px; box-shadow: 0 0 0 2px rgba(212,175,55,0.5); }
.phsa-navbar .brand .brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.phsa-navbar .brand span { font-weight: 700; font-size: 1.05rem; }
.phsa-navbar .brand small { font-weight: 400; font-size: 0.68rem; color: rgba(255,255,255,0.6); letter-spacing: 0.3px; }
.phsa-navbar .nav-right { display: flex; align-items: center; gap: 1rem; }
.phsa-navbar .nav-right a { color: rgba(255,255,255,0.85); text-decoration: none; font-size: 0.92rem; }
.phsa-navbar .nav-right a:hover { color: var(--phsa-gold); }
.phsa-navbar .user-chip { color: #fff; font-size: 0.9rem; }
.phsa-navbar .user-chip strong { color: var(--phsa-gold-light); }

/* ---- Sidebar (candidate/college/admin app shell) ---- */
.phsa-shell { display: flex; min-height: calc(100vh - 62px); }
.phsa-sidebar {
    width: 240px;
    background: var(--phsa-navy);
    flex-shrink: 0;
    padding: 1rem 0;
}
.phsa-sidebar a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: rgba(255,255,255,0.8);
    padding: 0.7rem 1.25rem;
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 500;
    border-left: 3px solid transparent;
}
.phsa-sidebar a i { width: 20px; text-align: center; color: var(--phsa-gold); }
.phsa-sidebar a:hover, .phsa-sidebar a.active {
    background: rgba(212,175,55,0.12);
    color: var(--phsa-gold);
    border-left-color: var(--phsa-gold);
}
.phsa-main { flex: 1; padding: 1.75rem; min-width: 0; }

@media (max-width: 768px) {
    .phsa-shell { flex-direction: column; }
    .phsa-sidebar { width: 100%; display: flex; overflow-x: auto; padding: 0.4rem; }
    .phsa-sidebar a { flex-direction: column; gap: 0.2rem; font-size: 0.72rem; padding: 0.5rem 0.8rem; border-left: none; border-bottom: 3px solid transparent; white-space: nowrap; }
    .phsa-sidebar a:hover, .phsa-sidebar a.active { border-left-color: transparent; border-bottom-color: var(--phsa-gold); }
    .phsa-main { padding: 1rem; }
}

/* ---- Cards, forms, buttons ---- */
.phsa-card { background: #fff; border-radius: 14px; border: none; box-shadow: 0 6px 20px rgba(10,38,71,0.06); margin-bottom: 1.5rem; transition: box-shadow 0.2s; }
.phsa-card .card-header { background: var(--phsa-navy); border-bottom: 3px solid var(--phsa-gold); color: #fff; border-radius: 14px 14px 0 0 !important; font-weight: 600; letter-spacing: 0.2px; }
.phsa-card .card-body { padding: 1.5rem; }

/* ---- Tables inside phsa-card: crisp, official register style ---- */
.phsa-card .table { margin-bottom: 0; }
.phsa-card .table thead th {
    background: #eef2f8;
    color: var(--phsa-navy);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-weight: 700;
    border-bottom: 2px solid var(--phsa-border);
    white-space: nowrap;
}
.phsa-card .table td, .phsa-card .table th { vertical-align: middle; border-color: #eef1f5; }
.phsa-card .table tbody tr:hover { background: #f7f9fc; }

.phsa-form-control, .phsa-card .form-control, .phsa-card select.form-control {
    border-radius: 10px;
    border: 1px solid var(--phsa-border);
    padding: 0.55rem 0.9rem;
    font-size: 0.93rem;
}
.phsa-form-control:focus, .phsa-card .form-control:focus {
    border-color: var(--phsa-navy-light);
    box-shadow: 0 0 0 0.2rem rgba(26,74,122,0.15);
}
.phsa-card label { font-weight: 600; font-size: 0.85rem; color: #45535f; }

/* Masked password dots render small at the base font-size — size and space
   them out so a typed password is easy to see at a glance. */
input[type="password"].phsa-form-control,
input.phsa-password-visible.phsa-form-control {
    font-size: 1.2rem;
    letter-spacing: 2px;
}

/* ---- Password show/hide toggle (auto-injected by phsa-password-toggle.js
   onto every input[type=password] on the page) ---- */
.phsa-password-wrap { position: relative; }
.phsa-password-wrap input[type="password"],
.phsa-password-wrap input[type="text"].phsa-password-visible {
    padding-right: 2.6rem;
}
.phsa-password-toggle {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 2.6rem;
    background: transparent;
    border: none;
    color: #7a8a99;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    padding: 0;
}
.phsa-password-toggle:hover, .phsa-password-toggle:focus {
    color: var(--phsa-navy);
    outline: none;
}

.btn-phsa { background: var(--phsa-navy); color: #fff; border: none; border-radius: 30px; padding: 0.6rem 1.6rem; font-weight: 600; transition: 0.2s; }
.btn-phsa:hover { background: var(--phsa-navy-light); color: #fff; transform: translateY(-1px); }
.btn-phsa-outline { background: transparent; color: var(--phsa-navy); border: 2px solid var(--phsa-navy); border-radius: 30px; padding: 0.55rem 1.6rem; font-weight: 600; }
.btn-phsa-outline:hover { background: var(--phsa-navy); color: #fff; }
.btn-phsa-gold { background: var(--phsa-gold); color: var(--phsa-navy); border: none; border-radius: 30px; padding: 0.6rem 1.6rem; font-weight: 700; }
.btn-phsa-gold:hover { background: var(--phsa-gold-light); color: var(--phsa-navy); }

/* ---- Status badges ---- */
.phsa-badge { display: inline-block; padding: 0.3rem 0.8rem; border-radius: 20px; font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; }
.phsa-badge-draft { background: #e9ecef; color: #495057; }
.phsa-badge-submitted { background: #cfe2ff; color: #084298; }
.phsa-badge-returned { background: #ffe0cc; color: #8a3b00; }
.phsa-badge-document_verified { background: #d1ecf1; color: #0c5460; }
.phsa-badge-interview_scheduled { background: #fff3cd; color: #664d03; }
.phsa-badge-selected { background: #d4edda; color: #155724; }
.phsa-badge-waiting { background: #ffe5b4; color: #7a4b00; }
.phsa-badge-rejected { background: #f8d7da; color: #721c24; }
.phsa-badge-pending { background: #e9ecef; color: #495057; }
.phsa-badge-verified { background: #d4edda; color: #155724; }

/* ---- Step wizard ---- */
.phsa-steps { display: flex; flex-wrap: wrap; margin-bottom: 1.75rem; border-radius: 12px; overflow: hidden; box-shadow: 0 4px 14px rgba(0,0,0,0.04); }
.phsa-steps .phsa-step { flex: 1; min-width: 110px; text-align: center; padding: 0.65rem 0.4rem; background: #fff; border-bottom: 4px solid var(--phsa-border); color: var(--phsa-text-muted); font-size: 0.82rem; font-weight: 600; }
.phsa-steps .phsa-step.done { border-bottom-color: var(--phsa-success); color: var(--phsa-success); }
.phsa-steps .phsa-step.active { border-bottom-color: var(--phsa-gold); color: var(--phsa-navy); }

/* ---- Auth pages (login/register/forgot/reset) ---- */
.phsa-auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #0a2647 0%, #1a4a7a 100%); padding: 20px; }
.phsa-auth-card { width: 100%; max-width: 460px; background: #fff; border-radius: 16px; padding: 2rem 1.8rem 1.8rem; box-shadow: 0 25px 60px rgba(0,0,0,0.3); border-top: 6px solid var(--phsa-gold); }
.phsa-auth-card.wide { max-width: 720px; }
.phsa-auth-header { text-align: center; margin-bottom: 1.6rem; }
.phsa-auth-header img { max-height: 60px; margin-bottom: 0.4rem; }
.phsa-auth-header h3 { font-weight: 700; color: var(--phsa-navy); font-size: 1.5rem; margin: 0.2rem 0 0.1rem; }
.phsa-auth-header p { color: var(--phsa-text-muted); font-size: 0.92rem; margin-bottom: 0; }
.phsa-auth-footer { text-align: center; color: rgba(255,255,255,0.65); font-size: 0.85rem; margin-top: 1.2rem; }
.phsa-auth-footer a { color: #fff; font-weight: 500; }

.phsa-alert { border-radius: 10px; font-size: 0.9rem; padding: 0.7rem 1.1rem; margin-bottom: 1rem; }

/* Celebratory success banner for auth pages (e.g. "Registration Successful") — warmer and more prominent than a plain alert. */
.phsa-flash-success {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: linear-gradient(135deg, #e8f8f0, #d7f3e3);
    border: 1px solid #a8e6c4;
    color: #146c43;
    border-radius: 12px;
    padding: 0.85rem 1.1rem;
    margin-bottom: 1.2rem;
    font-size: 0.95rem;
    font-weight: 600;
}
.phsa-flash-success i { font-size: 1.3rem; color: #1e9e5f; }

/* ---- Floating-label fields (applicant-facing auth forms) ---- */
.phsa-float-group {
    position: relative;
    margin-bottom: 1.4rem;
}
.phsa-float-group input.phsa-form-control,
.phsa-float-group select.phsa-form-control {
    height: 3.1rem;
    padding: 1.35rem 0.9rem 0.4rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.phsa-float-group select.phsa-form-control { padding-top: 1.2rem; }
.phsa-float-group label {
    position: absolute;
    left: 0.95rem;
    top: 0.95rem;
    margin: 0;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--phsa-text-muted);
    background: transparent;
    pointer-events: none;
    transform-origin: left top;
    transition: transform 0.18s ease, color 0.18s ease, top 0.18s ease;
}
/* Float the label up+shrink once the field has a value or is focused.
   The " " placeholder on the input is what makes :placeholder-shown work
   as an "is it empty" check for floating labels without JS. */
.phsa-float-group input.phsa-form-control:focus ~ label,
.phsa-float-group input.phsa-form-control:not(:placeholder-shown) ~ label,
.phsa-float-group select.phsa-form-control ~ label {
    top: 0.28rem;
    transform: scale(0.78);
    color: var(--phsa-navy-light);
    font-weight: 700;
}
.phsa-float-group input.phsa-form-control:focus,
.phsa-float-group select.phsa-form-control:focus {
    border-color: var(--phsa-gold);
    box-shadow: 0 0 0 3px rgba(212,175,55,0.18);
}
.phsa-float-group .phsa-password-toggle { top: 0; bottom: 0; }

.phsa-doc-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.8rem 0; border-bottom: 1px solid var(--phsa-border); }

/* =====================================================================
   Admin template chrome (Modern Admin theme navbar + sidebar overrides).
   Shared by every page rendered through admin/includes/adm_top.php.
   ===================================================================== */
.header-navbar {
    background: var(--phsa-navy) !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    border-bottom: 3px solid var(--phsa-gold);
}
.navbar-brand { display: flex; align-items: center; flex-wrap: wrap; padding: 0.2rem 0; }
.navbar-brand .brand-logo { height: 32px; width: auto; margin-right: 10px; }
.navbar-brand .brand-text { font-weight: 700; font-size: 1.05rem; line-height: 1.1; letter-spacing: 0.3px; color: #fff; }
.navbar-brand .brand-sub { font-size: 0.65rem; font-weight: 300; color: rgba(255,255,255,0.7); display: block; margin-top: 0; letter-spacing: 0.2px; }
.header-navbar .nav-link { color: rgba(255,255,255,0.8) !important; transition: 0.3s; }
.header-navbar .nav-link:hover, .header-navbar .nav-link:focus { color: var(--phsa-gold) !important; }
.header-navbar .dropdown-user .user-name { color: var(--phsa-gold); font-weight: 600; }
.header-navbar .dropdown-menu { border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,0.15); border-top: 3px solid var(--phsa-gold); }
.header-navbar .dropdown-menu .dropdown-item { color: var(--phsa-navy); font-weight: 500; padding: 0.6rem 1.5rem; transition: 0.2s; }
.header-navbar .dropdown-menu .dropdown-item:hover { background: rgba(10, 38, 71, 0.06); color: var(--phsa-navy); }
.header-navbar .dropdown-menu .dropdown-item i { width: 20px; margin-right: 8px; color: var(--phsa-gold); }
.header-navbar .badge-glow { background: var(--phsa-gold) !important; color: var(--phsa-navy) !important; font-weight: 700; }
.header-navbar .toggle-icon { color: var(--phsa-gold) !important; }
.header-navbar .navbar-toggler .fa-bars { color: var(--phsa-gold); font-size: 1.6rem; }

.main-menu { background: var(--phsa-navy) !important; border-right: 1px solid var(--phsa-gold) !important; }
.main-menu .navigation > li > a {
    color: rgba(255,255,255,0.8) !important;
    font-weight: 500;
    padding: 12px 20px;
    border-left: 2px solid transparent;
    transition: all 0.25s ease;
}
.main-menu .navigation > li > a:hover, .main-menu .navigation > li > a:focus {
    background: rgba(212, 175, 55, 0.12) !important;
    color: var(--phsa-gold) !important;
    border-left-color: var(--phsa-gold);
}
.main-menu .navigation > li.active > a {
    background: rgba(212, 175, 55, 0.15) !important;
    color: var(--phsa-gold) !important;
    border-left-color: var(--phsa-gold);
    box-shadow: inset 4px 0 0 var(--phsa-gold);
}
.main-menu .navigation > li > a i { color: var(--phsa-gold); width: 15px; text-align: center; font-size: 1rem; }
.main-menu .navigation > li > a:hover i, .main-menu .navigation > li.active > a i { color: var(--phsa-gold-light); }
.main-menu .menu-content { background: #0d2b4a !important; display: none; }
.main-menu .nav-item.open > .menu-content { display: block !important; }
.main-menu .menu-content li a {
    color: rgba(255,255,255,0.7) !important;
    padding: 8px 20px 8px 48px;
    font-size: 0.9rem;
    border-left: 3px solid transparent;
    transition: 0.2s;
}
.main-menu .menu-content li a:hover { background: rgba(212, 175, 55, 0.08) !important; color: var(--phsa-gold) !important; border-left-color: var(--phsa-gold); }
.main-menu .menu-content li.active > a { background: rgba(212, 175, 55, 0.12) !important; color: var(--phsa-gold) !important; border-left-color: var(--phsa-gold); }
.main-menu .navigation > li > a:after { color: var(--phsa-gold) !important; opacity: 0.6; }
.main-menu .navigation > li > a:hover:after { opacity: 1; }

@media (max-width: 768px) {
    .navbar-brand .brand-text { font-size: 0.95rem; }
    .navbar-brand .brand-logo { height: 26px; }
    .navbar-brand .brand-sub { font-size: 0.55rem; }
    .header-navbar .dropdown-user .user-name { display: none; }
    .header-navbar .nav-link { padding: 0.5rem 0.7rem; }
    .main-menu .navigation > li > a { padding: 10px 16px; font-size: 0.9rem; }
    .main-menu .menu-content li a { padding: 6px 16px 6px 36px; font-size: 0.8rem; }
}
@media (max-width: 576px) {
    .navbar-brand .brand-text { font-size: 0.85rem; }
    .navbar-brand .brand-logo { height: 22px; margin-right: 6px; }
    .header-navbar .nav-link { font-size: 0.8rem; }
}

/* =====================================================================
   Sidebar width + content offset. The theme's own core/menu CSS (which
   would normally provide this) ships as an empty folder in this copy of
   the template, so .main-menu has never had a width and .app-content has
   never been pushed clear of the fixed sidebar — this is the fix for that.
   ===================================================================== */
:root { --phsa-sidebar-width: 260px; }

.main-menu.menu-fixed {
    width: var(--phsa-sidebar-width);
    left: 0;
    overflow-y: auto;
    transition: transform 0.25s ease;
}
.app-content { margin-left: var(--phsa-sidebar-width); transition: margin-left 0.25s ease; }
footer.footer { margin-left: var(--phsa-sidebar-width); transition: margin-left 0.25s ease; }

/* Desktop collapse toggle (the navbar's toggle-icon button) */
body.sidebar-closed .main-menu.menu-fixed { transform: translateX(calc(-1 * var(--phsa-sidebar-width))); }
body.sidebar-closed .app-content,
body.sidebar-closed footer.footer { margin-left: 0; }

/* Mobile: sidebar becomes an off-canvas overlay, hidden unless opened */
@media (max-width: 767.98px) {
    .main-menu.menu-fixed { transform: translateX(calc(-1 * var(--phsa-sidebar-width))); }
    .app-content, footer.footer { margin-left: 0; }
    body.sidebar-open .main-menu.menu-fixed { transform: translateX(0); box-shadow: 4px 0 24px rgba(0,0,0,0.3); }
    body.sidebar-open::after {
        content: "";
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.4);
        z-index: 999;
    }
}
.phsa-doc-row:last-child { border-bottom: none; }

.phsa-timeline { list-style: none; padding: 0; margin: 0; }
.phsa-timeline li { position: relative; padding-left: 1.8rem; padding-bottom: 1.2rem; border-left: 2px solid var(--phsa-border); margin-left: 0.5rem; }
.phsa-timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.phsa-timeline li::before { content: ''; position: absolute; left: -7px; top: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--phsa-border); }
.phsa-timeline li.done::before { background: var(--phsa-success); }
.phsa-timeline li.current::before { background: var(--phsa-gold); box-shadow: 0 0 0 4px rgba(212,175,55,0.25); }

/* =====================================================================
   Review workflow (Returned for Correction / Resubmitted) — admin + applicant
   ===================================================================== */
.phsa-badge-resubmitted { background: #e2d9f3; color: #432874; }
.phsa-badge-cancelled { background: #e9ecef; color: #6c757d; }

.phsa-admin-comment {
    background: #fff8e1;
    border-left: 4px solid var(--phsa-gold);
    border-radius: 8px;
    padding: 0.7rem 0.9rem;
    color: #4a3b00;
    font-size: 0.92rem;
    word-wrap: break-word;
}
.phsa-return-panel { border: 2px solid #f0ad4e; border-radius: 12px; overflow: hidden; margin-bottom: 1rem; background: #fffdf8; }
.phsa-return-panel-head { background: #fcf0dc; color: #8a3b00; font-weight: 700; padding: 0.6rem 1rem; border-bottom: 1px solid #f5d6a3; }
.phsa-fix-list li { margin-bottom: 0.6rem; }
.phsa-guide-list li { margin-bottom: 0.45rem; font-size: 0.9rem; line-height: 1.5; }

/* Applicant: one clear "current status / what to do" box per application */
.phsa-next { border-radius: 12px; padding: 1rem 1.1rem; margin-bottom: 1rem; border-left: 5px solid; font-size: 0.93rem; line-height: 1.55; }
.phsa-next-title { font-weight: 700; font-size: 1.02rem; margin-bottom: 0.25rem; }
.phsa-next-info { background: #eef5ff; border-color: #1a4a7a; color: #1f3350; }
.phsa-next-success { background: #eaf7ef; border-color: #28a745; color: #14532d; }
.phsa-next-warning { background: #fff7ea; border-color: #e0a800; color: #5c3d00; }
.phsa-next-danger { background: #fdeeee; border-color: #dc3545; color: #6b1a1a; }
.phsa-next-secondary { background: #f1f3f5; border-color: #adb5bd; color: #3d4b5c; }
.phsa-fix-items { list-style: none; padding: 0; margin: 0.9rem 0; }
.phsa-fix-items li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; background: #fff; border: 1px solid #f0d9a8; border-radius: 8px; padding: 0.55rem 0.75rem; margin-bottom: 0.5rem; }
.phsa-fix-items li span { flex: 1 1 220px; }
.phsa-progress { display: flex; list-style: none; padding: 0; margin: 0; counter-reset: pstep; }
.phsa-progress li { flex: 1; text-align: center; font-size: 0.8rem; color: var(--phsa-text-muted); position: relative; padding-top: 30px; }
.phsa-progress li:before { counter-increment: pstep; content: counter(pstep); position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 24px; height: 24px; border-radius: 50%; background: #e3e8ef; color: #6c7a8a; font-weight: 700; font-size: 0.75rem; line-height: 24px; z-index: 1; }
.phsa-progress li:after { content: ''; position: absolute; top: 11px; left: -50%; width: 100%; height: 2px; background: #e3e8ef; }
.phsa-progress li:first-child:after { display: none; }
.phsa-progress li.done { color: #1e7e34; }
.phsa-progress li.done:before { content: '\2713'; background: #28a745; color: #fff; }
.phsa-progress li.done:after, .phsa-progress li.current:after { background: #28a745; }
.phsa-progress li.current { color: var(--phsa-navy); font-weight: 700; }
.phsa-progress li.current:before { background: var(--phsa-gold); color: var(--phsa-navy); box-shadow: 0 0 0 4px rgba(212,175,55,0.25); }

/* Admin: return-for-correction box + queue tabs */
.phsa-return-box { background: #fffaf0; border: 1px dashed #e0a800; border-radius: 10px; padding: 0.9rem 1rem; }
.phsa-queue-tabs { gap: 0.4rem; flex-wrap: wrap; }
.phsa-queue-tabs .nav-link {
    background: #fff; border-radius: 30px; color: var(--phsa-navy); font-weight: 600; font-size: 0.9rem;
    padding: 0.45rem 1rem; box-shadow: 0 2px 8px rgba(10,38,71,0.06); border: 1px solid var(--phsa-border);
}
.phsa-queue-tabs .nav-link.active { background: var(--phsa-navy); color: #fff; border-color: var(--phsa-navy); }
.phsa-queue-tabs .nav-link .badge { margin-left: 0.3rem; }
.phsa-chip {
    display: inline-block; margin: 0 0.3rem 0.4rem 0; padding: 0.25rem 0.75rem; border-radius: 20px;
    border: 1px solid var(--phsa-border); background: #fff; color: #45535f; text-decoration: none !important;
}
.phsa-chip.active, .phsa-chip:hover { background: #fcf0dc; border-color: #e0a800; color: #8a3b00; }

/* Step wizard: steps may be links (returned / correcting) and flag what needs fixing */
.phsa-steps a.phsa-step { text-decoration: none; }
.phsa-steps a.phsa-step:hover { background: #f7f9fc; color: var(--phsa-navy); }
.phsa-steps .phsa-step .step-num::after { content: '. '; }
.phsa-steps .phsa-step.needs-fix { border-bottom-color: #e8590c; color: #c2410c; background: #fff7ed; }
.phsa-steps .phsa-step.needs-fix .fa { color: #e8590c; }
.phsa-step-mobile-label { margin: -1rem 0 1rem; font-size: 0.9rem; color: var(--phsa-navy); }

/* =====================================================================
   Applicant portal — mobile
   ===================================================================== */
@media (max-width: 768px) {
    .phsa-navbar { padding: 0.5rem 0.75rem; }
    .phsa-navbar .user-chip { display: none; }
    .phsa-navbar .brand small { display: none; }
    .phsa-sidebar { position: sticky; top: 56px; z-index: 1020; box-shadow: 0 2px 8px rgba(0,0,0,0.12); -webkit-overflow-scrolling: touch; scrollbar-width: none; }
    .phsa-sidebar::-webkit-scrollbar { display: none; }
    .phsa-card .card-body { padding: 1rem; }
    .phsa-card .card-header { font-size: 0.95rem; }
    .phsa-doc-row { flex-wrap: wrap; gap: 0.5rem; }
    .phsa-session-row > :last-child { margin-left: auto; }
}
@media (max-width: 575.98px) {
    .phsa-gov-strip { font-size: 0.62rem; padding: 3px 0.5rem; }
    .phsa-navbar .brand span { font-size: 0.92rem; }
    .phsa-navbar .brand img { height: 34px; width: 34px; }
    .phsa-navbar .nav-right { gap: 0.8rem; }
    .phsa-navbar .nav-right a { font-size: 0; }          /* icon-only links on phones */
    .phsa-navbar .nav-right a .fa { font-size: 1.15rem; }
    .phsa-main { padding: 0.75rem; }
    .phsa-main > h4 { font-size: 1.15rem; }

    /* 16px inputs stop iOS Safari zooming the page on focus */
    .phsa-form-control, .phsa-card .form-control, .phsa-card select.form-control { font-size: 16px; }
    .phsa-card .form-control-file { font-size: 0.85rem; max-width: 100%; }

    /* Wizard: numbered dots in one row; the active step's name is shown below */
    .phsa-steps { flex-wrap: nowrap; border-radius: 10px; }
    .phsa-steps .phsa-step { min-width: 0; padding: 0.55rem 0.1rem; font-size: 0.85rem; }
    .phsa-steps .phsa-step .step-label { display: none; }
    .phsa-steps .phsa-step .step-num::after { content: ''; }
    .phsa-step-mobile-label { margin: -1.1rem 0 1rem; }

    /* Main action buttons become full-width tap targets inside forms */
    .phsa-card form > .btn-phsa, .phsa-card form > .btn-phsa-gold, .phsa-card form > .btn-phsa-outline,
    .phsa-card .card-body > form > button[type=submit] { width: 100%; margin-bottom: 0.5rem; }
    .phsa-card form > a.btn-phsa-outline { width: 100%; margin-bottom: 0.5rem; }
    .btn-phsa, .btn-phsa-gold, .btn-phsa-outline { padding-left: 1.1rem; padding-right: 1.1rem; }

    /* Tables collapse into stacked label/value cards */
    .phsa-stack-table thead { display: none; }
    .phsa-stack-table, .phsa-stack-table tbody, .phsa-stack-table tr, .phsa-stack-table td { display: block; width: 100%; }
    .phsa-stack-table tr { border: 1px solid var(--phsa-border); border-radius: 10px; margin-bottom: 0.75rem; padding: 0.4rem 0.75rem; }
    .phsa-stack-table td { border: none !important; padding: 0.3rem 0 !important; display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; text-align: right; }
    .phsa-stack-table td::before { content: attr(data-label); font-weight: 700; color: var(--phsa-navy); font-size: 0.8rem; text-align: left; }
    .phsa-stack-table td:not([data-label]) { justify-content: flex-end; }
    .phsa-card .table-sm td, .phsa-card .table-sm th { font-size: 0.85rem; }
    .phsa-timeline li { padding-bottom: 0.9rem; }
}
