/* === VARIABLES === */
:root {
    --primary: #1a365d;
    --primary-light: #2a4a7f;
    --primary-lighter: #e8edf5;
    --secondary: #38a169;
    --secondary-light: #c6f6d5;
    --warning: #dd6b20;
    --warning-light: #feebc8;
    --danger: #e53e3e;
    --danger-light: #fed7d7;
    --purple: #6b46c1;
    --purple-light: #e9d8fd;
    --blue: #3182ce;
    --blue-light: #bee3f8;
    --orange: #dd6b20;
    --orange-light: #feebc8;

    --bg: #f7fafc;
    --bg-card: #ffffff;
    --text: #1a202c;
    --text-secondary: #718096;
    --text-muted: #a0aec0;
    --border: #e2e8f0;
    --border-light: #edf2f7;

    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.1), 0 6px 10px rgba(0,0,0,0.08);

    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --transition: 0.2s ease;
}

/* === RESET === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
    scroll-behavior: smooth;
}

/* Touch-friendly tap targets */
@media (hover: none) and (pointer: coarse) {
    button, a, .nav-btn, .gallery-item {
        min-height: 44px;
        min-width: 44px;
    }
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

.hidden { display: none !important; }

/* === LOGIN SCREEN === */
.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a365d 0%, #2a4a7f 50%, #1a365d 100%);
    padding: 1rem;
}

.login-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.login-logo {
    margin-bottom: 1.5rem;
}

.login-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.login-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

.input-group {
    text-align: left;
    margin-bottom: 1rem;
}

.input-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.input-wrapper {
    position: relative;
}

.input-wrapper input {
    width: 100%;
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: var(--font);
    transition: border-color var(--transition);
    outline: none;
}

.input-wrapper input:focus {
    border-color: var(--primary);
}

.toggle-password {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    display: flex;
}

.toggle-password:hover { color: var(--text-secondary); }

.login-error {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--danger);
    font-size: 0.85rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: var(--danger-light);
    border-radius: var(--radius-sm);
}

.btn-primary {
    width: 100%;
    padding: 0.75rem 1.5rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: background var(--transition), transform var(--transition);
}

.btn-primary:hover { background: var(--primary-light); }
.btn-primary:active { transform: scale(0.98); }

.btn-secondary {
    padding: 0.5rem 1rem;
    background: var(--bg);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-family: var(--font);
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.btn-secondary:hover {
    background: var(--border-light);
    color: var(--text);
}

/* === HEADER === */
.header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

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

.header-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
}

.btn-icon:hover {
    background: var(--bg);
    color: var(--text);
}

.btn-logout {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-family: var(--font);
    cursor: pointer;
    transition: all var(--transition);
}

.btn-logout:hover {
    background: var(--danger-light);
    border-color: var(--danger);
    color: var(--danger);
}

/* === NAVIGATION === */
.nav {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.nav-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    gap: 0.25rem;
}

.nav-btn {
    padding: 0.75rem 1.25rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-family: var(--font);
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--transition);
}

.nav-btn:hover {
    color: var(--text);
    background: var(--bg);
}

.nav-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* === LOADING / ERROR === */
.loading-state, .error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
    color: var(--text-secondary);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.error-state h3 {
    color: var(--danger);
    margin: 1rem 0 0.5rem;
}

/* === MAIN CONTENT === */
.main-content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 1.5rem;
}

.section { animation: fadeIn 0.3s ease; }

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

.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 1.25rem;
}

/* === SUMMARY CARDS === */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.summary-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    transition: box-shadow var(--transition);
}

.summary-card:hover { box-shadow: var(--shadow-md); }

.summary-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.summary-icon.blue { background: var(--blue-light); color: var(--blue); }
.summary-icon.orange { background: var(--orange-light); color: var(--orange); }
.summary-icon.green { background: var(--secondary-light); color: var(--secondary); }
.summary-icon.purple { background: var(--purple-light); color: var(--purple); }

.summary-info {
    display: flex;
    flex-direction: column;
}

.summary-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-value {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text);
    margin-top: 0.25rem;
}

/* === CARDS === */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
}

.card-highlight {
    border: 2px solid var(--primary);
    background: var(--primary-lighter);
}

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

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

/* === CATEGORY DOTS === */
.category-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.category-dot.hard { background: var(--blue); }
.category-dot.soft { background: var(--purple); }
.category-dot.terreno { background: var(--orange); }

/* === BADGES === */
.badge {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    white-space: nowrap;
}

.badge-green {
    background: var(--secondary-light);
    color: #276749;
}

