/* =============================================================
   ROLLIN HOST — Componentes (tabelas, painéis, forms, timeline)
   ============================================================= */

/* Esconde crédito "Powered by WHMCS" em todas as páginas */
.text-center > a[href*="whmcs.com"],
p:has(> a[href*="whmcs.com"]),
.whmcs-credit,
#whmcs-credit,
[class*="powered-by"],
[id*="powered-by"] {
    display: none !important;
}

/* ===== Page header ===== */
.rollin-page-header {
    padding: var(--space-xl) 0 var(--space-lg);
    margin-bottom: var(--space-xl);
}

.rollin-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: var(--fs-xs);
    margin-bottom: var(--space-sm);
    font-weight: 500;
    flex-wrap: wrap;
}

.rollin-breadcrumb a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.rollin-breadcrumb a:hover { color: var(--rh-cyan); }
.rollin-breadcrumb-current { color: var(--text-primary); }

.rollin-page-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-lg);
    flex-wrap: wrap;
}

.rollin-page-title {
    font-size: var(--fs-2xl);
    font-weight: 800;
    letter-spacing: -0.025em;
    margin: 0 0 6px;
    line-height: 1.1;
    color: var(--text-primary);
}

.rollin-page-subtitle {
    color: var(--text-muted);
    font-size: var(--fs-base);
    margin: 0;
    max-width: 640px;
    line-height: 1.5;
}

.rollin-page-actions {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
    flex-shrink: 0;
}

/* ===== Tabela premium ===== */
.rollin-table-wrap {
    background: var(--bg-glass);
    /* backdrop-filter removido (perf) */
    /* -webkit-backdrop-filter removido (perf) */
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

.rollin-table-toolbar {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border-subtle);
    background: rgba(255,255,255,0.02);
    flex-wrap: wrap;
}

.rollin-search {
    flex: 1;
    min-width: 200px;
    position: relative;
    display: block; /* NÃO flex — ícone é absoluto sobre o input */
}

/* Pega <i data-lucide> ANTES da hidratação Lucide E <svg.lucide> DEPOIS */
.rollin-search > i,
.rollin-search > svg {
    position: absolute !important;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px !important;
    height: 16px !important;
    color: var(--text-muted);
    pointer-events: none;
    z-index: 2;
    margin: 0 !important;
}

.rollin-search input {
    width: 100% !important;
    padding: 10px 14px 10px 40px !important;
    height: 42px !important;
    box-sizing: border-box !important;
    margin: 0 !important;
}

.rollin-table-filters {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
}

.rollin-table-filter-btn {
    padding: 6px 14px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: 'Poppins', sans-serif;
    font-size: var(--fs-xs);
    font-weight: 600;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.rollin-table-filter-btn:hover { color: var(--text-primary); }

.rollin-table-filter-btn.active {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 16px var(--glow-primary);
}

.rollin-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.rollin-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    color: var(--text-secondary);
    font-size: var(--fs-sm);
    min-width: 600px;
}

.rollin-table thead th {
    background: rgba(255,255,255,0.025);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 14px var(--space-lg);
    text-align: left;
    border: none;
    border-bottom: 1px solid var(--border-default);
    white-space: nowrap;
}

.rollin-table tbody tr { transition: background var(--transition-fast); cursor: pointer; }
.rollin-table tbody tr:hover { background: rgba(138,43,214,0.05); }
.rollin-table tbody tr:last-child td { border-bottom: none; }

.rollin-table td {
    padding: var(--space-md) var(--space-lg);
    border: none;
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: middle;
    color: var(--text-secondary);
}

.rollin-table td.col-primary { color: var(--text-primary); font-weight: 600; }
.rollin-table td.col-action  { text-align: right; width: 1%; white-space: nowrap; }

/* ===== Row CTA (ex: "Ver fatura") =====
   Substitui o chevron-only por um botão com texto + ícone. */
.rh-invoice-row-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 10px;
    font-family: 'Poppins', system-ui, sans-serif;
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none !important;
    border: 1px solid;
    outline: none !important;
    transition: background 160ms ease, color 160ms ease, border-color 160ms ease, transform 160ms ease;
    white-space: nowrap;
}
html[data-theme="light"] .rh-invoice-row-cta {
    background: rgba(106, 26, 176, 0.06);
    border-color: rgba(106, 26, 176, 0.18);
    color: #6a1ab0;
}
html[data-theme="dark"] .rh-invoice-row-cta {
    background: rgba(184, 85, 255, 0.10);
    border-color: rgba(184, 85, 255, 0.24);
    color: #b855ff;
}
.rh-invoice-row-cta:hover,
.rh-invoice-row-cta:focus-visible {
    text-decoration: none !important;
}
html[data-theme="light"] .rh-invoice-row-cta:hover {
    background: #6a1ab0;
    border-color: #6a1ab0;
    color: #ffffff;
}
html[data-theme="dark"] .rh-invoice-row-cta:hover {
    background: #b855ff;
    border-color: #b855ff;
    color: #16002a;
}
.rh-invoice-row-cta:focus-visible {
    box-shadow: 0 0 0 3px rgba(184, 85, 255, 0.30);
}
.rh-invoice-row-cta i,
.rh-invoice-row-cta svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* Variante "Pagar" — CTA cheio em roxo, destaque pra fatura em aberto.
   Cor da fonte com !important e cobrindo span/ícone: o botão fica dentro de
   <td> de tabela, e regras genéricas de cor de link de tabela vinham
   sobrescrevendo o texto pra escuro em light mode. O padrão (sem data-theme)
   já é a aparência light — não depende do FOUC ter rodado. */
