/* ============================================
   ESTILS REVOLUCIÓ SOLAR
   Reutilitza prog-table, prog-controls,
   prog-loading-overlay, prog-no-data, prog-alert
   ============================================ */

.rs-results {
    padding: 4px 0;
}

.rs-header h3 {
    margin: 0 0 4px;
    font-size: 20px;
    font-weight: 700;
}

.rs-meta {
    font-size: 16px;
    color: var(--text-medium, #666);
    margin: 0 0 16px;
}

.rs-section {
    background: var(--bg-secondary, #f8f9fa);
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 16px;
}

.rs-section h4 {
    margin: 0 0 12px;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-dark, #222);
}

.rs-section h5 {
    margin: 0 0 8px;
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-dark, #2c3e50);
}

.rs-table {
    font-size: 16px;
}

.rs-table td, .rs-table th {
    padding: 6px 10px;
    font-size: 16px;
}

.rs-table th {
    font-weight: 600;
    background: var(--bg-tertiary, #eef2f7);
}

.rs-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 768px) {
    .rs-grid-2 {
        grid-template-columns: 1fr;
    }
}

.rs-card {
    background: white;
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: 8px;
    padding: 12px 14px;
}

.rs-card h5 {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 8px;
    color: var(--primary-dark, #2c3e50);
}

.rs-card ul {
    margin: 0;
    padding: 0 0 0 16px;
}

.rs-card li {
    font-size: 16px;
    line-height: 1.6;
}

.rs-card p {
    font-size: 16px;
    margin: 4px 0;
    line-height: 1.5;
}

.rs-sub {
    font-size: 15px;
    color: var(--text-medium, #666);
    margin-top: 4px !important;
}

.rs-balance-table {
    margin-bottom: 12px;
}

.prog-input-small {
    width: 140px;
}

.rs-balance-table:last-child {
    margin-bottom: 0;
}

/* ============================================
   SUB-PESTANYES RS
   ============================================ */

.rs-sub-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-color, #ddd);
    flex-wrap: wrap;
}

.rs-sub-tab {
    padding: 10px 18px;
    font-size: 16px;
    font-weight: 500;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    color: var(--text-medium, #666);
    transition: all 0.2s;
    border-radius: 6px 6px 0 0;
}

.rs-sub-tab:hover {
    color: var(--text-dark, #333);
    background: var(--bg-hover, #f0f0f0);
}

.rs-sub-tab.active {
    color: var(--primary, #3a5a7a);
    border-bottom-color: var(--primary, #3a5a7a);
    font-weight: 600;
}

.rs-sub-pane {
    display: none;
}

.rs-sub-pane.active {
    display: block;
}

/* Columnes ordenables de la taula de contactes */
.rs-sort-th {
    cursor: pointer;
    user-select: none;
    text-decoration: none;
    transition: color 0.15s, background 0.15s;
}

.rs-sort-th:hover {
    color: var(--primary, #3a5a7a);
    text-decoration: underline;
    background: var(--bg-hover, #eef2f7);
}

.rs-sort-indicator {
    font-size: 12px;
    margin-left: 4px;
    color: var(--primary, #3a5a7a);
}

/* Cerca de ciutat per RS */
.rs-search-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    font-size: 16px;
    color: var(--text-medium, #666);
}

.spinner-small {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color, #ddd);
    border-top-color: var(--primary, #3a5a7a);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.rs-search-results {
    margin-top: 6px;
}

.rs-selected-city {
    margin-top: 6px;
}

.results-prompt {
    padding: 10px 14px;
    background: var(--accent-faded, #eef2ff);
    border-bottom: 2px solid var(--accent, #3a5a7a);
    font-size: 16px;
    border-radius: 6px 6px 0 0;
}

.result-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color, #ddd);
    cursor: pointer;
    border-left: 3px solid transparent;
    font-size: 16px;
    background: white;
    transition: background 0.15s;
}

.result-item:last-child {
    border-radius: 0 0 6px 6px;
}

.result-item:hover {
    background: var(--bg-hover, #f0f0f0);
    border-left-color: var(--accent, #3a5a7a);
}

.result-item.selected {
    background: var(--accent-faded, #eef2ff);
    border-left-color: var(--accent-dark, #2c3e50);
    font-weight: 600;
    border-radius: 6px;
}

.result-item.selected::after {
    content: ' ✓';
    color: var(--success, #27ae60);
}

.city-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 3px;
}

.city-location {
    font-size: 15px;
    opacity: 0.8;
}

.city-coords {
    font-size: 13px;
    color: var(--text-light, #888);
    margin-top: 2px;
}

.change-city-btn {
    margin-top: 6px;
    padding: 4px 12px;
    background: none;
    border: 1px solid var(--accent, #3a5a7a);
    border-radius: 6px;
    color: var(--accent-dark, #2c3e50);
    font-size: 14px;
    cursor: pointer;
}

.change-city-btn:hover {
    background: var(--accent-faded, #eef2ff);
}

/* El dibuix de la carta RS ha d'ocupar tot l'ample */
#rs-carta .dibuix-carta-natal {
    margin: 0 auto;
}

#rs-carta svg {
    max-width: 100%;
    height: auto;
}

/* ─── RS Location Tabs (Natal / Residencia / Elegida) ─── */
.rs-location-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 1rem;
    padding: 0.5rem 0 0;
    background: #fafafa;
}
.rs-location-tab {
    padding: 0.5rem 1.25rem;
    border: none;
    background: none;
    font-size: 0.95rem;
    font-weight: 600;
    color: #888;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
}
.rs-location-tab:hover { color: #555; }
.rs-location-tab.active {
    color: #1e4d2b;
    border-bottom-color: #1e4d2b;
}
.rs-loc-pane {
    display: none;
}
.rs-loc-pane[style*="display:block"],
.rs-loc-pane[style*="display: block"] {
    display: block !important;
}
