/* Enhanced Overview Dashboard Styles */

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 2rem;
    border-radius: 20px;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
    color: white;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.05)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    pointer-events: none;
}

.hero-content {
    flex: 1;
    z-index: 2;
    position: relative;
}

.company-branding {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.company-avatar {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 700;
    color: white;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    border: 3px solid rgba(255, 255, 255, 0.2);
}

.company-name {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    background: linear-gradient(45deg, #ffffff, #f1f3f4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.company-subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    margin: 0 0 1rem 0;
    font-weight: 400;
}

.period-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    opacity: 0.8;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 25px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: fit-content;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.hero-action-btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.hero-action-btn.primary {
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

.hero-action-btn.secondary {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

.hero-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.hero-action-btn.primary:hover {
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.6);
}

.btn-icon {
    font-size: 1.2rem;
}

.hero-visual {
    flex: 0 0 400px;
    height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    position: relative;
}

.animated-chart-container {
    width: 100%;
    height: 100%;
    position: relative;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 1rem;
}

/* Executive Summary */
.executive-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.summary-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.summary-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.summary-card.primary-metric {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.summary-card.secondary-metric {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.summary-card.health-metric {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

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

.metric-icon {
    padding: 0.75rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.metric-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    animation: pulse 2s infinite;
}

.metric-status.positive .status-indicator {
    background: #10b981;
}

.metric-status.warning .status-indicator {
    background: #f59e0b;
}

.metric-status.negative .status-indicator {
    background: #ef4444;
}

.metric-title {
    font-size: 0.9rem;
    font-weight: 500;
    margin: 0 0 0.5rem 0;
    opacity: 0.9;
}

.metric-value {
    font-size: 2.2rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    line-height: 1;
}

.metric-context {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    opacity: 0.8;
}

.change-indicator {
    font-weight: 600;
}

.change-indicator.positive {
    color: #10b981;
}

.change-indicator.negative {
    color: #ef4444;
}

.metric-sparkline {
    height: 50px;
    margin-top: 1rem;
    opacity: 0.8;
    position: relative;
}

.metric-sparkline canvas {
    width: 100% !important;
    height: 100% !important;
}

/* Health Score Ring */
.health-score-ring {
    width: 50px;
    height: 50px;
}

.circular-chart {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    max-height: 100%;
}

.circle-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.2);
    stroke-width: 2.8;
}

.circle {
    fill: none;
    stroke: #10b981;
    stroke-width: 2.8;
    stroke-linecap: round;
    animation: progress 1s ease-out forwards;
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
}

@keyframes progress {
    0% {
        stroke-dasharray: 0 100;
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Insights Section */
.insights-section {
    margin-bottom: 2rem;
}

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

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.section-icon {
    font-size: 1.3rem;
}

.section-subtitle {
    color: #6b7280;
    margin: 0;
    font-size: 0.95rem;
}

.insights-filters {
    display: flex;
    gap: 0.5rem;
    background: #f3f4f6;
    padding: 0.25rem;
    border-radius: 12px;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #6b7280;
}

.filter-btn.active {
    background: white;
    color: #1f2937;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.insights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.insight-card {
    background: white;
    border-radius: 12px;
    padding: 1.25rem;
    border-left: 4px solid #3b82f6;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.insight-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.insight-card.opportunity {
    border-left-color: #10b981;
}

.insight-card.risk {
    border-left-color: #ef4444;
}

.insight-card.trend {
    border-left-color: #8b5cf6;
}

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

.insight-icon {
    font-size: 1.25rem;
}

.insight-priority {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
}

.insight-priority.high {
    background: #fef2f2;
    color: #dc2626;
}

.insight-priority.medium {
    background: #fef3c7;
    color: #d97706;
}

.insight-priority.low {
    background: #f0f9ff;
    color: #2563eb;
}

.insight-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 0.5rem 0;
}

.insight-description {
    font-size: 0.9rem;
    color: #6b7280;
    margin: 0;
    line-height: 1.4;
}

/* Performance Overview */
.performance-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
    align-items: start;
}

.overview-chart-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    overflow: visible;
    display: flex;
    flex-direction: column;
    height: auto;
}

.overview-chart-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.12);
}

.overview-chart-card.featured {
    grid-row: span 2;
}

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

.chart-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.chart-controls {
    display: flex;
    gap: 0.25rem;
    background: #f3f4f6;
    padding: 0.25rem;
    border-radius: 8px;
}

.chart-control-btn {
    padding: 0.4rem 0.8rem;
    border: none;
    background: transparent;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #6b7280;
}

.chart-control-btn.active {
    background: white;
    color: #1f2937;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.chart-container {
    height: 200px;
    position: relative;
    padding: 0.5rem;
    box-sizing: border-box;
}

.chart-container.compact {
    height: 140px;
    padding: 0.25rem;
}

.chart-container canvas {
    width: 100% !important;
    height: 100% !important;
    max-width: 100%;
    max-height: 100%;
}

.chart-footer {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #f3f4f6;
}

.trend-indicators {
    display: flex;
    gap: 1rem;
}

.trend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #6b7280;
}

