/* executive.css - Executive Dashboard Styles */

/* ==================== */
/* Container */
/* ==================== */

#executive-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* ==================== */
/* Loading & Error */
/* ==================== */

.executive-loading,
.executive-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 500px;
    text-align: center;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e2e8f0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.executive-error {
    color: #f56565;
}

.error-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.executive-error button {
    margin-top: 20px;
    padding: 12px 24px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
}

/* ==================== */
/* Dashboard */
/* ==================== */

.executive-dashboard {
    background: #f7fafc;
    border-radius: 16px;
    padding: 32px;
    min-height: calc(100vh - 120px);
}

/* ==================== */
/* Header */
/* ==================== */

.executive-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 40px;
    padding-bottom: 24px;
    border-bottom: 3px solid #e2e8f0;
}

.header-content {
    flex: 1;
}

.executive-title {
    font-size: 36px;
    font-weight: 800;
    color: #1a202c;
    margin: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-subtitle {
    font-size: 16px;
    color: #718096;
    margin-top: 8px;
}

.header-actions {
    display: flex;
    gap: 12px;
}

.btn-primary,
.btn-secondary {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: white;
    color: #2d3748;
    border: 2px solid #e2e8f0;
}

.btn-secondary:hover {
    border-color: #667eea;
    color: #667eea;
}

/* ==================== */
/* Metrics Grid */
/* ==================== */

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 40px;
}

.metric-card {
    background: white;
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 20px;
}

.metric-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.metric-large {
    grid-column: span 1;
}

.metric-icon {
    font-size: 48px;
    opacity: 0.9;
}

.metric-content {
    flex: 1;
}

.metric-value {
    font-size: 36px;
    font-weight: 800;
    color: #1a202c;
    margin-bottom: 8px;
}

.metric-label {
    font-size: 14px;
    color: #718096;
    font-weight: 500;
}

.metric-hint {
    font-size: 13px;
    margin-top: 8px;
    font-weight: 600;
}

/* Metric Variants */
.metric-roi {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-left: 6px solid #10b981;
}

.metric-roi .metric-value {
    color: #059669;
}

.metric-success {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border-left: 6px solid #059669;
}

.metric-success .metric-value {
    color: #047857;
}

.metric-engagement {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-left: 6px solid #3b82f6;
}

.metric-engagement .metric-value {
    color: #2563eb;
}

.metric-ideas {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-left: 6px solid #f59e0b;
}

.metric-ideas .metric-value {
    color: #d97706;
}

/* Status Card */
.metric-status {
    padding: 20px;
}

.status-content {
    display: flex;
    align-items: center;
    justify-content: space-around;
    width: 100%;
}

.status-item {
    text-align: center;
    flex: 1;
}

.status-value {
    font-size: 42px;
    font-weight: 800;
    margin-bottom: 8px;
}

.status-label {
    font-size: 13px;
    color: #718096;
    font-weight: 600;
}

.status-on-track .status-value {
    color: #10b981;
}

.status-at-risk .status-value {
    color: #f59e0b;
}

.status-divider {
    width: 2px;
    height: 60px;
    background: #e2e8f0;
}

/* ==================== */
/* Wins Section */
/* ==================== */