.rh-invoice-row-cta-pay,
html[data-theme="light"] .rh-invoice-row-cta-pay {
    background: #6a1ab0;
    border-color: #6a1ab0;
    color: #ffffff !important;
}
.rh-invoice-row-cta-pay span,
.rh-invoice-row-cta-pay i,
.rh-invoice-row-cta-pay svg,
html[data-theme="light"] .rh-invoice-row-cta-pay span,
html[data-theme="light"] .rh-invoice-row-cta-pay i,
html[data-theme="light"] .rh-invoice-row-cta-pay svg {
    color: #ffffff !important;
}
.rh-invoice-row-cta-pay:hover,
html[data-theme="light"] .rh-invoice-row-cta-pay:hover {
    background: #5410a0;
    border-color: #5410a0;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(106, 26, 176, 0.30);
}
html[data-theme="dark"] .rh-invoice-row-cta-pay {
    background: #b855ff;
    border-color: #b855ff;
    color: #16002a !important;
}
html[data-theme="dark"] .rh-invoice-row-cta-pay span,
html[data-theme="dark"] .rh-invoice-row-cta-pay i,
html[data-theme="dark"] .rh-invoice-row-cta-pay svg {
    color: #16002a !important;
}
html[data-theme="dark"] .rh-invoice-row-cta-pay:hover {
    background: #c773ff;
    border-color: #c773ff;
    color: #16002a !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(184, 85, 255, 0.30);
}

/* ===== Status badges ===== */
.rollin-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
    white-space: nowrap;
    border: 1px solid transparent;
}

.rollin-status::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 6px currentColor;
}

/* === Pago / Ativo — verde sucesso (substituiu ciano que se confundia com
   o roxo Rollin em light mode e dava pouco contraste) === */
.rollin-status-active,
.rollin-status-paid {
    background: rgba(16, 185, 129, 0.12);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.30);
}
html[data-theme="light"] .rollin-status-active,
html[data-theme="light"] .rollin-status-paid {
    background: #d1fae5;
    color: #065f46;
    border-color: rgba(16, 185, 129, 0.45);
}

/* === Em aberto / Pendente — amarelo warning com mais contraste === */
.rollin-status-pending,
.rollin-status-unpaid {
    background: rgba(245, 158, 11, 0.14);
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.35);
}
html[data-theme="light"] .rollin-status-pending,
html[data-theme="light"] .rollin-status-unpaid {
    background: #fef3c7;
    color: #92400e;
    border-color: rgba(245, 158, 11, 0.50);
}

/* === Cancelado / Suspended / Overdue — rosa-vermelho === */
.rollin-status-suspended,
.rollin-status-overdue,
.rollin-status-cancelled {
    background: rgba(255,92,124,0.10);
    color: #ff8aa0;
    border-color: rgba(255,92,124,0.25);
}
html[data-theme="light"] .rollin-status-suspended,
html[data-theme="light"] .rollin-status-overdue,
html[data-theme="light"] .rollin-status-cancelled {
    background: #fee2e2;
    color: #991b1b;
    border-color: rgba(220, 38, 38, 0.45);
}

.rollin-status-terminated,
.rollin-status-fraud {
    background: rgba(128,128,128,0.1);
    color: var(--text-muted);
    border-color: var(--border-default);
}

.rollin-status-open,
.rollin-status-answered {
    background: rgba(138,43,214,0.1);
    color: #b97aff;
    border-color: rgba(138,43,214,0.25);
}

.rollin-status-closed {
    background: rgba(255,255,255,0.06);
    color: var(--text-muted);
    border-color: var(--border-default);
}

.rollin-status-customer-reply,
.rollin-status-customerreply,
.rollin-status-in-progress {
    background: rgba(1,250,213,0.08);
    color: var(--rh-cyan);
    border-color: rgba(1,250,213,0.2);
}

/* ===== Empty state ===== */
.rollin-empty {
    padding: var(--space-2xl) var(--space-lg);
    text-align: center;
    color: var(--text-muted);
}

.rollin-empty-icon-box {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-lg);
    background: rgba(138,43,214,0.1);
    border: 1px solid rgba(138,43,214,0.2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-md);
    color: var(--rh-purple);
}

.rollin-empty h3 {
    font-size: var(--fs-lg);
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 6px;
}

