/* retomas.autocavado.pt — portal de parceiros (licitações de retomas) */
:root {
    --bg: #0b1220;
    --surface: #ffffff;
    --surface-alt: #f4f6fb;
    --text: #101828;
    --muted: #667085;
    --border: #e4e7ec;
    --primary: #1570ef;
    --primary-d: #1257c4;
    --green: #16a34a;
    --red: #dc2626;
    --amber: #b45309;
    --radius: 14px;
    --shadow: 0 8px 30px rgba(16, 24, 40, .10);
    /* Scrollbar personalizado — nunca o nativo do SO */
    --scrollbar-track-bg: transparent;
    --scrollbar-thumb: rgba(16, 24, 40, 0.22);
    --scrollbar-thumb-hover: rgba(16, 24, 40, 0.42);
}

/* Scrollbar global (ver pilot/base.css): webkit p/ Chrome/Safari; Firefox via
   @supports; rede de segurança que força auto no Chrome (nunca o nativo do SO). */
::-webkit-scrollbar             { width: 8px; height: 8px; }
::-webkit-scrollbar-button      { display: none; height: 0; width: 0; }
::-webkit-scrollbar-track       { background: var(--scrollbar-track-bg, transparent); }
::-webkit-scrollbar-thumb       { background: var(--scrollbar-thumb, rgba(16, 24, 40, 0.22)); border-radius: 0; }
::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-thumb-hover, rgba(16, 24, 40, 0.42)); }
@supports not selector(::-webkit-scrollbar) {
  * { scrollbar-width: thin; scrollbar-color: var(--scrollbar-thumb, rgba(16, 24, 40, 0.22)) transparent; }
}
@supports selector(::-webkit-scrollbar) {
  * { scrollbar-width: auto !important; scrollbar-color: auto !important; }
}
* { box-sizing: border-box; }
body.rt-portal {
    margin: 0;
    font-family: 'Inter', system-ui, sans-serif;
    background: linear-gradient(180deg, #0b1220 0%, #0b1220 200px, #eef1f7 200px, #eef1f7 100%);
    color: var(--text);
    min-height: 100vh;
}

/* Header */
/* Barra da sessão, ABAIXO do cabeçalho do site: a marca vive lá, ao centro, e
   aqui fica só o que é deste portal. O padding-top desconta a altura do
   cabeçalho, que é fixo. */
.rt-session-bar { display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding: calc(var(--main-header-height, 70px) + 16px) 24px 12px; color: #fff; max-width: 1100px; margin: 0 auto; flex-wrap: wrap; min-height: var(--main-header-height, 70px); }
.rt-header-right { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rt-partner-name { font-size: .82rem; opacity: .85; margin-right: 4px; }

.rt-main { max-width: 1100px; margin: 0 auto; padding: 0 24px 64px; }

/* Cards / botões */
.rt-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; margin-bottom: 16px; }
.rt-card h1 { font-size: 1.3rem; margin: 0 0 8px; }
.rt-card h2 { font-size: 1.02rem; margin: 0 0 10px; }
.rt-card h3 { font-size: .88rem; margin: 14px 0 8px; }
.rt-card p { color: var(--muted); line-height: 1.5; margin: 6px 0; }
.rt-muted { color: var(--muted); font-size: .82rem; }
.rt-btn { border: none; border-radius: 10px; padding: 11px 20px; font: inherit; font-weight: 600; cursor: pointer; transition: background .15s, opacity .15s; }
.rt-btn-primary { background: var(--primary); color: #fff; }
.rt-btn-primary:hover { background: var(--primary-d); }
.rt-btn-primary:disabled { opacity: .55; cursor: default; }
.rt-btn-ghost { background: rgba(255,255,255,.08); color: #fff; border: 1px solid rgba(255,255,255,.18); }
.rt-main .rt-btn-ghost { background: var(--surface-alt); color: var(--text); border: 1px solid var(--border); }
.rt-error { color: var(--red); font-size: .85rem; }
.rt-error-inline { color: var(--red); }
.rt-ok { color: var(--green); font-weight: 700; font-size: .9rem; }

/* Login */
.rt-login { max-width: 440px; margin: 18px auto; }
.rt-login form { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.rt-login label { display: flex; flex-direction: column; gap: 4px; font-size: .8rem; color: var(--muted); font-weight: 600; }
.rt-login input { padding: 11px 12px; border: 1px solid var(--border); border-radius: 10px; font: inherit; }
.rt-login input:focus { outline: none; border-color: var(--primary); }
.rt-pin-input { letter-spacing: 8px; font-weight: 700; font-size: 1.2rem; text-align: center; }

/* Lista */
.rt-list-head h1 { color: #fff; margin: 6px 0 2px; font-size: 1.35rem; }
.rt-list-head .rt-muted { color: rgba(255,255,255,.65); margin-bottom: 14px; display: block; }
.rt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.rt-item { display: flex; flex-direction: column; gap: 6px; margin-bottom: 0; }
.rt-item-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rt-plate { font-family: ui-monospace, monospace; font-weight: 700; color: var(--primary); background: rgba(21,112,239,.08); border: 1px solid rgba(21,112,239,.25); padding: 3px 10px; border-radius: 6px; font-size: .85rem; }
.rt-photos { font-size: .76rem; color: var(--muted); }
.rt-item-title { font-size: 1.02rem; font-weight: 700; }
.rt-item-sub { font-size: .8rem; color: var(--muted); }
.rt-item-bids { display: flex; flex-direction: column; gap: 2px; font-size: .8rem; color: var(--muted); margin: 8px 0 10px; }
.rt-mybid { color: var(--primary); }
.rt-item-open { margin-top: auto; }

/* Detalhe */
.rt-back { margin: 6px 0 12px; }
.rt-detail-grid { display: grid; grid-template-columns: 1fr 320px; gap: 16px; align-items: start; }
@media (max-width: 880px) { .rt-detail-grid { grid-template-columns: 1fr; } }
.rt-detail-title { font-size: 1.3rem; margin: 6px 0; }
.rt-specs { display: flex; flex-wrap: wrap; gap: 10px; font-size: .84rem; color: var(--muted); margin: 8px 0; }
.rt-notes { background: var(--surface-alt); border-radius: 8px; padding: 10px 12px; font-size: .85rem; }
.rt-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.rt-gallery img { width: 100%; height: 100px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.rt-perit-summary { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.rt-pill { font-size: .74rem; padding: 4px 10px; border-radius: 999px; background: var(--surface-alt); color: var(--muted); font-weight: 600; }
.rt-pill-bad { background: rgba(220,38,38,.1); color: var(--red); }
.rt-pill-warn { background: rgba(245,158,11,.12); color: var(--amber); }
.rt-pill-score { background: rgba(21,112,239,.1); color: var(--primary); }
.rt-checks { display: flex; flex-direction: column; gap: 6px; }
.rt-check { font-size: .82rem; padding: 7px 10px; border-radius: 7px; border: 1px solid var(--border); }
.rt-check span { font-family: ui-monospace, monospace; font-size: .72rem; color: var(--muted); margin-right: 8px; }
.rt-check-bad { border-color: rgba(220,38,38,.3); background: rgba(220,38,38,.04); }
.rt-check-warn { border-color: rgba(245,158,11,.3); background: rgba(245,158,11,.05); }
.rt-damages { margin: 6px 0 0; padding-left: 18px; font-size: .82rem; color: var(--muted); }
.rt-asis { color: var(--amber); font-weight: 700; }
.rt-video { color: var(--primary); font-weight: 600; text-decoration: none; }

/* Licitação */
.rt-detail-side { position: sticky; top: 16px; }
.rt-bid-card label { display: flex; flex-direction: column; gap: 4px; font-size: .8rem; color: var(--muted); font-weight: 600; margin-bottom: 10px; }
.rt-bid-card input, .rt-bid-card textarea { padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; font: inherit; }
.rt-bid-card input:focus, .rt-bid-card textarea:focus { outline: none; border-color: var(--primary); }
.rt-bid-highest { font-size: .9rem; margin-bottom: 12px; }
.rt-bid-card .rt-btn { width: 100%; }
.rt-mybids { list-style: none; margin: 6px 0 0; padding: 0; font-size: .84rem; display: flex; flex-direction: column; gap: 4px; }

/* Histórico */
.rt-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.rt-table th, .rt-table td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); }
.rt-table th { font-size: .72rem; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); }

@media (max-width: 560px) { .rt-main { padding: 0 14px 48px; } .rt-card { padding: 18px 16px; } }
