/* Dashboard page styles */

.dashboard-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

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

.dashboard-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--bs-text);
    margin: 0;
}

.subtitle {
    color: var(--bs-text-subtle);
    margin: 0.5rem 0 0 0;
}


.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--bs-border);
    border-top-color: var(--bs-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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


/* KPI Cards */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.kpi-card {
    background: var(--bs-surface);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    gap: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.kpi-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    flex-shrink: 0;
}

.kpi-content {
    flex: 1;
}

.kpi-label {
    font-size: 0.875rem;
    color: var(--bs-text-subtle);
    margin-bottom: 0.25rem;
}

.kpi-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--bs-text);
    line-height: 1;
}

.kpi-subtitle {
    font-size: 0.75rem;
    color: var(--bs-gray-400);
    margin-top: 0.25rem;
}

.kpi-warning {
    color: var(--bs-warning);
}

.kpi-multi-currency {
    font-size: 1.25rem;
}

/* Charts */
.charts-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.chart-card {
    background: var(--bs-surface);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

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

.chart-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--bs-text);
    margin: 0;
}

.chart-header span {
    color: var(--bs-primary);
    font-size: 1.5rem;
}

.chart-content {
    min-height: 250px;
}

.bar-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    height: 200px;
    gap: 2px;
    padding: 1rem 0;
}

.bar-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
}

.bar {
    width: 100%;
    background: linear-gradient(180deg, var(--bs-primary) 0%, #667eea 100%);
    border-radius: 4px 4px 0 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 4px;
    min-height: 4px;
    transition: all 0.3s;
    position: relative;
}

.bar:hover {
    opacity: 0.8;
}

.bar-value {
    font-size: 0.625rem;
    font-weight: 600;
    color: white;
}

.bar-label {
    font-size: 0.625rem;
    color: var(--bs-text-subtle);
    margin-top: 4px;
}

/* Coffee Types */
.coffee-types-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.coffee-type-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.coffee-type-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.coffee-type-name {
    font-weight: 600;
    color: var(--bs-text);
}

.coffee-type-count {
    font-size: 0.875rem;
    color: var(--bs-text-subtle);
}

.coffee-type-bar {
    height: 8px;
    background: var(--bs-gray-100);
    border-radius: 4px;
    overflow: hidden;
}

.coffee-type-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--bs-primary) 0%, #667eea 100%);
    transition: width 0.3s;
}

.chart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: var(--bs-gray-400);
}

.chart-empty span {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

/* Stats */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card-large {
    background: var(--bs-surface);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon-large {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    flex-shrink: 0;
}

.stat-content-large h3 {
    font-size: 0.875rem;
    color: var(--bs-text-subtle);
    margin: 0 0 0.5rem 0;
    font-weight: 500;
}

.stat-value-large {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--bs-text);
    margin: 0 0 0.25rem 0;
}

.stat-subtitle {
    font-size: 0.75rem;
    color: var(--bs-gray-400);
    margin: 0;
}

/* Quick Actions */
.quick-actions {
    background: var(--bs-surface);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.quick-actions h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--bs-text);
    margin: 0 0 1rem 0;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--bs-gray-50);
    border: 1px solid var(--bs-border);
    border-radius: 8px;
    color: var(--bs-text);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn:hover {
    background: var(--bs-primary);
    color: white;
    border-color: var(--bs-primary);
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--bs-primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: var(--bs-primary-dark);
}

/* Currency Breakdown Modal */
.currency-breakdown-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.currency-breakdown-modal {
    background: var(--bs-surface);
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--bs-border);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--bs-text);
}

.close-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    color: var(--bs-text-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.close-btn:hover {
    background: var(--bs-gray-100);
    color: var(--bs-text);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}

.warning-banner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bs-warning-light);
    border-radius: 8px;
    color: #92400e;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.warning-banner span.material-symbols-outlined {
    color: var(--bs-warning);
}

.breakdown-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--bs-gray-50);
    border-radius: 8px;
}

.currency-code {
    font-weight: 600;
    font-size: 1rem;
    color: var(--bs-text);
    background: var(--bs-border);
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
}

.amount-info {
    text-align: right;
}

.original-amount {
    font-weight: 600;
    color: var(--bs-text);
}

.converted-amount {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
    color: var(--bs-success);
    margin-top: 0.25rem;
}

.not-converted {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
    color: var(--bs-error);
    margin-top: 0.25rem;
}

.total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    border-radius: 8px;
    margin-top: 1rem;
    color: white;
}

.total-label {
    font-weight: 500;
}

.total-value {
    font-size: 1.25rem;
    font-weight: 700;
}

/* Responsive */
@media (max-width: 768px) {
    .dashboard-container {
        padding: 1rem;
    }

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

    .charts-row {
        grid-template-columns: 1fr;
    }

    .stats-row {
        grid-template-columns: 1fr;
    }

    .bar-label {
        font-size: 0.5rem;
    }
}
