@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700&display=swap');

:root {
  --bg: #f5f7fb;
  --bg-soft: #eef2f7;
  --bg-grad-end: #edf2f7;
  --card: #ffffff;
  --line: #e2e8f0;
  --text: #0f172a;
  --text-2: #475569;
  --accent-a: #1d4ed8;
  --accent-b: #0ea5e9;
  --ok: #16a34a;
  --warn: #f59e0b;
  --bad: #dc2626;
  --sidebar-bg: #f8fafc;
  --surface-soft: #eef2f7;
  --topbar-bg: rgba(245, 247, 251, 0.9);
  --btn-bg: #f1f5f9;
  --input-bg: #ffffff;
  --panel-bg: #f8fafc;
  --modal-backdrop: rgba(15, 23, 42, 0.4);
}

html[data-theme="dark"] {
  --bg: #08111e;
  --bg-soft: #0f1a2a;
  --bg-grad-end: #0a1420;
  --card: #101b2b;
  --line: #223146;
  --text: #e6edf6;
  --text-2: #9cafc8;
  --accent-a: #3b82f6;
  --accent-b: #38bdf8;
  --ok: #22c55e;
  --warn: #fbbf24;
  --bad: #f87171;
  --sidebar-bg: #0b1625;
  --surface-soft: #162437;
  --topbar-bg: rgba(8, 17, 30, 0.92);
  --btn-bg: #162437;
  --input-bg: #0b1625;
  --panel-bg: #0b1625;
  --modal-backdrop: rgba(2, 6, 23, 0.72);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Manrope', 'Segoe UI', sans-serif;
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-grad-end) 100%);
  color: var(--text);
  font-size: 15px;
}

a { color: inherit; text-decoration: none; }

.container {
  width: min(1100px, 92vw);
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--topbar-bg);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand img { height: 54px; width: auto; }

