
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css');
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
    --heading-font: 'Inter', 'Segoe UI', Arial, sans-serif;
    --brand-navy: #174A8B;
    --brand-navy-dark: #123A6D;
    --brand-navy-light: #DCEBFA;
    --brand-blue: #2563EB;
    --brand-blue-light: #EFF6FF;
    --brand-green: #2563EB;
    --brand-green-dark: #1D4ED8;
    --brand-green-light: #EFF6FF;
    --brand-emerald: #3B82F6;
    --brand-gold: #1D4ED8;
    --brand-gold-light: #DBEAFE;
    --brand-rose: #E11D48;
    --brand-rose-light: #FFF1F2;
    --brand-purple: #1E40AF;
    --brand-purple-light: #EFF6FF;

    --navy: var(--brand-navy);
    --gold: var(--brand-gold);
    --gold-light: var(--brand-gold-light);
    --blue: var(--brand-blue);
    --blue-light: var(--brand-blue-light);
    --green: var(--brand-green);
    --green-dark: var(--brand-green-dark);
    --green-light: var(--brand-green-light);
    --purple: var(--brand-purple);
    --muted: var(--text-muted);
    --slate: var(--text-slate);
    --line: var(--border-subtle);
    --line-light: var(--bg-elevated);
    
    --bg-page: #F3F8FE;
    --bg-card: #FFFFFF;
    --bg-elevated: #F1F5F9;
    --text-main: #0F172A;
    --text-slate: #334155;
    --text-muted: #64748B;
    --text-light: #94A3B8;
    --border-subtle: #E2E8F0;
    --border-card: #E2E8F0;
    --border-focus: #2563EB;

    --billing-title-offset: 88px;
    --billing-toolbar-offset: calc(var(--billing-title-offset) + 70px);
    --billing-table-head-offset: calc(var(--billing-toolbar-offset) + 90px);
    --standard-button-height: 36.4px;
    --search-control-height: 40px;
    --search-control-icon-size: 16px;
    --search-control-icon-offset: 12px;
    --search-control-text-offset: 40px;
    --search-control-radius: 9px;
    --search-control-border: var(--border-subtle);
    --search-control-focus: rgba(37, 99, 235, 0.12);
    --dropdown-control-radius: var(--radius-sm);
    --dropdown-control-border: #DFE6F0;
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-pill: 9999px;
    
    --shadow-xs: 0 1px 2px 0 rgba(15, 23, 42, 0.04);
    --shadow-sm: 0 2px 4px 0 rgba(15, 23, 42, 0.05), 0 1px 2px 0 rgba(15, 23, 42, 0.03);
    --shadow-md: 0 4px 12px -2px rgba(15, 23, 42, 0.08), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 12px 24px -4px rgba(15, 23, 42, 0.1), 0 4px 8px -2px rgba(15, 23, 42, 0.05);
    --shadow-xl: 0 20px 35px -8px rgba(15, 23, 42, 0.14), 0 8px 12px -4px rgba(15, 23, 42, 0.06);
}

.insurance-relation-input-wrap > input:hover:not(:focus) {
    border-color: #93C5FD !important;
    background-color: #F8FBFF !important;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: Arial, Helvetica, sans-serif;
    color: var(--text-main);
    background: var(--bg-page);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    line-height: 1.5;
}

h1, h2, h3, h4, h5, h6,
.section-tag,
.section-tag-text,
.page-title-box,
.page-title-box *,
.full-entry-section h4,
.card-glass h2,
.card-glass h3,
.card-glass h4 {
    font-family: var(--heading-font);
}

/* TOP APPLICATION HEADER */
.app-header {
    position: static;
    top: auto;
    z-index: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem clamp(1rem, 3vw, 2.5rem);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-subtle);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
}

body.billing-page .app-header {
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    text-decoration: none;
}
.header-logo-image {
    display: block;
    width: 430px;
    height: 80px;
    object-fit: contain;
    object-position: left center;
}

.brand-emblem {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #DCEBFA 0%, #AFCDF0 100%);
    color: var(--brand-navy);
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.18);
    position: relative;
    overflow: hidden;
}
.brand-emblem::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 50%;
    background: linear-gradient(to bottom, rgba(255,255,255,0.15), transparent);
}
.brand-emblem i { font-size: 1.25rem; color: var(--brand-navy); }

.brand-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #DCEBFA 0%, #AFCDF0 100%);
    color: var(--brand-navy);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.92rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.18);
}
.header-brand > div:last-child {
    display: flex;
    flex-direction: column;
    color: var(--brand-navy);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1.2;
}
.header-brand > div:last-child span {
    margin-top: 0.16rem;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--brand-gold);
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.brand-titles {
    display: flex;
    flex-direction: column;
}
.brand-title-main {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--brand-navy);
    line-height: 1.2;
}
.brand-title-sub {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--brand-gold);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.header-right-zone {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-user-zone {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}
.user-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.35rem 0.75rem;
    background: #FFFFFF;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-pill);
    box-shadow: var(--shadow-xs);
    color: var(--text-main);
    font-size: 0.82rem;
    font-weight: 700;
}
.badge-tag {
    padding: 0.18rem 0.5rem;
    border-radius: var(--radius-pill);
    background: var(--brand-navy);
    color: #FFFFFF;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.system-status-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.3rem 0.75rem;
    border-radius: var(--radius-pill);
    background: var(--brand-green-light);
    border: 1px solid rgba(13, 148, 136, 0.2);
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--brand-green-dark);
}
.pulse-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--brand-emerald);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.user-profile-badge {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.35rem 0.85rem;
    background: #FFFFFF;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-pill);
    box-shadow: var(--shadow-xs);
}
.user-avatar-circle {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-blue), var(--brand-navy));
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 0.76rem;
}
.user-info-text {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-main);
}
.user-role-tag {
    font-size: 0.68rem;
    font-weight: 800;
    background: var(--brand-navy-light);
    color: var(--brand-navy);
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-pill);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* NAVIGATION TABS BAR */
.dash-nav-bar {
    position: relative;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: safe center;
    width: 100%;
    box-sizing: border-box;
    gap: 0.4rem;
    padding: 0.4rem;
    background: #FFFFFF;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
    overflow: visible;
}
.dash-nav-bar::-webkit-scrollbar { height: 4px; }
.dash-nav-bar::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 4px; }

.dash-nav-btn {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.6rem 1.15rem;
    border-radius: var(--radius-md);
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--text-slate);
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.18s ease;
    border: 1px solid transparent;
}
.dash-nav-btn i { font-size: 0.95rem; color: var(--text-muted); transition: color 0.18s ease; }

.dash-nav-btn:hover {
    background: var(--bg-elevated);
    color: var(--brand-navy);
}
.dash-nav-btn:hover i { color: var(--brand-navy); }

.dash-nav-btn.active {
    background: #DCEBFA;
    color: #174A8B;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.12);
    border-color: rgba(37, 99, 235, 0.18);
}
.dash-nav-btn.active i { color: #2563EB; }

.nav-dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.nav-dropdown > summary {
    list-style: none;
    cursor: pointer;
    flex: 0 0 auto;
    box-sizing: border-box;
}

.nav-dropdown > summary::-webkit-details-marker {
    display: none;
}

.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 0.4rem);
    left: 0;
    min-width: 220px;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.45rem;
    background: #FFFFFF;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(8px);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
    z-index: 30;
}

.nav-dropdown[open] .nav-dropdown-menu,
.nav-dropdown[open]:hover .nav-dropdown-menu,
.nav-dropdown[open]:focus-within .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.nav-dropdown.is-dismissed .nav-dropdown-menu {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(8px);
}

[data-admin-view][hidden],
[data-subscription-scope][hidden],
#current-admin-section[hidden] {
    display: none !important;
}

.nav-dropdown:hover > summary,
.nav-dropdown:focus-within > summary {
    background: var(--bg-elevated);
    color: var(--brand-navy);
}

.nav-dropdown-menu .dash-nav-btn {
    width: 100%;
    justify-content: flex-start;
    box-sizing: border-box;
}

@media (max-width: 1280px) {
    .dash-nav-bar {
        overflow-x: auto;
        overflow-y: visible;
        scrollbar-width: thin;
    }

    .nav-dropdown-menu {
        position: absolute;
        top: calc(100% + 0.4rem);
        left: 0;
        opacity: 1;
        visibility: visible;
        pointer-events: none;
        transform: translateY(8px);
    }

    .nav-dropdown[open] .nav-dropdown-menu,
    .nav-dropdown[open]:hover .nav-dropdown-menu,
    .nav-dropdown[open]:focus-within .nav-dropdown-menu {
        pointer-events: auto;
        transform: translateY(0);
    }
}

/* Keep agency and attorney nav dropdowns floating over the row at every width. */
@media (max-width: 1280px) {
    .dash-nav-bar {
        overflow-y: visible;
    }

    .nav-dropdown {
        flex: 0 0 auto;
        align-self: center;
    }

    .nav-dropdown[open] {
        flex-direction: row;
        align-items: center;
    }

    .nav-dropdown[open] .nav-dropdown-menu {
        position: absolute;
        top: calc(100% + 0.4rem);
        left: 0;
        transform: translateY(0);
    }
}

/* MAIN SHELL */
.main-shell {
    max-width: 1600px;
    margin: 0 auto;
    padding: 1.5rem clamp(1rem, 3vw, 2.5rem);
}

/* CARDS */
.card-glass {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-xl);
    padding: clamp(1.25rem, 2.5vw, 2.25rem);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.25s ease;
}

/* Keep the first content area compact throughout Agency and Attorney panels. */
.panel-workspace > .page-title-box { margin-bottom: 1rem !important; }
.panel-workspace > .card-glass { padding-top: 1.25rem; }
.panel-workspace .ledger-payment-toolbar:has(#payment-history-btn[style*="display:none"]),
.panel-workspace .ledger-payment-toolbar:has(#payment-history-btn[style*="display: none"]) { display: none !important; }
.card-glass:hover {
    box-shadow: var(--shadow-md);
}

#billing-page-title {
    margin-top: 0.35rem;
}

/* PAGE TITLE BOX */
.permission-update-modal#modal-candidate-stage .modal-box { width: min(94vw, 980px); max-width: 980px; border-radius: 16px; }
.permission-update-modal#modal-candidate-stage .modal-header { padding: 1rem 1.25rem; }
.permission-update-modal#modal-candidate-stage .modal-body { padding: 1.25rem; }
.permission-update-modal#modal-candidate-stage .visa-form-section { margin-top: 0; }
.permission-update-modal#modal-candidate-stage .visa-form-section h2 { font-size: 1rem; margin-bottom: 0.75rem; }
.permission-update-modal#modal-candidate-stage .form-group:has(#stage-total-demand) { max-width: 280px; }
.permission-update-modal#modal-candidate-stage .form-group label { font-size: 0.75rem; }
.permission-update-modal#modal-candidate-stage .demand-header-row { grid-template-columns: 32px repeat(3, minmax(0, 1fr)) !important; gap: 0.75rem !important; padding: 0.6rem 0.75rem !important; margin-bottom: 0.5rem !important; background: #EFF6FF; border-radius: 8px; }
.permission-update-modal#modal-candidate-stage .demand-header-row > div { font-size: 0.75rem !important; font-weight: 700 !important; }
.permission-update-modal#modal-candidate-stage .demand-list { gap: 0.45rem; }
.permission-update-modal#modal-candidate-stage .permission-demand-group { padding: 0.75rem 0.75rem !important; gap: 0.75rem; border: 1px solid #E2E8F0 !important; border-radius: 8px !important; background: #FFFFFF !important; box-shadow: none !important; }
.permission-update-modal#modal-candidate-stage .permission-demand-group .form-grid { gap: 0.75rem !important; min-width: 0; }
.permission-update-modal#modal-candidate-stage .round-demand-card { width: 32px; height: 32px; min-width: 32px; border-radius: 8px; border: 0; background: var(--brand-blue); color: #FFFFFF; box-shadow: none; font-size: 0.8rem; font-weight: 700; }
.permission-update-modal#modal-candidate-stage .permission-demand-group input { min-width: 0; height: 38px; font-size: 0.85rem; }
.permission-update-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.65rem; padding-top: 1rem; border-top: 1px solid var(--border-subtle); }
.permission-update-modal#modal-candidate-stage .modal-header { display: grid; grid-template-columns: minmax(0, 1fr) auto 32px; gap: 1rem; background: #F8FAFC; }
.permission-update-modal#modal-candidate-stage .modal-header h3 { text-align: left; color: var(--brand-navy); }
.permission-header-demand { display: flex; align-items: center; gap: 0.6rem; }
.permission-header-demand label { color: var(--brand-navy); font-size: 0.75rem; font-weight: 600; white-space: nowrap; }
.permission-header-demand input { width: 80px; height: 34px; padding: 0.4rem; text-align: center; border-radius: 6px; }
.permission-update-modal#modal-candidate-stage .demand-header-row { background: var(--brand-blue); }
.permission-update-modal#modal-candidate-stage .demand-header-row > div { color: #FFFFFF !important; text-align: center; }
@media (max-width: 600px) {
    .permission-update-modal#modal-candidate-stage .modal-header { grid-template-columns: minmax(0, 1fr) 32px; gap: 0.5rem; }
    .permission-update-modal#modal-candidate-stage .modal-header h3 { grid-column: 1; }
    .permission-update-modal#modal-candidate-stage .modal-header .modal-close-btn { grid-column: 2; grid-row: 1; }
    .permission-header-demand { grid-column: 1 / -1; justify-content: center; }
    .permission-update-modal#modal-candidate-stage .modal-body { padding: 0.75rem; }
    .permission-update-modal#modal-candidate-stage .demand-header-row { grid-template-columns: 24px repeat(3, minmax(0, 1fr)) !important; gap: 0.35rem !important; padding: 0.5rem !important; }
    .permission-update-modal#modal-candidate-stage .permission-demand-group { gap: 0.35rem; padding: 0.5rem !important; }
    .permission-update-modal#modal-candidate-stage .permission-demand-group .form-grid { gap: 0.35rem !important; }
    .permission-update-modal#modal-candidate-stage .round-demand-card { width: 24px; height: 24px; min-width: 24px; }
    .permission-update-modal#modal-candidate-stage .demand-header-row > div { font-size: 0.65rem !important; }
}
.salary-currency-field { position: relative; width: 100%; min-width: 0; }
.salary-currency-field > span { position: absolute; left: 0.7rem; top: 50%; transform: translateY(-50%); color: var(--brand-navy); font-size: 0.75rem; font-weight: 700; pointer-events: none; }
.salary-currency-field > input { width: 100%; padding-left: 2.25rem !important; }
.profession-picker { position: relative; width: 100%; min-width: 0; }
.profession-picker > input { width: 100%; padding-right: 2.5rem; }
.profession-picker-toggle { position: absolute; right: 0.35rem; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; padding: 0; border: 0; background: transparent; color: var(--brand-blue); cursor: pointer; }
.profession-picker-options { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 100; max-height: 220px; overflow-y: auto; padding: 0.3rem; border: 1px solid var(--border-subtle); border-radius: 8px; background: #FFFFFF; box-shadow: var(--shadow-sm); }
.profession-picker-options[hidden] { display: none; }
.profession-picker-options > button { display: block; width: 100%; border: 0; border-radius: 4px; padding: 0.6rem; background: #FFFFFF; color: var(--text-main); text-align: left; font: inherit; cursor: pointer; overflow-wrap: anywhere; }
.profession-picker-options > button:hover,
.profession-picker-options > button:focus-visible { background: #EFF6FF; }
.profession-picker-options > p { padding: 0.6rem; font-size: 0.75rem; color: var(--muted); }
.password-field { position: relative; width: 100%; min-width: 0; }
.password-field > input { width: 100%; padding-right: 2.75rem !important; }
.password-visibility-toggle { position: absolute; right: 0.35rem; top: 50%; transform: translateY(-50%); display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--brand-navy); cursor: pointer; }
.password-visibility-toggle:hover { background: var(--brand-blue-light); }
.password-visibility-toggle:focus-visible { outline: 2px solid var(--brand-blue); outline-offset: 1px; }
.page-title-box {
    margin-bottom: 1.75rem;
}
.main-shell > .page-title-box {
    text-align: center;
}
.main-shell > .page-title-box > h1 {
    width: 100%;
    max-width: 100%;
    text-align: center;
    overflow-wrap: anywhere;
}
.main-shell > .page-title-box > h1::after,
.embassy-list-group-title::after {
    --heading-divider-line-width: 90px;
    content: "";
    display: block;
    width: calc(2 * var(--heading-divider-line-width) + 32px);
    max-width: 100%;
    height: 12px;
    margin: 12px auto 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1' height='1'%3E%3Cpath fill='%230967E8' d='M0 0h1v1H0z'/%3E%3C/svg%3E"), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12'%3E%3Ccircle cx='6' cy='6' r='6' fill='%230967E8'/%3E%3C/svg%3E"), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1' height='1'%3E%3Cpath fill='%230967E8' d='M0 0h1v1H0z'/%3E%3C/svg%3E");
    background-size: var(--heading-divider-line-width) 2px, 12px 12px, var(--heading-divider-line-width) 2px;
    background-position: left center, center center, right center;
    background-repeat: no-repeat;
}
@media (max-width: 600px) {
    .main-shell > .page-title-box > h1::after,
.embassy-list-group-title::after {
        --heading-divider-line-width: clamp(24px, 15vw, 60px);
    }
}
.page-title-box-action {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 1rem;
}
.page-title-box-action > h1 {
    grid-column: 2;
    grid-row: 1;
}
.page-title-box-action > button {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
}
.page-title-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-pill);
    background: var(--brand-blue-light);
    color: var(--brand-blue);
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}
.page-title-box h1 {
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--brand-navy);
    letter-spacing: -0.03em;
    line-height: 1.25;
}
.page-title-box p {
    font-size: 0.92rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
}

.embassy-page-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 1rem;
}
.embassy-page-heading h1 {
    margin: 0;
}
.embassy-page-heading > h1 {
    grid-column: 2;
    grid-row: 1;
}
.embassy-page-heading > form {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
}
.embassy-date-filter-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-left: auto;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}
.embassy-date-filter-toolbar .entry-file-search-field {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex: 0 1 360px;
    margin: 0;
}
.embassy-date-filter-toolbar label {
    margin: 0;
    color: var(--brand-navy);
    font-size: 0.78rem;
    font-weight: 800;
    white-space: nowrap;
}
.embassy-date-filter-toolbar .entry-file-search-input-wrap {
    position: relative;
    width: 150px;
    min-width: 0;
}
.embassy-date-filter-toolbar .entry-file-search-input-wrap > i {
    position: absolute;
    left: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    color: #7A8CA7;
    font-size: 0.74rem;
    pointer-events: none;
}
.embassy-date-filter-toolbar .entry-file-search-input-wrap > input {
    display: block;
    width: 100%;
    min-width: 0;
    height: 34px;
    box-sizing: border-box;
    padding: 0.35rem 0.55rem 0.35rem 1.9rem;
    border: 1px solid #D9E7F7;
    border-radius: 8px;
    outline: none;
    background: #FFFFFF !important;
    color: var(--text-main);
    font: inherit;
    font-size: 0.86rem;
    box-shadow: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
    color-scheme: light;
    -webkit-appearance: none;
    appearance: none;
}
.embassy-date-filter-toolbar .entry-file-search-input-wrap > input:hover {
    border-color: #CFE1F5;
    background: #FFFFFF;
}
.embassy-date-filter-toolbar .entry-file-search-input-wrap > input:focus {
    border-color: #D9E7F7;
    outline: none;
    box-shadow: none;
    background: #FFFFFF !important;
}
.embassy-date-filter-toolbar .entry-file-search-input-wrap > input::-webkit-calendar-picker-indicator {
    opacity: 0.8;
    background-color: transparent;
    cursor: pointer;
}

/* SECTION HEADERS IN FORMS */
.section-tag {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin: 1.75rem 0 1rem 0;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--brand-navy);
    font-size: 1.12rem;
    font-weight: 800;
    line-height: 1.3;
}
.section-tag:first-of-type { margin-top: 0; }
.section-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-blue), var(--brand-navy));
    color: #fff;
    font-size: 0.75rem;
    font-weight: 800;
}
.section-tag-text {
    font-size: 1.02rem;
    font-weight: 800;
    color: var(--brand-navy);
    letter-spacing: -0.01em;
}

