/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
.header {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 2rem 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.header-text h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: 300;
}

.header-text h1 i {
    color: #3498db;
    margin-right: 0.5rem;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
    margin: 0;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.user-welcome {
    font-size: 0.95rem;
    opacity: 0.9;
}

.user-role {
    background: rgba(52, 152, 219, 0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    text-transform: uppercase;
    font-weight: 600;
    border: 1px solid rgba(52, 152, 219, 0.3);
}

.logout-btn {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    color: white !important;
    padding: 0.5rem 1rem !important;
    font-size: 0.9rem !important;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    transform: none !important;
}

/* Navigation Styles */
.navbar {
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
    overflow-x: auto;
}

.nav-menu {
    list-style: none;
    display: flex;
    justify-content: center;
    flex-wrap: nowrap;
    min-width: max-content;
    padding: 0.5rem 0;
}

.nav-menu li {
    margin: 0;
}

.nav-link {
    display: block;
    padding: 1rem 1.5rem;
    text-decoration: none;
    color: #5a6c7d;
    font-weight: 500;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.nav-link:hover,
.nav-link.active {
    color: #2c3e50;
    border-bottom-color: #3498db;
    background-color: #f8f9fa;
}

.nav-link i {
    margin-right: 0.5rem;
}

/* Main Content */
.main-content {
    padding: 2rem 0;
    min-height: calc(100vh - 200px);
}

.section {
    display: none;
}

.section.active {
    display: block;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
}

.section-header h2 {
    font-size: 2rem;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.section-header p {
    color: #7f8c8d;
    font-size: 1.1rem;
}

/* Dashboard Styles */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    font-size: 2.5rem;
    margin-right: 1.5rem;
    color: #3498db;
}

.stat-content h3 {
    font-size: 0.9rem;
    color: #7f8c8d;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
}

/* Upliftment Areas */
.upliftment-areas {
    margin-bottom: 3rem;
}

.upliftment-areas h3 {
    text-align: center;
    margin-bottom: 2rem;
    color: #2c3e50;
    font-size: 1.5rem;
}

.areas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.area-card {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    transition: transform 0.3s ease;
    cursor: pointer;
    position: relative;
}

.area-card:hover {
    transform: translateY(-3px);
}

.area-card.active {
    border: 2px solid #2c3e50;
    background: #f8f9fa;
}

.area-card i {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.area-card.deen i { color: #9b59b6; }
.area-card.education i { color: #3498db; }
.area-card.health i { color: #e74c3c; }
.area-card.housing i { color: #27ae60; }
.area-card.livelihood i { color: #f39c12; }

.area-card h4 {
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.area-card p {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.area-count {
    margin-top: 1rem;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.count-number {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
    color: #2c3e50;
}

.count-label {
    font-size: 0.8rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Form sections */
.form-section {
    margin: 2rem 0;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.form-section h3 {
    margin: 0 0 1rem 0;
    color: #2c3e50;
    font-size: 1.1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #dee2e6;
}

.form-section h3 small {
    color: #6c757d;
    font-weight: normal;
    font-size: 0.8rem;
}

/* Responsible persons container */
.responsible-persons-container {
    margin-bottom: 1rem;
}

.responsible-person-entry {
    background: white;
    padding: 1rem;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    margin-bottom: 1rem;
    position: relative;
}

.responsible-person-entry:last-child {
    margin-bottom: 0;
}

.remove-responsible-person {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 0.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-responsible-person:hover {
    background: #c82333;
}

/* Action buttons for dashboard table */
.action-buttons {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 0.9rem;
}

.btn-icon:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.btn-icon i {
    margin: 0;
    font-size: 0.875rem;
}

/* Tooltip styles */
.btn-icon[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 0.375rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 0.25rem;
    opacity: 0;
    animation: tooltipFadeIn 0.2s ease forwards;
}

.btn-icon[title]:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid #333;
    z-index: 1000;
    margin-bottom: 1px;
    opacity: 0;
    animation: tooltipFadeIn 0.2s ease forwards;
}

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

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 3px;
    white-space: nowrap;
}

.btn-sm i {
    font-size: 0.7rem;
    margin-right: 0.25rem;
}

/* Responsive action buttons */
@media (max-width: 768px) {
    .action-buttons {
        gap: 0.25rem;
    }
    
    .btn-icon {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }
    
    .btn-icon i {
        font-size: 0.75rem;
    }
    
    /* Hide tooltips on mobile to avoid issues */
    .btn-icon[title]:hover::after,
    .btn-icon[title]:hover::before {
        display: none;
    }
}

/* Table Styles */
.beneficiaries-table h3 {
    margin-bottom: 1.5rem;
    color: #2c3e50;
}

.table-container {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #ecf0f1;
}

.data-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
}

.data-table tr:hover {
    background-color: #f8f9fa;
}

.no-data {
    text-align: center;
    color: #7f8c8d;
    font-style: italic;
}

/* Form Styles */
.form-container {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    max-width: 800px;
    margin: 0 auto;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #2c3e50;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #ecf0f1;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #3498db;
}

.form-group small {
    color: #7f8c8d;
    font-size: 0.85rem;
    margin-top: 0.25rem;
    display: block;
}

/* Checkbox Group */
.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border: 2px solid #ecf0f1;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.checkbox-label:hover {
    border-color: #3498db;
    background: #e8f4f8;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 0.75rem;
    width: auto;
}

.checkbox-label i {
    margin-right: 0.5rem;
    font-size: 1.1rem;
}

/* Button Styles */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
    transform: translateY(-2px);
}

.btn-warning {
    background: #f39c12;
    color: white;
}

.btn-warning:hover {
    background: #e67e22;
    transform: translateY(-2px);
}

/* Edit Mode Indicator */
.edit-mode-indicator {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    margin-top: 1rem;
    font-weight: 600;
    text-align: center;
    box-shadow: 0 2px 8px rgba(243, 156, 18, 0.3);
    border: 2px solid #e67e22;
}

.edit-mode-indicator i {
    margin-right: 0.5rem;
    font-size: 1.1em;
}

/* Clickable Cards */
.clickable-card {
    cursor: pointer;
    transition: all 0.3s ease;
}

.clickable-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Tag Filter Section */
.tag-filter-section {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.filter-header h4 {
    margin: 0;
    color: #495057;
    font-size: 1rem;
}

.tag-filters, .status-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.tag-filter, .status-filter {
    background: #e9ecef;
    color: #495057;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid #ced4da;
}

.tag-filter:hover, .status-filter:hover {
    background: #dee2e6;
    transform: translateY(-1px);
}

.tag-filter.active, .status-filter.active {
    background: #007bff;
    color: white;
    border-color: #0056b3;
}

.tag-filter.active:hover, .status-filter.active:hover {
    background: #0056b3;
}

/* Tag Display */
.tag-item {
    display: inline-block;
    background: #e7f3ff;
    color: #0066cc;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    margin: 0.1rem;
    border: 1px solid #b3d9ff;
}

.tag-item.removable {
    cursor: pointer;
    position: relative;
    padding-right: 1.5rem;
}

.tag-item.removable:after {
    content: '×';
    position: absolute;
    right: 0.4rem;
    top: 50%;
    transform: translateY(-50%);
    font-weight: bold;
}

.tag-item.removable:hover {
    background: #ff6b6b;
    color: white;
    border-color: #ff5252;
}

/* Tag Button */
.btn-tag {
    background: #28a745;
    color: white;
    font-size: 0.8rem;
    padding: 0.4rem 0.6rem;
}

.btn-tag:hover {
    background: #218838;
}

/* Actions Dropdown */
.actions-dropdown {
    position: relative;
    display: inline-block;
}

.actions-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 0.5rem 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    transition: background-color 0.3s ease;
}

.actions-btn:hover {
    background: #5a6268;
}

.actions-btn i {
    font-size: 0.8rem;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background-color: white;
    min-width: 180px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.15);
    border-radius: 6px;
    z-index: 1000;
    border: 1px solid #e9ecef;
    overflow: hidden;
}

.dropdown-content.show {
    display: block;
    animation: dropdownSlide 0.2s ease-out;
}

@keyframes dropdownSlide {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: #495057;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-size: 0.85rem;
    transition: background-color 0.2s ease;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
    color: #495057;
    text-decoration: none;
}

.dropdown-item.primary:hover {
    background-color: #e3f2fd;
    color: #1976d2;
}

.dropdown-item.success:hover {
    background-color: #e8f5e8;
    color: #2e7d32;
}

.dropdown-item.warning:hover {
    background-color: #fff8e1;
    color: #f57c00;
}

.dropdown-item.secondary:hover {
    background-color: #f5f5f5;
    color: #424242;
}

.dropdown-item i {
    width: 16px;
    text-align: center;
    font-size: 0.9rem;
}

.dropdown-divider {
    height: 1px;
    background-color: #e9ecef;
    margin: 0.25rem 0;
}

.btn-search {
    background: #27ae60;
    color: white;
}

.btn-search:hover {
    background: #229954;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #ecf0f1;
}

/* Form Sections */
.form-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #ecf0f1;
}

.form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.form-section h3,
.form-section h4 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

/* Beneficiary Info */
.beneficiary-info {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.beneficiary-info h3 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.info-item {
    background: white;
    padding: 0.75rem;
    border-radius: 6px;
    border-left: 4px solid #3498db;
}

.info-item strong {
    color: #2c3e50;
}

/* Search Styles */
.beneficiary-search {
    margin-bottom: 2rem;
}

.beneficiary-search .form-group {
    max-width: 400px;
    margin: 0 auto;
    display: flex;
    gap: 0.5rem;
    align-items: end;
}

.beneficiary-search input {
    flex: 1;
}

.beneficiary-search .btn {
    margin-bottom: 0;
}

/* Visitor Entry */
.visitor-entry {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border-left: 4px solid #3498db;
}

/* History Styles */
.history-container {
    max-width: 1000px;
    margin: 0 auto;
}

.beneficiary-summary {
    margin-bottom: 3rem;
}

.progress-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #ecf0f1;
}

.progress-header h4 {
    color: #2c3e50;
    font-size: 1.3rem;
}

.progress-status {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    background: #3498db;
    color: white;
}

.progress-details {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.detail-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.detail-item {
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #3498db;
}

.detail-item.full-width {
    grid-column: 1 / -1;
}

.summary-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.summary-header h3 {
    margin: 0;
}

.detail-item strong {
    color: #2c3e50;
}

/* Timeline */
.visit-timeline {
    margin-bottom: 3rem;
}

.visit-timeline h3 {
    margin-bottom: 1.5rem;
    color: #2c3e50;
}

#timelineContainer {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

/* Add Visit Section */
.add-visit-section {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.add-visit-section h3 {
    margin-bottom: 1.5rem;
    color: #2c3e50;
}

/* Footer */
.footer {
    background: #2c3e50;
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
}

/* Responsive Design - Mobile First */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }
    
    .header-text h1 {
        font-size: 1.8rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .user-info {
        justify-content: center;
    }
    .header h1 {
        font-size: 1.8rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .nav-menu {
        flex-direction: column;
        overflow-x: auto;
        white-space: nowrap;
        display: flex;
        flex-direction: row;
    }
    
    .nav-link {
        text-align: center;
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
        white-space: nowrap;
        min-width: 120px;
    }
    
    .nav-link i {
        display: block;
        margin-bottom: 0.25rem;
        margin-right: 0;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .checkbox-group {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .stat-card {
        padding: 1.5rem;
        flex-direction: column;
        text-align: center;
    }
    
    .stat-icon {
        margin-right: 0;
        margin-bottom: 1rem;
        font-size: 2rem;
    }
    
    .areas-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .area-card {
        padding: 1rem;
    }
    
    .area-card i {
        font-size: 1.5rem;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .progress-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .progress-details {
        grid-template-columns: 1fr;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .data-table {
        font-size: 0.9rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 0.5rem;
    }
    
    .visitor-entry .form-row {
        gap: 0.75rem;
    }
    
    .beneficiary-search .form-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .beneficiary-search .btn {
        margin-top: 0.5rem;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    
    .header {
        padding: 1.5rem 0;
    }
    
    .header h1 {
        font-size: 1.6rem;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .section-header h2 {
        font-size: 1.5rem;
    }
    
    .form-container {
        padding: 1rem;
        margin: 0 10px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .areas-grid {
        grid-template-columns: 1fr;
    }
    
    .area-card {
        padding: 1rem;
    }
    
    .nav-link {
        font-size: 0.8rem;
        padding: 0.5rem;
        min-width: 100px;
    }
    
    .checkbox-label {
        padding: 0.5rem;
        font-size: 0.9rem;
    }
    
    .btn {
        padding: 0.75rem 1rem;
        font-size: 0.95rem;
    }
    
    .form-group input,
    .form-group textarea,
    .form-group select {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .table-container {
        overflow-x: auto;
    }
    
    .data-table {
        min-width: 600px;
        font-size: 0.8rem;
    }
    
    .visitor-entry {
        padding: 0.75rem;
    }
    
    .beneficiary-info {
        padding: 1rem;
    }
    
    .progress-card {
        padding: 1rem;
    }
}

/* Extra small devices */
@media (max-width: 360px) {
    .header h1 {
        font-size: 1.4rem;
    }
    
    .nav-link {
        font-size: 0.75rem;
        padding: 0.4rem;
        min-width: 90px;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-icon {
        font-size: 1.8rem;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
}

/* Animation */
.section {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Status badges */
.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-pending { background: #f39c12; color: white; }
.status-in-progress { background: #3498db; color: white; }
.status-completed { background: #27ae60; color: white; }
.status-requires-review { background: #e74c3c; color: white; }

/* Print styles for house visit form */
@media print {
    body { 
        margin: 0; 
        padding: 15px; 
        font-family: Arial, sans-serif;
        font-size: 12px;
        line-height: 1.3;
    }
    .print-only { display: block !important; }
    .no-print { display: none !important; }
    
    .visit-form-header {
        border: 2px solid #333;
        padding: 8px;
        margin-bottom: 12px;
        background: #f9f9f9;
        page-break-inside: avoid;
    }
    
    .visit-form-title {
        text-align: center;
        font-size: 16px;
        font-weight: bold;
        margin-bottom: 6px;
        color: #333;
    }
    
    .visit-form-details {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 6px;
        font-size: 11px;
        line-height: 1.2;
    }
    
    .visit-form-section {
        margin-bottom: 15px;
        page-break-inside: avoid;
    }
    
    .visit-form-section h3 {
        font-size: 13px;
        margin-bottom: 6px;
        padding-bottom: 2px;
        border-bottom: 1px solid #333;
        font-weight: bold;
    }
    
    .form-lines {
        border: none;
        border-bottom: 1px solid #ccc;
        width: 100%;
        min-height: 50px;
        margin-bottom: 8px;
        background: transparent;
        padding: 2px 0;
    }
    
    .form-lines.large {
        min-height: 80px;
    }
    
    .signature-section {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 15px;
        margin-top: 25px;
        page-break-inside: avoid;
    }
    
    .signature-box {
        text-align: center;
        padding-top: 35px;
        border-top: 1px solid #333;
        margin-top: 15px;
        font-size: 11px;
    }
    
    /* Ensure proper page margins */
    @page {
        margin: 0.5in;
        size: A4;
    }
}
