/* =============================================================================
   بهای تمام‌شده واقع‌گرایانه — داشبورد /cost
   (فایل جدا برای اطمینان از بارگذاری در publish؛ fallback بدون color-mix)
   ============================================================================= */

.cost-page .cost-amort-section-title {
    border-bottom-color: rgba(21, 101, 192, 0.35) !important;
}

.cost-page .cost-amort-panel {
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(21, 101, 192, 0.22);
    background: linear-gradient(160deg, rgba(227, 242, 253, 0.92), var(--mud-palette-surface, #ffffff));
    box-shadow: 0 6px 24px rgba(21, 101, 192, 0.1);
}

.cost-page .cost-amort-panel--empty {
    background: var(--mud-palette-surface, #ffffff);
    border-color: rgba(21, 101, 192, 0.14);
}

.cost-page .cost-amort-panel__header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(21, 101, 192, 0.14);
    background: rgba(21, 101, 192, 0.04);
}

.cost-page .cost-amort-compare-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

@media (min-width: 960px) {
    .cost-page .cost-amort-compare-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.cost-page .cost-amort-compare-card {
    border-radius: 12px;
    padding: 14px 16px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: var(--mud-palette-surface, #ffffff);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.cost-page .cost-amort-compare-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.1);
}

.cost-page .cost-amort-compare-card--egg {
    border-color: rgba(21, 101, 192, 0.28);
    background: linear-gradient(165deg, rgba(227, 242, 253, 0.95), var(--mud-palette-surface, #ffffff));
}

.cost-page .cost-amort-compare-card--chick {
    border-color: rgba(46, 125, 50, 0.28);
    background: linear-gradient(165deg, rgba(232, 245, 233, 0.95), var(--mud-palette-surface, #ffffff));
}

.cost-page .cost-amort-compare-card__title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    font-size: 0.92rem;
    margin-bottom: 10px;
    color: var(--mud-palette-text-primary, #212121);
}

.cost-page .cost-amort-compare-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.cost-page .cost-amort-metric {
    border-radius: 10px;
    padding: 10px 12px;
}

.cost-page .cost-amort-metric--new {
    border: 1px solid rgba(21, 101, 192, 0.32);
    background: rgba(21, 101, 192, 0.07);
}

.cost-page .cost-amort-compare-card--chick .cost-amort-metric--new {
    border-color: rgba(46, 125, 50, 0.32);
    background: rgba(46, 125, 50, 0.07);
}

.cost-page .cost-amort-metric--legacy {
    border: 1px solid rgba(120, 144, 156, 0.28);
    background: rgba(236, 239, 241, 0.85);
}

.cost-page .cost-amort-metric__label {
    display: block;
    font-size: 0.72rem;
    color: var(--mud-palette-text-secondary, rgba(0, 0, 0, 0.6));
    margin-bottom: 4px;
}

.cost-page .cost-amort-metric__value {
    font-size: 1.15rem;
    font-weight: 800;
    direction: ltr;
    unicode-bidi: plaintext;
    color: var(--mud-palette-text-primary, #212121);
}

.cost-page .cost-amort-diff {
    margin-top: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
    display: inline-block;
}

.cost-page .cost-amort-diff--lower {
    color: #2e7d32;
    background: rgba(232, 245, 233, 0.95);
}

.cost-page .cost-amort-diff--higher {
    color: #c62828;
    background: rgba(255, 235, 238, 0.95);
}

.cost-page .cost-amort-diff--same {
    color: var(--mud-palette-text-secondary, #78909c);
    background: rgba(236, 239, 241, 0.9);
}

.cost-page .cost-amort-weekly {
    margin-top: 8px;
    font-size: 0.78rem;
    color: var(--mud-palette-text-secondary, rgba(0, 0, 0, 0.6));
}

.cost-page .cost-amort-stack-bars {
    margin-top: 12px;
}

.cost-page .cost-amort-stack-bar {
    display: flex;
    height: 10px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(236, 239, 241, 0.9);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.08);
}

.cost-page .cost-amort-stack-bar--tall {
    height: 16px;
}

.cost-page .cost-amort-stack-seg {
    transition: width 0.4s ease;
    position: relative;
}

.cost-page .cost-amort-stack-seg--rearing {
    background: linear-gradient(90deg, #9575cd, #7e57c2);
}

.cost-page .cost-amort-stack-seg--production {
    background: linear-gradient(90deg, #66bb6a, #43a047);
}

.cost-page .cost-amort-stack-seg--hatchery {
    background: linear-gradient(90deg, #29b6f6, #0288d1);
}

.cost-page .cost-amort-stack-visual {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 4px;
}

.cost-page .cost-amort-stack-visual__bars {
    flex: 1;
    min-width: 0;
}

.cost-page .cost-amort-pie {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    position: relative;
}

.cost-page .cost-amort-pie::after {
    content: "";
    position: absolute;
    inset: 14px;
    border-radius: 50%;
    background: var(--mud-palette-surface, #fff);
    box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.06);
}

.cost-page .cost-amort-pct {
    font-style: normal;
    font-size: 0.68rem;
    opacity: 0.85;
    margin-right: 2px;
}

/* Charts row */
.cost-page .cost-amort-charts-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    border-top: 1px dashed rgba(21, 101, 192, 0.18);
    padding-top: 14px;
    margin-top: 4px;
}

@media (min-width: 960px) {
    .cost-page .cost-amort-charts-row {
        grid-template-columns: 1fr 1fr;
    }
}

.cost-page .cost-amort-chart-box {
    border-radius: 12px;
    padding: 12px 14px;
    border: 1px solid rgba(21, 101, 192, 0.14);
    background: rgba(255, 255, 255, 0.65);
}

.cost-page .cost-amort-chart-box__title {
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    color: var(--mud-palette-text-primary);
}

.cost-page .cost-amort-chart-box__legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin-top: 8px;
    font-size: 0.78rem;
}

.cost-page .cost-amort-chart-box__legend-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Chips */
.cost-page .cost-amort-chip--new {
    font-weight: 700 !important;
}

.cost-page .cost-amort-rearing-progress__bar {
    height: 12px !important;
    border-radius: 999px !important;
    background: rgba(126, 87, 194, 0.15) !important;
}

.cost-page .cost-amort-rearing-progress__pct {
    color: #7e57c2;
    font-size: 1rem;
}


.cost-page .cost-amort-stack-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    margin-top: 6px;
    font-size: 0.72rem;
    color: var(--mud-palette-text-secondary, rgba(0, 0, 0, 0.6));
}

.cost-page .cost-amort-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-left: 4px;
    vertical-align: middle;
}

.cost-page .cost-amort-dot--rearing { background: #7e57c2; }
.cost-page .cost-amort-dot--production { background: #43a047; }
.cost-page .cost-amort-dot--hatchery { background: #0288d1; }

.cost-page .cost-amort-rearing-progress {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 4px 12px;
    align-items: center;
    border-top: 1px dashed rgba(21, 101, 192, 0.18);
    padding-top: 12px;
    margin-top: 4px;
}

.cost-page .cost-amort-rearing-progress__label {
    grid-column: 1 / -1;
    font-size: 0.78rem;
    color: var(--mud-palette-text-secondary, rgba(0, 0, 0, 0.6));
}

.cost-page .cost-amort-rearing-progress__bar {
    grid-column: 1;
}

.cost-page .cost-amort-rearing-progress__pct {
    grid-column: 2;
    font-weight: 700;
    font-size: 0.85rem;
}

.cost-page .cost-amort-basis-grid {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 6px 16px;
}

@media (min-width: 600px) {
    .cost-page .cost-amort-basis-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1280px) {
    .cost-page .cost-amort-basis-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.cost-page .cost-amort-basis-item {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 5px 0;
    border-bottom: 1px dashed rgba(0, 0, 0, 0.12);
    font-size: 0.82rem;
}

.cost-page .cost-amort-basis-item__label {
    color: var(--mud-palette-text-secondary, rgba(0, 0, 0, 0.6));
}

.cost-page .cost-amort-basis-item__value {
    font-weight: 600;
    text-align: left;
    direction: ltr;
    unicode-bidi: plaintext;
    color: var(--mud-palette-text-primary, #212121);
}

.cost-page .cost-amort-formula-block {
    font-size: 0.84rem;
    line-height: 1.75;
    color: var(--mud-palette-text-primary, #212121);
}

.cost-page .cost-amort-formula-block hr {
    border: none;
    border-top: 1px dashed rgba(0, 0, 0, 0.12);
    margin: 10px 0;
}

.cost-page .cost-amort-formula-block__tag {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 6px;
    font-size: 0.78rem;
}

.cost-page .cost-amort-formula-block__tag--egg {
    background: rgba(21, 101, 192, 0.12);
    color: #1565c0;
}

.cost-page .cost-amort-formula-block__tag--chick {
    background: rgba(46, 125, 50, 0.12);
    color: #2e7d32;
}

.cost-page .cost-amort-formula-block__tag--legacy {
    background: rgba(120, 144, 156, 0.15);
    color: #546e7a;
}

[data-theme="dark"] .cost-page .cost-amort-panel {
    background: linear-gradient(160deg, rgba(30, 64, 175, 0.18), rgba(15, 23, 42, 0.88));
    border-color: rgba(147, 197, 253, 0.22);
}

[data-theme="dark"] .cost-page .cost-amort-panel__header {
    background: rgba(21, 101, 192, 0.12);
    border-bottom-color: rgba(147, 197, 253, 0.18);
}

[data-theme="dark"] .cost-page .cost-amort-compare-card {
    background: rgba(15, 23, 42, 0.72);
    border-color: rgba(148, 163, 184, 0.22);
}

[data-theme="dark"] .cost-page .cost-amort-compare-card--egg {
    background: linear-gradient(165deg, rgba(30, 64, 175, 0.22), rgba(15, 23, 42, 0.72));
    border-color: rgba(147, 197, 253, 0.28);
}

[data-theme="dark"] .cost-page .cost-amort-compare-card--chick {
    background: linear-gradient(165deg, rgba(6, 95, 70, 0.22), rgba(15, 23, 42, 0.72));
    border-color: rgba(134, 239, 172, 0.28);
}

[data-theme="dark"] .cost-page .cost-amort-metric--legacy {
    background: rgba(30, 41, 59, 0.72);
    border-color: rgba(148, 163, 184, 0.24);
}

[data-theme="dark"] .cost-page .cost-amort-metric--new {
    background: rgba(30, 64, 175, 0.2);
    border-color: rgba(147, 197, 253, 0.3);
}

[data-theme="dark"] .cost-page .cost-amort-compare-card--chick .cost-amort-metric--new {
    background: rgba(6, 95, 70, 0.22);
    border-color: rgba(134, 239, 172, 0.3);
}

[data-theme="dark"] .cost-page .cost-amort-diff--lower {
    color: #86efac;
    background: rgba(6, 95, 70, 0.35);
}

[data-theme="dark"] .cost-page .cost-amort-diff--higher {
    color: #fca5a5;
    background: rgba(127, 29, 29, 0.35);
}

[data-theme="dark"] .cost-page .cost-amort-stack-bar {
    background: rgba(51, 65, 85, 0.8);
}

[data-theme="dark"] .cost-page .cost-amort-formula-block__tag--egg {
    background: rgba(96, 165, 250, 0.18);
    color: #93c5fd;
}

[data-theme="dark"] .cost-page .cost-amort-formula-block__tag--chick {
    background: rgba(74, 222, 128, 0.16);
    color: #86efac;
}

[data-theme="dark"] .cost-page .cost-amort-chart-box {
    background: rgba(15, 23, 42, 0.72);
    border-color: rgba(147, 197, 253, 0.18);
}

[data-theme="dark"] .cost-page .cost-amort-pie::after {
    background: rgba(15, 23, 42, 0.95);
}

[data-theme="dark"] .cost-page .cost-amort-rearing-progress__pct {
    color: #b39ddb;
}
