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

/* ===== CONTAINER & LAYOUT ===== */
.ccc-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: #1f2937;
    padding: 0;
    border: none;
    background: #FFFFFF;
    border-radius: 6px;

    max-width: 1200px; /* Maximum width for readability */
    margin: 0 auto; /* Center the content */}

/* ===== HEADER SECTION ===== */
.ccc-wrapper .report-title {
    font-size: 1.5rem;
    font-weight: 600;
    text-align: center;
    margin: 0;
    padding: 1.5rem 1.5rem 0.375rem;
    color: #1f2937;
}

.ccc-wrapper .report-subtitle {
    font-size: 0.875rem;
    text-align: center;
    margin: 0;
    padding: 0.375rem 1.5rem 1.5rem;
    font-style: normal;
    color: #6b7280;
    font-weight: 400;
}

/* ===== METRICS GRID ===== */
.ccc-wrapper .cvp-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    padding: 1.5rem;
    margin: 0;
}

/* ===== METRIC CARDS ===== */
.ccc-metric-card {
    background: white;
    border-radius: 6px;
    padding: 1.5rem;
    border: 1px solid #e5e7eb;
    transition: box-shadow 0.2s ease;
}

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

.ccc-metric-card .metric-label {
    font-weight: 500;
    font-size: 0.875rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
    display: block;
}

.ccc-metric-card .metric-value {
    font-size: 2.5rem;
    font-weight: 400;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', 'Consolas', monospace;
    font-variant-numeric: tabular-nums;
    color: #3b82f6;
    margin-bottom: 0.5rem;
    display: block;
    line-height: 1.2;
}

.ccc-metric-card .metric-interpretation {
    font-size: 0.8125rem;
    color: #6b7280;
    line-height: 1.5;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #f3f4f6;
}

/* ===== METRIC STATUS INDICATORS ===== */
.ccc-metric-card .metric-status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 1.25rem;
    font-size: 0.75rem;
    font-weight: 500;
    margin-top: 0.5rem;
}

.ccc-metric-card .metric-status.excellent {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.ccc-metric-card .metric-status.good {
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
}

.ccc-metric-card .metric-status.needs-improvement {
    background: rgba(251, 191, 36, 0.1);
    color: #d97706;
}

/* ===== ACCOUNT IDENTIFICATION SECTION ===== */
.ccc-account-section {
    margin: 1.5rem;
    padding: 1.5rem;
    background: white;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    border-left: 3px solid #3b82f6;
    margin-bottom: 1.5rem;
}

.ccc-account-section:last-child {
    border-bottom: none;
}

.ccc-account-section h4 {
    margin: 0 0 1rem 0;
    font-size: 1.0625rem;
    font-weight: 500;
    color: #1f2937;
}

.ccc-account-select {
    width: 100%;
    min-height: 100px;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.9375rem;
    background: white;
    transition: all 0.2s ease;
}

.ccc-account-select:hover {
    border-color: #3b82f6;
}

.ccc-account-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.ccc-account-select option {
    padding: 0.5rem;
}

.ccc-account-select option:disabled {
    font-style: italic;
    color: #9ca3af;
    background: #f9fafb;
}

/* ===== OPENING BALANCES TABLE ===== */
.opening-balances-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    margin: 1rem 0;
    font-size: 0.875rem;
}

.opening-balances-table th,
.opening-balances-table td {
    padding: 0.875rem 1rem;
    border: none;
    text-align: left;
}

.opening-balances-table th {
    background: #f9fafb;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #e5e7eb;
}

.opening-balances-table tbody tr {
    transition: background 0.2s ease;
}

.opening-balances-table tbody tr:hover {
    background: #f9fafb;
}

.opening-balances-table tbody tr:not(:last-child) {
    border-bottom: 1px solid #f3f4f6;
}

.opening-balances-table td:nth-child(2),
.opening-balances-table td:nth-child(3) input {
    text-align: right;
}

.opening-balance-input {
    width: 120px;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', 'Consolas', monospace;
    font-variant-numeric: tabular-nums;
    font-size: 0.9375rem;
    transition: all 0.2s ease;
}

.opening-balance-input:hover {
    border-color: #3b82f6;
}

.opening-balance-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* ===== COMPONENTS SUMMARY SECTION ===== */
.ccc-components-summary {
    margin: 1.5rem;
    padding: 1.5rem;
    background: white;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    border-left: 3px solid #3b82f6;
}

.ccc-components-summary h4 {
    margin: 0 0 1rem 0;
    font-size: 1.125rem;
    font-weight: 500;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ccc-components-summary p {
    margin: 0.75rem 0;
    padding: 0.75rem;
    background: #f9fafb;
    border-radius: 6px;
    font-size: 0.9375rem;
    color: #374151;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', 'Consolas', monospace;
    font-variant-numeric: tabular-nums;
}

.ccc-components-summary p strong {
    color: #1f2937;
    font-weight: 500;
}

/* ===== LOADING STATE ===== */
.ccc-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    background: white;
    border-radius: 6px;
    margin: 1.5rem;
}

.ccc-loading .spinner {
    width: 48px;
    height: 48px;
    border: 3px solid #e5e7eb;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ===== EMPTY STATE ===== */
.ccc-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    background: white;
    border-radius: 6px;
    margin: 1.5rem;
    padding: 3rem;
    text-align: center;
}

.ccc-empty-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 1.5rem;
    opacity: 0.3;
}

.ccc-empty h3 {
    font-size: 1.5rem;
    font-weight: 500;
    color: #1f2937;
    margin: 0 0 0.5rem 0;
}

.ccc-empty p {
    font-size: 1rem;
    color: #6b7280;
    margin: 0;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1024px) {
    .ccc-wrapper .cvp-metrics-grid {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
        gap: 1rem;
        padding: 1rem;
    }

    .ccc-wrapper .report-title {
        font-size: 1.375rem;
        padding: 1.25rem 1.25rem 0.375rem;
    }
}

@media (max-width: 768px) {
    .ccc-wrapper .cvp-metrics-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 0.5rem;
    }

    .ccc-wrapper .report-title {
        font-size: 1.25rem;
        padding: 1rem 1rem 0.375rem;
    }

    .ccc-metric-card {
        padding: 1.25rem;
    }

    .ccc-metric-card .metric-value {
        font-size: 2rem;
    }

    .ccc-account-section,
    .ccc-components-summary {
        margin: 0.5rem;
        padding: 1rem;
    }

    .opening-balance-input {
        width: 100px;
    }
}

@media (max-width: 480px) {
    .ccc-metric-card .metric-value {
        font-size: 1.75rem;
    }

    .ccc-components-summary h4 {
        font-size: 1.0625rem;
    }

    .opening-balance-input {
        width: 80px;
        font-size: 0.8125rem;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .ccc-wrapper {
        background: white;
    }

    .ccc-metric-card,
    .ccc-account-section,
    .ccc-components-summary,
    .opening-balances-table {
        border: 1px solid #d1d5db;
        page-break-inside: avoid;
    }

    .ccc-metric-card:hover {
        transform: none;
        box-shadow: none;
    }
}

/* ===== ACCESSIBILITY ===== */
.ccc-metric-card:focus-within,
.ccc-account-select:focus,
.opening-balance-input:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}
