/* Quotation module — structured cards, pricing summary, sticky actions */

.qe-page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    bottom: 0;
    z-index: 20;
    background: var(--card-bg, #fff);
    border-top: 1px solid var(--border-color, #e5e7eb);
    padding: 0.85rem 1rem;
    margin: 1.25rem -0.25rem -0.25rem;
    box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.06);
}

.qe-page-actions__end {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.qe-section {
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 0.75rem;
    background: var(--card-bg, #fff);
    margin-bottom: 1rem;
    overflow: hidden;
}

.qe-section__header {
    padding: 0.85rem 1.1rem;
    border-bottom: 1px solid var(--border-color, #eef2f7);
    font-weight: 600;
    font-size: 0.95rem;
    background: rgba(148, 163, 184, 0.08);
}

.qe-section__body {
    padding: 1.1rem;
}

.qe-customer-card,
.qe-address-card {
    border: 1px dashed var(--border-color, #cbd5e1);
    border-radius: 0.65rem;
    padding: 0.9rem 1rem;
    background: rgba(241, 245, 249, 0.55);
}

.qe-customer-card__name,
.qe-address-card__title {
    font-weight: 600;
    margin-bottom: 0.15rem;
}

.qe-summary {
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 0.75rem;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.9), #fff);
}

.qe-summary__title {
    padding: 0.8rem 1rem;
    font-weight: 600;
    border-bottom: 1px solid var(--border-color, #eef2f7);
}

.qe-summary__row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.55rem 1rem;
    font-size: 0.925rem;
}

.qe-summary__row--agreed {
    align-items: center;
    background: rgba(59, 130, 246, 0.06);
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.qe-summary__row--total {
    border-top: 1px solid var(--border-color, #e5e7eb);
    font-weight: 700;
    font-size: 1.05rem;
    padding-top: 0.85rem;
    padding-bottom: 0.85rem;
    color: var(--primary, #2563eb);
}

.qe-summary__input {
    max-width: 160px;
    text-align: end;
}

/* Hide native number spinners on money inputs */
.qe-summary__input::-webkit-outer-spin-button,
.qe-summary__input::-webkit-inner-spin-button,
#qeDiscountValue::-webkit-outer-spin-button,
#qeDiscountValue::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.qe-summary__input,
#qeDiscountValue {
    -moz-appearance: textfield;
    appearance: textfield;
}

.qe-items-table th,
.qe-items-table td {
    vertical-align: middle;
}

.qe-items-table .qe-qty {
    max-width: 90px;
}

.qe-empty {
    text-align: center;
    padding: 1.75rem 1rem;
    color: var(--text-secondary, #64748b);
}

.qe-empty__title {
    font-weight: 600;
    color: var(--text-primary, #0f172a);
    margin-bottom: 0.35rem;
}

.qe-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
}

.qe-status-badge--draft { background: #F1F5F9; color: #475569; }
.qe-status-badge--sent { background: var(--info-light, #DBEAFE); color: var(--info, #2563EB); }
.qe-status-badge--accepted { background: var(--success-light, #D1FAE5); color: #059669; }
.qe-status-badge--rejected,
.qe-status-badge--cancelled { background: var(--danger-light, #FEE2E2); color: var(--danger, #DC2626); }
.qe-status-badge--expired { background: var(--warning-light, #FEF3C7); color: #B45309; }
.qe-status-badge--used { background: #E2E8F0; color: #334155; }

.qd-grid {
    display: grid;
    gap: 1rem;
}

@media (min-width: 992px) {
    .qd-layout {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 320px;
        gap: 1rem;
        align-items: start;
    }

    .qe-summary--sticky {
        position: sticky;
        top: 1rem;
    }
}

[dir="rtl"] .qe-summary__input {
    text-align: start;
}

[dir="rtl"] .qe-page-actions {
    flex-direction: row-reverse;
}

button.is-loading,
a.is-loading {
    pointer-events: none;
    opacity: 0.85;
}
