/* FILE: public/assets/css/app.css */
/* Cleaned 2026-10-07: duplicate appended blocks removed, repeated rules merged (same styles as before). */

/* FILE: public/assets/css/app.css */

:root {
    --brand-green: #2D893E;
    --brand-green-dark: #1a5c28;
    --brand-green-hover: #256e33;
    --brand-gold: #f5c451;
    --brand-red: #c0392b;
    --brand-red-dark: #a5301f;
    --text-main: #1c1e21;
    --text-muted: #5a5f6a;
    --text-faint: #8a8f99;

    /* Theme surface colors (2026-10-05, dark mode). Only surfaces that
       appear on authenticated (post-login) pages get a dark override
       below — the theme toggle lives in the topbar, which only renders
       once logged in, so login/register never need a dark variant. */
    --bg-page: #f3f4f6;
    --bg-card: #ffffff;
    --bg-elevated: #ffffff;
    --bg-subtle: #f8f9fa;
    --bg-muted-2: #f4f5f7;
    --bg-hover: #f4f8f5;
    --border-color: #d9dbe0;
    --border-color-soft: #eceef1;
    --input-bg: #ffffff;
    --input-border: #c3c6cc;
    --nav-bg: #eef1ee;
    --shadow-color: rgba(0, 0, 0, 0.12);
    --shadow-color-strong: rgba(0, 0, 0, 0.35);
    --watermark-opacity: 0.06;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Nunito', -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    background-color: var(--bg-page);
    color: var(--text-main);
    line-height: 1.5;
    position: relative;
    overflow-x: hidden;
}

/* Faint diagonal logo-pattern watermark across the whole page background.
   Only meaningful once assets/images/deped_nir_pattern.webp exists. */

body::before {
    content: "";
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    z-index: -1;
    background-image: url('../images/deped_nir_pattern.webp');
    background-repeat: repeat;
    background-size: 120px 120px;
    transform: rotate(-45deg);
    opacity: var(--watermark-opacity);
    filter: grayscale(100%);
}

.site-page-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.page {
    max-width: 1100px;
    width: 100%;
    margin: 32px auto;
    padding: 0 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.page-narrow {
    max-width: 480px; /* 2026-10-23: 448px card (Tailwind max-w-md, as on Operator) + 16px side padding */
    min-height: 100vh;
    margin: 0 auto;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

/* Anchor for the registration notice panel: the login card centers
   normally inside .auth-card-wrapper regardless of whether the notice
   is present, since the notice is positioned ABSOLUTELY relative to
   this anchor rather than sharing flex space with the card. */

.login-relative-anchor {
    position: relative;
    width: 100%;
}

/* Mobile-first: notice stacks below the card in normal flow. */

.notice-panel-wrapper {
    position: relative;
    width: 100%;
    margin-top: 2rem;
    overflow: visible;
}

@media (min-width: 1024px) {
    .notice-panel-wrapper {
        position: absolute;
        top: 50%;
        left: 100%;
        transform: translateY(-50%);
        margin-left: 2rem;
        margin-top: 0;
        width: 20rem;
    }
}

.notice-panel {
    position: relative;
    width: 100%;
    background: #f59e0b;
    border-radius: 28px 28px 20px 20px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.notice-white-curve {
    position: absolute;
    z-index: 2;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: visible;
}

.notice-white-curve ellipse {
    fill: #ffffff;
}

.notice-content {
    position: relative;
    z-index: 5;
    padding: 1.75rem;
    padding-top: 2rem;
    padding-bottom: 4.5rem;
}

.notice-content h2 {
    margin: 0 0 10px;
    font-size: 1.25rem;
    font-weight: 800;
    text-align: center;
    color: #111827;
    letter-spacing: 0.02em;
}

.notice-content p {
    margin: 0 0 10px;
    font-size: 0.85rem;
    color: #374151;
    line-height: 1.5;
}

.notice-content ul {
    margin: 0;
    padding-left: 18px;
    font-size: 0.85rem;
    color: #374151;
    line-height: 1.6;
}

.notice-karl {
    position: absolute;
    z-index: 20;
    bottom: 0;
    right: 0;
    width: 7rem;
    height: auto;
    user-select: none;
    pointer-events: none;
    transform: translate(20%, 30%) rotate(10deg);
    transform-origin: center;
}

@media (max-width: 480px) {
    .notice-karl {
        width: 6rem;
        transform: translate(15%, 25%) rotate(10deg);
    }
}

.auth-card-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 28px;
}

/* ============================================================
   Login / Register card (auth pages only — never themed dark;
   the theme toggle only exists in the topbar, which these pages
   don't render)
   ============================================================ */

/* 2026-10-23: the whole card now mirrors the DepEd NIR Operator login
   (operator/index.php). Its Tailwind classes are noted beside each value
   so the two pages can be kept in sync later. */

.auth-card {
    background: #ffffff;
    border-radius: 24px;                                     /* rounded-3xl */
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);       /* shadow-2xl */
    overflow: hidden;
}

.auth-card-header {
    position: relative;
    overflow: hidden;
    padding: 40px;                                           /* p-10 */
    text-align: center;
    background: linear-gradient(135deg, var(--brand-green) 0%, var(--brand-green-dark) 100%);
}

.auth-card-watermark {
    position: absolute;
    top: -75%;
    left: -75%;
    width: 250%;
    height: 250%;
    background-image: url('../images/deped_nir.webp');
    background-repeat: repeat;
    background-size: 150px 150px;                            /* was 100px */
    opacity: 0.15;                                           /* was 0.12 */
    transform: rotate(-15deg) scale(1.5);                    /* was scale(1.4) */
    pointer-events: none;
}

.auth-card-header-content {
    position: relative;
    z-index: 1;
}

.auth-logo {
    width: 80px;                                             /* h-20 w-20 */
    height: 80px;
    margin: 0 auto 16px;                                     /* mb-4 */
    display: block;
    object-fit: contain;
    filter: drop-shadow(0 10px 8px rgba(0, 0, 0, 0.04))      /* drop-shadow-lg */
            drop-shadow(0 4px 3px rgba(0, 0, 0, 0.1));
}

.auth-system-title {
    margin: 0;
    color: #ffffff;
    font-size: 1.875rem;                                     /* text-3xl */
    line-height: 2.25rem;
    font-weight: 800;                                        /* font-extrabold */
    letter-spacing: 0.1em;                                   /* tracking-widest */
    filter: drop-shadow(0 4px 3px rgba(0, 0, 0, 0.07))       /* drop-shadow-md */
            drop-shadow(0 2px 2px rgba(0, 0, 0, 0.06));
}

.auth-system-tagline {
    margin: 8px 0 0;                                         /* mt-2 */
    color: #dcfce7;                                          /* text-green-100 */
    opacity: 0.9;
    font-size: 0.75rem;                                      /* text-xs */
    line-height: 1.25rem;
    font-weight: 600;                                        /* font-semibold */
    letter-spacing: 0.1em;                                   /* tracking-widest */
    text-wrap: balance; /* evens out the lines, so no lone "System" on the last line */
}

.auth-card-body {
    padding: 32px;                                           /* p-8 */
}

.auth-card-body .field-hint {
    margin: 0;
    font-size: 0.875rem;                                     /* text-sm */
    line-height: 1.5;
}

.auth-card-body .btn {
    margin-top: 24px;                                        /* my-6 gap, as in the Operator divider */
    padding: 12px 16px;                                      /* py-3 px-4 */
    font-size: 1rem;
    line-height: 1.5rem;
    font-weight: 700;                                        /* font-bold */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),           /* shadow-md */
                0 2px 4px -2px rgba(0, 0, 0, 0.1);
}

/* .btn (declared later) resets display to inline-block, which broke the
   icon's vertical centering — re-assert flex here with higher specificity. */
.auth-card-body .btn-with-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;                                               /* mr-3 */
}

.auth-card-body .btn-with-icon svg {
    width: 20px;                                             /* w-5 h-5 */
    height: 20px;
}

/* Pill-shaped inputs/buttons for the auth card specifically — scoped
   here rather than globally, so admin tables/filters keep their more
   compact, standard rectangular form controls. */

.auth-card-body input[type="email"],
.auth-card-body input[type="password"],
.auth-card-body input[type="text"] {
    border-radius: 24px;
}

.auth-card-body .btn {
    border-radius: 20px;                                     /* rounded-[20px] */
}

.auth-form-intro {
    margin: -8px 0 18px;
    color: var(--text-muted);
    font-size: 0.88rem;
    font-weight: 600;
    text-align: center;
}

.site-footer-text {
    text-align: center;
    padding: 20px 16px;
    color: #9ca3af;
    font-size: 0.75rem;
    line-height: 1.5;
    box-sizing: border-box;
    margin-top: auto;
    /* Full-bleed trick: span the full screen width regardless of the
       parent container's max-width, so the copyright line has room to
       stay on one line instead of wrapping mid-sentence. */
    position: relative;
    left: 50%;
    width: 100vw;
    margin-left: -50vw;
}

@media (min-width: 480px) {
    .site-footer-text > div:first-child {
        white-space: nowrap;
    }
}

.site-footer-subtext {
    opacity: 0.85;
}

/* Icon-prefixed inputs, used on login/register */

.input-icon-wrap {
    position: relative;
}

.input-icon-wrap .input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: #9aa0a8;
    pointer-events: none;
}

.input-icon-wrap .input-icon svg {
    width: 100%;
    height: 100%;
}

.input-icon-wrap input[type="email"],
.input-icon-wrap input[type="password"],
.input-icon-wrap input[type="text"] {
    padding-left: 44px;
}

.password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 4px;
    color: #9aa0a8;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.password-toggle:hover {
    color: var(--brand-green);
}

.password-toggle svg {
    width: 16px;
    height: 16px;
}

.input-icon-wrap input[type="password"] {
    padding-right: 42px;
}

.btn-with-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-with-icon svg {
    width: 15px;
    height: 15px;
}

h1 {
    font-size: 1.4rem;
    margin: 0 0 20px;
    color: var(--text-main);
}

.subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: -12px 0 20px;
}

label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 6px;
    margin-top: 16px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="number"],
input[type="file"],
select,
textarea {
    width: 100%;
    padding: 9px 10px;
    border: 1px solid var(--input-border);
    border-radius: 4px;
    font-size: 0.95rem;
    font-family: inherit;
    background: var(--input-bg);
    color: var(--text-main);
}

input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--brand-green);
    outline-offset: 1px;
}

.btn {
    display: inline-block;
    width: 100%;
    margin-top: 22px;
    padding: 10px 16px;
    background: var(--brand-green);
    color: #ffffff;
    border: none;
    border-radius: 4px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
}