/* FORM GRIDS & INPUT CONTROLS */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
}
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.form-group label {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-slate);
    display: flex;
    align-items: center;
    gap: 0.45rem;
}
.form-group label i {
    font-size: 0.85rem;
    color: var(--text-muted);
}
.entry-remarks-input {
    height: 44px;
    min-height: 44px;
    resize: none;
    overflow-y: auto;
}

.input-icon-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}
.input-icon-wrapper i.field-icon {
    position: absolute;
    left: 1rem;
    font-size: 0.95rem;
    color: var(--text-light);
    pointer-events: none;
    transition: color 0.18s ease;
}

.input-icon-wrapper input,
.input-icon-wrapper select,
.input-icon-wrapper textarea,
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-main);
    background: #FFFFFF;
    border: 1.5px solid var(--border-subtle);
    border-radius: var(--radius-md);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-xs);
}
/* ── SELECT / DROPDOWN PREMIUM STYLING ─────────────────────── */
.input-icon-wrapper select,
.form-group select,
select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 100%;
    background-color: #FFFFFF;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232563EB' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.9rem center;
    background-size: 1rem;
    padding-right: 2.75rem;
    cursor: pointer;
}
.input-icon-wrapper select:hover,
.form-group select:hover,
select:hover {
    border-color: #93C5FD;
    background-color: #F8FBFF;
}
.input-icon-wrapper select:focus,
.form-group select:focus,
select:focus {
    outline: none;
    border-color: var(--brand-blue);
    background-color: #FFFFFF;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}
select option {
    font-family: inherit;
    font-weight: 500;
    background: #FFFFFF;
    color: var(--text-main);
}
select option[value=""] {
    color: var(--text-light);
}
.input-icon-wrapper input,
.input-icon-wrapper select {
    padding-left: 2.6rem;
}

.input-icon-wrapper input:focus,
.input-icon-wrapper select:focus,
.input-icon-wrapper textarea:focus,
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
    background: #FFFFFF;
}
.input-icon-wrapper input:focus + i.field-icon,
.input-icon-wrapper:focus-within i.field-icon {
    color: var(--brand-blue);
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-subtle);
}

/* BUTTONS */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #4B8FE8 0%, #2563EB 100%);
    color: #FFFFFF;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 700;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(9, 30, 58, 0.2);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(9, 30, 58, 0.28);
    background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
}
.btn-primary.btn-green {
    background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
}
.btn-primary.btn-green:hover {
    background: linear-gradient(135deg, #1D4ED8 0%, #1E40AF 100%);
    box-shadow: 0 6px 14px rgba(37, 99, 235, 0.35);
}
.btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.2rem;
    background: #FFFFFF;
    color: var(--text-slate);
    font-family: inherit;
    font-size: 0.84rem;
    font-weight: 700;
    border: 1.5px solid var(--border-subtle);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.18s ease;
    text-decoration: none;
}
.btn-outline:hover {
    background: var(--bg-elevated);
    border-color: #CBD5E1;
    color: var(--text-main);
}