.rollin-empty p {
    font-size: var(--fs-sm);
    color: var(--text-muted);
    margin: 0 0 var(--space-lg);
    max-width: 440px;
    margin-left: auto;
    margin-right: auto;
}

/* ===== Item cards ===== */
.rollin-item-card {
    display: block;
    padding: var(--space-lg);
    background: var(--bg-glass);
    /* backdrop-filter removido pra performance */
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-md);
    transition: all var(--transition-base);
    cursor: pointer;
    text-decoration: none;
    color: var(--text-primary);
    position: relative;
    overflow: hidden;
}

.rollin-item-card:hover {
    border-color: rgba(138,43,214,0.35);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    color: var(--text-primary);
    text-decoration: none;
}

.rollin-item-card::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.rollin-item-card:hover::before { opacity: 1; }

.rollin-item-title {
    font-size: var(--fs-base);
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 4px;
}

.rollin-item-subtitle {
    font-size: var(--fs-sm);
    color: var(--text-muted);
    margin: 0;
    font-family: 'JetBrains Mono', 'SF Mono', monospace;
}

.rollin-item-meta {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--border-subtle);
}

.rollin-item-meta-label {
    font-size: 10px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}

.rollin-item-meta-value {
    font-size: var(--fs-sm);
    color: var(--text-primary);
    font-weight: 500;
}

/* ===== Tabs ===== */
.rollin-tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    margin-bottom: var(--space-lg);
    overflow-x: auto;
    scrollbar-width: none;
    /* backdrop-filter removido pra performance */
}

.rollin-tabs::-webkit-scrollbar { display: none; }

.rollin-tab {
    padding: 10px 20px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: 'Poppins', sans-serif;
    font-size: var(--fs-sm);
    font-weight: 600;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-base);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    flex-shrink: 0;
    text-decoration: none;
}

.rollin-tab:hover { color: var(--text-primary); text-decoration: none; }

.rollin-tab.active {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 16px var(--glow-primary);
}

.rollin-tab-content {
    background: var(--bg-glass);
    /* backdrop-filter removido pra performance */
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
}

/* ===== Info cards ===== */
.rollin-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.rollin-info-card {
    padding: var(--space-lg);
    background: var(--bg-glass);
    /* backdrop-filter removido pra performance */
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
}

.rollin-info-card:hover {
    border-color: rgba(138,43,214,0.3);
    transform: translateY(-2px);
}

.rollin-info-card-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    margin-bottom: 10px;
}

.rollin-info-card-label i { color: var(--rh-cyan); }

