/* =====================================================================
   PORTAL TRUE ELO — identidade visual
   Cores tiradas do logo: azul-noite, ciano ("True") e dourado ("Elo").
   ===================================================================== */
:root {
  --bg: #00001b;
  --bg-2: #050a2e;
  --panel: #060b3a;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-2: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.09);
  --text: #f1f4fa;
  --muted: #9aa3bd;
  --cyan: #389cb6;          /* "True" no logo */
  --cyan-bright: #4fc3df;   /* links e ações */
  --blue: #2563eb;
  --gold: #c0904d;          /* "Elo" no logo */
  --gold-bright: #e0aa62;
  --danger: #f87171;
  --success: #34d399;
  --warn: #fbbf24;
  --grad-cyan: linear-gradient(135deg, #4fc3df 0%, #2f7fd6 100%);
  --grad-gold: linear-gradient(135deg, #e6b56c 0%, #c0904d 55%, #a8743a 100%);
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --sidebar-w: 272px;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(56, 156, 182, 0.12), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(192, 144, 77, 0.08), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0 0 .35em; font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; }
h1 { font-size: 1.75rem; font-weight: 700; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
a { color: var(--cyan-bright); text-decoration: none; }
a:hover { text-decoration: underline; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }

/* ---------- Marca ---------- */
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand img.symbol { width: 40px; height: 40px; border-radius: 50%; }
.brand img.custom { max-height: 44px; max-width: 180px; object-fit: contain; }
.brand .wordmark { display: flex; flex-direction: column; min-width: 0; }
.brand .name { font-size: 1.35rem; font-weight: 600; letter-spacing: -0.02em; line-height: 1; white-space: nowrap; }
.brand .name .t { color: var(--cyan); }
.brand .name .e { color: var(--gold); }
.brand .slogan { display: none; font-size: .78rem; color: var(--text); opacity: .85; margin-top: 6px; }
.brand-lg { flex-direction: column; gap: 14px; margin-bottom: 28px; text-align: center; }
.brand-lg img.symbol { width: 92px; height: 92px; box-shadow: 0 0 60px rgba(56, 156, 182, 0.25); }
.brand-lg img.custom { max-height: 90px; max-width: 260px; }
.brand-lg .wordmark { align-items: center; }
.brand-lg .name { font-size: 2.3rem; }
.brand-lg .slogan { display: block; font-size: .92rem; }
.brand-sm img.symbol { width: 32px; height: 32px; }
.brand-sm .name { font-size: 1.15rem; }

/* ---------- Telas ---------- */
.screen { min-height: 100%; }
.screen-center { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px; gap: 6px; }
.screen-auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 32px 18px; }
.auth-box { width: 100%; max-width: 420px; }
.auth-box > h1, .auth-box > p.muted:first-of-type { text-align: center; }
.auth-box > h1 { font-size: 1.6rem; }

.spinner { width: 42px; height: 42px; border-radius: 50%; border: 3px solid rgba(255,255,255,.1); border-top-color: var(--cyan-bright); animation: spin 1s linear infinite; margin-bottom: 10px; }
@keyframes spin { to { transform: rotate(360deg); } }

.status-icon { width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; font-size: 2rem; font-weight: 700; margin-bottom: 16px; }
.status-danger { background: rgba(248, 113, 113, .15); color: var(--danger); }
.status-warn { background: rgba(251, 191, 36, .15); color: var(--warn); }

/* ---------- Cartões e formulários ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.form { display: flex; flex-direction: column; gap: 16px; }
.auth-box .card { margin: 20px 0 18px; }
.auth-about { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--border); text-align: center; }
.auth-about h2 { font-size: .95rem; font-weight: 600; margin: 0 0 6px; color: var(--text); }
.auth-about p { font-size: .82rem; color: var(--muted); margin: 0 0 8px; line-height: 1.55; }
.auth-legal { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 8px; margin-top: 10px; font-size: .82rem; color: var(--muted); }
.auth-legal a { color: var(--cyan-bright); text-decoration: none; }
.auth-legal a:hover { text-decoration: underline; }
label { display: flex; flex-direction: column; gap: 7px; font-size: .88rem; font-weight: 500; color: #cdd3e3; }
input, select, textarea {
  font: inherit; color: var(--text); background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.12); border-radius: var(--radius-sm);
  padding: 12px 14px; width: 100%; transition: border-color .2s, box-shadow .2s;
}
select option { background: var(--panel); }
input::placeholder { color: #6b7391; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--cyan-bright); box-shadow: 0 0 0 3px rgba(79, 195, 223, .15); }

.btn {
  font: inherit; font-weight: 500; border: 0; border-radius: var(--radius-sm); padding: 12px 20px;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .2s, box-shadow .2s, background .2s, opacity .2s; color: #fff; text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: .6; cursor: progress; transform: none !important; }
.btn-primary { background: var(--grad-cyan); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 28px rgba(79, 195, 223, .28); }
.btn-gold { background: var(--grad-gold); color: #120c02; }
.btn-gold:hover { transform: translateY(-1px); box-shadow: 0 10px 28px rgba(192, 144, 77, .3); }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: #cdd3e3; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: #dc2626; }
.btn-danger:hover { background: #b91c1c; }
.btn-sm { padding: 8px 14px; font-size: .88rem; }
.btn-link { background: none; border: 0; color: var(--cyan-bright); font: inherit; font-size: .9rem; cursor: pointer; padding: 4px; align-self: center; }
.btn-link:hover { text-decoration: underline; }

.icon-btn { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 8px; border-radius: 8px; display: inline-grid; place-items: center; font-size: 1.05rem; }
.icon-btn:hover { color: var(--text); background: var(--surface-2); }
.icon-btn.cyan { color: var(--cyan-bright); }
.icon-btn.gold { color: var(--gold-bright); }
.icon-btn.red { color: var(--danger); }

.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: rgba(0,0,0,.25); padding: 5px; border-radius: 12px; }
.tab { font: inherit; font-size: .85rem; font-weight: 500; color: var(--muted); background: none; border: 0; padding: 9px 6px; border-radius: 9px; cursor: pointer; }
.tab.active { background: var(--surface-2); color: var(--text); }

/* ---------- Avisos (toasts) ---------- */
#toasts { position: fixed; top: 16px; right: 16px; left: 16px; z-index: 100; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; pointer-events: none; }
.toast { pointer-events: auto; max-width: 420px; padding: 12px 18px; border-radius: 12px; font-weight: 500; font-size: .92rem; box-shadow: var(--shadow); animation: toast-in .25s ease; color: #fff; }
.toast.ok { background: #059669; }
.toast.error { background: #dc2626; }
.toast.info { background: #b7791f; }
.toast.out { opacity: 0; transform: translateY(-6px); transition: all .3s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ---------- Estrutura do portal ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar-w); background: var(--panel); border-right: 1px solid var(--border); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.sidebar-top { padding: 22px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.menu { flex: 1; overflow-y: auto; padding: 14px 12px; display: flex; flex-direction: column; gap: 2px; }
.menu-group { font-size: .72rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #6b7391; padding: 18px 14px 8px; }
.menu-item { font: inherit; display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 11px 14px; border-radius: 10px; border: 0; border-left: 3px solid transparent; background: none; color: #c3c9db; cursor: pointer; transition: background .2s, color .2s; }
.menu-item:hover { background: rgba(79, 195, 223, .07); color: #fff; }
.menu-item.active { background: rgba(79, 195, 223, .12); border-left-color: var(--cyan-bright); color: #fff; }
.menu-item.gold { color: var(--gold-bright); }
.menu-item.gold.active { border-left-color: var(--gold-bright); background: rgba(192, 144, 77, .12); }
.sidebar-user { padding: 16px; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 12px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--grad-cyan); display: grid; place-items: center; font-weight: 600; font-size: .9rem; flex-shrink: 0; }
.avatar-sm { width: 34px; height: 34px; font-size: .78rem; border: 0; color: #fff; cursor: pointer; font-family: inherit; }
.user-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.user-info strong { font-size: .9rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-info span { font-size: .75rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.content { padding: 36px 40px 60px; max-width: 1180px; width: 100%; animation: fade .3s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.page-head p { margin: 0; }

.grid { display: grid; gap: 18px; }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.stat { display: flex; align-items: center; gap: 16px; }
.stat-icon { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; }
.stat-icon.cyan { background: var(--grad-cyan); color: #fff; }
.stat-icon.gold { background: var(--grad-gold); color: #120c02; }
.stat-icon.green { background: rgba(52, 211, 153, .15); color: var(--success); }
.stat strong { display: block; font-size: 1.05rem; font-weight: 600; }

.quick { cursor: pointer; transition: border-color .2s, transform .2s; text-align: left; font: inherit; color: inherit; width: 100%; }
.quick:hover { border-color: rgba(79, 195, 223, .35); transform: translateY(-2px); }

.empty { text-align: center; padding: 44px 24px; }
.empty svg { width: 54px; height: 54px; color: #3d4566; margin-bottom: 14px; }

/* Lista de usuários */
.toolbar { display: flex; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.toolbar input { max-width: 340px; }
.list { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; gap: 16px; padding: 16px 18px; }
.row-main { flex: 1; min-width: 0; }
.row-main h4 { margin: 0; font-size: .98rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-main p { margin: 2px 0 0; font-size: .85rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-actions { display: flex; gap: 4px; flex-shrink: 0; }
.badge { display: inline-block; margin-top: 6px; padding: 2px 9px; border-radius: 999px; font-size: .72rem; font-weight: 600; background: rgba(154, 163, 189, .15); color: #c3c9db; }
.badge.owner { background: rgba(192, 144, 77, .18); color: var(--gold-bright); }
.badge.admin { background: rgba(79, 195, 223, .15); color: var(--cyan-bright); }

.info-list { display: grid; grid-template-columns: 140px 1fr; gap: 10px 18px; margin: 0 0 22px; }
.info-list dt { color: var(--muted); font-size: .88rem; }
.info-list dd { margin: 0; word-break: break-word; }

.notice { padding: 14px 16px; border-radius: 12px; font-size: .88rem; }
.notice.gold { background: rgba(192, 144, 77, .1); border: 1px solid rgba(192, 144, 77, .3); color: #ecc98f; }
.notice.red { background: rgba(248, 113, 113, .08); border: 1px solid rgba(248, 113, 113, .3); color: #fca5a5; }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 10, .72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; padding: 18px; }
.modal-card { width: 100%; max-width: 460px; max-height: 92vh; overflow-y: auto; background: #0a0f3d; box-shadow: var(--shadow); animation: fade .2s ease; }
.modal-card h3 { font-size: 1.2rem; margin-bottom: 18px; }
.modal-actions { display: flex; gap: 10px; margin-top: 8px; }
.modal-actions .btn { flex: 1; }

.only-mobile { display: none; }


/* ---------- Etapa 2: documentos, relatórios, linha do tempo ---------- */
.stat-icon.sm { width: 40px; height: 40px; border-radius: 10px; }
.stat-icon.sm svg { width: 18px; height: 18px; }
.stat > div:last-child { display: flex; flex-direction: column; min-width: 0; }
.activity { padding: 10px 0; border-bottom: 1px solid var(--border); }
.activity:last-child { border-bottom: 0; }

.doc-card { display: flex; flex-direction: column; gap: 16px; justify-content: space-between; }
.doc-card .btn { align-self: flex-start; }
.doc-top { display: flex; gap: 14px; align-items: flex-start; min-width: 0; }
.doc-top h4 { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.recent-card { display: flex; flex-direction: column; gap: 4px; border-left: 3px solid var(--gold); }
.recent-card h4 { margin: 0; font-size: .98rem; font-weight: 500; }
.recent-card p { margin: 0 0 8px; }

.inline-label { display: flex; flex-direction: column; gap: 6px; }
.inline-label input, .inline-label select { min-width: 220px; }
.toolbar select { max-width: 300px; }
.page-head > select { max-width: 280px; }

.timeline-stats { margin-bottom: 28px; }
.timeline-stats > div { display: flex; flex-direction: column; gap: 4px; }
.big { font-size: 2.2rem; font-weight: 700; line-height: 1.1; }
.text-gold { background: var(--grad-gold); -webkit-background-clip: text; background-clip: text; color: transparent; }
.text-cyan { color: var(--cyan-bright); }
.progress-label { display: flex; justify-content: space-between; font-size: .9rem; margin-bottom: 8px; }
.progress { height: 14px; border-radius: 999px; background: rgba(255,255,255,.08); overflow: hidden; }
.progress.sm { height: 8px; }
.progress-fill { height: 100%; border-radius: 999px; background: var(--grad-gold); transition: width .6s ease; }
.months { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.month { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; font-size: .88rem; font-weight: 500; background: rgba(255,255,255,.05); color: var(--muted); }
.month.done { background: var(--grad-gold); color: #120c02; font-weight: 600; }
.month.current { background: rgba(79, 195, 223, .12); color: var(--cyan-bright); box-shadow: inset 0 0 0 2px var(--cyan-bright); font-weight: 600; }
.timeline-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 22px; }
.timeline-head .badge { margin: 0; }

.service-card summary { list-style: none; cursor: pointer; display: flex; flex-direction: column; gap: 12px; }
.service-card summary::-webkit-details-marker { display: none; }
.service-card summary h4 { margin: 0; font-weight: 500; }
.service-card summary p { margin: 2px 0 0; font-size: .85rem; color: var(--muted); }
.service-card[open] { border-color: rgba(192, 144, 77, .35); }

.logo-preview { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 28px; margin: 14px 0 18px; display: flex; justify-content: center; }
input[type=file] { padding: 10px; cursor: pointer; }
input[type=file]::file-selector-button { font: inherit; font-size: .85rem; margin-right: 12px; border: 0; border-radius: 8px; padding: 7px 14px; background: var(--surface-2); color: var(--text); cursor: pointer; }
input[type=month]::-webkit-calendar-picker-indicator, input[type=date]::-webkit-calendar-picker-indicator { filter: invert(1); opacity: .7; cursor: pointer; }
.card.empty .btn { margin-top: 6px; }
label.btn { flex-direction: row; color: #fff; font-size: inherit; font-weight: 500; }

@media (max-width: 820px) {
  .inline-label, .inline-label input, .inline-label select, .toolbar select, .page-head > select { width: 100%; max-width: none; min-width: 0; }
  .toolbar > * { width: 100%; }
  .big { font-size: 1.7rem; }
  .timeline-stats { grid-template-columns: repeat(3, 1fr) !important; gap: 8px; }
  .month { width: 36px; height: 36px; }
  .doc-card .btn { align-self: stretch; }
  .row-main h4 { white-space: normal; }
}


/* ---------- Extensão de serviço e solicitações ---------- */
.menu-item { position: relative; }
.menu-badge { margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--grad-gold); color: #120c02; font-size: .75rem; font-weight: 700; display: inline-grid; place-items: center; }
.extend-card { margin-top: 18px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; border-color: rgba(192, 144, 77, .3); background: linear-gradient(135deg, rgba(192,144,77,.08), rgba(255,255,255,.03)); }
.extend-card h4 { margin: 0 0 2px; font-size: 1.02rem; font-weight: 600; }
.extend-card p { margin: 0; color: var(--muted); font-size: .9rem; white-space: normal; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.choice { position: relative; cursor: pointer; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span { display: block; text-align: center; padding: 14px 10px; border-radius: 12px; border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.04); font-weight: 500; color: var(--text); transition: all .2s; }
.choice:hover span { border-color: rgba(192,144,77,.5); }
.choice input:checked + span { background: rgba(192,144,77,.16); border-color: var(--gold-bright); color: var(--gold-bright); box-shadow: 0 0 0 3px rgba(192,144,77,.15); }
.choice input:focus-visible + span { outline: 2px solid var(--cyan-bright); outline-offset: 2px; }
textarea { resize: vertical; min-height: 80px; }
.status-ok { background: rgba(52, 211, 153, .15); color: var(--success); }
.btn-whatsapp { background: #25d366; color: #052e16; font-weight: 600; }
.btn-whatsapp:hover { transform: translateY(-1px); box-shadow: 0 10px 28px rgba(37, 211, 102, .3); }
.req-message { white-space: normal !important; font-style: italic; color: #cdd3e3 !important; margin: 8px 0 4px !important; }
.req-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.row-main h4 + p + .req-message { margin-top: 8px; }
@media (max-width: 820px) {
  .extend-card .btn { width: 100%; }
  .req-actions .btn { flex: 1 1 auto; }
  .card .row-main h4 { white-space: normal; }
}

/* ---------- Preferências de e-mail ---------- */
.switch-row { flex-direction: row; align-items: center; justify-content: space-between; gap: 16px; cursor: pointer; }
.switch-row > span { display: flex; flex-direction: column; gap: 2px; }
.switch-row strong { font-weight: 500; color: var(--text); }
.switch { appearance: none; -webkit-appearance: none; width: 46px; min-width: 46px; height: 26px; padding: 0; border-radius: 999px; background: rgba(255,255,255,.15); border: 0; position: relative; cursor: pointer; transition: background .2s; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch:checked { background: var(--cyan-bright); }
.switch:checked::after { transform: translateX(20px); }
.switch:focus-visible { box-shadow: 0 0 0 3px rgba(79,195,223,.3); }
.card.highlight { border-color: var(--gold-bright); box-shadow: 0 0 0 3px rgba(192,144,77,.2); }


/* ---------- Marketing: desempenho, relatórios, integrações ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.kpi { display: flex; flex-direction: column; gap: 4px; padding: 18px; }
.report-doc .kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.kpi-label { font-size: .8rem; color: var(--muted); }
.kpi strong { font-size: 1.45rem; font-weight: 700; letter-spacing: -0.01em; }
.kpi-hint { font-size: .74rem; color: #6b7391; }
.kpi-change { font-size: .78rem; font-weight: 600; }
.kpi-change.up { color: var(--success); }
.kpi-change.down { color: var(--danger); }
.kpi-change.flat { color: var(--muted); }
.chart-card { margin-bottom: 18px; }
.chart-card h3 { margin-bottom: 12px; }
.chart-box { margin: 18px 0 8px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: .88rem; min-width: 640px; }
.data-table th { text-align: left; font-weight: 500; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.data-table td { padding: 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.data-table tr:last-child td { border-bottom: 0; }

.report-builder { display: grid; grid-template-columns: minmax(300px, 380px) 1fr; gap: 18px; align-items: start; }
.report-preview { min-height: 320px; }
.report-builder > * { min-width: 0; }
.content > .card, .content > form.card, .content > details.card { margin-bottom: 18px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.report-doc h2 { font-size: 1.5rem; margin: 2px 0 4px; }
.report-doc h3 { margin: 22px 0 10px; }
.report-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.report-head p { margin: 0; }
.report-kicker { font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; color: var(--gold-bright); font-weight: 600; }
.report-comment { margin-top: 20px; border-left: 3px solid var(--gold); padding: 6px 0 6px 16px; }
.report-comment span { font-size: .78rem; color: var(--gold-bright); font-weight: 600; }
.report-comment p { margin: 6px 0 0; }
.report-foot { margin: 20px 0 0; }
.modal-card.modal-wide { max-width: 980px; }
.report-modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin: -6px -6px 8px 0; }

.account-card .grid.compact { gap: 12px; }
.field-help { font-size: .76rem; color: #6b7391; font-weight: 400; }
.secret-field { display: flex; flex-direction: column; gap: 6px; padding-top: 4px; }
.secret-status { display: flex; align-items: center; gap: 10px; }
.secret-status .badge { margin: 0; }
.copy-row { display: flex; gap: 8px; }
.copy-row input { flex: 1; font-size: .82rem; }
.sync-lines { margin: 0; padding-left: 18px; font-size: .86rem; color: #cdd3e3; }
details.card > summary { cursor: pointer; list-style: none; }
details.card > summary::-webkit-details-marker { display: none; }

#cookie-banner { position: fixed; z-index: 90; left: 16px; right: 16px; bottom: 16px; max-width: 760px; margin: 0 auto; background: #0a0f3d; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; display: flex; align-items: center; gap: 16px; animation: fade .3s ease; padding-bottom: max(16px, env(safe-area-inset-bottom)); }
#cookie-banner .cookie-text { flex: 1; display: flex; flex-direction: column; gap: 4px; font-size: .86rem; color: #cdd3e3; }
#cookie-banner .cookie-text strong { color: var(--text); font-size: .92rem; }
#cookie-banner .cookie-actions { display: flex; gap: 8px; flex-shrink: 0; }

@media (max-width: 960px) { .report-builder { grid-template-columns: 1fr; } }
@media (max-width: 820px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 14px; }
  .kpi strong { font-size: 1.15rem; }
  #cookie-banner { flex-direction: column; align-items: stretch; }
  #cookie-banner .cookie-actions .btn { flex: 1; }
  .report-head { flex-direction: column; }
}

/* Impressão / PDF do relatório: só o relatório, fundo branco */
@media print {
  body { background: #fff !important; color: #111 !important; }
  .screen, #toasts, #cookie-banner, .no-print { display: none !important; }
  .modal { position: static !important; background: none !important; backdrop-filter: none !important; padding: 0 !important; display: block !important; }
  .modal-card { max-width: none !important; max-height: none !important; overflow: visible !important; background: #fff !important; border: 0 !important; box-shadow: none !important; color: #111 !important; padding: 0 !important; }
  .report-doc, .report-doc * { color: #111 !important; }
  .report-doc .kpi, .chart-box { background: #fff !important; border-color: #ddd !important; break-inside: avoid; }
  .kpi-change.up { color: #047857 !important; } .kpi-change.down { color: #b91c1c !important; }
  .brand .name .t { color: #2b7f96 !important; } .brand .name .e { color: #a8743a !important; }
  .data-table th, .data-table td { border-color: #ddd !important; }
}

/* ---------- Celular e tablet ---------- */
@media (max-width: 960px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 820px) {
  .only-mobile { display: initial; }
  .topbar { display: flex; align-items: center; gap: 10px; padding: 12px 14px; padding-top: max(12px, env(safe-area-inset-top)); background: rgba(6, 11, 58, .9); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
  .topbar-spacer { width: 36px; }
  .topbar .brand { flex: 1; justify-content: center; }
  .sidebar { position: fixed; left: 0; top: 0; z-index: 50; transform: translateX(-100%); transition: transform .28s ease; box-shadow: var(--shadow); padding-bottom: env(safe-area-inset-bottom); }
  .app.menu-open .sidebar { transform: none; }
  .backdrop { position: fixed; inset: 0; background: rgba(0,0,10,.6); z-index: 40; opacity: 0; pointer-events: none; transition: opacity .28s; }
  .app.menu-open .backdrop { opacity: 1; pointer-events: auto; }
  .content { padding: 22px 16px 48px; }
  h1 { font-size: 1.45rem; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .row { flex-wrap: wrap; }
  .row-actions { width: 100%; justify-content: flex-end; border-top: 1px solid var(--border); padding-top: 8px; }
  .page-head .btn { width: 100%; }
  .info-list { grid-template-columns: 1fr; gap: 2px; }
  .info-list dd { margin-bottom: 10px; }
  .toolbar input { max-width: none; }
}
