/* TrackServe Excel Import Module Styling */

.excel-import-container {
    display: flex;
    flex-direction: column;
    gap: 18px;
    width: 100%;
    margin-bottom: 30px;
}

/* Header & Active Dataset Bar */
.import-header-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    box-shadow: var(--shadow);
}

.import-header-title h1 {
    margin: 0 0 4px 0;
    font-size: 20px;
    font-weight: 800;
    color: #17233c;
    display: flex;
    align-items: center;
    gap: 8px;
}

.import-header-title p {
    margin: 0;
    font-size: 12px;
    color: var(--muted);
}

.active-dataset-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 6px 12px;
    border-radius: 8px;
}

.active-dataset-label {
    font-size: 11px;
    font-weight: 700;
    color: #475569;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 5px;
}

.active-dataset-dropdown {
    min-width: 200px;
    font-size: 12px;
    padding: 5px 8px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    font-weight: 600;
    color: #1e293b;
    outline: none;
    cursor: pointer;
}

.active-dataset-dropdown:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(11, 77, 184, 0.15);
}

/* Stepper Workflow Header */
.stepper-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 20px;
    box-shadow: var(--shadow);
}

.stepper-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    max-width: 900px;
    margin: 0 auto;
}

.stepper-nav::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 40px;
    right: 40px;
    height: 3px;
    background: #e2e8f0;
    z-index: 1;
}

.stepper-step {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #ffffff;
    padding: 0 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.step-circle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #f1f5f9;
    border: 2px solid #cbd5e1;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    transition: all 0.25s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}

.stepper-step.active .step-circle {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
    box-shadow: 0 0 0 4px rgba(11, 77, 184, 0.18);
}

.stepper-step.completed .step-circle {
    background: #10b981;
    border-color: #10b981;
    color: #ffffff;
}

.step-label {
    margin-top: 6px;
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    text-align: center;
}

.stepper-step.active .step-label {
    color: var(--primary);
    font-weight: 800;
}

.stepper-step.completed .step-label {
    color: #10b981;
}

/* Step 1: Upload & Validation */
.upload-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}

.dropzone-container {
    border: 2px dashed #93c5fd;
    background: #f8fafc;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.dropzone-container:hover, .dropzone-container.drag-over {
    border-color: var(--primary);
    background: #eff6ff;
    transform: translateY(-1px);
}

.dropzone-icon {
    font-size: 44px;
    margin-bottom: 12px;
    color: var(--primary);
    display: inline-block;
    animation: floatIcon 3s ease-in-out infinite;
}

@keyframes floatIcon {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

.dropzone-title {
    font-size: 15px;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 6px;
}

.dropzone-subtitle {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 16px;
}

.dropzone-file-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
    z-index: 5;
}

.supported-badge-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    font-size: 11px;
    color: #64748b;
}

.format-pill {
    background: #e0f2fe;
    color: #0369a1;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 10.5px;
}

.quick-sample-box {
    margin-top: 20px;
    padding: 12px 16px;
    background: #f1f5f9;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.quick-sample-text {
    font-size: 11.5px;
    color: #334155;
    font-weight: 600;
}

/* File Validation State Box */
.validation-result-box {
    margin-top: 18px;
    border-radius: 8px;
    padding: 14px 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.validation-result-box.valid {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}

.validation-result-box.invalid {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.validation-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.validation-content {
    flex: 1;
}

.validation-content strong {
    display: block;
    font-size: 13px;
    font-weight: 800;
    margin-bottom: 2px;
}

.validation-content p {
    margin: 0;
    font-size: 11.5px;
}

/* Step 2: Preview & Mapping */
.mapping-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sheet-selector-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
}

.sheet-selector-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sheet-tab-btn {
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 11.5px;
    font-weight: 700;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #475569;
    cursor: pointer;
    transition: all 0.15s ease;
}

.sheet-tab-btn:hover {
    background: #f8fafc;
    border-color: #94a3b8;
}

.sheet-tab-btn.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 2px 6px rgba(11, 77, 184, 0.2);
}

.mapping-grid-container {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 14px;
}

.mapping-grid-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.mapping-grid-title {
    font-size: 12px;
    font-weight: 800;
    color: #1e293b;
}

.mapping-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11.5px;
    background: #ffffff;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.mapping-table th {
    background: #f1f5f9;
    padding: 8px 12px;
    text-align: left;
    font-weight: 700;
    color: #475569;
    border-bottom: 1px solid #cbd5e1;
}

.mapping-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.mapping-table tr:hover {
    background: #fafafa;
}

.field-select {
    padding: 4px 8px;
    font-size: 11.5px;
    border-radius: 4px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    font-weight: 600;
    color: #1e293b;
    width: 100%;
    max-width: 220px;
}

.badge-auto {
    background: #dbeafe;
    color: #1d4ed8;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
}

.badge-manual {
    background: #fef3c7;
    color: #b45309;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
}

.badge-ignored {
    background: #f1f5f9;
    color: #64748b;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
}

/* Tabular Row Preview */
.tabular-preview-wrap {
    overflow-x: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #ffffff;
    max-height: 320px;
}

.tabular-preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
    white-space: nowrap;
}

.tabular-preview-table th {
    background: #f8fafc;
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 8px 10px;
    text-align: left;
    font-weight: 800;
    color: #334155;
    border-bottom: 2px solid #e2e8f0;
}

.tabular-preview-table td {
    padding: 7px 10px;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
}

.tabular-preview-table tr:hover td {
    background: #f0f6ff;
}

/* Step 3: Progress & Execution */
.progress-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px 24px;
    box-shadow: var(--shadow);
    text-align: center;
    max-width: 700px;
    margin: 0 auto;
}

.progress-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.progress-bar-container {
    width: 100%;
    height: 12px;
    background: #e2e8f0;
    border-radius: 99px;
    overflow: hidden;
    margin: 20px 0 10px;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #0b4db8, #2563eb, #38bdf8);
    background-size: 200% 100%;
    animation: progressShine 1.5s linear infinite;
    transition: width 0.3s ease;
}

@keyframes progressShine {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

.progress-status-text {
    font-size: 13px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 4px;
}

.progress-subtext {
    font-size: 11px;
    color: #64748b;
}

/* Step 4: Confirmation */
.confirmation-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.confirmation-hero {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border-radius: 10px;
}

.confirmation-hero.success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
}

.confirmation-hero.failure {
    background: #fef2f2;
    border: 1px solid #fecaca;
}

.confirmation-hero-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.confirmation-hero.success .confirmation-hero-icon {
    background: #10b981;
    color: #ffffff;
}

