.ref-page{padding:clamp(12px,3vw,28px)}
.ref-page h2{font-size:1.5rem;font-weight:800;margin-bottom:12px}
.ref-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.ref-list{display:grid;gap:10px;margin-top:10px}
.ref-card{padding:12px;border:1px solid #8791a24d;border-radius:10px;overflow-wrap:anywhere}
.ref-card .ref-actions{margin-top:8px}
.ref-actions input,.ref-actions select,.ref-control{min-height:40px;border:1px solid #8791a280;border-radius:8px;padding:6px 10px;color:inherit;max-width:100%}
.ref-actions input{width:min(100%,21rem)}
.ref-control:hover,.ref-control:focus-visible{outline:2px solid #dc2626;outline-offset:1px}

.ref-page {
    --ref-text:#172033; --ref-muted:#52627a; --ref-line:#dce4ef;
    --ref-paper:#fff; --ref-tint:#f5f7fb; --ref-accent:#ac1828;
    --ref-red-bg:#fff0f1; --ref-green:#126244; --ref-green-bg:#e7f7ee;
    --ref-blue:#234e9b; --ref-blue-bg:#eaf1ff; --ref-amber:#81510c; --ref-amber-bg:#fff4dc;
    max-width:1280px; margin-inline:auto; color:var(--ref-text);
}
html.dark .ref-page {
    --ref-text:#edf2fa; --ref-muted:#a8b4c8; --ref-line:#334158;
    --ref-paper:#151e30; --ref-tint:#1d2940; --ref-accent:#ff9ea8;
    --ref-red-bg:#40242d; --ref-green:#9be4bf; --ref-green-bg:#19392e;
    --ref-blue:#abc7ff; --ref-blue-bg:#233755; --ref-amber:#ffd489; --ref-amber-bg:#42331e;
}
.ref-page .ref-hero {
    background:linear-gradient(125deg,var(--ref-paper) 48%,var(--ref-red-bg));
    border:1px solid var(--ref-line); border-radius:18px; padding:clamp(16px,3vw,30px);
}
.ref-hero .ref-eyebrow {color:var(--ref-accent); font-size:.72rem; font-weight:800; letter-spacing:.12em}
.ref-page .ref-hero h2 {font-size:clamp(1.65rem,3vw,2.25rem); margin:4px 0}
.ref-hero > p:last-child {color:var(--ref-muted); max-width:58ch}
.ref-metrics {display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; margin-block:14px}
.ref-metric {display:grid; gap:4px; padding:12px 14px; border:1px solid var(--ref-line); background:var(--ref-paper); border-radius:12px}
.ref-metric span {font-size:.8rem; color:var(--ref-muted); font-weight:650}
.ref-metric strong {font-size:clamp(1.35rem,3vw,1.85rem); font-variant-numeric:tabular-nums}
.ref-page > form {padding:12px; background:var(--ref-paper); border:1px solid var(--ref-line); border-radius:12px}
.ref-page > form input {flex:1 1 13rem; width:auto; min-width:0}
.ref-page .ref-notice {margin-top:14px; color:var(--ref-muted); font-size:.85rem; font-weight:650; overflow-wrap:anywhere}
.ref-page .ref-card {padding:clamp(12px,2vw,18px); border-color:var(--ref-line); background:var(--ref-paper); border-radius:14px}
.ref-identity {display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:10px}
.ref-identity h3 {font-weight:800; line-height:1.25}
.ref-identity p {color:var(--ref-muted); font-size:.83rem; margin-top:3px}
.ref-avatar {display:grid; place-items:center; width:40px; height:40px; border-radius:12px; background:var(--ref-red-bg); color:var(--ref-accent); font-weight:800}
.ref-status {display:inline-block; justify-self:start; border-radius:999px; padding:4px 9px; font-size:.76rem; font-weight:750; color:var(--ref-muted); background:var(--ref-tint)}
.ref-status[data-status=nova] {color:var(--ref-blue); background:var(--ref-blue-bg)}
.ref-status[data-status=atendimento] {color:var(--ref-amber); background:var(--ref-amber-bg)}
.ref-status[data-status=convertida], .ref-page .ref-chat {color:var(--ref-green); background:var(--ref-green-bg)}
.ref-details {display:flex; flex-wrap:wrap; gap:8px 24px; margin:12px 0 0; padding:9px 12px; background:var(--ref-tint); border-radius:9px}
.ref-details dt {color:var(--ref-muted); font-size:.74rem}
.ref-details dd {font-size:.86rem; font-weight:700}
.ref-page .ref-actions input,.ref-page .ref-actions select,.ref-page .ref-control {border-color:var(--ref-line); background-color:var(--ref-paper); font-size:.85rem}
.ref-page .ref-control {display:inline-flex; align-items:center; justify-content:center; font-weight:700}
.ref-page .ref-control[hidden] {display:none}
.ref-page .ref-control:disabled {opacity:.55; cursor:wait}
.ref-page .ref-chat {background:var(--ref-green-bg)}
.ref-page .ref-control[type=submit], .ref-page .ref-control.ref-primary {background:#b91c2c; border-color:#b91c2c; color:#fff}
.ref-page .ref-card .ref-actions {margin-top:12px}
.ref-action-group {display:flex; gap:6px; flex-wrap:wrap; align-items:center; min-width:0}
.ref-page .ref-action-group input {width:10rem}
.ref-warning {color:var(--ref-accent); font-size:.83rem; margin-top:6px; flex-basis:100%}
.ref-warning:empty {display:none}
.ref-empty {padding:24px 14px; text-align:center; border:1px dashed var(--ref-line); background:var(--ref-paper); border-radius:12px}
.ref-empty p {color:var(--ref-muted); font-size:.88rem; margin-top:4px}
.ref-pagination {display:flex; flex-wrap:wrap; gap:8px; justify-content:flex-end}
@media (max-width:480px) {
    .ref-metrics {gap:6px}
    .ref-metric {padding:8px}
    .ref-metric span {font-size:.72rem}
    .ref-identity {grid-template-columns:auto minmax(0,1fr)}
    .ref-status {grid-column:2}
    .ref-action-group {flex-basis:100%}
}
