/* Customer-facing Delhivery UI. Every selector is deliberately module scoped. */
.delhivery-customer {
    --dlv-ink: #242a43;
    --dlv-muted: #707070;
    --dlv-line: #eadedb;
    --dlv-soft: #faf7f6;
    --dlv-accent: #c98778;
    --dlv-radius: 8px;
    max-width: 940px;
    margin: 10px auto 48px;
    color: inherit;
}
.delhivery-customer *, .delhivery-customer *:before, .delhivery-customer *:after { box-sizing: border-box; }
.delhivery-customer__heading { margin: 0 0 8px; color: var(--dlv-ink); font-size: 26px; line-height: 1.25; }
.delhivery-customer__intro { margin: 0 0 24px; color: var(--dlv-muted); }
.delhivery-customer__panel, .delhivery-customer .block-content, .delhivery-customer__card { margin: 0 0 20px; padding: 24px; background: #fff; border: 1px solid var(--dlv-line); border-radius: var(--dlv-radius); box-shadow: 0 5px 16px rgba(31,36,55,.05); }
.delhivery-customer__section-title { margin: 0 0 16px; color: var(--dlv-ink); font-size: 19px; line-height: 1.3; }
.delhivery-customer__meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0 0 20px; padding: 16px; background: var(--dlv-soft); border-radius: 6px; }
.delhivery-customer__meta div, .delhivery-customer__definition div { min-width: 0; }
.delhivery-customer__meta span, .delhivery-customer__definition dt { display: block; color: var(--dlv-muted); font-size: 12px; }
.delhivery-customer__meta strong { display: block; margin-top: 4px; overflow-wrap: anywhere; }
.delhivery-customer__definition { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 24px; margin: 0; }
.delhivery-customer__definition dd { margin: 4px 0 0; overflow-wrap: anywhere; font-weight: 600; }
.delhivery-customer__note { margin: 16px 0; padding: 12px 14px; color: #654b45; background: #fff8e9; border-left: 3px solid #d7a34a; border-radius: 3px; }
.delhivery-customer__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.delhivery-customer .action.primary, .delhivery-customer button.action.primary { min-height: 42px; padding: 7px 18px; }
.delhivery-customer__cancel { color: #8c3d38 !important; border-color: #c98b86 !important; background: #fff !important; }
.delhivery-customer__cancel:hover, .delhivery-customer__cancel:focus { color: #fff !important; background: #a84b45 !important; border-color: #a84b45 !important; }
.delhivery-status { display: inline-flex; align-items: center; max-width: 100%; min-height: 26px; padding: 4px 9px; overflow-wrap: anywhere; color: #355d73; font-size: 12px; font-weight: 700; line-height: 1.25; background: #edf6fa; border-radius: 999px; }
.delhivery-status--delivered, .delhivery-status--completed, .delhivery-status--replacement-created, .delhivery-status--returned-to-warehouse { color: #376247; background: #edf7ef; }
.delhivery-status--cancelled, .delhivery-status--rejected, .delhivery-status--carrier-rejected { color: #8b3936; background: #fceeed; }
.delhivery-status--pending-approval, .delhivery-status--pending-confirmation, .delhivery-status--rto-initiated, .delhivery-status--rto-in-transit { color: #775d20; background: #fff7df; }
.delhivery-status--in-transit, .delhivery-status--manifested, .delhivery-status--dispatched, .delhivery-status--out-for-delivery, .delhivery-status--approved { color: #355d73; background: #edf6fa; }
.delhivery-customer .field { margin: 0 0 16px; }
.delhivery-customer .field label, .delhivery-customer .field > span { display: block; margin-bottom: 7px; color: var(--dlv-ink); font-weight: 600; }
.delhivery-customer .field.required label:after { margin-left: 3px; color: #a84b45; content: '*'; }
.delhivery-customer input[type='text'], .delhivery-customer input[type='number'], .delhivery-customer select, .delhivery-customer textarea { width: 100%; min-height: 42px; padding: 9px 11px; border: 1px solid #d5d1d0; border-radius: 4px; background: #fff; }
.delhivery-customer textarea { min-height: 100px; resize: vertical; }
.delhivery-customer input:focus, .delhivery-customer select:focus, .delhivery-customer textarea:focus { outline: 0; border-color: var(--dlv-accent); box-shadow: 0 0 0 3px rgba(201,135,120,.16); }
.delhivery-customer__form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.delhivery-customer__form-grid .field--wide { grid-column: 1 / -1; }
.delhivery-customer__items { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.delhivery-customer__item { display: grid; grid-template-columns: minmax(0, 1fr) 116px; gap: 14px; align-items: end; padding: 16px; background: var(--dlv-soft); border: 1px solid var(--dlv-line); border-radius: 6px; }
.delhivery-customer__item-name { display: block; overflow-wrap: anywhere; color: var(--dlv-ink); font-weight: 700; }
.delhivery-customer__item-sku, .delhivery-customer__item-stats { display: block; margin-top: 4px; color: var(--dlv-muted); font-size: 13px; }
.delhivery-customer__item-qty label { display: block; margin-bottom: 6px; color: var(--dlv-ink); font-size: 13px; font-weight: 600; }
.delhivery-customer__item-qty input { max-width: 116px; }
.delhivery-customer__request-list { display: grid; gap: 12px; }
.delhivery-customer__request { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 16px; border: 1px solid var(--dlv-line); border-radius: 6px; }
.delhivery-customer__request a { overflow-wrap: anywhere; font-weight: 700; }
.delhivery-customer__request p { margin: 5px 0 0; color: var(--dlv-muted); font-size: 13px; overflow-wrap: anywhere; }
.delhivery-customer__list-empty { margin: 0; color: var(--dlv-muted); }
.delhivery-customer__item-list { margin: 0; padding-left: 20px; }
.delhivery-customer__item-list li { margin: 6px 0; overflow-wrap: anywhere; }
.delhivery-customer__back { margin-top: 20px; }

/* Order-view panels retain Magento's block placement but gain card structure. */
.block-delhivery-shipment-status, .delhivery-replacement-shipments {
    clear: both;
    display: block;
    width: 100%;
    max-width: none;
    margin: 24px 0;
    padding: 22px;
    border: 1px solid var(--dlv-line, #eadedb);
    border-radius: 8px;
    background: #fff;
}
.block-delhivery-shipment-status .block-title, .delhivery-replacement-shipments > h2 { margin: 0 0 14px; color: #242a43; font-size: 19px; }
.delhivery-replacement-shipments .box { margin: 14px 0 0; padding: 18px; border: 1px solid #eadedb; border-radius: 6px; }
.delhivery-replacement-shipments .box-content p { margin: 8px 0; overflow-wrap: anywhere; }
.delhivery-replacement-shipments .box-actions { margin-top: 16px; }
.delhivery-order-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.delhivery-order-actions .action { margin: 0 !important; }

@media (max-width: 767px) {
    .delhivery-customer { margin: 0 auto 32px; }
    .delhivery-customer__heading { font-size: 23px; }
    .delhivery-customer__panel, .delhivery-customer .block-content, .delhivery-customer__card { padding: 18px; }
    .delhivery-customer__meta, .delhivery-customer__definition, .delhivery-customer__form-grid { grid-template-columns: 1fr; }
    .delhivery-customer__item { grid-template-columns: 1fr; }
    .delhivery-customer__item-qty input { max-width: none; }
    .delhivery-customer__request { grid-template-columns: 1fr; }
    .delhivery-customer__actions .action, .delhivery-customer__actions button { width: 100%; }
    .delhivery-order-actions .action { width: 100%; text-align: center; }
    .block-delhivery-shipment-status, .delhivery-replacement-shipments { padding: 18px; }
}
