/* ============================================
   POSYANDU LIST CSS - COMPREHENSIVE STYLING
   Untuk: Kaders, Immunizations, Ibu Hamil, Health Records, 
   Locations, Nutrition Data, Patient Types, Schedules, Stunting Data
   ============================================ */

/* ===== ROOT VARIABLES ===== */
:root {
    /* Primary Colors - Purple Gradient Theme */
    --posyandu-primary: #667eea;
    --posyandu-primary-dark: #764ba2;
    --posyandu-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    
    /* Secondary Gradients */
    --gradient-pink: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-blue: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --gradient-green: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    --gradient-orange: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    --gradient-success: linear-gradient(135deg, #28a745 0%, #34ce57 100%);
    --gradient-info: linear-gradient(135deg, #17a2b8 0%, #20c997 100%);
    --gradient-warning: linear-gradient(135deg, #ffc107 0%, #ffd43b 100%);
    --gradient-danger: linear-gradient(135deg, #dc3545 0%, #e74c3c 100%);
    
    /* Neutral Colors */
    --white: #ffffff;
    --light-gray: #f8f9fa;
    --medium-gray: #e9ecef;
    --border-gray: #dee2e6;
    --text-gray: #6c757d;
    --text-dark: #495057;
    --text-black: #343a40;
    
    /* Status Colors */
    --status-success: #28a745;
    --status-success-bg: #e8f5e8;
    --status-success-text: #2e7d32;
    
    --status-danger: #dc3545;
    --status-danger-bg: #ffcdd2;
    --status-danger-text: #d32f2f;
    
    --status-warning: #ffc107;
    --status-warning-bg: #fff3e0;
    --status-warning-text: #f57c00;
    
    --status-info: #17a2b8;
    --status-info-bg: #e3f2fd;
    --status-info-text: #1976d2;
    
    /* Purple Status */
    --status-purple-bg: #f3e5f5;
    --status-purple-text: #7b1fa2;
    
    /* Pink Status */
    --status-pink-bg: #fce4ec;
    --status-pink-text: #c2185b;
    
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 8px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 8px 25px rgba(0, 0, 0, 0.1);
    --shadow-2xl: 0 10px 30px rgba(102, 126, 234, 0.3);
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 10px;
    --radius-lg: 15px;
    --radius-xl: 20px;
    --radius-full: 50%;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 2.5rem;
    --spacing-2xl: 3rem;
}

/* ===== CONTAINER & PAGE HEADER ===== */
.posyandu-container {
    padding: var(--spacing-md);
    min-height: 100vh;
    background: linear-gradient(135deg, #f0f4ff 0%, #faf9ff 100%);
}

/* Header spacing - simplified */
.container-fluid > .row:first-child {
    margin-bottom: 1rem;
}

/* Page Headers with Gradient */
.posyandu-header,
.kader-header,
.immunization-header,
.ibu-hamil-header,
.medical-header,
.location-header,
.nutrition-header,
.stunting-header,
.schedule-header {
    background: var(--posyandu-gradient);
    color: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--spacing-2xl);
    margin-bottom: var(--spacing-2xl);
    box-shadow: var(--shadow-2xl);
    position: relative;
    overflow: hidden;
}

.posyandu-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    z-index: 1;
}

.posyandu-header h2,
.posyandu-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
    position: relative;
    z-index: 2;
}

.posyandu-header p {
    font-size: 1.1rem;
    opacity: 0.9;
    margin: 0;
    position: relative;
    z-index: 2;
}

/* ===== STATISTICS CARDS ===== */
.stats-card {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-lg);
    box-shadow: var(--shadow-md);
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid var(--border-gray);
    position: relative;
    overflow: hidden;
}

.stats-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--posyandu-gradient);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.stats-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.stats-card:hover::before {
    transform: scaleX(1);
}

.stats-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--posyandu-primary);
    margin-bottom: var(--spacing-sm);
    line-height: 1;
}

.stats-label {
    color: var(--text-gray);
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Stats Card Variations with Gradients */
.stats-card.gradient-primary {
    background: var(--posyandu-gradient);
    color: var(--white);
}

.stats-card.gradient-pink {
    background: var(--gradient-pink);
    color: var(--white);
}

.stats-card.gradient-blue {
    background: var(--gradient-blue);
    color: var(--white);
}

.stats-card.gradient-green {
    background: var(--gradient-green);
    color: var(--white);
}

.stats-card.gradient-orange {
    background: var(--gradient-orange);
    color: var(--white);
}

.stats-card.gradient-primary .stats-number,
.stats-card.gradient-pink .stats-number,
.stats-card.gradient-blue .stats-number,
.stats-card.gradient-green .stats-number,
.stats-card.gradient-orange .stats-number,
.stats-card.gradient-primary .stats-label,
.stats-card.gradient-pink .stats-label,
.stats-card.gradient-blue .stats-label,
.stats-card.gradient-green .stats-label,
.stats-card.gradient-orange .stats-label {
    color: var(--white);
}

/* Stats Card with Border Left */
.stats-card.success {
    border-left: 5px solid var(--status-success);
}

.stats-card.warning {
    border-left: 5px solid var(--status-warning);
}

.stats-card.info {
    border-left: 5px solid var(--status-info);
}

.stats-card.danger {
    border-left: 5px solid var(--status-danger);
}

.stats-card.success .stats-number {
    color: var(--status-success);
}

.stats-card.warning .stats-number {
    color: var(--status-warning);
}

.stats-card.info .stats-number {
    color: var(--status-info);
}

.stats-card.danger .stats-number {
    color: var(--status-danger);
}

/* ===== FILTER SECTION ===== */
.filter-section {
    background: linear-gradient(135deg, var(--white) 0%, var(--light-gray) 100%);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    margin-top: var(--spacing-lg);
    margin-bottom: var(--spacing-2xl);
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(102, 126, 234, 0.1);
    position: relative;
    overflow: hidden;
}

.filter-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--posyandu-gradient);
}

.filter-header {
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-md);
    border-bottom: 2px solid var(--medium-gray);
}

.filter-title {
    color: var(--text-dark);
    font-weight: 600;
    margin: 0;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.filter-title i {
    color: var(--posyandu-primary);
}

/* Search Box */
.search-box {
    position: relative;
    width: 100%;
}

.search-box .form-control {
    padding-left: 45px;
    border-radius: 25px;
    border: 2px solid var(--medium-gray);
    transition: all 0.3s ease;
    background: var(--white);
    height: 45px;
}

.search-box .form-control:focus {
    border-color: var(--posyandu-primary);
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
    outline: none;
}

.search-box .search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--posyandu-primary);
    font-size: 1.1rem;
    pointer-events: none;
}

/* Filter Form Controls */
.filter-section .form-control {
    border-radius: var(--radius-md);
    border: 2px solid var(--medium-gray);
    transition: all 0.3s ease;
    background: var(--white);
    height: 45px;
}

.filter-section .form-control:focus {
    border-color: var(--posyandu-primary);
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
    outline: none;
}

.filter-section select.form-control {
    cursor: pointer;
}