.btn:hover {
    background: var(--brand-green-hover);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--brand-green);
    border: 1px solid var(--brand-green);
}

.btn-secondary:hover {
    background: #e8f3ea;
}

.field-error {
    color: #b42318;
    font-size: 0.82rem;
    margin-top: 4px;
}

.flash {
    padding: 12px 14px;
    border-radius: 4px;
    font-size: 0.9rem;
    margin-bottom: 16px;
    border-left: 4px solid transparent;
}

.flash-success {
    background: #e6f4ea;
    color: #1e6b34;
    border-left-color: #1e6b34;
}

.flash-error {
    background: #fdecea;
    color: #b42318;
    border-left-color: #b42318;
}

/* Informational flash — used where something is explained rather than
   succeeded or failed (e.g. performance_record.php's "scoring pending"
   notice). Added 2026-10-05 alongside the rubric tabs. */

.flash-info {
    background: #e7f0fa;
    color: #1a5c8a;
    border-left-color: #1a5c8a;
}

.helper-text {
    text-align: center;
    font-size: 0.88rem;
    margin-top: 18px;
    color: var(--text-muted);
}

.helper-text a {
    color: var(--brand-green);
    text-decoration: none;
}

.helper-text a:hover {
    text-decoration: underline;
}

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: #8a8f99;
    font-size: 0.8rem;
    margin: 20px 0;
}

.divider::before,
.divider::after {
    content: "";
    flex: 1;
    border-bottom: 1px solid #d9dbe0;
}

.divider:not(:empty)::before {
    margin-right: 10px;
}

.divider:not(:empty)::after {
    margin-left: 10px;
}

/* dashboard-page kept as a semantic wrapper class; width is handled by .page */

.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    background: #e8f3ea;
    color: var(--brand-green);
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
}

/* Phase 3.1: green masthead shown on all authenticated pages. Always
   stays this branded green/white in both themes — it's the one part of
   the page that's always "on brand" rather than surface-themed.
   2026-10-05: switched the flat fill for a subtle left-to-right
   emerald gradient (darker left, lighter right, where the clock/
   welcome/logout controls sit) — reuses the existing brand-green
   tokens rather than introducing new colors. */

.app-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px 24px;
    background: linear-gradient(to right, var(--brand-green-dark) 0%, var(--brand-green) 100%);
    color: #ffffff;
    padding: 14px 28px;
}

.app-topbar-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.app-logo-placeholder {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #ffffff;
    color: #3c6e47;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.app-logo-img {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    flex-shrink: 0;
}

.app-topbar-title {
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.app-topbar-right {
    display: flex;
    align-items: center;
    gap: 22px;
    flex-wrap: wrap;
}

/* Dark mode toggle button, sitting in the topbar to the left of the
   clock (added 2026-10-05). Styled against the topbar's own fixed
   green/white branding, not the page's theme variables — it always
   looks the same regardless of which theme is active. */

.theme-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    cursor: pointer;
    flex-shrink: 0;
    padding: 0;
    transition: background 0.15s ease;
}

.theme-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.22);
}

.theme-toggle-btn svg {
    width: 18px;
    height: 18px;
}

/* NOTE: these two rules must stay as single-class selectors with no
   element part (not ".theme-toggle-btn svg.theme-icon-moon" etc.) —
   adding "svg" to the selector raises its specificity above a plain
   class selector and breaks the sun/moon swap in light mode, which is
   exactly what happened the first time around (.theme-toggle-btn svg's
   display:block was quietly beating this display:none). */

.theme-icon-moon {
    display: none;
}

:root[data-theme="dark"] .theme-icon-sun {
    display: none;
}

:root[data-theme="dark"] .theme-icon-moon {
    display: block;
}

.app-clock,
.app-welcome {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.app-clock-label,
.app-welcome-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #f5c451;
}

.app-clock-datetime,
.app-welcome-name {
    font-size: 0.88rem;
    font-weight: 600;
    white-space: nowrap;
}

.app-logout-btn {
    background: #c0392b;
    color: #ffffff;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 9px 18px;
    border-radius: 4px;
    white-space: nowrap;
}

.app-logout-btn:hover {
    background: #a5301f;
}

.app-welcome-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.app-welcome-photo,
.app-welcome-photo-fallback {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    flex-shrink: 0;
}

.app-welcome-photo {
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.6);
}

.app-welcome-photo-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.22);
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 700;
}

.field-hint {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin: -6px 0 10px;
}

/* Score summary box (certification.php/experience.php/technical_knowledge.php) */

.score-summary {
    background: var(--bg-subtle);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 10px 14px;
    margin-bottom: 16px;
    font-size: 0.92rem;
}

.score-summary strong {
    font-size: 1.1rem;
}

/* ============================================================
   Mandatory onboarding modal — deliberately has NO close control.
   ============================================================ */

.onboarding-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(20, 30, 22, 0.72);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
    padding: 40px 16px;
    z-index: 2000;
}

.onboarding-modal {
    background: var(--bg-elevated);
    border-radius: 10px;
    max-width: 720px;
    width: 100%;
    padding: 32px;
    box-shadow: 0 20px 50px var(--shadow-color-strong);
}

.onboarding-modal h1 {
    margin-bottom: 6px;
}

.app-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    background: var(--nav-bg);
    border-radius: 10px;
    padding: 6px;
    margin-bottom: 20px;
}

.nav-tab {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.86rem;
    font-weight: 700;
    padding: 11px 18px;
    border-radius: 8px;
    text-align: center;
    flex: 1;
    white-space: nowrap;
    transition: background 0.12s ease, color 0.12s ease;
}

.nav-tab:hover {
    background: rgba(45, 137, 62, 0.12);
    color: var(--brand-green);
}

.nav-tab.active {
    background: var(--brand-green);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(45, 137, 62, 0.3);
}

.nav-tab.active:hover {
    background: var(--brand-green);
    color: #ffffff;
}

.section-heading {
    font-size: 1.05rem;
    margin: 24px 0 12px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color-soft);
}

.section-heading:first-of-type {
    margin-top: 4px;
    padding-top: 0;
    border-top: none;
}

.panel-heading-link {
    float: right;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--brand-green);
    text-decoration: none;
}

.panel-heading-link:hover {
    text-decoration: underline;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 16px;
}

.form-grid-full {
    grid-column: 1 / -1;
}

.btn-inline {
    display: inline-block;
    width: auto;
    padding: 9px 20px;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 8px 14px;
    margin-bottom: 8px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 400;
    font-size: 0.92rem;
    margin: 0;
}

.checkbox-item input {
    width: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
    font-size: 0.9rem;
}

.data-table th,
.data-table td {
    text-align: left;
    padding: 9px 10px;
    border-bottom: 1px solid var(--border-color-soft);
}

.data-table th {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
}

.btn-link-danger {
    background: none;
    border: none;
    color: #b42318;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
}

.empty-state {
    color: var(--text-faint);
    font-size: 0.9rem;
    font-style: italic;
}

.total-score {
    font-size: 1rem;
    margin: 4px 0 14px;
}

.total-score strong {
    font-size: 1.5rem;
    color: var(--brand-green);
}

.score-breakdown {
    list-style: none;
    margin: 0 0 8px;
    padding: 0;
}

.score-breakdown li {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color-soft);
    font-size: 0.9rem;
}

.score-breakdown li:last-child {
    border-bottom: none;
}

.score-breakdown li strong {
    color: var(--brand-green);
}

/* Dashboard profile summary */

.profile-summary {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    margin: 20px 0;
    padding: 18px;
    background: var(--bg-subtle);
    border-radius: 8px;
}

.profile-summary-photo {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 3px solid var(--bg-card);
    box-shadow: 0 2px 6px var(--shadow-color);
}

.profile-summary-photo-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--brand-green);
    color: #ffffff;
    font-size: 2rem;
    font-weight: 700;
}

.profile-summary-details {
    flex: 1;
    min-width: 0;
}

.data-table-compact td {
    padding: 6px 10px;
    border-bottom: none;
    font-size: 0.88rem;
}

.data-table-compact td:first-child {
    color: var(--text-muted);
    font-weight: 600;
    width: 200px;
}

/* ============================================================
   Mobile responsiveness
   ============================================================ */

@media (max-width: 640px) {
    .page {
        padding: 0 12px;
        margin: 16px auto;
    }

    .page-narrow {
        padding: 16px 12px;
    }

    .card,
    .onboarding-modal {
        padding: 18px;
    }

    /* Topbar: stack the branding row above the clock/welcome/logout row
       instead of squeezing everything into one line. */
    .app-topbar {
        flex-direction: column;
        align-items: flex-start;
        padding: 14px 16px;
        gap: 14px;
    }

    .app-topbar-title {
        font-size: 0.95rem;
    }

    .app-topbar-right {
        width: 100%;
        justify-content: space-between;
        gap: 14px;
    }

    .app-clock {
        display: none; /* Saves space on small screens; date/time isn't essential there. */
    }

    .app-nav {
        gap: 6px;
        padding: 6px;
    }

    .nav-tab {
        flex: 1 1 calc(50% - 6px);
        font-size: 0.8rem;
        padding: 10px 8px;
    }

    /* Two-column forms become one column so fields have room to breathe. */
    .form-grid {
        grid-template-columns: 1fr;
    }

    .checkbox-grid {
        grid-template-columns: 1fr 1fr;
    }

    /* Tables scroll horizontally within their own box rather than
       forcing the whole page wider than the viewport. */
    .data-table:not(.data-table-compact) {
        min-width: 480px;
    }

    .data-table-compact td:first-child {
        width: 140px;
    }

    .profile-summary {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .profile-summary-details {
        width: 100%;
    }

    .btn-inline {
        width: 100%;
    }
}

@media (max-width: 400px) {
    .checkbox-grid {
        grid-template-columns: 1fr;
    }

    /* 2026-10-23: card keeps the Operator sizes on phones; only the side
       padding narrows so the sign-in button text stays on one line. */
    .auth-card-header {
        padding: 40px 24px;
    }

    .auth-card-body {
        padding: 32px 24px;
    }

    .auth-card-body .btn {
        padding-left: 12px;
        padding-right: 12px;
        font-size: 0.95rem;
    }
}

/* ============================================================
   Document center (public/personnel/documents.php)
   ============================================================ */

.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.status-pending {
    background: #fff4de;
    color: #9a6700;
}

.status-approved {
    background: #e6f4ea;
    color: #1e6b34;
}

.status-rejected {
    background: #fdecea;
    color: #b42318;
}

.status-draft {
    background: #eceef1;
    color: #5a5f6a;
}

.status-submitted,
.status-under_review {
    background: #e7f0fa;
    color: #1a5c8a;
}

.status-needs_correction {
    background: #fff4de;
    color: #9a6700;
}

.status-archived {
    background: #eceef1;
    color: #8a8f99;
}

.actions-cell {
    display: flex;
    align-items: center;
    gap: 12px;
    white-space: nowrap;
}

.inline-form {
    display: inline;
}

.btn-link {
    background: none;
    border: none;
    color: var(--brand-green);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
}

.btn-link:hover {
    color: var(--brand-green-hover);
}

/* Closable document viewer modal */

.doc-viewer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 3000;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.doc-viewer-modal {
    background: var(--bg-elevated);
    border-radius: 8px;
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.doc-viewer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color-soft);
    font-weight: 700;
}