.confirmation-hero.failure .confirmation-hero-icon {
    background: #ef4444;
    color: #ffffff;
}

.confirmation-hero-text h2 {
    margin: 0 0 4px 0;
    font-size: 18px;
    font-weight: 800;
    color: #1e293b;
}

.confirmation-hero-text p {
    margin: 0;
    font-size: 12px;
    color: #475569;
}

.kpi-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.kpi-tile {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 14px;
    text-align: center;
}

.kpi-tile-title {
    font-size: 10.5px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.kpi-tile-value {
    font-size: 22px;
    font-weight: 900;
    color: #1e293b;
    margin: 4px 0 2px;
}

.kpi-tile-sub {
    font-size: 10px;
    color: #94a3b8;
}

.error-details-card {
    border: 1px solid #fecaca;
    background: #fff5f5;
    border-radius: 8px;
    padding: 14px;
}

.error-details-title {
    font-size: 12px;
    font-weight: 800;
    color: #b91c1c;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.error-list {
    max-height: 180px;
    overflow-y: auto;
    font-size: 11px;
    color: #7f1d1d;
    padding-left: 20px;
    margin: 0;
}

/* Downstream Records Explorer */
.roster-explorer-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.roster-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.roster-search-box {
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 4px 10px;
    gap: 6px;
    flex: 1;
    min-width: 240px;
}

.roster-search-box input {
    border: none;
    outline: none;
    font-size: 12px;
    width: 100%;
}

.roster-filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.roster-filter-select {
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 11.5px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    font-weight: 600;
    color: #334155;
}

.roster-table-wrapper {
    overflow-x: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    max-height: 480px;
}

.roster-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11.5px;
    white-space: nowrap;
}

.roster-table th {
    background: #f8fafc;
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 9px 12px;
    text-align: left;
    font-weight: 800;
    color: #334155;
    border-bottom: 2px solid #e2e8f0;
}

.roster-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #f1f5f9;
    color: #1e293b;
}

.roster-table tr:hover td {
    background: #f0f6ff;
}

.household-chip {
    font-family: monospace;
    font-weight: 700;
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    color: #0f172a;
}

@media (max-width: 768px) {
    .kpi-summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .stepper-nav::before {
        display: none;
    }
}

/* =========================================================
   Simplified Direct Import Pipeline Feedback
   ========================================================= */
.direct-pipeline-container {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-top: 14px;
}

.pipeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    flex-wrap: wrap;
    gap: 10px;
}

.pipeline-title {
    font-size: 15px;
    font-weight: 800;
    color: #17233c;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pipeline-steps-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    position: relative;
    margin: 16px 0 20px;
}

.pipeline-step-item {
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.25s ease;
}

.pipeline-step-item.pending {
    opacity: 0.65;
}

.pipeline-step-item.active {
    background: #eff6ff;
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
    opacity: 1;
}

.pipeline-step-item.completed {
    background: #ecfdf5;
    border-color: #10b981;
    opacity: 1;
}

.pipeline-step-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 14px;
    font-weight: 800;
    flex-shrink: 0;
    background: #e2e8f0;
    color: #64748b;
}

.pipeline-step-item.active .pipeline-step-icon {
    background: #3b82f6;
    color: #ffffff;
    animation: pulseGlow 1.5s infinite;
}

.pipeline-step-item.completed .pipeline-step-icon {
    background: #10b981;
    color: #ffffff;
}

@keyframes pulseGlow {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4); }
    50% { transform: scale(1.05); box-shadow: 0 0 0 6px rgba(59, 130, 246, 0); }
}

.pipeline-step-text strong {
    display: block;
    font-size: 12.5px;
    font-weight: 800;
    color: #1e293b;
}

.pipeline-step-text small {
    display: block;
    font-size: 10.5px;
    color: #64748b;
    margin-top: 2px;
}

/* =========================================================
   Active File Extracted Dropdowns Card
   ========================================================= */
.extracted-dropdowns-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.extracted-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 12px;
}

.extracted-card-title h3 {
    margin: 0 0 3px 0;
    font-size: 14.5px;
    font-weight: 800;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 7px;
}

.extracted-card-title p {
    margin: 0;
    font-size: 11px;
    color: #64748b;
}

.extracted-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.extracted-col {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.extracted-label {
    font-size: 11.5px;
    font-weight: 700;
    color: #334155;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.extracted-label span.count-badge {
    font-size: 10px;
    background: #f1f5f9;
    color: #64748b;
    padding: 1px 6px;
    border-radius: 99px;
    font-weight: 600;
}

.extracted-select {
    padding: 7px 10px;
    font-size: 11.5px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    font-weight: 600;
    color: #1e293b;
    outline: none;
    transition: all 0.15s ease;
    cursor: pointer;
    width: 100%;
}

.extracted-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(11, 77, 184, 0.15);
}

.extracted-select option {
    font-size: 11.5px;
}

.filter-active-pill {
    background: #e0f2fe;
    color: #0369a1;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-weight: 700;
}

@media (max-width: 900px) {
    .pipeline-steps-bar {
        grid-template-columns: repeat(2, 1fr);
    }
    .extracted-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* =========================================================
   Upload Modal & Percentage Line Only
   ========================================================= */
.upload-modal-dialog {
    background: #ffffff;
    width: min(480px, 94vw);
    border-radius: 14px;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.35);
    overflow: hidden;
    animation: modalScaleIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid #e2e8f0;
}

@keyframes modalScaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.upload-modal-header {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: #64748b;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.modal-close-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.upload-modal-body {
    padding: 24px 20px;
}

.modal-picker-zone {
    text-align: center;
    padding: 24px 16px;
    border: 1.5px dashed #cbd5e1;
    border-radius: 10px;
    background: #fafbfc;
}

.modal-progress-zone {
    padding: 30px 10px;
    text-align: center;
}

.progress-bar-track {
    background: #e2e8f0;
    height: 12px;
    border-radius: 99px;
    overflow: hidden;
    width: 100%;
    margin: 12px 0 10px;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.06);
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #2563eb, #3b82f6);
    border-radius: 99px;
    transition: width 0.15s ease-in-out;
}

.progress-percentage-line {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 16px;
    font-weight: 800;
    color: #1e293b;
    letter-spacing: 0.02em;
}

.modal-done-zone {
    text-align: center;
    padding: 20px 10px;
}

.done-icon {
    width: 48px;
    height: 48px;
    line-height: 48px;
    border-radius: 50%;
    background: #dcfce7;
    color: #16a34a;
    font-size: 24px;
    font-weight: 800;
    margin: 0 auto 12px;
}

.done-title {
    font-size: 16px;
    font-weight: 800;
    color: #16a34a;
    margin-bottom: 4px;
}