.btn {
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px 16px;
  color: var(--text);
  background: var(--btn-bg);
  cursor: pointer;
  font-weight: 600;
  transition: 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:focus-visible,
.input:focus-visible,
.select:focus-visible,
.textarea:focus-visible {
  outline: 2px solid rgba(29, 78, 216, 0.25);
  outline-offset: 2px;
}
.btn-primary {
  background: var(--accent-a);
  color: #fff;
}
.btn-ghost {
  background: transparent;
  border-color: var(--line);
}
.btn[disabled] { opacity: 0.55; cursor: not-allowed; transform: none; }

.grid { display: grid; gap: 16px; }
.cards-4 { grid-template-columns: repeat(4, 1fr); }
.cards-3 { grid-template-columns: repeat(3, 1fr); }
.cards-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.04);
}
.card.client-card {
  padding: 18px;
}
html[data-theme="dark"] .card {
  box-shadow: 0 10px 24px rgba(2, 6, 23, 0.28);
}
.card-title { color: var(--text-2); font-size: 13px; margin-bottom: 8px; }
.card-value { font-size: 22px; font-weight: 700; }
.card-sub { color: var(--text-2); font-size: 13px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  border: 1px solid;
  padding: 4px 10px;
  font-size: 12px;
}
.badge.ok { color: #166534; background: #dcfce7; border-color: #bbf7d0; }
html[data-theme="dark"] .badge.ok { color: #86efac; background: rgba(22, 101, 52, 0.2); border-color: rgba(34, 197, 94, 0.45); }
.badge.warn { color: #92400e; background: #fef3c7; border-color: #fde68a; }
html[data-theme="dark"] .badge.warn { color: #fde68a; background: rgba(146, 64, 14, 0.2); border-color: rgba(251, 191, 36, 0.45); }
.badge.bad { color: #991b1b; background: #fee2e2; border-color: #fecaca; }
html[data-theme="dark"] .badge.bad { color: #fca5a5; background: rgba(127, 29, 29, 0.22); border-color: rgba(248, 113, 113, 0.45); }

.section-title { font-size: 32px; line-height: 1.15; margin: 0 0 10px; }
.section-sub { color: var(--text-2); font-size: 16px; line-height: 1.6; margin: 0; }

.input, .select, .textarea {
  width: 100%;
  background: var(--input-bg);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}
.textarea { min-height: 100px; resize: vertical; }
.label { color: var(--text-2); font-size: 13px; margin-bottom: 6px; display: block; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.table { width: 100%; border-collapse: collapse; min-width: 980px; }
.table th, .table td { padding: 12px; border-bottom: 1px solid var(--line); text-align: left; }
.table th { color: var(--text-2); font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }

.kpi-progress {
  height: 8px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
}
.kpi-progress > span {
  display: block;
  height: 100%;
  background: linear-gradient(120deg, var(--accent-a), var(--accent-b));
}

.layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
}
.sidebar {
  border-right: 1px solid var(--line);
  background: var(--sidebar-bg);
  padding: 18px;
}
.nav {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}
.nav a {
  color: var(--text-2);
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px 12px;
}
.nav a.active,
.nav a:hover {
  color: var(--text);
  border-color: var(--line);
  background: var(--surface-soft);
}

.main {
  padding: 18px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.main-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.search {
  width: 320px;
  max-width: 100%;
}
.search-compact {
  width: 220px;
  max-width: 100%;
}

.filters-panel {
  display: grid;
  gap: 14px;
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-bg);
}
.filters-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr auto;
  gap: 16px;
  align-items: center;
}
.filters-row .input,
.filters-row .select {
  padding: 6px 10px;
  font-size: 12.5px;
  border-radius: 10px;
  height: 34px;
}
.filters-row .btn {
  padding: 6px 12px;
  font-size: 12.5px;
  height: 34px;
}
.filters-advanced {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 8px;
}
.filters-advanced .select {
  padding: 6px 10px;
  font-size: 12.5px;
  border-radius: 10px;
  height: 36px;
}
.filters-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: flex-end;
  margin-top: 0;
}
.filters-toggle {
  font-size: 12.5px;
  color: var(--text-2);
  cursor: pointer;
}

@media (max-width: 980px) {
  .filters-row {
    grid-template-columns: 1fr 1fr;
  }
  .filters-advanced {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 640px) {
  .filters-row {
    grid-template-columns: 1fr;
  }
  .filters-advanced {
    grid-template-columns: 1fr;
  }
  .filters-actions .btn {
    width: 100%;
  }
}

.state {
  border: 1px solid var(--line);
  color: var(--text-2);
  border-radius: 12px;
  padding: 18px;
  text-align: center;
  background: var(--panel-bg);
}
.state.error { border-color: #fecaca; color: #b91c1c; background: #fef2f2; }
.state.success { border-color: #bbf7d0; color: #166534; background: #f0fdf4; }
html[data-theme="dark"] .state.error { border-color: #7f1d1d; color: #fca5a5; background: rgba(127, 29, 29, 0.2); }
html[data-theme="dark"] .state.success { border-color: #166534; color: #86efac; background: rgba(22, 101, 52, 0.18); }

.skeleton {
  border-radius: 10px;
  background: linear-gradient(90deg, var(--line) 25%, var(--surface-soft) 50%, var(--line) 75%);
  background-size: 220% 100%;
  animation: pulse 1.2s infinite linear;
}
@keyframes pulse {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: var(--modal-backdrop);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 50;
}
.modal-backdrop.open { display: flex; }
.modal {
  width: min(560px, 96vw);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
}

.drawer-toggle { display: none; }

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 0;
}
.auth-card {
  width: min(560px, 92vw);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.section-title-sm {
  margin: 0;
  font-size: 18px;
}
.panel-stack {
  display: grid;
  gap: 14px;
}
.panel-stack.loose {
  gap: 18px;
}
.dashboard-grid {
  display: grid;
  grid-template-columns: 1.1fr 2fr;
  gap: 16px;
  align-items: start;
}
.dashboard-grid.client-grid {
  grid-template-columns: 2fr 1fr;
}
.toolbar-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.footer-lite {
  margin-top: auto;
  padding-top: 18px;
  color: var(--text-2);
}

.theme-switcher {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.theme-toggle {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.theme-toggle .btn {
  width: 100%;
}

.theme-toggle .btn.active {
  background: var(--accent-a);
  border-color: var(--accent-a);
  color: #fff;
}
.theme-switcher-compact .card-sub {
  margin-bottom: 6px;
}

.theme-toggle-icons {
  grid-template-columns: repeat(2, 44px);
  justify-content: start;
}

.theme-icon-btn {
  padding: 0;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-size: 20px;
  line-height: 1;
}

.theme-icon-btn span {
  pointer-events: none;
}

.ads-row-ok {
  background: #f4fbf6;
}

.ads-row-warn {
  background: #fffaf0;
}

.ads-row-bad {
  background: #fff5f5;
}

.ads-score-label {
  color: var(--text);
  font-weight: 600;
}

html[data-theme="dark"] .ads-row-ok {
  background: rgba(22, 101, 52, 0.16);
}

html[data-theme="dark"] .ads-row-warn {
  background: rgba(146, 64, 14, 0.18);
}

html[data-theme="dark"] .ads-row-bad {
  background: rgba(127, 29, 29, 0.2);
}

html[data-theme="dark"] .ads-row td,
html[data-theme="dark"] .ads-row th,
html[data-theme="dark"] .ads-score-label {
  color: var(--text);
}

@media (max-width: 1440px) {
  .layout { grid-template-columns: 200px 1fr; }
  .sidebar { padding: 16px; }
  .nav { gap: 6px; margin-top: 14px; }
  .nav a { padding: 9px 10px; }
  .main { padding: 16px; }
  .main-top { margin-bottom: 14px; }
  .grid,
  .panel-stack.loose,
  .dashboard-grid { gap: 14px; }
  .card,
  .card.client-card { padding: 14px; }
  .card-value { font-size: 20px; }
  .section-title { font-size: 28px; }
  .section-title-sm { font-size: 17px; }
  .table th,
  .table td { padding: 10px; }
}

@media (max-width: 1366px) {
  .layout { grid-template-columns: 188px 1fr; }
  .sidebar { padding: 14px; }
  .brand img { height: 48px; }
  .main { padding: 14px; }
  .card,
  .card.client-card { padding: 13px; }
  .card-value { font-size: 18px; }
  .section-title { font-size: 26px; }
  .section-title-sm { font-size: 16px; }
  .card-sub,
  .card-title { font-size: 12px; }
  .btn { padding: 9px 14px; }
  .table th,
  .table td { padding: 9px; }

  .page-admin .cards-4 { grid-template-columns: repeat(2, 1fr); }
  .page-admin .dashboard-grid { grid-template-columns: 1fr; }
  .page-admin .table { min-width: 900px; }

  .page-client .dashboard-grid { grid-template-columns: 1fr; }
  .page-client .cards-3 { grid-template-columns: repeat(2, 1fr); }
  .page-client .table { min-width: 820px; }

  .page-client-detail .cards-4 { grid-template-columns: repeat(2, 1fr); }
  .page-client-detail .cards-3 { grid-template-columns: repeat(2, 1fr); }
  .page-client-detail .table { min-width: 860px; }

  .page-import .card { padding: 14px; }
}

@media (max-width: 980px) {
  .cards-4 { grid-template-columns: repeat(2, 1fr); }
  .cards-3 { grid-template-columns: 1fr; }
  .cards-2 { grid-template-columns: 1fr; }
  .brand img { height: 44px; }
  .layout { grid-template-columns: 1fr; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .main { padding: 14px; }
  .main-top { flex-direction: column; align-items: flex-start; }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 260px;
    transform: translateX(-100%);
    transition: transform .2s ease;
    z-index: 40;
  }
  .sidebar.open { transform: translateX(0); }
  .drawer-toggle {
    display: inline-flex;
    border: 1px solid var(--line);
    background: var(--card);
    color: var(--text);
    border-radius: 10px;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
  }
}

@media (max-width: 720px) {
  .card { padding: 12px; }
  .card.client-card { padding: 16px; }
  .section-title { font-size: 24px; }
  .section-title-sm { font-size: 15px; }
  .table { min-width: 700px; }
  .btn { width: 100%; }
  .toolbar-row { width: 100%; }
}

@media (max-width: 520px) {
  .main { padding: 10px; }
  .card { padding: 10px; }
  .card.client-card { padding: 14px; }
  .btn { padding: 10px 12px; }
  .card-value { font-size: 20px; }
  .table { min-width: 620px; }
  .filters-panel { padding: 10px; }
  .filters-row { gap: 12px; }
}


.quality-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.quality-tabs a {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text-2);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
}
.quality-tabs a.active {
  color: #fff;
  background: linear-gradient(120deg, var(--accent-a), var(--accent-b));
  border-color: transparent;
}
.quality-list {
  display: grid;
  gap: 12px;
}
.quality-list-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  background: var(--panel-bg);
}
.quality-score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  border-radius: 999px;
  padding: 6px 12px;
  font-weight: 700;
  border: 1px solid var(--line);
}
.quality-score-critica {
  color: #991b1b;
  background: #fee2e2;
  border-color: #fecaca;
}
.quality-score-alta {
  color: #92400e;
  background: #fef3c7;
  border-color: #fde68a;
}
.quality-score-media {
  color: var(--text);
  background: var(--btn-bg);
}
.quality-score-boa {
  color: #166534;
  background: #dcfce7;
  border-color: #bbf7d0;
}
html[data-theme="dark"] .quality-score-critica {
  color: #fca5a5;
  background: rgba(127, 29, 29, 0.22);
  border-color: rgba(248, 113, 113, 0.45);
}
html[data-theme="dark"] .quality-score-alta {
  color: #fde68a;
  background: rgba(146, 64, 14, 0.2);
  border-color: rgba(251, 191, 36, 0.45);
}
html[data-theme="dark"] .quality-score-boa {
  color: #86efac;
  background: rgba(22, 101, 52, 0.2);
  border-color: rgba(34, 197, 94, 0.45);
}
.quality-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 980px) {
  .quality-meta-grid {
    grid-template-columns: 1fr;
  }
}

/* Pullse 2.0 - interface simples para lojista, densa para consultor */
:root {
  --bg: #f4f7fb;
  --bg-soft: #eef3f8;
  --bg-grad-end: #f8fafc;
  --card: #ffffff;
  --line: #d8e0eb;
  --text: #111827;
  --text-2: #637083;
  --accent-a: #1d4fff;
  --accent-b: #00a7e8;
  --accent-c: #02c48d;
  --ok: #02c48d;
  --warn: #ff9f1c;
  --bad: #ff4d5d;
  --sidebar-bg: #ffffff;
  --surface-soft: #eef3f8;
  --topbar-bg: rgba(255, 255, 255, 0.86);
  --btn-bg: #eef3f8;
  --input-bg: #ffffff;
  --panel-bg: #f7f9fc;
  --modal-backdrop: rgba(8, 13, 24, 0.55);
  --radius-md: 14px;
  --radius-lg: 18px;
  --shadow-action: 0 16px 36px rgba(29, 79, 255, 0.22);
}

html[data-theme="dark"] {
  --bg: #060a12;
  --bg-soft: #0a0f1a;
  --bg-grad-end: #050810;
  --card: #0a101c;
  --line: #1f2a3a;
  --text: #f4f7fb;
  --text-2: #9aa7ba;
  --accent-a: #3027ff;
  --accent-b: #1fb6ff;
  --accent-c: #05d69d;
  --ok: #05d69d;
  --warn: #ff9f1c;
  --bad: #ff596d;
  --sidebar-bg: #070b13;
  --surface-soft: #121a27;
  --topbar-bg: rgba(6, 10, 18, 0.88);
  --btn-bg: #141d2b;
  --input-bg: #070d17;
  --panel-bg: #080e18;
  --modal-backdrop: rgba(0, 0, 0, 0.78);
  --shadow-action: 0 18px 38px rgba(48, 39, 255, 0.28);
}

body {
  background:
    radial-gradient(circle at 82% -8%, rgba(31, 182, 255, 0.10), transparent 34%),
    radial-gradient(circle at 12% 0%, rgba(5, 214, 157, 0.08), transparent 30%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-grad-end) 100%);
  font-size: 16px;
  line-height: 1.48;
}

html[data-theme="dark"] body {
  background:
    radial-gradient(circle at 82% -8%, rgba(31, 182, 255, 0.16), transparent 32%),
    radial-gradient(circle at 0% 10%, rgba(5, 214, 157, 0.07), transparent 28%),
    linear-gradient(180deg, #060a12 0%, #050810 100%);
}

a, .btn, .input, .select, .textarea, .table th {
  letter-spacing: 0;
}

.layout {
  grid-template-columns: 272px minmax(0, 1fr);
  background: var(--bg);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 22px 14px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--line);
}

html[data-theme="dark"] .sidebar {
  background: linear-gradient(180deg, #070b13 0%, #050810 100%);
}

.sidebar .brand {
  min-height: 54px;
  padding: 0 10px;
}

.brand img {
  height: 50px;
  max-width: 168px;
  object-fit: contain;
}

.nav {
  gap: 5px;
  margin-top: 24px;
}

.nav a {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 46px;
  padding: 11px 13px 11px 16px;
  border-radius: 12px;
  color: var(--text-2);
  font-weight: 700;
  border-color: transparent;
}

.nav a::before {
  content: "";
  position: absolute;
  left: 0;
  top: 11px;
  bottom: 11px;
  width: 3px;
  border-radius: 999px;
  background: transparent;
}

.nav a.active,
.nav a:hover {
  color: var(--text);
  background: var(--surface-soft);
  border-color: transparent;
}

.nav a.active::before {
  background: linear-gradient(180deg, var(--accent-b), var(--accent-a));
}

.nav.nav-grouped {
  gap: 3px;
  overflow-y: auto;
  padding-right: 3px;
}

.nav-section-title {
  margin: 14px 10px 5px;
  color: var(--text-2);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
  opacity: .74;
}

.nav-section-title:first-child {
  margin-top: 0;
}

.nav.nav-grouped a {
  min-height: 40px;
  padding-top: 9px;
  padding-bottom: 9px;
  gap: 10px;
}

.nav-icon {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--text-2);
  background: color-mix(in srgb, var(--surface-soft) 72%, transparent);
  transition: color .18s ease, background .18s ease, transform .18s ease, border-color .18s ease;
}

.nav-icon svg {
  width: 15px;
  height: 15px;
}

.nav a.active .nav-icon,
.nav a:hover .nav-icon {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent-a), var(--accent-b));
  transform: translateY(-1px);
}

.theme-switcher {
  margin-top: auto;
}

.main {
  padding: 42px clamp(22px, 4vw, 64px);
  gap: 18px;
}

.main-top {
  margin-bottom: 22px;
  align-items: flex-start;
}

.main h1,
.section-title {
  font-size: clamp(30px, 3.1vw, 46px);
  line-height: 1.05;
  font-weight: 800;
}

.section-title-sm {
  font-size: 22px;
  font-weight: 800;
}

.section-sub,
.card-sub {
  color: var(--text-2);
}

.card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--card) 94%, transparent);
  box-shadow: none;
}

html[data-theme="dark"] .card {
  background: linear-gradient(180deg, rgba(13, 20, 33, 0.96), rgba(8, 14, 24, 0.96));
  box-shadow: none;
}

.card.client-card,
.page-admin .card,
.page-client-detail .card,
.page-import .card {
  padding: 22px;
}

.card-title {
  font-size: 13px;
  font-weight: 700;
}

.card-value {
  font-size: 28px;
  line-height: 1.15;
  font-weight: 800;
}

.cards-4,
.cards-3,
.cards-2,
.dashboard-grid,
.panel-stack {
  gap: 18px;
}

.btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  padding: 11px 18px;
  font-weight: 800;
  background: var(--btn-bg);
  border-color: var(--line);
  box-shadow: none;
}

