/* کد را درون فایل tiarche-calculator.css قرار دهید. */

/* --- استایل دهی مراحل --- */
#tiarche-calculator-container {
    max-width: 100%;
    margin: 0 auto;
}
#tiarche-step-indicator {
    display: flex;
    justify-content: space-around;
    margin-bottom: 25px;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

#tiarche-step-indicator span {
    padding: 5px 10px;
    cursor: default;
    font-weight: 600;
    color: #aaa;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}

#tiarche-step-indicator span.active {
    color: #000;
    border-color: #1e73be;
}

.tiarche-step h3 {
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 20px;
    font-size: 1.2em;
    color: #333;
}

/* --- استایل ردیف‌های ورودی --- */
#tiarche-length-quantity-rows,
#tiarche-rebar-rows {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.tiarche-row-item {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #f9f9f9;
}

.tiarche-row-item .field-group {
    display: flex;
    flex-direction: column;
    min-width: 100px;
    flex-grow: 1;
}

.tiarche-row-item .row-index-label,
.tiarche-row-item .batch-id-label {
    min-width: 50px;
    max-width: 80px;
    flex-grow: 0;
    text-align: center;
}
.tiarche-row-item .batch-id-label .batch-id {
    font-weight: bold;
    font-size: 1.1em;
    color: #1e73be;
}
.tiarche-row-item .row-index-label span {
     font-weight: bold;
}

/* استایل نمایش قیمت در مرحله ۲ (تغییر یافته به قیمت واحد تخمینی) */
.tiarche-row-item .price-display-preview {
    min-width: 120px;
    max-width: 150px;
    background-color: #eaf7f2; /* رنگ کمی متفاوت */
    padding: 5px 10px;
    border-radius: 4px;
    text-align: center;
    justify-content: center;
    height: 62px; 
    border: 1px solid #cceeff;
}

.tiarche-row-item .price-display-preview label {
    font-size: 0.8em;
    color: #555;
    margin-bottom: 2px;
}
.tiarche-row-item .price-display-preview span {
    font-weight: bold;
    color: #27ae60; /* سبز برای قیمت */
}

.tiarche-row-item .remove-row-btn {
    align-self: flex-end;
    min-width: 60px;
    padding: 8px 10px;
    font-size: 0.9em;
    background-color: #e74c3c;
    border-color: #c0392b;
    color: #fff;
}
.tiarche-row-item .remove-row-btn:hover {
     background-color: #c0392b;
}

#tiarche-rebar-rows .tiarche-row-item {
    padding: 15px;
}

/* --- دکمه‌های اقدام --- */
.step-1-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 15px;
}

#step-2-actions {
    display: flex;
    width: 100%;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
}

.add-row-btn {
    align-self: flex-start;
    padding: 8px 15px;
    margin-bottom: 10px;
}

/* --- استایل جدول فاکتور (مرحله ۳) --- */
#invoice-table-container {
    overflow-x: auto;
}

#tiarche-invoice-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    font-size: 0.9em;
}

#tiarche-invoice-table th,
#tiarche-invoice-table td {
    border: 1px solid #eee;
    padding: 8px;
    text-align: center;
    white-space: nowrap; 
}

#tiarche-invoice-table thead th {
    background-color: #f5f5f5;
    font-weight: bold;
}

/* استایل برای پیام خالی بودن فاکتور */
#tiarche-invoice-table tr .info-message {
    background-color: #fff3cd;
    color: #856404;
    font-weight: bold;
    padding: 15px;
    text-align: center;
}

/* خط جداکننده گروهی در فاکتور */
#tiarche-invoice-table .batch-separator {
    border: none;
    border-top: 2px dashed #999; 
    margin: 5px 0;
    width: 95%; 
}
#tiarche-invoice-table tr td:has(.batch-separator) {
    background-color: transparent !important;
    padding: 0;
    border: none;
}

#tiarche-invoice-table tfoot th,
#tiarche-invoice-table tfoot td {
    background-color: #eaf1f7;
    font-weight: bold;
    color: #1e73be;
}

#final-total-price {
    font-size: 1.2em;
    color: #c0392b;
}

#final-total-quantity {
    font-size: 1.2em;
    color: #27ae60;
}