.done-subtitle {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 20px;
}

/* =========================================================
   Active Dataset 6-Column Data Table View
   ========================================================= */
.active-dataset-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    margin-top: 18px;
}

.active-dataset-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid #f1f5f9;
}

.active-dataset-title {
    margin: 0 0 2px 0;
    font-size: 15px;
    font-weight: 800;
    color: #17233c;
    display: flex;
    align-items: center;
    gap: 6px;
}

.active-dataset-subtitle {
    font-size: 11.5px;
    color: #64748b;
}

.dataset-search-wrap {
    display: flex;
    align-items: center;
    position: relative;
    width: min(320px, 100%);
}

.dataset-search-wrap input {
    width: 100%;
    padding: 6px 28px 6px 12px;
    font-size: 12px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
}

.clear-search-btn {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 11px;
}

.roster-table-wrapper {
    overflow-x: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.roster-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    text-align: left;
}

.roster-table thead {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.roster-table th {
    padding: 10px 14px;
    font-weight: 700;
    color: #475569;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.roster-table td {
    padding: 10px 14px;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    vertical-align: middle;
}

.roster-table tbody tr:hover {
    background: #f8fafc;
}

.hhid-code {
    background: #f1f5f9;
    color: #0f172a;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-family: monospace;
    font-weight: 600;
    border: 1px solid #e2e8f0;
}

.beneficiary-name {
    color: #0f172a;
    font-weight: 700;
}

.hhset-pill {
    background: #f1f5f9;
    color: #475569;
    padding: 2px 8px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 700;
    display: inline-block;
    border: 1px solid #e2e8f0;
}

.status-pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 99px;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: capitalize;
}

.status-pill.status-active,
.status-pill.status-served {
    background: #dcfce7;
    color: #15803d;
}

.status-pill.status-referred {
    background: #fef3c7;
    color: #b45309;
}

.status-pill.status-planned {
    background: #e0f2fe;
    color: #0369a1;
}

.empty-dataset-box {
    text-align: center;
    padding: 48px 20px;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
}

/* Reference Photo Roster Layout Styles */
.roster-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 18px;
}

.roster-title-area {
    display: flex;
    flex-direction: column;
}

.roster-main-title {
    margin: 0;
    font-size: 20px;
    font-weight: 800;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 8px;
}

.roster-title-icon {
    font-size: 20px;
}

.roster-subtitle {
    margin-top: 3px;
    font-size: 12px;
    color: #64748b;
}

.btn-download-navy {
    background: #0f2b48;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    padding: 7px 16px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.15s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

.btn-download-navy:hover {
    background: #0b1f35;
}

.roster-two-col-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 16px;
    align-items: start;
    width: 100%;
}

@media (max-width: 900px) {
    .roster-two-col-layout {
        grid-template-columns: 1fr;
    }
}

/* Sidebar */
.roster-sidebar {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.sidebar-heading {
    font-size: 11px;
    font-weight: 800;
    color: #64748b;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 0 8px 10px 8px;
}

.sidebar-mun-btn {
    width: 100%;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    color: #334155;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-bottom: 6px;
}

.sidebar-mun-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.sidebar-mun-btn.active {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: #0f172a;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.03);
}

.sidebar-mun-left {
    display: flex;
    align-items: center;
    gap: 7px;
}

.sidebar-mun-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.sidebar-count-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 9999px;
    line-height: 1.2;
}

.sidebar-count-badge.badge-dark {
    background: #0f2b48;
    color: #ffffff;
}

.sidebar-count-badge.badge-blue {
    background: #2563eb;
    color: #ffffff;
}

.sidebar-chevron {
    color: #94a3b8;
    font-size: 14px;
    font-weight: 700;
}

/* Toolbar */
.roster-toolbar-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.roster-search-box {
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    overflow: hidden;
    flex: 1;
    min-width: 250px;
}

.search-lens-icon {
    padding-left: 10px;
    font-size: 13px;
    color: #94a3b8;
}

.roster-search-field {
    border: none;
    outline: none;
    padding: 7px 10px;
    font-size: 12px;
    flex: 1;
    color: #1e293b;
    background: transparent;
}

.btn-search-navy {
    background: #0f2b48;
    color: #ffffff;
    border: none;
    padding: 7px 14px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.btn-search-navy:hover {
    background: #0b1f35;
}

.roster-filter-dropdown {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 600;
    color: #334155;
    cursor: pointer;
    outline: none;
}

.roster-filter-dropdown.dataset-dropdown {
    color: #0f2b48;
    font-weight: 700;
}

.btn-clear-link {
    background: none;
    border: none;
    color: #64748b;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 6px;
}

.btn-clear-link:hover {
    color: #ef4444;
}

.roster-total-count {
    margin-left: auto;
    font-size: 11.5px;
    font-weight: 600;
    color: #64748b;
    white-space: nowrap;
}

/* Reference Table Card */
.roster-table-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
    overflow: hidden;
}

.roster-table-responsive {
    overflow-x: auto;
}

.roster-reference-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.roster-reference-table th {
    background: #f8fafc;
    color: #475569;
    font-weight: 700;
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 10px 12px;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
    text-align: left;
}

.sort-carat {
    font-size: 10px;
    color: #94a3b8;
    margin-left: 2px;
}

.roster-reference-table td {
    padding: 9px 12px;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    vertical-align: middle;
}

.roster-reference-table tr:hover {
    background: #f8fafc;
}

.household-id-badge {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 11px;
    color: #1e293b;
    font-weight: 600;
    white-space: nowrap;
}

.beneficiary-name-cell {
    font-weight: 700;
    color: #0f172a;
    font-size: 12px;
}

.client-status-active-pill {
    background: #15803d;
    color: #ffffff;
    font-size: 10.5px;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 9999px;
    display: inline-block;
    white-space: nowrap;
}

.client-status-plain {
    font-size: 11.5px;
    color: #64748b;
    font-weight: 500;
}

.cell-uppercase {
    text-transform: uppercase;
    font-size: 11.5px;
    color: #334155;
}

.hhset-cell {
    font-weight: 700;
    color: #334155;
    font-size: 11.5px;
}

.roster-pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    font-size: 11.5px;
    color: #64748b;
    flex-wrap: wrap;
    gap: 8px;
}

.pagination-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}

.page-indicator {
    font-weight: 600;
    color: #334155;
}

/* ==========================================================================
   MODERN STEP-BY-STEP UPLOAD ANIMATION & STEPPER STYLES
   ========================================================================== */

.upload-stepper-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 12px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    position: relative;
}

.upload-step-item {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 1;
}

