/* StartAi.PropertyAnalytics 01.00.00 Dashboard Styling */

.startai-property-analytics-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #2c3e50;
    padding: 15px;
    background: #f8fafc;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.analytics-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 20px;
}

.analytics-title {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: #1e293b;
}

.analytics-subtitle {
    margin: 5px 0 0;
    font-size: 13px;
    color: #64748b;
}

.analytics-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.date-filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
}

.analytics-nav-tabs {
    display: flex;
    gap: 8px;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 20px;
}

.nav-tab {
    padding: 10px 18px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-tab:hover {
    color: #0284c7;
}

.nav-tab.active {
    color: #0284c7;
    border-bottom-color: #0284c7;
    background: #f0f9ff;
    border-radius: 6px 6px 0 0;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* KPI Grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.kpi-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.kpi-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.kpi-title {
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
}

.kpi-icon {
    font-size: 18px;
}

.kpi-value {
    font-size: 24px;
    font-weight: 800;
    color: #0f172a;
    margin: 12px 0;
}

.kpi-footer {
    font-size: 12px;
    color: #94a3b8;
    border-top: 1px dashed #f1f5f9;
    padding-top: 8px;
}

/* Panels & Tables */
.panel-box {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 18px;
    margin-bottom: 20px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.panel-title {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    margin-top: 0;
    margin-bottom: 14px;
}

.panel-desc {
    font-size: 13px;
    color: #64748b;
    margin-top: -8px;
    margin-bottom: 14px;
}

.table-custom {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.table-custom th, .table-custom td {
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    text-align: left;
}

.table-custom th {
    background: #f8fafc;
    font-weight: 700;
    color: #334155;
}

.table-custom tr:nth-child(even) {
    background: #fbfcfe;
}

/* Market Summary Banner */
.market-summary-banner {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
}

.banner-item {
    flex: 1 1 200px;
    display: flex;
    flex-direction: column;
}

.banner-label {
    font-size: 12px;
    color: #1e40af;
    font-weight: 600;
}

.banner-value {
    font-size: 18px;
    font-weight: 800;
    color: #1e3a8a;
    margin-top: 4px;
}

/* Funnel Visualization */
.funnel-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 700px;
    margin: 20px auto;
}

.funnel-step {
    display: flex;
    align-items: center;
    background: #f1f5f9;
    border-radius: 6px;
    overflow: hidden;
    height: 48px;
    position: relative;
    border: 1px solid #cbd5e1;
}

.funnel-bar {
    height: 100%;
    background: linear-gradient(90deg, #38bdf8, #0284c7);
    transition: width 0.8s ease;
}

.funnel-content {
    position: absolute;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 16px;
    font-weight: 700;
    font-size: 13px;
    color: #0f172a;
}

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

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background-color: #ffffff;
    min-width: 220px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.1);
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    z-index: 100;
}

.dropdown-content a {
    color: #334155;
    padding: 10px 14px;
    text-decoration: none;
    display: block;
    font-size: 13px;
}

.dropdown-content a:hover {
    background-color: #f1f5f9;
    color: #0284c7;
}

.dropdown-export:hover .dropdown-content {
    display: block;
}

.analytics-loading-overlay {
    display: none;
    text-align: center;
    padding: 40px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0284c7;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    animation: spin 1s linear infinite;
    margin: 0 auto 12px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