.rollin-info-card-value {
    font-size: var(--fs-xl);
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.rollin-info-card-value.big {
    font-size: var(--fs-3xl);
    font-weight: 800;
    letter-spacing: -0.03em;
    background: var(--gradient-mixed);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Dark mode: remove gradient (legibilidade ruim em fundo escuro) e usa
   branco sólido — o ciano vibrante como texto grande cansava a vista. */
html[data-theme="dark"] .rollin-info-card-value.big {
    background: none !important;
    -webkit-background-clip: initial !important;
    background-clip: initial !important;
    -webkit-text-fill-color: #ffffff !important;
    color: #ffffff !important;
}

.rollin-info-card-hint {
    margin-top: 6px;
    font-size: var(--fs-xs);
    color: var(--text-muted);
}

/* ===== Progress bar ===== */
.rollin-progress {
    width: 100%;
    height: 6px;
    background: rgba(255,255,255,0.07);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin: 10px 0;
}

.rollin-progress-bar {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    transition: width 800ms cubic-bezier(0.4,0,0.2,1);
}

.rollin-progress-bar.cyan    { background: var(--gradient-cyan); }
.rollin-progress-bar.warn    { background: linear-gradient(90deg, #ffc940, #ff8a2c); }
.rollin-progress-bar.danger  { background: linear-gradient(90deg, #ff5c7c, #ff2c2c); }

.rollin-progress-label {
    display: flex;
    justify-content: space-between;
    font-size: var(--fs-xs);
    color: var(--text-muted);
    margin-top: 4px;
    font-variant-numeric: tabular-nums;
}

.rollin-progress-label strong { color: var(--text-primary); }

/* ===== Timeline ===== */
.rollin-timeline {
    position: relative;
    padding-left: 32px;
}

.rollin-timeline::before {
    content: '';
    position: absolute;
    left: 12px; top: 0; bottom: 0;
    width: 1px;
    background: linear-gradient(to bottom, var(--border-default) 0%, var(--border-subtle) 80%, transparent 100%);
}

.rollin-timeline-item {
    position: relative;
    margin-bottom: var(--space-lg);
}

.rollin-timeline-item::before {
    content: '';
    position: absolute;
    left: -26px; top: 14px;
    width: 12px; height: 12px;
    border-radius: 50%;
    background: var(--bg-primary);
    border: 2px solid var(--rh-purple);
    box-shadow: 0 0 0 3px var(--glow-primary);
    z-index: 1;
}

.rollin-timeline-item.admin::before {
    border-color: var(--rh-cyan);
    box-shadow: 0 0 0 3px var(--glow-cyan);
}

.rollin-timeline-item.system::before {
    border-color: var(--text-muted);
    box-shadow: 0 0 0 3px rgba(255,255,255,0.06);
}

.rollin-timeline-card {
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-glass);
    /* backdrop-filter removido pra performance */
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
}

.rollin-timeline-card.admin {
    background: linear-gradient(135deg, rgba(1,250,213,0.04), var(--bg-glass));
    border-color: rgba(1,250,213,0.15);
}

/* === DARK MODE — overrides explícitos pra evitar fundo claro vazando
       em qualquer classe legacy do WHMCS (ticket-reply, markdown-content, staff) === */
html[data-theme="dark"] .rollin-timeline-card,
html[data-theme="dark"] .rollin-timeline-card.admin,
html[data-theme="dark"] .ticket-reply,
html[data-theme="dark"] .ticket-reply.staff {
    background: rgba(21,0,40,0.55) !important;
    border-color: rgba(1,250,213,0.18) !important;
    color: var(--text-primary) !important;
}
html[data-theme="dark"] .rollin-timeline-card .rollin-timeline-head,
html[data-theme="dark"] .rollin-timeline-card .rollin-timeline-body,
html[data-theme="dark"] .ticket-reply .rollin-timeline-head,
html[data-theme="dark"] .ticket-reply .rollin-timeline-body {
    background: transparent !important;
    color: var(--text-secondary) !important;
}
html[data-theme="dark"] .rollin-timeline-name,
html[data-theme="dark"] .rollin-timeline-name span {
    color: var(--text-primary) !important;
}
html[data-theme="dark"] .rollin-timeline-subtitle,
html[data-theme="dark"] .rollin-timeline-date {
    color: var(--text-muted) !important;
}

.rollin-timeline-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--space-md);
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-subtle);
    flex-wrap: wrap;
}

.rollin-timeline-author {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.rollin-timeline-avatar {
    width: 42px; height: 42px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 15px;
    flex-shrink: 0;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08), 0 0 0 2px rgba(255,255,255,0.05);
    letter-spacing: -0.01em;
}

.rollin-timeline-avatar.admin {
    background: var(--gradient-cyan);
    color: var(--bg-primary);
    box-shadow: 0 1px 2px rgba(0,0,0,0.08), 0 0 0 2px rgba(1,250,213,0.15);
}

.rollin-timeline-name {
    font-size: var(--fs-base);
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.25;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.rollin-timeline-role {
    display: inline-block;
    padding: 3px 9px;
    background: rgba(138,43,214,0.15);
    color: #b97aff;
    border-radius: var(--radius-full);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-left: 0;
    line-height: 1.4;
}

.rollin-timeline-role.admin {
    background: rgba(1,250,213,0.14);
    color: var(--rh-cyan);
}

.rollin-timeline-subtitle {
    font-size: var(--fs-xs);
    color: var(--text-muted);
    margin-top: 3px;
    line-height: 1.3;
    font-weight: 500;
}

.rollin-timeline-date {
    font-size: var(--fs-xs);
    color: var(--text-muted);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.rollin-timeline-body {
    color: var(--text-secondary);
    font-size: var(--fs-sm);
    line-height: 1.7;
    word-wrap: break-word;
}

.rollin-timeline-body p { margin: 0 0 12px; }
.rollin-timeline-body p:last-child { margin-bottom: 0; }
.rollin-timeline-body a { color: var(--rh-cyan); }

/* === Bloco de código (pre + code) — light/dark safe === */
.rollin-timeline-body code,
.rollin-timeline-body :not(pre) > code {
    background: rgba(91,33,182,0.10);
    padding: 2px 7px;
    border-radius: 5px;
    font-family: 'JetBrains Mono','SF Mono',Menlo,Consolas,monospace;
    font-size: 12.5px;
    color: #5b21b6;
    border: 1px solid rgba(91,33,182,0.15);
    font-weight: 500;
}
.rollin-timeline-body pre {
    background: #0f172a;
    color: #e2e8f0;
    padding: 14px 18px;
    border-radius: 10px;
    margin: 14px 0;
    overflow-x: auto;
    border: 1px solid rgba(0,0,0,0.1);
    font-family: 'JetBrains Mono','SF Mono',Menlo,Consolas,monospace;
    font-size: 12.5px;
    line-height: 1.65;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.rollin-timeline-body pre code {
    background: transparent !important;
    padding: 0 !important;
    color: #e2e8f0 !important;
    border: 0 !important;
    font-size: inherit !important;
    font-weight: 400 !important;
    white-space: pre;
}
/* Garante que no LIGHT também o bloco code (pre) fique escuro com texto claro */
[data-theme="light"] .rollin-timeline-body pre {
    background: #0f172a;
    color: #e2e8f0;
    border-color: rgba(15,23,42,0.15);
}
[data-theme="light"] .rollin-timeline-body :not(pre) > code,
[data-theme="light"] .rollin-timeline-body code:not(pre code) {
    background: #f5f3ff;
    color: #5b21b6;
    border-color: #ddd6fe;
}

/* === Card SLA dentro do ticket === */
.rollin-sla-strip {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    background: var(--bg-glass);
    margin: var(--space-md) 0 var(--space-lg);
    flex-wrap: wrap;
}
.rollin-sla-strip-icon {
    width: 42px; height: 42px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(91,33,182,0.10);
    color: #5b21b6;
    flex-shrink: 0;
}
.rollin-sla-strip.ok .rollin-sla-strip-icon { background: rgba(16,185,129,0.12); color: #059669; }
.rollin-sla-strip.bad .rollin-sla-strip-icon { background: rgba(220,38,38,0.12); color: #dc2626; }
.rollin-sla-strip.warn .rollin-sla-strip-icon { background: rgba(245,158,11,0.14); color: #b45309; }
.rollin-sla-strip-info { flex: 1; min-width: 200px; }
.rollin-sla-strip-title {
    font-size: var(--fs-sm);
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
}
.rollin-sla-strip-sub {
    font-size: var(--fs-xs);
    color: var(--text-muted);
    margin-top: 2px;
}
.rollin-sla-strip-metric {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    padding-left: 14px;
    border-left: 1px solid var(--border-subtle);
}
.rollin-sla-strip-metric-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    font-weight: 700;
}
.rollin-sla-strip-metric-val {
    font-size: var(--fs-base);
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.rollin-timeline-attachments,
.rollin-timeline-attachments.attachments {
    margin-top: 16px;
    padding: 14px 16px;
    border-top: 1px dashed var(--border-subtle);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    background: rgba(91,33,182,0.04) !important;   /* override legacy .attachments white bg */
    color: var(--text-secondary);
}
html[data-theme="dark"] .rollin-timeline-attachments,
html[data-theme="dark"] .rollin-timeline-attachments.attachments {
    background: rgba(1,250,213,0.04) !important;
    border-top-color: rgba(1,250,213,0.15);
}
.rollin-timeline-attachments > div:first-child,
.rollin-timeline-attachments > .label {
    color: var(--text-muted) !important;
}
html[data-theme="dark"] .rollin-timeline-attachments > div:first-child {
    color: rgba(255,255,255,0.65) !important;
}
.rollin-timeline-attachment {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: rgba(91,33,182,0.08);
    border: 1px solid rgba(91,33,182,0.25);
    border-radius: 10px;
    color: #5b21b6;
    font-size: var(--fs-sm);
    font-weight: 600;
    text-decoration: none;
    transition: all .15s ease;
}
.rollin-timeline-attachment i { width: 16px; height: 16px; }
.rollin-timeline-attachment:hover {
    background: rgba(91,33,182,0.14);
    border-color: rgba(91,33,182,0.45);
    color: #4c1d95;
    transform: translateY(-1px);
}
[data-theme="dark"] .rollin-timeline-attachment {
    background: rgba(1,250,213,0.08);
    border-color: rgba(1,250,213,0.30);
    color: var(--rh-cyan);
}
[data-theme="dark"] .rollin-timeline-attachment:hover {
    background: rgba(1,250,213,0.16);
    border-color: rgba(1,250,213,0.50);
}

/* === Uploader de anexos (form de resposta) — light/dark safe === */
.rollin-uploader {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.rollin-uploader-drop {
    position: relative;
    border: 2px dashed rgba(91,33,182,0.25);
    border-radius: 12px;
    background: rgba(91,33,182,0.03);
    padding: 22px;
    transition: all .15s ease;
    min-height: 110px;
    cursor: pointer;
}
.rollin-uploader-drop:hover,
.rollin-uploader-drop.is-drag {
    border-color: #5b21b6;
    background: rgba(91,33,182,0.06);
}
html[data-theme="dark"] .rollin-uploader-drop {
    border-color: rgba(1,250,213,0.25);
    background: rgba(1,250,213,0.04);
}
html[data-theme="dark"] .rollin-uploader-drop:hover,
html[data-theme="dark"] .rollin-uploader-drop.is-drag {
    border-color: var(--rh-cyan);
    background: rgba(1,250,213,0.08);
}
.rollin-uploader-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}
.rollin-uploader-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-align: center;
    pointer-events: none;
    color: var(--text-muted);
}
.rollin-uploader-empty i { width: 32px; height: 32px; color: #5b21b6; opacity: .85; }
html[data-theme="dark"] .rollin-uploader-empty i { color: var(--rh-cyan); }
.rollin-uploader-empty-title {
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 4px;
}
.rollin-uploader-empty-hint {
    font-size: var(--fs-xs);
    color: var(--text-muted);
}
.rollin-uploader-chips {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    position: relative;
    z-index: 3;
}
.rollin-uploader-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px 6px 12px;
    background: #ffffff;
    border: 1px solid rgba(91,33,182,0.25);
    border-radius: 999px;
    font-size: var(--fs-xs);
    color: #4c1d95;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    max-width: 100%;
}
.rollin-uploader-chip i { width: 14px; height: 14px; flex-shrink: 0; }
.rollin-uploader-chip-name {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 180px;
}
.rollin-uploader-chip-size {
    color: var(--text-muted);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}
.rollin-uploader-chip-remove {
    background: transparent;
    border: 0;
    padding: 2px;
    margin-left: 2px;
    cursor: pointer;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all .12s ease;
}
.rollin-uploader-chip-remove:hover {
    background: rgba(220,38,38,0.10);
    color: #dc2626;
}
html[data-theme="dark"] .rollin-uploader-chip {
    background: rgba(1,250,213,0.10);
    border-color: rgba(1,250,213,0.30);
    color: var(--rh-cyan);
}
html[data-theme="dark"] .rollin-uploader-chip-size {
    color: rgba(255,255,255,0.55);
}
html[data-theme="dark"] .rollin-uploader-chip-remove {
    color: rgba(255,255,255,0.55);
}
html[data-theme="dark"] .rollin-uploader-chip-remove:hover {
    background: rgba(255,138,160,0.18);
    color: #ff8aa0;
}
.rollin-uploader-extra-slots {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.rollin-uploader-extra-slot {
    position: relative;
}
.rollin-uploader-input--extra {
    position: absolute;
    width: 1px; height: 1px; opacity: 0; overflow: hidden;
}
.rollin-uploader-extra-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: rgba(91,33,182,0.06);
    border: 1px solid rgba(91,33,182,0.20);
    border-radius: 10px;
    font-size: var(--fs-sm);
    color: #5b21b6;
    cursor: pointer;
    font-weight: 500;
    transition: all .12s ease;
}
.rollin-uploader-extra-label:hover {
    background: rgba(91,33,182,0.12);
    border-color: rgba(91,33,182,0.35);
}
html[data-theme="dark"] .rollin-uploader-extra-label {
    background: rgba(1,250,213,0.06);
    border-color: rgba(1,250,213,0.22);
    color: var(--rh-cyan);
}
html[data-theme="dark"] .rollin-uploader-extra-label:hover {
    background: rgba(1,250,213,0.12);
    border-color: rgba(1,250,213,0.40);
}
.rollin-uploader-addmore {
    align-self: flex-start;
    background: transparent;
    border: 1px dashed rgba(91,33,182,0.35);
    color: #5b21b6;
    padding: 8px 14px;
    border-radius: 10px;
    cursor: pointer;
    font-size: var(--fs-sm);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all .12s ease;
}
.rollin-uploader-addmore:hover {
    background: rgba(91,33,182,0.06);
    border-color: rgba(91,33,182,0.55);
}
.rollin-uploader-addmore i { width: 16px; height: 16px; }
html[data-theme="dark"] .rollin-uploader-addmore {
    border-color: rgba(1,250,213,0.35);
    color: var(--rh-cyan);
}
html[data-theme="dark"] .rollin-uploader-addmore:hover {
    background: rgba(1,250,213,0.08);
    border-color: rgba(1,250,213,0.60);
}

/* ===== Forms ===== */
.rollin-form-section {
    background: var(--bg-glass);
    /* backdrop-filter removido pra performance */
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    margin-bottom: var(--space-lg);
}

.rollin-form-section-title {
    font-size: var(--fs-lg);
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 4px;
}

.rollin-form-section-desc {
    color: var(--text-muted);
    font-size: var(--fs-sm);
    margin: 0 0 var(--space-lg);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--border-subtle);
}

.rollin-form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.rollin-form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.rollin-form-field.full { grid-column: 1 / -1; }

.rollin-form-field label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    margin: 0;
}

.rollin-form-field .required { color: #ff5c7c; }

.rollin-form-field .hint,
.rollin-form-field .error-text {
    font-size: var(--fs-xs);
    color: var(--text-dim);
    line-height: 1.4;
}

.rollin-form-field .error-text { color: #ff8aa0; }

.rollin-form-actions {
    display: flex;
    gap: var(--space-sm);
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
    padding-top: var(--space-md);
    border-top: 1px solid var(--border-subtle);
    margin-top: var(--space-lg);
}

/* ===== Panels nativos WHMCS ===== */
.rollin-panels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-lg);
}

.rollin-panel {
    background: var(--bg-glass);
    /* backdrop-filter removido pra performance */
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: border-color var(--transition-base);
}

.rollin-panel:hover { border-color: rgba(138,43,214,0.3); }

.rollin-panel-header {
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border-subtle);
    background: rgba(255,255,255,0.02);
}

.rollin-panel-header h3 {
    font-size: var(--fs-sm);
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.rollin-panel-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: var(--rh-purple);
    color: white;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
}

.rollin-panel-body {
    padding: var(--space-md) var(--space-lg);
    color: var(--text-secondary);
    font-size: var(--fs-sm);
    line-height: 1.6;
}

.rollin-panel-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.rollin-panel-list li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px var(--space-lg);
    color: var(--text-secondary);
    font-size: var(--fs-sm);
    text-decoration: none;
    border-bottom: 1px solid var(--border-subtle);
    transition: all var(--transition-fast);
}

.rollin-panel-list li:last-child a { border-bottom: none; }

.rollin-panel-list li a:hover {
    background: rgba(138,43,214,0.06);
    color: var(--text-primary);
    text-decoration: none;
    padding-left: calc(var(--space-lg) + 4px);
}

.rollin-panel-list li a.active {
    color: var(--rh-cyan);
    background: rgba(1,250,213,0.06);
}

.rollin-panel-cta {
    display: block;
    margin: var(--space-md) var(--space-lg);
    text-align: center;
    width: calc(100% - var(--space-lg) * 2);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .rollin-page-title { font-size: var(--fs-xl); }
    .rollin-table-toolbar { flex-direction: column; align-items: stretch; }
    .rollin-table { font-size: var(--fs-xs); }
    .rollin-table thead th,
    .rollin-table td { padding: 10px 12px; }
    .rollin-info-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .rollin-form-section { padding: var(--space-lg); }
    .rollin-form-row { grid-template-columns: 1fr; }
    .rollin-panels-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .rollin-info-grid { grid-template-columns: 1fr; }
}

/* =============================================================
   ONDA 1 — Componentes adicionais (checkbox, icon-badge, row-action)
   ============================================================= */

/* === Checkbox estilizado === */
.rollin-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 12px;
    margin: 0 0 4px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 150ms ease;
}
.rollin-checkbox:hover { background: rgba(255,255,255,0.04); }
[data-theme="light"] .rollin-checkbox:hover { background: rgba(13,10,31,0.04); }
.rollin-checkbox input[type="checkbox"] {
    width: 18px; height: 18px;
    margin: 1px 0 0;
    accent-color: var(--rh-purple);
    cursor: pointer;
    flex-shrink: 0;
}
.rollin-checkbox > span {
    font-weight: 600;
    font-size: 13.5px;
    color: var(--text-primary);
    line-height: 1.3;
    display: block;
    text-transform: none;
    letter-spacing: 0;
}
.rollin-checkbox > small {
    display: block;
    font-size: 11.5px;
    color: var(--text-muted);
    margin-top: 2px;
    line-height: 1.3;
}
.rollin-checkbox > span ~ small,
.rollin-checkbox span + small { font-weight: 400; }

/* === Icon badge (círculo colorido com ícone) === */
.rollin-icon-badge {
    width: 40px; height: 40px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(138,43,214,0.14);
    color: var(--rh-purple);
    border: 1px solid rgba(138,43,214,0.25);
    transition: background 200ms ease, color 200ms ease;
}
.rollin-icon-badge svg,
.rollin-icon-badge i { width: 18px; height: 18px; }
.rollin-icon-badge-purple {
    background: rgba(138,43,214,0.14);
    color: var(--rh-purple);
    border-color: rgba(138,43,214,0.25);
}
.rollin-icon-badge-cyan {
    background: rgba(1,250,213,0.14);
    color: var(--rh-cyan);
    border-color: rgba(1,250,213,0.3);
}
.rollin-icon-badge-pink {
    background: rgba(255,92,124,0.14);
    color: #ff5c7c;
    border-color: rgba(255,92,124,0.3);
}
.rollin-icon-badge-warn {
    background: rgba(255,184,0,0.14);
    color: #ffb800;
    border-color: rgba(255,184,0,0.3);
}
.rollin-icon-badge-ok {
    background: rgba(25,242,156,0.14);
    color: #19f29c;
    border-color: rgba(25,242,156,0.3);
}
[data-theme="light"] .rollin-icon-badge-purple {
    background: rgba(106,26,176,0.10);
    color: var(--rh-purple);
}
[data-theme="light"] .rollin-icon-badge-cyan {
    background: rgba(106,26,176,0.10);
    color: var(--rh-purple);
}

/* === Row action (botão pequeno em linha de tabela) === */
.rollin-row-action {
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 8px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.10);
    color: var(--text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 150ms ease, color 150ms ease, transform 150ms ease;
}
.rollin-row-action:hover {
    background: rgba(138,43,214,0.18);
    color: var(--rh-cyan);
    transform: translateY(-1px);
}
.rollin-row-action svg,
.rollin-row-action i { width: 14px; height: 14px; }
[data-theme="light"] .rollin-row-action {
    background: rgba(13,10,31,0.04);
    border-color: rgba(13,10,31,0.08);
    color: rgba(13,10,31,0.5);
}
[data-theme="light"] .rollin-row-action:hover {
    background: rgba(106,26,176,0.10);
    color: var(--rh-purple);
}

/* === Form actions (linha de botões no fim do form) === */
.rollin-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-end;
    align-items: center;
    margin-top: var(--space-lg, 24px);
    padding-top: var(--space-lg, 24px);
    border-top: 1px solid rgba(255,255,255,0.06);
}
[data-theme="light"] .rollin-form-actions {
    border-top-color: rgba(13,10,31,0.06);
}
.rollin-form-actions .btn {
    min-width: 140px;
}
@media (max-width: 640px) {
    .rollin-form-actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }
    .rollin-form-actions .btn { width: 100%; }
}

