/* =========================================================
   TrackServe - Interventions Module Stylesheet (Compact Vertical Layout)
   ========================================================= */

/* Page Heading - Compact Rhythm */
.page-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.page-heading > div:first-child {
    min-width: 0;
}

.page-heading h1 {
    margin: 0;
    font-size: 18px;
    font-weight: 800;
    color: #17233c;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.page-heading p {
    margin: 2px 0 0 0;
    font-size: 11.5px;
    color: #64748b;
    line-height: 1.35;
    max-width: 950px;
}

.heading-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.heading-actions .btn {
    padding: 5px 12px;
    font-size: 12px;
    height: 32px;
}

/* Toast / Alert Notifications */
.alert-dismissible {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 12px;
    margin-bottom: 10px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 600;
}

.alert-success {
    background: #e7f9ef;
    color: #0d6d3d;
    border: 1px solid #c2eed5;
}

.alert-danger {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.alert-close {
    background: transparent;
    border: 0;
    font-size: 13px;
    color: inherit;
    opacity: 0.7;
    padding: 0 4px;
    cursor: pointer;
}
.alert-close:hover { opacity: 1; }

/* =========================================================
   KPI Summary Stats Grid - Highly Compact
   ========================================================= */
.stat-grid.intervention-stats {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.intervention-stats .stat-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 1px 4px rgba(20, 45, 90, 0.04);
    min-height: auto;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.intervention-stats .stat-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(20, 45, 90, 0.08);
}

.intervention-stats .stat-card:nth-child(1) { border-top: 3px solid var(--primary); }
.intervention-stats .stat-card:nth-child(2) { border-top: 3px solid #10b981; }
.intervention-stats .stat-card:nth-child(3) { border-top: 3px solid #0284c7; }
.intervention-stats .stat-card:nth-child(4) { border-top: 3px solid #f59e0b; }
.intervention-stats .stat-card:nth-child(5) { border-top: 3px solid #8b5cf6; }

.intervention-stats .stat-card .stat-icon {
    width: 34px;
    height: 34px;
    border-radius: 7px;
    display: grid;
    place-items: center;
    font-size: 16px;
    flex-shrink: 0;
    margin-bottom: 0;
}

.intervention-stats .stat-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.intervention-stats .stat-title {
    font-size: 9.5px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    line-height: 1.1;
}

.intervention-stats .stat-content strong {
    font-size: 19px;
    font-weight: 900;
    color: #17233c;
    line-height: 1.1;
    margin: 1px 0 0 0;
}

.intervention-stats .stat-content small {
    font-size: 9.5px;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
    line-height: 1.1;
}

@media (max-width: 1200px) {
    .stat-grid.intervention-stats {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .stat-grid.intervention-stats {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   Filter Toolbar - Compact Horizontal Layout
   ========================================================= */
.filter-card {
    padding: 7px 12px;
    margin-bottom: 12px;
    border-radius: 9px;
}

.filter-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.search-box {
    position: relative;
    flex: 1.3;
    min-width: 220px;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 10px;
    font-size: 12px;
    color: #94a3b8;
    pointer-events: none;
}

.search-box .input {
    padding: 5px 26px 5px 30px;
    height: 32px;
    font-size: 11.5px;
    border-radius: 6px;
}

.clear-search {
    position: absolute;
    right: 7px;
    background: transparent;
    border: 0;
    color: #94a3b8;
    font-size: 12px;
    cursor: pointer;
}

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

.filter-select {
    flex: 1;
    min-width: 120px;
    padding: 4px 8px;
    height: 32px;
    font-size: 11.5px;
    border-radius: 6px;
}

.filter-group .btn {
    height: 32px;
    padding: 4px 10px;
    font-size: 11.5px;
    border-radius: 6px;
}

@media (max-width: 1200px) {
    .filter-toolbar {
        flex-wrap: wrap;
    }
    .filter-group {
        flex-wrap: wrap;
        width: 100%;
    }
}

@media (max-width: 900px) {
    .filter-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .filter-group {
        flex-direction: column;
        align-items: stretch;
    }
    .filter-select {
        width: 100%;
    }
}

/* =========================================================
   Table Card & Collapsible Household Cards
   ========================================================= */
.table-card {
    border-radius: 10px;
}

.table-card .card-heading {
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #edf0f4;
}

.table-card .card-heading h2 {
    margin: 0;
    font-size: 13px;
    font-weight: 800;
}

.table-card .card-heading .muted {
    display: block;
    font-size: 10.5px;
    color: var(--muted);
    margin-top: 1px;
}

.status-summary-pills {
    display: flex;
    gap: 6px;
}

.status-pill {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
}

.pill-planned { background: #fff5e6; color: #b45309; }
.pill-referred { background: #eff6ff; color: #1d4ed8; }
.pill-served { background: #ecfdf5; color: #047857; }

.household-cards-list {
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 9px 10px;
}

.household-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(20, 45, 90, 0.03);
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
    overflow: hidden;
}

.household-card:hover {
    border-color: #cbdbee;
    box-shadow: 0 4px 14px rgba(20, 45, 90, 0.06);
}

.household-card.is-expanded {
    border-color: #b5cde8;
}

.household-card-header {
    padding: 7px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    background: #ffffff;
    cursor: pointer;
    user-select: none;
    transition: background 0.12s ease;
}

.household-card-header:hover {
    background: #f9fbfd;
}

.hh-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.hh-head-avatar {
    width: 32px;
    height: 32px;
    border-radius: 7px;
    background: linear-gradient(135deg, #0b4db8, #1c6ed9);
    color: #ffffff;
    display: grid;
    place-items: center;
    font-size: 12px;
    font-weight: 900;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(11, 77, 184, 0.18);
}

.hh-head-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.hh-head-title-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.hh-head-name {
    font-size: 13px;
    font-weight: 800;
    color: #17233c;
}

.hh-head-tags {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    font-size: 10.5px;
}

.hh-head-tags code {
    font-size: 10px;
    color: #0b4db8;
    background: #eef4ff;
    padding: 1px 4px;
    border-radius: 3px;
}

.swdi-badge {
    font-size: 9px;
    font-weight: 700;
    color: #556277;
    background: #e2e8f0;
    padding: 1px 4px;
    border-radius: 3px;
}

.services-count-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10.5px;
    font-weight: 700;
    background: #f1f5f9;
    color: #334155;
    padding: 1px 6px;
    border-radius: 4px;
}

.hh-header-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.btn-toggle-expand {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 9px;
    background: #f8fafc;
    color: #475569;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.btn-toggle-expand:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.btn-view-household {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 9px;
    background: #eef4ff;
    color: var(--primary);
    border: 1px solid #c4d7f5;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.btn-view-household:hover {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(11, 77, 184, 0.18);
}

.action-btn {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: white;
    font-size: 11px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    transition: all 0.15s ease;
}

.action-btn:hover {
    background: #f4f7fb;
    border-color: #c4d2e8;
    transform: translateY(-1px);
}

.action-btn.delete-btn:hover {
    background: #ffebeb;
    border-color: #ffb8b8;
}

/* =========================================================
   Household Services List (Expanded View)
   ========================================================= */
.household-card-body {
    padding: 0 10px 8px 10px;
    border-top: 1px solid #f0f3f8;
    background: #fbfcfe;
    animation: fadeIn 0.15s ease-out;
}

.hh-services-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 2px 3px 2px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #5d6d88;
}

.household-services-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 2px 0;
    min-width: 320px;
}

.household-service-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: #ffffff;
    border: 1px solid #eef2f7;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 11.5px;
    transition: background 0.12s ease;
}

.household-service-item:hover {
    background: #f8fafc;
    border-color: #e2eaf4;
}

.service-item-main {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.service-provider-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #f1f5f9;
    color: #17233c;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    padding: 2px 8px 2px 4px;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    flex-shrink: 0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.service-provider-badge .agency-mini-logo {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    object-fit: contain;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    padding: 1px;
    flex-shrink: 0;
}

.service-provider-badge .agency-fallback-icon {
    font-size: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: #e2e8f0;
    border-radius: 50%;
}

.service-provider-badge .agency-acronym-text {
    font-weight: 800;
    letter-spacing: 0.3px;
}

.service-item-title {
    font-weight: 700;
    color: #17233c;
    font-size: 12px;
}

.service-item-agency {
    font-size: 9.5px;
    color: #4b5871;
    background: #e9eff8;
    padding: 1px 5px;
    border-radius: 3px;
    font-weight: 700;
}

.priority-tag {
    display: inline-block;
    font-size: 9px;
    font-weight: 800;
    padding: 1px 4px;
    border-radius: 3px;
}

.priority-tag.high {
    background: #fee2e2;
    color: #b91c1c;
}

.intervention-notes {
    color: #6b778c;
    font-size: 10.5px;
    display: block;
    margin-top: 1px;
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.service-item-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.service-item-date {
    font-size: 10.5px;
    color: #64748b;
    font-weight: 600;
}

.status-mini-pill {
    display: inline-flex;
    align-items: center;
    padding: 1px 6px;
    border-radius: 10px;
    font-size: 9.5px;
    font-weight: 800;
}

.status-mini-pill.status-planned {
    background: #fff3db;
    color: #9a5b00;
    border: 1px solid #ffd899;
}

.status-mini-pill.status-referred {
    background: #e7f0ff;
    color: #1357a6;
    border: 1px solid #bad3ff;
}

.status-mini-pill.status-served {
    background: #e4f7ec;
    color: #0f6b40;
    border: 1px solid #a8e5c1;
}

.hh-card-footer-meta {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px dashed #e2eaf4;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 10px;
    color: #78879e;
}

/* =========================================================
   Stacked Column Chart View (Interventions Distribution)
   ========================================================= */
.stacked-chart-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 7px 14px;
    margin-bottom: 8px;
    box-shadow: 0 1px 3px rgba(20, 45, 90, 0.04);
}

.stacked-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid #f1f5f9;
}

.stacked-chart-heading {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}

.stacked-chart-heading h2 {
    margin: 0;
    font-size: 12.5px;
    font-weight: 700;
    color: #17233c;
    letter-spacing: -0.01em;
}

.stacked-chart-heading span {
    font-size: 10px;
    color: var(--muted);
}

.stacked-kpi-chips {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    align-items: center;
}

.stacked-kpi-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 7px;
    border-radius: 5px;
    font-size: 10px;
    font-weight: 600;
    border: 1px solid transparent;
}

.stacked-columns-container {
    height: 64px;
    display: flex;
    align-items: flex-end;
    gap: 6px;
    padding: 16px 4px 2px;
    position: relative;
    border-bottom: 1px solid #e2e8f0;
    background: repeating-linear-gradient(to top, transparent, transparent 16px, #f8fafc 17px);
}

.stacked-col-wrapper {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    justify-content: flex-end;
    position: relative;
    cursor: pointer;
    transition: transform 0.15s ease;
}

.stacked-col-wrapper:hover {
    transform: translateY(-2px);
}

.stacked-col-total-badge {
    position: absolute;
    top: -15px;
    font-size: 8.5px;
    font-weight: 700;
    color: #334155;
    background: #ffffff;
    padding: 0 3px;
    border-radius: 3px;
    border: 1px solid #cbd5e1;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    white-space: nowrap;
    line-height: 1.2;
}

.stacked-col-bar {
    width: 100%;
    max-width: 26px;
    border-radius: 3px 3px 0 0;
    overflow: hidden;
    display: flex;
    flex-direction: column-reverse;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    transition: height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    background: #e2e8f0;
}

.stacked-segment {
    width: 100%;
    transition: height 0.3s ease;
    position: relative;
}

.stacked-segment:hover {
    filter: brightness(1.12);
}

.stacked-segment.seg-health { background: #10b981; }
.stacked-segment.seg-education { background: #0284c7; }
.stacked-segment.seg-livelihood { background: #f59e0b; }
.stacked-segment.seg-social { background: #8b5cf6; }
.stacked-segment.seg-others { background: #64748b; }

.stacked-segment.seg-planned { background: #f59e0b; }
.stacked-segment.seg-referred { background: #3b82f6; }
.stacked-segment.seg-served { background: #10b981; }

.stacked-col-label {
    margin-top: 2px;
    font-size: 9px;
    font-weight: 700;
    color: #475569;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.stacked-chart-legend {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 4px;
    font-size: 9.5px;
    color: #64748b;
}

.stacked-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.stacked-legend-dot {
    width: 7px;
    height: 7px;
    border-radius: 2px;
    display: inline-block;
}

/* =========================================================
   Parent Scoped Modal Layout & Capture / Edit Form
   ========================================================= */
.interventions-view-container {
    position: relative;
    min-height: calc(100vh - 90px);
    width: 100%;
}

.interventions-view-container .fullpage-modal-backdrop,
.fullpage-modal-backdrop {
    position: absolute;
    inset: 0;
    z-index: 500;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border-radius: 10px;
    animation: fadeIn 0.2s ease-out;
    padding: 0;
    width: 100%;
    height: 100%;
}

.interventions-view-container .fullpage-modal-container,
.interventions-view-container .fullpage-modal-card,
.fullpage-modal-card {
    width: 100%;
    height: 100%;
    max-height: 100%;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid var(--border);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

.side-panel-header {
    padding: 12px 28px;
    background: #ffffff;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 10;
}

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

.btn-return {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: #f1f4f9;
    color: #2b384e;
    border: 1px solid #d5dfea;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 700;
    transition: all 0.15s ease;
    cursor: pointer;
}

.btn-return:hover {
    background: #e2eaf5;
    color: var(--primary);
    border-color: #b8cbe3;
}

.side-panel-header h2 {
    margin: 2px 0 0;
    font-size: 16px;
    font-weight: 800;
    color: #17233c;
}

.side-panel-header p {
    margin: 1px 0 0;
    font-size: 11px;
    color: var(--muted);
}

.side-panel-body {
    padding: 20px 28px;
    max-width: 1300px;
    width: 100%;
    margin: 0 auto;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: #f8fafc;
}

.fullpage-modal-card .modal-header {
    padding: 8px 18px;
    background: #ffffff;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    z-index: 20;
}

.fullpage-modal-card .modal-header h2 {
    margin: 1px 0 0;
    font-size: 14.5px;
    font-weight: 800;
    color: #17233c;
}

.fullpage-modal-card .modal-header p {
    margin: 1px 0 0;
    font-size: 10.5px;
    color: var(--muted);
}

.fullpage-modal-card .modal-body {
    padding: 10px 16px;
    width: 100%;
    max-width: 100%;
    margin: 0;
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-sizing: border-box;
}

.fullpage-modal-card .modal-footer {
    padding: 8px 16px;
    background: #ffffff;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    z-index: 20;
}

.fullpage-modal-card .modal-footer .footer-actions-right {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-left: auto;
}

.form-section-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 7px;
    padding: 8px 12px;
    box-shadow: 0 1px 3px rgba(20, 45, 90, 0.02);
}

.section-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid #f0f3f7;
}

.section-title {
    font-size: 11px;
    font-weight: 800;
    color: #2a374e;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    display: flex;
    align-items: center;
    gap: 5px;
}

.household-selector-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

@media (max-width: 900px) {
    .household-selector-grid {
        grid-template-columns: 1fr;
    }
}

.household-search-wrap {
    position: relative;
    width: 100%;
}

.combobox-input-group {
    display: flex;
    gap: 6px;
    align-items: center;
}

.combobox-input {
    flex: 1;
    position: relative;
}

.combobox-suggestions {
    position: absolute;
    top: calc(100% + 3px);
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #c8d6e7;
    border-radius: 6px;
    box-shadow: 0 8px 20px rgba(15, 35, 70, 0.12);
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    padding: 3px;
    list-style: none;
    margin: 0;
}

.suggestion-item {
    padding: 5px 8px;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.12s ease;
    border-bottom: 1px solid #f4f6f9;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-empty-state {
    padding: 12px 10px;
    text-align: center;
    color: #64748b;
    font-size: 11px;
    background: #f8fafc;
    border-radius: 5px;
}

.suggestion-item:hover, .suggestion-item.active {
    background: #edf4ff;
}

.suggestion-main strong {
    font-size: 11.5px;
    color: #17233c;
    display: block;
}

.suggestion-main small {
    font-size: 10px;
    color: #627088;
}

.selected-household-card {
    margin-top: 6px;
    background: #f0f6ff;
    border: 1px solid #c9deff;
    border-radius: 6px;
    padding: 6px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.hh-avatar {
    width: 26px;
    height: 26px;
    border-radius: 5px;
    background: var(--primary);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 12px;
    font-weight: 800;
}

.hh-details h4 {
    margin: 0 0 1px;
    font-size: 12px;
    font-weight: 800;
    color: #0b3e94;
}

.hh-tags {
    display: flex;
    gap: 5px;
    align-items: center;
    flex-wrap: wrap;
    font-size: 10px;
}

.intervention-form-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #ffffff;
}

.intervention-form-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 820px;
}

.intervention-form-table th {
    background: #f3f6fa;
    color: #4b5870;
    font-size: 9.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 5px 7px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    white-space: nowrap;
}

.intervention-form-table td {
    padding: 4px 6px;
    border-bottom: 1px solid #edf1f7;
    vertical-align: top;
}

.table-input-select {
    width: 100%;
    padding: 3px 6px;
    height: 27px;
    border: 1px solid #cbd6e5;
    border-radius: 4px;
    background: #ffffff;
    font-size: 11px;
    color: #1a273f;
    outline: none;
}

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

.table-input-text {
    width: 100%;
    padding: 3px 6px;
    height: 27px;
    border: 1px solid #cbd6e5;
    border-radius: 4px;
    background: #ffffff;
    font-size: 11px;
    color: #1a273f;
    outline: none;
    box-sizing: border-box;
}

.table-input-text:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(11, 77, 184, 0.12);
}

.table-input-date {
    width: 100%;
    padding: 3px 6px;
    height: 27px;
    border: 1px solid #cbd6e5;
    border-radius: 4px;
    font-size: 11px;
    color: #1a273f;
    outline: none;
}

.btn-remove-row {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fca5a5;
    border-radius: 4px;
    width: 22px;
    height: 22px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    font-size: 10px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-remove-row:hover {
    background: #ef4444;
    color: #ffffff;
    border-color: #dc2626;
}

.intervention-form-table tr.row-has-duplicate {
    background: #fff8f8;
}

.intervention-form-table tr.row-has-duplicate td {
    border-bottom: 1px solid #fed7d7;
}

.row-duplicate-alert {
    margin-top: 4px;
    padding: 2px 6px;
    background: #fee2e2;
    border: 1px solid #fca5a5;
    border-radius: 4px;
    color: #991b1b;
    font-size: 9.5px;
    font-weight: 700;
    line-height: 1.25;
    display: flex;
    align-items: center;
    gap: 4px;
    animation: fadeIn 0.15s ease-in;
}

.side-panel-footer {
    padding: 8px 14px;
    background: #ffffff;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    bottom: 0;
    z-index: 10;
}

.footer-actions-right {
    display: flex;
    gap: 6px;
    align-items: center;
}

.audit-meta-card {
    background: #f9fbfd;
    border: 1px dashed #cedae9;
    border-radius: 6px;
    padding: 5px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 10px;
}

.audit-meta-group {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.audit-item {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.audit-label {
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #728096;
}

.audit-value {
    font-weight: 700;
    color: #212f45;
    font-size: 10.5px;
}

.soft-delete-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #eef8f2;
    color: #117846;
    border: 1px solid #bce6cf;
    padding: 3px 8px;
    border-radius: 5px;
    font-size: 10.5px;
    font-weight: 700;
}

.empty-state {
    text-align: center;
    color: var(--muted);
    padding: 24px !important;
}

.empty-icon {
    font-size: 32px;
    margin-bottom: 6px;
}

/* =========================================================
   Planned Interventions Panel Custom Scrollbar Styling
   ========================================================= */
#interventionsTableWrap,
.referrals-main-content .table-wrap {
    scrollbar-width: thin;
    scrollbar-color: #94a3b8 #f1f5f9;
}

#interventionsTableWrap::-webkit-scrollbar,
.referrals-main-content .table-wrap::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

#interventionsTableWrap::-webkit-scrollbar-track,
.referrals-main-content .table-wrap::-webkit-scrollbar-track {
    background: #f8fafc;
    border-radius: 4px;
}

#interventionsTableWrap::-webkit-scrollbar-thumb,
.referrals-main-content .table-wrap::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
    border: 2px solid #f8fafc;
}

#interventionsTableWrap::-webkit-scrollbar-thumb:hover,
.referrals-main-content .table-wrap::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.agency-filter-list {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f8fafc;
}

.agency-filter-list::-webkit-scrollbar {
    width: 5px;
}

.agency-filter-list::-webkit-scrollbar-track {
    background: #f8fafc;
    border-radius: 4px;
}

.agency-filter-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.agency-filter-list::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}