.btn:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent-b) 42%, var(--line));
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-a) 0%, #2517ff 58%, var(--accent-b) 120%);
  border-color: transparent;
  color: #fff;
  box-shadow: var(--shadow-action);
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
}

.input,
.select,
.textarea,
.input-field {
  min-height: 48px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--input-bg);
  color: var(--text);
  padding: 12px 14px;
  font-size: 15px;
}

.label {
  color: var(--text);
  font-weight: 700;
  font-size: 14px;
}

.input:focus-visible,
.select:focus-visible,
.textarea:focus-visible,
.input-field:focus {
  border-color: var(--accent-b);
  outline: 3px solid rgba(31, 182, 255, 0.18);
  outline-offset: 0;
  box-shadow: none;
}

.table-wrap {
  border-radius: var(--radius-lg);
  border-color: var(--line);
  background: var(--card);
}

.table th {
  color: var(--text-2);
  text-transform: none;
  font-size: 14px;
  font-weight: 800;
}

.table td {
  font-size: 15px;
}

html[data-theme="dark"] .table tr:hover td {
  background: rgba(255, 255, 255, 0.025);
}

.badge {
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  font-weight: 800;
}

.badge.ok {
  color: #027a5c;
  background: rgba(5, 214, 157, 0.13);
  border-color: rgba(5, 214, 157, 0.36);
}

