/* =============================================================
   HELPREX Portal — REXSUITE brand system
   Cliente final: fundo paper quente, accent coral, Geist.
   ============================================================= */

:root {
    --ink:       #0A0A0B;
    --ink-2:     #131316;
    --ink-3:     #1E1E22;
    --line:      #2E2E34;
    --muted:     #6B6B72;
    --muted-2:   #9A9AA1;
    --paper:     #F4F1EA;
    --paper-2:   #E9E4D9;
    --paper-3:   #D9D3C5;

    /* HELPREX — Apex Coral */
    --coral:     #FF4D2E;
    --coral-dim: rgba(255,77,46,.10);
    --coral-dark:#B82A12;

    --font: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --mono: "Geist Mono", ui-monospace, monospace;
    --ease-out: cubic-bezier(.16, 1, .3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
body {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.55;
    color: var(--ink);
    background: var(--paper);
    -webkit-font-smoothing: antialiased;
}
::selection { background: var(--coral); color: var(--ink); }

h1, h2, h3 { font-family: var(--font); font-weight: 600; letter-spacing: -0.02em; color: var(--ink); margin: 0; }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 12px; }
a { color: var(--coral); text-decoration: none; transition: opacity .12s; }
a:hover { opacity: .8; }
code { font-family: var(--mono); font-size: .85em; background: var(--paper-2); padding: 2px 6px; border-radius: 4px; }

/* ---- Header ---- */
header.portal-head {
    background: var(--ink);
    border-bottom: 1px solid var(--ink-3);
    padding: 16px 24px;
    position: sticky; top: 0; z-index: 10;
}
header.portal-head nav {
    display: flex;
    align-items: center;
    gap: 20px;
    max-width: 960px;
    margin: 0 auto;
}
header.portal-head .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}
header.portal-head .rex-icon {
    width: 28px; height: 28px;
    background: var(--coral);
    border-radius: 7px;
    display: flex; align-items: center; justify-content: center;
}
header.portal-head .rex-icon img { width: 80%; height: 80%; object-fit: contain; }
header.portal-head .wm {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.04em;
    color: var(--paper);
    line-height: 1;
}
header.portal-head .wm .pre { font-weight: 400; opacity: .45; }
header.portal-head .wm .rex { font-weight: 800; color: var(--coral); }
header.portal-head .spacer { flex: 1; }
header.portal-head .nav-link {
    font-family: var(--mono);
    font-size: .72rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--paper);
    text-decoration: none;
    padding: 7px 12px;
    border: 1px solid var(--ink-3);
    border-radius: 6px;
    transition: border-color .12s;
}
header.portal-head .nav-link:hover { border-color: var(--muted); opacity: 1; }
header.portal-head .btn-link {
    background: none; border: 0;
    color: var(--muted-2);
    cursor: pointer;
    font-family: var(--mono);
    font-size: .72rem;
    letter-spacing: .1em;
    text-transform: uppercase;
}

main { max-width: 960px; margin: 40px auto; padding: 0 24px; }

/* ---- Card ---- */
.card {
    background: #fff;
    border: 1px solid var(--paper-3);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 16px;
}

/* ---- Forms ---- */
input, textarea, select {
    width: 100%;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid var(--paper-3);
    border-radius: 6px;
    font-family: inherit;
    font-size: .95rem;
    color: var(--ink);
    transition: border-color .12s, box-shadow .12s;
}
textarea { min-height: 160px; line-height: 1.55; resize: vertical; }
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--coral);
    box-shadow: 0 0 0 3px var(--coral-dim);
}
input::placeholder, textarea::placeholder { color: var(--muted-2); }
label {
    display: block;
    font-family: var(--mono);
    font-size: .68rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 16px 0 6px;
}

/* ---- Buttons ---- */
button.primary, .btn.accent {
    display: inline-block;
    background: var(--ink);
    color: var(--paper);
    border: 1px solid var(--ink);
    padding: 10px 18px;
    border-radius: 6px;
    font-family: var(--mono);
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    cursor: pointer;
    transition: transform .12s, box-shadow .12s;
    text-decoration: none;
}
button.primary:hover, .btn.accent:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,.15); }

/* ---- Badges ---- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: 999px;
    font-family: var(--mono);
    font-size: .65rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .7; }
.badge.b-New     { background: #EEE8D0; color: #5A5020; }
.badge.b-Open    { background: #D0E8D0; color: #1A4020; }
.badge.b-Pending { background: #F0DEAD; color: #5A3A10; }
.badge.b-Resolved{ background: #C8E4D0; color: #1A4028; }
.badge.b-Closed  { background: var(--paper-2); color: var(--muted); }

.err { color: var(--coral); font-size: .82rem; margin: 8px 0; }
.muted { color: var(--muted-2); }
.ticket-num { font-family: var(--mono); color: var(--muted-2); font-size: .88rem; }

/* ---- Ticket list ---- */
.ticket-row {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    align-items: center;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--paper-3);
}
.ticket-row:last-child { border-bottom: 0; }
.ticket-row a { color: var(--ink); font-weight: 500; }
.ticket-row a:hover { color: var(--coral); opacity: 1; }

/* ---- Message bubbles ---- */
.bubble {
    background: #fff;
    border: 1px solid var(--paper-3);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
}
.bubble.you { border-left: 2px solid var(--coral); }
.bubble.support { border-left: 2px solid #6ABA6A; }
.bubble small { display: block; font-family: var(--mono); font-size: .68rem; letter-spacing: .08em; color: var(--muted-2); margin-bottom: 10px; text-transform: uppercase; }
.bubble small strong { color: var(--ink); font-weight: 600; }

.page-head { margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid var(--paper-3); }
.page-head h2 { margin-bottom: 4px; }
.page-head .lead { color: var(--muted-2); font-size: .9rem; }

.empty { text-align: center; padding: 64px 24px; color: var(--muted-2); }
.empty h3 { color: var(--ink); margin-bottom: 8px; }