.upload-step-circle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #64748b;
    font-size: 11px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.upload-step-item.active .upload-step-circle {
    background: #2563eb;
    color: #ffffff;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2);
    animation: stepPulse 2s infinite;
}

.upload-step-item.completed .upload-step-circle {
    background: #10b981;
    color: #ffffff;
}

.upload-step-label {
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    transition: color 0.3s;
}

.upload-step-item.active .upload-step-label {
    color: #1e293b;
    font-weight: 800;
}

.upload-step-item.completed .upload-step-label {
    color: #059669;
}

.upload-step-connector {
    flex: 1;
    height: 2px;
    background: #e2e8f0;
    margin: 0 10px;
    transition: background 0.3s;
}

.upload-step-connector.completed {
    background: #10b981;
}

@keyframes stepPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(37, 99, 235, 0);
    }
}

/* Step 1: Reading & Validating Stage */
.step-reading-card {
    text-align: center;
    padding: 24px 16px;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

.reading-radar-wrap {
    width: 68px;
    height: 68px;
    margin: 0 auto 16px auto;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.reading-radar-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid #3b82f6;
    animation: radarRipple 1.6s infinite cubic-bezier(0, 0.2, 0.8, 1);
    opacity: 0;
}

.reading-radar-ring:nth-child(2) {
    animation-delay: 0.5s;
}

.reading-radar-icon {
    font-size: 28px;
    z-index: 2;
    animation: bounceSlow 2s infinite ease-in-out;
}

@keyframes radarRipple {
    0% {
        transform: scale(0.6);
        opacity: 0.9;
    }
    100% {
        transform: scale(1.4);
        opacity: 0;
    }
}

@keyframes bounceSlow {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

.reading-title {
    font-size: 14px;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 6px;
}

.reading-desc {
    font-size: 11.5px;
    color: #64748b;
    max-width: 380px;
    margin: 0 auto;
    line-height: 1.5;
}

/* Step 2: Live Importing Stage */
.step-importing-card {
    padding: 20px 16px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

.importing-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.importing-live-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #eff6ff;
    color: #1d4ed8;
    padding: 3px 10px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 700;
    border: 1px solid #bfdbfe;
}

.live-pulse-dot {
    width: 6px;
    height: 6px;
    background: #2563eb;
    border-radius: 50%;
    animation: blink 1s infinite alternate;
}

@keyframes blink {
    from { opacity: 0.3; }
    to { opacity: 1; }
}

.importing-counter {
    font-size: 12.5px;
    font-weight: 800;
    color: #0f172a;
    font-variant-numeric: tabular-nums;
}

.modern-progress-wrap {
    height: 12px;
    background: #e2e8f0;
    border-radius: 9999px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.06);
    margin-bottom: 10px;
}

.modern-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #2563eb 0%, #3b82f6 50%, #60a5fa 100%);
    border-radius: 9999px;
    transition: width 0.25s ease-out;
    position: relative;
    background-size: 30px 30px;
    background-image: linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.18) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, 0.18) 50%,
        rgba(255, 255, 255, 0.18) 75%,
        transparent 75%,
        transparent
    );
    animation: progressStripeMove 1s linear infinite;
}

@keyframes progressStripeMove {
    0% { background-position: 0 0; }
    100% { background-position: 30px 0; }
}

.importing-footer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11.5px;
    color: #64748b;
}

/* Step 3: Fully Imported Stage */
.step-success-card {
    text-align: center;
    padding: 24px 18px;
    background: #ffffff;
    border-radius: 12px;
}

.success-check-badge {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 50%;
    color: #ffffff;
    font-size: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px auto;
    box-shadow: 0 8px 16px rgba(16, 185, 129, 0.25);
    animation: popCheck 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popCheck {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.success-title {
    font-size: 16px;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 4px;
}

.success-subtitle {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 18px;
}

.success-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px 10px;
    margin-bottom: 20px;
    text-align: center;
}

.stat-metric-val {
    font-size: 15px;
    font-weight: 800;
    color: #1e293b;
    font-variant-numeric: tabular-nums;
}

.stat-metric-lbl {
    font-size: 10px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-top: 2px;
}

.success-actions-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Set Active File Button & Badge */
.btn-set-active {
    background: #f59e0b;
    color: #ffffff;
    border: 1px solid #d97706;
    font-size: 11.5px;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s;
}

.btn-set-active:hover {
    background: #d97706;
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(217, 119, 6, 0.2);
}

.badge-active-file {
    background: #15803d;
    color: #ffffff;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 9999px;
    letter-spacing: 0.03em;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* ==========================================================================
   DYNAMIC FULL-VIEWPORT LAYOUT (No Main Window Scrollbar)
   ========================================================================== */
.excel-import-page-container {
    height: calc(100vh - 50px) !important;
    max-height: calc(100vh - 50px) !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    padding: 12px 18px !important;
    box-sizing: border-box !important;
    background: #f8fafc;
}

.excel-import-page-header {
    flex-shrink: 0;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ==========================================================================
   PRIMARY TABS NAVIGATION
   ========================================================================== */
.roster-primary-tabs {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0px;
    flex-shrink: 0;
}

.roster-tab-btn {
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 700;
    color: #64748b;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.15s ease;
    border-radius: 6px 6px 0 0;
    margin-bottom: -2px;
}

.roster-tab-btn:hover {
    color: #1e3a8a;
    background: #f1f5f9;
}

.roster-tab-btn.active {
    color: #1e3a8a;
    border-bottom-color: #1e3a8a;
    background: #ffffff;
    font-weight: 800;
}

.roster-tab-badge {
    background: #f1f5f9;
    color: #475569;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 9999px;
    border: 1px solid #e2e8f0;
}

.roster-tab-btn.active .roster-tab-badge {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #bfdbfe;
}

.roster-tab-badge.active-batch-tag {
    background: #ecfdf5;
    color: #047857;
    border-color: #a7f3d0;
}

/* Tab Content Container */
.tab-content-area {
    flex: 1 1 0 !important;
    min-height: 0 !important;
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
}

/* ==========================================================================
   TAB 1: ROSTER BATCH MANAGEMENT DASHBOARD
   ========================================================================== */
.batches-management-container {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 4px 2px 16px 2px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.batches-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    flex-shrink: 0;
}

.batch-kpi-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
    display: flex;
    align-items: center;
    gap: 12px;
}

.batch-kpi-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    background: #eff6ff;
    color: #1d4ed8;
    flex-shrink: 0;
}

.batch-kpi-label {
    font-size: 10px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.batch-kpi-val {
    font-size: 16px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.2;
}

.batch-kpi-sub {
    font-size: 10px;
    color: #64748b;
    margin-top: 2px;
}

.batches-table-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
    overflow: hidden;
    flex-shrink: 0;
}

.batches-table-card-header {
    padding: 12px 18px;
    background: #fafbfc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.batches-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.batches-table th {
    background: #f8fafc;
    color: #475569;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 10px 16px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.batches-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    vertical-align: middle;
}

.batches-table tr:hover td {
    background: #f8fafc;
}

.btn-view-records {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.15s;
}

.btn-view-records:hover {
    background: #1d4ed8;
    color: #ffffff;
}

/* ==========================================================================
   TAB 2: BENEFICIARY MASTERLIST (REFERENCE SCREENSHOT DESIGN)
   ========================================================================== */

/* Modern Roster View Header Card matching reference screenshot */
.roster-view-header-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    margin-bottom: 14px;
}