.badge-orange {
    background: var(--warning-light);
    color: #9c4221;
}

.badge-red {
    background: var(--danger-light);
    color: #c53030;
}

.badge-blue {
    background: var(--blue-light);
    color: #2b6cb0;
}

/* === PROGRESS BARS === */
.progress-item {
    margin-bottom: 1.25rem;
}

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

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.5rem;
}

.progress-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text);
}

.progress-values {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.progress-bar-bg {
    width: 100%;
    height: 10px;
    background: var(--border-light);
    border-radius: 5px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 5px;
    transition: width 0.8s ease;
    min-width: 2px;
}

.progress-bar-fill.blue { background: var(--blue); }
.progress-bar-fill.purple { background: var(--purple); }
.progress-bar-fill.orange { background: var(--orange); }
.progress-bar-fill.green { background: var(--secondary); }
.progress-bar-fill.red { background: var(--danger); }

.progress-amounts {
    display: flex;
    justify-content: space-between;
    margin-top: 0.35rem;
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* === SUBCATEGORY BREAKDOWN === */
.subcategory-breakdown {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
}

.subcategory-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.88rem;
}

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

.subcategory-name { color: var(--text); font-weight: 500; }

.subcategory-values {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.subcat-budget, .subcat-spent {
    min-width: 110px;
    text-align: right;
}

.subcat-budget { color: var(--text-secondary); }
.subcat-spent { color: var(--text); font-weight: 500; }

.subcat-bar {
    width: 100px;
    height: 6px;
    background: var(--border-light);
    border-radius: 3px;
    overflow: hidden;
}

.subcat-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.8s ease;
}

/* === BUDGET TOTAL SUMMARY === */
.budget-total-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    text-align: center;
}

.budget-total-item {
    padding: 1rem;
}

.budget-total-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.budget-total-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.budget-total-sub {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* === INDICATORS === */
.indicators-list {
    display: flex;
    flex-direction: column;
}

.indicator-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--border-light);
}

.indicator-row:last-child { border-bottom: none; }

.indicator-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.indicator-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

.indicator-value.positive { color: var(--secondary); }
.indicator-value.highlight { color: var(--primary); font-size: 1.1rem; }

/* === INVESTORS === */
.investors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.investor-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg);
    border-radius: var(--radius-sm);
}

.investor-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
}

.investor-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
}

.investor-amount {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* === HOUSES === */
.house-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.house-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.house-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    background: var(--primary-lighter);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.house-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
}

.house-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.house-detail {
    padding: 0.75rem;
    background: var(--bg);
    border-radius: var(--radius-sm);
}

.house-detail-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.house-detail-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    margin-top: 0.25rem;
}

/* === SALES STATUS === */
.sale-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

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

.sale-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
}

.sale-status {
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-available { background: var(--secondary-light); color: #276749; }
.status-in-process { background: var(--warning-light); color: #9c4221; }
.status-sold { background: var(--blue-light); color: #2b6cb0; }

.sale-info {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.sale-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
}

.sale-row-label { color: var(--text-secondary); }
.sale-row-value { font-weight: 500; color: var(--text); }

/* === GALLERY === */
.gallery-container {
    min-height: 200px;
}

.gallery-loading, .gallery-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: var(--text-secondary);
    text-align: center;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.gallery-item {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 4/3;
    background: var(--border-light);
    box-shadow: var(--shadow);
    transition: transform var(--transition), box-shadow var(--transition);
}

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

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gallery-item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.6));
    color: white;
    padding: 2rem 0.75rem 0.75rem;
    font-size: 0.8rem;
    opacity: 0;
    transition: opacity var(--transition);
}

.gallery-item:hover .gallery-item-overlay { opacity: 1; }

/* === LIGHTBOX === */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.9);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.lightbox img {
    max-width: 90%;
    max-height: 85vh;
    border-radius: var(--radius-sm);
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity var(--transition);
    z-index: 10;
}

.lightbox-close:hover { opacity: 1; }

.lightbox-prev, .lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    font-size: 1.5rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    transition: background var(--transition);
    z-index: 10;
}

.lightbox-prev { left: 1rem; }
.lightbox-next { right: 1rem; }
.lightbox-prev:hover, .lightbox-next:hover { background: rgba(255,255,255,0.2); }

.lightbox-caption {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 0.9rem;
    text-align: center;
    background: rgba(0,0,0,0.5);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
}