.btn-sm {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    font-size: 0.76rem;
    font-weight: 700;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
}
.btn-sm-extend {
    background: var(--brand-gold-light);
    color: #92400E;
    border: 1px solid rgba(217, 119, 6, 0.25);
}
.btn-sm-extend:hover { background: #FDE68A; }
.btn-sm-view {
    background: var(--brand-blue-light);
    color: var(--brand-blue);
    border: 1px solid rgba(37, 99, 235, 0.25);
}
.btn-sm-view:hover { background: #DBEAFE; }
.btn-sm-danger {
    background: var(--brand-rose-light);
    color: var(--brand-rose);
    border: 1px solid rgba(225, 29, 72, 0.25);
}
.btn-sm-danger:hover { background: #FFE4E6; }
.action-dropdown { position: relative; display: inline-block; text-align: left; }
.action-dropdown-trigger { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.45rem 0.7rem; border: 1px solid #CFE0F4; border-radius: var(--radius-sm); background: #FFFFFF; color: var(--brand-navy); font: inherit; font-size: 0.74rem; font-weight: 800; cursor: pointer; }
.action-dropdown-trigger:hover, .action-dropdown.is-open .action-dropdown-trigger { border-color: var(--brand-blue); color: var(--brand-blue); background: #F8FBFF; }
.action-dropdown-menu { position: absolute; right: 0; top: calc(100% + 0.35rem); z-index: 30; min-width: 180px; padding: 0.3rem; border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); background: #FFFFFF; box-shadow: var(--shadow-md); display: none; }
.action-dropdown.is-open .action-dropdown-menu { display: grid; gap: 0.15rem; }
.action-dropdown-menu button { display: flex; align-items: center; gap: 0.5rem; width: 100%; padding: 0.6rem 0.7rem; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text-slate); font: inherit; font-size: 0.8rem; text-align: left; cursor: pointer; }
.action-dropdown-menu button:hover { background: #EFF6FF; color: var(--brand-blue); }
.action-dropdown-menu a { display: flex; align-items: center; gap: 0.5rem; width: 100%; padding: 0.6rem 0.7rem; border-radius: var(--radius-sm); color: var(--text-slate); font-size: 0.8rem; text-decoration: none; }
.action-dropdown-menu a:hover { background: #EFF6FF; color: var(--brand-blue); }
.action-dropdown-menu button.action-danger { color: var(--brand-rose); }
.action-dropdown-menu button.action-danger:hover { background: #FFF1F2; }
.ledger-archived-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.35rem; }
.ledger-archived-actions button { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.45rem 0.6rem; border: 1px solid #CFE0F4; border-radius: var(--radius-sm); background: #FFFFFF; color: var(--brand-navy); font: inherit; font-size: 0.74rem; font-weight: 700; cursor: pointer; }
.ledger-archived-actions button:hover { border-color: var(--brand-blue); color: var(--brand-blue); background: #F8FBFF; }

.billing-delete-btn {
    border: 0;
    background: #D11A2A;
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 1.55rem;
    line-height: 1;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0 auto;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.7);
    text-align: center;
    vertical-align: middle;
    transform: translateY(0);
}

.billing-delete-btn:hover {
    background: #B71322;
    transform: translateY(-1px);
}

.billing-delete-btn:before {
    content: "×";
    display: block;
    transform: translateY(-1px);
}
.embassy-list-table { width: 100%; table-layout: fixed; font-size: 0.55rem; font-weight: 400; }
.embassy-list-table th, .embassy-list-table td { text-align: left; }
.embassy-list-table th { font-size: 0.72rem; font-weight: 800; padding: 0.55rem 0.35rem !important; white-space: normal; overflow-wrap: normal; word-break: normal; line-height: 1.25; }
.embassy-list-table td { padding: 0.26rem 0.3rem !important; overflow-wrap: anywhere; font-size: 12px; font-weight: 400; }
.embassy-list-table:not([data-column-controls]) .embassy-col-check { width: 3%; }
.embassy-list-table:not([data-column-controls]) .embassy-col-submit-date { width: 12%; }
.embassy-list-table:not([data-column-controls]) .embassy-col-visa-no { width: 9%; }
.embassy-list-table:not([data-column-controls]) .embassy-col-id-no { width: 9%; }
.embassy-list-table:not([data-column-controls]) .embassy-col-passport-no { width: 10%; }
.embassy-list-table:not([data-column-controls]) .embassy-col-e-no { width: 8%; }
.embassy-list-table:not([data-column-controls]) .embassy-col-profession { width: 10%; }
.embassy-list-table:not([data-column-controls]) .embassy-col-sponsor { width: 9%; }
.embassy-list-table:not([data-column-controls]) .embassy-col-urdu { width: 8%; }
.embassy-list-table:not([data-column-controls]) .embassy-col-agency { width: 7%; }
.embassy-list-table:not([data-column-controls]) .embassy-col-remarks { width: 7%; }
.embassy-list-table:not([data-column-controls]) .embassy-col-action { width: 8%; }
.embassy-list-table th:last-child, .embassy-list-table td:last-child { white-space: nowrap; }
.embassy-list-table td:last-child .action-dropdown, .embassy-list-table .action-dropdown-trigger { width: 100%; box-sizing: border-box; }
.embassy-list-table td:nth-child(2) { white-space: nowrap; }
.embassy-list-table .action-dropdown-trigger { min-width: 0; justify-content: center; padding: 0.35rem 0.4rem; font-size: 0.68rem; font-weight: 800; white-space: nowrap; }
.embassy-list-table .embassy-remarks-cell { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 400; }
.embassy-list-table tr.embassy-row-issued > td { background: #DCFCE7 !important; color: #166534; }
.embassy-list-table tr.embassy-row-objection > td { background: #FEE2E2 !important; color: #991B1B; }
.embassy-list-table tr.embassy-row-issued .embassy-remarks-cell,
.embassy-list-table tr.embassy-row-objection .embassy-remarks-cell { color: inherit; }
.embassy-status-button { width: 100%; padding: 0.35rem 0.4rem; border: 1px solid currentColor; border-radius: var(--radius-sm); background: rgba(255, 255, 255, 0.72); font: inherit; font-size: 0.68rem; font-weight: 800; cursor: default; }
.embassy-status-button.embassy-status-issued { color: #15803D; }
.embassy-status-button.embassy-status-objection { color: #DC2626; }

.action-menu { position: relative; display: inline-block; text-align: left; }
.action-menu-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-width: 106px;
    padding: 0.58rem 0.9rem;
    border: 1px solid #D9E5F6;
    border-radius: 10px;
    background: linear-gradient(180deg, #FFFFFF 0%, #F4F8FF 100%);
    color: var(--brand-navy);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.9), 0 2px 8px rgba(27, 54, 93, 0.06);
    transition: all 0.16s ease;
}
.action-menu-trigger:hover {
    border-color: #C7D9F4;
    background: linear-gradient(180deg, #F9FBFF 0%, #EEF5FF 100%);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.98), 0 4px 12px rgba(27, 54, 93, 0.1);
}
.action-menu-trigger i {
    font-size: 0.7rem;
    color: var(--text-slate);
    transition: transform 0.15s ease;
}
.action-menu.is-open .action-menu-trigger {
    border-color: #B7CCEC;
    background: linear-gradient(180deg, #F3F9FF 0%, #EAF3FF 100%);
}
.action-menu.is-open .action-menu-trigger i {
    transform: rotate(180deg);
}
.action-menu-list {
    position: absolute;
    top: calc(100% + 0.4rem);
    right: 0;
    z-index: 20;
    display: grid;
    min-width: 188px;
    padding: 0.38rem;
    background: #FFFFFF;
    border: 1px solid #DCE7F4;
    border-radius: 12px;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.14), 0 4px 12px rgba(37, 99, 235, 0.08);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-5px);
    transition: all 0.16s ease;
}
.action-menu.is-open .action-menu-list { opacity: 1; visibility: visible; transform: translateY(0); }
.action-menu-list button {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    padding: 0.68rem 0.75rem;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--text-slate);
    font-family: inherit;
    font-size: 0.76rem;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.action-menu-list button i { width: 1rem; color: var(--brand-blue); text-align: center; }
.action-menu-list button:hover { background: var(--brand-blue-light); color: var(--brand-navy); transform: translateX(1px); }
.action-menu-list button.action-menu-danger { color: var(--brand-rose); }
.action-menu-list button.action-menu-danger i { color: var(--brand-rose); }
.action-menu-list button.action-menu-danger:hover { background: var(--brand-rose-light); color: var(--brand-rose); }
.payment-action-menu .action-menu-list { min-width: 190px; }
.payment-processed-label {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.6rem 0.7rem;
    color: var(--text-muted);
    font-size: 0.76rem;
    font-weight: 700;
}
.payment-processed-label i { color: var(--brand-green); }
.protector-status-date { margin-top: 0.35rem; color: var(--muted); font-size: 0.72rem; font-weight: 400; }
.protector-list-table:not([data-column-controls]) th:nth-child(4),
.protector-list-table:not([data-column-controls]) td:nth-child(4) { min-width: 155px; }
.permission-list-table {
    table-layout: fixed;
}
.permission-list-table th,
.permission-list-table td {
    font-size: 0.78rem;
}
.custom-table.permission-list-table th:nth-child(3),
.custom-table.permission-list-table th:nth-child(4),
.custom-table.permission-list-table th:nth-child(5) {
    font-size: 0.62rem;
    letter-spacing: -0.02em;
}
.permission-list-table:not([data-column-controls]) th:nth-child(1), .permission-list-table:not([data-column-controls]) td:nth-child(1) {
    width: 185px;
    max-width: 185px;
    min-width: 185px;
}
.permission-list-table:not([data-column-controls]) th:nth-child(2), .permission-list-table:not([data-column-controls]) td:nth-child(2) {
    width: 170px;
    max-width: 170px;
    min-width: 170px;
}
.permission-list-table:not([data-column-controls]) th:nth-child(3), .permission-list-table:not([data-column-controls]) td:nth-child(3) {
    width: 200px;
    max-width: 200px;
    min-width: 200px;
}
.permission-list-table:not([data-column-controls]) th:nth-child(4), .permission-list-table:not([data-column-controls]) td:nth-child(4) {
    width: 100px;
    max-width: 100px;
    min-width: 100px;
    white-space: normal;
    padding-left: 0.45rem;
    padding-right: 0.45rem;
    padding-top: 0.55rem;
    padding-bottom: 0.55rem;
    line-height: 1.2;
}
.permission-list-table:not([data-column-controls]) th:nth-child(5), .permission-list-table:not([data-column-controls]) td:nth-child(5) {
    width: 95px;
    max-width: 95px;
    min-width: 95px;
}
.permission-list-table:not([data-column-controls]) th:nth-child(6), .permission-list-table:not([data-column-controls]) td:nth-child(6) {
    width: 110px;
    max-width: 110px;
    min-width: 110px;
    font-size: 0.72rem;
}
.permission-list-table:not([data-column-controls]) td:nth-child(6) .status-pill {
    font-size: 0.68rem;
    padding: 0.22rem 0.55rem;
    line-height: 1.1;
}
.permission-list-table:not([data-column-controls]) td:nth-child(6) div:last-child {
    font-size: 0.62rem;
    line-height: 1.15;
}
.permission-list-table:not([data-column-controls]) th:nth-child(7), .permission-list-table:not([data-column-controls]) td:nth-child(7) {
    width: 145px;
    max-width: 145px;
    min-width: 145px;
}
.permission-list-table:not([data-column-controls]) th:nth-child(8), .permission-list-table:not([data-column-controls]) td:nth-child(8) {
    width: 120px;
    max-width: 120px;
    min-width: 120px;
    text-align: right;
}
.protector-list-table td { font-size: 0.82rem; }
.protector-list-table td strong { color: var(--text-main); font-weight: 700; }
.protector-list-table td > div { line-height: 1.35; }
.protector-list-table .status-pill { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.02em; white-space: nowrap; }
.protector-list-table .protector-status-date { font-size: 0.72rem; white-space: nowrap; }
.protector-remarks-modal-box { max-width: 500px; }
.protector-remarks-modal-box textarea { min-height: 130px; resize: vertical; line-height: 1.5; }
.agent-access-editor { margin-top: 1rem; padding: 0.85rem; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); background: #F8FBFF; }
.agent-access-editor > strong { display: block; margin-bottom: 0.65rem; color: var(--brand-navy); font-size: 0.82rem; }
.agent-access-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; }
.agent-access-grid label { display: flex; align-items: center; gap: 0.4rem; color: var(--text-slate); font-size: 0.76rem; font-weight: 600; }
.candidate-list-table th { position: relative; }
.candidate-list-table th.candidate-column-draggable { cursor: grab; }
.candidate-list-table th.candidate-column-dragging { opacity: 0.45; cursor: grabbing; }
.candidate-list-table th.candidate-column-drop-target { box-shadow: inset 0 0 0 2px #bfdbfe; }
.candidate-list-table th,
.candidate-list-table td { overflow-wrap: anywhere; }
.candidate-list-table th:first-child,
.candidate-list-table td:first-child {
    width: 52px;
    min-width: 52px;
    max-width: 52px;
    white-space: nowrap;
    text-align: center;
    position: sticky;
    left: 0;
    z-index: 2;
    background: #FFFFFF;
    box-shadow: 1px 0 0 rgba(148, 163, 184, 0.25);
}
.candidate-list-table th:first-child {
    font-size: 0.8rem;
    background: var(--brand-blue);
    border-radius: 10px 0 0 10px;
}
.candidate-list-table th:last-child,
.candidate-list-table td:last-child { width: 100px; min-width: 100px; max-width: 100px; white-space: nowrap; position: sticky; right: 0; z-index: 2; background: #FFFFFF; box-shadow: -1px 0 0 rgba(148, 163, 184, 0.25); }
.candidate-list-table th:last-child { background: var(--brand-blue); border-radius: 0 10px 10px 0; }
.candidate-list-table td:last-child { overflow: visible; text-align: center; }
.candidate-list-table td:last-child .action-dropdown { position: relative; display: block; width: 100%; max-width: 100%; overflow: visible; }
.candidate-list-table td:last-child .action-dropdown-trigger { width: 100%; max-width: 100%; justify-content: center; box-sizing: border-box; }
.candidate-list-table td:last-child .action-dropdown-menu { left: auto !important; right: auto !important; top: auto !important; transform: none !important; }
.candidate-list-table td:nth-child(5) .status-pill { white-space: nowrap; font-size: 0.72rem; letter-spacing: 0; }
.candidate-table-container { width: 100%; max-width: 100%; min-width: 0; overflow-x: auto; }
.candidate-toolbar-actions [hidden], #candidate-import-preview[hidden] { display: none !important; }
.list-table-scroll-container { width: 100%; max-width: 100%; min-width: 0; overflow-x: auto; }
.list-table-controls { display: flex; justify-content: flex-end; margin-bottom: 0.5rem; }
.list-table-controls[hidden] { display: none; }
.listing-resizable-header { position: relative; }
.listing-column-resizer { position: absolute; z-index: 1; top: 0; right: -5px; bottom: 0; width: 11px; padding: 0; border: 0; background: transparent; cursor: col-resize; touch-action: none; }
.listing-column-resizer::after { position: absolute; top: 25%; bottom: 25%; left: 5px; width: 2px; border-radius: 2px; background: #fff; content: ""; opacity: 0.85; }
.listing-column-resizer:hover::after,
.listing-column-resizer:focus-visible::after { background: #fff; opacity: 1; }
.listing-column-resizer:focus-visible { outline: 2px solid #2563eb; outline-offset: -2px; }
.listing-serial-column,
td[data-list-serial] { width: 58px; min-width: 58px; text-align: center; white-space: nowrap; }
.listing-serial-column { font-size: 0.72rem; }
body.listing-resizing-columns { cursor: col-resize; user-select: none; }
.candidate-column-resizer { position: absolute; z-index: 1; top: 0; right: -5px; bottom: 0; width: 11px; padding: 0; border: 0; background: transparent; cursor: col-resize; touch-action: none; }
.candidate-column-resizer::after { position: absolute; top: 25%; bottom: 25%; left: 5px; width: 2px; border-radius: 2px; background: #fff; content: ""; opacity: 0.85; }
.candidate-column-resizer:hover::after,
.candidate-column-resizer:focus-visible::after { background: #fff; opacity: 1; }
.candidate-column-resizer:focus-visible { outline: 2px solid #2563eb; outline-offset: -2px; }
body.candidate-resizing-columns { cursor: col-resize; user-select: none; }
.candidate-toolbar { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.25rem; }
.candidate-search-group { display: flex; flex: 1; min-width: 0; align-items: center; gap: 0.75rem; }
.candidate-search-group h2 { flex: 0 0 auto; white-space: nowrap; }
.candidate-search-field { position: relative; display: block; flex: 1; min-width: 160px; }
.candidate-search-field > i { position: absolute; top: 50%; left: var(--search-control-icon-offset); display: grid; width: var(--search-control-icon-size); height: var(--search-control-icon-size); place-items: center; color: var(--text-muted); font-size: var(--search-control-icon-size); transform: translateY(-50%); pointer-events: none; }
.candidate-search-field input { width: 100%; min-width: 0; }
.search-section-heading {
    font-family: Arial, sans-serif;
    font-size: 16px;
    font-weight: 600;
    line-height: 22px;
    color: #164C91;
    letter-spacing: 0;
    margin: 0;
    flex-shrink: 0;
}
.candidate-search-field input:focus { border-color: var(--brand-blue); outline: none; box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12); }
.candidate-toolbar-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 0.75rem; }
.visa-list-table td { font-size: 0.82rem; }
.visa-list-table td strong { color: var(--text-main); font-weight: 700; }
.visa-list-table td > div { line-height: 1.35; }
.visa-list-table td:nth-child(4) { min-width: 130px; }
.visa-list-table td:nth-child(4) .status-pill { white-space: nowrap; font-size: 0.72rem; letter-spacing: 0; }
.incomplete-entry-field label { color: var(--brand-blue); }
.incomplete-entry-field input,
.incomplete-entry-field select,
.incomplete-entry-field textarea { border-color: #93C5FD; background: #F8FBFF; }

/* DATA TABLES */
.custom-table-container {
    overflow: visible;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    background: #FFFFFF;
    box-shadow: var(--shadow-xs);
}
.custom-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    text-align: left;
}
.custom-table th { user-select: none; }
.ledger-popup-billing-table {
    table-layout: auto;
    font-size: 14px;
    font-weight: 350;
}
.ledger-popup-billing-table th,
.ledger-popup-billing-table td {
    padding: 0.42rem 0.2rem;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 14px;
    font-weight: 350;
}
.ledger-popup-billing-table th { font-size: 0.66rem; font-weight: 800; }
.ledger-popup-billing-table th:nth-child(1),
.ledger-popup-billing-table td:nth-child(1) { width: 3%; }
.ledger-popup-billing-table th:nth-child(2),
.ledger-popup-billing-table td:nth-child(2) { width: 9%; white-space: nowrap; }
.ledger-popup-billing-table th:nth-child(3),
.ledger-popup-billing-table td:nth-child(3) { width: 12%; }
.ledger-popup-billing-table th:nth-child(4),
.ledger-popup-billing-table td:nth-child(4) { width: 11%; }
.ledger-popup-billing-table th:nth-child(5),
.ledger-popup-billing-table td:nth-child(5) { width: 9%; }
.ledger-popup-billing-table th:nth-child(6),
.ledger-popup-billing-table td:nth-child(6) { width: 9%; }
.ledger-popup-billing-table th:nth-child(7),
.ledger-popup-billing-table td:nth-child(7) { width: 7%; }
.ledger-popup-billing-table th:nth-child(8),
.ledger-popup-billing-table td:nth-child(8) { width: 13%; }
.ledger-popup-billing-table th:nth-child(9),
.ledger-popup-billing-table td:nth-child(9) { width: 10%; }
.ledger-popup-billing-table th:nth-child(10),
.ledger-popup-billing-table td:nth-child(10) { width: 10%; white-space: nowrap; }
.ledger-popup-billing-table th:nth-child(11),
.ledger-popup-billing-table td:nth-child(11) { width: 12%; white-space: nowrap; }
.ledger-popup-billing-table th:nth-child(12),
.ledger-popup-billing-table td:nth-child(12) { width: 5%; }
.ledger-popup-billing-table .billing-description-input { width: 100% !important; min-width: 0; }
.ledger-popup-billing-table .billing-debit-input { width: 90px !important; min-width: 0; }
.ledger-popup-billing-table td:nth-child(9),
.billing-page-table td:nth-child(9) { color: #DC2626; }
.ledger-popup-billing-table .billing-debit-input,
.billing-page-table .billing-debit-input {
    color: #DC2626 !important;
    font-weight: 400 !important;
}
.ledger-popup-billing-table td:nth-child(10),
.billing-page-table td:nth-child(10) { color: #16A34A; }
.ledger-popup-billing-table td:nth-child(11),
.billing-page-table td:nth-child(11) { color: #DC2626; }
.billing-page-table td.billing-running-balance {
    color: #111827 !important;
    font-weight: 400;
}
.billing-page-table td.billing-running-balance.is-final {
    font-weight: 800;
}
#billing-total-debit,
#modal-ledger-debit { color: #DC2626 !important; }
#billing-total-credit,
#modal-ledger-credit { color: #16A34A !important; }
#billing-total-balance,
#modal-ledger-balance { color: #DC2626 !important; }
.billing-page-table th:nth-child(2),
.billing-page-table td:nth-child(2) { width: 105px; white-space: nowrap; }
.custom-table thead tr {
    background: transparent;
}
.custom-table th {
    height: 40px;
    padding: 0.45rem 0.75rem;
    font-family: var(--heading-font);
    font-size: 0.8rem;
    font-weight: 800;
    color: #FFFFFF;
    background: var(--brand-blue);
    line-height: 1.2;
    vertical-align: middle;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: none;
    letter-spacing: 0.01em;
}
.custom-table th:first-child {
    border-radius: 10px 0 0 10px;
}
.custom-table th:last-child {
    border-radius: 0 10px 10px 0;
}

.billing-page-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 1rem;
    margin: 0 0 1.1rem;
}
.billing-page-header > .btn-primary {
    justify-self: end;
    white-space: nowrap;
}
.billing-page-identity {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
}
.billing-page-identity > .btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 42px;
    padding: 0.6rem 0.9rem;
    border-color: #d8e2ef;
    border-radius: 10px;
    color: var(--navy);
    font-weight: 700;
    white-space: nowrap;
}
.billing-agent-name {
    display: flex;
    justify-content: center;
    align-items: baseline;
    flex-wrap: wrap;
    column-gap: 0.55rem;
    row-gap: 0.1rem;
    min-width: 0;
    text-align: center;
}
.billing-agent-name > span {
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.055em;
    text-transform: uppercase;
}
.billing-agent-name > h1,
.billing-agent-name > h2 {
    overflow-wrap: anywhere;
    margin: 0;
    color: #172b4d;
    font-size: clamp(1.3rem, 2.2vw, 1.75rem);
    font-weight: 800;
    line-height: 1.2;
}
.billing-page-header > .btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 42px;
    padding: 0.65rem 1rem;
    border-radius: 10px;
    font-weight: 750;
}

body.billing-page .billing-sticky-header > .billing-page-header {
    position: static;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(8px);
    padding: 0.35rem 0 0.65rem;
    margin: 0 0 0.75rem;
    border-bottom: 1px solid rgba(23, 74, 139, 0.1);
    box-shadow: none;
}

@media (max-width: 600px) {
    .billing-page-header {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
    }
    .billing-page-back { grid-column: 1; grid-row: 2; }
    .billing-agent-name { grid-column: 1 / -1; grid-row: 1; }
    .billing-page-identity > .btn-outline { padding: 0.55rem 0.7rem; font-size: 0.78rem; }
    .billing-page-header > .btn-primary { grid-column: 2; grid-row: 2; width: auto; }
}

body.billing-page .card-glass {
    --billing-table-header-top: 300px;
}

body.billing-page .card-glass > .billing-sticky-header {
    position: sticky;
    top: 104px;
    z-index: 30;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(8px);
    padding: 0 0 0.35rem;
    margin: 0 0 0.12rem;
    border-bottom: 1px solid rgba(23, 74, 139, 0.08);
    box-shadow: 0 12px 20px -18px rgba(15, 23, 42, 0.24);
}

body.billing-page .card-glass > .billing-sticky-header > * {
    background: transparent;
}

body.billing-page .card-glass .billing-sticky-toolbar {
    position: static;
    z-index: auto;
    padding: 0.45rem 0.9rem 0.05rem;
    margin: 0;
    border: 1px solid #D7E9F8;
    border-top: 0;
    border-bottom: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

body.billing-page .card-glass .billing-sticky-toolbar .btn-primary {
    white-space: nowrap;
}

body.billing-page .card-glass .custom-table thead th {
    position: sticky;
    top: var(--billing-table-header-top);
    z-index: 5;
    background: var(--brand-blue);
}

.custom-table-container {
    position: relative;
    z-index: 1;
    margin-top: -1px;
    border-top: 0;
    border-radius: 0 0 12px 12px;
}

.custom-table-container .custom-table {
    border-top: 0;
}

.table-sort-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-transform: inherit;
    letter-spacing: inherit;
    cursor: pointer;
}
.table-sort-btn i { color: var(--brand-blue); font-size: 0.72rem; }
.table-sort-btn:hover { color: var(--brand-blue); }

.ui-dropdown { position: relative; width: 100%; }
.ui-dropdown-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 44px;
    padding: 0.75rem 1rem;
    border: 1.5px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: #FFFFFF;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    box-shadow: var(--shadow-xs);
    transition: all 0.18s ease;
}
.ui-dropdown-trigger:hover,
.ui-dropdown.is-open .ui-dropdown-trigger { border-color: var(--brand-blue); background: #F8FBFF; box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1); }
.ui-dropdown-trigger i { color: var(--brand-blue); font-size: 0.75rem; transition: transform 0.18s ease; }
.ui-dropdown.is-open .ui-dropdown-trigger i { transform: rotate(180deg); }
.ui-dropdown-menu {
    position: absolute;
    top: calc(100% + 0.35rem);
    right: 0;
    left: 0;
    z-index: 40;
    display: grid;
    gap: 0.2rem;
    max-height: 220px;
    overflow-y: auto;
    padding: 0.35rem;
    border: 1px solid #CFE0F4;
    border-radius: var(--radius-md);
    background: #FFFFFF;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-5px);
    transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
}
.ui-dropdown.is-open .ui-dropdown-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.ui-dropdown-option {
    padding: 0.65rem 0.75rem;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-slate);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
}
.ui-dropdown-option:hover { background: var(--brand-blue-light); color: var(--brand-blue); }
.ui-dropdown-option.is-placeholder { color: var(--text-muted); cursor: default; }

#billing-credit-amount {
    appearance: textfield;
    -moz-appearance: textfield;
    -webkit-appearance: none;
    text-align: left;
}
#billing-credit-amount::-webkit-outer-spin-button,
#billing-credit-amount::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.visa-form-section {
    margin-top: 1.5rem;
    padding: 1.15rem;
    border: 1px solid #D5E4F5;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, #FBFDFF, #F4F9FF);
}
.visa-form-section:first-of-type { margin-top: 0; }
.visa-form-section h2,
.visa-picture-panel h2 {
    margin-bottom: 1rem;
    color: var(--brand-navy);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 1.12rem;
    font-weight: 800;
}
.agent-field-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}
.picker-default-check {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.3rem;
    color: var(--text-muted);
    font-size: 0.68rem;
    font-weight: 700;
    cursor: pointer;
}
.picker-default-check input {
    width: 13px;
    height: 13px;
    accent-color: var(--brand-blue);
}
.add-agent-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.45rem;
    border: 1px solid #BFD5EE;
    border-radius: 5px;
    background: #FFFFFF;
    color: var(--brand-blue);
    font-size: 0.65rem;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    font-family: inherit;
}
.add-agent-link:hover { background: var(--brand-blue-light); }
.visa-form-section .add-agent-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    height: 28px !important;
    min-height: 28px !important;
    max-height: 28px !important;
    padding: 0 0.55rem !important;
    border: 1px solid #CFE0F4;
    border-radius: 6px;
    background: #FFFFFF;
    color: var(--brand-navy);
    font-size: 0.68rem;
    font-weight: 600;
    line-height: 1;
    box-shadow: none;
    white-space: nowrap;
}
.visa-form-section .add-agent-link i { font-size: 0.65rem; color: var(--brand-blue); }
.visa-form-section .add-agent-link:hover { background: #EFF6FF; border-color: #0967E8; }
.visa-form-section .add-agent-link:focus-visible { outline: 2px solid #0967E8; outline-offset: 2px; }
.case-details-section h2 {
    display: inline-block;
    margin-bottom: 1rem;
    padding-bottom: 0.25rem;
    border-bottom: 3px solid var(--brand-blue);
}
.passenger-details-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 225px;
    align-items: stretch;
    gap: 1.5rem;
    margin-top: 1.5rem;
}
.passenger-details-layout .visa-form-section { margin-top: 0; }
.attorney-case-remarks-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 1.5rem;
    margin-top: 1.5rem;
    align-items: stretch;
}
.attorney-case-remarks-layout > .visa-form-section { margin-top: 0; min-width: 0; }
.attorney-case-remarks-layout .case-details-section > .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (max-width: 1099px) {
    .attorney-case-remarks-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
    .attorney-case-remarks-layout .case-details-section > .form-grid { grid-template-columns: minmax(0, 1fr); }
}
.passenger-picture-side {
    width: auto;
    min-width: 0;
    margin-top: 0;
}
.passenger-picture-side h2 { white-space: nowrap; }
.passenger-picture-side .visa-picture-upload,
.passenger-picture-side #visa-picture-preview {
    width: 150px;
    height: 150px;
}
.date-entry {
    position: relative;
    display: flex;
    align-items: center;
}
.date-entry [data-date-entry] {
    width: 100%;
    padding-right: 2.5rem;
}
.date-picker-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}
.date-picker-button {
    position: absolute;
    right: 0.55rem;
    display: grid;
    place-items: center;
    width: 1.6rem;
    height: 1.6rem;
    border: 0;
    background: transparent;
    color: var(--brand-navy);
    cursor: pointer;
}
.date-picker-button:hover { color: var(--brand-blue); }
.optional-label {
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 600;
}
.passenger-picture-field {
    grid-column: span 2;
}
@media (min-width: 1100px) {
    .visa-details-section > .form-grid {
        grid-template-columns: minmax(100px, 0.75fr) minmax(100px, 0.75fr) minmax(115px, 0.7fr) minmax(140px, 1.15fr) minmax(140px, 1.15fr) minmax(120px, 1fr) minmax(220px, 1.5fr);
    }
    .visa-details-section > .form-grid > .form-group { min-width: 0; }
    .attorney-visa-details-section > .form-grid {
        grid-template-columns: minmax(100px, 0.75fr) minmax(100px, 0.75fr) minmax(115px, 0.7fr) minmax(140px, 1.15fr) minmax(120px, 0.8fr) minmax(180px, 1.35fr) minmax(220px, 1.5fr);
    }
    .passenger-details-section > .form-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); }
    .passenger-details-section > .form-grid > .form-group { grid-column: span 4; min-width: 0; }
    .passenger-details-section > .form-grid > .form-group:has(#visa-passenger-name),
    .passenger-details-section > .form-grid > .form-group:has(#visa-father-name),
    .passenger-details-section > .form-grid > .form-group:has(#visa-name-urdu),
    .passenger-details-section > .form-grid > .form-group:has(#visa-furdu-name) { grid-column: span 3; }
    .attorney-passenger-details-section > .form-grid > .form-group:has(#visa-e-no),
    .attorney-passenger-details-section > .form-grid > .form-group:has(#visa-passport-no),
    .attorney-passenger-details-section > .form-grid > .form-group:has(#visa-place-birth),
    .attorney-passenger-details-section > .form-grid > .form-group:has(#visa-country),
    .attorney-passenger-details-section > .form-grid > .form-group:has(#visa-dob),
    .attorney-passenger-details-section > .form-grid > .form-group:has(#visa-passport-issue),
    .attorney-passenger-details-section > .form-grid > .form-group:has(#visa-passport-expiry),
    .attorney-passenger-details-section > .form-grid > .form-group:has(#visa-medical-status) { grid-column: span 3; }
}
.passenger-picture-field .visa-picture-upload {
    width: 170px;
    height: 86px;
}
.passenger-picture-field #visa-picture-preview {
    width: 86px;
    height: 86px;
    margin-top: 0.55rem;
}
.add-agent-modal-box { max-width: 680px; }
.add-agent-modal-note {
    margin-bottom: 1rem;
    color: var(--text-muted);
    font-size: 0.8rem;
}
.add-agent-modal-grid { gap: 0.8rem; }
.inline-agent-actions {
    justify-content: flex-end;
    margin-top: 1.1rem;
    padding-top: 1rem;
}
.full-entry-modal-box { max-width: 1320px; width: min(96vw, 1320px); }
.full-entry-grid {
    display: grid;
    gap: 0.9rem;
    max-height: 86vh;
    overflow-y: auto;
}
.full-entry-section { padding: 0.85rem; border: 1px solid #D5E4F5; border-radius: var(--radius-sm); background: #F8FBFF; }
.full-entry-section h4 { margin: 0 0 0.65rem; padding-bottom: 0.45rem; border-bottom: 1px solid #D5E4F5; color: var(--brand-navy); font-size: 0.88rem; }
.full-entry-section-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.65rem; }
.full-entry-field {
    min-width: 0;
    padding: 0.7rem 0.8rem;
    border: 1px solid #D5E4F5;
    border-radius: var(--radius-sm);
    background: #F8FBFF;
}
.full-entry-field small {
    display: block;
    margin-bottom: 0.2rem;
    color: var(--text-muted);
    font-size: 0.68rem;
    font-weight: 700;
}
.full-entry-field strong {
    display: block;
    overflow-wrap: anywhere;
    color: var(--brand-navy);
    font-size: 0.8rem;
}
.visa-picture-panel {
    display: inline-flex;
    flex-direction: column;
    gap: 0.7rem;
    min-width: 190px;
    margin-top: 1.5rem;
    padding: 1rem;
    border: 1px solid #CFE0F4;
    border-radius: var(--radius-lg);
    background: #F8FBFF;
}
.passenger-details-layout .passenger-picture-side {
    margin-top: 0;
}
.visa-picture-upload {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 150px;
    height: 150px;
    border: 1.5px dashed #9FC1EB;
    border-radius: var(--radius-md);
    background: #FFFFFF;
    color: var(--brand-blue);
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
}
.visa-picture-upload input { display: none; }
#visa-picture-preview { display: none; width: 150px; height: 150px; object-fit: cover; border-radius: var(--radius-md); }
#visa-picture-preview.is-visible { display: block; }

.protector-search-actions { display: flex; gap: 0.55rem; }
.protector-search-actions button { white-space: nowrap; }
.protector-search-results { margin-bottom: 1.25rem; }
.protector-result-card { padding: 1.15rem; border: 1px solid #BFD5EE; border-radius: var(--radius-lg); background: #FFFFFF; box-shadow: var(--shadow-sm); }
.protector-result-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.protector-result-heading strong { display: block; color: var(--brand-navy); font-size: 1rem; }
.protector-result-heading span { display: block; margin-top: 0.25rem; color: var(--text-muted); font-size: 0.76rem; }
.protector-result-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.8rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border-subtle); }
.protector-result-grid small { display: block; color: var(--text-muted); font-size: 0.7rem; }
.protector-result-grid strong { display: block; margin-top: 0.2rem; color: var(--text-main); font-size: 0.8rem; }
.protector-empty-result { padding: 1rem; border: 1px dashed #BFD5EE; border-radius: var(--radius-md); color: var(--text-muted); text-align: center; }
.visa-saved-list-card { margin-top: 1.5rem; }
.visa-saved-list-card .page-title-box { margin-bottom: 1rem; }
.visa-list-loading { padding: 2rem; color: var(--text-muted); text-align: center; }
.agent-register-panel { display: grid; grid-template-columns: 1fr 2fr; gap: 1rem; align-items: center; margin-bottom: 1.25rem; padding: 1rem; border: 1px solid #CFE0F4; border-radius: var(--radius-lg); background: #F8FBFF; }
.agent-register-panel h3 { margin: 0; color: var(--brand-navy); font-family: Arial, Helvetica, sans-serif; font-size: 1rem; }
.agent-register-panel p { margin-top: 0.25rem; color: var(--text-muted); font-size: 0.72rem; }
.agent-register-form { display: grid; grid-template-columns: repeat(3, 1fr) auto; gap: 0.6rem; }
.agent-register-form input { width: 100%; padding: 0.65rem 0.8rem; border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); font-family: Arial, Helvetica, sans-serif; }
.agent-row-actions { display: flex; justify-content: flex-end; gap: 0.4rem; }
.access-note { margin: -0.5rem 0 1rem; color: var(--text-muted); font-size: 0.78rem; }
.agent-access-grid { display: flex; flex-wrap: nowrap; gap: 0.65rem; overflow-x: auto; padding: 0.2rem 0.1rem 0.55rem; scrollbar-width: thin; }
.agent-access-grid label, .agent-no-delete { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 0.35rem; padding: 0.48rem 0.58rem; border: 1px solid #CFE0F4; border-radius: var(--radius-sm); background: #FFFFFF; color: var(--brand-navy); font-size: 0.68rem; font-weight: 700; white-space: nowrap; }
.agent-access-grid input { accent-color: var(--brand-blue); }
#modal-edit-agent .modal-box { width: calc(100vw - 2rem); max-width: none; }
#modal-edit-agent .modal-header { padding: 1rem 1.25rem; }
#modal-edit-agent .modal-body { padding: 1rem 1.25rem; }
#modal-edit-agent .add-agent-modal-note { margin-bottom: 0.75rem; }
#modal-edit-agent .form-grid { gap: 0.75rem 1rem; }
#modal-edit-agent .agent-access-grid { flex-wrap: wrap; overflow: visible; padding-bottom: 0; }
@media (min-width: 1200px) {
    #modal-edit-agent .agent-access-grid { flex-wrap: nowrap; gap: 0.4rem; }
    #modal-edit-agent .agent-access-grid label { flex: 1 1 auto; min-width: 0; justify-content: center; padding: 0.48rem 0.35rem; }
}
#modal-edit-agent .agent-access-grid input[type="checkbox"] { width: 18px; height: 18px; flex: 0 0 18px; margin: 0; }
#modal-edit-agent .inline-agent-actions { margin-top: 1rem; padding-top: 0.75rem; flex-wrap: wrap; }
@media (max-width: 600px) {
    #modal-edit-agent .modal-header,
    #modal-edit-agent .modal-body { padding: 0.75rem; }
}
.agent-delete-access { color: var(--brand-rose) !important; border-color: rgba(225, 29, 72, 0.25) !important; background: var(--brand-rose-light) !important; }
.agent-no-delete { color: var(--brand-rose); background: var(--brand-rose-light); border-color: rgba(225, 29, 72, 0.2); }
#stage-protector-no,
#stage-protector-no + label,
.form-group:has(> #stage-protector-no) { display: none !important; }
@media (max-width: 900px) { .agent-register-panel, .agent-register-form { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
    .passenger-details-layout { grid-template-columns: 1fr; }
    .passenger-picture-side { width: 100%; }
    .full-entry-section-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) { .full-entry-section-grid { grid-template-columns: 1fr; } }
@media (max-width: 600px) { .protector-modal-detail-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 800px) { .protector-result-grid { grid-template-columns: 1fr 1fr; } .protector-search-actions { grid-column: span 2; } }

.subscription-overview-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 1.5rem;
}
.subscription-summary-card {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1rem 1.15rem;
    border: 1px solid #CFE0F4;
    border-radius: var(--radius-lg);
    background: #FFFFFF;
    box-shadow: var(--shadow-sm);
}
.subscription-summary-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--radius-md); background: var(--brand-blue-light); color: var(--brand-blue); }
.subscription-summary-card strong { display: block; color: var(--brand-navy); font-size: 1.25rem; font-weight: 800; }
.subscription-summary-card small { color: var(--text-muted); font-size: 0.72rem; font-weight: 700; }
.manual-payment-card { margin-top: 1.5rem; }
.manual-payment-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.manual-payment-actions { grid-column: span 3; margin-top: 0; }
@media (max-width: 900px) { .subscription-overview-grid, .manual-payment-grid { grid-template-columns: 1fr; } .manual-payment-actions { grid-column: auto; } }
.custom-table tbody tr {
    border-bottom: 1px solid var(--border-subtle);
    transition: background-color 0.15s ease;
}
.custom-table tbody tr:last-child { border-bottom: none; }
.custom-table tbody tr:hover {
    background-color: #F8FAFC;
}
.custom-table td {
    padding: 0.95rem 1.15rem;
    color: var(--text-main);
    font-size: 0.82rem;
    vertical-align: middle;
}

.custom-table td strong,
.custom-table td code {
    color: var(--text-main) !important;
    font-family: Arial, Helvetica, sans-serif !important;
    font-size: inherit !important;
}

.custom-table .field-label {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    color: var(--text-muted);
}

.custom-table .field-value {
    margin-left: 0.2rem;
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
}

code, pre, kbd, samp {
    font-family: Arial, Helvetica, sans-serif;
    pointer-events: none;
}

/* STATUS PILLS & DOTS */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.28rem 0.75rem;
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.status-active {
    background: #ECFDF5;
    color: #065F46;
    border: 1px solid rgba(16, 185, 129, 0.25);
}
.status-active::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10B981;
}
.status-pending {
    background: #FFF1F2;
    color: #B91C1C;
    border: 1px solid rgba(220, 38, 38, 0.25);
}
.status-pending::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #DC2626;
}
.status-expired {
    background: #FFF1F2;
    color: #9F1239;
    border: 1px solid rgba(225, 29, 72, 0.25);
}
.status-expired::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #E11D48;
}

/* STAT CARDS ROW */
.stat-cards-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.15rem;
    margin-bottom: 1.75rem;
}
.stat-box {
    background: #FFFFFF;
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    padding: 1.35rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s ease;
}
.stat-box:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.stat-box-info { display: flex; flex-direction: column; }
.stat-box-num {
    font-size: 1.95rem;
    font-weight: 800;
    color: var(--brand-navy);
    line-height: 1.1;
    font-family: Arial, Helvetica, sans-serif;
}
.stat-box-lbl {
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.35rem;
}
.stat-box-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: grid;
    place-items: center;
    font-size: 1.25rem;
}

/* SUBSCRIPTION EXECUTIVE RIBBON */
.sub-alert-bar {
    background: #FFFFFF;
    border: 1.5px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 0.95rem 1.35rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}
.sub-countdown-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: #DCEBFA;
    color: #174A8B;
    padding: 0.35rem 0.85rem;
    border-radius: var(--radius-pill);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.03em;
}
.sub-pay-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1.15rem;
    background: linear-gradient(135deg, #2563EB, #1D4ED8);
    color: #FFFFFF;
    font-size: 0.82rem;
    font-weight: 800;
    border: none;
    border-radius: var(--radius-pill);
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
    transition: all 0.18s ease;
}
.sub-pay-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(37, 99, 235, 0.4);
}

/* MODALS */
.app-dialog-backdrop {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.58);
    backdrop-filter: blur(3px);
}
.app-dialog {
    width: min(100%, 440px);
    padding: 1.5rem;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    background: #FFFFFF;
    box-shadow: 0 20px 48px rgba(15, 23, 42, 0.22);
    color: #1E293B;
    font-family: Arial, sans-serif;
}
.app-dialog-icon {
    display: grid;
    width: 44px;
    height: 44px;
    margin-bottom: 1rem;
    place-items: center;
    border-radius: 50%;
    background: #EFF6FF;
    color: #0967E8;
    font-size: 1.35rem;
}
.app-dialog-backdrop[data-dialog-type="success"] .app-dialog-icon {
    background: #ECFDF3;
    color: #15803D;
}
.app-dialog-backdrop[data-dialog-type="error"] .app-dialog-icon {
    background: #FEF2F2;
    color: #DC2626;
}
.app-dialog-backdrop[data-dialog-type="warning"] .app-dialog-icon {
    background: #FFFBEB;
    color: #D97706;
}
.app-dialog h2 {
    margin: 0 0 0.5rem;
    color: #0F172A;
    font-family: Arial, sans-serif;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.35;
}
.app-dialog > p {
    margin: 0;
    color: #475569;
    font-size: 14px;
    line-height: 1.55;
    white-space: pre-line;
}
.app-dialog-form {
    margin-top: 1.25rem;
}
.app-dialog-input-label {
    display: block;
    margin-bottom: 0.4rem;
    color: #334155;
    font-size: 13px;
    font-weight: 600;
}
.app-dialog-input {
    width: 100%;
    min-height: var(--standard-button-height);
    padding: 0.55rem 0.75rem;
    border: 1px solid #DFE6F0;
    border-radius: 8px;
    color: #1E293B;
    font: 14px Arial, sans-serif;
}
.app-dialog-input:focus {
    border-color: #0967E8;
    outline: 3px solid rgba(9, 103, 232, 0.12);
}
.app-dialog-validation {
    min-height: 1.2em;
    margin-top: 0.3rem;
    color: #B91C1C;
    font-size: 12px;
}
.app-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
    margin-top: 1.25rem;
}
.app-dialog-button {
    min-height: var(--standard-button-height);
    padding: 0.45rem 1rem;
    border: 1px solid transparent;
    border-radius: 8px;
    font: 600 14px Arial, sans-serif;
    cursor: pointer;
}
.app-dialog-button:focus-visible {
    outline: 3px solid rgba(9, 103, 232, 0.2);
    outline-offset: 2px;
}
.app-dialog-button-secondary {
    border-color: #DFE6F0;
    background: #FFFFFF;
    color: #334155;
}
.app-dialog-button-secondary:hover {
    background: #F8FAFC;
}
.app-dialog-button-primary {
    background: #0967E8;
    color: #FFFFFF;
}
.app-dialog-button-primary:hover {
    background: #0759C7;
}
.app-dialog-button-danger {
    background: #DC2626;
    color: #FFFFFF;
}
.app-dialog-button-danger:hover {
    background: #B91C1C;
}
@media (max-width: 480px) {
    .app-dialog {
        padding: 1.25rem;
    }
    .app-dialog-actions {
        flex-wrap: wrap;
    }
}
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(12px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    animation: fadeIn 0.2s ease-out forwards;
}
#modal-yes-no-confirm {
    z-index: 2000;
}
#credit-entry-modal,
#credit-entry-modal .modal-box {
    z-index: 3000;
}
.modal-backdrop.active { display: flex; }

/* Bound dialogs to the viewport even on pages without the premium UI layer. */
@media screen {
    .modal-backdrop {
        box-sizing: border-box;
        overflow: auto;
    }
    .modal-backdrop .modal-box {
        display: flex;
        flex-direction: column;
        min-width: 0;
        min-height: 0;
        box-sizing: border-box;
        max-height: calc(100vh - 40px);
        max-height: calc(100dvh - 40px);
    }
    .modal-box > .modal-header,
    .modal-box > .form-actions {
        flex-shrink: 0;
    }
    .modal-box > .modal-body,
    .modal-box > form {
        min-height: 0;
        overflow: auto;
        overscroll-behavior: contain;
    }
    .modal-header > :is(h2, h3) {
        min-width: 0;
        overflow-wrap: anywhere;
    }
    .modal-close-btn {
        flex-shrink: 0;
    }
    .app-dialog {
        box-sizing: border-box;
        max-height: calc(100vh - 32px);
        max-height: calc(100dvh - 32px);
        overflow: auto;
    }
    @media (max-width: 600px) {
        .modal-backdrop { padding: 10px; }
        .modal-backdrop .modal-box {
            max-height: calc(100vh - 20px);
            max-height: calc(100dvh - 20px);
        }
    }
}

.modal-box {
    position: relative;
    z-index: 1;
}

.credit-entry-modal-card {
    max-width: 440px;
    border: 1px solid #D9EAFB;
    border-radius: 18px;
    background: linear-gradient(180deg, #FFFFFF 0%, #F7FAFF 100%);
    overflow: hidden;
    box-shadow: 0 18px 46px rgba(15, 23, 42, 0.18), 0 5px 12px rgba(37, 99, 235, 0.12);
}
.credit-entry-modal-header {
    padding: 1rem 1.2rem;
    border-bottom: 1px solid var(--border-subtle);
    background: linear-gradient(180deg, #F2F8FF 0%, #EFF6FF 100%);
}
.credit-entry-modal-header h3 {
    margin: 0;
    color: var(--brand-navy);
    font-size: 1.1rem;
    font-weight: 800;
}
.credit-entry-modal-body {
    padding: 1.2rem;
}
.billing-credit-form-group {
    margin-bottom: 1rem;
}
.billing-credit-form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--brand-navy);
    font-size: 0.76rem;
    font-weight: 800;
}
.billing-credit-form-group select,
.billing-credit-form-group input {
    width: 100%;
    padding: 0.8rem 0.9rem;
    border: 1.5px solid #D7E9F8;
    border-radius: 10px;
    background: #F9FBFF;
    color: var(--text-slate);
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
    font: inherit;
    font-size: 0.86rem;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}
.billing-credit-form-group select:hover,
.billing-credit-form-group input:hover {
    border-color: #A5C7F5;
    background: #FFFFFF;
}
.billing-credit-form-group select:focus,
.billing-credit-form-group input:focus {
    outline: none;
    border-color: var(--brand-blue);
    background: #FFFFFF;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}
.billing-credit-form-group select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--brand-blue) 50%), linear-gradient(135deg, var(--brand-blue) 50%, transparent 50%);
    background-position: calc(100% - 18px) calc(50% - 2px), calc(100% - 12px) calc(50% - 2px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    padding-right: 2.5rem;
}
.billing-credit-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 0.5rem;
}
.activity-page-toolbar { display: flex; gap: 0.7rem; align-items: center; margin-bottom: 1rem; }
.activity-page-toolbar input, .activity-page-toolbar select { flex: 1; min-width: 0; padding: 0.65rem 0.8rem; border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); font: inherit; color: var(--text-slate); background: #FFFFFF; }
.activity-retention-notice { margin: -0.25rem 0 1rem; color: var(--text-muted); font-size: 0.78rem; }
.activity-retention-notice i { margin-right: 0.35rem; color: var(--brand-blue); }
.activity-page-table td { font-size: 0.78rem; }
.activity-page-empty { padding: 2rem !important; color: var(--text-muted); text-align: center; }
.activity-undone { color: var(--text-muted); font-size: 0.75rem; font-weight: 700; }
.staff-access-grid { display: flex; flex-wrap: nowrap; gap: 0.5rem; overflow-x: auto; padding: 0.15rem 0.1rem 0.5rem; scrollbar-width: thin; }
.staff-access-grid label { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 0.3rem; padding: 0.48rem 0.58rem; border: 1px solid #CFE0F4; border-radius: var(--radius-sm); background: #FFFFFF; color: var(--brand-navy); font-size: 0.68rem; font-weight: 700; white-space: nowrap; }
.staff-access-grid input[type="checkbox"] { width: 18px; height: 18px; min-width: 18px; flex: 0 0 18px; margin: 0; padding: 0; accent-color: var(--brand-blue); cursor: pointer; }
.staff-access-grid label { gap: 0.45rem; cursor: pointer; }
.staff-table-card { margin-top: 1.5rem; }
.staff-table-card h2 { margin-bottom: 1rem; color: var(--brand-navy); font-family: Arial, Helvetica, sans-serif; font-size: 1.1rem; }
.staff-table-card td small { display: block; margin-top: 0.2rem; color: var(--text-muted); font-size: 0.7rem; }
.staff-access-badges { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.staff-access-pill { display: inline-flex; align-items: center; padding: 0.35rem 0.58rem; border-radius: 999px; background: #e8f9ee; color: #15803d; font-size: 0.72rem; font-weight: 700; }
.staff-access-pill.is-empty { background: #f5f5f5; color: var(--muted); }
.staff-access-pill.is-denied { background: #fef2f2; color: #b91c1c; }
.staff-salary-status { color: #B45309; font-size: 0.76rem; }
.staff-salary-status.is-paid { color: #15803D; }
.group-management-list, .status-management-list { margin-top: 1rem; padding-top: 0.8rem; border-top: 1px solid var(--border-subtle); color: var(--brand-navy); font-size: 0.78rem; }
.management-list-row { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-top: 0.45rem; padding: 0.45rem 0.55rem; border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); background: #F8FBFF; }
.management-list-actions { display: inline-flex; align-items: center; gap: 0.25rem; }
.management-list-actions .btn-sm { min-width: 1.7rem; padding: 0.3rem 0.4rem; line-height: 1; }
.management-list-row small { color: var(--text-muted); font-size: 0.7rem; }
.picker-empty-note { padding: 0.65rem 0.75rem; color: var(--text-muted); font-size: 0.75rem; }
.recent-entry-row { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.75rem 0; border-bottom: 1px solid var(--line-light); }
.recent-entry-info { min-width: 0; }
.recent-entry-info strong { display: block; color: var(--navy); font-size: 0.86rem; }
.recent-entry-info div { display: flex; flex-wrap: wrap; gap: 0.35rem 0.8rem; margin-top: 0.3rem; color: var(--muted); font-size: 0.72rem; }
.recent-entry-row .btn-sm { flex: 0 0 auto; text-decoration: none; }
.entry-file-search { display: flex; align-items: center; gap: 0.75rem; margin: 0 0 1.25rem; padding: 0; border: 0; border-radius: 0; background: transparent; }
.entry-file-search-card { margin-bottom: 1rem; }
.entry-file-search-card .entry-file-search { margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; }
.entry-file-search-field { display: flex; flex: 1; min-width: 0; align-items: center; gap: 0.75rem; }
.entry-file-search-date-field { flex: 0 1 280px; }
.embassy-date-filter-toolbar { display: flex; justify-content: flex-end; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.embassy-date-filter-toolbar .entry-file-search-field { flex: 0 1 360px; }
#embassy-search-form { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; }
#embassy-search-form .entry-file-search-field { min-height: 42px; }
.entry-file-search .entry-file-search-field > label { flex: 0 0 auto; white-space: nowrap; }
.entry-file-search-input-wrap { position: relative; flex: 1; min-width: 0; }
.entry-file-search-input-wrap > i { position: absolute; top: 50%; left: var(--search-control-icon-offset); z-index: 1; display: grid; width: var(--search-control-icon-size); height: var(--search-control-icon-size); place-items: center; color: var(--text-muted); font-size: var(--search-control-icon-size); transform: translateY(-50%); pointer-events: none; }
.entry-file-search .entry-file-search-input-wrap > input { display: block; width: 100%; min-width: 0; height: 42px; box-sizing: border-box; padding: 0.55rem 0.8rem 0.55rem 2.25rem; border: 1px solid #D5E4F5; border-radius: 9px; outline: none; background: #FFFFFF; color: var(--text-main); font: inherit; font-size: 0.88rem; box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04); transition: border-color 0.18s ease, box-shadow 0.18s ease; }
.embassy-date-filter-toolbar .entry-file-search-input-wrap > input { display: block; width: 100%; min-width: 0; height: 32px; box-sizing: border-box; padding: 0.35rem 0.3rem 0.35rem 1.7rem; border: 1px solid transparent; border-radius: 8px; outline: none; background: transparent; color: var(--text-main); font: inherit; font-size: 0.86rem; box-shadow: none; transition: border-color 0.18s ease, background 0.18s ease; }
.embassy-date-filter-toolbar .entry-file-search-input-wrap > input:focus { border-color: transparent; background: rgba(37, 99, 235, 0.04); box-shadow: none; }
.entry-file-search .entry-file-search-input-wrap > input::placeholder { color: #94A3B8; }
.entry-file-search .entry-file-search-input-wrap > input:focus { border-color: #60A5FA; box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12); }
.entry-file-search > button { display: inline-flex; flex: 0 0 auto; min-height: 42px; align-items: center; justify-content: center; gap: 0.45rem; white-space: nowrap; }
.entry-file-search > .ledger-add-agent { display: inline-flex; flex: 0 0 auto; min-height: 42px; align-items: center; justify-content: center; gap: 0.45rem; white-space: nowrap; text-decoration: none; }
.ledger-list-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 0.6rem; }
.ledger-list-actions > button,
.ledger-list-actions > .ledger-add-agent { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; gap: 0.45rem; white-space: nowrap; }
.ledger-list-actions > .btn-outline { padding: 0.65rem 1rem; }
.ledger-list-actions > .ledger-add-agent[hidden] { display: none; }
#active-ledger-table-container { width: 100%; max-width: 100%; min-width: 0; box-sizing: border-box; overflow-x: auto; }
#active-ledger-table-container .ledger-list-table { width: 100% !important; min-width: 0 !important; table-layout: fixed !important; }
#active-ledger-table-container .ledger-list-table th,
#active-ledger-table-container .ledger-list-table td { text-align: center !important; vertical-align: middle; padding-left: 0.5rem; padding-right: 0.5rem; box-sizing: border-box; overflow-wrap: anywhere; }
#active-ledger-table-container .ledger-list-table th:last-child,
#active-ledger-table-container .ledger-list-table td:last-child { width: auto !important; }
#active-ledger-table-container .ledger-list-table col:nth-child(1) { width: 4% !important; }
#active-ledger-table-container .ledger-list-table col:nth-child(2) { width: 14% !important; }
#active-ledger-table-container .ledger-list-table col:nth-child(3) { width: 12% !important; }
#active-ledger-table-container .ledger-list-table col:nth-child(4) { width: 12% !important; }
#active-ledger-table-container .ledger-list-table col:nth-child(5) { width: 14% !important; }
#active-ledger-table-container .ledger-list-table col:nth-child(6),
#active-ledger-table-container .ledger-list-table col:nth-child(7) { width: 11% !important; }
#active-ledger-table-container .ledger-list-table col:nth-child(8) { width: 12% !important; }
#active-ledger-table-container .ledger-list-table col:nth-child(9) { width: 10% !important; }
#active-ledger-table-container .ledger-list-table td:nth-child(2),
#active-ledger-table-container .ledger-list-table td:nth-child(4) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#active-ledger-table-container .ledger-list-table td:nth-child(4) strong { display: block; width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* The archive table starts hidden, so initial column measurements have no container width. */
#archived-ledger-table-container { width: 100%; max-width: 100%; min-width: 0; box-sizing: border-box; overflow-x: auto; }
#archived-ledger-table-container .ledger-list-table { width: 100% !important; min-width: 0 !important; table-layout: fixed !important; }
#archived-ledger-table-container .ledger-list-table th:last-child,
#archived-ledger-table-container .ledger-list-table td:last-child { width: auto !important; }
#archived-ledger-table-container .ledger-list-table col:nth-child(1) { width: 4% !important; }
#archived-ledger-table-container .ledger-list-table col:nth-child(2) { width: 13% !important; }
#archived-ledger-table-container .ledger-list-table col:nth-child(3) { width: 10% !important; }
#archived-ledger-table-container .ledger-list-table col:nth-child(4) { width: 11% !important; }
#archived-ledger-table-container .ledger-list-table col:nth-child(5) { width: 12% !important; }
#archived-ledger-table-container .ledger-list-table col:nth-child(6),
#archived-ledger-table-container .ledger-list-table col:nth-child(7) { width: 10% !important; }
#archived-ledger-table-container .ledger-list-table col:nth-child(8) { width: 11% !important; }
#archived-ledger-table-container .ledger-list-table col:nth-child(9) { width: 10% !important; }
#archived-ledger-table-container .ledger-list-table col:nth-child(10) { width: 9% !important; }
#archived-ledger-table-container .ledger-list-table th,
#archived-ledger-table-container .ledger-list-table td { padding-left: 0.5rem; padding-right: 0.5rem; box-sizing: border-box; }
#archived-ledger-table-container .ledger-list-table thead th { text-align: center !important; vertical-align: middle; }
#archived-ledger-table-container .ledger-list-table td { overflow-wrap: anywhere; text-align: center !important; vertical-align: middle; }
#archived-ledger-table-container .ledger-list-table td:nth-child(2),
#archived-ledger-table-container .ledger-list-table td:nth-child(4) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#archived-ledger-table-container .ledger-list-table td:nth-child(4) strong { display: block; width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#archived-ledger-table-container .ledger-archived-actions button { min-height: 38px; max-width: 100%; box-sizing: border-box; white-space: normal; padding: 0.5rem 0.5rem; }
.ledger-list-table tbody tr.agent-row-blocked td:not(:last-child),
.ledger-list-table tbody tr.agent-row-blocked td:not(:last-child) *:not(i):not(svg) {
    color: #DC2626 !important;
}
.entry-file-search-card .entry-file-search > button { display: inline-flex; flex: 0 0 auto; min-height: 42px; align-items: center; justify-content: center; gap: 0.45rem; }
.entry-file-search-results { margin: 0 0 1.25rem; padding: 0.9rem; border: 1px solid #BFDBFE; border-radius: var(--radius-sm); background: #EFF6FF; }
.entry-search-result-heading { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.75rem; }
.entry-search-result-heading strong { display: block; color: var(--brand-navy); font-size: 0.95rem; }
.entry-search-result-heading span { display: block; margin-top: 0.2rem; color: var(--text-muted); font-size: 0.72rem; }
.entry-search-result-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.55rem; }
.entry-search-result-grid div { padding: 0.55rem 0.65rem; border: 1px solid #D5E4F5; border-radius: var(--radius-sm); background: #FFFFFF; }
.entry-search-result-grid small { display: block; color: var(--text-muted); font-size: 0.66rem; }
.entry-search-result-grid strong { display: block; margin-top: 0.2rem; color: var(--brand-navy); font-size: 0.76rem; overflow-wrap: anywhere; }
@media (max-width: 600px) {
    .entry-file-search { align-items: stretch; flex-direction: column; }
    .entry-file-search-field { align-items: stretch; flex-direction: column; }
    .entry-file-search > button, .entry-file-search > .ledger-add-agent { width: 100%; }
    .ledger-list-actions { width: 100%; }
    .ledger-list-actions > button, .ledger-list-actions > .ledger-add-agent { flex: 1 1 0; }
    .entry-file-search-date-field { flex-basis: auto; }
    #embassy-search-form { display: flex; }
    #embassy-search-form .entry-file-search-field { min-height: 0; }
    .page-title-box-action,
    .embassy-page-heading { grid-template-columns: minmax(0, 1fr); gap: 0.6rem; }
    .page-title-box-action > h1,
    .embassy-page-heading > h1 { grid-column: 1; grid-row: 1; }
    .page-title-box-action > button { grid-column: 1; grid-row: 2; justify-self: end; }
    .embassy-page-heading > form { grid-column: 1; grid-row: 2; justify-self: stretch; }
    .embassy-date-filter-toolbar { padding: 0; }
    .embassy-date-filter-toolbar .entry-file-search-field { flex-basis: auto; }
}
@media (max-width: 800px) { .entry-search-result-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.recent-entry-heading { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 1rem; }
.recent-entry-heading h3 { margin: 0; color: var(--navy); font-size: 1.15rem; font-weight: 800; }
.realtime-indicator { display: inline-flex; align-items: center; gap: 0.35rem; color: #047857; font-size: 0.7rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; }
.realtime-indicator i { font-size: 0.48rem; color: #10B981; }
.protector-modal-section { margin: 0.85rem 0 1rem; padding: 0.8rem; border: 1px solid #D5E4F5; border-radius: var(--radius-sm); background: #F8FBFF; }
.protector-modal-section h4 { margin: 0 0 0.65rem; color: var(--brand-navy); font-size: 0.84rem; }
.protector-modal-detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.55rem; }
.protector-modal-detail-grid div { padding: 0.5rem; border: 1px solid #D5E4F5; border-radius: var(--radius-sm); background: #FFFFFF; }
.protector-modal-detail-grid small { display: block; color: var(--text-muted); font-size: 0.66rem; }
.protector-modal-detail-grid strong { display: block; margin-top: 0.2rem; color: var(--brand-navy); font-size: 0.76rem; overflow-wrap: anywhere; }
.protector-missing-details { margin: 0 0 1rem; padding: 0.65rem 0.75rem; border: 1px solid #FDE68A; border-radius: var(--radius-sm); background: #FFFBEB; color: #92400E; font-size: 0.75rem; }
.protector-complete-details { margin: 0 0 1rem; padding: 0.65rem 0.75rem; border: 1px solid #A7F3D0; border-radius: var(--radius-sm); background: #ECFDF5; color: #047857; font-size: 0.75rem; }
@media (max-width: 700px) { .activity-page-toolbar { flex-wrap: wrap; } .activity-page-toolbar input, .activity-page-toolbar select { flex-basis: 100%; } }
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-box {
    background: #FFFFFF;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 760px;
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    animation: modalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.modal-box.ledger-modal-box {
    max-width: min(98vw, 1400px);
    width: min(98vw, 1400px);
}
.modal-box.full-billing-modal-box {
    max-width: min(96vw, 1300px);
    width: min(96vw, 1300px);
}
.modal-box.full-entry-modal-box {
    max-width: 1180px;
    width: min(92vw, 1180px);
}
@keyframes modalPop {
    from { transform: scale(0.96) translateY(10px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.75rem;
    background: #F8FAFC;
    border-bottom: 1px solid var(--border-subtle);
}
.modal-header h3 {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--brand-navy);
}
.modal-close-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--bg-elevated);
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.15s ease;
}
.modal-close-btn:hover { background: #CBD5E1; color: var(--text-main); }
.modal-body {
    padding: 1.75rem;
}
#modal-candidate-stage[data-mode="remarks"] .modal-box {
    max-width: 520px;
}
#modal-candidate-stage[data-mode="remarks"] .modal-body {
    display: grid;
    gap: 0.9rem;
    padding: 1.35rem 1.5rem 1.5rem;
}
.stage-status-native {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}
.stage-status-picker { position: relative; }
.stage-status-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 42px;
    padding: 0.65rem 0.85rem;
    border: 1.5px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: #FFFFFF;
    color: var(--text-main);
    font: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
}
.stage-status-trigger:hover,
.stage-status-picker.is-open .stage-status-trigger {
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.stage-status-trigger i { color: var(--brand-blue); font-size: 0.75rem; transition: transform 0.2s ease; }
.stage-status-picker.is-open .stage-status-trigger i { transform: rotate(180deg); }
.stage-status-menu {
    position: absolute;
    top: calc(100% + 0.35rem);
    left: 0;
    right: 0;
    z-index: 50;
    display: none;
    max-height: 190px;
    overflow-y: auto;
    padding: 0.3rem;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: #FFFFFF;
    box-shadow: var(--shadow-md);
}
.stage-status-picker.is-open .stage-status-menu { display: grid; gap: 0.15rem; }
.stage-status-option {
    width: 100%;
    padding: 0.55rem 0.65rem;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-slate);
    font: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}
.stage-status-option:hover, .stage-status-option.is-selected { background: var(--brand-blue-light); color: var(--brand-blue); }
.stage-status-empty { padding: 0.55rem 0.65rem; color: var(--text-muted); font-size: 0.78rem; }
.courier-name-native {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}
.courier-name-picker { position: relative; flex: 1; min-width: 0; }
.courier-name-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 38px;
    padding: 0.55rem 0.7rem;
    border: 1px solid #c9dcef;
    border-radius: 7px;
    background: #FFFFFF;
    color: var(--text-main);
    font: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
}
.courier-name-trigger:hover,
.courier-name-picker.is-open .courier-name-trigger {
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.courier-name-trigger i { color: var(--brand-blue); font-size: 0.7rem; transition: transform 0.2s ease; }
.courier-name-picker.is-open .courier-name-trigger i { transform: rotate(180deg); }
.courier-name-menu {
    position: absolute;
    top: calc(100% + 0.35rem);
    left: 0;
    right: 0;
    z-index: 60;
    display: none;
    max-height: 190px;
    overflow-y: auto;
    padding: 0.3rem;
    border: 1px solid #d5e2f0;
    border-radius: 8px;
    background: #FFFFFF;
    box-shadow: 0 12px 28px rgba(26, 58, 93, 0.16);
}
.courier-name-picker.is-open .courier-name-menu { display: grid; gap: 0.15rem; }
.courier-name-option {
    display: grid;
    grid-template-columns: 1rem 1fr auto;
    align-items: center;
    gap: 0.45rem;
    width: 100%;
    padding: 0.55rem 0.6rem;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--text-slate);
    font: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}
.courier-name-option > i:first-child { color: #7aa7da; font-size: 0.72rem; }
.courier-name-option .option-check { visibility: hidden; color: var(--brand-blue); font-size: 0.7rem; }
.courier-name-option:hover, .courier-name-option.is-selected { background: var(--brand-blue-light); color: var(--brand-blue); }
.courier-name-option.is-selected .option-check { visibility: visible; }
.courier-name-empty { padding: 0.6rem; color: var(--text-muted); font-size: 0.78rem; }
#modal-candidate-stage[data-mode="remarks"] .remarks-status-field {
    position: relative;
    z-index: 2;
    margin-bottom: 0 !important;
    padding: 0.85rem;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: #F8FAFC;
    gap: 0.45rem;
}
#modal-candidate-stage[data-mode="remarks"] .remarks-status-field label {
    color: var(--brand-navy);
    font-size: 0.76rem;
    font-weight: 800;
}
#modal-candidate-stage .btn-primary:disabled {
    opacity: 0.65;
    cursor: wait;
    transform: none;
}
#modal-candidate-stage[data-mode="remarks"] .remarks-editor-field {
    position: relative;
    z-index: 1;
    gap: 0.55rem;
    margin-bottom: 0 !important;
    padding: 0.85rem;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: #FFFFFF;
}
#modal-candidate-stage[data-mode="remarks"] .remarks-editor-field label {
    color: var(--brand-navy);
    font-size: 0.86rem;
    font-weight: 800;
}
#modal-candidate-stage[data-mode="remarks"] #stage-remarks {
    min-height: 130px;
    resize: vertical;
    line-height: 1.5;
}

/* TOAST NOTIFICATIONS */
.toast-container {
    position: fixed;
    bottom: 1.75rem;
    right: 1.75rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.toast-msg {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.85rem 1.35rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    font-size: 0.86rem;
    font-weight: 700;
    color: #FFFFFF;
    animation: toastSlide 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes toastSlide {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.toast-success { background: linear-gradient(135deg, #059669, #0F766E); }
.toast-error { background: linear-gradient(135deg, #E11D48, #9F1239); }

.agency-access-lock-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    padding: 0.65rem 1rem;
    background: var(--brand-rose-light);
    border-bottom: 1px solid rgba(225, 29, 72, 0.2);
    color: #9F1239;
    font-size: 0.8rem;
    font-weight: 800;
}

.logo-upload-box {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-height: 58px;
    padding: 0.65rem 0.75rem;
    border: 1.5px dashed #B8C7D9;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #F8FBFF, #FFFFFF);
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}
.logo-upload-box:hover,
.logo-upload-box:focus-within {
    border-color: var(--brand-blue);
    background: var(--brand-blue-light);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.logo-upload-box input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}
.logo-upload-icon {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    border-radius: var(--radius-sm);
    background: var(--brand-blue-light);
    color: var(--brand-blue);
    font-size: 0.95rem;
}
.logo-upload-copy {
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
    min-width: 0;
}
.logo-upload-copy strong { color: var(--brand-navy); font-size: 0.76rem; }
.logo-upload-copy small { color: var(--text-muted); font-size: 0.68rem; }
.logo-upload-action {
    margin-left: auto;
    padding: 0.38rem 0.65rem;
    border: 1px solid rgba(37, 99, 235, 0.25);
    border-radius: var(--radius-sm);
    background: #FFFFFF;
    color: var(--brand-blue);
    font-size: 0.72rem;
    font-weight: 800;
    white-space: nowrap;
}
.logo-preview {
    display: none;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    object-fit: contain;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    background: #FFFFFF;
}
.logo-preview.is-visible { display: block; }

.duration-field {
    grid-column: span 2;
    padding: 0.85rem;
    border: 1px solid rgba(37, 99, 235, 0.18);
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #F8FBFF, #FFFFFF);
}
.duration-field > label {
    color: var(--brand-navy);
    font-weight: 800;
}
.duration-field > label i { color: var(--brand-blue); }
.duration-control {
    position: relative;
    display: flex;
    align-items: center;
    margin-top: 0.45rem;
}
.duration-control > i:first-child {
    position: absolute;
    left: 0.9rem;
    z-index: 1;
    color: var(--brand-blue);
    pointer-events: none;
}
.duration-control select {
    appearance: none;
    padding-left: 2.5rem;
    padding-right: 2.5rem;
    border-color: rgba(37, 99, 235, 0.3);
    background: #FFFFFF;
    cursor: pointer;
}
.duration-chevron {
    position: absolute;
    right: 1rem;
    color: var(--text-muted);
    pointer-events: none;
}
.duration-field small {
    display: block;
    margin-top: 0.35rem;
    color: var(--text-muted);
    font-size: 0.7rem;
}

.duration-picker { position: relative; width: 100%; }
.duration-picker-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 44px;
    padding: 0.75rem 2.5rem 0.75rem 2.5rem;
    border: 1.5px solid rgba(37, 99, 235, 0.3);
    border-radius: var(--radius-md);
    background: #FFFFFF;
    color: var(--brand-navy);
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
    transition: all 0.18s ease;
}
.duration-picker-trigger:hover,
.duration-picker.is-open .duration-picker-trigger {
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.duration-picker-trigger > i { color: var(--text-muted); font-size: 0.7rem; transition: transform 0.18s ease; }
.duration-picker.is-open .duration-picker-trigger > i { transform: rotate(180deg); }
.duration-picker-trigger.status-pending {
    background: #FFF1F2;
    border-color: rgba(220, 38, 38, 0.40);
    color: #B91C1C;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.08);
}
.duration-picker-trigger.status-pending > i { color: #B91C1C; }
.duration-picker-trigger.status-active {
    background: #ECFDF5;
    border-color: rgba(16, 185, 129, 0.40);
    color: #065F46;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.08);
}
.duration-picker-trigger.status-active > i { color: #065F46; }
.duration-picker-menu {
    position: absolute;
    top: calc(100% + 0.4rem);
    right: 0;
    left: 0;
    z-index: 30;
    display: grid;
    gap: 0.2rem;
    padding: 0.35rem;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: #FFFFFF;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-5px);
    transition: all 0.16s ease;
}
.duration-picker.is-open .duration-picker-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.duration-picker-option {
    padding: 0.65rem 0.75rem;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-slate);
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
}
.duration-picker-option:hover { background: var(--brand-blue-light); color: var(--brand-blue); }
.duration-picker-option.is-selected { background: var(--brand-blue-light); color: var(--brand-blue); font-weight: 800; }
.duration-picker-option[data-status="pending"] { color: #B91C1C; }
.duration-picker-option[data-status="done"] { color: #065F46; }
.insurance-relation-picker { position: relative; width: 100%; }
.insurance-relation-input-wrap { position: relative; }
.insurance-relation-input-wrap > input { width: 100%; box-sizing: border-box; padding-right: 2.4rem; }
.insurance-relation-input-wrap > i { position: absolute; top: 50%; right: 0.9rem; color: var(--text-muted); font-size: 0.7rem; transform: translateY(-50%); pointer-events: none; transition: transform 0.18s ease; }
.insurance-relation-picker.is-open .insurance-relation-input-wrap > i { transform: translateY(-50%) rotate(180deg); }
.insurance-relation-options { position: absolute; z-index: 100; top: calc(100% + 0.35rem); right: 0; left: 0; max-height: 220px; overflow-y: auto; padding: 0.3rem; border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); background: #FFFFFF; box-shadow: 0 10px 24px rgba(15, 23, 42, 0.14); opacity: 0; visibility: hidden; transform: translateY(-4px); transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease; }
.insurance-relation-picker.is-open .insurance-relation-options { opacity: 1; visibility: visible; transform: translateY(0); }
.insurance-relation-options > button { display: block; width: 100%; padding: 0.58rem 0.7rem; border: 0; border-radius: 5px; background: transparent; color: var(--text-main); font: inherit; font-size: 0.82rem; text-align: left; cursor: pointer; }
.insurance-relation-options > button:hover,
.insurance-relation-options > button:focus-visible { outline: none; background: var(--brand-blue-light); color: var(--brand-blue); }
.insurance-relation-options > button[hidden] { display: none; }

input[type="date"],
input[type="datetime-local"],
input[type="month"] {
    min-height: 42px;
    accent-color: var(--brand-blue);
    color-scheme: light;
}
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator,
input[type="month"]::-webkit-calendar-picker-indicator {
    padding: 0.25rem;
    border-radius: 5px;
    cursor: pointer;
    opacity: 0.72;
}
input[type="date"]::-webkit-calendar-picker-indicator:hover,
input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover,
input[type="month"]::-webkit-calendar-picker-indicator:hover {
    background: var(--brand-blue-light);
    opacity: 1;
}
.global-calendar-picker {
    position: fixed;
    z-index: 5000;
    display: none;
    width: 272px;
    padding: 0.75rem;
    border: 1px solid #D5E2F0;
    border-radius: 14px;
    background: #FFFFFF;
    box-shadow: 0 18px 40px rgba(26, 58, 93, 0.2);
}
.global-calendar-picker.is-open { display: block; }
.global-calendar-header,
.global-calendar-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}
.global-calendar-header { margin-bottom: 0.7rem; color: var(--brand-navy); font-size: 0.82rem; }
.global-calendar-header button,
.global-calendar-footer button {
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--brand-blue);
    font: inherit;
    font-size: 0.72rem;
    font-weight: 800;
    cursor: pointer;
}
.global-calendar-header button { width: 28px; height: 28px; }
.global-calendar-header button:hover,
.global-calendar-footer button:hover { background: var(--brand-blue-light); }
.global-calendar-weekdays,
.global-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.18rem;
}
.global-calendar-weekdays { margin-bottom: 0.25rem; color: var(--text-muted); font-size: 0.62rem; font-weight: 800; text-align: center; }
.global-calendar-day {
    display: grid;
    place-items: center;
    min-height: 30px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--text-slate);
    font: inherit;
    font-size: 0.72rem;
    cursor: pointer;
}
.global-calendar-day:hover { background: var(--brand-blue-light); color: var(--brand-blue); }
.global-calendar-day.is-selected { background: var(--brand-blue); color: #FFFFFF; font-weight: 800; }
.global-calendar-day.is-today:not(.is-selected) { box-shadow: inset 0 0 0 1px var(--brand-blue); color: var(--brand-blue); font-weight: 800; }
.global-calendar-day.is-empty { cursor: default; }
.global-calendar-footer { margin-top: 0.65rem; padding-top: 0.55rem; border-top: 1px solid #E7EEF7; }
.ledger-fund-request-btn { gap: 0.45rem; }
.ledger-fund-request-count {
    display: inline-grid;
    place-items: center;
    min-width: 20px;
    height: 20px;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: #D92D55;
    color: #FFFFFF;
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1;
}

.ui-dropdown-trigger,
.duration-picker-trigger,
.action-menu-trigger,
.action-dropdown-trigger {
    min-height: 40px;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease;
}
.ui-dropdown-trigger:focus-visible,
.duration-picker-trigger:focus-visible,
.action-menu-trigger:focus-visible,
.action-dropdown-trigger:focus-visible,
.date-picker-button:focus-visible,
button:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.22);
    outline-offset: 2px;
}
.ui-dropdown-menu,
.duration-picker-menu,
.action-menu-list,
.action-dropdown-menu {
    border-color: #D5E2F0;
    border-radius: 10px;
    box-shadow: 0 12px 28px rgba(26, 58, 93, 0.14);
}
.ui-dropdown-option,
.duration-picker-option,
.action-menu-list button,
.action-dropdown-menu button {
    min-height: 36px;
    transition: background 0.16s ease, color 0.16s ease;
}
.action-menu-trigger,
.action-dropdown-trigger {
    justify-content: center;
    white-space: nowrap;
}
.action-menu-list button.action-menu-danger,
.action-dropdown-menu button.action-danger {
    color: var(--brand-rose);
}
.action-menu-list button.action-menu-danger:hover,
.action-dropdown-menu button.action-danger:hover {
    background: var(--brand-rose-light);
    color: var(--brand-rose);
}

@media (max-width: 700px) {
    .action-menu-list,
    .action-dropdown-menu {
        position: fixed;
        right: 0.75rem;
        left: auto;
        min-width: min(250px, calc(100vw - 1.5rem));
        max-width: calc(100vw - 1.5rem);
    }
}
.permission-status-note {
    margin-top: 0.35rem;
    font-size: 0.72rem;
    line-height: 1.2;
    color: var(--text-muted);
    text-align: center;
}

/* GRID UTILITIES */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
@media (max-width: 900px) {
    .custom-table-container { overflow-x: auto; overflow-y: hidden; }
    .duration-field { grid-column: auto; }
    .grid-2 { grid-template-columns: 1fr; }
    .stat-cards-row { grid-template-columns: 1fr 1fr; }
    .candidate-toolbar { align-items: flex-start; flex-wrap: wrap; }
    .candidate-search-group { flex-basis: 100%; }
    .candidate-search-field { min-width: 0; }
}
@media (max-width: 600px) {
    .stat-cards-row { grid-template-columns: 1fr; }
    .candidate-search-group { align-items: stretch; flex-direction: column; }
    .candidate-search-group h2 { white-space: normal; }
    .candidate-toolbar-actions { flex-wrap: wrap; }
    .app-header { padding: 0.65rem 1rem; }
    .header-brand { gap: 0.6rem; }
    .header-logo-image { width: 300px; height: 58px; }
    .header-brand > div:last-child { font-size: 0.9rem; }
    .header-brand > div:last-child span { font-size: 0.52rem; letter-spacing: 0.04em; }
    .header-user-zone .user-pill { display: none; }
    .header-user-zone .btn-outline { padding: 0.5rem 0.75rem; font-size: 0.76rem; }
}

input[type="search"],
#filter-agency-search,
.candidate-search-field > input,
.entry-file-search-input-wrap > input:not([type="date"]) {
    box-sizing: border-box;
    max-width: 100%;
    height: var(--search-control-height) !important;
    min-width: 0;
    padding: 0 34px 0 var(--search-control-text-offset) !important;
    border: 1px solid var(--search-control-border) !important;
    border-radius: var(--search-control-radius) !important;
    background-color: #FFFFFF !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364758B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-4-4'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: var(--search-control-icon-offset) center !important;
    background-size: var(--search-control-icon-size) !important;
    color: var(--text-main) !important;
    font-family: inherit !important;
    font-size: 14px !important;
    line-height: 1.2 !important;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.candidate-search-field > input,
.entry-file-search-input-wrap > input:not([type="date"]) {
    padding-left: var(--search-control-text-offset) !important;
    background-image: none !important;
}

input[type="search"]::placeholder,
#filter-agency-search::placeholder,
.candidate-search-field > input::placeholder,
.entry-file-search-input-wrap > input:not([type="date"])::placeholder {
    color: #94A3B8;
    opacity: 1;
    text-overflow: ellipsis;
}

input[type="search"]:hover,
#filter-agency-search:hover,
.candidate-search-field > input:hover,
.entry-file-search-input-wrap > input:not([type="date"]):hover:not(:focus) {
    border-color: #93C5FD !important;
    background-color: #F8FBFF !important;
}

input[type="search"]:focus,
#filter-agency-search:focus,
.candidate-search-field > input:focus,
.entry-file-search-input-wrap > input:not([type="date"]):focus {
    border-color: var(--brand-blue) !important;
    outline: none;
    background-color: #FFFFFF !important;
    box-shadow: 0 0 0 3px var(--search-control-focus) !important;
}

input[type="search"]:disabled,
#filter-agency-search:disabled,
.candidate-search-field > input:disabled,
.entry-file-search-input-wrap > input:not([type="date"]):disabled {
    background-color: var(--bg-elevated) !important;
    color: var(--text-muted) !important;
    cursor: not-allowed;
    opacity: 0.7;
}

@media (max-width: 600px) {
    input[type="search"],
    #filter-agency-search,
    .candidate-search-field > input,
    .entry-file-search-input-wrap > input:not([type="date"]) {
        width: 100%;
        font-size: 14px !important;
    }
    .candidate-search-field,
    .entry-file-search-field,
    .entry-file-search-input-wrap { min-width: 0; max-width: 100%; }
}

select:not(.stage-status-native):not(.courier-name-native) {
    box-sizing: border-box;
    height: var(--standard-button-height) !important;
    min-height: var(--standard-button-height) !important;
    max-height: var(--standard-button-height) !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    border: 1px solid var(--dropdown-control-border) !important;
    border-radius: var(--dropdown-control-radius) !important;
    background-color: #FFFFFF;
    background-position: right 0.75rem center !important;
    background-size: 0.9rem !important;
    color: #1E293B;
    font-family: Arial, sans-serif;
    font-size: 14px;
    line-height: 1.2;
    text-overflow: ellipsis;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

select:not(.stage-status-native):not(.courier-name-native):hover {
    border-color: #93C5FD;
    background-color: #F8FBFF;
}

select:not(.stage-status-native):not(.courier-name-native):focus {
    border-color: #0967E8 !important;
    outline: none;
    background-color: #FFFFFF;
    box-shadow: 0 0 0 3px var(--search-control-focus);
}

select:not(.stage-status-native):not(.courier-name-native):disabled {
    background-color: #F1F5F9;
    color: #64748B;
    cursor: not-allowed;
    opacity: 0.7;
}

select:not(.stage-status-native):not(.courier-name-native) option {
    background: #FFFFFF;
    color: #1E293B;
    font-family: Arial, sans-serif;
    font-size: 14px;
}

select:not(.stage-status-native):not(.courier-name-native) option:checked {
    background: var(--brand-blue);
    color: #FFFFFF;
}

.ui-dropdown-trigger,
.duration-picker-trigger,
.stage-status-trigger,
.courier-name-trigger,
.action-menu-trigger,
.action-dropdown-trigger,
.insurance-relation-input-wrap > input {
    box-sizing: border-box;
    height: var(--standard-button-height) !important;
    min-height: var(--standard-button-height) !important;
    max-height: var(--standard-button-height) !important;
    min-width: 0;
    max-width: 100%;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    border-width: 1px !important;
    border-color: var(--dropdown-control-border) !important;
    border-radius: var(--dropdown-control-radius) !important;
    background-color: #FFFFFF !important;
    color: var(--text-main) !important;
    font-family: inherit !important;
    font-size: 14px !important;
    line-height: 1.2 !important;
}

.duration-picker-trigger {
    padding-right: 0.75rem !important;
    padding-left: 2.5rem !important;
}

.courier-name-trigger {
    padding-right: 0.75rem !important;
    padding-left: 0.75rem !important;
}

.insurance-relation-input-wrap > input {
    padding-right: 2.4rem !important;
}

.ui-dropdown-trigger > i:last-child,
.duration-picker-trigger > i:last-child,
.stage-status-trigger > i:last-child,
.courier-name-trigger > i:last-child,
.action-menu-trigger > i:last-child,
.action-dropdown-trigger > i:last-child {
    flex: 0 0 auto;
    color: var(--brand-blue);
    font-size: 0.75rem;
}

.ui-dropdown-trigger:hover,
.ui-dropdown.is-open .ui-dropdown-trigger,
.ui-dropdown-trigger:focus-visible,
.duration-picker-trigger:hover,
.duration-picker.is-open .duration-picker-trigger,
.duration-picker-trigger:focus-visible,
.stage-status-trigger:hover,
.stage-status-picker.is-open .stage-status-trigger,
.stage-status-trigger:focus-visible,
.courier-name-trigger:hover,
.courier-name-picker.is-open .courier-name-trigger,
.courier-name-trigger:focus-visible,
.action-menu-trigger:hover,
.action-menu.is-open .action-menu-trigger,
.action-menu-trigger:focus-visible,
.action-dropdown-trigger:hover,
.action-dropdown.is-open .action-dropdown-trigger,
.action-dropdown-trigger:focus-visible {
    border-color: #0967E8 !important;
    background-color: #F8FBFF !important;
    box-shadow: 0 0 0 3px var(--search-control-focus) !important;
}

.duration-picker-trigger.status-pending,
.duration-picker-trigger.status-pending:hover,
.duration-picker-trigger.status-pending:focus-visible,
.duration-picker.is-open .duration-picker-trigger.status-pending {
    border-color: rgba(220, 38, 38, 0.4) !important;
    background-color: #FFF1F2 !important;
    color: #B91C1C !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.08) !important;
}

.duration-picker-trigger.status-active,
.duration-picker-trigger.status-active:hover,
.duration-picker-trigger.status-active:focus-visible,
.duration-picker.is-open .duration-picker-trigger.status-active {
    border-color: rgba(16, 185, 129, 0.4) !important;
    background-color: #ECFDF5 !important;
    color: #065F46 !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.08) !important;
}

.ui-dropdown-trigger:disabled,
.duration-picker-trigger:disabled,
.stage-status-trigger:disabled,
.courier-name-trigger:disabled,
.action-menu-trigger:disabled,
.action-dropdown-trigger:disabled,
.ui-dropdown-trigger[aria-disabled="true"],
.duration-picker-trigger[aria-disabled="true"],
.stage-status-trigger[aria-disabled="true"],
.courier-name-trigger[aria-disabled="true"] {
    background-color: var(--bg-elevated) !important;
    color: var(--text-muted) !important;
    cursor: not-allowed;
    opacity: 0.7;
}

.insurance-relation-input-wrap > input:focus {
    border-color: var(--brand-blue) !important;
    outline: none;
    background-color: #FFFFFF !important;
    box-shadow: 0 0 0 3px var(--search-control-focus) !important;
}

.insurance-relation-input-wrap > input:disabled {
    background-color: var(--bg-elevated) !important;
    color: var(--text-muted) !important;
    cursor: not-allowed;
    opacity: 0.7;
}

.ui-dropdown-menu,
.duration-picker-menu,
.stage-status-menu,
.courier-name-menu,
.insurance-relation-options,
.action-menu-list,
.action-dropdown-menu,
.nav-dropdown-menu {
    box-sizing: border-box;
    max-height: min(280px, 50vh);
    overflow-x: hidden;
    overflow-y: auto;
    border: 1px solid var(--dropdown-control-border);
    border-radius: 8px;
    background: #FFFFFF;
    box-shadow: var(--shadow-lg);
    scrollbar-color: #CBD5E1 #F8FAFC;
    scrollbar-width: thin;
}

.ui-dropdown-menu::-webkit-scrollbar,
.duration-picker-menu::-webkit-scrollbar,
.stage-status-menu::-webkit-scrollbar,
.courier-name-menu::-webkit-scrollbar,
.insurance-relation-options::-webkit-scrollbar {
    width: 8px;
}

.ui-dropdown-menu::-webkit-scrollbar-thumb,
.duration-picker-menu::-webkit-scrollbar-thumb,
.stage-status-menu::-webkit-scrollbar-thumb,
.courier-name-menu::-webkit-scrollbar-thumb,
.insurance-relation-options::-webkit-scrollbar-thumb {
    border: 2px solid #F8FAFC;
    border-radius: 999px;
    background: #CBD5E1;
}

.ui-dropdown-option,
.duration-picker-option,
.stage-status-option,
.courier-name-option,
.insurance-relation-options > button,
.action-menu-list > button,
.action-dropdown-menu > button {
    box-sizing: border-box;
    min-width: 0;
    min-height: 36px;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    color: var(--text-slate);
    background: transparent;
    font-family: Arial, sans-serif;
    font-size: 14px;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.ui-dropdown-option:hover,
.ui-dropdown-option.is-selected,
.ui-dropdown-option[aria-selected="true"],
.duration-picker-option:hover,
.duration-picker-option.is-selected,
.duration-picker-option[aria-selected="true"],
.stage-status-option:hover,
.stage-status-option.is-selected,
.stage-status-option[aria-selected="true"],
.courier-name-option:hover,
.courier-name-option.is-selected,
.courier-name-option[aria-selected="true"],
.insurance-relation-options > button:hover,
.insurance-relation-options > button[aria-selected="true"],
.insurance-relation-options > button:focus-visible {
    background: var(--brand-blue-light);
    color: var(--brand-blue);
}

/* One simple dropdown system across forms, filters, statuses and action menus. */
select:not(.stage-status-native):not(.courier-name-native),
body :is(.ui-dropdown-trigger, .duration-picker-trigger, .stage-status-trigger, .courier-name-trigger, .action-menu-trigger, .action-dropdown-trigger) {
    height: 40px !important;
    min-height: 40px !important;
    max-height: 40px !important;
    padding: 0 12px !important;
    border: 1px solid #D7E0EA !important;
    border-radius: 8px !important;
    background-color: #FFFFFF !important;
    color: #1E293B !important;
    font-family: Arial, Helvetica, sans-serif !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    line-height: 1.2 !important;
    box-shadow: none !important;
}

select:not(.stage-status-native):not(.courier-name-native) {
    padding-right: 36px !important;
    background-position: right 12px center !important;
    background-size: 14px !important;
}

body :is(.ui-dropdown-trigger, .duration-picker-trigger, .stage-status-trigger, .courier-name-trigger) {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    text-align: left;
}

body :is(.action-menu-trigger, .action-dropdown-trigger) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px !important;
    width: auto;
    white-space: nowrap;
}

body :is(.ui-dropdown-trigger, .duration-picker-trigger, .stage-status-trigger, .courier-name-trigger, .action-menu-trigger, .action-dropdown-trigger) > i:last-child {
    color: #2563EB !important;
    font-size: 12px !important;
}

select:not(.stage-status-native):not(.courier-name-native):hover,
body :is(.ui-dropdown-trigger, .duration-picker-trigger, .stage-status-trigger, .courier-name-trigger, .action-menu-trigger, .action-dropdown-trigger):hover,
body :is(.ui-dropdown, .duration-picker, .stage-status-picker, .courier-name-picker, .action-menu, .action-dropdown).is-open > :is(.ui-dropdown-trigger, .duration-picker-trigger, .stage-status-trigger, .courier-name-trigger, .action-menu-trigger, .action-dropdown-trigger) {
    border-color: #2563EB !important;
    background-color: #FFFFFF !important;
    box-shadow: none !important;
}

select:not(.stage-status-native):not(.courier-name-native):focus,
body :is(.ui-dropdown-trigger, .duration-picker-trigger, .stage-status-trigger, .courier-name-trigger, .action-menu-trigger, .action-dropdown-trigger):focus-visible {
    border-color: #2563EB !important;
    outline: 2px solid rgba(37, 99, 235, 0.16) !important;
    outline-offset: 1px !important;
    box-shadow: none !important;
}

body :is(.ui-dropdown-menu, .duration-picker-menu, .stage-status-menu, .courier-name-menu, .insurance-relation-options, .action-menu-list, .action-dropdown-menu, .nav-dropdown-menu, .app-select-menu) {
    padding: 5px !important;
    border: 1px solid #D7E0EA !important;
    border-radius: 8px !important;
    background: #FFFFFF !important;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12) !important;
}

body :is(.ui-dropdown-option, .duration-picker-option, .stage-status-option, .courier-name-option, .insurance-relation-options > button, .action-menu-list > button, .action-dropdown-menu > button, .action-dropdown-menu > a, .nav-dropdown-menu > .dash-nav-btn, .app-select-option) {
    min-height: 36px !important;
    padding: 8px 10px !important;
    border: 0 !important;
    border-radius: 5px !important;
    background: #FFFFFF !important;
    color: #334155 !important;
    font-family: Arial, Helvetica, sans-serif !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    line-height: 1.25 !important;
    box-shadow: none !important;
}

body .passport-agent-filter-menu .app-select-option {
    white-space: nowrap !important;
    overflow: visible !important;
    text-overflow: clip !important;
}

body :is(.ui-dropdown-option, .duration-picker-option, .stage-status-option, .courier-name-option, .insurance-relation-options > button, .action-menu-list > button, .action-dropdown-menu > button, .action-dropdown-menu > a, .nav-dropdown-menu > .dash-nav-btn, .app-select-option):hover,
body :is(.ui-dropdown-option, .duration-picker-option, .stage-status-option, .courier-name-option, .app-select-option):is(.is-selected, [aria-selected="true"]) {
    background: #EFF6FF !important;
    color: #1D4ED8 !important;
}

body :is(.action-menu-list > button, .action-dropdown-menu > button).action-danger,
body .action-dropdown-menu > button.action-danger {
    color: #DC2626 !important;
}

button,
input[type="button"],
input[type="submit"],
input[type="reset"],
[role="button"],
.btn-primary,
.btn-outline,
.btn-sm,
.dash-nav-btn {
    box-sizing: border-box;
    height: var(--standard-button-height) !important;
    min-height: var(--standard-button-height) !important;
    max-height: var(--standard-button-height) !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    line-height: 1.1 !important;
}

@media print {
    @page {
        size: landscape;
        margin: 10mm;
    }

    .app-header,
    .dash-nav-bar,
    .page-title-box,
    #embassy-search-form,
    #embassy-date-filter-form,
    .card-glass > .form-actions,
    #modal-embassy-remarks {
        display: none !important;
    }

    body,
    .app-shell,
    .app-main,
    .card-glass {
        background: #FFFFFF !important;
    }

    .card-glass {
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        box-shadow: none !important;
    }

    .custom-table-container {
        margin: 0 !important;
        overflow: visible !important;
    }

    .embassy-list-table {
        width: 100% !important;
        table-layout: auto !important;
        border: 1px solid #333 !important;
        font-size: 9px !important;
    }

    .embassy-list-table th,
    .embassy-list-table td {
        padding: 4px 5px !important;
        font-size: 9px !important;
        line-height: 1.15 !important;
        white-space: nowrap !important;
        overflow: hidden;
        text-overflow: clip;
    }

    .embassy-list-table th { font-size: 8px !important; }

    .embassy-list-table th:first-child,
    .embassy-list-table td:first-child,
    .embassy-list-table th:last-child,
    .embassy-list-table td:last-child {
        display: none !important;
    }
}

/* Shared Action controls across all panels. */
body .action-dropdown-trigger,
body .action-menu-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px !important;
    width: auto;
    min-width: 0 !important;
    max-width: 100%;
    height: 32px !important;
    min-height: 32px !important;
    max-height: 32px !important;
    padding: 0 10px !important;
    border: 1px solid #CBDCF2 !important;
    border-radius: 6px !important;
    background: #FFFFFF !important;
    color: #174A8B !important;
    font-family: Arial, Helvetica, sans-serif !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    white-space: nowrap;
    box-shadow: none !important;
    transform: none !important;
}
body .action-dropdown-trigger > i,
body .action-menu-trigger > i {
    color: #0967E8 !important;
    font-size: 11px !important;
    transform: none !important;
}
body .action-dropdown-trigger:hover,
body .action-menu-trigger:hover,
body .action-dropdown.is-open .action-dropdown-trigger,
body .action-menu.is-open .action-menu-trigger {
    background: #EFF6FF !important;
    border-color: #0967E8 !important;
    box-shadow: none !important;
}
body .action-dropdown-trigger:focus-visible,
body .action-menu-trigger:focus-visible {
    outline: 2px solid #0967E8;
    outline-offset: 2px;
    box-shadow: none !important;
}
body .action-dropdown-menu,
body .action-menu-list {
    padding: 5px;
    border: 1px solid #DCE5F0;
    border-radius: 8px;
    background: #FFFFFF;
    box-shadow: 0 6px 18px rgba(23, 74, 139, 0.12);
}
body .action-dropdown-menu button,
body .action-menu-list button {
    min-height: 34px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 500;
}

/* Align Agent Details headings, values and badges within their columns. */
.custom-table.agent-details-table th,
.custom-table.agent-details-table td {
    text-align: center;
    vertical-align: middle;
}
.agent-details-table .agent-access-list {
    justify-content: center;
    align-items: center;
}

/* Embassy selection stays centered before the serial column. */
.embassy-list-table th:has(#select-all-checkbox),
.embassy-list-table td:has(.embassy-row-checkbox) {
    text-align: center;
    vertical-align: middle;
}
.embassy-list-table #select-all-checkbox,
.embassy-list-table .embassy-row-checkbox {
    display: block;
    margin: 0 auto;
}

.embassy-date-filter-toolbar .entry-file-search-input-wrap > #embassy-date-filter { padding-left: 0.65rem; }

.embassy-create-table th:has(#create-select-all-checkbox),
.embassy-create-table td:has(.embassy-create-row-checkbox) {
    text-align: center;
    vertical-align: middle;
}
.embassy-create-table #create-select-all-checkbox,
.embassy-create-table .embassy-create-row-checkbox {
    display: block;
    margin: 0 auto;
}

/* Keep the complete submission table inside its card after adding serials. */
.custom-table.embassy-create-table {
    width: 100%;
    min-width: 0 !important;
    max-width: none;
    table-layout: fixed;
}
.custom-table.embassy-create-table th,
.custom-table.embassy-create-table td {
    min-width: 0;
    width: auto;
    overflow-wrap: anywhere;
    white-space: normal;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.ledger-heading-actions:not(:has(button:not([style*="display:none"]):not([style*="display: none"]))) { display: none !important; }

.software-theme-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.software-theme-choice{display:flex;align-items:center;gap:12px;padding:14px;border:1px solid var(--line);border-radius:12px;background:white;color:var(--text-main);font:inherit;cursor:pointer}
.software-theme-choice[aria-pressed=true]{border-color:var(--brand-blue);background:var(--brand-blue-light);box-shadow:0 0 0 2px var(--brand-blue-light)}
.software-theme-swatch{width:24px;height:24px;border-radius:50%;flex-shrink:0}
.software-theme-account{position:relative}.software-theme-account summary{cursor:pointer;list-style:none}.software-theme-account>button{position:absolute;right:0;top:calc(100% + 8px);min-width:160px;background:#fff;border:1px solid var(--line);box-shadow:var(--shadow-sm);z-index:1100;border-radius:10px;padding:12px;color:var(--navy)}
html[data-software-theme] .btn-primary{background:linear-gradient(135deg,var(--brand-blue),var(--brand-navy))}
html[data-software-theme] .btn-primary:hover{background:var(--brand-navy)}
html[data-software-theme] .dash-nav-btn.active{background:var(--brand-blue-light);color:var(--brand-navy);border-color:var(--brand-blue)}
html[data-software-theme] .badge-tag{background:var(--brand-navy)}
html[data-software-theme] .custom-table thead th{background:var(--brand-blue)}
@media print{.software-theme-account,#software-theme-modal{display:none!important}}

#agency-account-menu>summary{display:inline-flex;align-items:center;gap:.6rem}
#agency-account-menu .account-menu-chevron{font-size:.7rem;transition:transform .15s}
#agency-account-menu[open] .account-menu-chevron{transform:rotate(180deg)}
#agency-account-menu .account-menu-options{display:flex!important;flex-direction:column;min-width:230px!important;padding:8px!important;border-color:var(--line)!important;box-shadow:0 10px 28px #10264c20!important}
#agency-account-menu .account-menu-item{display:flex!important;align-items:center;gap:12px;padding:11px 12px!important;color:var(--text-slate)!important;font-size:.85rem!important;font-weight:600;transition:background .15s,color .15s}
#agency-account-menu .account-menu-item i{width:20px;text-align:center;color:var(--brand-navy);font-size:1rem}
#agency-account-menu .account-menu-item:hover,#agency-account-menu .account-menu-item:focus-visible{background:var(--brand-blue-light)!important;color:var(--brand-navy)!important;outline:none}
#agency-account-menu .account-menu-item[data-account=logout],#agency-account-menu .account-menu-item[data-account=exit-admin-access]{order:99;margin-top:5px;border-top:1px solid var(--line);color:#b91c1c!important}
#agency-account-menu .account-menu-item[data-account=logout] i,#agency-account-menu .account-menu-item[data-account=exit-admin-access] i{color:#b91c1c}

.privacy-otp-toggle{padding:12px;border:1px solid var(--line);border-radius:12px;background:var(--bg-elevated)}
.privacy-otp-state{margin-left:auto;padding:3px 10px;border-radius:20px;background:var(--brand-blue-light);color:var(--navy);font-size:.8rem;font-weight:700}
.privacy-password-section{margin-top:24px;border:1px solid var(--line);border-radius:12px;padding:16px}
.privacy-password-section summary{color:var(--navy);font-weight:700;cursor:pointer}
.privacy-password-section[open] summary{margin-bottom:18px}
.privacy-password-section .form-group{margin-bottom:16px}.privacy-password-section button{width:100%}

/* Keep sticky page chrome behind every open popup. */
body:has(.modal-backdrop.active) .app-header{visibility:hidden!important;z-index:0!important;pointer-events:none!important}
body:has(.modal-backdrop.active) .dash-nav-bar{z-index:0!important;pointer-events:none!important}
#agency-details-modal .modal-box,#agency-email-modal .modal-box,#software-theme-modal .modal-box{display:flex;flex-direction:column;max-height:calc(100dvh - 2.5rem)}
#agency-details-modal .modal-header,#agency-email-modal .modal-header,#software-theme-modal .modal-header{flex-shrink:0}
#agency-details-modal .modal-body,#agency-email-modal .modal-body,#software-theme-modal .modal-body{overflow-y:auto;min-height:0;overscroll-behavior:contain}
#agency-details-modal .form-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
#agency-details-modal .form-grid>.form-group{min-width:0}
#agency-details-modal .form-grid>.form-group:nth-child(3){grid-column:1/-1}
@media (max-width:650px){#agency-details-modal .form-grid{grid-template-columns:minmax(0,1fr)}}

/* Keep resizable Embassy draft tables inside their card at every viewport width. */
.embassy-draft-table-container {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    border-radius: 12px;
    scrollbar-width: thin;
    scrollbar-color: #b9c8df #f5f9ff;
}
.embassy-draft-table-container .embassy-create-table th,
.embassy-draft-table-container .embassy-create-table td { vertical-align: middle; }
.embassy-draft-table-container [data-remove-draft] { white-space: nowrap; padding: .5rem .75rem; }

/* Respect each dialog's own max-width; only constrain its width to the backdrop. */
@media screen {
    .modal-backdrop .modal-box { width: 100%; }
    .modal-backdrop .modal-box.full-entry-modal-box { max-width: 1320px; }
    .modal-backdrop .modal-box.full-billing-modal-box { max-width: 1300px; }
    .modal-backdrop .modal-box.ledger-modal-box { max-width: 1400px; }
}

/* Screen layouts fit their container; printed forms retain their paper dimensions. */
@media screen {
    html, body { max-width: 100%; overflow-x: clip; }
    .main-shell, .panel-workspace, .card-glass, .form-group,
    .modal-box, .team-layout, .team-chat { min-width: 0; }
    .dash-nav-bar, .agent-access-grid, .staff-access-grid { flex-wrap: wrap !important; }
    .custom-table-container, .candidate-table-container, .list-table-scroll-container,
    .embassy-draft-table-container, #active-ledger-table-container, #archived-ledger-table-container {
        width: 100%; max-width: 100%; min-width: 0; box-sizing: border-box;
        height: auto !important; max-height: none !important;
        overflow-x: auto !important; overflow-y: visible !important;
    }
    .custom-table, .candidate-list-table, .embassy-create-table {
        width: 100% !important; min-width: 0 !important; max-width: 100%; table-layout: fixed !important;
    }
    :is(.custom-table, .candidate-list-table, .embassy-create-table) :is(th,td) {
        min-width: 0 !important; white-space: normal !important; overflow-wrap: anywhere;
    }
    :is(.custom-table, .candidate-list-table, .embassy-create-table) :is(input,select,textarea,button,.status-pill) {
        min-width: 0; max-width: 100%; box-sizing: border-box; white-space: normal; overflow-wrap: anywhere;
    }
}

@media screen {
    .custom-table td:has(.action-dropdown), .custom-table td:has(.action-menu),
    .candidate-list-table td:has(.action-dropdown), .candidate-list-table td:has(.action-menu) {
        vertical-align: middle !important;
    }
    :is(.custom-table, .candidate-list-table) :is(.action-dropdown, .action-menu) {
        display: inline-flex !important; align-items: center; justify-content: flex-end;
        vertical-align: middle; margin: 0 !important; padding: 0 !important;
        min-height: 32px; max-width: 100%; line-height: 1;
    }
    body :is(.action-dropdown-trigger, .action-menu-trigger) {
        flex-shrink: 0; margin: 0 !important; vertical-align: middle;
        white-space: nowrap !important; position: relative; top: auto !important; bottom: auto !important;
        transition: background-color .15s, border-color .15s !important;
    }
    :is(.action-dropdown-menu, .action-menu-list):popover-open {
        transform: none !important; animation: none !important;
        transition: none !important; box-sizing: border-box;
    }
}

/* Agent payment request */
#modal-agent-add-fund .agent-fund-box { width:min(600px,94vw); max-width:600px; }
#modal-agent-add-fund .modal-header { padding:24px; }
#modal-agent-add-fund .modal-body { padding:24px; }
.agent-fund-heading { display:flex; align-items:center; gap:14px; }
.agent-fund-heading h3 { margin:0; font-size:21px; }
.agent-fund-heading p { margin:5px 0 0; font-size:13px; color:#64748b; }
.agent-fund-icon { width:48px; height:48px; flex-shrink:0; display:grid; place-items:center; background:#eaf2ff; color:#2563eb; border-radius:14px; font-size:22px; }
#agent-add-fund-form { display:grid; gap:20px; }
#agent-add-fund-form .form-group { margin:0; display:flex; flex-direction:column; gap:8px; min-width:0; }
#agent-add-fund-form label { margin:0; font-size:13px; font-weight:600; }
#agent-add-fund-form label i { color:#2563eb; margin-right:5px; }
.agent-fund-grid { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.agent-fund-amount { position:relative; }
.agent-fund-amount span { position:absolute; left:14px; top:50%; transform:translateY(-50%); color:#64748b; font-weight:600; }
#agent-add-fund-amount { padding-left:48px; width:100%; }
.agent-fund-upload { border:1.5px dashed #b8cbee; border-radius:14px; background:#f8fbff; padding:20px; display:flex; flex-direction:column; align-items:center; gap:8px; }
.agent-fund-upload > i { color:#2563eb; font-size:26px; }
.agent-fund-upload strong { font-size:14px; color:#1e3a5f; }
.agent-fund-upload > span { color:#64748b; font-size:12px; }
#agent-add-fund-receipt { background:white; padding:8px; font-size:12px; width:100%; }
#agent-add-fund-receipt::file-selector-button { border:0; background:#eaf2ff; color:#1d4ed8; border-radius:6px; padding:8px 12px; margin-right:10px; cursor:pointer; }
#agent-add-fund-preview { max-height:180px; max-width:100%; object-fit:contain; border-radius:8px; }
#agent-add-fund-preview[hidden] { display:none !important; }
.agent-fund-footer { display:flex; justify-content:flex-end; gap:12px; border-top:1px solid #e5edf7; padding-top:20px; }
@media(max-width:540px) { .agent-fund-grid { grid-template-columns:1fr; } .agent-fund-heading p { max-width:210px; } .agent-fund-footer { flex-wrap:wrap; } }

.submit-group-picker > .duration-picker-trigger,.submit-group-picker > .duration-picker-menu{display:none!important}
#embassy-submit-group[hidden]{display:none!important}
.insurance-relation-toggle{position:absolute;right:.35rem;top:50%;transform:translateY(-50%);width:30px;height:30px;padding:0;border:0;background:transparent;color:var(--brand-blue);cursor:pointer;display:flex;align-items:center;justify-content:center}.insurance-relation-toggle i{transition:transform .15s}.insurance-relation-picker.is-open .insurance-relation-toggle i{transform:rotate(180deg)}.insurance-relation-toggle:focus-visible{outline:2px solid var(--brand-blue);border-radius:5px}
.entry-file-search-results{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,360px),1fr));gap:10px;padding:12px;background:var(--bg-elevated);border-color:var(--border-subtle)}
.entry-file-search-results[hidden]{display:none!important}
.entry-file-search-result-item{display:grid;grid-template-columns:40px minmax(0,1fr) auto;align-items:center;gap:12px;min-width:0;width:100%;padding:15px;border:1px solid var(--border-subtle);border-radius:12px;background:var(--bg-card);color:var(--text-main);font:inherit;text-align:left;cursor:pointer;transition:border-color .15s,box-shadow .15s}
.entry-file-search-result-item:hover,.entry-file-search-result-item:focus-visible{border-color:var(--brand-blue);box-shadow:0 3px 12px #174a8b12;outline:2px solid transparent}
.entry-result-icon{display:flex;align-items:center;justify-content:center;width:40px;height:44px;background:var(--brand-blue-light);border-radius:9px;color:var(--brand-blue)}.entry-result-icon svg{width:23px;height:23px}
.entry-result-content{display:grid;gap:8px;min-width:0}.entry-result-heading{display:flex;align-items:center;flex-wrap:wrap;gap:8px}.entry-result-heading>strong{font-size:14px;font-weight:700;overflow-wrap:anywhere}
.entry-result-file{padding:3px 7px;border-radius:5px;background:var(--bg-elevated);color:var(--navy);font-size:11px;font-weight:700;overflow-wrap:anywhere}
.entry-result-meta{display:flex;flex-wrap:wrap;gap:5px 16px;color:var(--text-muted);font-size:12px}.entry-result-meta b{font-weight:500;color:var(--text-slate);margin-left:5px;overflow-wrap:anywhere}
.entry-result-open{display:inline-flex;align-items:center;gap:8px;font-size:12px;font-weight:600;color:var(--brand-blue);white-space:nowrap}@media(max-width:480px){.entry-file-search-result-item{grid-template-columns:32px minmax(0,1fr);padding:12px;gap:8px}.entry-result-icon{width:32px}.entry-result-open{grid-column:2}}
/* Result cards contain two text rows; the global toolbar button height must not constrain them. */
.entry-file-search-results .entry-file-search-result-item{height:auto!important;min-height:80px!important;max-height:none!important;padding:14px 16px!important;line-height:1.45!important;align-content:center}
.entry-file-search-results .entry-result-heading{line-height:1.4}.entry-file-search-results .entry-result-meta{line-height:1.5}
#entry-file-search-form + .entry-file-search-results{margin:14px 0 0}
.card-glass:has(> #entry-file-search-form){padding:24px 32px}
@media(max-width:600px){.card-glass:has(> #entry-file-search-form){padding:18px}.entry-file-search-results .entry-file-search-result-item{padding:12px!important}}
.entry-duplicate-check{display:flex;align-items:center;flex-wrap:wrap;gap:5px 7px;margin-top:6px;font-size:12px;line-height:1.4;color:var(--text-muted)}.entry-duplicate-check[hidden]{display:none!important}.entry-duplicate-check[data-state=available]{color:#047857}.entry-duplicate-check[data-state=duplicate]{color:#b42318}.entry-duplicate-check[data-state=error]{color:#92400e}.entry-duplicate-mark{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;border-radius:50%;background:var(--bg-elevated);font-weight:700;flex-shrink:0}.entry-duplicate-check[data-state=available] .entry-duplicate-mark{background:#d1fae5}.entry-duplicate-check[data-state=duplicate] .entry-duplicate-mark{background:#fee2e2}.entry-duplicate-check .entry-duplicate-open{height:auto!important;min-height:24px!important;max-height:none!important;border:0;background:transparent;padding:2px 0!important;color:inherit;font:inherit;font-weight:600;text-align:left;text-decoration:underline;text-underline-offset:3px;cursor:pointer;line-height:1.4!important}input[data-duplicate-state=duplicate]{border-color:#ef9a9a!important}input[data-duplicate-state=available]{border-color:#6ee7b7!important}
/* Agency Visa Details: five fields above, four below; Sponsor Name keeps its quarter width. */
.agency-visa-details-section > .form-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
.agency-visa-details-section > .form-grid > .form-group{min-width:0}
@media(min-width:1200px){
.agency-visa-details-section > .form-grid{grid-template-columns:repeat(12,minmax(0,1fr))}
.agency-visa-details-section > .form-grid > .form-group{grid-column:span 3}
.agency-visa-details-section > .form-grid > .form-group:has(#visa-file-no),.agency-visa-details-section > .form-grid > .form-group:has(#visa-no),.agency-visa-details-section > .form-grid > .form-group:has(#visa-id-no){grid-column:span 2}
}
@media(max-width:600px){.agency-visa-details-section > .form-grid{grid-template-columns:minmax(0,1fr)}}
.entry-duplicate-check[data-state=accepted]{color:#92400e}.entry-duplicate-check[data-state=accepted] .entry-duplicate-mark{background:#fef3c7}input[data-duplicate-state=accepted]{border-color:#fbbf24!important}.entry-duplicate-check .entry-duplicate-allow{display:inline-flex;flex-direction:row;align-items:center;gap:6px;flex-basis:100%;margin:2px 0 0;font-size:12px;font-weight:500;color:var(--navy);cursor:pointer}.entry-duplicate-check .entry-duplicate-allow input{width:16px;height:16px;min-height:16px;max-height:16px;flex:0 0 16px;padding:0;margin:0;box-shadow:none;accent-color:var(--brand-blue)}
.entry-duplicate-check[data-state=duplicate]{display:grid;grid-template-columns:18px minmax(0,1fr);align-items:start;gap:7px;background:#fff7f7;border:1px solid #fecaca;border-radius:9px;padding:10px;margin-top:8px;font-size:12px}
.entry-duplicate-actions{grid-column:1/-1;display:flex;flex-wrap:wrap;gap:6px;margin-top:2px}
.entry-duplicate-check .entry-duplicate-actions button{display:inline-flex;align-items:center;justify-content:center;gap:5px;width:auto;height:auto!important;min-height:30px!important;max-height:none!important;border:1px solid var(--border-subtle);border-radius:6px;padding:6px 9px!important;background:var(--bg-card);color:var(--navy);font:inherit;font-size:11px;font-weight:600;line-height:1.2!important;text-decoration:none;cursor:pointer}
.entry-duplicate-check .entry-duplicate-actions .entry-duplicate-continue{background:var(--brand-blue);border-color:var(--brand-blue);color:#fff}
.entry-duplicate-check .entry-duplicate-actions button:hover{box-shadow:0 2px 5px #174a8b20}.entry-duplicate-check .entry-duplicate-actions button:focus-visible{outline:2px solid var(--brand-blue);outline-offset:2px}

.searchable-agent-picker > .duration-picker-trigger, .searchable-agent-picker > .duration-picker-menu { display: none !important; }

.file-delete-mini{position:fixed;bottom:20px;right:20px;z-index:10010;display:flex;gap:8px;padding:12px;background:var(--white,#fff);border:1px solid var(--border-color,#dbe4f0);border-radius:14px;box-shadow:0 8px 28px #0003;flex-wrap:wrap;max-width:calc(100vw - 40px)}
.file-delete-mini[hidden]{display:none!important}

.file-delete-bar{position:fixed;z-index:10010;bottom:16px;left:16px;right:16px;max-width:620px;margin:auto;border:1px solid #cbd5e1;border-radius:12px;background:#fff;box-shadow:0 12px 32px #0f172a38;overflow:hidden;color:#174a8b}
.file-delete-bar[hidden]{display:none!important}
.file-delete-bar-header{display:flex;align-items:center;justify-content:space-between;padding:8px 16px;border-bottom:1px solid #e2e8f0}
.file-delete-bar-body{display:flex;align-items:center;gap:12px;padding:12px 16px;flex-wrap:wrap}
.file-delete-bar-body p{margin:0!important;font-size:14px}
.file-delete-bar-body .form-actions{display:flex;gap:8px;margin:0!important;padding:0!important;border:0!important;flex-wrap:wrap}
.file-delete-bar-body [data-minimize]{display:none}
.file-delete-bar-progress{height:5px;background:#e2e8f0}
.file-delete-bar-progress span{display:block;height:100%;background:#2563eb;transform-origin:left}

.activity-action-pill{white-space:nowrap;word-break:normal;overflow-wrap:normal;max-width:none!important}

.activity-page-table .activity-action-pill{white-space:nowrap!important;overflow-wrap:normal!important;word-break:normal!important;display:inline-flex;align-items:center;border-radius:8px;padding:6px 10px;font-size:12px;line-height:1.4;max-width:none!important}
.activity-page-table tbody td{padding:14px 16px!important;vertical-align:middle!important}
.activity-page-table td:has(.activity-action-pill){white-space:nowrap!important}
.activity-page-table td:last-child button{white-space:nowrap!important}
.activity-page-table td:nth-child(2){white-space:nowrap!important}
@media(max-width:900px){.activity-page-table .activity-action-pill{white-space:normal!important;overflow-wrap:normal!important;word-break:normal!important;max-width:100%!important}.activity-page-table tbody td{padding:10px 8px!important}}

.agency-linked-attorney{display:inline-flex;align-items:center;gap:7px;color:var(--navy);font-size:12px;font-weight:600}.agency-linked-attorney i{color:var(--brand-blue)}

.integration-pair{display:flex;align-items:center;gap:8px}.integration-pair>span[data-integration]{display:inline-flex;min-width:0}.integration-divider{color:var(--text-muted);flex:none}.integration-pair .status-pill{font-size:11px;padding:5px 8px;gap:4px}.agency-contact-line{display:flex;align-items:center;gap:6px;margin-top:5px;color:var(--navy);font-size:12px}

.admin-agencies-fit tbody td{padding:16px 12px!important;vertical-align:middle!important}
.admin-agencies-fit td:nth-child(2){overflow-wrap:normal!important;word-break:normal!important}
.admin-agencies-fit td:nth-child(2)>div:last-child{font-size:11px!important;overflow-wrap:anywhere}
.admin-agencies-fit td:nth-child(5),.admin-agencies-fit td:nth-child(6),.admin-agencies-fit td:nth-child(7){white-space:nowrap!important}
.admin-agencies-fit .status-pill{white-space:nowrap!important;font-size:11px;letter-spacing:0;padding:7px 9px;gap:5px}
.admin-agencies-fit .integration-pair{gap:7px;flex-wrap:nowrap}
.admin-agencies-fit .agency-linked-attorney{font-size:12px;line-height:1.5}

.linked-account-type{display:block;margin-top:4px;padding-left:21px;font-size:11px;font-weight:500;color:var(--text-muted)}
.dash-nav-btn :is(i,span,svg){cursor:inherit}
button.dash-nav-btn:disabled{cursor:not-allowed}

.tenant-fund-request-box{width:min(1450px,98vw)!important;max-width:1450px!important}
.tenant-fund-request-body{overflow:auto!important;padding:16px 24px 20px!important}
.tenant-fund-request-table{width:100%;min-width:900px;table-layout:auto}
.tenant-fund-request-table th{height:36px!important;padding:7px 12px!important}
.tenant-fund-request-table td{height:auto!important;padding:8px 12px!important;line-height:1.3!important;vertical-align:middle!important}
.tenant-fund-request-table .tenant-view-receipt{display:inline-flex;align-items:center;gap:6px;min-height:34px!important;padding:6px 10px!important;white-space:nowrap;font-size:12px}
.tenant-receipt-viewer{position:fixed!important;inset:0!important;margin:auto!important;width:fit-content;height:fit-content;max-width:94vw;max-height:90vh;padding:0;border:0;border-radius:14px;background:#fff;box-shadow:0 24px 70px #0f172a55;overflow:hidden}
.tenant-receipt-viewer::backdrop{background:rgba(15,23,42,.72)}
.tenant-receipt-viewer-header{display:flex;align-items:center;justify-content:space-between;gap:16px;height:58px;padding:10px 16px;border-bottom:1px solid var(--border-subtle);color:var(--navy)}
.tenant-receipt-viewer-header strong{display:flex;align-items:center;gap:8px}
.tenant-receipt-viewer-body{display:flex;align-items:center;justify-content:center;width:fit-content;height:fit-content;max-width:94vw;max-height:calc(90vh - 58px);padding:10px;background:#f1f5f9;overflow:auto}
.tenant-receipt-viewer-body img{display:block;width:auto;height:auto;max-width:calc(94vw - 20px);max-height:calc(90vh - 78px);object-fit:contain;border-radius:8px;box-shadow:0 4px 18px #0f172a20}
.tenant-request-status{font-weight:800}
.tenant-request-status.is-approved{color:#15803d}
.tenant-request-status.is-rejected{color:#b91c1c}
.tenant-request-status.is-pending{color:#b45309}
.tenant-request-action.is-approve{color:#15803d!important;border-color:#86efac!important;background:#f0fdf4!important}
.tenant-request-action.is-reject{color:#b91c1c!important;border-color:#fecaca!important;background:#fef2f2!important}
@media(max-width:700px){.tenant-fund-request-body{padding:10px!important}.tenant-receipt-viewer{max-width:96vw;max-height:88vh}.tenant-receipt-viewer-body{max-width:96vw;max-height:calc(88vh - 58px);padding:8px}.tenant-receipt-viewer-body img{max-width:calc(96vw - 16px);max-height:calc(88vh - 74px)}}

/* Keep Action dropdowns on the same basic control style after page-specific rules. */
body :is(.action-menu-trigger, .action-dropdown-trigger) {
    height:40px!important;min-height:40px!important;max-height:40px!important;
    padding:0 12px!important;border:1px solid #d7e0ea!important;border-radius:8px!important;
    background:#fff!important;color:#1e293b!important;font:500 14px/1.2 Arial,Helvetica,sans-serif!important;
    box-shadow:none!important;transform:none!important;
}
body :is(.action-menu-trigger, .action-dropdown-trigger):hover,
body :is(.action-menu, .action-dropdown).is-open > :is(.action-menu-trigger, .action-dropdown-trigger) {
    border-color:#2563eb!important;background:#fff!important;color:#1e293b!important;box-shadow:none!important;
}
body :is(.action-menu-list, .action-dropdown-menu) {
    padding:5px!important;border:1px solid #d7e0ea!important;border-radius:8px!important;
    background:#fff!important;box-shadow:0 8px 20px rgba(15,23,42,.12)!important;
}

/* Action controls must remain a single clean line.  Their menus grow with
   their actions; no nested horizontal or vertical scrollbar is allowed. */
body :is(.form-actions, .candidate-toolbar-actions, .system-notice-admin-actions,
    .action-dropdown, .action-menu) { min-width:0; max-height:none!important; overflow:visible!important; }
body :is(.form-actions, .candidate-toolbar-actions, .system-notice-admin-actions) { display:flex; align-items:center; flex-wrap:wrap; gap:10px; }
body :is(.form-actions, .candidate-toolbar-actions, .system-notice-admin-actions) > :is(button, a),
body :is(.action-dropdown-trigger, .action-menu-trigger) { display:inline-flex!important; align-items:center!important; justify-content:center!important; flex:0 0 auto; white-space:nowrap!important; overflow:visible!important; text-overflow:clip!important; vertical-align:middle; }
body :is(.action-dropdown-menu, .action-menu-list) { width:max-content; min-width:180px; max-width:min(360px,calc(100vw - 24px)); max-height:none!important; overflow:visible!important; }
body :is(.action-dropdown-menu, .action-menu-list) :is(button, a) { display:flex!important; align-items:center!important; min-height:36px!important; height:auto!important; max-height:none!important; white-space:nowrap!important; overflow:visible!important; text-overflow:clip!important; line-height:1.35!important; }

/* Subscription review has dense, fixed business columns.  Reserve enough
   room for its status and Actions control instead of allowing either label
   to split into two lines.  The first column is the shared serial column. */
.subscription-payment-table { table-layout:fixed!important; }
.subscription-payment-table :is(th,td):nth-child(1) { width:4%!important; }
.subscription-payment-table :is(th,td):nth-child(2) { width:10%!important; }
.subscription-payment-table :is(th,td):nth-child(3) { width:9%!important; }
.subscription-payment-table :is(th,td):nth-child(4) { width:13%!important; }
.subscription-payment-table :is(th,td):nth-child(5) { width:14%!important; }
.subscription-payment-table :is(th,td):nth-child(6) { width:14%!important; }
.subscription-payment-table :is(th,td):nth-child(7) { width:15%!important; }
.subscription-payment-table :is(th,td):nth-child(8) { width:9%!important; white-space:nowrap!important; text-align:center!important; }
.subscription-payment-table :is(th,td):nth-child(9) { width:12%!important; min-width:128px!important; white-space:nowrap!important; text-align:center!important; }
.subscription-payment-table .status-pill { display:inline-flex!important; align-items:center!important; justify-content:center!important; min-width:106px; white-space:nowrap!important; }
.subscription-payment-table .payment-action-menu { display:inline-flex!important; min-width:112px; }
.subscription-payment-table .payment-action-menu .action-menu-trigger { width:112px!important; min-width:112px!important; }

/* Keep every action control inside its own available space.  A narrow table
   column or phone viewport may move a control to the next line, but never
   lets buttons overlap, escape their card, or create a nested scrollbar. */
body :is(.action-dropdown, .action-menu, .form-actions, .candidate-toolbar-actions,
    .system-notice-admin-actions) { box-sizing:border-box; max-width:100%; }
body :is(.action-dropdown, .action-menu) { display:inline-flex; align-items:center; justify-content:center; }
body :is(.action-dropdown-trigger, .action-menu-trigger) {
    box-sizing:border-box!important;
    width:auto!important;
    min-width:0!important;
    max-width:100%!important;
    height:38px!important;
    min-height:38px!important;
    max-height:38px!important;
    padding-inline:10px!important;
    font-size:clamp(12px,1.15vw,14px)!important;
}
body :is(.form-actions, .candidate-toolbar-actions, .system-notice-admin-actions) > :is(button, a, .action-dropdown, .action-menu) {
    box-sizing:border-box;
    min-width:0!important;
    max-width:100%!important;
}
.custom-table :is(td, th):has(> :is(.action-dropdown, .action-menu)) {
    min-width:0!important;
    overflow:visible!important;
    text-align:center!important;
}
.custom-table :is(.action-dropdown, .action-menu) { max-width:100%; }
@media(max-width:600px) {
    body :is(.form-actions, .candidate-toolbar-actions, .system-notice-admin-actions) > :is(button, a, .action-dropdown, .action-menu) { flex:1 1 150px; }
    body :is(.action-dropdown-trigger, .action-menu-trigger) { width:100%!important; font-size:13px!important; }
}

/* Workspace content belongs to the document flow.  Cards must grow with their
   content instead of creating a second scrollbar inside the page. */
.panel-workspace :is(.card-glass, .custom-table-container, .candidate-table-container,
    .list-table-scroll-container, #active-ledger-table-container, #archived-ledger-table-container) {
    height:auto!important;
    max-height:none!important;
    overflow:visible!important;
    overscroll-behavior:auto;
}
.panel-workspace :is(.custom-table-container, .candidate-table-container,
    .list-table-scroll-container, #active-ledger-table-container, #archived-ledger-table-container) > table {
    width:100%!important;
    min-width:0!important;
    table-layout:fixed;
}
.panel-workspace :is(.custom-table-container, .candidate-table-container,
    .list-table-scroll-container, #active-ledger-table-container, #archived-ledger-table-container) :is(th, td) {
    white-space:normal!important;
    overflow-wrap:anywhere;
    word-break:break-word;
}

/* Admin pages use .main-shell (rather than .panel-workspace).  Apply the same
   document-flow rule to every normal page table/card; dialogs and print views
   remain deliberately viewport-bound elsewhere. */
.main-shell :is(.card-glass, .custom-table-container, .candidate-table-container,
    .list-table-scroll-container, #active-ledger-table-container, #archived-ledger-table-container) {
    height:auto!important;
    max-height:none!important;
    overflow:visible!important;
    overscroll-behavior:auto;
}
.main-shell :is(.custom-table-container, .candidate-table-container,
    .list-table-scroll-container, #active-ledger-table-container, #archived-ledger-table-container) > table {
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    table-layout:fixed!important;
}
.main-shell :is(.custom-table-container, .candidate-table-container,
    .list-table-scroll-container, #active-ledger-table-container, #archived-ledger-table-container) :is(th, td) {
    min-width:0!important;
    white-space:normal!important;
    overflow-wrap:anywhere!important;
    word-break:break-word;
}

/* Embassy print settings: keep the controls in one desktop row and show a
   realistic, responsive sample of the printed Embassy list beneath them. */
#embassy-print-settings-modal .modal-box { max-width:1180px; }
#embassy-print-settings-modal .embassy-print-settings-heading {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    margin-bottom:10px;
    padding-bottom:8px;
    border-bottom:1px solid var(--border-subtle);
}
#embassy-print-settings-modal .embassy-print-settings-heading h3 { margin:0; color:var(--brand-navy); font-size:1rem; }
#embassy-print-settings-modal .embassy-print-settings-heading span { display:block; margin-top:3px; color:var(--text-muted); font-size:.82rem; }
#embassy-print-settings-modal .embassy-print-settings-actions { display:flex; align-items:center; gap:8px; flex-shrink:0; }
#embassy-print-settings-modal [data-print-warning] { margin:0; }
#embassy-print-settings-modal [data-print-warning]:empty { display:none; }
#embassy-print-settings-modal .embassy-print-settings-fields {
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:12px;
    margin-bottom:12px;
}
#embassy-print-settings-modal .embassy-print-settings-fields > label {
    display:flex;
    flex-direction:column;
    align-items:stretch;
    gap:7px;
    min-width:0;
    padding:10px 12px;
    border:1px solid #d9e3ef;
    border-radius:11px;
    background:linear-gradient(180deg,#fff 0%,#f8fbff 100%);
    white-space:normal;
    font-size:.84rem;
    font-weight:650;
    color:var(--text-slate);
}
#embassy-print-settings-modal .embassy-print-settings-fields input {
    box-sizing:border-box;
    width:100%;
    min-width:0;
    height:40px;
    padding:8px 11px;
    border:1px solid #cbd7e5;
    border-radius:9px;
    background:#fff;
    color:var(--text-main);
    font-family:inherit;
    font-size:.96rem;
    font-weight:600;
    line-height:1.2;
    box-shadow:0 1px 2px #18395b0d;
    transition:border-color .16s ease,box-shadow .16s ease;
}
#embassy-print-settings-modal .embassy-print-settings-fields input:focus {
    outline:none;
    border-color:var(--brand-blue);
    box-shadow:0 0 0 3px rgba(37,99,235,.13);
}
#embassy-print-settings-modal .embassy-gap-move-card {
    display:flex;
    flex-direction:column;
    justify-content:space-between;
    gap:7px;
    min-width:0;
    padding:10px 12px;
    border:1px solid #d9e3ef;
    border-radius:11px;
    background:linear-gradient(180deg,#fff 0%,#f8fbff 100%);
    color:var(--text-slate);
    font-size:.84rem;
    font-weight:650;
}
#embassy-print-settings-modal .embassy-gap-controls { display:flex; align-items:center; gap:8px; min-width:0; }
#embassy-print-settings-modal .embassy-gap-controls button {
    display:inline-grid;
    place-items:center;
    flex:0 0 36px;
    width:36px;
    height:40px;
    padding:0;
    border:1px solid var(--border-subtle);
    border-radius:8px;
    background:#fff;
    color:var(--brand-navy);
    font-size:1.05rem;
    font-weight:700;
    cursor:pointer;
}
#embassy-print-settings-modal .embassy-gap-controls button:hover { background:#edf4ff; border-color:#9db9e8; }
#embassy-print-settings-modal .embassy-print-settings-body { display:flex; flex:1 1 auto; flex-direction:column; gap:10px; min-height:0; overflow:auto; }
#embassy-print-settings-modal .embassy-settings-preview {
    flex:0 0 auto;
    border:1px solid var(--border-subtle);
    border-radius:12px;
    overflow:hidden;
    background:#f8fbff;
}
#embassy-print-settings-modal .embassy-settings-preview > header {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    padding:10px 14px;
    border-bottom:1px solid var(--border-subtle);
}
#embassy-print-settings-modal .embassy-settings-preview h3,
#embassy-print-settings-modal .embassy-settings-preview-page h4 { margin:0; }
#embassy-print-settings-modal [data-preview-count] { color:var(--text-muted); font-size:.82rem; }
#embassy-print-settings-modal .embassy-settings-preview-sheet {
    display:flex;
    flex-direction:column;
    width:min(940px,100%);
    max-width:100%;
    aspect-ratio:297/210;
    box-sizing:border-box;
    margin:12px auto;
    padding:4px;
    border:1px solid #aab7c7;
    background:#fff;
    box-shadow:0 3px 14px #17365b20;
    overflow:hidden;
}
#embassy-print-settings-modal .embassy-settings-space {
    display:flex;
    align-items:center;
    justify-content:center;
    flex:0 0 auto;
    min-height:0;
    padding:0 4px;
    border-bottom:1px dashed #9aacc2;
    text-align:center;
    color:#52677d;
    font-size:clamp(7px,.8vw,10px);
    white-space:nowrap;
    overflow:hidden;
}
#embassy-print-settings-modal .embassy-settings-print-table {
    width:100%;
    border-collapse:collapse;
    table-layout:fixed;
    direction:rtl;
    color:#111;
}
#embassy-print-settings-modal .embassy-settings-print-table th,
#embassy-print-settings-modal .embassy-settings-print-table td {
    height:var(--preview-row-height,7mm);
    padding:2px 3px;
    border:1px solid #222;
    text-align:center;
    overflow-wrap:anywhere;
    vertical-align:middle;
    line-height:1.15;
}
#embassy-print-settings-modal .embassy-settings-print-table th { font-weight:700; }
#embassy-print-settings-modal .embassy-settings-print-table .embassy-preview-title th {
    height:var(--preview-title-height,9mm);
    font-size:1.2em;
}
#embassy-print-settings-modal .embassy-settings-print-table .embassy-preview-meta th,
#embassy-print-settings-modal .embassy-settings-print-table thead tr:last-child th { height:var(--preview-heading-height,8mm); }
#embassy-print-settings-modal .embassy-settings-print-table bdi { direction:ltr; }
@media (max-width:900px) {
    #embassy-print-settings-modal .embassy-print-settings-fields { grid-template-columns:minmax(0,1fr); }
    #embassy-print-settings-modal .embassy-print-settings-fields > label { display:grid; grid-template-columns:minmax(0,1fr) minmax(160px,260px); align-items:center; }
}
@media (max-width:600px) {
    #embassy-print-settings-modal .embassy-print-settings-heading { align-items:flex-start; flex-direction:column; gap:4px; }
    #embassy-print-settings-modal .embassy-print-settings-actions { align-self:flex-end; }
    #embassy-print-settings-modal .embassy-print-settings-fields > label { grid-template-columns:minmax(0,1fr); }
    #embassy-print-settings-modal .embassy-settings-preview > header { align-items:flex-start; flex-direction:column; }
}