/* =========================================================================
   Rollin — Símbolo animado no HOVER (detalhe de marca). SVG inline dentro de
   .rollin-logo; o cursor ">" reage ao mouse. CSS puro, sem JS. Keyframes com
   prefixo rln* pra não conflitar. Cores: roxo #8A2BD6, verde #01FAD5.
   Uso: {include file="$template/includes/rollin-symbol.tpl" anim="nudge"}
   ========================================================================= */
.rollin-logo { display: inline-flex; align-items: center; justify-content: center; line-height: 0; }
.rollin-logo svg { overflow: visible; display: block; }
.rollin-logo .rollin-chev, .rollin-logo .rollin-dot { transform-box: fill-box; transform-origin: center; }

/* Padrão — digitação: empurrão elástico do > + piscada do ponto (cursor de terminal) */
@keyframes rlnNudge { 0% { transform: translateX(0); } 30% { transform: translateX(7px); } 55% { transform: translateX(-2px); } 100% { transform: translateX(0); } }
@keyframes rlnBlink { 0%, 100% { opacity: 1; } 25% { opacity: 0; } 50% { opacity: 1; } 75% { opacity: 0; } }
.rollin-logo:hover .rollin-chev { animation: rlnNudge .5s cubic-bezier(.34,1.56,.64,1) both; }
.rollin-logo:hover .rollin-dot  { animation: rlnBlink .9s steps(1) .15s both; }