/* === EXPENSES TABLE === */
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-light);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.filter-group label {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.filter-group select,
.filter-group input {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-family: var(--font);
    color: var(--text);
    background: var(--bg-card);
    outline: none;
    transition: border-color var(--transition);
}

.filter-group select:focus,
.filter-group input:focus {
    border-color: var(--primary);
}

.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.expenses-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.expenses-table th {
    text-align: left;
    padding: 0.75rem 1rem;
    background: var(--bg);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

.expenses-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

.expenses-table tbody tr:hover { background: var(--bg); }

.expenses-table tbody tr:nth-child(even) { background: #fafbfc; }
.expenses-table tbody tr:nth-child(even):hover { background: var(--bg); }

.expenses-table tfoot td {
    padding: 0.85rem 1rem;
    background: var(--primary-lighter);
    border-top: 2px solid var(--primary);
    font-size: 0.95rem;
}

.text-right { text-align: right; }

.category-tag {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.tag-hard { background: var(--blue-light); color: #2b6cb0; }
.tag-soft { background: var(--purple-light); color: #553c9a; }
.tag-terreno { background: var(--orange-light); color: #9c4221; }

.no-data {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* === CAPITAL DISTRIBUTION (PIE CHART) === */
.capital-dist {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.pie-chart-container {
    position: relative;
    width: 140px;
    height: 140px;
    flex-shrink: 0;
}

.pie-chart {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    transform: rotate(-90deg);
}

.pie-chart-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70px;
    height: 70px;
    background: var(--bg-card);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.pie-chart-center-value {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text);
}

.pie-chart-center-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.capital-legend {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex: 1;
}

.capital-legend-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.88rem;
}

.capital-legend-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.capital-legend-pct {
    font-weight: 600;
    color: var(--text);
}

.capital-legend-amount {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-left: auto;
    margin-right: 0.75rem;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.capital-legend-pct {
    font-weight: 600;
    color: var(--text);
}

/* === RESPONSIVE === */
@media (max-width: 1024px) {
    .summary-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    .budget-total-summary {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .summary-cards {
        grid-template-columns: 1fr;
    }
    .grid-2 {
        grid-template-columns: 1fr;
    }
    .header-inner {
        flex-direction: row;
        align-items: center;
        padding: 0.75rem 1rem;
    }
    .header-left {
        gap: 0.5rem;
    }
    .header-title {
        font-size: 1rem;
    }
    .header-date {
        font-size: 0.7rem;
    }
    .header-right {
        gap: 0.35rem;
    }
    .btn-icon {
        width: 36px;
        height: 36px;
    }
    .btn-icon svg {
        width: 18px;
        height: 18px;
    }
    .btn-logout {
        padding: 0.4rem 0.6rem;
    }
    .btn-logout span { display: none; }

    /* Navigation - horizontal scroll */
    .nav {
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .nav::-webkit-scrollbar {
        display: none;
    }
    .nav-inner {
        padding: 0 0.75rem;
        gap: 0;
    }
    .nav-btn {
        padding: 0.6rem 0.85rem;
        font-size: 0.8rem;
        flex-shrink: 0;
    }

    .main-content {
        padding: 0.75rem;
    }

    /* Cards */
    .card {
        padding: 1rem;
        margin-bottom: 0.75rem;
    }
    .card-title {
        font-size: 0.9rem;
    }
    .section-title {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }

    /* Summary cards */
    .summary-card {
        padding: 1rem;
        gap: 0.75rem;
    }
    .summary-icon {
        width: 40px;
        height: 40px;
    }
    .summary-icon svg {
        width: 20px;
        height: 20px;
    }
    .summary-label {
        font-size: 0.7rem;
    }
    .summary-value {
        font-size: 1.15rem;
    }

    /* Pie chart - stack vertically on mobile */
    .capital-dist {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    .pie-chart-container {
        width: 160px;
        height: 160px;
    }
    .pie-chart-center {
        width: 80px;
        height: 80px;
    }
    .pie-chart-center-value {
        font-size: 1rem;
    }
    .capital-legend {
        width: 100%;
    }

    /* Progress items */
    .progress-label {
        font-size: 0.85rem;
    }
    .progress-values {
        font-size: 0.75rem;
    }
    .progress-amounts {
        font-size: 0.7rem;
    }

    /* Subcategory breakdown */
    .subcategory-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.4rem;
        padding: 0.75rem 0;
    }
    .subcategory-values {
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 0.5rem;
    }
    .subcat-budget, .subcat-spent {
        min-width: auto;
        font-size: 0.8rem;
    }
    .subcat-bar {
        width: 60px;
        flex-shrink: 0;
    }

    /* Budget total summary */
    .budget-total-summary {
        gap: 1rem;
    }
    .budget-total-item {
        padding: 0.75rem;
    }
    .budget-total-value {
        font-size: 1.2rem;
    }

    /* Indicators */
    .indicator-row {
        padding: 0.7rem 0;
    }
    .indicator-label {
        font-size: 0.85rem;
    }
    .indicator-value {
        font-size: 0.9rem;
    }

    /* Investors */
    .investors-grid {
        grid-template-columns: 1fr;
    }
    .investor-card {
        padding: 0.85rem;
    }
    .investor-avatar {
        width: 38px;
        height: 38px;
        font-size: 0.9rem;
    }

    /* Houses */
    .house-card {
        padding: 1rem;
    }
    .house-header {
        margin-bottom: 1rem;
    }
    .house-icon {
        width: 38px;
        height: 38px;
    }
    .house-name {
        font-size: 1rem;
    }
    .house-details {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }
    .house-detail {
        padding: 0.6rem;
    }
    .house-detail-label {
        font-size: 0.65rem;
    }
    .house-detail-value {
        font-size: 0.95rem;
    }

    /* Sales */
    .sale-card {
        padding: 1rem;
    }
    .sale-name {
        font-size: 1rem;
    }
    .sale-status {
        font-size: 0.75rem;
        padding: 0.3rem 0.7rem;
    }
    .sale-row {
        font-size: 0.85rem;
    }

    /* Filters */
    .filters {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    .filter-group {
        width: 100%;
    }
    .filter-group label {
        font-size: 0.75rem;
    }
    .filter-group select,
    .filter-group input {
        width: 100%;
        padding: 0.6rem;
    }
    .btn-secondary {
        width: 100%;
        padding: 0.6rem;
    }

    /* Table */
    .table-wrapper {
        margin: 0 -1rem;
        padding: 0 1rem;
    }
    .expenses-table {
        font-size: 0.8rem;
    }
    .expenses-table th {
        padding: 0.6rem 0.5rem;
        font-size: 0.7rem;
    }
    .expenses-table td {
        padding: 0.6rem 0.5rem;
    }
    .category-tag {
        font-size: 0.65rem;
        padding: 0.15rem 0.4rem;
    }

    /* Gallery */
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    /* Lightbox */
    .lightbox-prev, .lightbox-next {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    .lightbox-close {
        font-size: 1.75rem;
        top: 0.5rem;
        right: 1rem;
    }
    .lightbox-caption {
        font-size: 0.8rem;
        bottom: 1rem;
    }
}

@media (max-width: 480px) {
    .login-card {
        padding: 1.5rem;
        margin: 0.5rem;
    }
    .login-title {
        font-size: 1.25rem;
    }
    .login-subtitle {
        font-size: 0.85rem;
    }

    .header-logo {
        width: 28px;
        height: 28px;
    }
    .header-title {
        font-size: 0.9rem;
    }
    .header-date {
        display: none;
    }

    .summary-cards {
        gap: 0.75rem;
    }
    .summary-card {
        padding: 0.85rem;
    }
    .summary-value {
        font-size: 1.05rem;
    }

    /* Pie chart smaller on very small screens */
    .pie-chart-container {
        width: 130px;
        height: 130px;
    }
    .pie-chart-center {
        width: 65px;
        height: 65px;
    }
    .pie-chart-center-value {
        font-size: 0.85rem;
    }
    .pie-chart-center-label {
        font-size: 0.55rem;
    }
    .capital-legend-item {
        font-size: 0.8rem;
    }
    .capital-legend-amount {
        font-size: 0.7rem;
    }

    /* House details 1 column on very small */
    .house-details {
        grid-template-columns: 1fr;
    }

    /* Table - hide some columns on very small */
    .expenses-table th:nth-child(3),
    .expenses-table td:nth-child(3) {
        display: none;
    }

    /* Gallery single column */
    .gallery-grid {
        grid-template-columns: 1fr;
    }
}

/* === PRINT === */
@media print {
    .header { position: static; }
    .nav, .btn-icon, .btn-logout, #refresh-btn, #print-btn, #logout-btn { display: none !important; }
    .lightbox { display: none !important; }
    .filters { display: none !important; }
    .section { display: block !important; page-break-inside: avoid; }
    .hidden { display: block !important; }
    .card { box-shadow: none; border: 1px solid var(--border); }
    .summary-card { box-shadow: none; border: 1px solid var(--border); }
    body { background: white; }
    #login-screen { display: none !important; }
    #dashboard { display: block !important; }
}