.roster-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.roster-header-icon-box {
    width: 44px;
    height: 44px;
    background: #1d4ed8;
    color: #ffffff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 2px 6px rgba(29, 78, 216, 0.25);
    flex-shrink: 0;
}

.roster-header-titles {
    display: flex;
    flex-direction: column;
}

.roster-header-titles h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.2;
}

.roster-header-subtitle {
    font-size: 12px;
    color: #64748b;
    margin-top: 3px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.roster-batch-quick-select {
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 11px;
    padding: 2px 6px;
    background: #f8fafc;
    color: #334155;
    outline: none;
    cursor: pointer;
}

.roster-header-right {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.roster-territory-pill {
    background: #06b6d4;
    color: #ffffff;
    font-size: 11.5px;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: none;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(6, 182, 212, 0.25);
    transition: all 0.15s ease;
}

.roster-territory-pill:hover {
    background: #0891b2;
}

.roster-pill-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.roster-pill-input-wrap .search-icon {
    position: absolute;
    left: 12px;
    color: #94a3b8;
    font-size: 13px;
    pointer-events: none;
}

.roster-pill-search-input {
    border-radius: 9999px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    font-size: 12px;
    color: #1e293b;
    padding: 7px 14px 7px 32px;
    width: 210px;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.roster-pill-search-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.roster-pill-select {
    border-radius: 9999px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    font-size: 12px;
    color: #334155;
    font-weight: 600;
    padding: 7px 14px;
    outline: none;
    cursor: pointer;
    transition: border-color 0.15s;
}

.roster-pill-select:focus {
    border-color: #2563eb;
}

.btn-pill-reset {
    border-radius: 9999px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #475569;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.15s ease;
}

.btn-pill-reset:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: #0f172a;
}

.btn-pill-download {
    border-radius: 9999px;
    border: none;
    background: #059669;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    padding: 7px 18px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 1px 3px rgba(5, 150, 105, 0.3);
    transition: all 0.15s ease;
}

.btn-pill-download:hover {
    background: #047857;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(5, 150, 105, 0.4);
}

/* Two Column Layout */
.roster-two-col-layout {
    flex: 1 1 0 !important;
    min-height: 0 !important;
    height: calc(100vh - 250px) !important;
    max-height: calc(100vh - 250px) !important;
    display: flex !important;
    gap: 16px !important;
    overflow: hidden !important;
}

/* Sidebar Browse */
.roster-browse-sidebar {
    width: 230px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: 100%;
    max-height: 100%;
    overflow: hidden;
}

.roster-browse-label {
    font-size: 11px;
    font-weight: 800;
    color: #94a3b8;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding-left: 2px;
}

.sidebar-aurora-btn {
    width: 100%;
    border-radius: 12px;
    border: 1.5px solid #a855f7;
    background: #faf5ff;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.15s ease;
}

.sidebar-aurora-btn:hover {
    background: #f3e8ff;
}

.sidebar-aurora-left {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #7c3aed;
    font-size: 12.5px;
    font-weight: 800;
}

.sidebar-aurora-badge {
    background: #7c3aed;
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    padding: 2px 10px;
    border-radius: 9999px;
}

.sidebar-aurora-chevron {
    color: #a855f7;
    font-size: 10px;
    margin-left: 4px;
}

.sidebar-mun-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto;
    flex: 1 1 0;
    min-height: 0;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.sidebar-mun-group {
    display: flex;
    flex-direction: column;
}

.sidebar-mun-item {
    width: 100%;
    border: none;
    background: transparent;
    border-radius: 8px;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: background 0.12s ease;
}

.sidebar-mun-item:hover {
    background: #f1f5f9;
}

.sidebar-mun-item.active {
    background: #eff6ff;
}

.sidebar-mun-item.active .mun-name {
    color: #1d4ed8;
    font-weight: 800;
}

.mun-name-box {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mun-icon {
    font-size: 13px;
    color: #3b82f6;
}

.mun-name {
    font-size: 12px;
    font-weight: 700;
    color: #334155;
    text-transform: uppercase;
}

.mun-count-pill {
    background: #3b82f6;
    color: #ffffff;
    font-size: 10.5px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 9999px;
}

.sidebar-mun-chevron {
    font-size: 9px;
    color: #94a3b8;
    margin-left: 4px;
    transition: transform 0.15s ease;
}

.sidebar-barangay-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 3px 0 6px 14px;
    padding-left: 10px;
    border-left: 2px solid #bfdbfe;
    animation: fadeIn 0.15s ease-in-out;
}

.sidebar-brgy-item {
    width: 100%;
    border: none;
    background: transparent;
    border-radius: 6px;
    padding: 5px 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    font-size: 11px;
    color: #475569;
    transition: all 0.12s ease;
}

.sidebar-brgy-item:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.sidebar-brgy-item.active {
    background: #dbeafe;
    color: #1d4ed8;
    font-weight: 700;
}

.sidebar-brgy-count {
    background: #f1f5f9;
    color: #64748b;
    font-size: 9.5px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 9999px;
}

.sidebar-brgy-item.active .sidebar-brgy-count {
    background: #2563eb;
    color: #ffffff;
}

.sidebar-brgy-loading {
    padding: 6px 10px;
    font-size: 11px;
    color: #94a3b8;
    font-style: italic;
}

/* Continuous Roster Table Card */
.roster-table-card {
    flex: 1 1 0;
    min-width: 0;
    min-height: 0;
    height: 100%;
    max-height: 100%;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.roster-card-header {
    padding: 14px 18px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
    flex-shrink: 0;
}

.roster-card-title {
    font-size: 13.5px;
    font-weight: 800;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.roster-records-pill {
    background: #e0f2fe;
    color: #0284c7;
    font-size: 11px;
    font-weight: 800;
    padding: 4px 12px;
    border-radius: 9999px;
    letter-spacing: 0.04em;
}

.roster-table-wrap {
    flex: 1 1 0;
    min-height: 280px;
    height: calc(100vh - 355px);
    max-height: calc(100vh - 355px);
    overflow-y: auto;
    overflow-x: auto;
    position: relative;
    background: #ffffff;
    scrollbar-width: thin;
    scrollbar-color: #94a3b8 #f1f5f9;
}

@media (max-width: 992px) {
    .roster-two-col-layout {
        flex-direction: column !important;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
    }

    .roster-browse-sidebar {
        width: 100%;
        height: auto;
        max-height: 300px;
    }

    .roster-table-card {
        height: auto;
        max-height: none;
    }

    .roster-table-wrap {
        height: 520px;
        max-height: 70vh;
    }
}

.roster-table-clean {
    width: 100%;
    min-width: 960px;
    border-collapse: collapse;
}

.roster-table-clean th {
    background: #ffffff;
    color: #1e293b;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 12px 14px;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 10;
}

.roster-table-clean td {
    padding: 10px 14px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 12px;
    color: #334155;
    vertical-align: middle;
}

.roster-row-normal:hover td {
    background: #f8fafc;
}

/* Active Highlight Row matching Row 1 of reference screenshot */
.roster-row-active td {
    background: #0f2744 !important;
    color: #ffffff !important;
    border-bottom: 1px solid #1e3a5f !important;
}

.roster-row-active .roster-row-num {
    color: #93c5fd !important;
}

.roster-row-active .roster-hh-id-pill {
    background: #1e3a5f !important;
    color: #93c5fd !important;
    border-color: #3b82f6 !important;
}

.roster-row-active .roster-name-text {
    color: #ffffff !important;
    font-weight: 800;
}

.roster-row-active .roster-sub-text {
    color: #cbd5e1 !important;
}

.roster-row-active .badge-status-plain {
    color: #e2e8f0 !important;
}

.roster-row-active .btn-view-details-pill {
    background: #e0f2fe !important;
    color: #0369a1 !important;
    border-color: #bae6fd !important;
}

.roster-row-active .btn-family-pill {
    background: #1e3a5f !important;
    color: #ffffff !important;
    border-color: #3b82f6 !important;
}

/* Roster Cell Specifics */
.roster-row-num {
    text-align: center;
    color: #64748b;
    font-weight: 600;
    width: 44px;
}

.roster-hh-id-pill {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #334155;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 9999px;
    display: inline-block;
    letter-spacing: 0.02em;
}

.roster-name-text {
    font-weight: 700;
    color: #0f172a;
    text-transform: uppercase;
    font-size: 12.5px;
}

.roster-sub-text {
    color: #475569;
    font-size: 11.5px;
}

/* Status Badges */
.badge-status-active {
    background: #15803d;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 12px;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    letter-spacing: 0.02em;
}

.badge-status-plain {
    color: #475569;
    font-size: 11.5px;
}

/* Row Action Buttons */
.btn-view-details-pill {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1d4ed8;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 9999px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.15s ease;
}

.btn-view-details-pill:hover {
    background: #1d4ed8;
    color: #ffffff;
}

.btn-family-pill {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #475569;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 9999px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.15s ease;
}

.btn-family-pill:hover {
    background: #f1f5f9;
    color: #0f172a;
    border-color: #94a3b8;
}

.btn-family-pill.expanded {
    background: #fef3c7;
    border-color: #fde68a;
    color: #b45309;
    font-weight: 700;
}

/* Member Role Badges */
.member-role-badge {
    font-size: 9px;
    font-weight: 800;
    padding: 1px 5px;
    border-radius: 4px;
    text-transform: uppercase;
}

.role-head {
    background: #fef3c7;
    color: #b45309;
    border: 1px solid #fde68a;
}

.role-spouse {
    background: #fce7f3;
    color: #be185d;
    border: 1px solid #fbcfe8;
}

.role-child {
    background: #e0f2fe;
    color: #0284c7;
    border: 1px solid #bae6fd;
}

.role-other {
    background: #f1f5f9;
    color: #64748b;
}

/* Footer Pagination matching screenshot */
.roster-footer-bar {
    padding: 10px 18px;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.roster-pagination-controls {
    display: flex;
    align-items: center;
    gap: 5px;
}

.page-nav-arrow-btn {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: #64748b;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.page-nav-arrow-btn:hover:not(:disabled) {
    background: #f1f5f9;
    color: #0f172a;
    border-color: #cbd5e1;
}

.page-nav-arrow-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-num-box {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #334155;
}

.page-num-box:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.page-num-box.active {
    background: #0f172a !important; /* Solid dark navy square */
    color: #ffffff !important;
    border-color: #0f172a !important;
    font-weight: 800;
}

.page-ellipsis-dots {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    color: #94a3b8;
    font-weight: 700;
    font-size: 13px;
}

.roster-page-info {
    font-size: 12px;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 12px;
}

.roster-page-jump {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    color: #64748b;
}

.roster-page-jump-input {
    width: 52px;
    height: 28px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    color: #1e293b;
    background: #ffffff;
    outline: none;
    transition: border-color 0.15s;
}

.roster-page-jump-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}

/* Delete Confirmation Modal */
.modal-confirm-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.modal-confirm-dialog {
    background: #ffffff;
    border-radius: 12px;
    width: 90%;
    max-width: 440px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.modal-confirm-header {
    padding: 16px 20px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 800;
    color: #b91c1c;
}

.modal-confirm-body {
    padding: 18px 20px;
    font-size: 12.5px;
    color: #334155;
    line-height: 1.6;
}

.modal-confirm-footer {
    padding: 12px 20px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ACTIONS Eye Button Styling */
.btn-action-eye {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    color: #1d4ed8;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    padding: 0;
}

.btn-action-eye:hover {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(37, 99, 235, 0.3);
}

.roster-row-active .btn-action-eye {
    background: #1e40af;
    border-color: #3b82f6;
    color: #bfdbfe;
}

.roster-row-active .btn-action-eye:hover {
    background: #3b82f6;
    border-color: #60a5fa;
    color: #ffffff;
}

.eye-icon-svg {
    width: 17px;
    height: 17px;
    pointer-events: none;
}

/* Row selection helpers */
.roster-row-active .text-white {
    color: #ffffff !important;
}

.roster-row-active .text-light {
    color: #93c5fd !important;
}

.roster-row-active .roster-hh-id-pill.active-pill {
    background: #0f2744 !important;
    color: #93c5fd !important;
    border-color: #3b82f6 !important;
}

/* Modal Tab Bar & Household Details / Member Roster Modal */
.modal-tabs-bar {
    display: flex;
    gap: 8px;
    padding: 10px 20px;
    background: #f1f5f9;
    border-bottom: 1px solid #e2e8f0;
}

.modal-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 7px;
    border: 1px solid transparent;
    background: transparent;
    font-size: 12.5px;
    font-weight: 700;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s ease;
}

.modal-tab-btn:hover {
    color: #1e293b;
    background: #e2e8f0;
}

.modal-tab-btn.active {
    background: #ffffff;
    color: #0f172a;
    border-color: #cbd5e1;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.modal-tab-badge {
    background: #2563eb;
    color: #ffffff;
    font-size: 10.5px;
    font-weight: 800;
    padding: 1px 7px;
    border-radius: 10px;
}

/* Modal Roster Members Table */
.modal-roster-table {
    width: 100%;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    font-size: 11.5px;
    border: none !important;
    border-radius: 0 !important;
    overflow: visible !important;
}

.modal-roster-table th {
    background-color: #f1f5f9 !important;
    color: #334155 !important;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 10px 10px;
    border-bottom: 2px solid #94a3b8 !important;
    white-space: nowrap;
    position: sticky !important;
    top: 0 !important;
    z-index: 35 !important;
    background-clip: padding-box !important;
}

.modal-roster-table td {
    padding: 9px 10px;
    border-bottom: 1px solid #f1f5f9;
    color: #1e293b;
    vertical-align: middle;
}

.modal-roster-table tr:last-child td {
    border-bottom: none;
}

.modal-roster-table tr:hover td {
    background-color: #f1f5f9;
}

.modal-member-row-grantee {
    background-color: #f0fdf4 !important;
}

.modal-member-row-grantee:hover td {
    background-color: #dcfce7 !important;
}

/* ==========================================================================
   ROSTERLIST OPTIMIZATIONS & ENHANCEMENTS
   ========================================================================== */

/* Animated Records Loading & Skeleton */
.roster-loading-state-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 20px 20px;
    gap: 10px;
}

.roster-spinner-ring {
    width: 36px;
    height: 36px;
    border: 3.5px solid #e2e8f0;
    border-top: 3.5px solid #4f46e5;
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
}

.roster-loading-title {
    font-size: 13.5px;
    font-weight: 700;
    color: #1e293b;
}

.roster-loading-subtitle {
    font-size: 11.5px;
    color: #64748b;
    margin-top: -4px;
}

.roster-skeleton-table {
    width: 100%;
    padding: 4px 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.roster-skeleton-row {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 38px;
    padding: 0 10px;
    background: #ffffff;
    border-radius: 6px;
    border: 1px solid #f1f5f9;
}

.roster-skeleton-cell {
    height: 18px;
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s infinite ease-in-out;
    border-radius: 4px;
}

@keyframes skeletonShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* View Members Button (Replacing Actions) */
.btn-action-view-members {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: #eef2ff;
    color: #4338ca;
    border: 1px solid #c7d2fe;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11.5px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    text-decoration: none;
}

.btn-action-view-members:hover {
    background: #4338ca;
    color: #ffffff;
    border-color: #4338ca;
    box-shadow: 0 2px 6px rgba(67, 56, 202, 0.25);
    transform: translateY(-1px);
}

.btn-action-view-members .eye-icon-svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.btn-action-view-members .member-count-badge {
    background: #4338ca;
    color: #ffffff;
    border-radius: 10px;
    padding: 1px 6px;
    font-size: 10px;
    font-weight: 800;
    line-height: 1.2;
    transition: all 0.15s ease;
}

.btn-action-view-members:hover .member-count-badge {
    background: #ffffff;
    color: #4338ca;
}

.roster-row-active .btn-action-view-members {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.4);
}

.roster-row-active .btn-action-view-members:hover {
    background: #ffffff;
    color: #1e1b4b;
    border-color: #ffffff;
}

.roster-row-active .btn-action-view-members .member-count-badge {
    background: #ffffff;
    color: #1e1b4b;
}

/* Modal 2: Wider Details Modal with Constant Dynamic Height */
.roster-details-modal-dialog {
    max-width: 1240px !important;
    width: 95vw !important;
    height: 85vh !important;
    max-height: 85vh !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
}

.roster-details-modal-body {
    flex: 1 1 0 !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow-y: auto !important;
    padding: 20px !important;
}

/* Modal Member Roster Table with Sticky Header */
.modal-roster-table-scroll-container {
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    overflow-x: auto !important;
    overflow-y: auto !important;
    max-height: 280px;
    position: relative;
    width: 100%;
    background: #ffffff;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03);
}

.modal-roster-table-expanded {
    min-width: 1420px;
    width: 100%;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    font-size: 11px;
    border: none !important;
    border-radius: 0 !important;
    overflow: visible !important;
}

.modal-roster-table-expanded thead {
    position: sticky !important;
    top: 0 !important;
    z-index: 30 !important;
}

.modal-roster-table-expanded thead tr {
    position: sticky !important;
    top: 0 !important;
}

.modal-roster-table-expanded thead th {
    position: sticky !important;
    top: 0 !important;
    z-index: 35 !important;
    background-color: #f1f5f9 !important;
    background: #f1f5f9 !important;
    background-clip: padding-box !important;
    border-top: none !important;
    border-bottom: 2px solid #94a3b8 !important;
    box-shadow: inset 0 -2px 0 #94a3b8, 0 2px 4px rgba(0, 0, 0, 0.06) !important;
    text-align: left;
    font-size: 11px;
    font-weight: 800;
    color: #334155;
    padding: 10px 10px;
    white-space: nowrap;
}

.modal-roster-table-expanded td {
    padding: 9px 10px;
    border-bottom: 1px solid #f1f5f9;
    color: #1e293b;
    vertical-align: middle;
    white-space: nowrap;
    text-align: left;
}

.modal-roster-table-expanded tbody tr {
    cursor: pointer;
    transition: background-color 0.15s ease, outline 0.15s ease;
}

.modal-roster-table-expanded tbody tr:last-child td {
    border-bottom: none;
}

.modal-roster-table-expanded tbody tr:hover td {
    background-color: #f1f5f9;
}

.modal-member-row-grantee {
    background: #f0fdf4;
}

.modal-member-row-grantee:hover td {
    background-color: #dcfce7 !important;
}

.modal-member-row-selected {
    background: #eff6ff !important;
    outline: 2px solid #3b82f6 !important;
    outline-offset: -2px;
}

.modal-member-row-selected td {
    background-color: #eff6ff !important;
}

/* Modal Section A: Household Summary Card */
.modal-hh-summary-card {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 16px;
}

.hh-summary-title {
    font-size: 11.5px;
    font-weight: 800;
    color: #334155;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.hh-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px 14px;
}

.hh-summary-item {
    font-size: 11.5px;
    line-height: 1.4;
}

.hh-summary-item .item-label {
    font-size: 10.5px;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.hh-summary-item .item-value {
    font-size: 12px;
    font-weight: 700;
    color: #0f172a;
    margin-top: 1px;
}

/* Modal Section C: View More Member Details Section */
.modal-view-more-section {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 16px;
    margin-top: 16px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.modal-view-more-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    padding-bottom: 10px;
    margin-bottom: 14px;
    border-bottom: 1px solid #f1f5f9;
}

.modal-view-more-title {
    font-size: 13px;
    font-weight: 800;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 8px;
}

.detail-groups-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
}

.detail-group-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 14px;
}

.detail-group-card h5 {
    margin: 0 0 8px 0;
    font-size: 11.5px;
    font-weight: 800;
    color: #1e293b;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    display: flex;
    align-items: center;
    gap: 6px;
}

.detail-field-list {
    font-size: 11.5px;
    line-height: 1.75;
    color: #475569;
}

.detail-field-list strong {
    color: #1e293b;
}

/* ==========================================================================
   TAB 3: SUMMARY ANALYTICS DASHBOARD STYLES
   ========================================================================== */
.summary-tab-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.summary-header-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.summary-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.summary-header-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    color: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.12);
}

.summary-header-titles h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 800;
    color: #0f172a;
}