/* Variante "pulse" — anéis ao vivo saindo do ponto (status/online) */
.rollin-logo--pulse .rollin-ring, .rollin-logo--pulse .rollin-ring2 { transform-box: fill-box; transform-origin: center; opacity: 0; }
@keyframes rlnRipple  { 0% { transform: scale(1); opacity: .8; } 100% { transform: scale(3.4); opacity: 0; } }
@keyframes rlnBreathe { 0%, 100% { transform: scale(1); } 40% { transform: scale(1.07); } }
.rollin-logo--pulse:hover .rollin-ring  { animation: rlnRipple .8s ease-out both; }
.rollin-logo--pulse:hover .rollin-ring2 { animation: rlnRipple .8s ease-out .25s both; }
.rollin-logo--pulse:hover .rollin-chev  { animation: rlnBreathe .8s ease-in-out both; }

/* Variante "draw" — o > se redesenha e o ponto entra com pop (destaque) */
.rollin-logo--draw .rollin-chev { stroke-dasharray: 100; }
@keyframes rlnDraw { from { stroke-dashoffset: 100; } to { stroke-dashoffset: 0; } }
@keyframes rlnPop  { 0% { transform: scale(0); } 70% { transform: scale(1.25); } 100% { transform: scale(1); } }
.rollin-logo--draw:hover .rollin-chev { animation: rlnDraw .55s ease-out both; }
.rollin-logo--draw:hover .rollin-dot  { animation: rlnPop .35s cubic-bezier(.34,1.56,.64,1) .45s both; }