/* Quick Filters */
.quick-filters {
    margin-top: var(--spacing-lg);
}

.filter-group {
    margin-bottom: var(--spacing-lg);
}

.filter-group:last-child {
    margin-bottom: 0;
}

.filter-group-label {
    display: block;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: var(--spacing-sm);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-buttons,
.activity-type-filter,
.age-group-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-buttons .btn,
.activity-type-filter .btn,
.age-group-filter .btn {
    border-radius: var(--radius-xl);
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 2px solid;
}

.filter-buttons .btn:hover,
.activity-type-filter .btn:hover,
.age-group-filter .btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.filter-buttons .btn.active,
.activity-type-filter .btn.active,
.age-group-filter .btn.active {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Custom Button Outline Colors */
.btn-outline-purple {
    color: #7b1fa2;
    border-color: #7b1fa2;
}

.btn-outline-purple:hover,
.btn-outline-purple.active {
    background-color: #7b1fa2;
    border-color: #7b1fa2;
    color: var(--white);
}

.btn-outline-pink {
    color: #c2185b;
    border-color: #c2185b;
}

.btn-outline-pink:hover,
.btn-outline-pink.active {
    background-color: #c2185b;
    border-color: #c2185b;
    color: var(--white);
}

/* ===== DATA CARDS (Universal) ===== */
.data-card,
.kader-card,
.location-card,
.schedule-card,
.patient-type-card,
.immunization-card,
.stunting-card,
.nutrition-card {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    border: 1px solid var(--border-gray);
    position: relative;
    overflow: hidden;
}

/* Add spacing before data list section */
#schedulesList,
#stuntingDataList,
#kadersList,
#locationsList,
#nutritionDataList,
#immunizationsList {
    margin-top: var(--spacing-lg);
}

.data-card:hover,
.kader-card:hover,
.location-card:hover,
.schedule-card:hover,
.patient-type-card:hover,
.immunization-card:hover,
.stunting-card:hover,
.nutrition-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--posyandu-primary);
}

/* Card Header Section */
.card-header-section {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: var(--spacing-md);
}

.card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-black);
    margin: 0 0 var(--spacing-xs) 0;
}

.card-subtitle {
    font-size: 0.85rem;
    color: var(--text-gray);
    margin: 0;
}

/* ===== AVATARS & ICONS ===== */
.kader-avatar,
.patient-avatar,
.avatar-circle {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-full);
    object-fit: cover;
    border: 4px solid var(--medium-gray);
    margin-bottom: var(--spacing-md);
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.avatar-circle {
    width: 45px;
    height: 45px;
    border-radius: var(--radius-full);
    background: var(--posyandu-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: 700;
    font-size: 1.1rem;
    margin-right: 15px;
    border: none;
    flex-shrink: 0;
}

.avatar-circle.small {
    width: 40px;
    height: 40px;
    font-size: 1rem;
}

.avatar-circle i {
    font-size: 1.2rem;
}

/* ===== BADGES & STATUS ===== */
/* Base Badge Styling */
.badge-posyandu,
.status-badge,
.jabatan-badge,
.vaccine-type,
.nutrition-status,
.stunting-status,
.pregnancy-badge,
.risk-badge,
.schedule-status,
.age-range {
    display: inline-block;
    padding: 6px 12px;
    border-radius: var(--radius-xl);
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: capitalize;
    line-height: 1;
    white-space: nowrap;
}

/* Jabatan Badges (Kader) */
.jabatan-badge.ketua {
    background: var(--status-success-bg);
    color: var(--status-success-text);
}

.jabatan-badge.wakil_ketua {
    background: var(--status-info-bg);
    color: var(--status-info-text);
}

.jabatan-badge.sekretaris {
    background: var(--status-warning-bg);
    color: var(--status-warning-text);
}

.jabatan-badge.bendahara {
    background: var(--status-pink-bg);
    color: var(--status-pink-text);
}

.jabatan-badge.anggota,
.jabatan-badge.kader {
    background: var(--status-info-bg);
    color: var(--status-info-text);
}

.jabatan-badge.other {
    background: var(--medium-gray);
    color: var(--text-gray);
}

/* Vaccine Type Badges */
.vaccine-type.bcg {
    background: var(--status-info-bg);
    color: var(--status-info-text);
}

.vaccine-type.dpt {
    background: var(--status-purple-bg);
    color: var(--status-purple-text);
}

.vaccine-type.polio {
    background: var(--status-success-bg);
    color: var(--status-success-text);
}

.vaccine-type.hepatitis {
    background: var(--status-warning-bg);
    color: var(--status-warning-text);
}

.vaccine-type.campak {
    background: var(--status-pink-bg);
    color: var(--status-pink-text);
}

.vaccine-type.other {
    background: var(--medium-gray);
    color: var(--text-gray);
}

/* Nutrition Status Badges */
.nutrition-status.normal {
    background: var(--status-success-bg);
    color: var(--status-success-text);
}

.nutrition-status.undernourished,
.nutrition-status.kurang {
    background: var(--status-warning-bg);
    color: var(--status-warning-text);
}

.nutrition-status.severely-undernourished,
.nutrition-status.buruk {
    background: var(--status-danger-bg);
    color: var(--status-danger-text);
}

.nutrition-status.overweight,
.nutrition-status.lebih {
    background: var(--status-info-bg);
    color: var(--status-info-text);
}

.nutrition-status.stunting {
    background: var(--status-purple-bg);
    color: var(--status-purple-text);
}

.nutrition-status.wasting {
    background: #ffebee;
    color: #c62828;
}

/* Stunting Status Badges */
.stunting-status.normal {
    background: var(--status-success-bg);
    color: var(--status-success-text);
}

.stunting-status.stunting {
    background: var(--status-danger-bg);
    color: var(--status-danger-text);
}

.stunting-status.severe-stunting {
    background: #f8bbd9;
    color: #c2185b;
}

.stunting-status.risk {
    background: var(--status-warning-bg);
    color: var(--status-warning-text);
}

/* Pregnancy Badges */
.pregnancy-badge.trimester-1 {
    background: var(--status-success-bg);
    color: var(--status-success-text);
}

.pregnancy-badge.trimester-2 {
    background: var(--status-warning-bg);
    color: var(--status-warning-text);
}

.pregnancy-badge.trimester-3 {
    background: var(--status-danger-bg);
    color: var(--status-danger-text);
}

/* Risk Badges */
.risk-badge.low {
    background: #d4edda;
    color: #155724;
}

.risk-badge.high {
    background: #f8d7da;
    color: #721c24;
}

/* Risk Indicators (Dots) */
.risk-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: var(--radius-full);
    margin-right: 8px;
}

.risk-indicator.low {
    background: var(--status-success);
}

.risk-indicator.medium {
    background: var(--status-warning);
}

.risk-indicator.high {
    background: var(--status-danger);
}

/* Schedule Status Badges */
.schedule-status.upcoming {
    background: var(--status-info-bg);
    color: var(--status-info-text);
}

