/* productivityMetrics.css - Professional Financial SaaS Version */

/* ===== EMPLOYEE CONFIGURATION FORM ===== */
.pm-employee-config-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding: 1.25rem;
    max-width: 500px;
    margin: 0 auto;
}

.pm-form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.pm-form-group label {
    font-weight: 500;
    color: #374151;
    font-size: 0.9375rem;
}

.pm-form-group input[type="number"],
.pm-form-group select {
    padding: 0.625rem 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 0.9375rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    color: #1f2937;
}

.pm-form-group input[type="number"]:focus,
.pm-form-group select:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
    border-color: #3b82f6;
}

.pm-form-group small {
    color: #6b7280;
    font-size: 0.8125rem;
    font-style: italic;
}

.pm-form-group label input[type="checkbox"] {
    margin-right: 0.5rem;
    cursor: pointer;
}

.pm-form-group label input[type="checkbox"]:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* ===== METRICS GRID LAYOUTS ===== */
.pm-metrics-grid {
    display: grid;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 0;
}

.pm-employee-metrics {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.pm-alternative-metrics {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* ===== SECTION HEADERS ===== */
.pm-section-header {
    grid-column: 1 / -1;
    background: #3b82f6;
    color: white;
    padding: 1rem 1.25rem;
    border-radius: 6px;
    margin: 0.625rem 0 0.375rem 0;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.pm-section-header.pm-alternative-header {
    background: #d97706;
}

.pm-section-header h4 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
}

.pm-employee-count,
.pm-note {
    font-size: 0.875rem;
    font-weight: 400;
    opacity: 0.95;
}

/* ===== METRIC CARDS ===== */
.pm-metric-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 1.25rem;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: box-shadow 0.2s ease;
    position: relative;
}

.pm-metric-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.pm-metric-label {
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.pm-metric-value {
    font-size: 1.75rem;
    font-weight: 400;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', 'Consolas', monospace;
    font-variant-numeric: tabular-nums;
    color: #1f2937;
    line-height: 1.2;
}

.pm-metric-description {
    font-size: 0.8125rem;
    color: #6b7280;
    font-style: italic;
}

/* ===== SCORE-BASED COLORING ===== */
.pm-metric-card.pm-score-excellent {
    border-left: 3px solid #10b981;
}

.pm-metric-card.pm-score-excellent .pm-metric-value {
    color: #059669;
}

.pm-metric-card.pm-score-good {
    border-left: 3px solid #10b981;
}

.pm-metric-card.pm-score-good .pm-metric-value {
    color: #059669;
}

.pm-metric-card.pm-score-fair {
    border-left: 3px solid #f59e0b;
}

.pm-metric-card.pm-score-fair .pm-metric-value {
    color: #d97706;
}

.pm-metric-card.pm-score-poor {
    border-left: 3px solid #ef4444;
}

.pm-metric-card.pm-score-poor .pm-metric-value {
    color: #dc2626;
}

/* ===== BENCHMARK PANEL ===== */
.pm-benchmark-panel {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.pm-benchmark-panel h4 {
    margin: 0 0 0.75rem 0;
    color: #1f2937;
    font-size: 1.125rem;
    font-weight: 600;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 0.625rem;
}

.pm-benchmark-description {
    margin: 0 0 1.25rem 0;
    color: #6b7280;
    font-style: italic;
    font-size: 0.875rem;
}

.pm-benchmark-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.pm-benchmark-metric {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.pm-benchmark-label {
    font-weight: 500;
    color: #1f2937;
    font-size: 0.9375rem;
}

.pm-benchmark-scale {
    position: relative;
}

.pm-benchmark-bar {
    position: relative;
    height: 60px;
    background: linear-gradient(to right,
        #ef4444 0%,
        #ef4444 25%,
        #f59e0b 25%,
        #f59e0b 50%,
        #10b981 50%,
        #10b981 75%,
        #059669 75%,
        #059669 100%);
    border-radius: 6px;
    overflow: hidden;
}

.pm-benchmark-ranges {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: space-around;
    background: rgba(255, 255, 255, 0.85);
    padding: 0 0.625rem;
}

.pm-range {
    font-size: 0.75rem;
    font-weight: 500;
    text-align: center;
    padding: 0.25rem 0.375rem;
    border-radius: 4px;
    white-space: nowrap;
}

.pm-range.pm-poor {
    color: #dc2626;
    background: rgba(239, 68, 68, 0.1);
}

.pm-range.pm-average {
    color: #d97706;
    background: rgba(245, 158, 11, 0.1);
}

.pm-range.pm-good {
    color: #059669;
    background: rgba(16, 185, 129, 0.1);
}

.pm-range.pm-excellent {
    color: #047857;
    background: rgba(5, 150, 105, 0.1);
}

.pm-current-position {
    position: absolute;
    bottom: -25px;
    transform: translateX(-50%);
    background: #3b82f6;
    color: white;
    padding: 0.375rem 0.625rem;
    border-radius: 4px;
    font-size: 0.8125rem;
    font-weight: 500;
    white-space: nowrap;
    z-index: 10;
}

.pm-current-position::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-bottom-color: #3b82f6;
}

.pm-current-value {
    display: block;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', 'Consolas', monospace;
    font-variant-numeric: tabular-nums;
}

/* ===== INSIGHTS PANEL ===== */
.pm-insights {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.pm-insights h4 {
    margin: 0 0 1.25rem 0;
    color: #1f2937;
    font-size: 1.125rem;
    font-weight: 600;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 0.625rem;
}

.pm-insights-list {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.pm-insight-card {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    padding: 0.875rem;
    border-radius: 6px;
    border-left: 3px solid #e5e7eb;
    background-color: white;
    transition: box-shadow 0.2s ease;
}

.pm-insight-card:hover {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.pm-insight-card.pm-positive {
    border-left-color: #10b981;
    background-color: white;
}

.pm-insight-card.pm-warning {
    border-left-color: #f59e0b;
    background-color: white;
}

.pm-insight-card.pm-negative {
    border-left-color: #ef4444;
    background-color: white;
}

.pm-insight-card.pm-info {
    border-left-color: #3b82f6;
    background-color: white;
}

.pm-insight-icon {
    font-size: 1.125rem;
    font-weight: 500;
    min-width: 24px;
    text-align: center;
    margin-top: 2px;
    flex-shrink: 0;
}

.pm-insight-card.pm-positive .pm-insight-icon {
    color: #059669;
}

.pm-insight-card.pm-warning .pm-insight-icon {
    color: #d97706;
}

.pm-insight-card.pm-negative .pm-insight-icon {
    color: #dc2626;
}

.pm-insight-card.pm-info .pm-insight-icon {
    color: #3b82f6;
}

.pm-insight-content {
    flex: 1;
}

.pm-insight-content h5 {
    margin: 0 0 0.375rem 0;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #1f2937;
}

.pm-insight-content p {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.5;
    color: #374151;
}

/* ===== CHARTS SECTION ===== */
.pm-charts-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.pm-chart-wrapper {
    background-color: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    min-height: 450px;
}

.pm-chart-title {
    text-align: center;
    font-size: 1.0625rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 1rem 0;
    flex-shrink: 0;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
}

.pm-chart-wrapper canvas {
    flex-grow: 1;
    min-height: 0;
    max-height: 400px;
}

/* ===== SUMMARY NOTE ===== */
.pm-summary-note {
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 1rem;
    margin-top: 1.25rem;
    text-align: center;
}

.pm-summary-note p {
    margin: 0;
    font-size: 0.875rem;
    color: #6b7280;
    line-height: 1.5;
}

/* ===== TREND INDICATORS ===== */
.pm-metric-card .pm-trend-indicator {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.pm-trend-indicator.pm-up {
    background: #10b981;
}

.pm-trend-indicator.pm-down {
    background: #ef4444;
}

.pm-trend-indicator.pm-stable {
    background: #f59e0b;
}

/* ===== HIGHLIGHT CARD ===== */
.pm-metric-card.pm-highlight {
    background: white;
    border: 1px solid #3b82f6;
}

.pm-metric-card.pm-highlight .pm-metric-value {
    color: #3b82f6;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1024px) {
    .pm-charts-section {
        grid-template-columns: 1fr;
    }

    .pm-employee-metrics {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }

    .pm-alternative-metrics {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }

    .pm-benchmark-ranges {
        flex-direction: column;
        gap: 0.25rem;
        padding: 0.375rem;
    }

    .pm-range {
        font-size: 0.6875rem;
    }
}

@media (max-width: 768px) {
    .pm-metrics-grid {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        gap: 0.875rem;
    }

    .pm-section-header {
        flex-direction: column;
        gap: 0.375rem;
        text-align: center;
        padding: 0.875rem 1rem;
    }

    .pm-section-header h4 {
        font-size: 1.0625rem;
    }

    .pm-metric-card {
        padding: 1rem;
    }

    .pm-metric-value {
        font-size: 1.5rem;
    }

    .pm-chart-wrapper {
        min-height: 350px;
        padding: 1.25rem;
    }

    .pm-chart-wrapper canvas {
        max-height: 300px;
    }

    .pm-benchmark-panel {
        padding: 1.25rem;
    }

    .pm-benchmark-bar {
        height: 40px;
    }

    .pm-current-position {
        bottom: -20px;
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }

    .pm-insights {
        padding: 1.25rem;
    }

    .pm-insight-card {
        padding: 0.75rem;
        gap: 0.75rem;
    }
}

@media (max-width: 480px) {
    .pm-metrics-grid {
        grid-template-columns: 1fr;
    }

    .pm-chart-wrapper {
        min-height: 300px;
        padding: 1rem;
    }

    .pm-chart-wrapper canvas {
        max-height: 250px;
    }

    .pm-insight-card {
        flex-direction: column;
        text-align: center;
        padding: 0.75rem;
    }

    .pm-insight-icon {
        align-self: center;
    }

    .pm-employee-config-form {
        padding: 1rem;
        max-width: 100%;
    }

    .pm-form-group {
        gap: 0.5rem;
    }

    .pm-benchmark-ranges {
        display: none;
    }

    .pm-benchmark-bar {
        height: 30px;
    }

    .pm-current-position {
        position: static;
        transform: none;
        margin-top: 0.625rem;
        display: inline-block;
    }

    .pm-current-position::before {
        display: none;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .pm-charts-section {
        display: block;
    }

    .pm-chart-wrapper {
        page-break-inside: avoid;
        margin-bottom: 1rem;
        min-height: 300px;
        box-shadow: none;
        border: 1px solid #d1d5db;
    }

    .pm-chart-wrapper canvas {
        max-height: 280px;
    }

    .pm-insights,
    .pm-benchmark-panel {
        page-break-inside: avoid;
        border: 1px solid #d1d5db;
        box-shadow: none;
    }

    .pm-metrics-grid {
        page-break-inside: avoid;
    }

    .pm-section-header {
        color: white;
        background: #3b82f6;
        border: none;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .pm-section-header.pm-alternative-header {
        background: #d97706;
    }

    .pm-benchmark-bar {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .pm-current-position {
        background: #3b82f6;
        color: white;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .pm-trend-indicator {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* ===== ACCESSIBILITY ===== */
.pm-metric-card:focus-within,
.pm-insight-card:focus-within,
.pm-chart-wrapper:focus-within {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}