/* Variante "flip" — gira 360° como moeda */
.rollin-logo--flip { perspective: 500px; }
@keyframes rlnFlip { from { transform: rotateY(0); } to { transform: rotateY(360deg); } }
.rollin-logo--flip:hover svg { animation: rlnFlip .8s cubic-bezier(.45,0,.2,1) both; }

/* Variante "tumble" — cambalhota: o > se agacha, salta girando 360° e aterrissa; o ponto encolhe e comemora */
@keyframes rlnSomersault { 0% { transform: rotate(0) translateY(0); } 15% { transform: rotate(0) translateY(4px) scaleY(.92); } 60% { transform: rotate(360deg) translateY(-14px); } 85% { transform: rotate(360deg) translateY(2px) scaleY(.95); } 100% { transform: rotate(360deg) translateY(0); } }
@keyframes rlnDotDuck { 0%, 100% { transform: scale(1); } 40% { transform: scale(.7); } 70% { transform: scale(1.15); } }
.rollin-logo--tumble:hover .rollin-chev, .rh-ca-sidebar-brand:hover .rollin-chev { animation: rlnSomersault .9s cubic-bezier(.45,0,.25,1) both; }
.rollin-logo--tumble:hover .rollin-dot,  .rh-ca-sidebar-brand:hover .rollin-dot  { animation: rlnDotDuck .9s ease-in-out both; }

/* Logo inline da sidebar: wordmark acompanha o tema (claro = escuro; escuro = branco) */
.rh-ca-sidebar-logo-full { color: #180025; }
[data-theme="dark"] .rh-ca-sidebar-logo-full { color: #ffffff; }

@media (prefers-reduced-motion: reduce) { .rollin-logo svg, .rollin-logo svg * { animation: none !important; } }
