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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: white;
    padding: 30px;
    text-align: center;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.main-content {
    display: flex;
    min-height: 80vh;
}

.provinces-container {
    flex: 2;
    padding: 30px;
    background: #f8f9fa;
}

.provinces-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
    max-width: 800px;
    margin: 0 auto;
}

.province-card {
    background: white;
    border: 3px solid #e3f2fd;
    border-radius: 15px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.province-card:hover {
    border-color: #2196f3;
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(33, 150, 243, 0.2);
}

.province-card.selected {
    border-color: #1976d2;
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(25, 118, 210, 0.3);
}

.province-card.selected::before {
    content: '✓';
    position: absolute;
    top: 10px;
    right: 15px;
    background: #1976d2;
    color: white;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
}

.province-name-card {
    font-size: 1.3rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 10px;
}

.province-stats {
    font-size: 0.9rem;
    color: #7f8c8d;
    background: #f8f9fa;
    padding: 8px 12px;
    border-radius: 20px;
    display: inline-block;
}

.sidebar {
    flex: 1;
    background: white;
    padding: 30px;
    border-left: 1px solid #e0e0e0;
    overflow-y: auto;
}

.province-info {
    margin-bottom: 30px;
}

.province-name {
    font-size: 1.8rem;
    color: #2c3e50;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 3px solid #3498db;
}

.filters-section {
    background: #e8f5e8;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 25px;
    border: 2px solid #c8e6c9;
    display: none;
}

.filters-section h3 {
    margin-bottom: 15px;
    color: #2e7d32;
    font-size: 1.2rem;
}

.filters-grid {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 15px;
    align-items: end;
}

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

.filter-group label {
    display: block;
    margin-bottom: 5px;
    color: #2e7d32;
    font-weight: 600;
    font-size: 0.9rem;
}

.filter-group input, .filter-group select {
    width: 100%;
    padding: 10px;
    border: 2px solid #a5d6a7;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.filter-group input:focus, .filter-group select:focus {
    outline: none;
    border-color: #4caf50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.btn-small {
    padding: 10px 20px;
    font-size: 12px;
    background: linear-gradient(135deg, #ff9800, #f57c00);
    white-space: nowrap;
}

.btn-small:hover {
    background: linear-gradient(135deg, #f57c00, #ff9800);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.add-company-form {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 25px;
    border: 2px solid #e9ecef;
    display: none;
}

.add-company-form h3 {
    margin-bottom: 15px;
    color: #2c3e50;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #495057;
    font-weight: 600;
}

.form-group input, .form-group textarea, .form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.btn {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn:hover {
    background: linear-gradient(135deg, #2980b9, #3498db);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    padding: 8px 15px;
    font-size: 12px;
    margin-left: 10px;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #c0392b, #e74c3c);
}

.companies-list {
    max-height: 400px;
    overflow-y: auto;
}

.company-item {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    transition: all 0.3s;
    position: relative;
}

.company-item:hover {
    border-color: #3498db;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.15);
}

.company-guardian {
    color: #8e24aa;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 5px;
    background: #f3e5f5;
    padding: 4px 8px;
    border-radius: 12px;
    display: inline-block;
}

.company-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 8px;
}

.company-address {
    color: #7f8c8d;
    font-size: 0.95rem;
    line-height: 1.4;
    margin-bottom: 10px;
}

.company-controls {
    display: flex;
    justify-content: flex-end;
}

.no-companies {
    text-align: center;
    color: #95a5a6;
    font-style: italic;
    padding: 40px 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 2px dashed #bdc3c7;
}

.stats {
    display: flex;
    justify-content: space-between;
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: none;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 1.8rem;
    font-weight: bold;
    display: block;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

    @media (max-width: 768px) {
        .main-content {
            flex-direction: column;
        }
        
        .sidebar {
            border-left: none;
            border-top: 1px solid #e0e0e0;
        }
        
        .header h1 {
            font-size: 2rem;
        }

        .provinces-grid {
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: 12px;
        }

        .province-card {
            padding: 15px;
        }

        .province-name-card {
            font-size: 1.1rem;
        }

        .filters-grid {
            grid-template-columns: 1fr;
            gap: 10px;
        }

        .form-row {
            grid-template-columns: 1fr;
        }
    }