.summary-header-titles .subtitle {
    font-size: 12px;
    color: #64748b;
    margin-top: 2px;
}

.summary-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.summary-kpi-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.summary-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.06);
}

.summary-kpi-icon {
    width: 46px;
    height: 46px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.summary-kpi-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
}

.summary-kpi-val {
    font-size: 22px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.2;
    margin-top: 2px;
}

.summary-kpi-sub {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 2px;
}

.summary-analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 16px;
}

.summary-card-panel {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px 18px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.summary-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f1f5f9;
}

.summary-panel-title {
    font-size: 13px;
    font-weight: 800;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 8px;
}

.summary-stat-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 0;
    font-size: 12px;
    border-bottom: 1px dashed #f1f5f9;
}

.summary-stat-row:last-child {
    border-bottom: none;
}

.summary-stat-label {
    color: #475569;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.summary-stat-value {
    font-weight: 800;
    color: #0f172a;
}

.summary-progress-item {
    margin-bottom: 12px;
}

.summary-progress-item:last-child {
    margin-bottom: 0;
}

.summary-progress-header {
    display: flex;
    justify-content: space-between;
    font-size: 11.5px;
    margin-bottom: 4px;
}

.summary-progress-bar-bg {
    width: 100%;
    height: 7px;
    background: #f1f5f9;
    border-radius: 99px;
    overflow: hidden;
}