.schedule-status.ongoing {
    background: var(--status-success-bg);
    color: var(--status-success-text);
}

.schedule-status.completed {
    background: var(--status-purple-bg);
    color: var(--status-purple-text);
}

.schedule-status.cancelled {
    background: var(--status-danger-bg);
    color: var(--status-danger-text);
}

/* General Status Badges */
.status-badge.active,
.status-active {
    background: #d4edda;
    color: #155724;
}

.status-badge.inactive,
.status-inactive {
    background: #f8d7da;
    color: #721c24;
}

.status-badge.pending {
    background: var(--status-warning-bg);
    color: var(--status-warning-text);
}

.status-badge.completed {
    background: var(--status-success-bg);
    color: var(--status-success-text);
}

.status-badge.overdue {
    background: var(--status-danger-bg);
    color: var(--status-danger-text);
}

.status-badge.maintenance {
    background: var(--status-warning-bg);
    color: var(--status-warning-text);
}

/* Modern Badge Styling */
.badge-modern {
    padding: 8px 16px;
    border-radius: var(--radius-xl);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-primary {
    background: #dbeafe;
    color: #1e40af;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

/* Age Range Badge */
.age-range {
    background: var(--status-info-bg);
    color: var(--status-info-text);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
}

/* ===== INFO SECTIONS ===== */
.card-info,
.kader-info,
.patient-info,
.location-info,
.schedule-info,
.contact-info {
    background: var(--light-gray);
    border-radius: var(--radius-sm);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-sm);
}

.info-row:last-child {
    margin-bottom: 0;
}

.info-label {
    font-size: 0.85rem;
    color: var(--text-gray);
    font-weight: 500;
}

.info-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-black);
}

/* Contact Info Items */
.contact-item {
    display: flex;
    align-items: center;
    margin-bottom: var(--spacing-xs);
    padding: var(--spacing-xs) 0;
}

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

.contact-item i {
    width: 20px;
    color: var(--text-gray);
    margin-right: var(--spacing-sm);
    flex-shrink: 0;
}

.contact-item span {
    font-size: 0.85rem;
    color: var(--text-dark);
}

/* ===== SKILLS & AMENITIES ===== */
.kader-skills,
.location-amenities {
    background: var(--status-info-bg);
    border-radius: var(--radius-sm);
    padding: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.kader-skills h6,
.location-amenities h6 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--status-info-text);
    margin-bottom: var(--spacing-sm);
}

.skill-tag {
    display: inline-block;
    padding: 4px 12px;
    border-radius: var(--radius-xl);
    font-size: 0.8rem;
    font-weight: 500;
    margin: 2px;
    background: #bbdefb;
    color: var(--status-info-text);
}

.amenity-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.85rem;
}

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

.amenity-item i {
    width: 20px;
    color: var(--status-info-text);
    margin-right: var(--spacing-sm);
}

/* ===== SPECIAL SECTIONS ===== */
/* Schedule Details */
.schedule-details,
.vaccine-schedule,
.growth-chart {
    background: var(--status-info-bg);
    border-radius: var(--radius-sm);
    padding: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.schedule-details h6,
.vaccine-schedule h6,
.growth-chart h6 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--status-info-text);
    margin-bottom: var(--spacing-sm);
}

.detail-item,
.schedule-item,
.chart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #bbdefb;
}

.chart-label {
    font-size: 0.85rem;
    color: var(--text-gray);
    font-weight: 500;
}

.chart-value {
    font-size: 0.9rem;
    color: var(--text-black);
    font-weight: 600;
}

.detail-item:last-child,
.schedule-item:last-child,
.chart-item:last-child {
    border-bottom: none;
}

.detail-label,
.schedule-date,
.chart-label {
    font-weight: 500;
    color: var(--status-info-text);
    font-size: 0.85rem;
}

.detail-value,
.chart-value {
    font-weight: bold;
    color: var(--status-info-text);
    font-size: 0.9rem;
}

.schedule-status-indicator {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Intervention Section (Stunting) */
.intervention-section {
    background: #fff3cd;
    border-radius: var(--radius-sm);
    padding: var(--spacing-md);
    margin-top: var(--spacing-md);
    border-left: 4px solid var(--status-warning);
}

.intervention-title {
    font-weight: 600;
    color: #856404;
    margin-bottom: var(--spacing-sm);
    font-size: 0.9rem;
}

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

.intervention-list li {
    padding: 5px 0;
    color: #856404;
    font-size: 0.85rem;
}

.intervention-list li:before {
    content: "✓ ";
    color: var(--status-success);
    font-weight: bold;
    margin-right: 8px;
}

/* Nutrition Trend */
.nutrition-trend {
    background: var(--light-gray);
    border-radius: var(--radius-sm);
    padding: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.trend-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    border-bottom: 1px solid var(--border-gray);
}

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

.trend-date {
    font-size: 0.8rem;
    color: var(--text-gray);
}

.trend-value {
    font-weight: 500;
    color: var(--text-dark);
}

/* ===== TABLES ===== */
.table-container,
.nutrition-list-container,
.immunization-list-container {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 0;
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    margin-bottom: var(--spacing-xl);
}

.records-table {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
}

/* Modern Table Styling */
.table,
.table-modern,
.nutrition-table,
.immunization-table {
    margin-bottom: 0;
    width: 100%;
}

.table thead th,
.table-modern thead th,
.nutrition-table thead th,
.immunization-table thead th {
    background: var(--posyandu-gradient);
    color: var(--white);
    border: none;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    padding: 20px 15px;
    text-align: center;
    vertical-align: middle;
}

.table tbody tr,
.table-modern tbody tr,
.nutrition-table tbody tr,
.immunization-table tbody tr {
    transition: all 0.3s ease;
    border-bottom: 1px solid var(--medium-gray);
}

.table tbody tr:hover,
.table-modern tbody tr:hover,
.nutrition-table tbody tr:hover,
.immunization-table tbody tr:hover {
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f4ff 100%);
    transform: scale(1.01);
}

.table tbody td,
.table-modern tbody td,
.nutrition-table tbody td,
.immunization-table tbody td {
    padding: 20px 15px;
    vertical-align: middle;
    border: none;
    font-size: 0.9rem;
}

.table tbody tr:last-child {
    border-bottom: none;
}

