/* CalculationPage Modern Dashboard Styles */

/* ===== MudPaper Rounded Corners ===== */
.mud-paper {
    border-radius: 12px !important;
}

/* ===== Stat Cards ===== */
.stat-card {
    background: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 12px;
    padding: 12px 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--card-accent, #00d68f), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 214, 143, 0.15);
    border-color: rgba(0, 214, 143, 0.3);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card.expanded {
    background: var(--mud-palette-background-grey);
}

/* Card accent colors */
.stat-card.total {
    --card-accent: #00d68f;
    border: 2px solid var(--mud-palette-text-primary);
    box-shadow: 0 4px 20px rgba(0, 214, 143, 0.25);
    font-weight: 600;
}

.stat-card.materials {
    --card-accent: #ffaa00;
}

.stat-card.operations {
    --card-accent: #0095ff;
}

/* ===== Card Value ===== */
.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--mud-palette-text-primary);
    line-height: 1.2;
}

.stat-value.small {
    font-size: 1.1rem;
}

/* Special styling for total value */
.stat-card.total .stat-value {
    color: #00d68f;
}

.stat-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--mud-palette-text-secondary);
    margin-bottom: 4px;
}

/* ===== Mini Chart Container ===== */
.mini-chart-container {
    height: 40px;
    display: flex;
    align-items: flex-end;
    gap: 2px;
    opacity: 0.7;
}

.mini-chart-bar {
    flex: 1;
    background: linear-gradient(to top, rgba(0, 214, 143, 0.3), rgba(0, 214, 143, 0.8));
    border-radius: 2px 2px 0 0;
    min-height: 4px;
    transition: height 0.5s ease;
}

/* ===== Expandable Content ===== */
.card-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s;
    padding-top: 0;
}

.card-details.expanded {
    max-height: 300px;
    padding-top: 12px;
    margin-top: 12px;
    border-top: 1px solid var(--mud-palette-lines-default);
}

/* ===== Ultra Compact Grid ===== */
.compact-grid .mud-table-cell {
    padding: 4px 8px !important;
    font-size: 0.72rem !important;
}

.compact-grid .mud-table-head .mud-table-cell {
    padding: 6px 8px !important;
    font-size: 0.68rem !important;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--mud-palette-text-secondary);
}

.compact-grid .mud-table-row {
    transition: background 0.2s;
}

.compact-grid .mud-table-row:hover {
    background: rgba(0, 214, 143, 0.05) !important;
}

.compact-grid .mud-input-root {
    font-size: 0.72rem !important;
}

/* ===== Progress Bar for Cost Distribution ===== */
.cost-bar {
    height: 4px;
    background: var(--mud-palette-lines-default);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 4px;
}

.cost-bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.5s ease;
}

.cost-bar-fill.materials {
    background: linear-gradient(90deg, #ffaa00, #ff8800);
}

.cost-bar-fill.operations {
    background: linear-gradient(90deg, #0095ff, #0077cc);
}

/* ===== Section Headers ===== */
.section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.section-header .mud-icon-root {
    font-size: 1rem;
    opacity: 0.7;
}

.section-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--mud-palette-text-secondary);
}

/* ===== Expand Icon ===== */
.expand-icon {
    transition: transform 0.3s;
    opacity: 0.5;
}

.expand-icon.rotated {
    transform: rotate(180deg);
}

/* ===== Project Tree Compact ===== */
.project-tree-compact {
    max-height: calc(100vh - 300px);
    overflow-y: auto;
}

/* ===== Donut Chart Small ===== */
.mini-donut-wrapper {
    display: flex;
    align-items: center;
    gap: 16px;
}

.mini-donut-legend {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.legend-dot.materials {
    background: #ffaa00;
}

.legend-dot.operations {
    background: #0095ff;
}

.legend-dot.total {
    background: #00d68f;
}

/* ===== Action Buttons Compact ===== */
.action-btn-compact {
    padding: 2px 8px !important;
    min-width: auto !important;
    font-size: 0.65rem !important;
}

/* Tree styles moved to app.css for better loading reliability */