.wins-section {
    background: white;
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 32px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.section-title {
    font-size: 24px;
    font-weight: 700;
    color: #1a202c;
    margin: 0 0 24px 0;
}

.wins-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.win-card {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-radius: 12px;
    padding: 24px;
    border-left: 6px solid #f59e0b;
    display: flex;
    gap: 16px;
    align-items: center;
}

.win-rank {
    font-size: 48px;
    font-weight: 800;
    color: #d97706;
    opacity: 0.8;
}

.win-content {
    flex: 1;
}

.win-name {
    font-size: 16px;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 12px;
}

.win-savings {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.savings-amount {
    font-size: 20px;
    font-weight: 800;
    color: #059669;
}

.savings-label {
    font-size: 12px;
    color: #718096;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.6;
}

.empty-state p {
    color: #718096;
    font-size: 16px;
}

/* ==================== */
/* Footer */
/* ==================== */

.executive-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 24px;
    border-top: 2px solid #e2e8f0;
    margin-top: 40px;
}

.footer-text {
    font-size: 13px;
    color: #718096;
}

.footer-logo {
    font-size: 14px;
    color: #2d3748;
}

.footer-logo strong {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ==================== */
/* Widgets Row (Phase 8.2) */
/* ==================== */

.exec-widgets-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.exec-widgets-2col {
    grid-template-columns: 1fr 1fr;
}

.exec-widget {
    background: white;
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: all 0.3s;
}

.exec-widget:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.exec-widget-header {
    font-size: 14px;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.exec-widget-icon {
    font-size: 18px;
}

.exec-widget-wide {
    /* Takes full width in 2-col grid via parent */
}

.exec-widget-empty {
    color: #a0aec0;
    font-size: 13px;
    text-align: center;
    padding: 24px 0;
}

.exec-widget-ok {
    color: #38a169;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    padding: 12px 0;
}

.exec-widget-footnote {
    font-size: 12px;
    color: #a0aec0;
    margin-top: 12px;
    text-align: center;
}

/* ==================== */
/* KPI Widget */
/* ==================== */

.exec-kpi-summary {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.exec-kpi-dot {
    font-size: 14px;
    font-weight: 600;
}

.exec-kpi-total {
    font-size: 12px;
    color: #a0aec0;
    margin-left: auto;
}

.exec-kpi-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.exec-kpi-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    background: #f7fafc;
    border-radius: 6px;
    font-size: 13px;
}

.exec-kpi-name {
    flex: 1;
    color: #2d3748;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ==================== */
/* 5S Widget */
/* ==================== */

.exec-5s-score {
    font-size: 42px;
    font-weight: 800;
    text-align: center;
    margin-bottom: 12px;
    line-height: 1;
}

.exec-5s-max {
    font-size: 18px;
    font-weight: 400;
    color: #a0aec0;
}

.exec-5s-bars {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.exec-5s-bar-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.exec-5s-label {
    width: 80px;
    font-size: 12px;
    color: #718096;
    text-align: right;
    flex-shrink: 0;
}

.exec-5s-bar {
    flex: 1;
    height: 8px;
    background: #edf2f7;
    border-radius: 4px;
    overflow: hidden;
}

.exec-5s-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.exec-5s-val {
    width: 28px;
    font-size: 12px;
    font-weight: 600;
    color: #4a5568;
    text-align: right;
    flex-shrink: 0;
}

/* ==================== */
/* OEE Widget */
/* ==================== */

.exec-oee-score {
    font-size: 42px;
    font-weight: 800;
    text-align: center;
    line-height: 1;
    margin-bottom: 4px;
}

.exec-oee-label {
    font-size: 13px;
    color: #718096;
    text-align: center;
    margin-bottom: 16px;
}

.exec-oee-breakdown {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.exec-oee-item {
    display: flex;
    justify-content: space-between;
    padding: 6px 8px;
    background: #f7fafc;
    border-radius: 6px;
    font-size: 13px;
    color: #4a5568;
}

/* ==================== */
/* Funnel Widget */
/* ==================== */

.exec-funnel {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.exec-funnel-stage {
    display: flex;
    align-items: center;
    gap: 12px;
}

.exec-funnel-bar-wrap {
    flex: 1;
    height: 24px;
    background: #edf2f7;
    border-radius: 6px;
    overflow: hidden;
}

.exec-funnel-bar {
    height: 100%;
    border-radius: 6px;
    transition: width 0.5s ease;
    min-width: 4px;
}

.exec-funnel-info {
    width: 100px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.exec-funnel-val {
    font-size: 16px;
    font-weight: 700;
    color: #2d3748;
    min-width: 24px;
}

.exec-funnel-label {
    font-size: 12px;
    color: #718096;
}

/* ==================== */
/* Attention Widget */
/* ==================== */

.exec-attention-count {
    margin-left: auto;
    background: #fed7d7;
    color: #c53030;
    font-size: 12px;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 12px;
}

.exec-attention-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.exec-attention-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    border-left: 4px solid #e2e8f0;
}

.exec-attention-critical {
    background: #fff5f5;
    border-left-color: #e53e3e;
}

.exec-attention-warning {
    background: #fffbeb;
    border-left-color: #ed8936;
}

.exec-attention-info {
    background: #ebf8ff;
    border-left-color: #3182ce;
}

.exec-att-icon {
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 2px;
}

.exec-att-info {
    flex: 1;
    min-width: 0;
}

.exec-att-title {
    font-size: 13px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 2px;
}

.exec-att-desc {
    font-size: 12px;
    color: #718096;
}

/* ==================== */
/* Responsive */
/* ==================== */

@media (max-width: 1200px) {
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .exec-widgets-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .executive-dashboard {
        padding: 20px;
    }

    .executive-header {
        flex-direction: column;
        gap: 20px;
    }

    .header-actions {
        width: 100%;
        flex-direction: column;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
    }

    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .wins-grid {
        grid-template-columns: 1fr;
    }

    .exec-widgets-row,
    .exec-widgets-2col {
        grid-template-columns: 1fr;
    }

    .exec-funnel-info {
        width: 80px;
    }

    .executive-title {
        font-size: 28px;
    }

    .metric-value {
        font-size: 28px;
    }
}

/* ==================== */
/* Print Styles */
/* ==================== */

@media print {
    .executive-dashboard {
        background: white;
        padding: 20px;
    }

    .header-actions,
    .btn-primary,
    .btn-secondary {
        display: none;
    }

    .metric-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #e2e8f0;
    }

    .wins-section {
        break-inside: avoid;
    }

    .exec-widget {
        box-shadow: none;
        border: 1px solid #e2e8f0;
        break-inside: avoid;
    }
}
