/* ============================================================
   Site público (abrir / acompanhar / detalhe / erro)
   Mesmo tema "tech" do painel admin, escopado a .site-body.
   ============================================================ */
:root {
    --st-bg: #0b1020;
    --st-bg-soft: #0f1730;
    --st-surface: #ffffff;
    --st-text: #1b2440;
    --st-muted: #5b6680;
    --st-line: #e3e8f3;
    --st-brand: #4f7cff;
    --st-brand-2: #22d3ee;
    --st-shadow: 0 18px 48px rgba(11, 16, 32, 0.12);

    --c-open: #2563eb;
    --c-in_progress: #0ea5a3;
    --c-waiting_customer: #d97706;
    --c-resolved: #16a34a;
    --c-closed: #64748b;

    --p-low: #64748b;
    --p-normal: #2563eb;
    --p-high: #d97706;
    --p-urgent: #e11d48;
}

.site-body {
    background:
        radial-gradient(1200px 600px at 100% -10%, rgba(34, 211, 238, 0.10), transparent 60%),
        radial-gradient(900px 500px at -10% 0%, rgba(79, 124, 255, 0.12), transparent 55%),
        #eef2fb;
    color: var(--st-text);
    min-height: 100vh;
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}

/* ---------- Navbar ---------- */
.site-topbar {
    background: linear-gradient(100deg, var(--st-bg) 0%, var(--st-bg-soft) 55%, #15224a 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 6px 24px rgba(11, 16, 32, 0.28);
}

.site-topbar .navbar-brand,
.site-topbar .nav-link {
    color: #e7ecff;
}

.site-topbar .nav-link:hover,
.site-topbar .nav-link.active {
    color: #fff;
}

.brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, var(--st-brand), var(--st-brand-2));
    box-shadow: 0 6px 18px rgba(79, 124, 255, 0.45);
}

/* ---------- Cabeçalho de página / hero ---------- */
.page-head {
    margin-bottom: 22px;
}

.page-head .eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 12px;
    font-weight: 700;
    color: var(--st-brand);
    margin: 0 0 6px;
}

.page-head h1 {
    margin: 0;
    font-weight: 800;
    font-size: clamp(26px, 4vw, 40px);
    line-height: 1.1;
}

.page-head .sub {
    color: var(--st-muted);
    margin: 10px 0 0;
    max-width: 720px;
}

/* ---------- Superfícies ---------- */
.surface {
    background: var(--st-surface);
    border: 1px solid var(--st-line);
    border-radius: 16px;
    box-shadow: var(--st-shadow);
}

.surface h2 {
    font-size: 1.15rem;
    font-weight: 700;
}

/* ---------- Badges ---------- */
.badge-status,
.badge-priority {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
    white-space: nowrap;
}

.badge-status::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.st-open            { color: var(--c-open);            background: rgba(37, 99, 235, 0.12); }
.st-in_progress     { color: var(--c-in_progress);     background: rgba(14, 165, 163, 0.14); }
.st-waiting_customer{ color: var(--c-waiting_customer);background: rgba(217, 119, 6, 0.14); }
.st-resolved        { color: var(--c-resolved);        background: rgba(22, 163, 74, 0.14); }
.st-closed          { color: var(--c-closed);          background: rgba(100, 116, 139, 0.16); }

.pr-low     { color: var(--p-low);     background: rgba(100, 116, 139, 0.14); }
.pr-normal  { color: var(--p-normal);  background: rgba(37, 99, 235, 0.12); }
.pr-high    { color: var(--p-high);    background: rgba(217, 119, 6, 0.14); }
.pr-urgent  { color: var(--p-urgent);  background: rgba(225, 29, 72, 0.14); }

/* ---------- Timeline / mensagens ---------- */
.timeline {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.msg {
    border: 1px solid var(--st-line);
    border-left: 4px solid var(--st-brand);
    border-radius: 12px;
    padding: 14px;
    background: #fff;
}

.msg.admin    { border-left-color: var(--c-resolved); background: #f6fbf8; }
.msg.customer { border-left-color: var(--st-brand); }

.msg-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    color: var(--st-muted);
    font-size: 13px;
    margin-bottom: 6px;
}

.msg-head strong { color: var(--st-text); }

.status-change {
    font-size: 12px;
    font-weight: 700;
    color: var(--p-high);
}

/* ---------- Anexos ---------- */
.attachments {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.attachment {
    display: grid;
    gap: 6px;
    padding: 8px;
    border: 1px solid var(--st-line);
    border-radius: 10px;
    background: #fafbff;
    color: var(--st-text);
    text-decoration: none;
    overflow: hidden;
}

.attachment:hover { color: var(--st-text); border-color: #cdd7ee; }

.attachment img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--st-line);
}

.attachment span {
    font-size: 12px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.attachment small { color: var(--st-muted); }

/* ---------- Layouts utilitários ---------- */
.narrow-wrap {
    min-height: calc(100vh - 200px);
    display: grid;
    place-items: center;
}

.sticky-side {
    position: sticky;
    top: 84px;
}

@media (max-width: 991px) {
    .sticky-side { position: static; }
}