/* Patient Info in Tables */
.patient-info-table {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.patient-name {
    font-weight: 700;
    color: var(--text-black);
    font-size: 0.95rem;
    margin: 0;
}

.patient-nik {
    color: var(--text-gray);
    font-size: 0.8rem;
    margin: 0;
}

/* ===== CHART CONTAINERS ===== */
.kader-chart,
.location-chart,
.schedule-chart,
.stunting-chart,
.vaccine-chart,
.nutrition-chart {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    margin-top: var(--spacing-lg);
    margin-bottom: var(--spacing-2xl);
    box-shadow: var(--shadow-sm);
}

.chart-container {
    position: relative;
    height: 300px;
    margin-bottom: 15px;
    padding: var(--spacing-sm);
    background: var(--white);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chart-container canvas {
    max-width: 100% !important;
    max-height: 100% !important;
}

/* Chart Legends */
.kader-legend,
.location-legend,
.schedule-legend,
.stunting-legend,
.vaccine-legend,
.chart-legend {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-gray);
}

.stunting-legend .legend-item {
    text-align: center;
    padding: 15px 10px;
    background: var(--light-gray);
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
}

.stunting-legend .legend-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stunting-legend .legend-color {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin: 0 auto 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.stunting-legend .legend-label {
    font-size: 0.75rem;
    color: var(--text-gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    margin-bottom: 5px;
}

.stunting-legend .legend-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-black);
    line-height: 1;
}

.legend-item {
    display: flex;
    align-items: center;
    font-size: 0.875rem;
    padding: 4px 8px;
    background: var(--light-gray);
    border-radius: 4px;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    margin-right: 8px;
}

.legend-label {
    color: var(--text-dark);
    font-weight: 500;
}

.legend-value {
    color: var(--text-gray);
    font-weight: 600;
    margin-left: 4px;
}

/* ===== CALENDAR VIEW ===== */
.calendar-view {
    background: var(--light-gray);
    border-radius: var(--radius-sm);
    padding: var(--spacing-lg);
    margin-top: var(--spacing-lg);
    margin-bottom: var(--spacing-2xl);
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
}

.calendar-nav {
    display: flex;
    gap: 10px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: var(--border-gray);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.calendar-day {
    background: var(--white);
    padding: 10px;
    min-height: 80px;
    border: 1px solid var(--border-gray);
    font-size: 0.85rem;
}

.calendar-day.other-month {
    background: var(--light-gray);
    color: var(--text-gray);
}

.calendar-day.today {
    background: var(--status-info-bg);
    border-color: var(--status-info-text);
}

.calendar-day-header {
    background: #f8f9fa;
    padding: 8px;
    text-align: center;
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--text-dark);
    border: 1px solid var(--border-gray);
}

.calendar-day.has-schedule {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border-color: #667eea !important;
    color: white !important;
}

.calendar-day.has-schedule .day-number {
    color: white !important;
    font-weight: 700;
}

.schedule-count {
    font-size: 0.65rem;
    margin-top: 4px;
    padding: 2px 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
}

.day-number {
    font-weight: bold;
    margin-bottom: 5px;
}

.schedule-indicator {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    background: var(--status-warning-text);
    margin-top: 5px;
}

/* ===== TIMELINE ===== */
.timeline {
    position: relative;
    padding-left: 30px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-gray);
}

.timeline-item {
    position: relative;
    margin-bottom: var(--spacing-lg);
    background: var(--white);
    border-radius: var(--radius-sm);
    padding: var(--spacing-md);
    box-shadow: var(--shadow-sm);
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -22px;
    top: 15px;
    width: 12px;
    height: 12px;
    border-radius: var(--radius-full);
    background: var(--posyandu-primary);
    border: 3px solid var(--white);
    box-shadow: 0 0 0 3px var(--border-gray);
}

.timeline-time {
    font-size: 0.8rem;
    color: var(--text-gray);
    margin-bottom: 5px;
}

.timeline-title {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 5px;
}

.timeline-description {
    color: var(--text-gray);
    font-size: 0.9rem;
}

/* ===== IMAGES ===== */
.location-image,
.card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    margin-bottom: var(--spacing-md);
}

/* Map Container */
.map-container {
    background: var(--light-gray);
    border-radius: var(--radius-sm);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    text-align: center;
}

.map-placeholder {
    width: 100%;
    height: 200px;
    background: var(--medium-gray);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-gray);
    font-size: 1.1rem;
}

/* ===== ACTION BUTTONS ===== */
.action-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: var(--spacing-md);
}

.action-buttons .btn {
    margin: 0;
    transition: all 0.3s ease;
}

.action-buttons .btn:hover {
    transform: translateY(-2px);
}

/* Modern Action Buttons */
.btn-action {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-action:hover {
    transform: scale(1.1);
}

.btn-view {
    background: #dbeafe;
    color: #1e40af;
}

.btn-edit {
    background: #fef3c7;
    color: #92400e;
}

.btn-delete {
    background: #fee2e2;
    color: #991b1b;
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-gray);
    background: var(--white);
    border-radius: var(--radius-md);
    margin: var(--spacing-lg) 0;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: var(--spacing-lg);
    color: var(--border-gray);
    opacity: 0.5;
}

.empty-state h4,
.empty-state h5 {
    color: var(--text-dark);
    margin-bottom: var(--spacing-sm);
}

.empty-state p {
    color: var(--text-gray);
    margin-bottom: var(--spacing-lg);
}

/* ===== PAGINATION ===== */
.pagination-wrapper {
    display: flex;
    justify-content: center;
    margin-top: var(--spacing-xl);
}

.pagination {
    display: flex;
    list-style: none;
    border-radius: var(--radius-sm);
    padding: 0;
    margin: 0;
}

.pagination .page-item {
    margin: 0 2px;
}

.pagination .page-link {
    border-radius: var(--radius-sm);
    border: 2px solid var(--medium-gray);
    color: var(--posyandu-primary);
    padding: 10px 16px;
    transition: all 0.3s ease;
    font-weight: 500;
    cursor: pointer;
}

.pagination .page-link:hover {
    background-color: var(--posyandu-primary);
    border-color: var(--posyandu-primary);
    color: var(--white);
    transform: translateY(-2px);
}

.pagination .page-item.active .page-link {
    background-color: var(--posyandu-primary);
    border-color: var(--posyandu-primary);
    color: var(--white);
}

.pagination .page-item.disabled .page-link {
    background-color: var(--light-gray);
    border-color: var(--medium-gray);
    color: var(--text-gray);
    cursor: not-allowed;
}

/* Modern Pagination */
.pagination-modern .page-link {
    border: 2px solid var(--medium-gray);
    color: var(--text-gray);
    padding: 12px 16px;
    margin: 0 4px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    transition: all 0.3s ease;
}

.pagination-modern .page-link:hover {
    background: var(--posyandu-primary);
    border-color: var(--posyandu-primary);
    color: var(--white);
    transform: translateY(-2px);
}

.pagination-modern .page-item.active .page-link {
    background: var(--posyandu-primary);
    border-color: var(--posyandu-primary);
    color: var(--white);
}

/* ===== LOADING STATES ===== */
.loading-spinner {
    display: none;
    text-align: center;
    padding: 40px;
}

.loading-spinner.active {
    display: block;
}

.spinner-border-modern {
    width: 3rem;
    height: 3rem;
    border: 4px solid var(--medium-gray);
    border-top: 4px solid var(--posyandu-primary);
    border-radius: var(--radius-full);
    animation: spin 1s linear infinite;
}

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

/* ===== ALERTS ===== */
.alert-posyandu {
    border: none;
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
    font-weight: 600;
    box-shadow: var(--shadow-md);
}

.alert-success-posyandu {
    background: var(--gradient-success);
    color: var(--status-success-text);
    border-left: 5px solid var(--status-success);
}