.badge.warn {
  color: #a86100;
  background: rgba(255, 159, 28, 0.14);
  border-color: rgba(255, 159, 28, 0.42);
}

.badge.bad {
  color: #d92f48;
  background: rgba(255, 89, 109, 0.13);
  border-color: rgba(255, 89, 109, 0.36);
}

html[data-theme="dark"] .badge.ok { color: #5ff2c6; }
html[data-theme="dark"] .badge.warn { color: #ffd08a; }
html[data-theme="dark"] .badge.bad { color: #ff9aa7; }

.state {
  border-radius: var(--radius-lg);
  border-style: dashed;
  background: var(--panel-bg);
  padding: 24px;
}

.filters-panel,
.quality-list-item,
.client-quality-item,
.today-action-item {
  border-radius: var(--radius-lg);
  background: var(--panel-bg);
}

.auth-shell {
  min-height: 100vh;
  padding: 0;
}

.auth-shell-split {
  display: grid;
  grid-template-columns: minmax(380px, 0.85fr) minmax(480px, 1.15fr);
  align-items: stretch;
  background: #fff;
}

.auth-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: min(560px, 82%);
  margin: 0 auto;
  padding: 48px 0;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 44px;
  color: #111827;
  font-size: 26px;
  font-weight: 800;
}

.auth-brand img {
  height: 54px;
  width: auto;
}

.auth-heading {
  margin-bottom: 30px;
}

.eyebrow {
  margin: 0 0 10px;
  color: #667085;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.auth-heading h1 {
  margin: 0 0 10px;
  color: #111827;
  font-size: clamp(34px, 4vw, 48px);
  line-height: 1.05;
}

.auth-heading p {
  margin: 0;
  color: #667085;
  font-size: 18px;
}

.auth-panel .label {
  color: #111827;
}

.auth-panel .input {
  min-height: 58px;
  border-radius: 18px;
  color: #111827;
  background: #fff;
  border-color: #d9e0ea;
  box-shadow: 0 7px 22px rgba(15, 23, 42, 0.05);
}

.auth-panel .btn-primary {
  width: 100%;
  min-height: 58px;
  margin-top: 10px;
  border-radius: 18px;
  font-size: 17px;
}

.auth-links {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}

.auth-links .btn {
  min-height: auto;
  padding: 0;
  color: #667085;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.auth-visual {
  display: grid;
  place-items: center;
  margin: 26px 26px 26px 0;
  border-radius: 32px;
  background:
    radial-gradient(circle at 86% 12%, rgba(255, 255, 255, 0.16), transparent 7%),
    radial-gradient(circle at 10% 88%, rgba(31, 182, 255, 0.16), transparent 8%),
    linear-gradient(135deg, #0a1266 0%, #1f1494 56%, #11106e 100%);
  overflow: hidden;
}

.auth-visual-card {
  position: relative;
  width: min(520px, 72%);
  aspect-ratio: 0.82;
  border-radius: 34px;
  background: #d9ddff;
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.28);
  padding: 34px;
}

.auth-visual-top {
  display: flex;
  gap: 8px;
}

.auth-visual-top span {
  display: block;
  width: 48px;
  height: 8px;
  border-radius: 999px;
  background: rgba(24, 24, 91, 0.32);
}

.auth-score-ring {
  position: absolute;
  left: 50%;
  top: 28%;
  transform: translateX(-50%);
  width: 138px;
  height: 138px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  align-content: center;
  color: #17145e;
  background: rgba(255, 255, 255, 0.35);
}

.auth-score-ring strong {
  font-size: 42px;
  line-height: 1;
}

.auth-score-ring small,
.auth-next-step small {
  color: #565a8e;
  font-weight: 800;
  text-transform: uppercase;
}

.auth-bars {
  position: absolute;
  left: 34px;
  right: 34px;
  bottom: 132px;
  height: 112px;
  display: flex;
  align-items: end;
  gap: 14px;
}

.auth-bars span {
  flex: 1;
  border-radius: 16px 16px 4px 4px;
  background: linear-gradient(180deg, #3027ff, #1fb6ff);
}

.auth-next-step {
  position: absolute;
  left: 34px;
  right: 34px;
  bottom: 34px;
  border-radius: 22px;
  padding: 18px;
  color: #17145e;
  background: rgba(255, 255, 255, 0.44);
}

.auth-next-step strong {
  display: block;
  margin-top: 6px;
  font-size: 18px;
}

@media (max-width: 1440px) {
  .layout { grid-template-columns: 248px minmax(0, 1fr); }
  .main { padding: 34px clamp(18px, 3.2vw, 46px); }
  .card-value { font-size: 24px; }
}

@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    height: 100vh;
    width: 292px;
  }
  .main { padding: 22px 16px; }
  .auth-shell-split {
    grid-template-columns: 1fr;
    background: #fff;
  }
  .auth-panel {
    width: min(540px, 88vw);
  }
  .auth-visual {
    display: none;
  }
}

@media (max-width: 720px) {
  .main h1,
  .section-title { font-size: 28px; }
  .card.client-card,
  .page-admin .card,
  .page-client-detail .card,
  .page-import .card { padding: 16px; }
  .btn { width: auto; }
}

/* Pullse OS - novo shell operacional */
:root {
  --os-bg: #eef1f4;
  --os-surface: #ffffff;
  --os-surface-2: #f6f8fb;
  --os-ink: #0b1220;
  --os-ink-2: #334155;
  --os-muted: #64748b;
  --os-line: #d9e1ea;
  --os-primary: #175cff;
  --os-success: #059669;
  --os-warning: #d97706;
  --os-danger: #e11d48;
}

html[data-theme="dark"] {
  --os-bg: #080c13;
  --os-surface: #0f1724;
  --os-surface-2: #111b2a;
  --os-ink: #f8fafc;
  --os-ink-2: #dbe4ef;
  --os-muted: #9aa7ba;
  --os-line: #253244;
}

body {
  background: var(--os-bg);
  color: var(--os-ink);
}

html[data-theme="dark"] body {
  background: var(--os-bg);
}

.layout {
  grid-template-columns: 296px minmax(0, 1fr);
  background: var(--os-bg);
}

.sidebar {
  margin: 16px 0 16px 16px;
  height: calc(100vh - 32px);
  border: 0;
  border-radius: 8px;
  background: #08111f;
  color: #eef5ff;
  box-shadow: 0 22px 50px rgba(8, 17, 31, 0.22);
}

html[data-theme="dark"] .sidebar {
  background: #050914;
}

.sidebar .brand {
  padding: 10px 10px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.nav-section-title {
  color: rgba(238,245,255,.52);
  margin: 18px 10px 7px;
}

.nav a {
  min-height: 42px;
  color: rgba(238,245,255,.68);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
}

.nav a::before {
  display: none;
}

.nav a.active,
.nav a:hover {
  color: #ffffff;
  background: rgba(255,255,255,.09);
}

.nav a.active {
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
}

.nav-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border-color: rgba(255,255,255,.08);
  color: rgba(238,245,255,.72);
  background: rgba(255,255,255,.06);
}

.nav a.active .nav-icon,
.nav a:hover .nav-icon {
  background: var(--os-primary);
  color: #fff;
}

.theme-switcher {
  border-top: 1px solid rgba(255,255,255,.08);
  padding: 14px 8px 4px;
}

.theme-switcher .card-sub {
  color: rgba(238,245,255,.56);
}

.main {
  padding: 16px clamp(18px, 2.4vw, 34px) 34px;
}

.main-top {
  position: sticky;
  top: 0;
  z-index: 12;
  margin: -16px calc(clamp(18px, 2.4vw, 34px) * -1) 18px;
  padding: 16px clamp(18px, 2.4vw, 34px);
  background: rgba(238, 241, 244, .9);
  border-bottom: 1px solid rgba(217, 225, 234, .78);
  backdrop-filter: blur(12px);
}

html[data-theme="dark"] .main-top {
  background: rgba(8, 12, 19, .88);
  border-bottom-color: rgba(37, 50, 68, .86);
}

.main h1,
.section-title {
  color: var(--os-ink);
  font-size: clamp(26px, 2.4vw, 36px);
  letter-spacing: 0;
}

.card,
.table-wrap,
.filters-panel,
.state {
  border-radius: 8px;
  border-color: var(--os-line);
  background: var(--os-surface);
  box-shadow: 0 12px 28px rgba(15, 23, 42, .05);
}

html[data-theme="dark"] .card,
html[data-theme="dark"] .table-wrap,
html[data-theme="dark"] .filters-panel,
html[data-theme="dark"] .state {
  background: var(--os-surface);
  box-shadow: none;
}

.card-title,
.card-sub,
.section-sub {
  color: var(--os-muted);
}

.card-value {
  color: var(--os-ink);
  font-weight: 900;
}

.btn {
  border-radius: 8px;
  min-height: 40px;
  padding: 9px 14px;
  box-shadow: none;
}

.btn-primary {
  background: var(--os-primary);
  border-color: var(--os-primary);
  box-shadow: 0 12px 22px rgba(23, 92, 255, .2);
}

.btn-primary:hover {
  background: #064ee8;
}

.btn-ghost {
  background: var(--os-surface);
  border-color: var(--os-line);
}

.input,
.select,
.textarea,
.input-field {
  border-radius: 8px;
  min-height: 42px;
  background: var(--os-surface);
  border-color: var(--os-line);
}

.badge {
  border-radius: 8px;
  min-height: 26px;
  font-size: 12px;
}

.badge.ok {
  color: var(--os-success);
  background: rgba(5, 150, 105, .10);
  border-color: rgba(5, 150, 105, .22);
}

.badge.warn {
  color: var(--os-warning);
  background: rgba(217, 119, 6, .10);
  border-color: rgba(217, 119, 6, .24);
}

.badge.bad {
  color: var(--os-danger);
  background: rgba(225, 29, 72, .10);
  border-color: rgba(225, 29, 72, .22);
}

.table th {
  background: var(--os-surface-2);
  color: var(--os-muted);
}

.table td {
  background: var(--os-surface);
}

@media (max-width: 1100px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar {
    margin: 0;
    height: 100vh;
    border-radius: 0;
  }
  .main {
    padding: 18px 14px 28px;
  }
  .main-top {
    margin: -18px -14px 16px;
    padding: 14px;
  }
}

/* Pullse Pro - camada final mais sóbria para SaaS de gestão */
:root {
  --pro-bg: #f3f5f8;
  --pro-sidebar: #ffffff;
  --pro-card: #ffffff;
  --pro-line: #dde3eb;
  --pro-text: #111827;
  --pro-muted: #667085;
  --pro-accent: #155eef;
  --pro-hover: #f2f6ff;
}

html[data-theme="dark"] {
  --pro-bg: #090d14;
  --pro-sidebar: #0f1724;
  --pro-card: #111827;
  --pro-line: #263244;
  --pro-text: #f8fafc;
  --pro-muted: #a1adbd;
  --pro-hover: #172133;
}

body {
  background: var(--pro-bg);
}

.layout {
  grid-template-columns: 276px minmax(0, 1fr);
  background: var(--pro-bg);
}

.sidebar {
  margin: 0;
  height: 100vh;
  border-radius: 0;
  background: var(--pro-sidebar);
  color: var(--pro-text);
  border-right: 1px solid var(--pro-line);
  box-shadow: none;
}

.sidebar .brand {
  border-bottom: 1px solid var(--pro-line);
}

.nav-section-title,
.theme-switcher .card-sub {
  color: var(--pro-muted);
}

.nav a {
  color: var(--pro-muted);
  border-radius: 8px;
}

.nav a.active,
.nav a:hover {
  color: var(--pro-text);
  background: var(--pro-hover);
}

.nav a.active {
  box-shadow: inset 3px 0 0 var(--pro-accent);
}

.nav-icon {
  color: var(--pro-muted);
  background: transparent;
  border-color: var(--pro-line);
}

.nav a.active .nav-icon,
.nav a:hover .nav-icon {
  color: var(--pro-accent);
  background: #fff;
  border-color: rgba(21, 94, 239, .28);
}

html[data-theme="dark"] .nav a.active .nav-icon,
html[data-theme="dark"] .nav a:hover .nav-icon {
  background: #111827;
}

.theme-switcher {
  border-top: 1px solid var(--pro-line);
}

.main {
  padding: 22px clamp(22px, 3vw, 42px) 42px;
}

.main-top {
  margin: -22px calc(clamp(22px, 3vw, 42px) * -1) 22px;
  padding: 18px clamp(22px, 3vw, 42px);
  background: rgba(243, 245, 248, .92);
  border-bottom: 1px solid var(--pro-line);
}

html[data-theme="dark"] .main-top {
  background: rgba(9, 13, 20, .9);
}

.card,
.table-wrap,
.filters-panel,
.state {
  background: var(--pro-card);
  border-color: var(--pro-line);
  border-radius: 10px;
  box-shadow: none;
}

.btn-primary {
  background: var(--pro-accent);
  border-color: var(--pro-accent);
  box-shadow: none;
}

.btn-ghost {
  background: var(--pro-card);
}

@media (max-width: 1100px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    margin: 0;
    border-radius: 0;
  }
  .main {
    padding: 18px 14px 28px;
  }
  .main-top {
    margin: -18px -14px 16px;
    padding: 14px;
  }
}

