/* ========================================
   DASHBOARD OVERVIEW STYLES — PREMIUM
   ======================================== */

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.metrics-grid-premium {
    gap: 1.25rem;
}

.metric-card {
    background: #13131c;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 5px;
    padding: 1.5rem 1.6rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    transition: all 0.22s ease;
    position: relative;
    overflow: hidden;
}

.metric-card-premium {
    background: #13131c;
    border-left-width: 3px;
}

/* Accent left-border by data-accent */
.metric-card-glow { display: none; }

.metric-card-premium[data-accent="blue"]   { border-left-color: #4a9eff; }
.metric-card-premium[data-accent="green"]  { border-left-color: #00c896; }
.metric-card-premium[data-accent="purple"] { border-left-color: #a78bfa; }
.metric-card-premium[data-accent="orange"] { border-left-color: #f6ad55; }

.metric-card:hover {
    background: #16161f;
    border-color: rgba(255, 255, 255, 0.12);
}

.metric-card-premium:hover {
    background: #16161f;
}

.metric-card-premium:hover .metric-icon {
    opacity: 0.8;
}

.metric-icon {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
    transition: opacity 0.22s ease;
}

.metric-icon.blue   { background: rgba(74, 158, 255, 0.1);  color: #4a9eff;  border: 1px solid rgba(74, 158, 255, 0.2); }
.metric-icon.green  { background: rgba(0, 200, 150, 0.1);   color: #00c896;  border: 1px solid rgba(0, 200, 150, 0.2); }
.metric-icon.purple { background: rgba(167, 139, 250, 0.1); color: #a78bfa;  border: 1px solid rgba(167, 139, 250, 0.2); }
.metric-icon.orange { background: rgba(246, 173, 85, 0.1);  color: #f6ad55;  border: 1px solid rgba(246, 173, 85, 0.2); }

.metric-content {
    flex: 1;
    min-width: 0;
}

.metric-label {
    display: block;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.38);
    margin-bottom: 0.45rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.metric-value {
    font-size: 2.15rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    letter-spacing: -0.03em;
    line-height: 1;
}

.metric-change {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.82rem;
    font-weight: 600;
    margin-top: 0.5rem;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
}

.metric-change.positive {
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

.metric-change.negative {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.metric-change i {
    font-size: 0.7rem;
}

/* Charts Row */
.charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.chart-card {
    background: #13131c;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 5px;
    padding: 1.5rem;
    min-height: 400px;
    display: flex;
    flex-direction: column;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-shrink: 0;
}

.chart-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
}

.chart-period-selector {
    padding: 0.5rem 1rem;
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 8px;
    font-size: 0.875rem;
    color: #b3b3b3;
    background: rgba(255, 255, 255, 0.08);
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.chart-period-selector:hover {
    border-color: #d4af37;
}

.chart-period-selector:focus {
    outline: none;
    border-color: #d4af37;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

/* Canvas Container */
.chart-card canvas {
    max-height: 300px;
    flex: 1;
}

/* Overview Bottom Row */
.overview-bottom-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

/* Activity Card */
.activity-card {
    background: #13131c;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 5px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.activity-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.activity-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
}

.btn-link {
    background: none;
    border: none;
    color: #d4af37;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.3s ease;
}

.btn-link:hover {
    color: #b8941f;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 460px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 0.4rem;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 0.85rem 0.5rem;
    border-radius: 3px;
    background: transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: background 0.2s ease;
}

.activity-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.activity-item.important {
    border-left: 4px solid #f59e0b;
    background: rgba(245, 158, 11, 0.08);
}

.activity-item.critical {
    border-left: 4px solid #ef4444;
    background: rgba(239, 68, 68, 0.08);
}

.activity-icon {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.activity-icon.sale     { background: rgba(0,  200, 150, 0.12); color: #00c896; }
.activity-icon.lead     { background: rgba(246, 173, 85,  0.12); color: #f6ad55; }
.activity-icon.property { background: rgba(74,  158, 255, 0.12); color: #4a9eff; }
.activity-icon.visit    { background: rgba(167, 139, 250, 0.12); color: #a78bfa; }

.activity-content {
    flex: 1;
    min-width: 0;
}

.activity-title {
    font-weight: 500;
    color: #ffffff;
    margin-bottom: 0.25rem;
}

.activity-priority {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.1rem 0.45rem;
    font-size: 0.68rem;
    font-weight: 700;
    margin-left: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.activity-priority.important {
    color: #fbbf24;
    background: rgba(245, 158, 11, 0.2);
}

.activity-priority.critical {
    color: #f87171;
    background: rgba(239, 68, 68, 0.2);
}

.activity-description {
    font-size: 0.875rem;
    color: #b3b3b3;
    margin-bottom: 0.25rem;
}

.activity-time {
    font-size: 0.75rem;
    color: #888;
}

/* Top Properties Card */
.top-properties-card {
    background: #13131c;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 5px;
    padding: 1.5rem;
}

.top-properties-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.top-properties-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
}

.top-properties-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.top-property-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: background 0.2s ease;
}

.top-property-item:last-child {
    border-bottom: none;
}

.top-property-item:hover {
    background: rgba(255, 255, 255, 0.03);
    padding-left: 0.4rem;
}

.top-property-image {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.top-property-info {
    flex: 1;
}

.top-property-title {
    font-weight: 500;
    color: #ffffff;
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
}

.top-property-location {
    font-size: 0.75rem;
    color: #b3b3b3;
    margin-bottom: 0.5rem;
}

.top-property-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: #b3b3b3;
}

.stat-item i {
    color: #d4af37;
}

.top-property-price {
    font-weight: 700;
    color: #d4af37;
    font-size: 1rem;
}

/* Empty State for Activities */
.activity-empty-state,
.top-properties-empty-state {
    text-align: center;
    padding: 2rem;
    color: #9ca3af;
}

.activity-empty-state i,
.top-properties-empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

/* Responsive Design */
@media (max-width: 1400px) {
    .charts-row {
        grid-template-columns: 1fr;
    }
    
    .chart-card {
        min-height: 350px;
    }
}

@media (max-width: 1024px) {
    .overview-bottom-row {
        grid-template-columns: 1fr;
    }
    
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
        margin-top: 0.5rem;
        margin-bottom: 1.5rem;
    }
    
    .metric-card {
        padding: 1.1rem;
        border-radius: 14px;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .metric-icon {
        width: 44px;
        height: 44px;
        border-radius: 11px;
        font-size: 1.2rem;
    }

    .metric-label {
        font-size: 0.7rem;
    }

    .metric-value {
        font-size: 1.5rem;
    }

    .metric-change {
        font-size: 0.72rem;
        padding: 0.15rem 0.45rem;
    }
    
    .chart-card {
        min-height: 300px;
    }
    
    .chart-card canvas {
        max-height: 250px;
    }
}

@media (max-width: 480px) {
    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .metric-card {
        flex-direction: row;
        align-items: center;
        padding: 1rem;
    }
}

/* ========================================
   SEÇÃO FINANCEIRA — ESTILOS
   ======================================== */

.fin-breakdown {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1rem 0;
}

.fin-breakdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.fin-breakdown-label {
    min-width: 90px;
    font-size: 13px;
    font-weight: 600;
    color: rgba(255,255,255,0.75);
    display: flex;
    align-items: center;
    gap: 6px;
}

.fin-breakdown-bar {
    flex: 1;
    height: 12px;
    background: rgba(255,255,255,0.08);
    border-radius: 6px;
    overflow: hidden;
}

.fin-breakdown-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 0.6s ease;
}

.fin-breakdown-fill.sale {
    background: linear-gradient(90deg, #27ae60, #2ecc71);
}

.fin-breakdown-fill.rental {
    background: linear-gradient(90deg, #2980b9, #3498db);
}

.fin-breakdown-value {
    min-width: 100px;
    text-align: right;
    font-size: 14px;
    font-weight: 700;
    color: #d4af37;
}

.section-card {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(212,175,55,0.12);
    border-radius: 16px;
    padding: 1.5rem;
}

/* Transaction type badges */
.tx-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.tx-type-badge.sale {
    background: rgba(39,174,96,0.15);
    color: #2ecc71;
}

.tx-type-badge.rental {
    background: rgba(52,152,219,0.15);
    color: #3498db;
}

.tx-commission {
    font-weight: 700;
    color: #d4af37;
}

/* Modal financeiro */
.fin-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.fin-modal {
    background: #1a2332;
    border: 1px solid rgba(212,175,55,0.2);
    border-radius: 16px;
    padding: 2rem;
    max-width: 520px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.fin-modal h3 {
    margin: 0 0 1.5rem 0;
    color: #d4af37;
    font-size: 1.2rem;
}

.fin-modal .form-group {
    margin-bottom: 1rem;
}

.fin-modal label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: rgba(255,255,255,0.7);
    margin-bottom: 4px;
}

.fin-modal input,
.fin-modal select,
.fin-modal textarea {
    width: 100%;
    padding: 8px 12px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    box-sizing: border-box;
}

.fin-modal input:focus,
.fin-modal select:focus {
    border-color: #d4af37;
    outline: none;
}

.fin-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

.fin-modal-actions button {
    padding: 8px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-size: 14px;
}

.fin-modal-actions .btn-cancel {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.fin-modal-actions .btn-save {
    background: linear-gradient(135deg, #d4af37, #b8962e);
    color: #1a2332;
}

.fin-row-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 480px) {
    .fin-row-group {
        grid-template-columns: 1fr;
    }
}