.alert-danger-posyandu {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: var(--status-danger-text);
    border-left: 5px solid var(--status-danger);
}

.alert-warning-posyandu {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: var(--status-warning-text);
    border-left: 5px solid var(--status-warning);
}

/* ===== RESPONSIVE DESIGN ===== */
/* Desktop - Large (1200px+) */
@media (min-width: 1200px) {
    .stats-grid {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: var(--spacing-lg);
    }
}

/* Desktop - Medium (992px - 1199px) */
@media (min-width: 992px) and (max-width: 1199px) {
    .stats-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: var(--spacing-md);
    }
}

/* Tablet (768px - 991px) */
@media (min-width: 768px) and (max-width: 991px) {
    .posyandu-header h2,
    .posyandu-header h1 {
        font-size: 2rem;
    }
    
    .stats-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-md);
    }
    
    .stats-card {
        padding: var(--spacing-lg);
    }
    
    .stats-number {
        font-size: 2rem;
    }
}

/* Mobile (max-width: 767px) */
@media (max-width: 767px) {
    .posyandu-container,
    .container-fluid {
        padding: 0.75rem;
    }
    
    .container-fluid > .row:first-child {
        margin-bottom: 0.75rem;
    }
    
    .posyandu-header,
    .kader-header,
    .immunization-header,
    .ibu-hamil-header,
    .medical-header,
    .location-header,
    .nutrition-header,
    .stunting-header,
    .schedule-header {
        padding: 0;
        margin-bottom: 1.5rem;
    }
    
    .container-fluid > .row:first-child {
        margin-bottom: 2.5rem !important;
        padding-bottom: 1rem !important;
    }
    
    .container-fluid > .row {
        margin-bottom: 1rem;
    }
    
    /* Header d-flex spacing on mobile */
    .container-fluid > .row:first-child .d-flex {
        margin-bottom: 1rem !important;
    }
    
    .container-fluid > .row:first-child .col-12 {
        padding-bottom: 0.75rem !important;
    }
    
    /* Back button spacing on mobile */
    .container-fluid > .row:first-child .btn-outline-primary {
        margin-bottom: 0.75rem !important;
        margin-top: 0.5rem !important;
    }
    
    /* Stats row spacing on mobile */
    .container-fluid > .row.mb-3:nth-child(2) {
        margin-top: 1.5rem !important;
    }
    
    h2 {
        font-size: 1.25rem !important;
        font-weight: 700;
        line-height: 1.3;
    }
    
    .posyandu-header h2,
    .posyandu-header h1 {
        font-size: 1.1rem;
        font-weight: 700;
    }
    
    .posyandu-header p,
    .text-muted {
        font-size: 0.8rem;
        margin-bottom: 0.5rem;
    }
    
    .posyandu-header .btn,
    .btn-primary {
        font-size: 0.8rem;
        padding: 0.5rem 0.75rem;
        border-radius: 8px;
    }
    
    .posyandu-header i {
        font-size: 0.9rem;
    }
    
    /* Stats Cards - ALWAYS 2 columns on mobile */
    .stats-grid,
    .row .col-6 {
        display: inline-block;
    }
    
    .stats-card {
        padding: 0.75rem 0.5rem;
        margin-bottom: 0.5rem;
        border-radius: 12px;
    }
    
    .stats-number {
        font-size: 1.75rem;
        font-weight: 700;
        margin-bottom: 0.25rem;
    }
    
    .stats-label {
        font-size: 0.7rem;
        letter-spacing: 0.3px;
        font-weight: 600;
    }
    
    /* Filter Section */
    .filter-section {
        padding: 0.75rem;
        margin-top: 1rem;
        margin-bottom: 1.5rem;
        background: white;
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    }
    
    .filter-header {
        margin-bottom: var(--spacing-md);
    }
    
    .filter-title {
        font-size: 1rem;
    }
    
    .search-box .form-control,
    .filter-section .form-control {
        height: 42px;
        font-size: 0.85rem;
        border-radius: 10px;
    }
    
    .search-box .form-control {
        padding-left: 38px;
    }
    
    .search-box .search-icon {
        left: 12px;
    }
    
    /* Activity Type Filter - Mobile */
    .activity-type-filter {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        margin-top: 0.75rem;
    }
    
    .activity-type-filter .btn {
        font-size: 0.7rem;
        padding: 6px 8px;
        flex: 1 1 calc(33.33% - 6px);
        min-width: 0;
        border-radius: 8px;
        font-weight: 600;
    }
    
    .activity-type-filter .btn.active {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
        border-color: #667eea;
    }
    
    /* Cards - Optimized for 2 grid mobile */
    .data-card,
    .kader-card,
    .location-card,
    .schedule-card,
    .patient-type-card,
    .immunization-card,
    .stunting-card,
    .nutrition-card {
        padding: var(--spacing-sm);
        margin-bottom: var(--spacing-sm);
    }
    
    .card-title {
        font-size: 0.9rem;
    }
    
    .card-subtitle {
        font-size: 0.75rem;
    }
    
    /* Location Card Specific */
    .location-card {
        min-height: auto;
    }
    
    .location-image,
    .card-image {
        height: 120px;
        margin-bottom: var(--spacing-sm);
    }
    
    .location-info,
    .card-info {
        padding: var(--spacing-xs);
    }
    
    .location-info .row > div,
    .card-info .row > div {
        font-size: 0.75rem;
    }
    
    .location-info small,
    .card-info small {
        font-size: 0.65rem;
    }
    
    .location-info strong,
    .card-info strong {
        font-size: 0.8rem;
    }
    
    /* Avatars */
    .kader-avatar,
    .patient-avatar {
        width: 60px;
        height: 60px;
    }
    
    .avatar-circle {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
    
    /* Badges */
    .badge-posyandu,
    .status-badge,
    .jabatan-badge,
    .vaccine-type,
    .nutrition-status,
    .stunting-status,
    .pregnancy-badge,
    .risk-badge,
    .schedule-status {
        padding: 4px 8px;
        font-size: 0.7rem;
    }
    
    /* Tables */
    .table-container,
    .nutrition-list-container,
    .immunization-list-container {
        overflow-x: auto;
    }
    
    .table thead th,
    .table-modern thead th,
    .nutrition-table thead th,
    .immunization-table thead th {
        padding: 12px 8px;
        font-size: 0.75rem;
    }
    
    .table tbody td,
    .table-modern tbody td,
    .nutrition-table tbody td,
    .immunization-table tbody td {
        padding: 12px 8px;
        font-size: 0.8rem;
    }
    
    /* Charts */
    .chart-container {
        height: 220px;
    }
    
    .kader-chart,
    .location-chart,
    .schedule-chart,
    .stunting-chart,
    .vaccine-chart,
    .nutrition-chart {
        padding: var(--spacing-md);
        margin-top: 1rem;
        margin-bottom: 1.5rem;
    }
    
    /* Calendar */
    .calendar-view {
        padding: 0.75rem;
        margin-top: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .calendar-header {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
        margin-bottom: 0.75rem;
    }
    
    .calendar-header h5 {
        font-size: 1rem;
        margin: 0;
    }
    
    .calendar-nav {
        justify-content: center;
    }
    
    .calendar-day-header {
        padding: 4px;
        font-size: 0.65rem;
    }
    
    .calendar-day {
        min-height: 45px;
        padding: 4px 2px;
        font-size: 0.7rem;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }
    
    .day-number {
        font-size: 0.85rem;
        margin-bottom: 2px;
    }
    
    .schedule-count {
        font-size: 0.5rem;
        padding: 1px 3px;
        margin-top: 2px;
    }
    
    /* Schedule Cards - More compact and beautiful */
    .schedule-card,
    .patient-type-card {
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
        transition: all 0.3s ease;
    }
    
    .schedule-card:hover,
    .patient-type-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    }
    
    .schedule-card h6,
    .patient-type-card h6 {
        font-size: 0.9rem;
        font-weight: 700;
        margin-bottom: 0.25rem;
    }
    
    .schedule-card small,
    .patient-type-card small {
        font-size: 0.7rem;
    }
    
    .schedule-status {
        font-size: 0.65rem;
        padding: 3px 8px;
        border-radius: 6px;
        font-weight: 600;
    }
    
    .badge {
        font-size: 0.65rem;
        padding: 3px 8px;
        border-radius: 6px;
        font-weight: 600;
    }
    
    .schedule-card i,
    .patient-type-card i {
        font-size: 0.75rem;
    }
    
    .patient-type-card code {
        font-size: 0.7rem;
        padding: 2px 6px;
        background: #f8f9fa;
        border-radius: 4px;
    }
    
    .patient-type-card p {
        font-size: 0.75rem;
        line-height: 1.4;
    }
    
    /* Action Buttons - Mobile Optimized */
    .action-buttons {
        display: flex;
        gap: 4px;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .action-buttons .btn {
        font-size: 0.7rem;
        padding: 5px 8px;
        flex: 1;
        min-width: 0;
    }
    
    .action-buttons .btn i {
        font-size: 0.8rem;
    }
    
    .btn-action {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }
    
    /* Contact Info Mobile */
    .contact-info {
        padding: var(--spacing-xs);
        margin-top: var(--spacing-xs);
    }
    
    .contact-item {
        margin-bottom: 4px;
        padding: 2px 0;
    }
    
    .contact-item i {
        width: 16px;
        font-size: 0.75rem;
        margin-right: 6px;
    }
    
    .contact-item span {
        font-size: 0.7rem;
    }
    
    /* Amenities Mobile */
    .location-amenities,
    .kader-skills {
        padding: var(--spacing-xs);
        margin-top: var(--spacing-xs);
    }
    
    .location-amenities h6,
    .kader-skills h6 {
        font-size: 0.75rem;
        margin-bottom: 4px;
    }
    
    .amenity-item {
        font-size: 0.7rem;
        margin-bottom: 4px;
    }
    
    .amenity-item i {
        width: 14px;
        font-size: 0.7rem;
        margin-right: 4px;
    }
    
    /* Empty State */
    .empty-state {
        padding: 40px 15px;
    }
    
    .empty-state i {
        font-size: 3rem;
    }
    
    /* Pagination */
    .pagination .page-link {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
    
    /* View Toggle Mobile */
    .view-toggle {
        width: 100%;
        gap: 4px;
    }
    
    /* Header Mobile untuk Location */
    .location-header {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .location-header h1 {
        font-size: 1.5rem;
    }
    
    .location-header p {
        font-size: 0.85rem;
    }
    
    .location-header .btn-light {
        width: 100%;
        padding: 0.75rem 1rem;
    }
    
    .location-header .btn-outline-light {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
    
    /* Location Table Mobile */
    .locations-data-table .table thead th {
        padding: 12px 8px;
        font-size: 0.75rem;
    }
    
    .locations-data-table .table tbody td {
        padding: 10px 8px;
        font-size: 0.85rem;
    }
    
    .location-avatar {
        width: 40px;
        height: 40px;
        border-width: 2px;
    }
    
    .location-avatar-sm {
        width: 35px;
        height: 35px;
    }
    
    .td-name {
        min-width: 150px;
    }
    
    .td-action {
        width: 140px;
    }
    
    .btn-view-toggle {
        padding: 8px 10px;
        font-size: 0.8rem;
        gap: 4px;
    }
    
    .btn-view-toggle i {
        font-size: 0.85rem;
    }
    
    /* List View Mobile - Table-like */
    .location-list-item {
        padding: var(--spacing-md);
        margin-bottom: var(--spacing-md);
    }
    
    .location-list-row {
        flex-direction: column;
        gap: var(--spacing-md);
    }
    
    .location-list-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-xs);
        margin-bottom: var(--spacing-sm);
        padding-bottom: var(--spacing-xs);
    }
    
    .location-name {
        font-size: 1rem;
    }
    
    .location-list-data {
        grid-template-columns: 1fr;
        gap: var(--spacing-xs);
    }
    
    .data-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }
    
    .data-label {
        font-size: 0.75rem;
        min-width: auto;
    }
    
    .data-value {
        font-size: 0.85rem;
    }
    
    .location-list-actions {
        flex-direction: row;
        flex-wrap: wrap;
        min-width: auto;
        width: 100%;
        gap: 6px;
    }
    
    .location-list-actions .btn {
        flex: 1;
        min-width: calc(50% - 3px);
        padding: 8px 10px;
        font-size: 0.75rem;
    }
    
    .location-list-actions .btn-text {
        display: inline;
    }
}

/* Extra Small Mobile (max-width: 480px) */
@media (max-width: 480px) {
    /* Header */
    .posyandu-header h2,
    .posyandu-header h1 {
        font-size: 1.1rem;
    }
    
    .posyandu-header p {
        font-size: 0.75rem;
    }
    
    .posyandu-header {
        padding: var(--spacing-sm);
        margin-bottom: var(--spacing-sm);
    }
    
    /* Stats - Extra compact for 2 grid */
    .stats-number {
        font-size: 1.25rem;
    }
    
    .stats-label {
        font-size: 0.6rem;
        letter-spacing: 0.2px;
    }
    
    .stats-card {
        padding: 0.5rem;
    }
    
    /* Filter Section */
    .filter-section {
        padding: var(--spacing-sm);
        margin-top: 1rem;
        margin-bottom: 1.25rem;
    }
    
    .search-box .form-control,
    .filter-section .form-control {
        height: 36px;
        font-size: 0.8rem;
    }
    
    .search-box .form-control {
        padding-left: 35px;
    }
    
    .search-box .search-icon {
        left: 12px;
        font-size: 0.9rem;
    }
    
    /* Cards - Very compact for 2 grid */
    .data-card,
    .kader-card,
    .location-card,
    .schedule-card,
    .patient-type-card,
    .immunization-card,
    .stunting-card,
    .nutrition-card {
        padding: 0.5rem;
        margin-bottom: 0.5rem;
    }
    
    .card-title {
        font-size: 0.8rem;
    }
    
    .location-image,
    .card-image {
        height: 100px;
    }
    
    /* Badges - Smaller */
    .status-badge,
    .jabatan-badge,
    .vaccine-type,
    .nutrition-status {
        padding: 3px 6px;
        font-size: 0.6rem;
    }
    
    /* Charts */
    .chart-container {
        height: 150px;
    }
    
    .kader-chart,
    .location-chart,
    .schedule-chart,
    .stunting-chart,
    .vaccine-chart,
    .nutrition-chart {
        padding: var(--spacing-sm);
        margin-top: 1rem;
        margin-bottom: 1.25rem;
    }
    
    /* Action Buttons - Extra compact */
    .action-buttons .btn {
        font-size: 0.65rem;
        padding: 4px 6px;
    }
    
    .btn-action {
        width: 26px;
        height: 26px;
        font-size: 0.7rem;
    }
    
    /* View Toggle Extra Small */
    .btn-view-toggle {
        padding: 6px 8px;
        font-size: 0.75rem;
        gap: 3px;
    }
    
    .btn-view-toggle i {
        font-size: 0.8rem;
    }
    
    /* Header Extra Small */
    .location-header {
        padding: 0.75rem;
    }
    
    .location-header h1 {
        font-size: 1.25rem;
    }
    
    .location-header p {
        font-size: 0.75rem;
    }
    
    .location-header .btn-light {
        padding: 0.6rem 0.8rem;
        font-size: 0.85rem;
    }
    
    .location-header .btn-outline-light {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
    
    /* Location Table Extra Small */
    .locations-data-table .table thead th {
        padding: 10px 6px;
        font-size: 0.7rem;
    }
    
    .locations-data-table .table tbody td {
        padding: 8px 6px;
        font-size: 0.8rem;
    }
    
    .location-avatar {
        width: 35px;
        height: 35px;
    }
    
    .location-avatar-sm {
        width: 30px;
        height: 30px;
    }
    
    .btn-group-mobile .btn {
        padding: 4px 6px;
        font-size: 0.75rem;
    }
    
    /* List View Extra Small */
    .location-list-item {
        padding: var(--spacing-sm);
        margin-bottom: var(--spacing-sm);
    }
    
    .location-name {
        font-size: 0.9rem;
    }
    
    .location-list-header {
        margin-bottom: 0.5rem;
        padding-bottom: 0.5rem;
    }
    
    .status-badge {
        font-size: 0.65rem;
        padding: 3px 8px;
    }
    
    .data-label {
        font-size: 0.7rem;
    }
    
    .data-value {
        font-size: 0.8rem;
    }
    
    .location-list-actions {
        gap: 4px;
    }
    
    .location-list-actions .btn {
        padding: 6px 8px;
        font-size: 0.7rem;
    }
    
    .location-list-actions .btn i {
        font-size: 0.75rem;
    }
    
    .location-list-actions .btn-text {
        font-size: 0.7rem;
    }
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.data-card,
.kader-card,
.location-card,
.schedule-card,
.patient-type-card,
.immunization-card,
.stunting-card,
.nutrition-card,
.stats-card {
    animation: fadeInUp 0.6s ease-out;
}

.data-card:nth-child(1),
.stats-card:nth-child(1) {
    animation-delay: 0.1s;
}

.data-card:nth-child(2),
.stats-card:nth-child(2) {
    animation-delay: 0.2s;
}

.data-card:nth-child(3),
.stats-card:nth-child(3) {
    animation-delay: 0.3s;
}

.data-card:nth-child(4),
.stats-card:nth-child(4) {
    animation-delay: 0.4s;
}

/* Hover Animation for Cards */
@keyframes cardHover {
    0% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-4px);
    }
    100% {
        transform: translateY(-2px);
    }
}

/* ===== SCROLLBAR STYLING ===== */
.table-container::-webkit-scrollbar,
.nutrition-list-container::-webkit-scrollbar,
.immunization-list-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.table-container::-webkit-scrollbar-track,
.nutrition-list-container::-webkit-scrollbar-track,
.immunization-list-container::-webkit-scrollbar-track {
    background: var(--light-gray);
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb,
.nutrition-list-container::-webkit-scrollbar-thumb,
.immunization-list-container::-webkit-scrollbar-thumb {
    background: var(--posyandu-primary);
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb:hover,
.nutrition-list-container::-webkit-scrollbar-thumb:hover,
.immunization-list-container::-webkit-scrollbar-thumb:hover {
    background: var(--posyandu-primary-dark);
}

/* ===== VIEW TOGGLE ===== */
.view-toggle {
    display: flex;
    gap: 5px;
    width: 100%;
}

.btn-view-toggle {
    flex: 1;
    padding: 10px 15px;
    border: 2px solid var(--medium-gray);
    background: var(--white);
    color: var(--text-gray);
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-view-toggle:hover {
    background: var(--light-gray);
    border-color: var(--posyandu-primary);
    color: var(--posyandu-primary);
}

.btn-view-toggle.active {
    background: var(--posyandu-gradient);
    border-color: var(--posyandu-primary);
    color: var(--white);
}

.btn-view-toggle i {
    font-size: 1rem;
}

/* ===== LIST VIEW LAYOUT (Table-like Data Display) ===== */
.locations-list-view {
    display: block;
    width: 100%;
}

.location-list-item {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    border: 1px solid var(--border-gray);
    border-left: 4px solid var(--posyandu-primary);
}

.location-list-item:hover {
    transform: translateX(3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--posyandu-primary);
    background: linear-gradient(135deg, #ffffff 0%, #f8f9ff 100%);
}

/* List Row Layout */
.location-list-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--spacing-lg);
}

.location-list-main {
    flex: 1;
    min-width: 0; /* Allow text truncation */
}

/* List Header (Name + Badge) */
.location-list-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 2px solid var(--light-gray);
}

.location-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-black);
    margin: 0;
}

/* List Data Grid */
.location-list-data {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-sm) var(--spacing-lg);
}