/* Pullse Pro - consistência entre módulos */
.section-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--pro-line);
}

.section-title-sm {
  font-size: 18px;
  line-height: 1.2;
  font-weight: 850;
  margin: 0;
}

.client-card,
.page-client .card,
.page-admin .card,
.page-client-detail .card {
  border-radius: 10px;
}

.cards-4,
.cards-3,
.cards-2,
.dashboard-grid,
.panel-stack {
  gap: 14px;
}

.cards-4 > .card,
.cards-3 > .card,
.cards-2 > .card {
  min-height: 104px;
}

.card-title {
  color: var(--pro-muted);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.card-value {
  font-size: 26px;
  line-height: 1.08;
}

.quality-list,
.today-actions-list,
.setup-list {
  display: grid;
  gap: 10px;
}

.quality-list-item,
.today-action-item,
.client-quality-item,
.client-ads-item,
.action-card {
  border: 1px solid var(--pro-line) !important;
  border-radius: 10px !important;
  background: var(--pro-card) !important;
  box-shadow: none !important;
}

.quality-list-item,
.client-quality-item,
.client-ads-item,
.action-card {
  padding: 16px !important;
}

.today-action-item {
  padding: 14px 16px !important;
}

.action-card-top,
.recommendation-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.filters-panel {
  border-radius: 10px;
  background: var(--pro-card);
}

.filters-row .input,
.filters-row .select,
.filters-row .btn {
  height: 40px;
  min-height: 40px;
}

.table-wrap {
  border-radius: 10px;
}

.table {
  min-width: 900px;
}

.table th,
.table td {
  padding: 11px 12px;
  border-color: var(--pro-line);
}

.table th {
  font-size: 12px;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.state {
  border-style: solid;
  color: var(--pro-muted);
}

.state.success {
  color: var(--os-success);
  border-color: rgba(5,150,105,.22);
  background: rgba(5,150,105,.08);
}

.state.error {
  color: var(--os-danger);
  border-color: rgba(225,29,72,.22);
  background: rgba(225,29,72,.08);
}

.kpi-progress {
  height: 7px;
  background: #e8edf4;
}

html[data-theme="dark"] .kpi-progress {
  background: #1f2a3a;
}

.kpi-progress > span {
  background: var(--pro-accent);
}

.drawer-toggle {
  border-radius: 8px !important;
}

@media (max-width: 720px) {
  .section-header,
  .action-card-top,
  .recommendation-header {
    flex-direction: column;
  }
  .card-value {
    font-size: 22px;
  }
}

/* Pullse SaaS sidebar */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow-y: auto;
  background: #070a12;
}

.sidebar > div:first-child {
  padding: 22px 20px 18px;
}

.sidebar .brand {
  min-height: 54px;
  border-bottom: 0;
  padding: 0;
}

.sidebar .brand img {
  max-width: 124px;
  max-height: 42px;
}

.nav.nav-grouped {
  margin-top: 18px;
  padding: 0 18px 18px;
  gap: 6px;
}

.nav-section-title {
  margin: 26px 0 10px;
  padding: 0 0 0 2px;
  color: #9aa3b2;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.nav-section-title:first-child {
  margin-top: 4px;
}

.nav.nav-grouped a,
.nav a {
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: #f4f7fb;
  font-size: 15px;
  font-weight: 750;
  letter-spacing: 0;
  background: transparent;
  transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}

.nav.nav-grouped a:hover,
.nav a:hover {
  color: #fff;
  background: #111827;
  border-color: #202a3b;
  transform: translateX(2px);
}

.nav.nav-grouped a.active,
.nav a.active {
  color: #fff;
  background: #1f2937;
  border-color: #263246;
  box-shadow: inset 4px 0 0 #4f46e5;
}

.nav.nav-grouped a::before,
.nav a::before {
  display: none;
}

.nav-icon {
  width: 28px;
  height: 28px;
  min-width: 28px;
  border: 0;
  color: #f8fafc;
  background: transparent;
}

.nav-icon svg {
  width: 24px;
  height: 24px;
}

.nav a.active .nav-icon,
.nav a:hover .nav-icon,
html[data-theme="dark"] .nav a.active .nav-icon,
html[data-theme="dark"] .nav a:hover .nav-icon {
  color: #fff;
  background: transparent;
  border-color: transparent;
}

.sidebar-user-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin: auto 18px 18px;
  padding: 14px;
  border: 1px solid #1d2638;
  border-radius: 16px;
  background: rgba(15, 23, 42, .78);
}

.sidebar-avatar {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #8b5cf6;
  background: #0b0f2f;
  font-size: 18px;
  font-weight: 900;
}

.sidebar-user-name {
  overflow: hidden;
  color: #f8fafc;
  font-size: 15px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user-role {
  margin-top: 2px;
  color: #9aa3b2;
  font-size: 13px;
  font-weight: 650;
}

.theme-switcher.theme-switcher-compact {
  margin: 0 18px 18px;
  padding-top: 14px;
  border-top: 1px solid #1d2638;
}

@media (max-width: 720px) {
  .nav.nav-grouped {
    padding: 0 14px 16px;
  }
  .sidebar-user-card {
    margin: 8px 14px 14px;
  }
}
