:root {
  --page: #eef2f6;
  --surface: #ffffff;
  --ink: #1f2a37;
  --muted: #6b7c8f;
  --line: #e5ebf1;
  --primary: #1a90e8;
  --primary-deep: #0f74c8;
  --primary-ink: #fff;
  --shadow: 0 10px 28px rgba(31, 42, 55, 0.07);
  --good: #1f9d55;
  --bad: #e5484d;
  --soft-blue: #e8f4ff;
  --soft-green: #e7f8ef;
  --soft-amber: #fff4df;
  --soft-rose: #ffe8ec;
  --soft-slate: #eef2f6;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "DM Sans", "IBM Plex Sans", sans-serif;
  background: var(--page);
  color: var(--ink);
  min-height: 100vh;
  padding: 16px;
}

.shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  min-height: calc(100vh - 32px);
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
}
.shell.is-rail-closed { grid-template-columns: 88px minmax(0, 1fr); }

.rail {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 14px 12px 12px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  position: sticky;
  top: 16px;
  height: calc(100vh - 32px);
  min-height: 420px;
}
.rail-head { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.rail-logo {
  width: min(168px, 100%);
  height: auto;
  aspect-ratio: 1166 / 376;
  border-radius: 0;
  display: block;
  object-fit: contain;
}
.rail-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--soft-slate);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  cursor: pointer;
  font-weight: 700;
  font-size: 12px;
}
.rail-toggle svg { width: 16px; height: 16px; display: block; transition: transform 0.2s ease; }
.shell.is-rail-closed .rail-toggle svg { transform: rotate(180deg); }
.shell.is-rail-closed .rail-toggle span,
.shell.is-rail-closed .rail-refresh span,
.shell.is-rail-closed .tabs,
.shell.is-rail-closed .dash-switch { display: none; }
.shell.is-rail-closed .rail { padding-inline: 8px; }
.shell.is-rail-closed .rail-logo {
  width: 44px;
  height: 44px;
  aspect-ratio: 1;
  object-fit: cover;
  object-position: left center;
  border-radius: 50%;
}
.shell.is-rail-closed .rail-toggle,
.shell.is-rail-closed .rail-refresh { width: 44px; height: 44px; padding: 0; margin-inline: auto; }
.tabs {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  margin: 10px 0 0;
  flex: 1;
}
.dash-switch {
  display: flex;
  width: 100%;
  gap: 4px;
  margin-top: 12px;
  padding: 4px;
  background: var(--soft-slate);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.dash-link {
  flex: 1;
  text-align: center;
  color: var(--muted);
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  padding: 7px 4px;
  border-radius: 10px;
}
.dash-link.is-on { background: var(--primary); color: #fff; }
.tab {
  width: 100%;
  background: transparent;
  color: var(--muted);
  border: 0;
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
}
.tab:hover { background: var(--soft-slate); color: var(--ink); }
.rail-foot { margin-top: auto; padding-top: 12px; display: grid; gap: 8px; }
.rail-user {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}
.rail-logout {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
}
.rail-refresh {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--primary);
  color: #fff;
}
.rail-refresh svg { width: 16px; height: 16px; display: block; flex: none; }
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 12% 18%, rgba(52, 166, 243, 0.28), transparent 42%),
    radial-gradient(circle at 88% 12%, rgba(15, 116, 200, 0.22), transparent 40%),
    var(--page);
}
.login-card {
  width: min(420px, 100%);
  background: var(--surface);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 28px 26px 24px;
}
.login-logo {
  width: min(220px, 70%);
  height: auto;
  aspect-ratio: 1166 / 376;
  object-fit: contain;
  display: block;
  margin: 0 0 18px;
}
.login-card h1 {
  margin: 0 0 18px;
  font-size: 28px;
}
.login-form {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}
.login-form label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
}
.login-form input {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  color: var(--ink);
}
.login-form .btn {
  margin-top: 4px;
  width: 100%;
  justify-content: center;
}
.login-error {
  margin: 14px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: #ffe8ec;
  color: #a1162e;
  font-size: 13px;
  font-weight: 600;
}
.panel-countdown {
  margin: 0;
  padding: 6px 12px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  width: fit-content;
  max-width: 100%;
  white-space: nowrap;
  box-shadow: var(--shadow);
}
.tab svg { width: 20px; height: 20px; display: block; color: var(--primary); flex: none; }
.tab.active {
  background: var(--primary);
  color: #fff;
}
.tab.active svg { color: #fff; }
a.tab { color: var(--muted); text-decoration: none; }
a.tab.active { color: #fff; }
a.tab:hover { background: var(--soft-slate); color: var(--ink); }
a.tab.active:hover { background: var(--primary-deep); color: #fff; }
.tab-panel.hidden { display: none; }

.workspace { min-width: 0; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 4px;
  background: transparent;
  border: 0;
  box-shadow: none;
  min-height: 0;
}
.topbar-tools { margin-left: auto; }
.data-stamp { display: none; }
.topbar-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.header-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  align-items: center;
}
.header-filters label {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}
.header-filters select,
.header-filters input {
  padding: 4px 10px;
  border-radius: 999px;
  min-width: 96px;
  background: #f5faff;
  font-size: 12px;
}
.header-filters .btn { padding: 4px 10px; font-size: 12px; }
.header-filters.hidden { display: none; }

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 4px 4px 8px;
}
.page-head h1 {
  margin: 0;
  font-size: 26px;
  letter-spacing: -0.03em;
  line-height: 1.15;
  font-weight: 700;
}
.page-head p { margin: 0; font-size: 12px; }
h2 { margin: 0 0 6px; font-size: 16px; letter-spacing: -0.02em; }
.chart-hint { margin: 0 0 8px; font-size: 12px; font-weight: 400; max-width: 640px; }

.tab-panel { padding: 0 4px 8px; }

input, select, button, textarea { font: inherit; }
input, select {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  background: #f7fbff;
  color: var(--ink);
}
.btn {
  background: var(--primary);
  color: var(--primary-ink);
  border: 0;
  border-radius: 999px;
  padding: 9px 16px;
  cursor: pointer;
  font-weight: 700;
}
.btn.ghost {
  background: #fff;
  color: var(--primary);
  border: 1px solid #d5e7f6;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.topbar-actions, .table-actions, .filter-actions, .pager {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.kpis article {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.kpi-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--soft-blue);
  color: var(--primary);
  display: grid;
  place-items: center;
  flex: none;
}
.kpi-icon svg { width: 18px; height: 18px; display: block; }
.kpi-base .kpi-icon { background: var(--soft-blue); color: var(--primary); }
.kpi-plans .kpi-icon { background: var(--soft-amber); color: #c47b12; }
.kpi-month .kpi-icon { background: var(--soft-green); color: var(--good); }
.kpi-week .kpi-icon { background: #e7f3ff; color: #0b6eae; }
.kpi-free .kpi-icon { background: var(--soft-rose); color: #c0392b; }
.kpis .label { color: var(--muted); font-size: 12px; margin: 0; font-weight: 600; }
.kpis .value { font-size: 26px; font-weight: 700; margin: 2px 0 0; letter-spacing: -0.03em; }
.kpis .hint { margin: 2px 0 0; color: var(--muted); font-size: 11px; }
.board-switch { margin: 0 0 12px; }
.board-section {
  padding: 18px 20px;
  margin-bottom: 14px;
}
.board-section .board-kpis { margin-bottom: 0; }
.board-sub {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}
.board-pane.hidden { display: none; }
.board-kpis {
  grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
  gap: 8px 18px;
}
.board-section .board-kpis article {
  min-width: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  border-radius: 12px;
  padding: 8px 6px;
}
.board-kpis .board-kpi > div { min-width: 0; flex: 1; }
.board-kpi { position: relative; }
.board-kpis .value {
  font-size: clamp(22px, 2vw, 30px);
  line-height: 1.1;
  white-space: nowrap;
  margin: 0;
}
.board-kpis .label {
  margin-top: 2px;
  font-size: 12px;
  font-weight: 500;
}
.board-kpi-split { grid-column: 1 / -1; }
.board-parts {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 4px 18px;
  margin-top: 4px;
}
.board-part-label {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.board-parts .value { font-size: clamp(16px, 1.35vw, 24px); }
.board-split {
  display: flex;
  gap: 14px;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.board-split strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}
.board-pct { font-weight: 700; font-size: 12px; }
.board-pct.is-good { color: var(--good); }
.board-pct.is-bad { color: var(--bad); }
.board-pct.is-flat { color: var(--muted); }
.board-help {
  display: none;
  position: absolute;
  z-index: 8;
  left: 0;
  top: calc(100% + 6px);
  width: 280px;
  background: #17324d;
  color: #fff;
  border-radius: 14px;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.45;
}
.board-help p { margin: 0 0 6px; }
.board-help p:last-child { margin: 0; color: #d6e8f8; }
.board-kpi:hover,
.board-kpi:focus-within { z-index: 8; }
.board-kpi:hover .board-help,
.board-kpi:focus-within .board-help { display: block; }

.charts {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 12px;
  margin-bottom: 14px;
}
.chart-frame { position: relative; height: 168px; }
.chart-frame-bar, .chart-frame-day { height: 196px; }
.chart-frame canvas { width: 100% !important; height: 100% !important; }
.panel {
  padding: 16px 18px;
  margin-bottom: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.filters h2 { margin: 0 0 4px; font-size: 14px; }
.filters { padding: 8px 12px; margin-bottom: 8px; }
.filters form {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  align-items: center;
}
.filters label {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}
.filters select,
.filters input {
  padding: 4px 10px;
  font-size: 12px;
  min-width: 96px;
}
.filters .btn { padding: 4px 10px; font-size: 12px; }
.filter-actions { align-items: center; }

.table-head, .pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.table-head h2 { margin: 0; font-size: 15px; }
.table-head .muted { margin: 2px 0 0; font-size: 12px; }
.table-actions select,
.table-actions input,
.topbar-actions select,
.topbar-actions input {
  padding: 4px 10px;
  font-size: 12px;
  min-width: 96px;
}
.table-actions .btn,
.topbar-actions .btn {
  padding: 4px 10px;
  font-size: 12px;
}
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: separate; border-spacing: 0 6px; font-size: 13px; }
th, td { text-align: left; padding: 8px 10px; white-space: nowrap; }
th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding-bottom: 4px;
}
td { background: #f5faff; }
td:first-child { border-radius: 12px 0 0 12px; }
td:last-child { border-radius: 0 12px 12px 0; }
tbody tr:hover td { background: #eaf5ff; }
tbody tr.clickable { cursor: pointer; }
tbody tr.is-selected td { background: #dcedff; }
#couponTable tfoot td {
  font-weight: 700;
  background: #e7f3ff;
  color: #16324a;
}
.coupon-drill.hidden { display: none; }
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}
.badge.STORE, .badge.FREE { background: #e7f3ff; color: #0f74c8; }
.badge.TECHNICIAN, .badge.ACTIVE, .badge.active, .badge.trialing, .badge.sent { background: #e7f6ff; color: #0b6eae; }
.badge.CUSTOMER, .badge.TRIALING { background: #eef4ff; color: #3d62b5; }
.badge.PAST_DUE, .badge.past_due, .badge.unpaid, .badge.Gold { background: #eef6ff; color: #1a5f99; }
.badge.INACTIVE, .badge.NONE, .badge.Silver, .badge.pending { background: #f2f6fa; color: #5d7388; }
.badge.canceled, .badge.paused, .badge.incomplete { background: #fdecea; color: #c0392b; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--ink); }
th.sort-asc::after { content: " ▲"; }
th.sort-desc::after { content: " ▼"; }
td.mail-address { white-space: normal; max-width: 280px; }
.profile-medians {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 12px 0;
}
.profile-medians article {
  background: #f5faff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
}
.profile-medians h3 { margin: 0 0 6px; font-size: 14px; }
.profile-medians p { margin: 0; font-size: 13px; }

.muted { color: var(--muted); }
.usage { line-height: 1.15; }
.usage strong { font-size: 15px; color: var(--primary-deep); }
.usage-level { font-size: 11px; color: var(--muted); }
.usage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  margin-top: 10px;
}
.usage-step {
  background: #f5faff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.usage-step b { font-size: 22px; line-height: 1.2; color: var(--primary-deep); letter-spacing: -0.03em; }
pre {
  background: #12304d;
  color: #d7e8ff;
  padding: 12px;
  border-radius: 16px;
  overflow: auto;
  min-height: 72px;
  max-height: 240px;
}
code { font-size: 12px; }

@media (max-width: 900px) {
  html, body { overflow-x: clip; }
  body { padding: 8px; }
  .shell, .shell.is-rail-closed {
    grid-template-columns: minmax(0, 1fr);
    border-radius: 18px;
    padding: 8px;
    min-height: 0;
    gap: 6px;
    width: 100%;
    max-width: 100%;
  }
  .rail,
  .workspace {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
  .rail {
    border-radius: 16px;
    position: static;
    height: auto;
    min-height: 0;
    padding: 10px;
  }
  .rail-head { flex-direction: row; justify-content: space-between; gap: 8px; align-items: center; }
  .rail-logo {
    width: min(132px, 52%);
    height: auto;
    aspect-ratio: 1166 / 376;
    object-fit: contain;
    border-radius: 0;
  }
  .rail-toggle { width: auto; padding: 6px 10px; }
  .tabs {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    margin-top: 6px;
    gap: 4px;
    flex: none;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .dash-switch {
    margin-top: 6px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }
  .tab {
    width: auto;
    flex: none;
    padding: 8px 10px;
    font-size: 12px;
    white-space: nowrap;
  }
  .tab svg { width: 16px; height: 16px; }
  /* No mobile o menu fica em faixa horizontal; o "fechar" só compacta o rodapé. */
  .shell.is-rail-closed .tabs {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
  }
  .shell.is-rail-closed .dash-switch { display: grid; }
  .shell.is-rail-closed .rail-user,
  .shell.is-rail-closed .rail-logout,
  .shell.is-rail-closed .rail-refresh { display: none; }
  .shell.is-rail-closed .rail-toggle span { display: inline; }
  .shell.is-rail-closed .rail-toggle { width: auto; height: auto; padding: 7px 12px; }
  .shell.is-rail-closed .rail { padding: 8px 10px; }
  .shell.is-rail-closed .rail-logo {
    width: min(132px, 52%);
    height: auto;
    aspect-ratio: 1166 / 376;
    object-fit: contain;
    border-radius: 0;
  }
  .shell.is-rail-closed .rail-foot { margin-top: 0; display: none; }
  .rail-foot {
    margin-top: 8px;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 6px;
  }
  .rail-user { grid-column: 1 / -1; text-align: left; }
  .rail-logout,
  .rail-refresh { width: 100%; justify-content: center; }
  .topbar, .charts, .table-head, .profile-medians { display: block; }
  .topbar-tools { margin-top: 6px; justify-content: flex-start; width: 100%; }
  .page-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 2px 2px 6px;
  }
  .page-head h1 { font-size: 20px; }
  .panel-countdown {
    white-space: normal;
    width: 100%;
    border-radius: 12px;
    line-height: 1.35;
  }
  .header-filters,
  .filters form,
  .table-actions,
  .topbar-actions,
  .observer-bar,
  .sales-switch,
  .board-switch {
    width: 100%;
  }
  .header-filters label,
  .filters label {
    width: 100%;
    justify-content: space-between;
  }
  .header-filters select,
  .header-filters input,
  .filters select,
  .filters input,
  .table-actions select,
  .table-actions input,
  .sales-pipeline select,
  .sales-pipeline input,
  .sales-pipeline textarea {
    min-width: 0;
    width: 100%;
    flex: 1;
  }
  .kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .kpis article { padding: 10px 12px; border-radius: 16px; gap: 8px; }
  .kpi-icon { width: 32px; height: 32px; }
  .kpis .value { font-size: 20px; }
  .board-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .board-kpi-split { grid-column: 1 / -1; }
  .board-kpis .value { white-space: normal; font-size: 20px; word-break: break-word; }
  .board-switch {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }
  .board-switch .sales-switch-btn { justify-content: center; padding-inline: 8px; width: 100%; }
  .board-section { padding: 14px; }
  .board-help {
    left: 0;
    right: 0;
    width: auto;
    max-width: calc(100vw - 40px);
  }
  .charts { grid-template-columns: 1fr; gap: 8px; }
  .chart-frame { height: 150px; }
  .chart-frame-bar, .chart-frame-day { height: 170px; }
  .chart-frame-sales { height: 240px; }
  .chart-frame-board { height: 200px; }
  .panel { padding: 12px; margin-bottom: 10px; border-radius: 16px; }
  .table-wrap {
    margin: 0 -4px;
    padding: 0 4px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }
  table { font-size: 12px; border-spacing: 0 4px; }
  th, td { padding: 6px 8px; }
  .profile-medians { grid-template-columns: 1fr; }
  .sales-sale-kpis { grid-template-columns: 1fr; }
  .sales-sale-kpis .value { font-size: clamp(24px, 10vw, 40px); }
  .seller-card { min-width: 168px; }
  .observer-bar { flex-direction: column; align-items: stretch; }
  .observer-pick { flex-direction: column; }
  .observer-pick label { width: 100%; justify-content: flex-start; }
  #saleDialog {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
    margin: 8px;
    padding: 12px;
    border-radius: 16px;
  }
  #saleDialog .table-wrap { max-height: 60vh; }
  .sale-dialog-head { flex-direction: column; }
  .login-card { padding: 20px 16px; border-radius: 20px; }
  .login-logo { width: min(180px, 72%); }
}

@media (max-width: 560px) {
  body { padding: 4px; }
  .shell, .shell.is-rail-closed {
    border-radius: 0;
    box-shadow: none;
    padding: 6px;
    min-height: 100vh;
  }
  .kpis,
  .board-kpis { grid-template-columns: 1fr; }
  .kpis .value { font-size: 22px; }
  .page-head h1 { font-size: 18px; }
  .rail-foot {
    grid-template-columns: 1fr;
  }
  .filter-actions,
  .table-actions {
    width: 100%;
  }
  .filter-actions .btn,
  .table-actions .btn,
  .header-filters .btn {
    flex: 1;
    justify-content: center;
  }
  .tab span { max-width: 7.5em; overflow: hidden; text-overflow: ellipsis; }
}

.seller-row {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 2px 8px;
}
.seller-card {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 196px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.seller-card.is-on {
  border-color: #1a90e8;
  box-shadow: 0 0 0 3px #d7ecff;
}
.seller-avatar, .seller-avatar-fallback {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  flex: none;
}
.seller-avatar { object-fit: cover; background: #e7f3ff; }
.seller-avatar-fallback {
  display: grid;
  place-items: center;
  background: #e7f3ff;
  color: #1786dc;
  font-weight: 700;
  font-size: 13px;
}
.seller-card strong { display: block; font-size: 13px; }
.seller-card span { color: var(--muted); font-size: 11px; }
.chart-frame-sales { height: 320px; }
.sales-tips {
  margin: 0 0 12px;
  padding-left: 18px;
  color: #245074;
}
.sales-pipeline {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.sales-pipeline select { min-width: 220px; }
.observer-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin: 0 0 14px;
  padding: 12px;
  border: 1px solid #d5e7f6;
  border-radius: 16px;
  background: #f5faff;
}
.observer-bar[hidden] { display: none; }
.observer-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.observer-pick label {
  display: flex;
  gap: 8px;
  align-items: center;
  border: 1px solid #d5e7f6;
  background: #fff;
  border-radius: 999px;
  padding: 8px 12px;
  cursor: pointer;
}
.sales-pipeline textarea {
  min-width: 260px;
  min-height: 58px;
  resize: vertical;
  padding: 8px 12px;
  border-radius: 16px;
  border: 1px solid #d5e7f6;
  background: #f5faff;
}
.sales-pipeline input {
  min-width: 180px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid #d5e7f6;
  background: #f5faff;
}
.chart-frame-board { height: 240px; }
.sales-switch {
  display: inline-flex;
  gap: 4px;
  margin-top: 14px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}
.sales-switch-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 10px;
  padding: 8px 16px;
  font-weight: 700;
  cursor: pointer;
}
.sales-switch-btn.is-on {
  background: var(--primary);
  color: #fff;
}
.sales-pane.hidden { display: none; }
.sales-sale-kpis {
  width: 100%;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 14px;
}
.sales-sale-kpis article {
  min-width: 0;
  width: 100%;
  container-type: inline-size;
}
.sales-sale-kpis .value { font-size: clamp(28px, 14cqi, 72px); }
.sales-sale-kpis .label { font-size: clamp(12px, 4cqi, 16px); }
.sales-subs h3 { margin: 18px 0 8px; font-size: 16px; }
.sales-sale-kpis article.is-clickable { cursor: pointer; }
.sales-sale-kpis article.is-clickable:hover { border-color: #1a90e8; }
.sale-link {
  border: 0;
  background: transparent;
  color: #0b6eae;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}
#saleDialog {
  width: min(960px, calc(100vw - 32px));
  max-height: min(82vh, 760px);
  border: 0;
  border-radius: 20px;
  padding: 18px;
  box-shadow: var(--shadow);
}
#saleDialog::backdrop { background: rgba(15, 40, 70, 0.45); }
.sale-dialog-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}
.sale-dialog-head h2 { margin: 0; }
#saleDialog .table-wrap { max-height: 58vh; overflow: auto; }
.sales-plan-table tfoot td {
  font-weight: 700;
  background: #e7f3ff;
  color: #16324a;
}

.docs { padding: 8px 12px 28px; }
.docs h1 { margin: 0 0 6px; font-size: 28px; }
.docs h2 { margin: 28px 0 8px; font-size: 20px; }
.docs h3 { margin: 0 0 8px; font-size: 16px; }
.docs p { margin: 0 0 10px; line-height: 1.45; }
.docs-lead { color: var(--muted); max-width: 68ch; }
.docs-jump { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 4px; }
.docs-jump a {
  color: var(--primary-deep);
  background: #e7f3ff;
  text-decoration: none;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
}
.doc-card {
  background: #f7fbff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px 16px 6px;
  margin-top: 14px;
}
.doc-card ul, .doc-card ol { margin: 0 0 12px; padding-left: 18px; }
.doc-card li { margin: 4px 0; line-height: 1.4; }
.doc-meta { color: var(--muted); font-size: 13px; margin-bottom: 10px; }
.flow {
  display: flex;
  gap: 28px;
  list-style: none;
  margin: 0 0 8px;
  padding: 4px 2px 12px;
  overflow-x: auto;
}
.flow li {
  position: relative;
  flex: 0 0 210px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
}
.flow li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -16px;
  width: 10px;
  height: 2px;
  background: var(--primary);
}
.flow li:not(:last-child)::before {
  content: "";
  position: absolute;
  top: calc(50% - 4px);
  right: -24px;
  border-width: 5px 0 5px 7px;
  border-style: solid;
  border-color: transparent transparent transparent var(--primary);
}
.step-n {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-bottom: 6px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.flow strong { display: block; margin-bottom: 4px; }
.flow span { color: var(--muted); font-size: 13px; line-height: 1.35; }
.docs table { width: 100%; border-collapse: collapse; margin: 0 0 12px; font-size: 14px; }
.docs th, .docs td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.docs th { color: var(--muted); font-weight: 600; }
code { font-family: "IBM Plex Sans", sans-serif; font-size: 0.92em; background: #e7f3ff; border-radius: 6px; padding: 1px 5px; }