.data-group {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.data-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-gray);
    min-width: 80px;
    flex-shrink: 0;
}

.data-value {
    font-size: 0.9rem;
    color: var(--text-dark);
    flex: 1;
    word-break: break-word;
}

.data-value strong {
    color: var(--posyandu-primary);
    font-weight: 700;
}

/* List Actions */
.location-list-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 120px;
}

.location-list-actions .btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-start;
    padding: 8px 12px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

.location-list-actions .btn i {
    width: 16px;
    text-align: center;
}

.location-list-actions .btn-text {
    flex: 1;
    text-align: left;
}

/* ===== LOCATION TABLE STYLES (Table Format like Pelajar) ===== */
.locations-data-table {
    margin-bottom: var(--spacing-xl);
}

.locations-data-table .card {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-gray);
    background: var(--white);
}

.locations-data-table .table {
    margin-bottom: 0;
}

.locations-data-table .table thead {
    background: var(--posyandu-gradient);
    color: var(--white);
}

.locations-data-table .table thead th {
    border: none;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    padding: 18px 15px;
    text-align: center;
    vertical-align: middle;
    color: var(--white);
}

.locations-data-table .table tbody tr {
    transition: all 0.3s ease;
    border-bottom: 1px solid var(--medium-gray);
    background: var(--white);
}