.summary-progress-bar-fill {
    height: 100%;
    border-radius: 99px;
    transition: width 0.4s ease;
}

/* =========================================================
   Excel Roster Import Mobile Responsiveness (max-width: 900px)
   ========================================================= */
@media (max-width: 900px) {
    .excel-import-page-container {
        height: auto !important;
        max-height: none !important;
        min-height: auto !important;
        overflow: visible !important;
        padding: 10px 8px !important;
    }

    .excel-import-page-header {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
    }

    .excel-import-page-header > div:last-child {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        gap: 8px !important;
    }

    .excel-import-page-header button {
        width: 100% !important;
        justify-content: center !important;
    }

    /* Primary Tabs Navigation - Vertically Stacked Full Width */
    .roster-primary-tabs {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        gap: 6px !important;
        border-bottom: none !important;
        margin-bottom: 14px !important;
    }

    .roster-tab-btn {
        width: 100% !important;
        border-radius: 8px !important;
        border: 1px solid #e2e8f0 !important;
        background: #ffffff !important;
        justify-content: space-between !important;
        padding: 10px 14px !important;
        box-sizing: border-box !important;
        margin-bottom: 0 !important;
    }

    .roster-tab-btn.active {
        background: #0b4db8 !important;
        color: #ffffff !important;
        border-color: #0b4db8 !important;
    }

    .roster-tab-btn.active .roster-tab-badge {
        background: rgba(255, 255, 255, 0.25) !important;
        color: #ffffff !important;
        border-color: transparent !important;
    }

    /* Tab 1: Summary Metric KPI Cards - Vertically Stacked Full Width */
    .batches-management-container {
        overflow: visible !important;
        height: auto !important;
        max-height: none !important;
    }

    .batches-kpi-grid {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        gap: 10px !important;
    }

    .batch-kpi-card {
        width: 100% !important;
        min-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Tab 2: Roster Header & Filters - Vertically Stacked Full Width */
    .roster-view-header-card {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
    }

    .roster-header-left {
        width: 100% !important;
    }

    .roster-header-right {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        width: 100% !important;
        gap: 8px !important;
    }

    .roster-territory-pill,
    .roster-pill-input-wrap,
    .roster-pill-search-input,
    .roster-pill-select,
    .btn-pill-reset,
    .btn-pill-download {
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        justify-content: center !important;
    }

    /* Tab 2: Two-Column Layout Ordered Stacking (Left Panel on top of Table) */
    .roster-two-col-layout {
        display: flex !important;
        flex-direction: column !important;
        height: auto !important;
        max-height: none !important;
        min-height: auto !important;
        gap: 14px !important;
        overflow: visible !important;
    }

    .roster-browse-sidebar {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        max-height: 280px !important;
        overflow-y: auto !important;
    }

    .roster-table-card,
    .roster-unified-table-card {
        width: 100% !important;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
    }

    .roster-table-wrap {
        max-height: 520px !important;
        overflow: auto !important;
    }

    .roster-footer-bar {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
    }

    .roster-pagination-controls {
        justify-content: center !important;
        flex-wrap: wrap !important;
    }

    .roster-page-info {
        justify-content: center !important;
        flex-wrap: wrap !important;
    }

    /* Tab 3: Summary Executive KPI Cards - Vertically Stacked Full Width */
    .summary-tab-container {
        overflow: visible !important;
        height: auto !important;
        max-height: none !important;
    }

    .summary-header-card {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
    }

    .summary-header-card > div:last-child button {
        width: 100% !important;
        justify-content: center !important;
    }

    .summary-kpi-grid {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        gap: 10px !important;
    }

    .summary-kpi-card {
        width: 100% !important;
        min-width: 100% !important;
        box-sizing: border-box !important;
    }

    .summary-analytics-grid {
        grid-template-columns: 1fr !important;
        width: 100% !important;
        gap: 14px !important;
    }
}



