
/* ============================================================
   SPK Items Card Layout (show/detail page)
   ============================================================ */
.ts-spk-items-section {
    border-top: 1px solid var(--ts-border, #e2e8f0);
    padding-top: 1rem;
}

.ts-item-card {
    border: 1px solid var(--ts-border, #e2e8f0);
    border-radius: var(--ts-radius-md, 0.5rem);
    overflow: hidden;
    background: #fff;
    transition: box-shadow 0.15s ease;
}

.ts-item-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.ts-item-card__header {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    background: var(--ts-surface-muted, #f8fafc);
    border-bottom: 1px solid var(--ts-border, #e2e8f0);
}

.ts-item-card__num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    background: var(--ts-primary, #2563eb);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.ts-item-card__title-wrap {
    flex: 1;
    min-width: 0;
}

.ts-item-card__title {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--ts-heading, #1e293b);
}

.ts-item-card__qty-col {
    flex-shrink: 0;
    text-align: right;
}

.ts-item-card__qty-value {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--ts-heading, #1e293b);
}

.ts-item-card__qty-label {
    font-size: 0.75rem;
    color: var(--ts-muted, #64748b);
    margin-left: 0.15rem;
}

/* Material chips inside item card */
.ts-item-card__materials {
    padding: 0.65rem 1rem;
    background: #fafbfd;
    border-bottom: 1px solid var(--ts-border, #e2e8f0);
}

.ts-item-card__section-label {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ts-muted, #64748b);
    font-weight: 600;
    display: block;
    margin-bottom: 0.4rem;
}

.ts-item-material-chip {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.4rem 0.6rem;
    background: #fff;
    border: 1px solid #e9ecf1;
    border-radius: 0.375rem;
    margin-bottom: 0.35rem;
}

.ts-item-material-chip:last-child {
    margin-bottom: 0;
}

.ts-item-material-chip__icon {
    font-size: 0.875rem;
    line-height: 1.4;
}

.ts-item-material-chip__info {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.ts-item-material-chip__name {
    font-size: 0.8125rem;
    font-weight: 500;
    color: #334155;
}

.ts-item-material-chip__meta {
    font-size: 0.75rem;
    color: #94a3b8;
}

/* Cost breakdown pills */
.ts-item-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.65rem 1rem;
}

.ts-item-card__costs {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.ts-cost-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.6rem;
    border-radius: 1rem;
    font-size: 0.75rem;
}

.ts-cost-pill__label {
    font-weight: 500;
}

.ts-cost-pill__value {
    font-weight: 600;
}

.ts-cost-pill--material {
    background: #fef3c7;
    color: #92400e;
}

.ts-cost-pill--jasa {
    background: #dbeafe;
    color: #1e40af;
}

.ts-item-card__subtotal {
    text-align: right;
}

.ts-item-card__subtotal-label {
    font-size: 0.6875rem;
    color: var(--ts-muted, #64748b);
    display: block;
}

.ts-item-card__subtotal-value {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--ts-heading, #1e293b);
}

/* Item notes */
.ts-item-card__notes {
    padding: 0.5rem 1rem;
    background: #fffbeb;
    border-top: 1px solid #fef3c7;
    font-size: 0.8125rem;
    color: #78716c;
}

.ts-item-card__notes-icon {
    margin-right: 0.25rem;
}

/* Grand total bar */
.ts-items-grand-total {
    background: var(--ts-surface-muted, #f8fafc);
    border: 1px solid var(--ts-border, #e2e8f0);
    border-radius: var(--ts-radius-md, 0.5rem);
    padding: 0.85rem 1rem;
    margin-top: 0.75rem;
}

.ts-items-grand-total__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 0;
}

.ts-items-grand-total__row--main {
    padding-top: 0.5rem;
    margin-top: 0.35rem;
    border-top: 2px solid var(--ts-border, #e2e8f0);
}

.ts-items-grand-total__label {
    font-size: 0.8125rem;
    color: var(--ts-muted, #64748b);
    font-weight: 500;
}

.ts-items-grand-total__row--main .ts-items-grand-total__label {
    font-size: 0.875rem;
    color: var(--ts-heading, #1e293b);
    font-weight: 600;
}

.ts-items-grand-total__value {
    font-weight: 600;
    font-size: 0.875rem;
}

.ts-items-grand-total__row--main .ts-items-grand-total__value {
    font-size: 1.0625rem;
    font-weight: 700;
}

/* ============================================================
   Summary sidebar sections
   ============================================================ */
.ts-summary-section {
    padding-bottom: 0.75rem;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid var(--ts-border, #e2e8f0);
}

.ts-summary-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.ts-summary-section__title {
    display: block;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ts-muted, #64748b);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

/* Material line in detail (fallback for non-card views) */
.ts-spk-material-line {
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
    margin-top: 0.4rem;
    font-size: 0.8125rem;
    color: #475569;
}

.ts-spk-material-line__icon {
    font-size: 0.8125rem;
    line-height: 1;
}

.ts-spk-review-breakdown {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.3rem;
    font-size: 0.75rem;
    color: #64748b;
}

.ts-spk-review-breakdown__sep {
    color: #cbd5e1;
}

/* ============================================================
   Mobile responsive
   ============================================================ */
@media (max-width: 575.98px) {
    .ts-item-card__header {
        padding: 0.7rem 0.75rem;
    }
    .ts-item-card__footer {
        flex-direction: column;
        align-items: flex-start;
    }
    .ts-item-card__subtotal {
        text-align: left;
        width: 100%;
        padding-top: 0.4rem;
        border-top: 1px dashed #e2e8f0;
    }
    .ts-item-card__materials {
        padding: 0.5rem 0.75rem;
    }
}

/* ============================================================
   Stat Highlight Cards (Summary sidebar)
   ============================================================ */
.ts-stat-highlight {
    display: flex;
    align-items: baseline;
    gap: 0.3rem;
    padding: 0.6rem 0.75rem;
    background: #f1f5f9;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
}

.ts-stat-highlight__value {
    font-size: 1.375rem;
    font-weight: 800;
    color: #1e293b;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
}

.ts-stat-highlight__unit {
    font-size: 0.8125rem;
    font-weight: 500;
    color: #64748b;
}

.ts-stat-highlight__currency {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #64748b;
    align-self: flex-start;
    margin-top: 0.25rem;
}

/* Tarif neto variant */
.ts-stat-highlight--secondary {
    background: #f8fafc;
    border-color: #e2e8f0;
}

.ts-stat-highlight--secondary .ts-stat-highlight__value {
    font-size: 1.125rem;
    font-weight: 700;
    color: #334155;
}

/* Total tarif kotor variant */
.ts-stat-highlight--primary {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border-color: rgba(37, 99, 235, 0.2);
}

.ts-stat-highlight--primary .ts-stat-highlight__value {
    font-size: 1.375rem;
    font-weight: 800;
    color: #1d4ed8;
}

.ts-stat-highlight--primary .ts-stat-highlight__currency {
    color: #3b82f6;
}

/* ============================================================
   Stat Row - Breakdown bahan dan jasa
   ============================================================ */
.ts-stat-row {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.ts-stat-row__item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0.65rem;
    background: #f8fafc;
    border-radius: 0.375rem;
    border: 1px solid #f1f5f9;
}

.ts-stat-row__item--total {
    background: #fff;
    border: 1px solid #e2e8f0;
}

.ts-stat-row__label {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 500;
}

.ts-stat-row__value {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1e293b;
    font-variant-numeric: tabular-nums;
}

.ts-stat-row__value--material {
    color: #b45309;
}

.ts-stat-row__value--jasa {
    color: #1d4ed8;
}