.locations-data-table .table tbody tr:hover {
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f4ff 100%);
    transform: scale(1.005);
}

.locations-data-table .table tbody td {
    padding: 15px;
    vertical-align: middle;
    border: none;
    font-size: 0.9rem;
    color: #343a40 !important;
}

/* Override any inherited colors */
.locations-data-table .table tbody td,
.locations-data-table .table tbody td * {
    color: #343a40;
}

.locations-data-table .table tbody .fw-bold,
.locations-data-table .table tbody .text-dark {
    color: #212529 !important;
}

.locations-data-table .table tbody .text-muted,
.locations-data-table .table tbody .small {
    color: #6c757d !important;
}

/* Badge colors in table */
.locations-data-table .badge-light {
    background-color: #f8f9fa;
    color: #495057;
}

.locations-data-table .badge-info {
    background-color: #17a2b8;
    color: #ffffff;
}

.locations-data-table .badge-secondary {
    background-color: #6c757d;
    color: #ffffff;
}

/* Status badge colors */
.locations-data-table .status-badge {
    color: #ffffff;
}

.locations-data-table .status-badge.active {
    background-color: #28a745;
    color: #ffffff;
}

.locations-data-table .status-badge.inactive {
    background-color: #dc3545;
    color: #ffffff;
}

.locations-data-table .status-badge.maintenance {
    background-color: #ffc107;
    color: #212529;
}