.doc-viewer-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0 4px;
}

.doc-viewer-close:hover {
    color: var(--text-main);
}

.doc-viewer-body {
    flex: 1;
    overflow: auto;
    background: var(--bg-muted-2);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

.doc-viewer-image {
    max-width: 100%;
    max-height: 80vh;
    display: block;
}

.doc-viewer-iframe {
    width: 100%;
    height: 75vh;
    border: none;
}

@media (max-width: 640px) {
    .doc-viewer-modal {
        max-height: 95vh;
    }

    .doc-viewer-iframe {
        height: 65vh;
    }

    .actions-cell {
        flex-wrap: wrap;
    }
}

/* ============================================================
   Admin shell: sidebar + content area
   ============================================================ */

.admin-page-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.admin-shell {
    display: flex;
    flex: 1;
    min-height: 0;
}

/* Sidebar stays this branded dark green in both themes, same reasoning
   as .app-topbar above. */

.admin-sidebar {
    width: 220px;
    flex-shrink: 0;
    background: #1e3a24;
    color: #ffffff;
    display: flex;
    flex-direction: column;
}

.admin-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px 10px;
}

.admin-sidebar-nav a {
    padding: 11px 16px;
    color: #cfe3d3;
    text-decoration: none;
    font-size: 0.86rem;
    font-weight: 700;
    border-radius: 8px;
    transition: background 0.12s ease, color 0.12s ease;
}

.admin-sidebar-nav a:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.admin-sidebar-nav a.active {
    background: var(--brand-green);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.admin-sidebar-nav a.active:hover {
    background: var(--brand-green);
    color: #ffffff;
}

.admin-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.admin-content {
    padding: 24px 28px 40px;
    flex: 1;
}

.admin-page-title {
    font-size: 1.4rem;
    margin: 0 0 18px;
}

.admin-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px 22px;
    margin-bottom: 20px;
}

.admin-panel-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Stat cards */

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.stat-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--brand-green);
    border-radius: 8px;
    padding: 16px 18px;
    text-decoration: none;
    color: inherit;
}