.trend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.trend-dot.revenue {
    background: #3b82f6;
}

.trend-dot.profit {
    background: #10b981;
}

.trend-dot.margin {
    background: #8b5cf6;
}

/* Ratios Display */
.ratios-display {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ratio-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: #f9fafb;
    border-radius: 8px;
}

.ratio-label {
    font-size: 0.85rem;
    color: #6b7280;
    font-weight: 500;
}

.ratio-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1f2937;
}

.ratio-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
}

.ratio-status.warning {
    background: #f59e0b;
}

.ratio-status.danger {
    background: #ef4444;
}

/* Cash Overview */
.cash-overview {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cash-metric {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.cash-label {
    font-size: 0.85rem;
    color: #6b7280;
    font-weight: 500;
}

.cash-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
}

.cash-trend {
    height: 80px;
    position: relative;
    margin-top: 0.5rem;
}

.cash-trend canvas {
    width: 100% !important;
    height: 100% !important;
}

/* Account Summary */
.account-summary {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 0;
    flex: 1;
}

.account-type-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background: #f9fafb;
    border-radius: 6px;
    border-left: 3px solid #3b82f6;
    overflow: hidden;
    min-height: 40px;
}

.account-type-label {
    font-size: 0.9rem;
    color: #6b7280;
    font-weight: 500;
    flex: 1;
    margin-right: 0.5rem;
}

.account-type-count {
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
    background: #e5e7eb;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    margin-right: 0.5rem;
    flex-shrink: 0;
}

.account-type-total {
    font-size: 0.85rem;
    font-weight: 600;
    color: #059669;
    flex-shrink: 0;
    text-align: right;
    max-width: 80px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Data Coverage */
.data-coverage {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 0;
    flex: 1;
}

.coverage-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background: #f0f9ff;
    border-radius: 6px;
    border-left: 3px solid #0ea5e9;
}

.coverage-label {
    font-size: 0.9rem;
    color: #0369a1;
    font-weight: 500;
}

.coverage-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e40af;
}

/* Next Steps */
.next-steps {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 0;
    flex: 1;
}

.step-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    background: #fef3c7;
    border-radius: 6px;
    border-left: 3px solid #f59e0b;
    transition: all 0.2s ease;
    cursor: pointer;
}

.step-item:hover {
    background: #fef9c3;
    transform: translateX(2px);
}

.step-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.step-text {
    font-size: 0.9rem;
    color: #92400e;
    font-weight: 500;
}

/* Quick Actions Section */
.quick-actions-section {
    margin-bottom: 2rem;
}

.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.quick-action-card {
    background: white;
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.quick-action-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    text-decoration: none;
}

.action-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    display: block;
}

.action-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 0.5rem 0;
}

.action-description {
    font-size: 0.85rem;
    color: #6b7280;
    margin: 0;
    line-height: 1.4;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .performance-overview {
        grid-template-columns: 1fr 1fr;
    }
    
    .overview-chart-card.featured {
        grid-column: span 2;
        grid-row: span 1;
    }
}

@media (max-width: 768px) {
    .hero-section {
        flex-direction: column;
        text-align: center;
        padding: 1.5rem;
    }
    
    .hero-visual {
        flex: none;
        width: 100%;
        margin-top: 1.5rem;
    }
    
    .company-branding {
        flex-direction: column;
        text-align: center;
    }
    
    .company-name {
        font-size: 2rem;
    }
    
    .performance-overview {
        grid-template-columns: 1fr;
    }
    
    .quick-actions-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    .insights-filters {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .executive-summary {
        grid-template-columns: 1fr;
    }
    
    .hero-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .hero-action-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Loading States */
.loading-pulse {
    animation: pulse 1.5s ease-in-out infinite;
}

.loading-shimmer {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .summary-card:not(.primary-metric):not(.secondary-metric):not(.health-metric) {
        background: #1f2937;
        color: white;
        border-color: #374151;
    }
    
    .overview-chart-card {
        background: #1f2937;
        color: white;
        border-color: #374151;
    }
    
    .section-title {
        color: white;
    }
    
    .quick-action-card {
        background: #1f2937;
        color: white;
        border-color: #374151;
    }
}