/* Reembolso: caixa na compra do cliente, aviso urgente do vendedor, popup de resumo e tela do admin. */
.refund-box { display: grid; gap: 10px; }
.refund-box p { margin: 0; color: var(--ink-soft, #5f6671); font-size: .92rem; line-height: 1.5; }
.refund-box p strong { color: var(--ink, #30343b); }
.refund-box .refund-box__muted { color: var(--muted, #8b939f); }
.refund-box__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.refund-box__head .pd2-title { margin: 0; }
.refund-box__ask { justify-self: start; }

.refund-pill { display: inline-flex; align-items: center; padding: 4px 11px; border-radius: 999px; font-style: normal; font-size: .72rem; font-weight: 700; letter-spacing: .02em; background: #fff4e0; color: #a35f00; }
.refund-pill.is-refunded { background: #e6f6ef; color: #0e7a55; }
.refund-pill.is-rejected { background: #fdecec; color: #b42323; }

/* aviso urgente no topo da área de vendas */
.refund-alerts { display: grid; gap: 10px; margin: 0 0 16px; }
.refund-alert { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 16px; border: 1px solid #f3b4b4; border-radius: 12px; background: #fff1f1; color: #7d1d1d; text-align: left; cursor: pointer; font: inherit; transition: background .15s, border-color .15s, transform .15s; animation: refund-pulse 2.4s ease-in-out infinite; }
.refund-alert:hover { background: #ffe7e7; border-color: #ea9090; }
.refund-alert:active { transform: scale(.995); }
.refund-alert__icon { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: #e5484d; color: #fff; }
.refund-alert__icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.refund-alert__txt { display: grid; gap: 2px; min-width: 0; flex: 1; }
.refund-alert__txt b { font-size: .95rem; }
.refund-alert__txt small { color: #a13a3a; font-size: .82rem; overflow-wrap: anywhere; }
.refund-alert em { flex: none; font-style: normal; font-size: .74rem; font-weight: 700; letter-spacing: .04em; color: #c2262b; }
@keyframes refund-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(229, 72, 77, .0); } 50% { box-shadow: 0 0 0 5px rgba(229, 72, 77, .14); } }
@media (prefers-reduced-motion: reduce) { .refund-alert { animation: none; } }

/* popup */
.refund-modal { position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; padding: 16px; opacity: 0; transition: opacity .16s; }
.refund-modal.is-open { opacity: 1; }
.refund-modal__backdrop { position: absolute; inset: 0; background: rgba(15, 20, 28, .55); }
.refund-modal__panel { position: relative; width: min(480px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 24px 22px 20px; border-radius: 16px; background: var(--paper, #fff); color: var(--ink, #30343b); box-shadow: 0 24px 60px rgba(0, 0, 0, .28); transform: translateY(8px); transition: transform .16s; }
.refund-modal.is-open .refund-modal__panel { transform: none; }
.refund-modal__panel h2 { margin: 2px 0 6px; font-size: 1.25rem; }
.refund-modal__x { position: absolute; top: 10px; right: 12px; width: 32px; height: 32px; border: 0; border-radius: 50%; background: transparent; color: var(--muted, #8b939f); font-size: 1.5rem; line-height: 1; cursor: pointer; }
.refund-modal__x:hover { background: var(--mist, #f6f8fb); }
.refund-modal__title { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.refund-modal__lead { margin: 0 0 14px; color: var(--ink-soft, #5f6671); font-size: .9rem; line-height: 1.5; }
.refund-modal__note { margin: 14px 0 0; padding: 12px 14px; border-radius: 10px; background: var(--mist, #f6f8fb); color: var(--ink-soft, #5f6671); font-size: .86rem; line-height: 1.5; }
.refund-modal__error { margin: 8px 0 0; color: #c2262b; font-size: .86rem; }
.refund-modal__actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.refund-modal__actions .button { border-radius: 10px; min-height: 44px; }
.refund-field { display: grid; gap: 6px; font-size: .85rem; font-weight: 600; }
.refund-field input { width: 100%; box-sizing: border-box; padding: 11px 12px; border: 1px solid var(--line-strong, #dce2ea); border-radius: 10px; background: var(--paper, #fff); color: var(--ink, #30343b); font: inherit; font-weight: 400; min-height: 44px; }
.refund-field input:focus { outline: 2px solid var(--brand, #1677f4); outline-offset: 1px; }
html[data-theme="dark"] .refund-field input { background: #10161c; border-color: #2a3541; color: #e8ecf1; }
.refund-field textarea { width: 100%; box-sizing: border-box; padding: 11px 12px; border: 1px solid var(--line-strong, #dce2ea); border-radius: 10px; background: var(--paper, #fff); color: var(--ink, #30343b); font: inherit; font-weight: 400; resize: vertical; min-height: 96px; }
.refund-field textarea:focus { outline: 2px solid var(--brand, #1677f4); outline-offset: 1px; }
.refund-summary { display: grid; margin: 12px 0 0; border: 1px solid var(--line, #e6eaf0); border-radius: 12px; overflow: hidden; }
.refund-summary > div { display: grid; grid-template-columns: 138px 1fr; gap: 10px; padding: 11px 14px; border-top: 1px solid var(--line, #e6eaf0); }
.refund-summary > div:first-child { border-top: 0; }
.refund-summary dt { color: var(--muted, #8b939f); font-size: .82rem; }
.refund-summary dd { margin: 0; font-size: .9rem; font-weight: 600; overflow-wrap: anywhere; }
html.refund-modal-open { overflow: hidden; }
@media (max-width: 520px) { .refund-summary > div { grid-template-columns: 1fr; gap: 2px; } .refund-alert em { display: none; } }

/* admin */
.refund-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.refund-tabs button { padding: 7px 14px; border: 1px solid var(--line-strong, #dce2ea); border-radius: 999px; background: var(--paper, #fff); color: var(--ink-soft, #5f6671); font: inherit; font-size: .84rem; font-weight: 600; cursor: pointer; }
.refund-tabs button.is-active { background: var(--brand, #1677f4); border-color: var(--brand, #1677f4); color: #fff; }
.refund-list { display: grid; gap: 12px; }
.refund-card { display: grid; gap: 10px; padding: 16px; border: 1px solid var(--line, #e6eaf0); border-radius: 12px; background: var(--paper, #fff); }
.refund-card__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.refund-card__head b { font-size: 1rem; }
.refund-card__meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px 18px; margin: 0; }
.refund-card__meta div { display: grid; gap: 1px; }
.refund-card__meta dt { color: var(--muted, #8b939f); font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; }
.refund-card__meta dd { margin: 0; font-size: .88rem; font-weight: 600; overflow-wrap: anywhere; }
.refund-card__reason { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--mist, #f6f8fb); color: var(--ink-soft, #5f6671); font-size: .88rem; line-height: 1.5; }
.refund-card__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.refund-empty { padding: 28px 16px; text-align: center; color: var(--muted, #8b939f); border: 1px dashed var(--line-strong, #dce2ea); border-radius: 12px; }

/* tema escuro */
html[data-theme="dark"] .refund-pill { background: #3a2b0e; color: #ffc766; }
html[data-theme="dark"] .refund-pill.is-refunded { background: #0f2f24; color: #5fd3a3; }
html[data-theme="dark"] .refund-pill.is-rejected { background: #3a1517; color: #ff8d90; }
html[data-theme="dark"] .refund-alert { background: #2a1517; border-color: #6b2a2d; color: #ffd6d7; }
html[data-theme="dark"] .refund-alert:hover { background: #331a1d; border-color: #8a3a3e; }
html[data-theme="dark"] .refund-alert__txt small { color: #f0a4a6; }
html[data-theme="dark"] .refund-alert em { color: #ff8d90; }
html[data-theme="dark"] .refund-modal__panel, html[data-theme="dark"] .refund-card, html[data-theme="dark"] .refund-tabs button { background: #141a21; border-color: #222c36; color: #e8ecf1; }
html[data-theme="dark"] .refund-tabs button.is-active { background: var(--brand, #1677f4); border-color: var(--brand, #1677f4); color: #fff; }
html[data-theme="dark"] .refund-modal__note, html[data-theme="dark"] .refund-card__reason { background: #1b232c; color: #b9c2cc; }
html[data-theme="dark"] .refund-summary, html[data-theme="dark"] .refund-summary > div { border-color: #222c36; }
html[data-theme="dark"] .refund-field textarea { background: #10161c; border-color: #2a3541; color: #e8ecf1; }
html[data-theme="dark"] .refund-box p, html[data-theme="dark"] .refund-modal__lead { color: #b9c2cc; }
html[data-theme="dark"] .refund-box p strong { color: #e8ecf1; }
html[data-theme="dark"] .refund-modal__x:hover { background: #1b232c; }

/* tickets de suporte e política */
.refund-pill.is-open { background: #fff4e0; color: #a35f00; }
.refund-pill.is-answered { background: #e6f1ff; color: #1457b8; }
.refund-pill.is-closed { background: #eceff3; color: #5f6671; }
.refund-pill.is-refund { background: #f1e9ff; color: #6a35c9; }
.refund-modal--wide .refund-modal__panel { width: min(600px, 100%); }
.refund-policy { margin: 4px 0 0; padding-left: 20px; display: grid; gap: 10px; font-size: .9rem; line-height: 1.55; color: var(--ink-soft, #5f6671); }
.refund-policy b { color: var(--ink, #30343b); }
.ticket-counter { margin: 6px 0 0; font-size: .8rem; color: var(--muted, #8b939f); }
.ticket-counter.is-ok { color: #0e7a55; }
.ticket-rows { display: grid; gap: 8px; }
.ticket-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 11px 13px; border: 1px solid var(--line, #e6eaf0); border-radius: 10px; background: var(--paper, #fff); color: inherit; font: inherit; text-align: left; cursor: pointer; }
.ticket-row:hover { border-color: var(--line-strong, #dce2ea); background: var(--mist, #f6f8fb); }
.ticket-row__txt { display: grid; gap: 2px; min-width: 0; }
.ticket-row__txt b { font-size: .92rem; }
.ticket-row__txt small { color: var(--muted, #8b939f); font-size: .78rem; overflow-wrap: anywhere; }
.ticket-thread { display: grid; gap: 10px; max-height: min(46vh, 380px); overflow: auto; margin: 12px 0; padding: 2px; }
.ticket-msg { display: grid; gap: 4px; max-width: 88%; padding: 10px 13px; border-radius: 12px; background: var(--mist, #f6f8fb); }
.ticket-msg.is-staff { justify-self: end; background: #e6f1ff; }
.ticket-msg__meta { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: .78rem; }
.ticket-msg__meta small { color: var(--muted, #8b939f); }
.ticket-msg p { margin: 0; font-size: .9rem; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink, #30343b); }
.ticket-card { display: grid; gap: 6px; width: 100%; padding: 14px 16px; border: 1px solid var(--line, #e6eaf0); border-radius: 12px; background: var(--paper, #fff); color: inherit; font: inherit; text-align: left; cursor: pointer; }
.ticket-card:hover { border-color: var(--brand, #1677f4); }
.ticket-card__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.ticket-card__head > span { display: inline-flex; gap: 6px; }
.ticket-card__meta { color: var(--muted, #8b939f); font-size: .8rem; overflow-wrap: anywhere; }
.ticket-card__preview { color: var(--ink-soft, #5f6671); font-size: .88rem; line-height: 1.45; overflow-wrap: anywhere; }
html[data-theme="dark"] .refund-pill.is-open { background: #3a2b0e; color: #ffc766; }
html[data-theme="dark"] .refund-pill.is-answered { background: #11263f; color: #8ec0ff; }
html[data-theme="dark"] .refund-pill.is-closed { background: #222c36; color: #b9c2cc; }
html[data-theme="dark"] .refund-pill.is-refund { background: #2a1c47; color: #c9a8ff; }
html[data-theme="dark"] .refund-policy { color: #b9c2cc; }
html[data-theme="dark"] .refund-policy b { color: #e8ecf1; }
html[data-theme="dark"] .ticket-row, html[data-theme="dark"] .ticket-card { background: #141a21; border-color: #222c36; color: #e8ecf1; }
html[data-theme="dark"] .ticket-row:hover { background: #1b232c; }
html[data-theme="dark"] .ticket-msg { background: #1b232c; }
html[data-theme="dark"] .ticket-msg.is-staff { background: #11263f; }
html[data-theme="dark"] .ticket-msg p { color: #e8ecf1; }
html[data-theme="dark"] .ticket-card__preview { color: #b9c2cc; }
html[data-theme="dark"] .ticket-counter.is-ok { color: #5fd3a3; }
@media (max-width: 520px) { .ticket-msg { max-width: 96%; } }
/* lista Compras: Chat vira "Ticket em aberto" */
.ocard__btn--ticket { font: inherit; font-weight: 700; cursor: pointer; }
.ocard__btn--ticket.is-answered { background: #0e7a55; border-color: #0e7a55; color: #fff; }
html[data-theme="dark"] .ocard__btn--ticket.is-answered { background: #0e7a55; border-color: #0e7a55; color: #fff; }
