:root {
  --brand: #0B63F6;
  --on-brand: #fff;
  --brand-soft: color-mix(in srgb, var(--brand) 11%, #fff);
  --ink: #0F172A;
  --ink-2: #475569;
  --ink-3: #64748B;
  --line: #E6EAF0;
  --line-2: #F1F4F8;
  --bg: #F7F9FC;
  --card: #fff;
  --green: #15803D; --green-bg: #DCFCE7;
  --blue: #1D4ED8; --blue-bg: #DBEAFE;
  --amber: #A16207; --amber-bg: #FEF3C7;
  --red: #B91C1C; --red-bg: #FEE2E2;
  --gray: #475569; --gray-bg: #E9EDF2;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 2px 8px rgba(15, 23, 42, .03);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 Inter, "Segoe UI", system-ui, -apple-system, sans-serif; }
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
svg.icon { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.mt { margin-top: 18px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Estrutura */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: 270px; flex: none; background: var(--card); border-right: 1px solid var(--line); padding: 18px 15px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar .logo { display: flex; justify-content: center; align-items: center; min-height: 100px; padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.sidebar .logo img { max-width: 170px; max-height: 96px; }
.sidebar .logo span { font-size: 20px; font-weight: 700; text-align: center; }
.nav { display: flex; flex-direction: column; gap: 3px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; color: var(--ink); border-radius: 10px; font-size: 15px; }
.nav a:hover { background: var(--line-2); text-decoration: none; }
.nav a.active { background: var(--brand); color: var(--on-brand); font-weight: 500; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 20px; height: 66px; padding: 0 28px 0 32px; background: var(--card); border-bottom: 1px solid var(--line); box-shadow: 0 1px 3px rgba(15, 23, 42, .04); }
.topbar h1 { font-size: 22px; font-weight: 700; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { background: none; border: 0; padding: 4px; color: var(--ink); cursor: pointer; display: inline-flex; border-radius: 8px; }
.icon-btn:hover { background: var(--line-2); }
.user-menu { position: relative; padding-left: 20px; border-left: 1px solid var(--line); }
.user-menu summary { list-style: none; display: flex; align-items: center; gap: 8px; cursor: pointer; }
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu .menu { position: absolute; right: 0; top: 46px; width: 230px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(15, 23, 42, .12); padding: 8px; }
.user-menu .menu a, .user-menu .menu button { display: block; width: 100%; padding: 8px 10px; background: none; border: 0; border-radius: 8px; color: var(--ink); text-align: left; font: inherit; cursor: pointer; }
.user-menu .menu a:hover, .user-menu .menu button:hover { background: var(--line-2); text-decoration: none; }
.user-menu .who { padding: 6px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; overflow: hidden; text-overflow: ellipsis; }
.content { padding: 30px 32px 40px; flex: 1; max-width: 1500px; width: 100%; }
.scrim { display: none; }
body.nav-collapsed .sidebar { display: none; }

/* Blocos */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 24px; }
.card > h2, .card-title { font-size: 19px; font-weight: 700; margin-bottom: 14px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2 { font-size: 19px; font-weight: 700; }
.welcome { margin-bottom: 22px; }
.welcome h2 { font-size: 30px; font-weight: 700; margin-bottom: 4px; }
.welcome p { margin: 0; font-size: 17px; }
.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-chart { grid-template-columns: minmax(0, 2.15fr) minmax(0, 1fr); }
.grid-side { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); align-items: start; }
.stat { display: flex; align-items: center; gap: 20px; padding: 20px; }
.stat-icon { width: 60px; height: 60px; flex: none; display: flex; align-items: center; justify-content: center; background: var(--brand-soft); color: var(--brand); border-radius: 12px; }
.stat-icon svg.icon { width: 30px; height: 30px; }
.stat-body { flex: 1; min-width: 0; }
.stat-label { font-size: 14.5px; }
.stat-value { font-size: 31px; font-weight: 700; line-height: 1.2; letter-spacing: -.02em; white-space: nowrap; }
.stat-delta { text-align: right; font-size: 13.5px; color: var(--ink-3); white-space: nowrap; }
.stat-delta b { display: block; font-size: 15px; font-weight: 600; }
.up { color: var(--green); } .down { color: var(--red); }
.grid-4 .stat { flex-wrap: wrap; gap: 14px; padding: 16px; }
.grid-4 .stat-icon { width: 48px; height: 48px; }
.grid-4 .stat-icon svg.icon { width: 24px; height: 24px; }
.grid-4 .stat-value { font-size: 24px; }
.grid-4 .stat-delta { flex-basis: 100%; text-align: left; }
.page-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filters input, .filters select { width: auto; min-width: 180px; }
.empty { text-align: center; padding: 36px 16px; color: var(--ink-3); }
.empty svg.icon { width: 34px; height: 34px; margin-bottom: 8px; }

/* Selos */
.badge { display: inline-block; padding: 3px 12px; border-radius: 8px; font-size: 13.5px; font-weight: 500; white-space: nowrap; }
.badge-green { background: var(--green-bg); color: var(--green); }
.badge-blue { background: var(--blue-bg); color: var(--blue); }
.badge-amber { background: var(--amber-bg); color: var(--amber); }
.badge-red { background: var(--red-bg); color: var(--red); }
.badge-gray { background: var(--gray-bg); color: var(--gray); }

/* Tabelas */
.table-wrap { overflow-x: auto; margin: 0 -8px; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-weight: 600; font-size: 14.5px; padding: 8px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.actions { white-space: nowrap; text-align: right; }
td.actions form { display: inline; }
.person { display: flex; align-items: center; gap: 14px; min-width: 190px; }
.person b { display: block; font-weight: 600; line-height: 1.25; }
.avatar { width: 44px; height: 44px; flex: none; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 15px; }
.avatar-0 { background: #DBEAFE; color: #1D4ED8; }
.avatar-1 { background: #EDE9FE; color: #6D28D9; }
.avatar-2 { background: #FFEDD5; color: #C2410C; }
.avatar-3 { background: #DCFCE7; color: #15803D; }
.thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; background: var(--line-2); display: block; }

/* Atividade */
.activity { list-style: none; margin: 0; padding: 0; }
.activity li { display: flex; gap: 16px; align-items: flex-start; padding: 9px 0; border-bottom: 1px solid var(--line); }
.activity li:last-child { border-bottom: 0; }
.activity .dot { width: 12px; height: 12px; margin-top: 7px; border-radius: 50%; flex: none; }
.dot-green { background: #16A34A; } .dot-blue { background: var(--brand); } .dot-amber { background: #D97706; }
.activity .text { flex: 1; min-width: 0; line-height: 1.3; }
.activity b { display: block; font-weight: 600; }
.activity time { font-size: 13px; color: var(--ink-3); white-space: nowrap; margin-top: 2px; }

/* Gráfico */
.legend { display: flex; gap: 32px; font-size: 14px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 8px; vertical-align: -1px; }
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart .tick { fill: var(--ink); font-size: 13px; }
.chart .line-primary { fill: none; stroke: var(--brand); stroke-width: 3; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.chart .line-secondary { fill: none; stroke: #94A3B8; stroke-width: 3; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.chart .marker-primary { fill: #fff; stroke: var(--brand); stroke-width: 2.5; vector-effect: non-scaling-stroke; }
.chart .marker-secondary { fill: #fff; stroke: #94A3B8; stroke-width: 2.5; vector-effect: non-scaling-stroke; }
.chart .crosshair { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 3 3; opacity: 0; pointer-events: none; }
.chart .hit { fill: transparent; }
.chart-tip { position: absolute; pointer-events: none; background: var(--ink); color: #fff; border-radius: 8px; padding: 7px 11px; font-size: 13px; line-height: 1.45; white-space: nowrap; transform: translate(-50%, -110%); opacity: 0; transition: opacity .1s; z-index: 5; }
.chart-summary { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 10px; font-size: 14px; color: var(--ink-2); }
.chart-summary b { color: var(--ink); }
details.data-table summary { cursor: pointer; font-size: 13px; color: var(--ink-3); margin-top: 8px; }

/* Formulários */
label.field { display: block; margin-bottom: 14px; }
.field-label { display: block; font-weight: 500; margin-bottom: 5px; font-size: 14.5px; }
.hint { display: block; font-size: 13px; color: var(--ink-3); margin-top: 4px; }
.field-error { display: block; font-size: 13px; color: var(--red); margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time], input[type=search], input[type=url], input[type=month], select, textarea {
  width: 100%; padding: 9px 12px; border: 1px solid #CFD6E0; border-radius: 10px; background: #fff; font: inherit; color: var(--ink);
}
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
textarea { min-height: 84px; resize: vertical; }
input[type=color] { width: 52px; height: 38px; padding: 2px; border: 1px solid #CFD6E0; border-radius: 8px; background: #fff; }
label.check { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; cursor: pointer; }
label.check input { width: 18px; height: 18px; accent-color: var(--brand); flex: none; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.form-grid .full { grid-column: 1 / -1; }
.form-section { margin-bottom: 20px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 18px; border-radius: 10px; border: 1px solid #CFD6E0; background: #fff; color: var(--ink); font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--line-2); text-decoration: none; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn-primary:hover { background: color-mix(in srgb, var(--brand) 88%, #000); }
.btn-danger { color: var(--red); border-color: #F3C2C2; }
.btn-danger:hover { background: var(--red-bg); }
.btn-sm { padding: 5px 11px; font-size: 13.5px; border-radius: 8px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.link-btn { background: none; border: 0; padding: 0; color: var(--brand); font: inherit; cursor: pointer; }
.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 18px; font-weight: 500; }
.flash-success { background: var(--green-bg); color: #14532D; }
.flash-error { background: var(--red-bg); color: #7F1D1D; }
.notice { padding: 12px 16px; border-radius: 10px; background: var(--amber-bg); color: #713F12; margin-bottom: 16px; }
.code-box { display: flex; align-items: center; gap: 8px; }
.code-box code { flex: 1; min-width: 0; background: var(--line-2); padding: 8px 10px; border-radius: 8px; font-size: 13px; overflow-x: auto; white-space: nowrap; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.totals { margin-left: auto; max-width: 300px; }
.totals div { display: flex; justify-content: space-between; padding: 4px 0; }
.totals .grand { font-size: 18px; font-weight: 700; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 8px; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding: 0 0 14px 22px; }
.timeline li::before { content: ""; position: absolute; left: 3px; top: 7px; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); }
.timeline li::after { content: ""; position: absolute; left: 7px; top: 19px; bottom: -4px; width: 2px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.hours-row { display: grid; grid-template-columns: 90px 1fr 1fr; gap: 10px; align-items: center; margin-bottom: 8px; }
.repeat-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; margin-bottom: 10px; align-items: start; }
.quote-row { display: grid; grid-template-columns: 1fr 110px auto; gap: 10px; margin-bottom: 10px; }

/* Primeiros passos */
.stepper { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 24px; }
.stepper a { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); color: var(--ink); }
.stepper a:hover { text-decoration: none; border-color: #CFD6E0; }
.stepper a.current { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.stepper .num { width: 32px; height: 32px; flex: none; border-radius: 50%; background: var(--line-2); display: flex; align-items: center; justify-content: center; font-weight: 700; }
.stepper a.done .num { background: var(--green-bg); color: var(--green); }
.stepper a.current .num { background: var(--brand); color: var(--on-brand); }
.stepper small { display: block; color: var(--ink-3); }
.setup-banner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; background: var(--brand-soft); border: 1px solid color-mix(in srgb, var(--brand) 25%, #fff); border-radius: var(--radius); padding: 16px 22px; margin-bottom: 20px; }

/* Central de atendimento */
.inbox { display: grid; grid-template-columns: 330px minmax(0, 1fr) 300px; height: calc(100vh - 66px); background: var(--card); }
.inbox-list { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.inbox-filters { padding: 14px; border-bottom: 1px solid var(--line); display: grid; gap: 8px; }
.inbox-items { overflow-y: auto; flex: 1; }
.conv { display: flex; gap: 12px; padding: 12px 14px; width: 100%; border: 0; border-bottom: 1px solid var(--line-2); background: none; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.conv:hover { background: var(--bg); }
.conv.active { background: var(--brand-soft); }
.conv-body { display: block; flex: 1; min-width: 0; }
.conv-top { display: flex; justify-content: space-between; gap: 8px; }
.conv-top b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.conv-preview { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-3); font-size: 13.5px; }
.conv-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; }
.conv-foot .badge { font-size: 12px; padding: 1px 8px; }
.unread { background: var(--brand); color: var(--on-brand); border-radius: 10px; font-size: 12px; font-weight: 600; padding: 0 7px; }
.inbox-chat { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--bg); }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 10px 18px; background: var(--card); border-bottom: 1px solid var(--line); }
.chat-head .who { flex: 1; min-width: 0; }
.chat-head b { display: block; }
.chat-back { display: none; }
.chat-messages { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 8px; }
.bubble { max-width: min(78%, 620px); padding: 8px 12px; border-radius: 12px; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--card); border: 1px solid var(--line); align-self: flex-start; }
.bubble.out { align-self: flex-end; background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 20%, #fff); }
.bubble.failed { background: var(--red-bg); border-color: #F3C2C2; }
.bubble img { display: block; max-width: 240px; border-radius: 8px; margin-bottom: 6px; }
.bubble-meta { display: block; font-size: 11.5px; color: var(--ink-3); margin-top: 3px; }
.chat-compose { display: flex; gap: 10px; padding: 12px 18px; background: var(--card); border-top: 1px solid var(--line); }
.chat-compose textarea { min-height: 42px; height: 42px; max-height: 140px; resize: none; }
.chat-notice, .chat-test-mode { padding: 8px 18px; background: var(--amber-bg); color: #713F12; font-size: 13.5px; }
.inbox-side { border-left: 1px solid var(--line); padding: 18px; overflow-y: auto; }
.inbox-side h3 { font-size: 15px; margin: 18px 0 8px; }
.inbox-side h3:first-child { margin-top: 0; }
.cart-line { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; padding: 3px 0; }
.inbox-empty { flex: 1; display: flex; align-items: center; justify-content: center; color: var(--ink-3); padding: 24px; text-align: center; }

.chat-open { display: contents; }
.chat-open[hidden], .inbox-empty[hidden], .inbox-side[hidden] { display: none; }
.inbox:not(.has-current) { grid-template-columns: 330px minmax(0, 1fr); }

/* Autenticação */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth .card { width: 100%; max-width: 410px; padding: 30px; }
.auth .logo { text-align: center; margin-bottom: 18px; }
.auth .logo img { max-width: 170px; max-height: 100px; }
.auth h1 { font-size: 22px; margin-bottom: 18px; text-align: center; }

/* Documento */
.doc { max-width: 800px; margin: 28px auto; background: #fff; padding: 40px; border: 1px solid var(--line); border-radius: 8px; }
.doc-head { display: flex; justify-content: space-between; gap: 20px; border-bottom: 3px solid var(--brand); padding-bottom: 16px; margin-bottom: 20px; }
.doc-head img { max-height: 70px; max-width: 200px; }
.doc-actions { max-width: 800px; margin: 20px auto 0; }
@media print { .doc-actions { display: none; } .doc { border: 0; margin: 0; padding: 0; max-width: none; } body { background: #fff; } }

.pagination { display: flex; gap: 8px; justify-content: flex-end; align-items: center; margin-top: 14px; }

@media (max-width: 1280px) {
  .grid-3 .stat { gap: 14px; padding: 16px; }
  .stat-icon { width: 48px; height: 48px; }
  .stat-value { font-size: 25px; }
  .inbox { grid-template-columns: 290px minmax(0, 1fr); }
  .inbox-side { display: none; }
}
@media (max-width: 1080px) {
  .grid-3, .grid-chart, .grid-side, .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .stepper { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 820px) {
  .sidebar { display: block; position: fixed; z-index: 40; left: 0; top: 0; transform: translateX(-100%); transition: transform .18s; }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(15, 23, 42, .4); z-index: 30; }
  body.nav-collapsed .sidebar { display: block; }
  .topbar { padding: 0 16px; gap: 12px; }
  .topbar h1 { font-size: 18px; }
  .user-menu { padding-left: 10px; border-left: 0; }
  .content { padding: 20px 16px 32px; }
  .welcome h2 { font-size: 24px; }
  .welcome p { font-size: 15px; }
  .card { padding: 16px; }
  .form-grid, .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .inbox, .inbox:not(.has-current) { grid-template-columns: minmax(0, 1fr); }
  .inbox.has-current .inbox-list { display: none; }
  .inbox:not(.has-current) .inbox-chat { display: none; }
  .chat-back { display: inline-flex; }
  .legend { gap: 14px; }
  .chart .tick { font-size: 24px; }
  .chart .marker-primary, .chart .marker-secondary { r: 10px; }
  .topbar:has(.range-form) h1 { display: none; }
  .range-form { flex: 1; }
  .chat-head .badge { display: none; }
  .filters input, .filters select { min-width: 0; flex: 1 1 140px; }
  .doc { padding: 20px; margin: 12px; }
}

/* ==== Visual do painel: superfícies claras, navegação agrupada, indicadores com selo ==== */
:root {
  --bg: #F6F7F9;
  --line: #E9ECF1;
  --line-2: #F2F4F7;
  --radius: 14px;
  --green-solid: #16A34A;
  --shadow: 0 1px 2px rgba(15, 23, 42, .03), 0 4px 16px rgba(15, 23, 42, .03);
}
body { font-size: 14px; }
.card { padding: 20px 22px; border-color: var(--line); }
.card > h2, .card-head h2, .card-title { font-size: 17px; font-weight: 700; margin-bottom: 2px; }
.card-sub { margin: 0 0 14px; }
.card-head { margin-bottom: 12px; align-items: flex-start; }
.card-head .card-sub { margin-bottom: 0; }
.content { padding: 24px 28px 36px; }

/* Menu lateral */
.sidebar { width: 236px; padding: 18px 12px 12px; display: flex; flex-direction: column; background: #FBFCFD; border-right-color: var(--line); }
.sidebar .logo { justify-content: flex-start; min-height: 0; padding: 0 8px 16px; margin-bottom: 8px; }
.sidebar .logo img { max-width: 160px; max-height: 56px; }
.sidebar .logo span { font-size: 17px; font-weight: 700; line-height: 1.2; text-align: left; color: var(--ink); }
.nav { gap: 1px; flex: 1; }
.nav a { gap: 11px; padding: 8px 10px; font-size: 13.5px; border-radius: 9px; color: #334155; }
.nav a svg.icon { width: 18px; height: 18px; color: #64748B; }
.nav a:hover { background: #F1F3F6; }
.nav a.active { background: var(--brand-soft); color: var(--ink); font-weight: 600; }
.nav a.active svg.icon { color: var(--brand); }
.nav-title { display: block; padding: 16px 10px 5px; font-size: 11.5px; font-weight: 500; color: #64748B; }

/* Cartão do usuário */
.user-card { position: relative; margin-top: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: var(--shadow); }
.user-card summary { list-style: none; display: flex; align-items: center; gap: 9px; padding: 8px 10px; cursor: pointer; }
.user-card summary::-webkit-details-marker { display: none; }
.user-card summary svg.icon { width: 15px; height: 15px; color: #64748B; }
.avatar-sm { width: 32px; height: 32px; font-size: 12px; background: var(--line-2); color: var(--ink); }
.user-text { flex: 1; min-width: 0; line-height: 1.25; }
.user-text b { display: block; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-text .small { display: block; font-size: 11.5px; }
.user-card .menu, .bell-menu { position: absolute; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(15, 23, 42, .12); padding: 8px; z-index: 30; }
.user-card .menu { left: 0; right: 0; bottom: calc(100% + 6px); }
.user-card .menu a, .user-card .menu button { display: block; width: 100%; padding: 8px 10px; background: none; border: 0; border-radius: 8px; color: var(--ink); text-align: left; font: inherit; cursor: pointer; }
.user-card .menu a:hover, .user-card .menu button:hover { background: var(--line-2); text-decoration: none; }
.user-card .who { padding: 4px 10px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; overflow-wrap: anywhere; }

/* Barra superior */
.topbar { height: 60px; padding: 0 28px; gap: 12px; box-shadow: none; background: var(--bg); border-bottom: 0; }
.topbar h1 { font-size: 14.5px; font-weight: 600; }
.crumb { font-weight: 500; color: #475569; margin-right: 2px; }
.range-form select { width: auto; min-width: 158px; padding: 7px 10px; border-radius: 10px; border-color: var(--line); font-size: 13px; }
.bell { position: relative; }
.bell summary { list-style: none; position: relative; display: flex; width: 36px; height: 36px; align-items: center; justify-content: center; background: #fff; border: 1px solid var(--line); border-radius: 50%; cursor: pointer; }
.bell summary::-webkit-details-marker { display: none; }
.bell summary svg.icon { width: 17px; height: 17px; }
.bell-dot { position: absolute; top: 7px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: #DC2626; border: 1.5px solid #fff; }
.bell-menu { right: 0; top: 44px; width: 340px; max-width: calc(100vw - 32px); padding: 12px 14px; }
.menu-title { display: block; margin-bottom: 4px; font-size: 14px; }
.btn-dark { background: var(--ink); border-color: var(--ink); color: #fff; padding: 7px 14px; font-size: 13px; }
.btn-dark:hover { background: var(--ink); opacity: .9; }
.btn-dark svg.icon { width: 16px; height: 16px; }

/* Boas-vindas */
.welcome { margin-bottom: 18px; }
.welcome h2 { font-size: 24px; margin-bottom: 2px; }
.welcome p { font-size: 14px; color: #475569; }

/* Indicadores */
.grid { gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-chart { grid-template-columns: minmax(0, 1.8fr) minmax(300px, 1fr); }
.stat, .grid-4 .stat { align-items: flex-start; flex-wrap: nowrap; gap: 14px; padding: 18px; }
.stat-icon, .grid-4 .stat-icon { width: 46px; height: 46px; border-radius: 12px; }
.stat-icon svg.icon, .grid-4 .stat-icon svg.icon { width: 22px; height: 22px; }
.stat-label { font-size: 13px; color: #334155; }
.stat-value, .grid-4 .stat-value { font-size: 24px; margin: 2px 0 6px; white-space: normal; overflow-wrap: anywhere; }
.stat-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; }
.chip { padding: 1px 7px; border-radius: 7px; font-weight: 600; white-space: nowrap; }
.chip-up { background: var(--green-bg); color: var(--green); }
.chip-down { background: var(--red-bg); color: var(--red); }
.tone-brand { background: var(--brand-soft); color: var(--brand); }
.tone-green { background: #E6F6EC; color: #15803D; }
.tone-blue { background: #E4EDFD; color: #1D4ED8; }
.tone-amber { background: #FEF0DC; color: #B45309; }
.tone-gray { background: #EEF1F5; color: #475569; }

/* Gráfico */
.chart .tick { fill: #64748B; font-size: 12px; }
.chart .line-primary { stroke-width: 2.5; }
.chart-dot { fill: var(--brand); stroke: #fff; stroke-width: 2; opacity: 0; pointer-events: none; }
.chart-summary { border-top: 1px solid var(--line-2); padding-top: 10px; font-size: 13px; }

/* Funil */
.funnel { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 7px; }
.funnel li { display: grid; grid-template-columns: 1fr 44px 40px; gap: 8px; align-items: center; }
.funnel-bar { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 7px 10px; border-radius: 9px; font-size: 13px; font-weight: 500; white-space: nowrap; color: var(--ink); }
.funnel-bar svg.icon { width: 15px; height: 15px; }
.funnel b { text-align: right; }
.funnel-pct { text-align: right; }
.rings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ring-card { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; min-width: 0; line-height: 1.3; }
.ring { --value: 0; --ring: var(--brand); flex: none; display: grid; place-items: center; width: 50px; height: 50px; border-radius: 50%; font-size: 12px; font-weight: 700; background: radial-gradient(closest-side, #fff 76%, transparent 78%), conic-gradient(var(--ring) calc(var(--value) * 1%), var(--line-2) 0); }

/* Listas */
th { font-size: 12.5px; color: #475569; padding: 8px 12px; background: var(--line-2); border-bottom: 0; }
th:first-child { border-radius: 8px 0 0 8px; }
th:last-child { border-radius: 0 8px 8px 0; }
td { padding: 10px 12px; font-size: 13.5px; }
td b { font-weight: 600; }
.badge { padding: 2px 10px; font-size: 12.5px; border-radius: 7px; }
.table-wrap { margin: 0; }
.order-code { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; color: var(--ink); }
.order-code svg.icon { width: 16px; height: 16px; color: #64748B; }
.link-more { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 500; color: var(--ink); white-space: nowrap; }
.link-more svg.icon { width: 15px; height: 15px; }
.top-products { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.top-products li { display: flex; align-items: center; gap: 12px; }
.top-products .thumb { width: 38px; height: 38px; flex: none; }
.thumb-icon { display: flex; align-items: center; justify-content: center; color: #64748B; }
.thumb-icon svg.icon { width: 18px; height: 18px; }
.top-body { flex: 1; min-width: 0; }
.top-line { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 5px; }
.top-line b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meter { display: block; height: 7px; border-radius: 6px; background: var(--line-2); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 6px; background: var(--brand); }

/* Atividade dentro do sino */
.bell-menu .activity { max-height: 340px; overflow-y: auto; }
.bell-menu .activity li { gap: 10px; padding: 8px 0; }
.bell-menu .activity .dot { width: 9px; height: 9px; margin-top: 6px; }
.bell-menu .activity b { font-size: 13px; }
.bell-menu .activity time { font-size: 12px; }
.bell-menu .activity .small { display: block; }

/* Central de atendimento na altura da barra nova */
.inbox { height: calc(100vh - 60px); border-top: 1px solid var(--line); }
.inbox:not(.has-current) { grid-template-columns: 300px minmax(0, 1fr); }
.inbox.has-current { grid-template-columns: 300px minmax(0, 1fr) 280px; }

@media (max-width: 1280px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inbox.has-current { grid-template-columns: 280px minmax(0, 1fr); }
}
@media (max-width: 1080px) {
  .grid-chart { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 820px) {
  .sidebar { display: flex; }
  body.nav-collapsed .sidebar { display: flex; }
  .topbar { padding: 0 16px; gap: 8px; }
  .topbar:has(.range-form) h1 { display: none; }
  .range-form select { min-width: 0; width: 100%; }
  .btn-label { display: none; }
  .btn-dark { padding: 8px 10px; }
  .content { padding: 14px 16px 28px; }
  .inbox, .inbox.has-current, .inbox:not(.has-current) { grid-template-columns: minmax(0, 1fr); }
  .chart .tick { font-size: 24px; }
}
@media (max-width: 520px) {
  .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .rings { grid-template-columns: minmax(0, 1fr); }
}

/* A largura geral dos campos não pode empurrar os filtros para outra linha */
.filters input[type=search], .filters input[type=text], .filters input[type=month] { width: 260px; max-width: 100%; }
.filters select { width: auto; }
@media (max-width: 820px) {
  .filters input[type=search], .filters input[type=text] { width: auto; }
}

/* Paleta sem verde: o azul forte indica sucesso e o azul-claro indica andamento */
:root {
  --green: #1D4ED8;
  --green-bg: #DBEAFE;
  --green-solid: #0B63F6;
  --blue: #0369A1;
  --blue-bg: #E0F2FE;
}
.tone-green { background: #E4EDFD; color: #1D4ED8; }
.tone-blue { background: #E0F2FE; color: #0369A1; }
.dot-green { background: #0B63F6; }
.dot-blue { background: #38BDF8; }
.avatar-3 { background: #E0F2FE; color: #0369A1; }
.flash-success { color: #1E3A8A; }

/* Atalho para a empresa enviar o logo */
.logo-add { display: block; margin: -10px 8px 12px; font-size: 12.5px; font-weight: 500; }

/* Planos, consumo e assinatura */
.legend-item { display: inline-flex; align-items: center; gap: 7px; color: var(--ink-2); font-size: 13px; }
.legend-swatch { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.chart .legend { margin-bottom: 8px; gap: 18px; }

.meter { display: grid; gap: 6px; }
.meter + .meter { margin-top: 16px; }
.meter-head, .meter-foot { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.meter-label { font-weight: 600; }
.meter-foot { color: var(--ink-2); }
.meter-track { height: 10px; border-radius: 999px; background: var(--line-2); overflow: hidden; }
.meter-fill { display: block; height: 100%; border-radius: 999px; }
.meter-brand { background: var(--brand); }
.meter-amber { background: #D97706; }
.meter-red { background: #DC2626; }
.meter-state { font-size: 12px; font-weight: 600; }
.meter-state-brand { color: var(--ink-3); }
.meter-state-amber { color: var(--amber); }
.meter-state-red { color: var(--red); }

.bar-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.bar-list li { display: grid; grid-template-columns: minmax(90px, 34%) 1fr auto; gap: 10px; align-items: center; font-size: 13px; }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 10px; background: var(--line-2); border-radius: 999px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--brand); border-radius: 0 4px 4px 0; }
.bar-value { font-variant-numeric: tabular-nums; color: var(--ink-2); white-space: nowrap; }

.notice { display: flex; gap: 14px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; border-radius: var(--radius); padding: 14px 18px; margin-bottom: 18px; border: 1px solid var(--line); background: var(--card); }
.notice b { display: block; margin-bottom: 2px; }
.notice p { margin: 0; color: var(--ink-2); }
.notice-info { border-color: color-mix(in srgb, var(--brand) 25%, #fff); background: var(--brand-soft); }
.notice-warning { border-color: #FCD34D; background: var(--amber-bg); }
.notice-danger { border-color: #FCA5A5; background: var(--red-bg); }

.cycle-toggle { display: inline-flex; padding: 4px; border-radius: 999px; background: var(--line-2); border: 1px solid var(--line); gap: 4px; }
.cycle-toggle a { padding: 7px 18px; border-radius: 999px; color: var(--ink-2); font-weight: 600; font-size: 13.5px; }
.cycle-toggle a.active { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.cycle-save { margin-left: 8px; font-size: 12px; color: var(--green); font-weight: 600; }

.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; align-items: stretch; margin: 22px auto 0; max-width: 1120px; }
.plan-card { position: relative; display: flex; flex-direction: column; gap: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 26px 22px 22px; box-shadow: var(--shadow); }
.plan-card.recommended { border: 2px solid var(--brand); box-shadow: 0 10px 30px color-mix(in srgb, var(--brand) 16%, transparent); background: linear-gradient(180deg, var(--brand-soft), var(--card) 42%); }
.plan-card.current { outline: 2px dashed var(--line); outline-offset: 4px; }
.plan-ribbon { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--brand); color: var(--on-brand); font-size: 11.5px; font-weight: 700; letter-spacing: .06em; padding: 4px 12px; border-radius: 999px; white-space: nowrap; }
.plan-name { font-size: 18px; font-weight: 700; }
.plan-desc { color: var(--ink-3); font-size: 13px; min-height: 38px; margin: 0; }
.plan-price { display: flex; align-items: baseline; gap: 4px; }
.plan-price b { font-size: 30px; letter-spacing: -.02em; }
.plan-price span { color: var(--ink-3); }
.plan-sub { font-size: 12.5px; color: var(--ink-3); min-height: 18px; }
.plan-limits { display: grid; gap: 6px; padding: 12px 14px; background: var(--line-2); border-radius: 12px; font-size: 13px; }
.plan-limits div { display: flex; justify-content: space-between; gap: 8px; }
.plan-limits b { font-variant-numeric: tabular-nums; }
.plan-features { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; font-size: 13px; flex: 1; }
.plan-features li { padding-left: 22px; position: relative; }
.plan-features li::before { content: ""; position: absolute; left: 2px; top: 5px; width: 10px; height: 6px; border-left: 2px solid var(--green); border-bottom: 2px solid var(--green); transform: rotate(-45deg); }
.plan-card .btn { width: 100%; justify-content: center; }
.summary-total { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px solid var(--line); padding-top: 14px; margin-top: 14px; font-size: 15px; }
.summary-total b { font-size: 24px; }
.pix-box { display: grid; grid-template-columns: 220px 1fr; gap: 22px; align-items: start; }
.pix-box img { width: 220px; height: 220px; border: 1px solid var(--line); border-radius: 12px; }
.pix-code { width: 100%; font-family: ui-monospace, monospace; font-size: 12px; word-break: break-all; }
.negative { color: var(--red); font-weight: 600; }
.positive { color: var(--green); font-weight: 600; }
tr.row-alert td { background: var(--red-bg); }
.sim-note { font-size: 12.5px; color: var(--ink-3); margin: 10px 0 0; }

@media (max-width: 640px) {
  .plan-grid { grid-template-columns: minmax(0, 1fr); }
  .pix-box { grid-template-columns: minmax(0, 1fr); }
  .pix-box img { margin: 0 auto; }
  .bar-list li { grid-template-columns: minmax(0, 1fr) auto; }
  .bar-list .bar-track { grid-column: 1 / -1; grid-row: 2; }
}
.plan-quota { display: grid; gap: 2px; padding: 12px 14px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--brand) 22%, #fff); background: var(--brand-soft); }
.plan-quota b { font-size: 24px; letter-spacing: -.01em; font-variant-numeric: tabular-nums; color: var(--ink); }
.plan-quota span { font-size: 12.5px; color: var(--ink-2); }

/* ==== Visual DA Code: menu escuro com brilho, cartões arredondados e indicadores em destaque ==== */
:root {
  --bg: #F2F5FB;
  --line: #E3E9F3;
  --line-2: #F1F4FA;
  --radius: 18px;
  --navy: #051634;
  --navy-2: #0A2A66;
  --side-ink: #C9D5EC;
  --side-muted: #7F93BA;
  --violet: #7C3AED;
  --topbar-h: 92px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(15, 40, 90, .06);
  --glow: 0 8px 24px color-mix(in srgb, var(--brand) 38%, transparent);
}
body { background: radial-gradient(1200px 600px at 100% -10%, color-mix(in srgb, var(--brand) 7%, transparent), transparent 70%), var(--bg); background-attachment: fixed; }
.card { border-radius: var(--radius); border-color: var(--line); box-shadow: var(--shadow); }

/* Menu lateral escuro */
.sidebar { width: 252px; padding: 22px 14px 14px; color: var(--side-ink); border-right: 0;
  background: radial-gradient(260px 220px at 0% 100%, rgba(37, 99, 235, .35), transparent 70%), radial-gradient(200px 160px at 100% 0%, rgba(59, 130, 246, .18), transparent 70%), linear-gradient(180deg, var(--navy-2) 0%, var(--navy) 38%, #030D22 100%);
  scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .15) transparent; }
.sidebar .logo { justify-content: center; padding: 8px 8px 18px; margin-bottom: 6px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.sidebar .logo img { max-width: 150px; max-height: 70px; }
.sidebar .logo span { color: #fff; text-align: center; }
.sidebar .logo-plate img { background: #fff; padding: 6px 10px; border-radius: 12px; }
.logo-add { color: #93C5FD; margin: 2px 8px 12px; text-align: center; }
.nav { gap: 3px; }
.nav a { color: var(--side-ink); padding: 10px 12px; font-size: 14px; border-radius: 12px; border: 1px solid transparent; transition: background .15s, color .15s; }
.nav a svg.icon { width: 19px; height: 19px; color: var(--side-muted); }
.nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav a:hover svg.icon { color: #fff; }
.nav a.active { color: var(--on-brand); font-weight: 600; border-color: color-mix(in srgb, var(--brand) 55%, #93C5FD);
  background: linear-gradient(90deg, var(--brand), color-mix(in srgb, var(--brand) 70%, #38BDF8)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent), var(--glow); }
.nav a.active svg.icon { color: var(--on-brand); }
.nav-title { color: var(--side-muted); text-transform: uppercase; letter-spacing: .08em; font-size: 11px; font-weight: 600; padding: 18px 12px 6px; margin-top: 8px; border-top: 1px solid rgba(255, 255, 255, .08); }
.side-card { position: relative; overflow: hidden; display: grid; justify-items: center; gap: 4px; text-align: center; margin-top: 18px; padding: 18px 14px; border-radius: 16px; border: 1px solid rgba(147, 197, 253, .18);
  background: radial-gradient(160px 90px at 50% 120%, rgba(59, 130, 246, .45), transparent 70%), rgba(255, 255, 255, .04); }
.side-card svg.icon { width: 30px; height: 30px; color: #60A5FA; filter: drop-shadow(0 0 8px rgba(96, 165, 250, .7)); }
.side-card b { color: #fff; font-size: 15px; }
.side-card span { font-size: 12px; line-height: 1.4; color: var(--side-ink); }

/* Barra superior com título da página */
.topbar { height: var(--topbar-h); padding: 0 28px; gap: 16px; background: transparent; border: 0; box-shadow: none; position: static; }
.page-head { flex: 1; min-width: 0; line-height: 1.2; }
.greet { display: block; font-size: 14px; color: var(--ink-2); margin-bottom: 2px; }
.topbar h1 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; color: var(--ink); }
.topbar h1 .crumb { font-size: 15px; font-weight: 500; color: var(--ink-3); }
.page-sub { margin: 4px 0 0; font-size: 14px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.topbar-actions:empty { display: none; }
.nav-toggle { width: 40px; height: 40px; align-items: center; justify-content: center; border-radius: 12px; background: var(--card); border: 1px solid var(--line); }
.bell summary { width: 42px; height: 42px; border-color: var(--line); box-shadow: var(--shadow); }
.range-form select { height: 42px; border-radius: 12px; }
.user-chip { position: relative; padding-left: 16px; border-left: 1px solid var(--line); }
.user-chip summary { list-style: none; display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 4px; border-radius: 14px; }
.user-chip summary::-webkit-details-marker { display: none; }
.user-chip summary:hover { background: rgba(255, 255, 255, .7); }
.user-chip .avatar-sm { width: 42px; height: 42px; font-size: 14px; color: #fff; background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 60%, #1E1B4B)); box-shadow: var(--glow); }
.user-chip .user-text { line-height: 1.25; max-width: 180px; }
.user-chip .user-text b { display: block; font-size: 14px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip .user-text .small { display: block; font-size: 12.5px; }
.user-chip summary > svg.icon { width: 16px; height: 16px; color: var(--ink-3); }
.user-chip .menu { position: absolute; right: 0; top: calc(100% + 8px); width: 240px; z-index: 30; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 16px 40px rgba(15, 23, 42, .14); padding: 8px; }
.user-chip .menu a, .user-chip .menu button { display: block; width: 100%; padding: 9px 10px; background: none; border: 0; border-radius: 9px; color: var(--ink); text-align: left; font: inherit; cursor: pointer; }
.user-chip .menu a:hover, .user-chip .menu button:hover { background: var(--line-2); text-decoration: none; }
.user-chip .who { padding: 4px 10px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; overflow-wrap: anywhere; }
.content { padding: 4px 28px 36px; }
.inbox { height: calc(100vh - var(--topbar-h)); border-top: 1px solid var(--line); }

/* Indicadores */
.stat, .grid-4 .stat { align-items: center; gap: 16px; padding: 20px; height: 100%; position: relative; overflow: hidden; }
.stat-icon, .grid-4 .stat-icon { width: 56px; height: 56px; border-radius: 16px; }
.stat-icon svg.icon, .grid-4 .stat-icon svg.icon { width: 26px; height: 26px; }
.stat-label { font-size: 14px; font-weight: 500; color: var(--ink); }
.stat-value, .grid-4 .stat-value { font-size: 28px; font-weight: 800; letter-spacing: -.02em; margin: 2px 0 4px; }
.stat-foot { font-size: 12.5px; }
.tone-brand { background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 16%, #fff), color-mix(in srgb, var(--brand) 6%, #fff)); color: var(--brand); }
.tone-amber { background: linear-gradient(135deg, #FFEBD2, #FFF6EA); color: #EA7A0C; }
.tone-red { background: linear-gradient(135deg, #FFE1E1, #FFF2F2); color: #DC2626; }
.tone-violet { background: linear-gradient(135deg, #EDE4FF, #F6F1FF); color: var(--violet); }
.stat-highlight { color: #fff; border-color: transparent;
  background: radial-gradient(240px 140px at 100% 100%, rgba(56, 189, 248, .45), transparent 70%), linear-gradient(135deg, color-mix(in srgb, var(--brand) 80%, #0B1530), color-mix(in srgb, var(--brand) 40%, #020617));
  box-shadow: 0 14px 32px color-mix(in srgb, var(--brand) 32%, transparent); }
.stat-highlight .stat-icon { background: rgba(255, 255, 255, .14); color: #fff; border: 1px solid rgba(255, 255, 255, .22); }
.stat-highlight .stat-label, .stat-highlight .stat-value { color: #fff; }
.stat-highlight .muted, .stat-highlight .stat-foot { color: rgba(255, 255, 255, .8); }
.stat-highlight .chip-up { background: rgba(255, 255, 255, .18); color: #fff; }

/* Grade do dashboard geral */
.dash-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 18px; align-items: stretch; }
.span-3 { grid-column: span 3; } .span-4 { grid-column: span 4; } .span-5 { grid-column: span 5; } .span-6 { grid-column: span 6; } .span-12 { grid-column: span 12; }
.dash-grid > .card { min-width: 0; }
.card-head h2.with-icon { display: flex; align-items: center; gap: 10px; font-size: 17px; }
.card-head h2.with-icon svg.icon { width: 21px; height: 21px; color: var(--brand); }
.link-more { color: var(--brand); font-weight: 600; }

/* Minigráficos */
.mini-chart + .mini-chart { margin-top: 6px; padding-top: 8px; border-top: 1px dashed var(--line); }
.mini-chart-title { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.swatch-brand { background: var(--brand); }
.swatch-violet { background: var(--violet); }
.chart-line .area-stop { stop-color: var(--brand); }
.chart-line .marker-primary { stroke: var(--card); stroke-width: 2; fill: var(--brand); }
.tone-line-violet .line-primary { stroke: var(--violet); }
.tone-line-violet .area-stop { stop-color: var(--violet); }
.tone-line-violet .marker-primary, .tone-line-violet .chart-dot { fill: var(--violet); }
.chart .grid-line { stroke: var(--line-2); }

/* Uso da plataforma */
.usage { display: flex; align-items: center; gap: 22px; }
.donut { --value: 0; flex: none; width: 150px; height: 150px; border-radius: 50%; display: grid; place-content: center; text-align: center;
  background: radial-gradient(closest-side, var(--card) 74%, transparent 75%), conic-gradient(var(--brand) 0, color-mix(in srgb, var(--brand) 55%, #38BDF8) calc(var(--value) * 1%), var(--line-2) 0);
  filter: drop-shadow(0 6px 14px color-mix(in srgb, var(--brand) 22%, transparent)); }
.donut b { font-size: 30px; font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.donut span { font-size: 12px; color: var(--ink-2); margin-top: 4px; }
.usage-list { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 0; display: grid; }
.usage-list li { display: flex; align-items: center; gap: 10px; padding: 10px 0; font-size: 13.5px; color: var(--ink-2); border-bottom: 1px solid var(--line-2); }
.usage-list li:last-child { border-bottom: 0; }
.usage-list svg.icon { width: 19px; height: 19px; color: var(--ink-3); }
.usage-list b { margin-left: auto; color: var(--ink); font-size: 15px; font-variant-numeric: tabular-nums; }
.usage-note { margin: 12px 0 0; }

/* Status dos serviços: o ícone e o texto acompanham a cor */
.services { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.service { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; font-size: 13.5px; background: var(--line-2); }
.service svg.icon { width: 22px; height: 22px; flex: none; }
.service b { font-weight: 600; }
.service span { margin-left: auto; font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }
.service-ok { background: color-mix(in srgb, var(--green) 7%, #fff); }
.service-ok svg.icon { color: var(--green-solid); }
.service-warn { background: var(--amber-bg); }
.service-warn svg.icon { color: #D97706; }
.service-down { background: var(--red-bg); }
.service-down svg.icon { color: #DC2626; }

/* Listas e vazios */
th { background: #EEF2F8; color: var(--ink-2); font-size: 12.5px; padding: 10px 14px; }
td { padding: 12px 14px; }
.empty-ok { display: grid; justify-items: center; gap: 4px; }
.empty-ok svg.icon, .empty svg.icon { width: 38px; height: 38px; color: var(--brand); margin-bottom: 4px; }
.empty-ok b { color: var(--ink); }

/* Faixa de chamada */
.promo { position: relative; overflow: hidden; display: flex; align-items: center; gap: 24px; padding: 22px 28px; border-radius: var(--radius); color: #fff;
  background: radial-gradient(420px 160px at 0% 100%, rgba(37, 99, 235, .55), transparent 70%), radial-gradient(300px 120px at 100% 0%, rgba(56, 189, 248, .25), transparent 70%), linear-gradient(90deg, #06173A, #0A2A66 55%, #061A44);
  box-shadow: 0 14px 32px rgba(6, 23, 58, .25); }
.promo-chip { flex: none; width: 64px; height: 64px; display: grid; place-items: center; border-radius: 16px; font-weight: 800; font-size: 22px; letter-spacing: .02em;
  background: linear-gradient(135deg, #0E3A8C, #061A44); border: 1px solid rgba(147, 197, 253, .5); box-shadow: 0 0 22px rgba(59, 130, 246, .65), inset 0 0 12px rgba(96, 165, 250, .35); transform: rotate(-8deg); }
.promo-text { flex: 1; min-width: 220px; display: grid; gap: 2px; }
.promo-text b { font-size: 18px; }
.promo-text span { color: rgba(255, 255, 255, .78); font-size: 13.5px; }
.promo-points { list-style: none; margin: 0; padding: 0 0 0 24px; display: flex; gap: 26px; border-left: 1px solid rgba(255, 255, 255, .14); }
.promo-points li { display: flex; align-items: center; gap: 8px; font-size: 13.5px; white-space: nowrap; }
.promo-points svg.icon { color: #60A5FA; }
.btn-ghost-light { background: transparent; border: 1px solid rgba(147, 197, 253, .7); color: #fff; border-radius: 12px; padding: 10px 20px; font-weight: 600; }
.btn-ghost-light:hover { background: rgba(255, 255, 255, .08); }
.btn-ghost-light svg.icon { width: 17px; height: 17px; }

/* Botões e campos */
.btn { border-radius: 12px; border-color: var(--line); }
.btn-primary { border: 0; background: linear-gradient(180deg, color-mix(in srgb, var(--brand) 88%, #fff), var(--brand) 55%, color-mix(in srgb, var(--brand) 80%, #000)); box-shadow: 0 6px 16px color-mix(in srgb, var(--brand) 30%, transparent); }
.btn-primary:hover { background: var(--brand); filter: brightness(1.06); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time], input[type=search], input[type=url], input[type=month], select, textarea { border-color: #D6DEEA; border-radius: 12px; }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 16%, transparent); }

/* Login dividido */
.login-page { background: #EEF3FC; }
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 38fr) minmax(0, 62fr); }
.login-hero { position: relative; overflow: hidden; color: #fff; padding: 56px 9% 40px; display: flex; flex-direction: column; clip-path: ellipse(100% 92% at 0% 50%);
  background: radial-gradient(420px 300px at 30% 95%, rgba(37, 99, 235, .6), transparent 70%), radial-gradient(500px 260px at 100% 20%, rgba(59, 130, 246, .3), transparent 70%), linear-gradient(160deg, #0A2A66, #051634 45%, #020A1C); }
.login-hero-inner { position: relative; z-index: 1; }
.login-hero-logo { max-width: 170px; max-height: 100px; margin-bottom: 36px; }
.login-hero-logo.logo-plate { background: #fff; padding: 8px 12px; border-radius: 14px; }
.login-hero h1 { font-size: clamp(28px, 2.6vw, 40px); font-weight: 800; line-height: 1.12; letter-spacing: -.02em; max-width: 440px; }
.login-hero h1 span { background: linear-gradient(90deg, #60A5FA, #38BDF8); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login-hero p { color: rgba(255, 255, 255, .8); font-size: 16px; max-width: 420px; margin: 14px 0 26px; }
.login-features { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.login-features li { display: flex; align-items: center; gap: 14px; font-size: 15px; }
.login-features span { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 50%; border: 1px solid rgba(147, 197, 253, .35); background: rgba(255, 255, 255, .05); box-shadow: inset 0 0 12px rgba(59, 130, 246, .3); }
.login-features svg.icon { color: #93C5FD; }
.login-chip { margin: auto 0 0 4%; width: 230px; height: 230px; flex: none; display: grid; place-items: center; border-radius: 34px; border: 2px solid rgba(96, 165, 250, .8);
  background: linear-gradient(135deg, #0E2F70, #04122E); box-shadow: 0 0 40px rgba(59, 130, 246, .65), 0 0 0 10px rgba(30, 64, 175, .25), inset 0 0 30px rgba(59, 130, 246, .35);
  transform: perspective(700px) rotateX(48deg) rotateZ(-32deg); }
.login-chip img { width: 70%; filter: drop-shadow(0 0 8px rgba(96, 165, 250, .8)); }
.login-side { display: flex; align-items: center; justify-content: center; padding: 40px 24px;
  background: radial-gradient(600px 300px at 100% 100%, rgba(147, 197, 253, .35), transparent 70%), radial-gradient(500px 260px at 30% 0%, rgba(191, 219, 254, .45), transparent 70%); }
.login-card { width: 100%; max-width: 520px; padding: 44px 52px; text-align: center; background: rgba(255, 255, 255, .92); border: 1px solid #fff; border-radius: 28px; box-shadow: 0 30px 70px rgba(15, 40, 90, .12); backdrop-filter: blur(8px); }
.login-logo { max-width: 180px; max-height: 110px; margin-bottom: 8px; }
.login-card h2 { font-size: 30px; font-weight: 800; letter-spacing: -.02em; color: #0B1B45; }
.login-sub { margin: 6px 0 26px; color: var(--ink-2); }
.login-card form { text-align: left; }
.input-icon { position: relative; display: block; margin-bottom: 14px; }
.input-icon > svg.icon { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--ink-3); pointer-events: none; }
.input-icon input { height: 54px; padding: 0 50px 0 52px; font-size: 15px; border-radius: 14px; }
.input-icon .eye { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 10px; background: none; color: var(--ink-3); cursor: pointer; }
.input-icon .eye:hover, .input-icon .eye[aria-pressed=true] { color: var(--brand); background: var(--line-2); }
.input-icon + .field-error { margin: -8px 0 12px; }
.login-remember { margin: 4px 0 20px; }
.btn-lg { width: 100%; height: 54px; font-size: 17px; font-weight: 700; border-radius: 14px; }
.btn-lg svg.icon { width: 22px; height: 22px; }

@media (max-width: 1280px) {
  .span-3 { grid-column: span 6; }
  .span-5 { grid-column: span 12; }
  .span-4 { grid-column: span 6; }
  .promo-points { display: none; }
}
@media (max-width: 1080px) {
  .login { grid-template-columns: minmax(0, 1fr); }
  .login-hero { clip-path: none; padding: 32px 24px; }
  .login-hero-logo { margin-bottom: 18px; }
  .login-chip { display: none; }
}
@media (max-width: 820px) {
  :root { --topbar-h: 70px; }
  .topbar { padding: 0 16px; gap: 10px; }
  .topbar h1 { font-size: 20px; }
  .greet, .page-sub, .user-chip .user-text, .user-chip summary > svg.icon { display: none; }
  .user-chip { padding-left: 0; border-left: 0; }
  .user-chip .avatar-sm { width: 38px; height: 38px; }
  .content { padding: 4px 16px 28px; }
  .span-3, .span-4, .span-6 { grid-column: span 12; }
  .usage { flex-direction: column; align-items: stretch; }
  .donut { margin: 0 auto; }
  .promo { flex-wrap: wrap; padding: 20px; }
  .login-card { padding: 30px 20px; border-radius: 22px; }
  .login-hero ul { display: none; }
  .login-hero p { margin-bottom: 0; }
}