.stat-card-warning { border-left-color: #9a6700; }

.stat-card-success { border-left-color: #1e6b34; }

.stat-card-danger { border-left-color: #b42318; }

.stat-number {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-main);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* Filter form on personnel list */

.filter-form label {
    margin-top: 0;
}

.filter-form .btn-inline {
    margin-top: 16px;
    margin-right: 8px;
}

/* Simple list (recent registrations, etc.) */

.simple-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.simple-list li {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color-soft);
    font-size: 0.9rem;
}

.simple-list li:last-child {
    border-bottom: none;
}

.simple-list-meta {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.audit-details {
    font-size: 0.85rem;
    max-width: 340px;
}

.audit-details .simple-list-meta {
    display: block;
    margin-top: 2px;
}

/* Pagination */

.pagination {
    display: flex;
    gap: 6px;
    margin-top: 16px;
}

.pagination a {
    display: inline-block;
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.85rem;
}

.pagination a.active {
    background: var(--brand-green);
    border-color: var(--brand-green);
    color: #ffffff;
}

.clickable-row {
    cursor: pointer;
}

.clickable-row:hover {
    background: var(--bg-hover);
}

@media (max-width: 900px) {
    .admin-panel-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .admin-shell {
        flex-direction: column;
    }

    .admin-sidebar {
        width: 100%;
    }

    .admin-sidebar-nav {
        flex-direction: row;
        flex-wrap: wrap;
        padding: 8px 12px;
    }

    .admin-sidebar-nav a {
        padding: 8px 12px;
    }

    .admin-content {
        padding: 16px;
    }
}

/* ============================================================
   Admin document review (personnel_view.php)
   ============================================================ */

.inline-filter-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.inline-filter-form select {
    width: auto;
}

.doc-review-row {
    border: 1px solid var(--border-color-soft);
    border-radius: 6px;
    padding: 14px 16px;
    margin-bottom: 12px;
}

.doc-review-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 0.9rem;
}

.doc-review-filename {
    color: var(--text-muted);
}

.doc-review-meta {
    width: 100%;
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.doc-review-form {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.doc-review-form textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--input-border);
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.88rem;
    resize: vertical;
    background: var(--input-bg);
    color: var(--text-main);
}

.doc-review-buttons {
    display: flex;
    gap: 10px;
}

.btn-approve,
.btn-reject {
    padding: 8px 16px;
    border-radius: 4px;
    border: none;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
}

.btn-approve {
    background: #1e6b34;
    color: #ffffff;
}

.btn-approve:hover {
    background: #175529;
}

.btn-reject {
    background: var(--bg-card);
    color: #b42318;
    border: 1px solid #b42318;
}

.btn-reject:hover {
    background: #fdecea;
}

@media (max-width: 640px) {
    .doc-review-buttons {
        flex-direction: column;
    }
}

/* ============================================================
   DARK MODE (2026-10-05)
   Toggled by the button in the topbar (app/templates/topbar.php),
   persisted to localStorage, and restored on page load by a small
   inline script in header.php (before first paint, to avoid a flash
   of the light theme). Overrides ONLY the variables declared in :root
   above, plus a handful of status-badge/flash colors that were
   hardcoded rather than variable-based (light pastel backgrounds that
   would look wrong — too glowy — against a dark page).
   ============================================================ */

:root[data-theme="dark"] {
    --bg-page: #15181c;
    --bg-card: #1f2328;
    --bg-elevated: #242931;
    --bg-subtle: #262b33;
    --bg-muted-2: #1a1d22;
    --bg-hover: #26312b;
    --border-color: #3a3f47;
    --border-color-soft: #2e3339;
    --input-bg: #262b33;
    --input-border: #454b54;
    --nav-bg: #262b33;
    --text-main: #e8eaed;
    --text-muted: #a3a9b3;
    --text-faint: #7d828c;
    --shadow-color: rgba(0, 0, 0, 0.4);
    --shadow-color-strong: rgba(0, 0, 0, 0.6);
    --watermark-opacity: 0.03;
}

:root[data-theme="dark"] .status-pending,
:root[data-theme="dark"] .status-needs_correction {
    background: #4a3a14;
    color: #f5c451;
}

:root[data-theme="dark"] .status-approved {
    background: #1c3324;
    color: #6fcf8e;
}

:root[data-theme="dark"] .status-rejected {
    background: #3a1e1c;
    color: #ff8a80;
}

:root[data-theme="dark"] .status-draft,
:root[data-theme="dark"] .status-archived {
    background: #2e3339;
    color: #a3a9b3;
}

:root[data-theme="dark"] .status-submitted,
:root[data-theme="dark"] .status-under_review {
    background: #1a2e3d;
    color: #7fb8e0;
}

:root[data-theme="dark"] .flash-success {
    background: #1c3324;
    color: #6fcf8e;
    border-left-color: #6fcf8e;
}

:root[data-theme="dark"] .flash-error {
    background: #3a1e1c;
    color: #ff8a80;
    border-left-color: #ff8a80;
}

:root[data-theme="dark"] .flash-info {
    background: #1a2e3d;
    color: #7fb8e0;
    border-left-color: #7fb8e0;
}

:root[data-theme="dark"] .btn-secondary:hover {
    background: #1c3324;
}

:root[data-theme="dark"] .btn-reject:hover {
    background: #3a1e1c;
}

.app-welcome-link {
    color: inherit;
    text-decoration: none;
    border-radius: 999px;
    padding: 2px 8px 2px 2px;
}

.app-welcome-link:hover,
.app-welcome-link:focus-visible {
    background: rgba(255, 255, 255, 0.15);
    outline: none;
}

tr.row-link { cursor: pointer; }

tr.row-link:hover td { background: rgba(46, 125, 50, 0.08); }

.faq-list { margin: 8px 0 24px; }

.faq-item {
    border: 1px solid var(--border-color, #d0d7de);
    border-radius: 6px;
    margin-bottom: 8px;
    padding: 0 14px;
}

.faq-item summary {
    cursor: pointer;
    font-weight: 700;
    padding: 12px 0;
}

.faq-item[open] summary { border-bottom: 1px solid var(--border-color, #d0d7de); margin-bottom: 10px; }

.faq-item p { margin: 0 0 12px; line-height: 1.55; }

.about-team {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin-top: 10px;
}

.about-person {
    border: 1px solid var(--border-color, #d0d7de);
    border-left: 4px solid #1e6b34;
    border-radius: 6px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

@media (min-width: 641px) {
    .admin-page-shell {
        height: 100vh;
        height: 100dvh;
        min-height: 0;
        overflow: hidden;
    }

    .admin-page-shell > .app-topbar {
        flex-shrink: 0;
    }

    .admin-shell {
        flex: 1;
        min-height: 0;
        overflow: hidden;
    }

    .admin-sidebar {
        overflow-y: auto;
    }

    .admin-main {
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    /* The footer is now inside the scrolling column, so it must not use
       the full-viewport-width trick meant for the old position. */
    .admin-main .site-footer-text {
        left: 0;
        width: auto;
        margin-left: 0;
    }
}

.admin-sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-sidebar-nav .nav-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* ---- Search bar: label above, field fills the row, button lines up with the field ---- */

.search-bar {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    margin: 14px 0 6px;
}

.search-bar-field {
    flex: 1;
    min-width: 0;
}

.search-bar-field label {
    display: block;
    margin-bottom: 6px;
}

.search-bar-field input {
    width: 100%;
    margin: 0;
}

.search-bar .btn {
    margin: 0;
    height: 42px;           /* same height as the text field */
    flex-shrink: 0;
}

/* ---- Table action buttons ---- */

.col-actions {
    text-align: right;
    white-space: nowrap;
    width: 1%;
}

.col-actions .inline-form { display: inline; margin-left: 6px; }

.btn-table {
    font: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 6px;
    border: 1px solid var(--border-color, #d0d7de);
    background: transparent;
    color: var(--text-main, #1f2328);
    cursor: pointer;
}

.btn-table:hover { background: var(--bg-hover, rgba(0, 0, 0, 0.06)); }

.btn-table-primary {
    background: var(--brand-green, #2e7d32);
    border-color: var(--brand-green, #2e7d32);
    color: #ffffff;
}

.btn-table-primary:hover { background: var(--brand-green-dark, #1e6b34); }

.btn-table-danger {
    color: #c0392b;
    border-color: #c0392b;
}

.btn-table-danger:hover { background: rgba(192, 57, 43, 0.12); }

/* ---- Shared dialog (native <dialog>) ---- */

.app-dialog {
    border: 1px solid var(--border-color, #d0d7de);
    border-radius: 10px;
    padding: 0;
    width: min(640px, 92vw);
    background: var(--bg-card, #ffffff);
    color: var(--text-main, #1f2328);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.app-dialog::backdrop { background: rgba(0, 0, 0, 0.55); }

.app-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color, #d0d7de);
}

.app-dialog-header h2 { margin: 0; font-size: 1.05rem; }

.app-dialog-close {
    background: none;
    border: 0;
    color: inherit;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
}

.app-dialog-body { padding: 16px 20px; }

.app-dialog-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid var(--border-color, #d0d7de);
}

.app-dialog-footer .btn { margin: 0; }

.dialog-sports {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 8px 14px;
    max-height: 50vh;
    overflow-y: auto;
    padding: 4px 2px;
}

.dialog-sports .checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-weight: 600;
}

.dialog-sports input[type="checkbox"] { width: auto; margin: 0; }

/* Same width for every status pill so the column lines up.
   Add the class to any .status-badge you want fixed-width. */

.status-pill-fixed {
    display: inline-block;
    min-width: 104px;
    text-align: center;
}

/* Subtle grey-blue "glass" button with a magnifier icon. */

.btn-view {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    color: #3d5a80;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.75), rgba(120, 144, 176, 0.18));
    border: 1px solid rgba(100, 125, 160, 0.38);
    box-shadow: 0 1px 2px rgba(60, 80, 110, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.btn-view:hover,
.btn-view:focus-visible {
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.9), rgba(120, 144, 176, 0.3));
    border-color: rgba(100, 125, 160, 0.6);
    outline: none;
}

.btn-view-icon { width: 15px; height: 15px; flex-shrink: 0; }

[data-theme="dark"] .btn-view {
    color: #b8d0ee;
    background: linear-gradient(to bottom, rgba(140, 170, 210, 0.2), rgba(100, 130, 170, 0.12));
    border-color: rgba(150, 180, 220, 0.35);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .btn-view:hover,
[data-theme="dark"] .btn-view:focus-visible {
    background: linear-gradient(to bottom, rgba(140, 170, 210, 0.32), rgba(100, 130, 170, 0.22));
    border-color: rgba(170, 200, 240, 0.55);
}

/* Grid/flex children may shrink below their content width. Without this,
   one wide table stretches the whole panel past the screen edge. */

.admin-panel,
.admin-panel-row > *,
.admin-content,
.stat-grid > * {
    min-width: 0;
}

.admin-panel-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 900px) {
    .admin-panel-row {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Wide tables scroll inside their panel instead of stretching the page. */

.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}

img, video, iframe {
    max-width: 100%;
}

@media (max-width: 640px) {
    html, body {
        overflow-x: hidden;
    }

    .admin-content {
        padding: 14px 12px 28px;
    }

    .admin-panel {
        padding: 14px;
    }

    /* Sidebar becomes one horizontally scrollable strip of icon+label tabs */
    .admin-sidebar {
        width: 100%;
        border-right: 0;
        border-bottom: 1px solid var(--border-color);
    }

    .admin-sidebar-nav {
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 4px;
        padding: 8px 10px;
        scrollbar-width: none;
    }

    .admin-sidebar-nav::-webkit-scrollbar {
        display: none;
    }

    .admin-sidebar-nav a {
        flex: 0 0 auto;
        white-space: nowrap;
        padding: 8px 12px;
        font-size: 0.85rem;
    }

    .admin-page-title {
        font-size: 1.2rem;
    }

    .section-heading {
        font-size: 1rem;
    }

    .stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .stat-card {
        padding: 12px;
    }

    /* Topbar: keep it to one tidy row */
    .app-topbar {
        flex-wrap: wrap;
        gap: 8px;
        padding: 8px 12px;
    }

    .app-topbar-right {
        gap: 8px;
        flex-wrap: wrap;
        margin-left: auto;
    }

    .app-welcome-name {
        max-width: 140px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* Forms and buttons: full width, finger-sized */
    input[type="text"], input[type="email"], input[type="password"],
    input[type="search"], input[type="date"], input[type="number"],
    select, textarea {
        max-width: 100%;
        font-size: 16px; /* stops iOS zooming into fields */
    }

    .search-bar {
        flex-wrap: wrap;
    }

    .search-bar input {
        flex: 1 1 100%;
    }

    .inline-filter-form {
        flex-wrap: wrap;
    }

    .data-table th,
    .data-table td {
        padding: 8px 10px;
    }

    .app-dialog {
        width: calc(100vw - 24px);
        max-width: calc(100vw - 24px);
    }
}

/* Dashboard: name buttons in "Recently Registered" + centered queue button */

.simple-list li.row-link {
    align-items: center;
    cursor: pointer;
}

.simple-list li .btn-view {
    max-width: 70%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-view-center {
    display: flex;
    justify-content: center;
    margin-top: 16px;
}

/* Recently Registered: equal-width name buttons + sport column */

.recent-list li {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr) auto;
    column-gap: 14px;
    align-items: center;
}

.simple-list.recent-list li .btn-view-fixed {
    width: 100%;
    max-width: none;
    justify-content: flex-start;
    box-sizing: border-box;
}

.recent-sport {
    font-size: 0.85rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 640px) {
    .recent-list li {
        grid-template-columns: minmax(0, 150px) minmax(0, 1fr);
        row-gap: 4px;
    }
    .recent-list .simple-list-meta {
        grid-column: 1 / -1;
    }
}

.filter-form .filter-actions .btn-inline {
    margin: 0;
    min-width: 130px;
}

.btn-apply { background: var(--brand-green); color: #fff; }

.btn-apply:hover { background: var(--brand-green-hover); }

.btn-reset { background: #d9822b; color: #fff; border: none; }

.btn-reset:hover { background: #b96a1c; }

.btn-export { background: #3d5a80; color: #fff; border: none; }

.btn-export:hover { background: #2f4766; }

@media (max-width: 640px) {
    .filter-form .filter-actions .btn-inline { flex: 1 1 100%; }
}

/* Same width as a filter dropdown, glass look from .btn-view */

.filter-actions .btn-filter-action {
    width: 190px;
    justify-content: center;
    padding: 9px 16px;
    box-sizing: border-box;
}

@media (max-width: 640px) {
    .filter-actions .btn-filter-action { flex: 1 1 100%; width: auto; }
}

/* Pill widths (Application Status / Documents columns) */

.status-pill-wide  { min-width: 152px; }

.status-pill-xwide { min-width: 172px; }

/* Filter buttons */

/* Both rows use the same column grid (auto-fill keeps the column count
   identical even when the button row has only two items), and the two
   buttons sit in the LAST two columns, so each is exactly as wide as the
   filter box above it. */

.filter-form .filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0 14px;
}

.filter-actions {
    display: grid;
    flex-wrap: wrap;
    gap: 0 14px;
    margin-top: 16px;
    justify-content: flex-end;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

.filter-actions .btn-filter-action {
    justify-content: center;
    padding: 9px 16px;
    box-sizing: border-box;
    width: 100%;
    margin: 0;
}

/* Colors: Reset orange, Export slate blue (override the glass look) */

.filter-actions .btn-reset {
    grid-column: -3 / -2;
    background: #d9822b;
    border-color: #b96a1c;
    color: #fff;
    box-shadow: none;
}

.filter-actions .btn-reset:hover,
.filter-actions .btn-reset:focus-visible { background: #b96a1c; border-color: #b96a1c; }

.filter-actions .btn-export {
    grid-column: -2 / -1;
    background: #3d5a80;
    border-color: #2f4766;
    color: #fff;
    box-shadow: none;
}

.filter-actions .btn-export:hover,
.filter-actions .btn-export:focus-visible { background: #2f4766; border-color: #2f4766; }

/* Centered filter dropdowns with the arrow placed by select_centered.js */

select.select-centered {
    -webkit-appearance: none;
    appearance: none;
    text-align: center;
    text-align-last: center;
    padding-left: 12px;
    padding-right: 12px;
    cursor: pointer;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' fill='none' stroke='%23666' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/></svg>");
    background-repeat: no-repeat;
    background-position: calc(100% - 12px) 50%;
}

[data-theme="dark"] select.select-centered {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' fill='none' stroke='%23bbb' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/></svg>");
}

@media (max-width: 640px) {
    .filter-actions { grid-template-columns: minmax(0, 1fr); row-gap: 8px; }
    .filter-actions .btn-reset,
    .filter-actions .btn-export { grid-column: 1; }
}

.filter-actions .btn-reset:only-child { grid-column: -2 / -1; }

/* Pill buttons that match .btn-view in size */

.btn-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 128px;
    padding: 7px 16px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    border: 1px solid transparent;
    box-sizing: border-box;
}

.btn-pill:disabled { opacity: 0.6; cursor: wait; }

.btn-pill-approve { background: #1e6b34; border-color: #175529; color: #fff; }

.btn-pill-approve:hover { background: #175529; }

.btn-pill-reject  { background: #b42318; border-color: #8f1b12; color: #fff; }

.btn-pill-reject:hover  { background: #8f1b12; }

.btn-pill-neutral {
    background: transparent;
    color: var(--text-main, #1f2328);
    border-color: var(--border-color, #c5ccd3);
}

.btn-pill-neutral:hover { background: var(--bg-hover, rgba(0, 0, 0, 0.05)); }

/* The View Document button in the queue is a <button>; keep it uniform */

.queue-actions .btn-view {
    min-width: 150px;
    justify-content: center;
    cursor: pointer;
    font-family: inherit;
    box-sizing: border-box;
}

/* Queue entry: info on top, buttons underneath */

.queue-info {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.4fr) minmax(0, 1.4fr);
    gap: 8px 20px;
    align-items: start;
    font-size: 0.9rem;
}

.queue-info > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

.queue-name { font-weight: 700; font-size: 1rem; }

.queue-division { color: var(--text-muted); font-size: 0.85rem; }

.queue-file .doc-review-filename { overflow-wrap: anywhere; }

/* Dialogs */

.app-dialog-narrow { width: min(480px, 92vw); }

.app-dialog-body textarea { width: 100%; box-sizing: border-box; resize: vertical; margin-top: 6px; }

.required-mark { color: #b42318; font-weight: 400; font-size: 0.85rem; }

.form-error { color: #b42318; font-size: 0.85rem; margin: 6px 0 0; }

@media (max-width: 760px) {
    .queue-info { grid-template-columns: minmax(0, 1fr); }
    .queue-actions .btn-view,
    .queue-actions .btn-pill { flex: 1 1 100%; }
}

/* ============================================================
   Profile pictures + queue columns (2026-10-07, part 2)
   ============================================================ */

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--border-color, #d0d7de);
    background: var(--bg-card, #fff);
}

.avatar-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    color: #fff;
    background: var(--brand-green, #2e7d32);
    border-color: transparent;
}

.person-inline {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.person-cell {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.person-cell .btn-view { min-width: 0; max-width: 100%; }

/* Recently Registered: avatar + button live in the first column */

.recent-list li { grid-template-columns: 230px minmax(0, 1fr) auto; }

.recent-list .person-cell .btn-view-fixed { flex: 1 1 auto; width: auto; }

@media (max-width: 640px) {
    .recent-list li { grid-template-columns: minmax(0, 1fr); }
}

/* Queue entry now has four columns: person | sport | document | file */

.queue-info { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, 1.2fr); }

.queue-label { color: var(--text-muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.03em; }

@media (max-width: 900px) {
    .queue-info { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
    .queue-info { grid-template-columns: minmax(0, 1fr); }
}

/* ============================================================
   Queue alignment fixes (2026-10-07, part 3)
   ============================================================ */

/* Five filter boxes: give the filter row and the button row the same five
   equal columns so Reset sits exactly under the last box (Show). */

@media (min-width: 901px) {
    .filter-form .filter-row.filter-cols-5,
    .filter-actions.filter-cols-5 {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
    .filter-actions.filter-cols-5 .btn-reset { grid-column: 5; }
}

/* Name pill fills its column; the SDO is centered beneath the pill */

.queue-info-main .person-cell .btn-view {
    flex: 1 1 auto;
    justify-content: center;
}

.queue-info-main .queue-division {
    padding-left: 42px;
    text-align: center;
}

/* View Document / Approve / Reject centered */

.queue-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color-soft);
    justify-content: center;
}

/* Leave room under the button so the corner silhouette never overlaps it */

.col-center,
.data-table td.col-center,
.data-table th.col-center { text-align: center; }

/* Search + toggle / role toolbar */

.rankings-toolbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin: 12px 0;
}

.rankings-search { flex: 1 1 280px; max-width: 420px; }

.rankings-role   { flex: 0 0 200px; }

/* List / Grid segmented toggle */

.view-toggle {
    display: inline-flex;
    border: 1px solid rgba(100, 125, 160, 0.38);
    border-radius: 999px;
    overflow: hidden;
    background: var(--bg-card, #fff);
}

.view-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border: 0;
    background: transparent;
    color: #3d5a80;
    font: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
}

.view-toggle-btn + .view-toggle-btn { border-left: 1px solid rgba(100, 125, 160, 0.3); }

.view-toggle-btn[aria-pressed="true"] {
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.75), rgba(120, 144, 176, 0.3));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

[data-theme="dark"] .view-toggle-btn { color: #b8d0ee; }

/* List vs grid on the sport overview */

.rankings-grid-view { display: none; }

.rankings-views.is-grid .rankings-list-view { display: none; }

.rankings-views.is-grid .rankings-grid-view { display: grid; }

.sport-grid {
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 14px;
}

.sport-card:hover { border-color: var(--brand-green, #2e7d32); background: rgba(46, 125, 50, 0.05); }

.sport-card-name { font-weight: 700; font-size: 1rem; }

.sport-card-count { display: flex; flex-direction: column; line-height: 1.1; }

.sport-card-count strong { font-size: 1.6rem; }

.sport-card-count span { font-size: 0.78rem; color: var(--text-muted); }

.sport-grid .empty-state { grid-column: 1 / -1; }

/* Ranking page */

.rankings-table .btn-view-name {
    width: 210px;
    max-width: 100%;
    justify-content: center;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    box-sizing: border-box;
}

.rankings-table td { vertical-align: middle; }

.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.85rem;
    background: rgba(120, 144, 176, 0.18);
    color: #3d5a80;
}

.rank-badge.rank-1 { background: #f6d56b; color: #6b4e00; }

.rank-badge.rank-2 { background: #d7dce1; color: #4a525a; }

.rank-badge.rank-3 { background: #e5b98a; color: #6b3d12; }

[data-theme="dark"] .rank-badge.rank-other { color: #b8d0ee; }

.status-pill-count { min-width: 34px; text-align: center; }

@media (max-width: 640px) {
    .rankings-search, .rankings-role { flex: 1 1 100%; max-width: none; }
    .view-toggle { width: 100%; }
    .view-toggle-btn { flex: 1; justify-content: center; }
    .sport-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .rankings-table .btn-view-name { width: 170px; }
}

.rankings-views { margin-top: 14px; }

#rankingsCount:empty { display: none; }

.rankings-toolbar + .subtitle + .field-hint,
.rankings-toolbar ~ .field-hint { margin-top: 14px; }

/* Sport silhouettes (sport_icons.php) */

.sport-icon { width: 22px; height: 22px; flex-shrink: 0; }

.sport-name-cell { display: inline-flex; align-items: center; gap: 20px; }

.sport-name-cell .sport-icon { color: #3d5a80; }

[data-theme="dark"] .sport-name-cell .sport-icon { color: #b8d0ee; }

[data-theme="dark"] .sport-card .sport-card-icon { color: #b8d0ee; }

/* Corner silhouette: bigger, partly clipped by the card's right/bottom edge,
   tucked UNDER the View Ranking button (button sits above it) and fainter. */

.sport-card {
    padding-bottom: 62px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 16px 14px;
    text-align: center;
    border: 1px solid var(--border-color-soft, #d8dee4);
    border-radius: 10px;
    background: var(--bg-card, #fff);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    justify-content: center;
}

.sport-card .sport-card-icon {
    right: -10px;
    bottom: -12px;
    opacity: 0.10;
    position: absolute;
    width: 76px;
    height: 76px;
    color: #3d5a80;
    pointer-events: none;
}

.sport-card:hover .sport-card-icon {
    opacity: 0.28;
    color: var(--brand-green, #2e7d32);
}

.sport-card .btn-view {
    margin-top: 4px;
    position: relative;
    z-index: 1;
}

.back-link-row { margin: 0 0 14px; }

.pv-top { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: stretch; margin-bottom: 20px; }

.pv-top > .admin-panel { margin-bottom: 0; }

.pv-identity { display: flex; gap: 18px; align-items: center; margin-bottom: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--border, #e2e8f0); }

.pv-photo { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; border: 3px solid #e6ecf3; }

.pv-photo-fallback { display: flex; align-items: center; justify-content: center; background: #dbe5f1; color: #3d5a80; font-size: 2.2rem; font-weight: 600; }

.pv-identity-text { min-width: 0; }

.pv-name { margin: 0 0 8px; font-size: 1.6rem; overflow-wrap: anywhere; }

.pv-identity-meta { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }

.pv-email { color: #5b6878; font-size: 0.9rem; overflow-wrap: anywhere; }

.pv-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

.pv-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; background: #e8eef6; color: #2f4560; font-size: 0.82rem; }

.pv-chip .sport-icon { width: 14px; height: 14px; fill: currentColor; }

.pv-chip-role { background: #eef3ea; color: #3f5a35; }

.pv-info-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }

.pv-info-group h3 { margin: 0 0 8px; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: #5b6878; }

.pv-info-group dl { margin: 0; display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 7px 12px; }

.pv-info-group dt { color: #5b6878; font-size: 0.88rem; }

.pv-info-group dd { margin: 0; overflow-wrap: anywhere; }

.pv-side { display: flex; flex-direction: column; gap: 16px; }

.pv-score { text-align: center; padding: 14px 10px; border-radius: 12px; background: linear-gradient(160deg, #eaf1f9, #f6f9fc); }

.pv-score-label { display: block; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: #5b6878; }

.pv-score-number { display: block; font-size: 3.2rem; font-weight: 700; line-height: 1.1; color: #3d5a80; }

.pv-score-link {
    font-size: 0.85rem;
    margin-top: 8px;
    text-decoration: none;
}

.pv-doc-counts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }

.pv-count { text-align: center; padding: 8px 4px; border-radius: 10px; background: #f3f5f8; }

.pv-count strong { display: block; font-size: 1.4rem; }

.pv-count span { font-size: 0.72rem; color: #5b6878; }

.pv-count-pending strong { color: #b7791f; }

.pv-count-approved strong { color: #2f855a; }

.pv-count-rejected strong { color: #c0392b; }

.pv-status-form { display: flex; flex-direction: column; gap: 8px; margin-top: auto; }

.pv-status-form label { font-size: 0.85rem; color: #5b6878; }

.pv-status-form select { width: 100%; }

.pv-status-btn, .pv-award-btn { justify-content: center; }

.pv-award-btn { margin-top: 16px; }

.pv-tab-panel { padding-top: 12px; }

.pv-doc {
    padding: 18px 22px;
    border-bottom: 1px solid var(--border, #e2e8f0);
    margin-bottom: 12px;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.6);
}

.pv-doc:last-child {
    border-bottom: 0;
    margin-bottom: 0;
}

.pv-doc-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }

.pv-doc-title { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

.pv-doc-file { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px 14px; color: #5b6878; font-size: 0.88rem; overflow-wrap: anywhere; }

.pv-doc-review { margin-top: 8px; font-size: 0.88rem; }

.pv-doc-comment { margin-top: 6px; padding: 8px 12px; border-left: 3px solid #d9822b; background: #fdf6ee; border-radius: 4px; }

.pv-doc-comment span { font-weight: 600; margin-right: 4px; }

.pv-doc .queue-actions { margin-top: 12px; justify-content: flex-start; }

.btn-pill-reopen { background: #e8eef6; color: #3d5a80; border: 1px solid #c7d4e4; }

.btn-pill-sm { padding: 4px 12px; font-size: 0.82rem; }

.score-figure {
    font-size: 1.3rem;
    color: #3d5a80;
}

[data-theme="dark"] .pv-photo { border-color: #2e3a4a; }

[data-theme="dark"] .pv-photo-fallback, [data-theme="dark"] .pv-chip { background: #25334a; color: #c9d8ec; }

[data-theme="dark"] .pv-chip-role { background: #2a3a2b; color: #cfe3c7; }

[data-theme="dark"] .pv-score, [data-theme="dark"] .pv-count { background: #1f2a3a; }

[data-theme="dark"] .pv-score-number { color: #9fc0e8; }

[data-theme="dark"] .pv-doc-comment { background: #3a2f22; }

[data-theme="dark"] .btn-pill-reopen { background: #25334a; color: #c9d8ec; border-color: #3a4c68; }

@media (max-width: 900px) {
    .pv-top { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 600px) {
    .pv-identity { flex-direction: column; text-align: center; }
    .pv-identity-meta, .pv-chips { justify-content: center; }
    .pv-info-grid { grid-template-columns: minmax(0, 1fr); }
    .pv-info-group dl { grid-template-columns: 105px minmax(0, 1fr); }
    .pv-doc-head { flex-direction: column; }
}

/* ---- Document tabs ---- */

.pv-tabs { display: flex; flex-wrap: wrap; gap: 8px; border-bottom: 1px solid var(--border, #e2e8f0); margin-bottom: 8px; }

.pv-tab { display: inline-flex; align-items: center; gap: 8px; padding: 11px 20px; border: 0; border-radius: 12px 12px 0 0; background: #eef0f4; color: #5b6878; font: inherit; font-weight: 600; cursor: pointer; }

.pv-tab:hover { background: #e3e8ef; }

.pv-tab.is-active { background: #3d5a80; color: #fff; box-shadow: 0 -2px 8px rgba(61, 90, 128, 0.25); }

.pv-tab-icon { width: 18px; height: 18px; flex: 0 0 auto; }

.pv-tab-count { min-width: 22px; padding: 1px 7px; border-radius: 999px; background: rgba(0, 0, 0, 0.08); font-size: 0.78rem; text-align: center; }

.pv-tab.is-active .pv-tab-count { background: rgba(255, 255, 255, 0.25); }

[data-theme="dark"] .pv-tab { background: #1f2a3a; color: #aab6c6; }

[data-theme="dark"] .pv-tab:hover { background: #26354a; }

[data-theme="dark"] .pv-tab.is-active { background: #3d5a80; color: #fff; }

@media (max-width: 600px) {
    .pv-tabs { gap: 4px; }
    .pv-tab { flex: 1 1 auto; justify-content: center; padding: 10px 8px; font-size: 0.85rem; }
    .pv-tab-icon { display: none; }
}

[data-theme="dark"] .pv-doc { background: rgba(31, 42, 58, 0.5); }

.pv-status-hint { margin: 0; font-size: 0.78rem; color: #5b6878; }

@media (max-width: 600px) {
    .col-actions-pair { white-space: normal; }
    .col-actions-pair .inline-form { margin: 8px 0 0; display: block; }
    .dialog-sports { grid-template-columns: minmax(0, 1fr); }
}

tr.row-click { cursor: pointer; }

tr.row-click:hover td { background: rgba(61, 90, 128, 0.07); }

.col-actions-pair { white-space: nowrap; text-align: right; }

.col-actions-pair .btn-view,
.col-actions-pair .btn-pill { vertical-align: middle; }

.col-actions-pair .btn-view { margin-right: 6px; }

.col-actions-pair .inline-form { display: inline-block; margin-left: 8px; vertical-align: middle; }

.search-bar { align-items: flex-end; }

.search-bar .btn-view { height: 42px; }

td .pv-chips { margin-top: 0; }

.dialog-sports { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; }

@media (max-width: 600px) {
    .col-actions-pair { white-space: normal; }
    .col-actions-pair .inline-form { margin: 8px 0 0; display: block; }
    .col-actions-pair .btn-view { margin: 0 6px 6px 0; }
    .dialog-sports { grid-template-columns: minmax(0, 1fr); }
}
/* FILE: public/assets/css/app.css  (APPEND this block to the END) — Validators page styling.
   Needs the .pv-chips / .pv-chip rules from app_css_personnel_view.css and the
   .person-inline / .avatar rules from app_css_queue.css (already in app.css). */
tr.row-click { cursor: pointer; }
tr.row-click:hover td { background: rgba(61, 90, 128, 0.07); }
.col-actions-pair { white-space: nowrap; text-align: right; }
.col-actions-pair .btn-view,
.col-actions-pair .btn-pill { vertical-align: middle; }
.col-actions-pair .btn-view { margin-right: 6px; }
.col-actions-pair .inline-form { display: inline-block; margin-left: 8px; vertical-align: middle; }
.search-bar { align-items: flex-end; }
.search-bar .btn-view { height: 42px; }
td .pv-chips { margin-top: 0; }
.dialog-sports { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; }
@media (max-width: 600px) {
    .col-actions-pair { white-space: normal; }
    .col-actions-pair .inline-form { margin: 8px 0 0; display: block; }
    .col-actions-pair .btn-view { margin: 0 6px 6px 0; }
    .dialog-sports { grid-template-columns: minmax(0, 1fr); }
}

/* Uniform height for the buttons in the validators tables */
.col-actions-pair .btn-view,
.col-actions-pair .btn-pill {
    height: 38px;
    padding-top: 0;
    padding-bottom: 0;
    box-sizing: border-box;
    align-items: center;
    justify-content: center;
}

/* Sports cell as a dropdown-style button */
.sports-btn {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    max-width: 100%;
    padding: 5px 34px 5px 8px;
    position: relative;
    font: inherit;
    color: inherit;
    text-align: left;
    cursor: pointer;
    border: 1px solid rgba(100, 125, 160, 0.38);
    border-radius: 12px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.75), rgba(120, 144, 176, 0.12));
}
.sports-btn:hover,
.sports-btn:focus-visible { border-color: rgba(100, 125, 160, 0.7); outline: none; }
.sports-btn-chevron {
    position: absolute;
    right: 12px;
    top: 50%;
    width: 10px;
    height: 6px;
    transform: translateY(-50%);
    color: #3d5a80;
}
[data-theme="dark"] .sports-btn { background: rgba(140, 170, 210, 0.12); border-color: rgba(150, 180, 220, 0.35); }
[data-theme="dark"] .sports-btn-chevron { color: #b8d0ee; }
 
/* FILE: public/assets/css/app.css — AUDIT LOGS section (add ONCE, near the other page sections) */
.status-pill-audit { min-width: 190px; white-space: nowrap; font-size: 0.72rem; }
.audit-table td { vertical-align: middle; }
.audit-when { white-space: nowrap; }
.audit-when strong { display: block; }
.audit-user { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.audit-user .simple-list-meta { overflow-wrap: anywhere; }
.audit-details { max-width: 420px; }
.audit-kvs { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.audit-kv {
    display: inline-block;
    max-width: 100%;
    padding: 2px 9px;
    border-radius: 999px;
    background: rgba(120, 144, 176, 0.14);
    color: var(--text-main);
    font-size: 0.76rem;
    overflow-wrap: anywhere;
}
.audit-kv b { color: #3d5a80; font-weight: 700; text-transform: capitalize; margin-right: 3px; }
[data-theme="dark"] .audit-kv { background: rgba(140, 170, 210, 0.16); }
[data-theme="dark"] .audit-kv b { color: #b8d0ee; }
@media (max-width: 640px) {
    .audit-table { min-width: 720px; }
}

/* Filter boxes: equal columns, equal heights, Reset under the LAST box */
#auditFilterForm select.select-centered,
#auditFilterForm input[type="text"],
#auditFilterForm input[type="date"] { height: 42px; box-sizing: border-box; }
@media (min-width: 901px) {
    .filter-form .filter-row.filter-cols-6,
    .filter-actions.filter-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
    .filter-actions.filter-cols-6 .btn-reset { grid-column: 6; }
}
@media (max-width: 900px) {
    #auditFilterForm .filter-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.acct-grid { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 20px; align-items: start; }
.acct-grid .admin-panel { margin-bottom: 0; }
.acct-main { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

.acct-identity { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 28px 24px; }
.acct-photo { width: 148px; height: 148px; border-radius: 50%; object-fit: cover; border: 4px solid #e6ecf3; box-shadow: 0 2px 8px var(--shadow-color); }
.acct-photo[hidden] { display: none; }
.acct-photo-fallback { display: flex; align-items: center; justify-content: center; background: var(--brand-green); color: #fff; font-size: 3.4rem; font-weight: 700; border-color: transparent; }
.acct-name { margin: 8px 0 0; font-size: 1.3rem; overflow-wrap: anywhere; }
.acct-email { margin: 0; color: var(--text-muted); font-size: 0.9rem; overflow-wrap: anywhere; }
.acct-photo-form { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; margin-top: 12px; padding-top: 18px; border-top: 1px solid var(--border-color-soft); }
.acct-photo-form .field-hint { margin: 0; text-align: center; }
.acct-file-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; pointer-events: none; }
.acct-file-name { margin: 0; font-size: 0.82rem; color: var(--text-muted); overflow-wrap: anywhere; }
.acct-file-name[hidden], .acct-photo-form [hidden] { display: none; }
.acct-choose { display: inline-flex; align-items: center; cursor: pointer; margin: 0; }
.acct-choose.is-disabled { opacity: 0.6; pointer-events: none; }
.acct-btn { width: 100%; max-width: 230px; justify-content: center; height: 38px; padding-top: 0; padding-bottom: 0; cursor: pointer; font-family: inherit; box-sizing: border-box; }

.acct-heading { margin: 0 0 16px; font-size: 1.1rem; }
.acct-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.acct-field label { margin-top: 0; }
.acct-field { margin-bottom: 14px; }
.acct-actions { margin-top: 6px; display: flex; gap: 10px; }
.acct-actions .btn-pill { min-width: 170px; height: 38px; padding-top: 0; padding-bottom: 0; }

.acct-dl { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 10px 16px; margin: 18px 0 8px; padding-top: 16px; border-top: 1px solid var(--border-color-soft); }
.acct-dl:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
.acct-dl dt { color: var(--text-muted); font-size: 0.88rem; font-weight: 600; }
.acct-dl dd { margin: 0; overflow-wrap: anywhere; }


[data-theme="dark"] .acct-photo { border-color: #2e3a4a; }

@media (max-width: 900px) {
    .acct-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
    .acct-fields { grid-template-columns: minmax(0, 1fr); }
    .acct-dl { grid-template-columns: minmax(0, 1fr); gap: 2px; }
    .acct-dl dd { margin-bottom: 8px; }
    .acct-actions .btn-pill { width: 100%; }
}
.rank-sports { display: grid; }
.rank-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 220px)); gap: 16px; margin-bottom: 20px; }
.rank-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 16px 12px;
    text-align: center;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: linear-gradient(160deg, #eaf1f9, #f6f9fc);
}
.rank-tile-label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }
.rank-tile-number { font-size: 2.6rem; font-weight: 800; line-height: 1.1; color: #3d5a80; }
.rank-tile-link { font-size: 0.78rem; }
.rank-row-you td { background: rgba(46, 125, 50, 0.1); }
.rank-row-you td:first-child { box-shadow: inset 4px 0 0 var(--brand-green); }
.you-chip { padding: 1px 9px; border-radius: 999px; background: var(--brand-green); color: #fff; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
[data-theme="dark"] .rank-tile { background: #1f2a3a; }
[data-theme="dark"] .rank-tile-number { color: #9fc0e8; }
@media (max-width: 600px) {
    .rank-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .rank-tile-number { font-size: 2rem; }
}
.score-table td, .score-table th { vertical-align: middle; }
.score-basis { font-size: 0.85rem; color: var(--text-muted); }
.score-note { display: block; font-size: 0.78rem; color: var(--text-faint); word-break: break-all; }
.score-pts { display: inline-block; min-width: 54px; padding: 3px 10px; border-radius: 999px; background: rgba(46,125,50,0.12); color: var(--brand-green); font-weight: 700; }
.score-table tfoot td { border-top: 2px solid var(--border-color); background: rgba(61,90,128,0.07); padding-top: 12px; padding-bottom: 12px; }
.score-total-label { text-align: right; font-weight: 700; text-transform: uppercase; font-size: 0.8rem; letter-spacing: 0.05em; }
.score-total-figure { font-size: 1.5rem; font-weight: 800; color: var(--brand-green); }
[data-theme="dark"] .score-table tfoot td { background: rgba(159,192,232,0.1); }
@media (max-width: 600px) {
    .score-table thead { display: none; }
    .score-table, .score-table tbody, .score-table tfoot { display: block; }
    .score-table tbody tr { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 10px 0; border-bottom: 1px solid var(--border-color-soft); }
    .score-table tbody td { display: block; border: 0; padding: 2px 0; text-align: left; }
    .score-table tbody td[data-label="Qualification"] { grid-column: 1; }
    .score-table tbody td[data-label="Points"] { grid-column: 2; grid-row: 1; text-align: right; }
    .score-table tbody td[data-label="Basis"], .score-table tbody td[data-label="Verified"] { grid-column: 1 / -1; }
    .score-table tbody td[data-label="Verified"]::before { content: "Verified: "; color: var(--text-faint); }
    .score-table tfoot tr { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; }
    .score-table tfoot td { display: block; border: 0; background: none; padding: 0; }
}

.dash-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.dash-head-main { min-width: 0; flex: 1 1 260px; }
.standing-box {
    display: flex; flex-direction: column; align-items: flex-end; gap: 2px;
    padding: 10px 16px; border-radius: 12px; text-align: right; text-decoration: none;
    border: 1px solid var(--border-color); background: linear-gradient(160deg, #eaf1f9, #f6f9fc);
    color: inherit; font-size: 0.85rem;
}
.standing-box:hover { border-color: #3d5a80; }
.standing-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }
.standing-line { display: flex; align-items: baseline; gap: 6px; }
.standing-rank { font-size: 1.7rem; font-weight: 800; line-height: 1.1; color: #3d5a80; }
[data-theme="dark"] .standing-box { background: #1f2a3a; }
[data-theme="dark"] .standing-rank { color: #9fc0e8; }
@media (max-width: 600px) {
    .standing-box { width: 100%; align-items: flex-start; text-align: left; }
}

.toast-stack { position: fixed; top: 76px; right: 16px; z-index: 3000; display: flex; flex-direction: column; gap: 10px; width: min(380px, calc(100vw - 32px)); pointer-events: none; }
.toast {
    pointer-events: auto; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
    padding: 12px 14px; border-radius: 10px; font-size: 0.9rem; line-height: 1.4;
    background: #fff; color: #1f2933; border: 1px solid var(--border-color); border-left: 5px solid var(--brand-green);
    box-shadow: 0 8px 24px rgba(0,0,0,0.18); animation: toast-in 0.2s ease-out;
}
.toast-error { border-left-color: #c62828; }
.toast-out { opacity: 0; transform: translateY(-8px); transition: opacity 0.25s, transform 0.25s; }
.toast-close { background: none; border: 0; font-size: 1.3rem; line-height: 1; cursor: pointer; color: inherit; opacity: 0.6; padding: 0 2px; }
.toast-close:hover { opacity: 1; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
[data-theme="dark"] .toast { background: #1f2a3a; color: #e8eef6; }
.form-grid .form-span-2 { grid-column: 1 / -1; }
.doc-meta { display: block; font-size: 0.78rem; color: var(--text-faint); margin-top: 2px; }
.doc-review-title { display: block; }
.doc-review-earned { display: inline-block; margin: 2px 0; padding: 1px 9px; border-radius: 999px; background: rgba(61,90,128,0.12); color: #3d5a80; font-size: 0.75rem; font-weight: 600; }
[data-theme="dark"] .doc-review-earned { color: #9fc0e8; background: rgba(159,192,232,0.14); }

.score-table td, .score-table th { vertical-align: middle; }
.score-basis { font-size: 0.85rem; color: var(--text-muted); }
.score-note { display: block; font-size: 0.78rem; color: var(--text-faint); word-break: break-all; }
.score-pts { display: inline-block; min-width: 54px; padding: 3px 10px; border-radius: 999px; background: rgba(46,125,50,0.12); color: var(--brand-green); font-weight: 700; }
.score-table tfoot td { border-top: 2px solid var(--border-color); background: rgba(61,90,128,0.07); padding-top: 12px; padding-bottom: 12px; }
.score-total-label { text-align: right; font-weight: 700; text-transform: uppercase; font-size: 0.8rem; letter-spacing: 0.05em; }
.score-total-figure { font-size: 1.5rem; font-weight: 800; color: var(--brand-green); }
[data-theme="dark"] .score-table tfoot td { background: rgba(159,192,232,0.1); }
@media (max-width: 600px) {
    .score-table thead { display: none; }
    .score-table, .score-table tbody, .score-table tfoot { display: block; }
    .score-table tbody tr { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 10px 0; border-bottom: 1px solid var(--border-color-soft); }
    .score-table tbody td { display: block; border: 0; padding: 2px 0; text-align: left; }
    .score-table tbody td[data-label="Qualification"] { grid-column: 1; }
    .score-table tbody td[data-label="Points"] { grid-column: 2; grid-row: 1; text-align: right; }
    .score-table tbody td[data-label="Basis"], .score-table tbody td[data-label="Verified"] { grid-column: 1 / -1; }
    .score-table tbody td[data-label="Verified"]::before { content: "Earned: "; color: var(--text-faint); }
    .score-table tfoot tr { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; }
    .score-table tfoot td { display: block; border: 0; background: none; padding: 0; }
}

/* FILE: public/assets/css/app.css — TOAST + DOCUMENT FORM FIELDS (add ONCE) */
.toast-stack { position: fixed; top: 76px; right: 16px; z-index: 3000; display: flex; flex-direction: column; gap: 10px; width: min(380px, calc(100vw - 32px)); pointer-events: none; }
.toast {
    pointer-events: auto; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
    padding: 12px 14px; border-radius: 10px; font-size: 0.9rem; line-height: 1.4;
    background: #fff; color: #1f2933; border: 1px solid var(--border-color); border-left: 5px solid var(--brand-green);
    box-shadow: 0 8px 24px rgba(0,0,0,0.18); animation: toast-in 0.2s ease-out;
}
.toast-error { border-left-color: #c62828; }
.toast-out { opacity: 0; transform: translateY(-8px); transition: opacity 0.25s, transform 0.25s; }
.toast-close { background: none; border: 0; font-size: 1.3rem; line-height: 1; cursor: pointer; color: inherit; opacity: 0.6; padding: 0 2px; }
.toast-close:hover { opacity: 1; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
[data-theme="dark"] .toast { background: #1f2a3a; color: #e8eef6; }
.form-grid .form-span-2 { grid-column: 1 / -1; }
.doc-meta { display: block; font-size: 0.78rem; color: var(--text-faint); margin-top: 2px; }
.doc-review-title { display: block; }
.doc-review-earned { display: inline-block; margin: 2px 0; padding: 1px 9px; border-radius: 999px; background: rgba(61,90,128,0.12); color: #3d5a80; font-size: 0.75rem; font-weight: 600; }
[data-theme="dark"] .doc-review-earned { color: #9fc0e8; background: rgba(159,192,232,0.14); }

/* Document table action buttons (View / Remove). Needs the .btn-view block from the earlier pass. */
td.actions-cell { display: table-cell; white-space: nowrap; vertical-align: middle; }
.doc-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.doc-actions .inline-form { display: inline-flex; margin: 0; }
.doc-actions .btn-view { cursor: pointer; font-family: inherit; }
.btn-view.btn-remove { color: #a63a2f; border-color: rgba(176, 70, 60, 0.4); background: linear-gradient(to bottom, rgba(255, 255, 255, 0.75), rgba(200, 110, 100, 0.16)); }
.btn-view.btn-remove:hover, .btn-view.btn-remove:focus-visible { background: linear-gradient(to bottom, rgba(255, 255, 255, 0.9), rgba(200, 110, 100, 0.28)); border-color: rgba(176, 70, 60, 0.65); }
[data-theme="dark"] .btn-view.btn-remove { color: #f0a9a0; border-color: rgba(230, 140, 130, 0.4); background: linear-gradient(to bottom, rgba(230, 140, 130, 0.18), rgba(200, 110, 100, 0.1)); }
/* FILE: public/assets/css/app.css — PERFORMANCE ASSESSMENT WINDOW + RECORDS (add ONCE; needs .app-dialog* from the validators block) */
.section-heading-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 18px 0 8px; }
.section-heading-row .section-heading { margin: 0; }
.btn-view.btn-view-primary { color: #fff; background: linear-gradient(to bottom, #4a9a4f, var(--brand-green)); border-color: #2a6b2f; box-shadow: 0 1px 2px rgba(0,0,0,0.2); cursor: pointer; font-family: inherit; }
.btn-view.btn-view-primary:hover, .btn-view.btn-view-primary:focus-visible { background: linear-gradient(to bottom, #55a85a, #327a37); border-color: #1f5a24; }
.app-dialog-wide { width: min(780px, 96vw); }
.app-dialog-wide .app-dialog-body { max-height: 72vh; overflow-y: auto; }
.optional-mark { font-weight: 400; font-size: 0.78rem; color: var(--text-faint); }
.pa-subheading { margin: 18px 0 8px; font-size: 1rem; }
.pa-scores { display: grid; gap: 0; border: 1px solid var(--border-color); border-radius: 10px; overflow: hidden; }
.pa-score-row { display: grid; grid-template-columns: 1fr 84px; gap: 12px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--border-color-soft); }
.pa-score-row:last-child { border-bottom: 0; }
.pa-score-row:nth-child(even) { background: rgba(61, 90, 128, 0.04); }
.pa-score-row label { display: block; font-size: 0.9rem; }
.pa-indicator { display: block; font-size: 0.76rem; color: var(--text-faint); margin-top: 2px; font-weight: 400; }
.pa-score { width: 100%; text-align: center; font-size: 1.05rem; font-weight: 700; padding: 8px 4px; box-sizing: border-box; }
.pa-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 16px 0; padding: 12px 14px; border-radius: 10px; background: linear-gradient(160deg, #eaf1f9, #f6f9fc); border: 1px solid var(--border-color); }
.pa-summary > div { display: flex; flex-direction: column; gap: 2px; }
.pa-sum-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }
.pa-summary strong { font-size: 1.4rem; color: #3d5a80; line-height: 1.2; }
.pa-summary > div > span:not(.pa-sum-label) { font-size: 0.8rem; color: var(--text-muted); }
.pa-sum-note { font-size: 0.74rem !important; }
.pa-table td { vertical-align: top; }
.pv-assessment { margin: 10px 0; padding: 10px 12px; border: 1px solid var(--border-color); border-radius: 8px; background: rgba(61, 90, 128, 0.05); }
.pv-assessment summary { cursor: pointer; font-size: 0.9rem; }
.pv-assessment-table td { padding: 4px 8px; font-size: 0.85rem; }
[data-theme="dark"] .pa-summary { background: #1f2a3a; }
[data-theme="dark"] .pa-summary strong { color: #9fc0e8; }
[data-theme="dark"] .pa-score-row:nth-child(even) { background: rgba(159, 192, 232, 0.06); }
@media (max-width: 600px) {
    .app-dialog-wide { width: 100vw; max-width: 100vw; margin: 0; border-radius: 0; }
    .app-dialog-wide .app-dialog-body { max-height: calc(100vh - 130px); }
    .pa-score-row { grid-template-columns: 1fr 64px; }
    .pa-summary { grid-template-columns: 1fr; gap: 8px; }
}
/* FILE: public/assets/css/app.css — rank tabs (add ONCE; needs the .pv-tab block from the personnel view pass) */
a.pv-tab { text-decoration: none; }
.rank-sports .sport-card-count + .sport-card-count { margin-top: -4px; }
/* FILE: public/assets/css/app.css — onboarding exit X + confirmation (add ONCE, after the .onboarding-modal block) */
.onboarding-modal { position: relative; }
.onboarding-modal h1 { padding-right: 48px; }
.onboarding-exit {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #c0392b;
    color: #ffffff;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(192, 57, 43, 0.35);
}
.onboarding-exit:hover { background: #a5301f; }
.onboarding-exit:focus-visible { outline: 3px solid rgba(192, 57, 43, 0.4); outline-offset: 2px; }
.onboarding-exit-dialog { width: min(440px, 92vw); }
.onboarding-exit-dialog .app-dialog-body p { margin: 0 0 8px; }
.onboarding-exit-confirm { background: #c0392b; color: #ffffff; text-decoration: none; }
.onboarding-exit-confirm:hover { background: #a5301f; color: #ffffff; }
/* FILE: public/assets/css/app.css — age-limit highlight + score breakdown (add ONCE) */
tr.row-expired td { background: #fff6cc; }
tr.row-expired td:first-child { box-shadow: inset 4px 0 0 #e0a800; }
.expired-note { display: block; margin-top: 4px; font-size: 0.8rem; font-weight: 600; color: #8a5a00; }
.expired-note-block { margin: 8px 0; padding: 8px 12px; border-radius: 8px; background: #fff6cc; border: 1px solid #ecd27a; }
.breakdown-heading { margin: 22px 0 8px; font-size: 0.95rem; }
.breakdown-table td, .breakdown-table th { vertical-align: middle; }
[data-theme="dark"] tr.row-expired td { background: #3a3318; }
[data-theme="dark"] .expired-note { color: #f0c862; }
[data-theme="dark"] .expired-note-block { background: #3a3318; border-color: #6b5a22; }

/* ============================================================
   Mobile menu: hamburger + slide-in drawer  (append to the END of app.css)
   2026-10-19. Replaces the old horizontally scrolling nav strip on phones.
   Desktop (> 640px) is untouched: the button and drawer footer stay hidden.
   Remove the older "sidebar becomes one horizontally scrollable strip" rules
   if you like; these later rules override them either way.
   ============================================================ */

.nav-toggle-btn,
.sidebar-mobile-footer,
.nav-backdrop {
    display: none;
}

@media (max-width: 640px) {
    /* ---- Topbar: ONE tidy row ---------------------------------- */
    .app-topbar {
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        padding: 10px 12px;
    }

    .app-topbar-left {
        display: flex;
        align-items: center;
        gap: 10px;
        min-width: 0;
    }

    .nav-toggle-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        flex-shrink: 0;
        padding: 0;
        border-radius: 8px;
        border: 1px solid rgba(255, 255, 255, 0.35);
        background: rgba(255, 255, 255, 0.12);
        color: #ffffff;
        cursor: pointer;
    }

    .nav-toggle-btn:hover,
    .nav-toggle-btn:focus-visible {
        background: rgba(255, 255, 255, 0.22);
    }

    .nav-toggle-btn svg {
        width: 22px;
        height: 22px;
    }

    .app-logo-img {
        width: 34px;
        height: 34px;
    }

    .app-topbar-title {
        font-size: 1rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* "DEPED NIR —" is dropped on phones; the seal already says it. */
    .title-org {
        display: none;
    }

    .app-topbar-right {
        width: auto;
        margin-left: 0;
        flex-wrap: nowrap;
        flex-shrink: 0;
        justify-content: flex-end;
        gap: 10px;
    }

    /* Clock, the "Welcome" caption, the name and the red Log Out button leave the
       topbar; the name and Log Out live at the bottom of the drawer instead. */
    .app-clock,
    .app-welcome-label,
    .app-welcome-name,
    .app-topbar-right > .app-logout-btn {
        display: none;
    }

    .app-welcome-photo,
    .app-welcome-photo-fallback {
        width: 34px;
        height: 34px;
    }

    .theme-toggle-btn {
        width: 38px;
        height: 38px;
    }

    /* ---- Sidebar becomes a drawer ------------------------------ */
    .admin-sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 1001;
        width: min(82vw, 300px);
        max-width: 300px;
        border-right: 0;
        border-bottom: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        transform: translateX(-105%);
        visibility: hidden;
        transition: transform 0.2s ease, visibility 0s linear 0.2s;
        box-shadow: none;
    }

    .nav-open .admin-sidebar {
        transform: translateX(0);
        visibility: visible;
        transition: transform 0.2s ease, visibility 0s;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.35);
    }

    .admin-sidebar-nav {
        flex-direction: column;
        flex-wrap: nowrap;
        overflow: visible;
        gap: 4px;
        padding: 16px 10px 8px;
    }

    .admin-sidebar-nav a {
        flex: 0 0 auto;
        white-space: normal;
        padding: 13px 14px;   /* finger-sized */
        font-size: 0.92rem;
    }

    .admin-sidebar-nav::-webkit-scrollbar {
        display: block;
    }

    /* Dim the page behind the open drawer; tapping it closes the drawer. */
    .nav-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1000;
        background: rgba(0, 0, 0, 0.5);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
    }

    .nav-open .nav-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    .nav-open,
    .nav-open body {
        overflow: hidden;
    }

    /* ---- Drawer footer: who am I, My Account, Log Out ----------- */
    .sidebar-mobile-footer {
        display: flex;
        flex-direction: column;
        gap: 4px;
        margin-top: auto;
        padding: 12px 10px 18px;
        border-top: 1px solid rgba(255, 255, 255, 0.14);
    }

    .sidebar-user {
        display: flex;
        flex-direction: column;
        padding: 6px 14px 10px;
        line-height: 1.3;
    }

    .sidebar-user-label {
        font-size: 0.7rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: #f5c451;
    }

    .sidebar-user-name {
        font-size: 0.95rem;
        font-weight: 700;
        color: #ffffff;
        overflow-wrap: anywhere;
    }

    .sidebar-footer-link {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 13px 14px;
        border-radius: 8px;
        color: #cfe3d3;
        text-decoration: none;
        font-size: 0.92rem;
        font-weight: 700;
    }

    .sidebar-footer-link:hover,
    .sidebar-footer-link:focus-visible {
        background: rgba(255, 255, 255, 0.08);
        color: #ffffff;
    }

    .sidebar-footer-link .nav-icon {
        width: 18px;
        height: 18px;
        flex-shrink: 0;
    }

    .sidebar-footer-logout {
        background: #c0392b;
        color: #ffffff;
        margin-top: 6px;
        justify-content: center;
    }

    .sidebar-footer-logout:hover,
    .sidebar-footer-logout:focus-visible {
        background: #a5301f;
    }
}

/* ============================================================
   Impersonate page  (append to the END of app.css)  2026-10-19
   Aligns the three tables and gives the Show dropdown a sensible width.
   Buttons/badges reuse .btn-view and .status-badge, no new button styles.
   ============================================================ */

.imp-table {
    table-layout: fixed;
    width: 100%;
}

@media (min-width: 641px) {
    .imp-table td,
    .imp-table th {
        overflow-wrap: anywhere;
    }
}

/* Breathing room between the search row and the "Showing x of y" line. */
.search-bar + .subtitle {
    margin-top: 12px;
}

/* Same right-hand columns in all three tables so they line up. */
.imp-table .imp-col-status { width: 120px; }
.imp-table .imp-col-action { width: 180px; }

.imp-table td.col-actions {
    width: 180px;
    text-align: right;
    white-space: nowrap;
}

.imp-table .btn-view {
    cursor: pointer;
    font-family: inherit;
}

/* "Show" dropdown: narrow field next to the wide search field. */
.search-bar-field.imp-perpage {
    flex: 0 0 150px;
}

.search-bar-field.imp-perpage select {
    width: 100%;
    margin: 0;
}

@media (max-width: 640px) {
    /* Phones: each account becomes a small card (details on top, the
       Impersonate button underneath) so the button is never off-screen. */
    .imp-table,
    .imp-table tbody,
    .imp-table tr,
    .imp-table td {
        display: block;
        min-width: 0;
        width: auto;
    }

    .imp-table thead {
        display: none;
    }

    .imp-table tr {
        padding: 12px 0;
        border-bottom: 1px solid var(--border-color);
    }

    .imp-table td {
        padding: 2px 0;
        border: 0;
        overflow-wrap: anywhere;
    }

    .imp-table td:first-child {
        font-weight: 700;
    }

    .imp-table td.col-actions {
        width: auto;
        text-align: left;
        margin-top: 8px;
    }

    .search-bar-field.imp-perpage {
        flex: 0 0 120px;
    }
}