/* Location Avatar */
.location-avatar {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border: 3px solid var(--medium-gray);
    transition: all 0.3s ease;
}

.location-avatar:hover {
    transform: scale(1.1);
    border-color: var(--posyandu-primary);
}

.location-avatar-sm {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border: 2px solid var(--medium-gray);
}

/* Table Cell Specific */
.td-no {
    text-align: center;
    width: 60px;
}

.td-photo {
    text-align: center;
    width: 80px;
}

.td-name {
    min-width: 200px;
}

.td-code {
    width: 120px;
}

.td-capacity {
    text-align: center;
    width: 130px;
}

.td-address {
    min-width: 250px;
}

.td-status {
    text-align: center;
    width: 120px;
}

.td-action {
    text-align: center;
    width: 180px;
}

/* Button Group Mobile */
.btn-group-mobile {
    display: flex;
    gap: 4px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-group-mobile .btn {
    padding: 5px 8px;
    font-size: 0.8rem;
}

/* Header Styling untuk Location */
.location-header {
    position: relative;
    z-index: 1;
}

.location-header h1 {
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.location-header .btn-light {
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
}

.location-header .btn-light:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

.location-header .btn-outline-light {
    border-width: 2px;
    font-weight: 600;
}

/* ===== UTILITY CLASSES ===== */
.text-posyandu-primary {
    color: var(--posyandu-primary) !important;
}

.bg-posyandu-primary {
    background-color: var(--posyandu-primary) !important;
}

.bg-posyandu-gradient {
    background: var(--posyandu-gradient) !important;
}

.border-posyandu-primary {
    border-color: var(--posyandu-primary) !important;
}

.shadow-posyandu-sm {
    box-shadow: var(--shadow-sm) !important;
}

.shadow-posyandu-md {
    box-shadow: var(--shadow-md) !important;
}

.shadow-posyandu-lg {
    box-shadow: var(--shadow-lg) !important;
}

.rounded-posyandu {
    border-radius: var(--radius-md) !important;
}

.rounded-posyandu-lg {
    border-radius: var(--radius-lg) !important;
}

/* ===== STUNTING CARD SPECIFIC STYLES ===== */
.stunting-card .metric-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--posyandu-primary);
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stunting-card .metric-label {
    font-size: 0.7rem;
    color: var(--text-gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.stunting-card .patient-info {
    padding: 0.75rem;
    background: var(--light-gray);
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
}

.stunting-card .stunting-meta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stunting-card .meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-dark);
}

.stunting-card .meta-item i {
    width: 16px;
    text-align: center;
}

.stunting-card .intervention-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-gray);
}

.stunting-card .intervention-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.stunting-card .intervention-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.stunting-card .intervention-list li {
    padding: 0.25rem 0;
    font-size: 0.85rem;
    color: var(--text-dark);
}

.stunting-card .intervention-list li:before {
    content: "• ";
    color: var(--posyandu-primary);
    font-weight: bold;
    margin-right: 0.5rem;
}

/* Mobile Responsive for Stunting Cards */
@media (max-width: 767px) {
    .stunting-card .metric-value {
        font-size: 1.25rem;
    }
    
    .stunting-card .metric-label {
        font-size: 0.65rem;
    }
    
    .stunting-card .patient-info {
        padding: 0.5rem;
    }
    
    .stunting-card .growth-chart h6 {
        font-size: 0.8rem;
    }
    
    .stunting-card .chart-item {
        font-size: 0.8rem;
        padding: 6px 0;
    }
    
    .stunting-card .stunting-meta {
        gap: 0.35rem;
    }
    
    .stunting-card .meta-item {
        font-size: 0.75rem;
    }
    
    /* Chart Legend Mobile */
    .stunting-legend .legend-item {
        padding: 12px 8px;
    }
    
    .stunting-legend .legend-color {
        width: 32px;
        height: 32px;
        margin-bottom: 8px;
    }
    
    .stunting-legend .legend-label {
        font-size: 0.7rem;
        margin-bottom: 3px;
    }
    
    .stunting-legend .legend-value {
        font-size: 1.25rem;
    }
}

@media (max-width: 576px) {
    .stunting-card {
        padding: 1rem;
    }
    
    .stunting-card .metric-value {
        font-size: 1.1rem;
    }
    
    .stunting-card .metric-label {
        font-size: 0.6rem;
    }
    
    .stunting-card h6 {
        font-size: 0.9rem;
    }
    
    .stunting-card .chart-item {
        font-size: 0.75rem;
    }
    
    /* Chart Legend Extra Small */
    .stunting-legend .legend-item {
        padding: 10px 6px;
    }
    
    .stunting-legend .legend-color {
        width: 28px;
        height: 28px;
        margin-bottom: 6px;
    }
    
    .stunting-legend .legend-label {
        font-size: 0.65rem;
        margin-bottom: 2px;
    }
    
    .stunting-legend .legend-value {
        font-size: 1.1rem;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .posyandu-header,
    .filter-section,
    .action-buttons,
    .pagination-wrapper,
    .btn {
        display: none !important;
    }
    
    .stats-card,
    .data-card,
    .kader-card,
    .location-card,
    .schedule-card {
        box-shadow: none !important;
        border: 1px solid var(--border-gray) !important;
        page-break-inside: avoid;
    }
    
    .table,
    .table-modern {
        page-break-inside: auto;
    }
    
    .table tr,
    .table-modern tr {
        page-break-inside: avoid;
        page-break-after: auto;
    }
}

/* ===== END OF POSYANDU LIST CSS ===== */

