@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,600;9..144,700&family=Manrope:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700;800&display=swap");

:root {
  color-scheme: light;
  --bg: #f3f0ea;
  --bg-2: #e9e2d6;
  --panel: rgba(255, 255, 255, 0.78);
  --panel-strong: rgba(255, 255, 255, 0.94);
  --panel-solid: #ffffff;
  --line: rgba(19, 38, 68, 0.1);
  --line-strong: rgba(19, 38, 68, 0.16);
  --text: #0f1c2e;
  --muted: #5c6d84;
  --accent: #1a4d7a;
  --accent-deep: #123a5c;
  --accent-2: #c27a24;
  --accent-3: #f7b84b;
  --danger: #b0453a;
  --success: #2f7d4f;
  --warning: #be7d12;
  --shadow: 0 18px 48px rgba(17, 28, 45, 0.12);
  --shadow-soft: 0 10px 28px rgba(17, 28, 45, 0.08);
  --shadow-strong: 0 24px 64px rgba(17, 28, 45, 0.16);
  --radius: 20px;
  --radius-sm: 14px;
  --sidebar-w: 280px;
  --focus: 0 0 0 3px rgba(26, 77, 122, 0.22);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at 12% -10%, rgba(26, 77, 122, 0.1), transparent 36%),
    radial-gradient(circle at 92% 0%, rgba(194, 122, 36, 0.12), transparent 30%),
    linear-gradient(180deg, #f7f4ee 0%, #efe8dc 100%);
  color: var(--text);
  font-family: "Manrope", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
}

[v-cloak] {
  display: none;
}

a {
  color: inherit;
}

#app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  position: relative;
  isolation: isolate;
}

#app::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.12), transparent 35%),
    radial-gradient(circle at 85% 0%, rgba(247, 184, 75, 0.1), transparent 30%);
  z-index: -1;
}

.sidebar {
  background: linear-gradient(180deg, #0c1524 0%, #13253f 55%, #16304d 100%);
  color: #f4f7fb;
  padding: 20px 16px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  z-index: 30;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.15) transparent;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
  padding: 4px 4px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(145deg, #f7b84b 0%, #d49437 45%, #b97519 100%);
  color: #101921;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 0.95rem;
  box-shadow: 0 10px 22px rgba(198, 128, 47, 0.28);
  flex-shrink: 0;
}

.eyebrow {
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.72rem;
  margin-bottom: 4px;
}

.brand h1,
.hero h2,
.card h3 {
  font-family: "Fraunces", Georgia, serif;
}

.brand h1 {
  margin: 0;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.brand p {
  margin: 2px 0 0;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.8rem;
  font-weight: 600;
}

.muted {
  color: var(--muted);
}

.nav {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
}

.nav-group {
  display: grid;
  gap: 4px;
}

.nav-group-label {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.38);
  padding: 4px 10px 6px;
}

.nav-item {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  border-radius: 12px;
  padding: 9px 10px;
  display: flex;
  gap: 10px;
  align-items: center;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
  font: inherit;
  font-weight: 600;
  font-size: 0.92rem;
}

.nav-icon {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.82rem;
  flex-shrink: 0;
}

.nav-label { flex: 1; min-width: 0; }

.nav-badge {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  display: grid;
  place-items: center;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}

.nav-item:hover .nav-icon {
  background: rgba(247, 184, 75, 0.16);
  color: #ffe2a8;
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(247, 184, 75, 0.18), rgba(255, 255, 255, 0.08));
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(247, 184, 75, 0.2);
}

.nav-item.active .nav-icon {
  background: linear-gradient(145deg, #f7b84b, #d49437);
  color: #101921;
}

.sidebar-card {
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.07);
  margin-bottom: 14px;
}

.sidebar-card h3,
.card h3 {
  margin: 0 0 12px;
  font-size: 1.12rem;
}

.sidebar-card p {
  margin: 10px 0 0;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.72);
}

.ghost-btn,
.chip-btn,
.action-btn,
.mini-btn {
  border: none;
  border-radius: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: 0.18s ease;
}

.ghost-btn {
  width: 100%;
  display: block;
  padding: 12px 14px;
  margin-top: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.ghost-btn:hover,
.action-btn:hover,
.mini-btn:hover {
  transform: translateY(-1px);
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill,
.badge,
.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}

.pill {
  background: rgba(31, 78, 121, 0.12);
  color: var(--accent);
}

.pill.soft {
  background: rgba(198, 128, 47, 0.12);
  color: var(--accent-2);
}

.badge {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.badge.warning {
  background: rgba(247, 184, 75, 0.18);
  color: #fff3dc;
}

.main {
  padding: 18px 22px 36px;
  min-width: 0;
}

.hero {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.72)),
    linear-gradient(145deg, rgba(31, 78, 121, 0.1), rgba(198, 128, 47, 0.08));
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow: var(--shadow-strong);
  border-radius: var(--radius);
  padding: 28px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: start;
  margin-bottom: 22px;
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto -120px -120px auto;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(198, 128, 47, 0.16) 0%, rgba(198, 128, 47, 0) 68%);
  pointer-events: none;
}

.crm-bar {
  display: grid;
  grid-template-columns: minmax(260px, 1.1fr) minmax(320px, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 18px 20px;
  margin-bottom: 22px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(18, 32, 51, 0.94), rgba(31, 78, 121, 0.92));
  color: #f4f7fb;
  box-shadow: 0 20px 40px rgba(17, 28, 45, 0.18);
}

.crm-bar-main {
  display: flex;
  gap: 14px;
  align-items: center;
}

.crm-bar-main strong {
  display: block;
  font-size: 1rem;
  margin-bottom: 2px;
}

.crm-bar-main p {
  margin: 0;
  color: rgba(244, 247, 251, 0.7);
  font-size: 0.92rem;
}

.crm-tag {
  min-width: 88px;
  text-align: center;
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(247, 184, 75, 0.16);
  color: #ffe9bf;
  font-size: 0.77rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.crm-bar-search input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-radius: 16px;
  padding: 14px 16px;
  font: inherit;
}

.crm-bar-search input::placeholder {
  color: rgba(255, 255, 255, 0.55);
}

.crm-bar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.mini-chip {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-radius: 999px;
  padding: 10px 12px;
  font-family: inherit;
  font-weight: 800;
  font-size: 0.82rem;
  cursor: pointer;
  transition: 0.18s ease;
}

.mini-chip:hover {
  background: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
}

.hero h2 {
  margin: 0;
  font-size: clamp(2rem, 2.6vw, 3rem);
  line-height: 1.02;
}

.hero p {
  margin: 14px 0 0;
  max-width: 64ch;
  font-size: 1.03rem;
  color: var(--muted);
  line-height: 1.6;
}

.hero-badges {
  display: grid;
  gap: 10px;
  justify-items: end;
}

.hero-badges .badge {
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 24px rgba(17, 28, 45, 0.08);
}

.dashboard-grid,
.content-grid {
  display: grid;
  gap: 18px;
}

.dashboard-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.content-grid {
  grid-template-columns: minmax(0, 1.7fr) minmax(260px, 0.8fr);
}

.card {
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(255,255,255,0.88));
  backdrop-filter: blur(14px);
  border: 1px solid rgba(19, 38, 68, 0.08);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: none;
}

.card > * {
  position: relative;
  z-index: 1;
}

.card.accent {
  background:
    linear-gradient(180deg, rgba(31, 78, 121, 0.1), rgba(255, 255, 255, 0.76)),
    var(--panel);
}

.wide {
  grid-column: 1 / -1;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 18px;
}

.section-head h3 {
  margin-bottom: 6px;
}

.section-head p {
  margin: 0;
  color: var(--muted);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.kpi {
  padding: 16px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.72));
  border: 1px solid rgba(15, 28, 47, 0.08);
  box-shadow: 0 14px 28px rgba(17, 28, 45, 0.08);
}

.kpi strong {
  display: block;
  font-size: 1.6rem;
  margin-bottom: 4px;
}

.kpi span {
  color: var(--muted);
  font-size: 0.9rem;
}

.mini-bars,
.stack,
.factory-list,
.excluded-grid,
.queue,
.kanban,
.factory-grid {
  display: grid;
  gap: 12px;
}

.bar-row,
.stack-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 12px;
  align-items: center;
}

.bar {
  height: 12px;
  background: rgba(18, 32, 51, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.factory-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.factory-chip {
  border: 1px solid rgba(255, 255, 255, 0.72);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.72));
  border-radius: 18px;
  padding: 14px;
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
}

.factory-chip span,
.factory-card strong,
.queue-head strong,
.kanban-card strong,
.detail-title {
  font-weight: 800;
}

.factory-chip small,
.meta-line,
.subtle,
.queue-meta,
.detail-copy {
  color: var(--muted);
}

.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.filters.compact {
  justify-content: flex-end;
}

.filters input,
.filters select {
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.84);
  padding: 11px 12px;
  min-width: 170px;
  font: inherit;
}

.chip-btn {
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  color: var(--text);
}

.chip-btn.active {
  background: linear-gradient(180deg, var(--accent), var(--accent-deep));
  color: #fff;
  box-shadow: 0 16px 24px rgba(30, 79, 123, 0.22);
}

.factory-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.factory-card {
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 20px;
  padding: 16px;
  text-align: left;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.72));
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease;
}

.factory-card:hover,
.queue-card:hover,
.kanban-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-strong);
}

.factory-card.selected {
  border-color: rgba(31, 78, 121, 0.35);
  box-shadow: 0 0 0 4px rgba(31, 78, 121, 0.08), var(--shadow-soft);
}

.factory-table-wrap {
  margin-top: 8px;
}

.factory-table tbody tr {
  cursor: pointer;
}

.factory-table tbody tr.selected td {
  background: rgba(31, 78, 121, 0.08);
}

.factory-table .pill {
  margin-right: 4px;
}

.factory-card-top,
.queue-head,
.kanban-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.status-pill {
  background: rgba(31, 78, 121, 0.12);
  color: var(--accent);
}

.status-pill.success {
  background: rgba(47, 125, 79, 0.14);
  color: var(--success);
}

.status-pill.warning {
  background: rgba(190, 125, 18, 0.14);
  color: var(--warning);
}

.status-pill.danger {
  background: rgba(176, 69, 58, 0.14);
  color: var(--danger);
}

.status-pill.neutral {
  background: rgba(96, 112, 137, 0.12);
  color: var(--muted);
}

.detail-title {
  font-size: 1.2rem;
  margin-bottom: 10px;
}

.detail-block {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin-top: 12px;
}

.detail-block strong {
  display: block;
  margin-bottom: 6px;
}

.excluded-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.excluded-city {
  padding: 12px 14px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(176, 69, 58, 0.1), rgba(176, 69, 58, 0.06));
  border: 1px solid rgba(176, 69, 58, 0.12);
  font-weight: 700;
}

.table-wrap {
  overflow: auto;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  background: rgba(255, 255, 255, 0.74);
  box-shadow: var(--shadow-soft);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1050px;
}

th,
td {
  padding: 14px 12px;
  border-bottom: 1px solid rgba(18, 32, 51, 0.08);
  vertical-align: top;
  text-align: left;
}

th {
  background: linear-gradient(180deg, rgba(31, 78, 121, 0.09), rgba(31, 78, 121, 0.04));
  color: #24354d;
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  position: sticky;
  top: 0;
  z-index: 1;
}

tbody tr:hover {
  background: rgba(31, 78, 121, 0.04);
}

.action-btn,
.mini-btn {
  background: linear-gradient(180deg, var(--accent), var(--accent-deep));
  color: #fff;
  padding: 10px 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 0.87rem;
}

.action-btn:disabled,
.mini-btn:disabled,
.mini-chip:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.action-btn.alt,
.mini-btn.ghost {
  background: rgba(31, 78, 121, 0.1);
  color: var(--accent);
}

.queue {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.queue-card,
.kanban-card {
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 20px;
  padding: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.74));
  box-shadow: var(--shadow-soft);
}

.queue-actions,
.kanban-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.ai-grid {
  display: grid;
  grid-template-columns: minmax(340px, 0.95fr) minmax(340px, 1.05fr);
  gap: 18px;
}

.ai-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.7));
  box-shadow: var(--shadow-soft);
}

.ai-panel label {
  display: grid;
  gap: 8px;
}

.ai-panel label span {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 800;
}

.ai-panel input,
.ai-panel textarea,
.ai-panel select {
  width: 100%;
  border: 1px solid rgba(19, 38, 68, 0.12);
  background: rgba(255, 255, 255, 0.84);
  border-radius: 16px;
  padding: 12px 14px;
  color: var(--text);
  font: inherit;
}

.ai-panel textarea {
  resize: vertical;
  min-height: 180px;
}

.ai-panel.result {
  min-height: 100%;
}

.ai-result-head {
  align-items: flex-start;
}

.ai-result-head p {
  margin: 4px 0 0;
  color: var(--muted);
}

.ai-response {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.7;
  color: #24354d;
  background: rgba(18, 32, 51, 0.04);
  border: 1px solid rgba(18, 32, 51, 0.08);
  border-radius: 18px;
  padding: 18px;
  min-height: 360px;
}

.ai-error {
  margin: 0;
  color: var(--danger);
  font-weight: 700;
}

.tiny {
  font-size: 0.8rem;
}

.pipeline-workspace {
  display: block;
}

.pipeline-shell {
  padding-bottom: 12px;
}

.pipeline-head {
  align-items: flex-start;
  flex-wrap: wrap;
}

.pipeline-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.pipeline-search,
.pipeline-toolbar select {
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  padding: 10px 12px;
  font: inherit;
  min-width: 140px;
}

.pipeline-search {
  min-width: 200px;
}

.drag-hint {
  color: var(--accent-2);
  font-weight: 800;
}

.sf-path {
  display: grid;
  grid-template-columns: repeat(7, minmax(120px, 1fr));
  gap: 8px;
  margin-bottom: 16px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.sf-path-step {
  position: relative;
  border: 1px solid rgba(19, 38, 68, 0.1);
  background: linear-gradient(180deg, #fff, rgba(255, 255, 255, 0.86));
  border-radius: 14px;
  padding: 12px 12px 12px 14px;
  text-align: left;
  cursor: pointer;
  min-width: 130px;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
  overflow: hidden;
}

.sf-path-step:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
}

.sf-path-bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
}

.sf-path-label {
  display: block;
  font-weight: 800;
  font-size: 0.86rem;
  color: var(--text);
  margin-bottom: 4px;
}

.sf-path-meta {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 700;
}

.stage-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}

.kanban {
  grid-template-columns: repeat(7, minmax(300px, 1fr));
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 14px;
  gap: 14px;
  scroll-snap-type: x proximity;
  min-height: calc(100vh - 300px);
}

.kanban-fluid {
  align-items: stretch;
}

.kanban-col {
  min-width: 300px;
  max-width: 360px;
  scroll-snap-align: start;
  background: linear-gradient(180deg, rgba(246, 248, 252, 0.96), rgba(236, 241, 248, 0.9));
  border: 1px solid rgba(19, 38, 68, 0.1);
  border-radius: 14px;
  padding: 12px 12px 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), var(--shadow-soft);
  display: flex;
  flex-direction: column;
  min-height: 520px;
  max-height: calc(100vh - 260px);
}

.kanban-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 4px;
}

.kanban-head-left {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
}

.kanban-head-left strong {
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kanban-head span {
  background: rgba(31, 78, 121, 0.1);
  color: var(--accent);
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
  flex-shrink: 0;
}

.kanban-col-value {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--muted);
  margin-bottom: 10px;
}

.kanban-stack-wrap {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 220px;
  border-radius: 12px;
  transition:
    background 0.15s ease,
    box-shadow 0.15s ease,
    border-color 0.15s ease;
}

.kanban-stack-wrap.drop-active {
  background: color-mix(in srgb, var(--col-accent, #0176d3) 10%, transparent);
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--col-accent, #0176d3) 55%, transparent);
}

.kanban-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  min-height: 220px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px 4px 16px;
  margin: 0;
  scrollbar-width: thin;
  /* melhora hit-area de drop em colunas longas */
  touch-action: pan-y;
  scroll-padding-bottom: 16px;
}

.kanban-stack::-webkit-scrollbar {
  width: 6px;
}

.kanban-stack::-webkit-scrollbar-thumb {
  background: rgba(19, 38, 68, 0.18);
  border-radius: 999px;
}

.kanban-empty {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  margin: 0;
  padding: 22px 12px;
  border: 1.5px dashed rgba(19, 38, 68, 0.18);
  border-radius: 14px;
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  pointer-events: none;
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    color 0.15s ease;
}

.kanban-empty.empty-hot {
  border-color: color-mix(in srgb, var(--col-accent, #0176d3) 70%, transparent);
  background: color-mix(in srgb, var(--col-accent, #0176d3) 8%, #fff);
  color: var(--col-accent, #0176d3);
}

.kanban-live-hint {
  margin: 0 0 10px;
  padding: 8px 12px;
  border-radius: 8px;
  background: #032d60;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  text-align: center;
  animation: kanban-hint-in 0.18s ease;
}

@keyframes kanban-hint-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.kanban-card {
  border: 1px solid rgba(19, 38, 68, 0.12);
  border-radius: 12px;
  padding: 0;
  background: #fff;
  box-shadow: 0 4px 12px rgba(17, 28, 45, 0.06);
  border-left: 4px solid var(--stage-color, var(--accent));
  cursor: grab;
  transition:
    box-shadow 0.18s cubic-bezier(0.2, 0, 0, 1),
    transform 0.18s cubic-bezier(0.2, 0, 0, 1),
    border-color 0.18s ease,
    opacity 0.15s ease;
  user-select: none;
  -webkit-user-select: none;
  overflow: visible;
  touch-action: pan-y;
  flex-shrink: 0; /* não comprime o card na lista */
  min-height: 118px;
}

.kanban-card:active {
  cursor: grabbing;
}

.kanban-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(17, 28, 45, 0.12);
  z-index: 2;
}

body.is-dragging-kanban .kanban-card:hover {
  transform: none;
}

.kanban-card-top {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 12px 12px 0;
}

.kanban-handle {
  border: none;
  background: rgba(19, 38, 68, 0.06);
  color: var(--muted);
  border-radius: 6px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  cursor: grab;
  font-size: 0.8rem;
  letter-spacing: -2px;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
  pointer-events: none;
}

.kanban-handle:active {
  cursor: grabbing;
}

.kanban-card-title {
  min-width: 0;
  cursor: pointer;
}

/* Nome do cliente — legível, até 3 linhas, sem sumir */
.kanban-client-name {
  display: -webkit-box !important;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden !important;
  text-overflow: ellipsis;
  white-space: normal !important;
  word-break: break-word;
  overflow-wrap: anywhere;
  font-size: 0.95rem !important;
  font-weight: 800 !important;
  line-height: 1.3 !important;
  letter-spacing: -0.015em;
  color: #0f1c2e;
  margin: 0;
}

.kanban-client-sub {
  margin-top: 3px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #5c6d84;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  line-clamp: 1;
  overflow: hidden;
}

.kanban-card-body {
  padding: 8px 12px 6px;
  cursor: pointer;
}

.kanban-card-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.kanban-card-tags .status-pill {
  font-size: 0.68rem;
  min-height: 22px;
  padding: 2px 8px;
  flex-shrink: 0;
}

.kanban-loc {
  font-size: 0.75rem;
  font-weight: 650;
  color: #5c6d84;
  line-height: 1.25;
}

.kanban-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 0 0 4px;
}

.kanban-metrics span {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(31, 78, 121, 0.08);
  color: #15385a;
}

.kanban-extra {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-size: 0.72rem;
  color: #6b7c93;
  font-weight: 600;
  margin-top: 2px;
}

.kanban-col.is-drop-target {
  background: color-mix(in srgb, var(--col-accent, #0176d3) 8%, #f5f7fb);
  border-color: color-mix(in srgb, var(--col-accent, #0176d3) 45%, transparent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--col-accent, #0176d3) 25%, transparent);
}

.kanban-col.is-source {
  opacity: 0.92;
}

/* legado — títulos agora usam .kanban-client-name */
.kanban-card-title strong {
  /* fallback se algum card antigo restar */
  white-space: normal;
}

.kanban-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 8px 10px 10px;
  border-top: 1px solid rgba(19, 38, 68, 0.06);
  background: rgba(248, 250, 252, 0.9);
}

.kanban-actions .mini-btn {
  padding: 7px 9px;
  font-size: 0.75rem;
  border-radius: 10px;
}

/* Sortable / drag states — fluidez Salesforce-like */
.kanban-ghost {
  opacity: 1 !important;
  background: color-mix(in srgb, var(--stage-color, #0176d3) 12%, #fff) !important;
  border: 2px dashed color-mix(in srgb, var(--stage-color, #0176d3) 55%, transparent) !important;
  border-left: 3px solid var(--stage-color, #0176d3) !important;
  box-shadow: none !important;
  transform: none !important;
  border-radius: 14px !important;
}

.kanban-ghost * {
  opacity: 0.15 !important;
}

.kanban-chosen {
  box-shadow: 0 20px 44px rgba(17, 28, 45, 0.24) !important;
  transform: scale(1.015);
  z-index: 30;
  opacity: 0.96;
}

.kanban-drag,
.kanban-drag-fallback,
.sortable-fallback {
  opacity: 1 !important;
  transform: rotate(2deg) scale(1.04) !important;
  box-shadow:
    0 28px 56px rgba(17, 28, 45, 0.32),
    0 0 0 1px rgba(1, 118, 211, 0.25) !important;
  cursor: grabbing !important;
  border-radius: 14px !important;
  background: #fff !important;
  z-index: 9999 !important;
  pointer-events: none !important;
}

.kanban-drag-fallback,
.sortable-fallback {
  width: var(--kanban-drag-w, 260px) !important;
  max-width: var(--kanban-drag-w, 260px) !important;
  height: auto !important;
  min-height: var(--kanban-drag-h, auto);
}

body.is-dragging-kanban {
  cursor: grabbing !important;
  user-select: none;
}

body.is-dragging-kanban .kanban-col {
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    opacity 0.15s ease;
}

body.is-dragging-kanban .kanban-stack {
  background: rgba(31, 78, 121, 0.025);
  border-radius: 12px;
}

body.is-dragging-kanban .kanban-actions {
  pointer-events: none;
  opacity: 0.55;
}

/* Compacto: menos meta, mas NOME sempre legível */
.kanban.compact .kanban-extra,
.kanban.compact .kanban-client-sub {
  display: none;
}

.kanban.compact .kanban-card {
  border-radius: 10px;
  min-height: 96px;
}

.kanban.compact .kanban-client-name {
  -webkit-line-clamp: 2;
  line-clamp: 2;
  font-size: 0.9rem !important;
}

.kanban.compact .kanban-metrics {
  margin: 2px 0;
}

.kanban.compact .kanban-stack {
  gap: 10px;
}

.kanban.compact .crm-actions.compact {
  padding: 4px 6px;
}

.kanban.dragging .kanban-card:not(.kanban-chosen):not(.kanban-drag) {
  transition: transform 0.22s cubic-bezier(0.2, 0, 0, 1);
}

/* Sortable injecta isso no body */
.sortable-drag {
  opacity: 0 !important;
}

@media (prefers-reduced-motion: reduce) {
  .kanban-card,
  .kanban-ghost,
  .kanban-chosen,
  .kanban-drag,
  .kanban-live-hint {
    transition: none !important;
    animation: none !important;
    transform: none !important;
  }
}

.script {
  white-space: pre-wrap;
  line-height: 1.75;
  color: #24354d;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.78);
}

.list {
  margin: 0;
  padding-left: 18px;
  color: #24354d;
  display: grid;
  gap: 8px;
}

.list li {
  line-height: 1.55;
}

em {
  color: var(--accent-2);
  font-style: normal;
}

.crm-bar,
.hero,
.card,
.factory-card,
.queue-card,
.kanban-col,
.table-wrap {
  backdrop-filter: blur(18px);
}

.card h3,
.sidebar-card h3 {
  letter-spacing: -0.02em;
}

.main {
  max-width: 1680px;
}

@media (max-width: 1180px) {
  #app {
    grid-template-columns: 1fr;
  }

  .dashboard-grid,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .factory-grid,
  .factory-list,
  .queue,
  .excluded-grid,
  .kpi-grid {
    grid-template-columns: 1fr 1fr;
  }

  .ai-grid {
    grid-template-columns: 1fr;
  }
}

.toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}

.client-row {
  cursor: pointer;
}

.client-row:hover {
  background: rgba(31, 78, 121, 0.06);
}

.row-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.clickable-row {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.72);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.72));
  border-radius: 16px;
  padding: 12px 14px;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  box-shadow: var(--shadow-soft);
}

.clickable-row:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-strong);
}

.wide-row {
  grid-template-columns: 1fr auto !important;
}

.agenda-reason {
  color: var(--accent-2) !important;
  font-weight: 700;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 18, 30, 0.45);
  backdrop-filter: blur(4px);
  z-index: 40;
}

.client-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(460px, 100vw);
  height: 100vh;
  overflow: auto;
  z-index: 50;
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 244, 237, 0.98)),
    #fff;
  border-left: 1px solid rgba(19, 38, 68, 0.1);
  box-shadow: -24px 0 60px rgba(17, 28, 45, 0.22);
}

.drawer-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.drawer-head h2 {
  margin: 4px 0 0;
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.45rem;
  line-height: 1.15;
}

.drawer-grid {
  display: grid;
  gap: 4px;
  margin-top: 12px;
}

.drawer-actions {
  margin: 16px 0;
}

.client-drawer textarea {
  width: 100%;
  border: 1px solid rgba(19, 38, 68, 0.12);
  background: rgba(255, 255, 255, 0.9);
  border-radius: 14px;
  padding: 12px 14px;
  color: var(--text);
  font: inherit;
  resize: vertical;
  margin-top: 8px;
}

.timeline {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.timeline-item {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(31, 78, 121, 0.05);
  border: 1px solid rgba(31, 78, 121, 0.08);
  line-height: 1.45;
}

.timeline-meta {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 4px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 80;
  background: #122033;
  color: #fff;
  padding: 12px 18px;
  border-radius: 999px;
  font-weight: 700;
  box-shadow: 0 16px 40px rgba(17, 28, 45, 0.28);
  animation: toast-in 0.2s ease;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

@media (max-width: 760px) {
  .main {
    padding: 16px;
  }

  .factory-grid,
  .factory-list,
  .queue,
  .excluded-grid,
  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .filters {
    width: 100%;
  }

  .filters input,
  .filters select {
    width: 100%;
    min-width: 0;
  }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .client-drawer {
    width: 100vw;
  }
}


/* ——— UX polish layer ——— */
*:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

button, input, select, textarea {
  font-family: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

/* Topbar */
.topbar {
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) auto;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(19, 38, 68, 0.08);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 12px;
  z-index: 20;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.page-title .eyebrow {
  color: var(--muted);
  margin-bottom: 0;
  font-size: 0.68rem;
}

.page-title h2 {
  margin: 2px 0 0;
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.1;
}

.page-icon {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: rgba(26, 77, 122, 0.1);
  color: var(--accent);
  font-size: 0.85rem;
}

.topbar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 28, 46, 0.04);
  border: 1px solid rgba(19, 38, 68, 0.1);
  border-radius: 14px;
  padding: 0 12px;
  min-height: 44px;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease), background 0.15s var(--ease);
}

.topbar-search.focused {
  background: #fff;
  border-color: rgba(26, 77, 122, 0.35);
  box-shadow: var(--focus);
}

.topbar-search input {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 10px 0;
  font: inherit;
  color: var(--text);
  min-width: 0;
  outline: none;
  box-shadow: none !important;
}

.topbar-search input::placeholder {
  color: rgba(92, 109, 132, 0.85);
}

.search-icon {
  color: var(--muted);
  font-size: 1rem;
  opacity: 0.8;
}

.search-clear {
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--muted);
  background: rgba(19, 38, 68, 0.06);
  border-radius: 8px;
  padding: 4px 8px;
  cursor: pointer;
  border: 0;
}

.search-clear:hover {
  background: rgba(19, 38, 68, 0.1);
  color: var(--text);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.top-chip {
  border: 1px solid rgba(19, 38, 68, 0.1);
  background: #fff;
  color: var(--text);
  border-radius: 999px;
  padding: 8px 12px;
  font: inherit;
  font-weight: 750;
  font-size: 0.82rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: 0.15s var(--ease);
}

.top-chip em {
  font-style: normal;
  background: rgba(26, 77, 122, 0.1);
  color: var(--accent);
  border-radius: 999px;
  min-width: 20px;
  padding: 1px 6px;
  font-size: 0.72rem;
  font-weight: 800;
  text-align: center;
}

.top-chip:hover {
  border-color: rgba(26, 77, 122, 0.25);
  transform: translateY(-1px);
}

.top-chip.active {
  background: linear-gradient(180deg, var(--accent), var(--accent-deep));
  color: #fff;
  border-color: transparent;
}

.top-chip.active em {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.top-chip.ghost {
  background: rgba(26, 77, 122, 0.06);
  color: var(--accent);
}

.topbar-user {
  display: grid;
  place-items: center;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(19, 38, 68, 0.1);
  background: #fff;
  color: var(--text);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 1rem;
  transition: 0.15s var(--ease);
}

.icon-btn:hover {
  background: rgba(26, 77, 122, 0.06);
}

.mobile-nav-btn {
  display: none;
}

/* Stats strip */
.stats-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.stat-pill {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 110px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(19, 38, 68, 0.08);
  box-shadow: 0 6px 16px rgba(17, 28, 45, 0.04);
}

.stat-pill strong {
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  font-weight: 800;
  color: var(--text);
}

.stat-label {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.stat-pill.warn {
  background: rgba(176, 69, 58, 0.08);
  border-color: rgba(176, 69, 58, 0.14);
}

.stat-pill.warn strong {
  color: var(--danger);
}

.stat-pill.soft {
  background: rgba(194, 122, 36, 0.08);
  border-color: rgba(194, 122, 36, 0.14);
}

/* Sidebar extras */
.user-card .user-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.user-meta strong {
  display: block;
  font-size: 0.92rem;
  line-height: 1.2;
}

.user-meta p,
.user-card .user-row p {
  margin: 2px 0 0 !important;
  color: rgba(255, 255, 255, 0.55) !important;
  font-size: 0.75rem !important;
  font-weight: 600;
}

.user-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 12px;
}

.user-stats span {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 8px;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.6);
}

.user-stats b {
  display: block;
  color: #fff;
  font-size: 0.95rem;
  margin-bottom: 1px;
}

.logout-btn {
  margin-top: 10px !important;
  padding: 9px 12px !important;
  font-size: 0.85rem;
  border-radius: 11px !important;
}

.sidebar-foot {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-foot p {
  margin: 10px 0 0;
  font-size: 0.75rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.42);
}

.sidebar .pill {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.72rem;
  min-height: 26px;
}

.nav-scrim {
  display: none;
}

/* Empty states */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  border-radius: 18px;
  border: 1px dashed rgba(19, 38, 68, 0.14);
  background: rgba(255, 255, 255, 0.5);
  margin-top: 8px;
}

.empty-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 12px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: rgba(26, 77, 122, 0.08);
  color: var(--accent);
  font-size: 1.3rem;
}

.empty-state h4 {
  margin: 0 0 6px;
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.2rem;
}

.empty-state p {
  margin: 0 auto 16px;
  max-width: 42ch;
  color: var(--muted);
  line-height: 1.5;
}

/* KPI polish */
.kpi {
  position: relative;
  overflow: hidden;
}

.kpi strong {
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.kpi-grid .kpi:nth-child(1) { border-top: 3px solid var(--accent); }
.kpi-grid .kpi:nth-child(2) { border-top: 3px solid var(--success); }
.kpi-grid .kpi:nth-child(3) { border-top: 3px solid var(--warning); }
.kpi-grid .kpi:nth-child(4) { border-top: 3px solid var(--accent-2); }

/* Buttons polish */
.action-btn,
.mini-btn {
  border-radius: 12px;
  font-weight: 750;
  letter-spacing: -0.01em;
  box-shadow: 0 8px 18px rgba(26, 77, 122, 0.14);
}

.action-btn.alt,
.mini-btn.ghost {
  box-shadow: none;
}

.action-btn:active,
.mini-btn:active,
.top-chip:active {
  transform: translateY(0) scale(0.98);
}

/* Table polish */
.table-wrap {
  border-radius: 16px;
}

tbody tr {
  transition: background 0.12s ease;
  cursor: pointer;
}

tbody tr:hover {
  background: rgba(26, 77, 122, 0.05);
}

th {
  font-size: 0.75rem !important;
}

/* Queue cards */
.queue-card {
  transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease), border-color 0.15s var(--ease);
  border: 1px solid rgba(19, 38, 68, 0.08);
}

.queue-card:hover {
  border-color: rgba(26, 77, 122, 0.2);
}

.agenda-reason {
  font-weight: 650;
  color: #2a3d56 !important;
  line-height: 1.4;
}

/* Kanban polish */
.kanban-col {
  background: linear-gradient(180deg, #f5f7fb 0%, #eef2f8 100%);
  border: 1px solid rgba(19, 38, 68, 0.08);
}

.kanban-card {
  border: 1px solid rgba(19, 38, 68, 0.08);
  border-left: 3px solid var(--stage-color, var(--accent));
  border-radius: 14px !important;
  padding: 12px !important;
  box-shadow: 0 6px 16px rgba(17, 28, 45, 0.06);
  transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

.kanban-card:hover {
  box-shadow: 0 12px 28px rgba(17, 28, 45, 0.12);
}

.kanban-handle {
  opacity: 0.45;
}

.kanban-card:hover .kanban-handle {
  opacity: 1;
}

.kanban-empty {
  border: 1px dashed rgba(19, 38, 68, 0.14);
  background: rgba(255, 255, 255, 0.45);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 650;
  display: grid;
  place-items: center;
  min-height: 72px;
  border-radius: 12px;
  margin-top: 8px;
}

.sf-path-step {
  border-radius: 12px;
}

/* Drawer polish */
.client-drawer {
  width: min(440px, 100vw);
  animation: drawer-in 0.22s var(--ease);
  padding: 20px 18px 40px;
}

@keyframes drawer-in {
  from { transform: translateX(18px); opacity: 0.6; }
  to { transform: translateX(0); opacity: 1; }
}

.drawer-backdrop {
  animation: fade-in 0.18s ease;
  background: rgba(10, 18, 30, 0.42);
  backdrop-filter: blur(6px);
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.drawer-close {
  flex-shrink: 0;
}

.drawer-head h2 {
  font-size: 1.35rem;
}

/* Toast */
.toast {
  backdrop-filter: blur(10px);
  background: rgba(15, 28, 46, 0.94);
  letter-spacing: -0.01em;
  max-width: min(90vw, 420px);
  text-align: center;
}

/* Login polish */
#app.auth-only {
  display: block;
  grid-template-columns: none;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 16px;
  position: relative;
  overflow: hidden;
}

.login-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  pointer-events: none;
  z-index: 0;
}

.login-orb-a {
  width: 340px;
  height: 340px;
  top: -80px;
  right: -60px;
  background: rgba(247, 184, 75, 0.28);
}

.login-orb-b {
  width: 300px;
  height: 300px;
  bottom: -60px;
  left: -40px;
  background: rgba(26, 77, 122, 0.18);
}

.login-card {
  position: relative;
  z-index: 1;
  width: min(460px, 100%);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 24px;
  box-shadow: var(--shadow-strong);
  padding: 28px 24px 20px;
  backdrop-filter: blur(18px);
}

.login-brand {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 20px;
}

.login-brand h1 {
  margin: 4px 0 2px;
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.55rem;
  letter-spacing: -0.03em;
}

.brand-mark.lg {
  width: 54px;
  height: 54px;
  font-size: 1.05rem;
}

.login-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 14px 0 8px;
}

.login-users {
  display: grid;
  gap: 8px;
}

.login-user {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  width: 100%;
  border: 1px solid rgba(19, 38, 68, 0.1);
  background: rgba(255, 255, 255, 0.8);
  border-radius: 14px;
  padding: 10px 12px;
  cursor: pointer;
  color: inherit;
  font: inherit;
  transition: 0.15s var(--ease);
}

.login-user-text {
  flex: 1;
  min-width: 0;
}

.login-user strong {
  display: block;
  font-size: 0.94rem;
}

.login-user small {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  margin-top: 2px;
}

.login-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 800;
  color: transparent;
  background: rgba(19, 38, 68, 0.06);
  flex-shrink: 0;
}

.login-user:hover {
  border-color: rgba(26, 77, 122, 0.28);
  transform: translateY(-1px);
}

.login-user.active {
  border-color: var(--accent);
  box-shadow: var(--focus);
  background: #fff;
}

.login-user.active .login-check {
  background: var(--accent);
  color: #fff;
}

.login-avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.78rem;
  color: #fff;
  background: linear-gradient(135deg, #1a4d7a, #c27a24);
  flex-shrink: 0;
}

.login-avatar.sm {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 0.72rem;
}

.login-avatar.xs {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  font-size: 0.7rem;
}

.login-pin-wrap {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.login-pin {
  width: 100%;
  border: 1px solid rgba(19, 38, 68, 0.12);
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  background: #fff;
  color: var(--text);
  letter-spacing: 0.15em;
}

.login-submit {
  min-width: 110px;
  margin: 0 !important;
  box-shadow: 0 10px 22px rgba(26, 77, 122, 0.2);
}

.login-error {
  color: var(--danger);
  font-weight: 700;
  font-size: 0.9rem;
  margin: 10px 0 0;
}

.login-help {
  margin-top: 16px;
  border-top: 1px solid rgba(19, 38, 68, 0.08);
  padding-top: 12px;
}

.login-help summary {
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 750;
  color: var(--muted);
  list-style: none;
}

.login-help summary::-webkit-details-marker { display: none; }

.login-help p {
  margin: 8px 0 0;
  line-height: 1.5;
}

.login-help code {
  background: rgba(26, 77, 122, 0.08);
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 0.85em;
}

/* Content transitions */
.dashboard-grid,
.content-grid,
.pipeline-workspace {
  animation: content-in 0.22s var(--ease);
}

@keyframes content-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Hide obsolete large hero if present */
.hero {
  display: none !important;
}

.crm-bar {
  display: none !important;
}

/* Responsive */
@media (max-width: 1180px) {
  #app {
    grid-template-columns: 1fr;
  }

  .mobile-nav-btn {
    display: grid;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: min(300px, 88vw);
    transform: translateX(-105%);
    transition: transform 0.22s var(--ease);
    box-shadow: 24px 0 60px rgba(0, 0, 0, 0.25);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .nav-scrim {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(10, 18, 30, 0.45);
    backdrop-filter: blur(3px);
    z-index: 25;
  }

  .topbar {
    grid-template-columns: 1fr;
    top: 8px;
  }

  .topbar-actions {
    justify-content: flex-start;
  }

  .topbar-search {
    order: 3;
  }
}

@media (max-width: 760px) {
  .main {
    padding: 12px 12px 28px;
  }

  .stats-strip {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .stat-pill {
    min-width: 0;
  }

  .page-title h2 {
    font-size: 1.15rem;
  }

  .login-pin-wrap {
    grid-template-columns: 1fr;
  }

  .login-submit {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* =========================================================
   Salesforce Lightning Experience skin
   ========================================================= */
body:has(#app:not(.auth-only)),
#app:not(.auth-only) {
  --sf-brand: #0176d3;
  --sf-brand-dark: #014486;
  --sf-navy: #032d60;
  --sf-header: #16325c;
  --sf-bg: #f3f3f3;
  --sf-surface: #ffffff;
  --sf-border: #c9c9c9;
  --sf-border-soft: #e5e5e5;
  --sf-text: #181818;
  --sf-muted: #706e6b;
  --sf-success: #2e844a;
  --sf-warning: #dd7a01;
  --sf-error: #ba0517;
  --accent: #0176d3;
  --accent-deep: #014486;
  --text: #181818;
  --muted: #706e6b;
  --line: #e5e5e5;
  --radius: 8px;
  --radius-sm: 6px;
  --sidebar-w: 220px;
  --shadow-soft: 0 2px 4px rgba(0, 0, 0, 0.07);
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-strong: 0 4px 16px rgba(0, 0, 0, 0.12);
  --focus: 0 0 0 2px #fff, 0 0 0 4px #0176d3;
}

#app:not(.auth-only) {
  display: block;
  grid-template-columns: none;
  min-height: 100vh;
  background: var(--sf-bg);
  font-family: Inter, "Salesforce Sans", system-ui, sans-serif;
}

#app:not(.auth-only)::before {
  display: none;
}

#app:not(.auth-only) body,
body:has(#app:not(.auth-only)) {
  background: var(--sf-bg);
}

.sf-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--sf-bg);
}

/* Global header */
.sf-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: auto minmax(240px, 1fr) auto;
  gap: 16px;
  align-items: center;
  min-height: 50px;
  padding: 0 12px;
  background: linear-gradient(180deg, #032d60 0%, #16325c 100%);
  color: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.sf-header-left,
.sf-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sf-app-launcher {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  display: grid;
  grid-template-columns: repeat(3, 6px);
  gap: 3px;
  place-content: center;
  cursor: pointer;
  padding: 8px;
}

.sf-app-launcher span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #fff;
  opacity: 0.9;
}

.sf-app-launcher:hover {
  background: rgba(255, 255, 255, 0.12);
}

.sf-app-name strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.sf-app-name small {
  display: block;
  font-size: 0.68rem;
  opacity: 0.7;
  font-weight: 500;
}

.sf-global-search {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 560px;
  width: 100%;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 20px;
  padding: 0 14px;
  min-height: 34px;
  transition: 0.15s ease;
}

.sf-global-search.focused {
  background: #fff;
  color: var(--sf-text);
  border-color: #fff;
}

.sf-global-search input {
  flex: 1;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.88rem;
  padding: 7px 0;
  outline: none;
  box-shadow: none !important;
}

.sf-global-search input::placeholder {
  color: rgba(255, 255, 255, 0.65);
}

.sf-global-search.focused input::placeholder {
  color: var(--sf-muted);
}

.sf-header-link {
  border: 0;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.sf-header-link:hover {
  background: rgba(255, 255, 255, 0.12);
}

.sf-header-link em {
  font-style: normal;
  background: #ba0517;
  border-radius: 999px;
  min-width: 18px;
  padding: 0 5px;
  font-size: 0.7rem;
  font-weight: 800;
  text-align: center;
}

.sf-user-menu {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 8px;
  border-left: 1px solid rgba(255, 255, 255, 0.15);
}

.sf-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #0176d3;
  font-size: 0.68rem;
  font-weight: 800;
}

.sf-user-meta strong {
  display: block;
  font-size: 0.78rem;
  line-height: 1.15;
}

.sf-user-meta small {
  display: block;
  font-size: 0.68rem;
  opacity: 0.7;
}

.sf-logout {
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: transparent;
  color: #fff;
  border-radius: 4px;
  padding: 4px 8px;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
}

.sf-logout:hover {
  background: rgba(255, 255, 255, 0.12);
}

.sf-app-menu {
  position: fixed;
  top: 52px;
  left: 12px;
  width: min(420px, calc(100vw - 24px));
  background: #fff;
  color: var(--sf-text);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  padding: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  z-index: 50;
}

.sf-app-menu-title {
  grid-column: 1 / -1;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--sf-muted);
  padding: 4px 6px 8px;
}

.sf-app-tile {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 10px;
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--sf-text);
}

.sf-app-tile:hover {
  background: #f3f3f3;
}

.sf-app-tile-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: #eef4ff;
  color: var(--sf-brand);
}

/* Body layout */
.sf-body {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  flex: 1;
  min-height: 0;
}

#app:not(.auth-only) .sidebar.sf-nav {
  position: sticky;
  top: 50px;
  height: calc(100vh - 50px);
  background: #fff;
  color: var(--sf-text);
  border-right: 1px solid var(--sf-border-soft);
  padding: 12px 8px 16px;
  box-shadow: none;
  z-index: 15;
}

#app:not(.auth-only) .nav-group-label {
  color: var(--sf-muted);
  font-size: 0.65rem;
}

#app:not(.auth-only) .nav-item {
  color: #444;
  border-radius: 6px;
  padding: 8px 8px;
  font-size: 0.86rem;
  font-weight: 600;
}

#app:not(.auth-only) .nav-icon {
  background: #f3f3f3;
  color: #444;
  border-radius: 6px;
  width: 26px;
  height: 26px;
}

#app:not(.auth-only) .nav-item:hover {
  background: #f3f3f3;
  color: var(--sf-text);
}

#app:not(.auth-only) .nav-item.active {
  background: #eef4ff;
  color: var(--sf-brand);
  box-shadow: none;
}

#app:not(.auth-only) .nav-item.active .nav-icon {
  background: var(--sf-brand);
  color: #fff;
}

#app:not(.auth-only) .sidebar-foot p,
#app:not(.auth-only) .sidebar .pill {
  color: var(--sf-muted);
  background: #f3f3f3;
}

#app:not(.auth-only) .sidebar-foot {
  border-top-color: var(--sf-border-soft);
}

/* Workspace */
.sf-workspace.main {
  padding: 0 0 40px;
  max-width: none;
  background: var(--sf-bg);
}

.sf-page-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  padding: 16px 20px 12px;
  background: #fff;
  border-bottom: 1px solid var(--sf-border-soft);
}

.sf-page-header-main {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  min-width: 0;
}

.sf-object-icon {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #7f8de1;
  color: #fff;
  font-size: 1.2rem;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.sf-object-icon.sm {
  width: 40px;
  height: 40px;
  font-size: 1rem;
  background: #7f8de1;
}

.sf-object-type {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--sf-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sf-page-header h1 {
  margin: 2px 0 4px;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-family: Inter, system-ui, sans-serif;
}

.sf-page-sub {
  margin: 0;
  color: var(--sf-muted);
  font-size: 0.84rem;
}

.sf-page-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.sf-btn {
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 0 12px;
  min-height: 32px;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: 0.12s ease;
}

.sf-btn.brand {
  background: var(--sf-brand);
  color: #fff;
}

.sf-btn.brand:hover {
  background: var(--sf-brand-dark);
}

.sf-btn.neutral {
  background: #fff;
  border-color: var(--sf-border);
  color: var(--sf-brand);
}

.sf-btn.neutral:hover {
  background: #f3f3f3;
}

.sf-highlight {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  background: #fff;
  border-bottom: 1px solid var(--sf-border-soft);
  margin-bottom: 12px;
}

.sf-hl-item {
  padding: 12px 16px;
  border-right: 1px solid var(--sf-border-soft);
}

.sf-hl-item:last-child {
  border-right: 0;
}

.sf-hl-item span {
  display: block;
  font-size: 0.72rem;
  color: var(--sf-muted);
  font-weight: 600;
  margin-bottom: 4px;
}

.sf-hl-item strong {
  font-size: 1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.sf-hl-item strong.danger {
  color: var(--sf-error);
}

/* Cards become SF white panels */
#app:not(.auth-only) .card {
  background: #fff;
  border: 1px solid var(--sf-border-soft);
  border-radius: 4px;
  box-shadow: none;
  backdrop-filter: none;
}

#app:not(.auth-only) .card::before {
  content: none;
}

#app:not(.auth-only) .card h3,
#app:not(.auth-only) .section-head h3 {
  font-family: Inter, system-ui, sans-serif;
  font-weight: 700;
  font-size: 1rem;
}

#app:not(.auth-only) .main > .dashboard-grid,
#app:not(.auth-only) .main > .content-grid,
#app:not(.auth-only) .main > .pipeline-workspace,
#app:not(.auth-only) .main > .sf-split {
  padding: 0 16px 16px;
}

/* Split view */
.sf-split {
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(340px, 1.15fr);
  gap: 12px;
  align-items: start;
  min-height: calc(100vh - 220px);
}

.sf-split:not(.has-record) {
  grid-template-columns: 1fr;
}

.sf-list-panel {
  min-height: 480px;
  max-height: calc(100vh - 200px);
  overflow: auto;
  padding: 0 !important;
}

.sf-list-head {
  padding: 12px 14px;
  border-bottom: 1px solid var(--sf-border-soft);
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 2;
  margin-bottom: 0 !important;
}

.sf-link-btn {
  border: 0;
  background: none;
  color: var(--sf-brand);
  font: inherit;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  margin-left: 8px;
  padding: 0;
}

.sf-record-list {
  display: flex;
  flex-direction: column;
}

.sf-list-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--sf-border-soft);
  background: #fff;
  text-align: left;
  padding: 10px 12px;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.sf-list-row:hover {
  background: #f3f3f3;
}

.sf-list-row.selected {
  background: #eef4ff;
  box-shadow: inset 3px 0 0 var(--sf-brand);
}

.sf-list-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #e5e5e5;
  color: #444;
  font-size: 0.68rem;
  font-weight: 800;
}

.sf-list-body strong {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sf-list-body small {
  display: block;
  color: var(--sf-muted);
  font-size: 0.75rem;
  margin-top: 2px;
}

.sf-list-meta {
  display: grid;
  justify-items: end;
  gap: 4px;
}

.sf-list-meta em {
  font-style: normal;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--sf-text);
}

.sf-list-pager {
  padding: 10px;
  border-top: 1px solid var(--sf-border-soft);
  justify-content: center;
}

/* Record panel */
.sf-record-panel {
  position: sticky;
  top: 62px;
  max-height: calc(100vh - 72px);
  overflow: auto;
  padding: 0 !important;
}

.sf-record-header {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--sf-border-soft);
}

.sf-record-title {
  flex: 1;
  min-width: 0;
}

.sf-record-title h2 {
  margin: 2px 0 2px;
  font-size: 1.2rem;
  font-family: Inter, system-ui, sans-serif;
  font-weight: 700;
  line-height: 1.2;
}

.sf-record-title p {
  margin: 0;
  color: var(--sf-muted);
  font-size: 0.84rem;
}

/* Path chevrons like Salesforce */
.sf-path-record {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 2px;
  padding: 12px 10px;
  background: #fafaf9;
  border-bottom: 1px solid var(--sf-border-soft);
}

.sf-path-chevr {
  position: relative;
  border: 0;
  background: #c9c7c5;
  color: #181818;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 8px 18px 8px 22px;
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%, 10px 50%);
  cursor: pointer;
  white-space: nowrap;
  min-width: max-content;
}

.sf-path-chevr:first-child {
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%);
  padding-left: 12px;
}

.sf-path-chevr.complete {
  background: #2e844a;
  color: #fff;
}

.sf-path-chevr.current {
  background: #0176d3;
  color: #fff;
}

.sf-path-chevr:hover {
  filter: brightness(0.95);
}

.sf-record-highlight {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  border-bottom: 1px solid var(--sf-border-soft);
}

.sf-record-highlight > div {
  padding: 10px 14px;
  border-right: 1px solid var(--sf-border-soft);
  border-bottom: 1px solid var(--sf-border-soft);
}

.sf-record-highlight span {
  display: block;
  font-size: 0.7rem;
  color: var(--sf-muted);
  font-weight: 600;
}

.sf-record-highlight strong {
  font-size: 0.9rem;
}

.sf-record-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--sf-border-soft);
  padding: 0 8px;
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 1;
}

.sf-record-tabs button {
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--sf-muted);
  padding: 12px 14px;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
}

.sf-record-tabs button.active {
  color: var(--sf-brand);
  border-bottom-color: var(--sf-brand);
}

.sf-record-body {
  padding: 12px 14px 20px;
}

.sf-field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
  margin-bottom: 12px;
}

.sf-field span {
  display: block;
  font-size: 0.72rem;
  color: var(--sf-muted);
  font-weight: 600;
  margin-bottom: 2px;
}

.sf-field strong {
  font-size: 0.9rem;
  font-weight: 600;
  word-break: break-word;
}

.sf-related {
  display: grid;
  gap: 10px;
}

.sf-related-card {
  border: 1px solid var(--sf-border-soft);
  border-radius: 4px;
  padding: 12px;
  background: #fafaf9;
}

.sf-related-card h4 {
  margin: 0 0 8px;
  font-size: 0.86rem;
  color: var(--sf-brand);
}

.sf-related-card p {
  margin: 4px 0;
  font-size: 0.88rem;
}

.sf-record-empty {
  margin: 24px 16px;
}

/* Kanban SF density */
#app:not(.auth-only) .kanban-col {
  background: #f3f3f3;
  border: 1px solid var(--sf-border-soft);
  border-radius: 8px;
  box-shadow: none;
  min-width: 300px;
  max-width: 360px;
}

#app:not(.auth-only) .kanban-card {
  border-radius: 10px !important;
  border: 1px solid var(--sf-border-soft);
  border-left-width: 4px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  background: #fff;
  overflow: visible;
}

#app:not(.auth-only) .kanban-client-name {
  color: #181818;
}

#app:not(.auth-only) .action-btn {
  border-radius: 4px;
  background: var(--sf-brand);
  box-shadow: none;
}

#app:not(.auth-only) .action-btn.alt,
#app:not(.auth-only) .mini-btn.ghost {
  background: #fff;
  border: 1px solid var(--sf-border);
  color: var(--sf-brand);
}

#app:not(.auth-only) .status-pill.success {
  background: #cdefc4;
  color: #194e31;
}

#app:not(.auth-only) .status-pill.warning {
  background: #f9e3b6;
  color: #8c4b02;
}

#app:not(.auth-only) .status-pill.danger {
  background: #fddde3;
  color: #8e030f;
}

#app:not(.auth-only) .client-drawer {
  border-radius: 0;
  border-left: 1px solid var(--sf-border);
  box-shadow: -4px 0 16px rgba(0, 0, 0, 0.12);
}

#app:not(.auth-only) .toast {
  border-radius: 4px;
  background: #16325c;
}

#app:not(.auth-only) .table-wrap {
  border-radius: 0;
  border: 0;
  box-shadow: none;
}

#app:not(.auth-only) th {
  background: #fafaf9 !important;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.78rem !important;
  color: var(--sf-muted);
  border-bottom: 1px solid var(--sf-border-soft);
}

#app:not(.auth-only) tbody tr.selected {
  background: #eef4ff;
}

/* hide old top chrome remnants */
#app:not(.auth-only) .topbar,
#app:not(.auth-only) .stats-strip,
#app:not(.auth-only) .hero,
#app:not(.auth-only) .crm-bar {
  display: none !important;
}

/* Login stays warm; only shell is SF */
@media (max-width: 1180px) {
  .sf-body {
    grid-template-columns: 1fr;
  }

  #app:not(.auth-only) .sidebar.sf-nav {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    height: 100vh;
    width: min(280px, 88vw);
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    z-index: 35;
    background: #fff;
  }

  #app:not(.auth-only) .sidebar.sf-nav.open {
    transform: translateX(0);
  }

  .sf-split,
  .sf-split.has-record {
    grid-template-columns: 1fr;
  }

  .sf-record-panel {
    position: relative;
    top: 0;
    max-height: none;
  }

  .sf-highlight {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sf-header {
    grid-template-columns: 1fr;
    padding: 8px 10px;
    gap: 8px;
  }

  .sf-user-meta {
    display: none;
  }

  .sf-header-link {
    display: none;
  }
}

@media (max-width: 760px) {
  .sf-page-header {
    flex-direction: column;
  }

  .sf-field-grid,
  .sf-record-highlight {
    grid-template-columns: 1fr;
  }
}

/* —— Atendimento / Composer —— */
.composer-layout {
  display: grid;
  grid-template-columns: minmax(240px, 0.85fr) minmax(0, 1.35fr) minmax(220px, 0.75fr);
  gap: 12px;
  padding: 0 16px 16px;
  align-items: start;
}

.composer-library,
.composer-main,
.composer-side {
  max-height: calc(100vh - 200px);
  overflow: auto;
}

.composer-filters {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.composer-channel-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.composer-filters select,
.composer-filters input,
.composer-client-pick select,
.composer-subject input {
  width: 100%;
  border: 1px solid var(--sf-border, #c9c9c9);
  border-radius: 4px;
  padding: 8px 10px;
  font: inherit;
  background: #fff;
}

.composer-pb-list {
  display: grid;
  gap: 6px;
}

.composer-pb-item {
  border: 1px solid var(--sf-border-soft, #e5e5e5);
  background: #fff;
  border-radius: 4px;
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
  display: grid;
  gap: 4px;
  transition: 0.12s ease;
}

.composer-pb-item:hover {
  background: #f3f3f3;
}

.composer-pb-item.active {
  border-color: #0176d3;
  background: #eef4ff;
  box-shadow: inset 3px 0 0 #0176d3;
}

.composer-pb-item strong {
  font-size: 0.9rem;
}

.composer-pb-item small {
  color: var(--sf-muted, #706e6b);
  font-size: 0.78rem;
  line-height: 1.35;
}

.composer-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.composer-tags em {
  font-style: normal;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: #f3f3f3;
  color: #444;
  padding: 2px 6px;
  border-radius: 3px;
}

.composer-client-pick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-end;
}

.composer-client-pick label {
  display: grid;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--sf-muted, #706e6b);
  min-width: 220px;
  flex: 1;
}

.composer-context {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  margin-bottom: 12px;
  background: #fafaf9;
  border: 1px solid var(--sf-border-soft, #e5e5e5);
  border-radius: 4px;
}

.composer-editor {
  display: grid;
  gap: 10px;
}

.composer-subject,
.composer-body-label {
  display: grid;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--sf-muted, #706e6b);
}

.composer-body-label textarea {
  width: 100%;
  border: 1px solid var(--sf-border, #c9c9c9);
  border-radius: 4px;
  padding: 12px;
  font: inherit;
  font-size: 0.92rem;
  line-height: 1.55;
  resize: vertical;
  min-height: 220px;
  color: var(--sf-text, #181818);
}

.composer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--sf-border-soft, #e5e5e5);
}

@media (max-width: 1180px) {
  .composer-layout {
    grid-template-columns: 1fr;
  }

  .composer-library,
  .composer-main,
  .composer-side {
    max-height: none;
  }

  .composer-context {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 760px) {
  .composer-context {
    grid-template-columns: 1fr;
  }
}

/* Gmail / email preview */
.composer-email-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.composer-email-fields label,
.composer-subject-full {
  display: grid;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--sf-muted, #706e6b);
}

.composer-subject-full {
  grid-column: 1 / -1;
}

.composer-email-fields input {
  width: 100%;
  border: 1px solid var(--sf-border, #c9c9c9);
  border-radius: 4px;
  padding: 8px 10px;
  font: inherit;
  background: #fff;
}

.composer-email-preview {
  margin-top: 12px;
  border: 1px solid var(--sf-border-soft, #e5e5e5);
  border-radius: 4px;
  overflow: hidden;
  background: #fafaf9;
}

.composer-preview-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--sf-border-soft, #e5e5e5);
  background: #fff;
}

.composer-preview-tabs {
  display: flex;
  gap: 6px;
}

.composer-html-frame {
  width: 100%;
  height: 320px;
  border: 0;
  background: #fff;
  display: block;
}

.composer-text-preview {
  margin: 0;
  padding: 14px;
  white-space: pre-wrap;
  font-family: inherit;
  font-size: 0.9rem;
  line-height: 1.5;
  max-height: 320px;
  overflow: auto;
  background: #fff;
}

.gmail-status-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--sf-border-soft, #e5e5e5);
  font-size: 0.82rem;
  color: #8c4b02;
  background: #fff8e6;
}

.gmail-status-bar.ok {
  color: #194e31;
  background: #eef8f0;
}

.gmail-status-bar code {
  background: rgba(0, 0, 0, 0.06);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.78em;
}

@media (max-width: 760px) {
  .composer-email-fields {
    grid-template-columns: 1fr;
  }
}

/* —— Catálogo CRM —— */
.catalog-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.7fr);
  gap: 12px;
  padding: 0 16px 16px;
  align-items: start;
}

.catalog-client-bar label {
  display: grid;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--sf-muted, #706e6b);
  min-width: 260px;
}

.catalog-client-bar select {
  border: 1px solid var(--sf-border, #c9c9c9);
  border-radius: 4px;
  padding: 8px 10px;
  font: inherit;
  background: #fff;
  min-width: 260px;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.catalog-card {
  border: 1px solid var(--sf-border-soft, #e5e5e5);
  border-radius: 6px;
  background: #fff;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.catalog-card:hover {
  border-color: #0176d3;
  box-shadow: 0 4px 14px rgba(1, 118, 211, 0.12);
}

.catalog-card-cover {
  aspect-ratio: 3/4;
  background: #f3f3f3;
  overflow: hidden;
}

.catalog-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.catalog-card-body {
  padding: 10px;
  display: grid;
  gap: 2px;
}

.catalog-card-body strong {
  font-size: 0.9rem;
}

.catalog-card-body small {
  color: var(--sf-muted, #706e6b);
  font-size: 0.75rem;
}

.catalog-viewer-top {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--sf-border-soft, #e5e5e5);
}

.catalog-page-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.catalog-page-nav label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
}

.catalog-page-nav input[type="number"] {
  width: 64px;
  border: 1px solid var(--sf-border, #c9c9c9);
  border-radius: 4px;
  padding: 6px 8px;
  font: inherit;
}

.catalog-viewer-body {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.75fr);
  gap: 12px;
  align-items: start;
}

.catalog-stage {
  background: #111;
  border-radius: 6px;
  min-height: 420px;
  display: grid;
  place-items: center;
  overflow: auto;
  max-height: calc(100vh - 260px);
}

.catalog-stage img {
  max-width: 100%;
  height: auto;
  display: block;
  cursor: zoom-in;
}

.catalog-viewer-body.zoomed .catalog-stage img {
  max-width: none;
  width: 140%;
  cursor: zoom-out;
}

.catalog-side-panel {
  border: 1px solid var(--sf-border-soft, #e5e5e5);
  border-radius: 6px;
  padding: 14px;
  background: #fafaf9;
}

.catalog-side-panel h4 {
  margin: 4px 0 8px;
  font-size: 1.05rem;
  line-height: 1.25;
}

.catalog-desc {
  margin: 0 0 12px;
  font-size: 0.84rem;
  color: #444;
  line-height: 1.45;
  max-height: 140px;
  overflow: auto;
}

.catalog-code-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
}

.code-chip {
  border: 1px solid var(--sf-border, #c9c9c9);
  background: #fff;
  border-radius: 999px;
  padding: 5px 10px;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  color: #181818;
}

.code-chip.active {
  background: #0176d3;
  border-color: #0176d3;
  color: #fff;
}

.catalog-manual-code {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  margin-top: 8px;
}

.catalog-manual-code input,
.catalog-qty-row input {
  border: 1px solid var(--sf-border, #c9c9c9);
  border-radius: 4px;
  padding: 8px 10px;
  font: inherit;
  width: 100%;
  background: #fff;
}

.catalog-qty-row {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 8px;
  margin: 12px 0;
}

.catalog-qty-row label {
  display: grid;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--sf-muted, #706e6b);
}

.catalog-qty-row label.grow {
  min-width: 0;
}

.catalog-actions {
  margin-top: 4px;
}

.catalog-rail {
  display: grid;
  gap: 12px;
}

.catalog-list-items {
  display: grid;
  gap: 8px;
  max-height: 280px;
  overflow: auto;
}

.catalog-line {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
  padding: 8px 10px;
  border: 1px solid var(--sf-border-soft, #e5e5e5);
  border-radius: 4px;
  background: #fff;
}

.catalog-line.fav {
  background: #fffaf0;
  border-color: #f3d19e;
}

.catalog-line strong {
  display: block;
  font-size: 0.86rem;
}

.catalog-line small {
  display: block;
  color: var(--sf-muted, #706e6b);
  font-size: 0.75rem;
  margin-top: 2px;
}

.followup-row {
  width: 100%;
  cursor: pointer;
  font: inherit;
  text-align: left;
  color: inherit;
}

.followup-row:hover {
  border-color: #0176d3;
  background: #eef4ff;
}

@media (max-width: 1100px) {
  .catalog-layout,
  .catalog-viewer-body {
    grid-template-columns: 1fr;
  }

  .catalog-stage {
    max-height: 50vh;
  }
}

/* Catálogo leve / dinâmico */
.catalog-lite-banner {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: baseline;
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 6px;
  background: #eef4ff;
  border: 1px solid #d0e2f7;
  font-size: 0.82rem;
  color: #014486;
}

.catalog-lite-banner span:first-child {
  font-weight: 800;
  white-space: nowrap;
}

.catalog-card-cover {
  position: relative;
  background:
    linear-gradient(110deg, #eee 25%, #f7f7f7 40%, #eee 55%);
  background-size: 200% 100%;
  animation: catalog-shimmer 1.2s linear infinite;
}

.catalog-card-cover img {
  position: relative;
  z-index: 1;
  background: #f3f3f3;
}

.catalog-card-pages {
  position: absolute;
  right: 6px;
  bottom: 6px;
  z-index: 2;
  background: rgba(3, 45, 96, 0.82);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 999px;
}

@keyframes catalog-shimmer {
  to {
    background-position-x: -200%;
  }
}

.catalog-loader {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 10px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.88rem;
  font-weight: 600;
  z-index: 2;
  background: rgba(0, 0, 0, 0.35);
}

.catalog-loader span {
  width: 28px;
  height: 28px;
  margin: 0 auto;
  border: 3px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: catalog-spin 0.7s linear infinite;
}

@keyframes catalog-spin {
  to {
    transform: rotate(360deg);
  }
}

.catalog-stage {
  position: relative;
}

.catalog-img-error {
  color: #fddde3;
  text-align: center;
  padding: 24px;
}

.catalog-img-error .sf-link-btn {
  color: #9fd0ff;
}

/* ========== Overview dashboard ========== */
.overview-dash {
  display: grid;
  gap: 14px;
  padding: 0 16px 24px;
}

.ov-kpi-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.ov-kpi {
  background: #fff;
  border: 1px solid var(--sf-border-soft, #e5e5e5);
  border-radius: 8px;
  padding: 14px 14px 12px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  display: grid;
  gap: 4px;
  min-height: 96px;
}

.ov-kpi.accent {
  border-color: #b5d4f4;
  background: linear-gradient(180deg, #f3f8ff, #fff);
}

.ov-kpi.warn {
  border-color: #f3c4c8;
  background: linear-gradient(180deg, #fff5f6, #fff);
}

.ov-kpi.soft {
  border-color: #f0d4a8;
  background: linear-gradient(180deg, #fffaf0, #fff);
}

.ov-kpi-label {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--sf-muted, #706e6b);
}

.ov-kpi strong {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #181818;
  line-height: 1.15;
}

.ov-kpi.warn strong {
  color: #ba0517;
}

.ov-kpi small {
  font-size: 0.75rem;
  color: var(--sf-muted, #706e6b);
  line-height: 1.35;
}

.ov-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ov-action {
  border: 1px solid var(--sf-border, #c9c9c9);
  background: #fff;
  border-radius: 999px;
  padding: 8px 14px;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #181818;
  transition: 0.12s ease;
}

.ov-action span {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: #eef4ff;
  color: #0176d3;
  font-size: 0.78rem;
}

.ov-action:hover {
  border-color: #0176d3;
  background: #f5f9ff;
  transform: translateY(-1px);
}

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

.ov-card .section-head {
  margin-bottom: 12px;
}

.ov-card h3 {
  margin: 0 0 2px;
  font-size: 1rem !important;
}

/* Status donut */
.ov-status-layout {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 18px;
  align-items: center;
}

.ov-donut {
  width: 132px;
  height: 132px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04);
}

.ov-donut-hole {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background: #fff;
  display: grid;
  place-content: center;
  text-align: center;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.04);
}

.ov-donut-hole strong {
  font-size: 1.15rem;
  line-height: 1;
}

.ov-donut-hole span {
  font-size: 0.68rem;
  color: var(--sf-muted, #706e6b);
  font-weight: 700;
  text-transform: uppercase;
}

.ov-legend {
  display: grid;
  gap: 10px;
}

.ov-legend-row {
  display: grid;
  grid-template-columns: 10px 1fr auto auto;
  gap: 8px;
  align-items: center;
  font-size: 0.86rem;
}

.ov-legend-row i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.ov-legend-row em {
  font-style: normal;
  color: var(--sf-muted, #706e6b);
  font-weight: 700;
  font-size: 0.78rem;
  min-width: 36px;
  text-align: right;
}

.ov-meter {
  display: grid;
  grid-template-columns: 100px 1fr auto;
  gap: 8px;
  align-items: center;
  font-size: 0.78rem;
  color: var(--sf-muted, #706e6b);
  font-weight: 600;
}

.ov-meter-bar {
  height: 8px;
  border-radius: 999px;
  background: #ecebea;
  overflow: hidden;
}

.ov-meter-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0176d3, #032d60);
}

.ov-meter-bar.phone i {
  background: linear-gradient(90deg, #2e844a, #04502c);
}

.ov-meter strong {
  font-size: 0.82rem;
  color: #181818;
}

/* Funnel */
.ov-funnel {
  display: grid;
  gap: 8px;
}

.ov-funnel-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.9fr) 1.4fr auto;
  gap: 10px;
  align-items: center;
  border: 0;
  background: transparent;
  padding: 6px 4px;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  text-align: left;
  color: inherit;
}

.ov-funnel-row:hover {
  background: #f3f3f3;
}

.ov-funnel-label {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 0.84rem;
  font-weight: 700;
}

.ov-funnel-label span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ov-funnel-label em {
  font-style: normal;
  color: var(--sf-muted, #706e6b);
  font-size: 0.75rem;
}

.ov-funnel-track {
  height: 12px;
  border-radius: 999px;
  background: #ecebea;
  overflow: hidden;
}

.ov-funnel-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  min-width: 4px;
  transition: width 0.35s cubic-bezier(0.2, 0, 0, 1);
}

.ov-funnel-value {
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
  color: #181818;
}

/* Bars */
.ov-bars {
  display: grid;
  gap: 12px;
}

.ov-bars.compact {
  gap: 8px;
}

.ov-bar-row {
  display: grid;
  grid-template-columns: minmax(90px, 1.1fr) 1.4fr auto;
  gap: 10px;
  align-items: center;
}

.ov-bar-meta {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.ov-bar-meta.short strong {
  font-size: 0.84rem;
}

.ov-bar-meta strong {
  font-size: 0.88rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ov-bar-meta span {
  font-size: 0.72rem;
  color: var(--sf-muted, #706e6b);
}

.ov-bar-track {
  height: 10px;
  border-radius: 999px;
  background: #ecebea;
  overflow: hidden;
}

.ov-bar-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0176d3, #7f8de1);
}

.ov-bar-track i.state {
  background: linear-gradient(90deg, #032d60, #0176d3);
}

.ov-bar-track i.city {
  background: linear-gradient(90deg, #c27a24, #f7b84b);
}

.ov-bar-row em {
  font-style: normal;
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
  text-align: right;
}

/* Score */
.ov-score-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.ov-score-card {
  border: 1px solid var(--sf-border-soft, #e5e5e5);
  border-radius: 8px;
  padding: 12px;
  background: #fafaf9;
}

.ov-score-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--sf-muted, #706e6b);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.ov-score-card strong {
  font-size: 1.4rem;
  letter-spacing: -0.03em;
}

.ov-score-bar {
  margin-top: 8px;
  height: 8px;
  border-radius: 999px;
  background: #ecebea;
  overflow: hidden;
}

.ov-score-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
}

/* Lists */
.ov-list {
  display: grid;
  gap: 6px;
}

.ov-list-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  border: 1px solid transparent;
  background: #fafaf9;
  border-radius: 8px;
  padding: 10px 10px;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: 0.12s ease;
}

.ov-list-row:hover {
  border-color: #c9c9c9;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.ov-list-kind {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 4px 7px;
  border-radius: 999px;
  background: #eef4ff;
  color: #0176d3;
}

.ov-list-kind.k-task { background: #fff3e0; color: #b54708; }
.ov-list-kind.k-close { background: #e8f5e9; color: #1b5e20; }
.ov-list-kind.k-rebuy { background: #e3f2fd; color: #0d47a1; }
.ov-list-kind.k-reactivation { background: #fdecea; color: #b71c1c; }
.ov-list-kind.k-followup { background: #f3e5f5; color: #6a1b9a; }

.ov-list-main {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.ov-list-main strong {
  font-size: 0.88rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ov-list-main small {
  font-size: 0.75rem;
  color: var(--sf-muted, #706e6b);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ov-list-row em {
  font-style: normal;
  font-weight: 800;
  font-size: 0.84rem;
}

.ov-list-row em.score { color: #dd7a01; }
.ov-list-row em.money { color: #014486; white-space: nowrap; }

.ov-rank {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #032d60;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
}

.ov-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

/* Factories */
.ov-factory-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.ov-factory-chip {
  border: 1px solid var(--sf-border-soft, #e5e5e5);
  background: #fff;
  border-radius: 8px;
  padding: 10px;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
  display: grid;
  gap: 3px;
}

.ov-factory-chip:hover,
.ov-factory-chip.hot {
  border-color: #f0c36d;
  background: #fffaf0;
}

.ov-factory-chip strong {
  font-size: 0.86rem;
}

.ov-factory-chip small {
  color: var(--sf-muted, #706e6b);
  font-size: 0.72rem;
}

.ov-factory-states {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.ov-factory-states em {
  font-style: normal;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 999px;
  background: #eef4ff;
  color: #0176d3;
}

/* Activity */
.ov-activity {
  display: grid;
  gap: 10px;
  max-height: 320px;
  overflow: auto;
}

.ov-activity-row {
  padding: 10px 12px;
  border-radius: 8px;
  background: #fafaf9;
  border: 1px solid var(--sf-border-soft, #e5e5e5);
}

.ov-activity-meta {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--sf-muted, #706e6b);
  margin-bottom: 4px;
}

.ov-activity-row strong {
  display: block;
  font-size: 0.88rem;
  margin-bottom: 2px;
}

.ov-activity-row p {
  margin: 0;
  font-size: 0.82rem;
  color: #3e3e3c;
  line-height: 1.4;
}

.ov-checklist {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
  font-size: 0.9rem;
  color: #3e3e3c;
  line-height: 1.45;
}

.ov-notes {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--sf-border-soft, #e5e5e5);
}

.ov-notes strong {
  display: block;
  margin-bottom: 8px;
  font-size: 0.84rem;
}

@media (max-width: 1200px) {
  .ov-kpi-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .ov-grid {
    grid-template-columns: 1fr;
  }

  .ov-kpi-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ov-status-layout {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .ov-funnel-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .ov-bar-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .ov-factory-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .ov-kpi-row {
    grid-template-columns: 1fr;
  }
}

/* ========== Agenda corporativa ========== */
.agenda-workspace {
  display: grid;
  gap: 12px;
  padding: 0 16px 28px;
}

.agenda-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) auto;
  gap: 18px;
  align-items: center;
  padding: 18px 20px !important;
  background:
    linear-gradient(135deg, #032d60 0%, #16325c 55%, #1b4f8a 100%) !important;
  color: #fff !important;
  border: 0 !important;
}

.agenda-hero-kicker {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.7;
  margin-bottom: 4px;
}

.agenda-hero h3 {
  margin: 0;
  font-size: 1.35rem !important;
  font-family: Inter, system-ui, sans-serif !important;
  color: #fff !important;
  letter-spacing: -0.02em;
}

.agenda-hero-date {
  margin: 6px 0 0;
  font-size: 0.92rem;
  text-transform: capitalize;
  opacity: 0.9;
}

.agenda-hero-sub {
  margin: 8px 0 0;
  font-size: 0.86rem;
  opacity: 0.78;
  max-width: 56ch;
  line-height: 1.45;
}

.agenda-hero-sub strong {
  color: #ffe9bf;
}

.agenda-hero-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(72px, 1fr));
  gap: 8px;
}

.agenda-metric {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 10px 12px;
  min-width: 78px;
}

.agenda-metric span {
  display: block;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.7;
  margin-bottom: 4px;
}

.agenda-metric strong {
  font-size: 1.35rem;
  letter-spacing: -0.03em;
}

.agenda-metric.crit {
  background: rgba(186, 5, 23, 0.28);
  border-color: rgba(255, 160, 170, 0.35);
}

.agenda-metric.today {
  background: rgba(1, 118, 211, 0.28);
}

.agenda-metric.week {
  background: rgba(46, 132, 74, 0.22);
}

.agenda-toolbar {
  padding: 12px 14px !important;
  display: grid;
  gap: 12px;
}

.agenda-filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.agenda-pill {
  border: 1px solid var(--sf-border, #c9c9c9);
  background: #fff;
  border-radius: 999px;
  padding: 7px 12px;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #181818;
  transition: 0.12s ease;
}

.agenda-pill em {
  font-style: normal;
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #f3f3f3;
  font-size: 0.72rem;
  font-weight: 800;
  text-align: center;
}

.agenda-pill:hover {
  border-color: #0176d3;
}

.agenda-pill.active {
  background: #0176d3;
  border-color: #0176d3;
  color: #fff;
}

.agenda-pill.active em {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.agenda-pill.crit.active {
  background: #ba0517;
  border-color: #ba0517;
}

.agenda-pill.today.active {
  background: #014486;
  border-color: #014486;
}

.agenda-pill.week.active {
  background: #2e844a;
  border-color: #2e844a;
}

.agenda-toolbar-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.agenda-search,
.agenda-select {
  border: 1px solid var(--sf-border, #c9c9c9);
  border-radius: 6px;
  padding: 8px 10px;
  font: inherit;
  font-size: 0.86rem;
  background: #fff;
  min-height: 36px;
}

.agenda-search {
  flex: 1;
  min-width: 200px;
}

.agenda-select {
  min-width: 150px;
}

.agenda-toggle {
  white-space: nowrap;
}

.agenda-view-toggle {
  display: inline-flex;
  border: 1px solid var(--sf-border, #c9c9c9);
  border-radius: 6px;
  overflow: hidden;
}

.agenda-view-btn {
  border: 0;
  background: #fff;
  padding: 8px 12px;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  color: #706e6b;
}

.agenda-view-btn.active {
  background: #032d60;
  color: #fff;
}

.agenda-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 12px;
  align-items: start;
}

.agenda-main {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.agenda-group {
  padding: 0 !important;
  overflow: hidden;
  animation: agenda-in 0.22s cubic-bezier(0.2, 0, 0, 1);
}

@keyframes agenda-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.agenda-group-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--sf-border-soft, #e5e5e5);
  background: #fafaf9;
  position: sticky;
  top: 58px;
  z-index: 2;
}

.agenda-group.tone-danger .agenda-group-head {
  background: #fff5f5;
  border-bottom-color: #f5c6cb;
}

.agenda-group.tone-today .agenda-group-head {
  background: #f0f7ff;
  border-bottom-color: #c9dff5;
}

.agenda-group.tone-week .agenda-group-head {
  background: #f3faf5;
  border-bottom-color: #c7e6d1;
}

.agenda-group.tone-focus .agenda-group-head {
  background: #fff8ef;
  border-bottom-color: #f0d8b0;
}

.agenda-group-head h4 {
  margin: 0;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
}

.agenda-group-head p {
  margin: 2px 0 0;
  font-size: 0.78rem;
  color: var(--sf-muted, #706e6b);
}

.agenda-group-count {
  min-width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #032d60;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
}

.agenda-group.tone-danger .agenda-group-count {
  background: #ba0517;
}

.agenda-rows {
  display: grid;
}

.agenda-row {
  display: grid;
  grid-template-columns: 4px 120px minmax(0, 1fr) auto;
  gap: 0 12px;
  align-items: start;
  padding: 12px 14px 12px 0;
  border-bottom: 1px solid var(--sf-border-soft, #e5e5e5);
  transition: background 0.12s ease;
}

.agenda-row:last-child {
  border-bottom: 0;
}

.agenda-row:hover {
  background: #f8fafc;
}

.agenda-row-accent {
  align-self: stretch;
  border-radius: 0 4px 4px 0;
  background: #c9c9c9;
}

.agenda-row.urg-critical .agenda-row-accent { background: #ba0517; }
.agenda-row.urg-high .agenda-row-accent { background: #0176d3; }
.agenda-row.urg-medium .agenda-row-accent { background: #2e844a; }
.agenda-row.urg-focus .agenda-row-accent { background: #dd7a01; }
.agenda-row.urg-low .agenda-row-accent { background: #706e6b; }

.agenda-row-due {
  display: grid;
  gap: 6px;
  padding-top: 2px;
}

.agenda-due-label {
  font-size: 0.78rem;
  font-weight: 800;
  color: #181818;
  line-height: 1.25;
}

.agenda-row.urg-critical .agenda-due-label {
  color: #ba0517;
}

.agenda-kind-badge {
  display: inline-flex;
  width: fit-content;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 7px;
  border-radius: 999px;
  background: #eef4ff;
  color: #014486;
}

.kind-task .agenda-kind-badge { background: #fff3e0; color: #b54708; }
.kind-close .agenda-kind-badge { background: #e8f5e9; color: #1b5e20; }
.kind-rebuy .agenda-kind-badge { background: #e3f2fd; color: #0d47a1; }
.kind-reactivation .agenda-kind-badge { background: #fdecea; color: #b71c1c; }
.kind-followup .agenda-kind-badge { background: #f3e5f5; color: #6a1b9a; }

.agenda-row-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.agenda-row-title {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.agenda-row-title strong {
  font-size: 0.95rem;
  cursor: pointer;
  letter-spacing: -0.01em;
}

.agenda-row-title strong:hover {
  color: #0176d3;
}

.agenda-row-reason {
  margin: 0;
  font-size: 0.86rem;
  color: #3e3e3c;
  line-height: 1.4;
}

.agenda-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  font-size: 0.75rem;
  color: var(--sf-muted, #706e6b);
  font-weight: 600;
}

.agenda-stage-chip {
  background: #f3f3f3;
  color: #181818;
  padding: 1px 7px;
  border-radius: 999px;
  font-weight: 800;
}

.agenda-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
  max-width: 280px;
}

.agenda-row-actions .sf-btn {
  min-height: 30px;
  padding: 0 10px;
  font-size: 0.76rem;
}

/* Lista densa */
.agenda-list-card {
  padding: 0 !important;
  overflow: hidden;
}

.agenda-table-wrap {
  overflow: auto;
  max-height: calc(100vh - 280px);
}

.agenda-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 920px;
}

.agenda-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fafaf9 !important;
  text-align: left;
  font-size: 0.72rem !important;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #706e6b;
  padding: 10px 12px;
  border-bottom: 1px solid #e5e5e5;
}

.agenda-table td {
  padding: 11px 12px;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.84rem;
  vertical-align: top;
}

.agenda-table tbody tr {
  cursor: pointer;
  transition: background 0.1s ease;
}

.agenda-table tbody tr:hover {
  background: #f5f9ff;
}

.agenda-table tbody tr.urg-critical {
  box-shadow: inset 3px 0 0 #ba0517;
}

.agenda-table tbody tr.urg-high {
  box-shadow: inset 3px 0 0 #0176d3;
}

.agenda-table td strong {
  display: block;
  font-size: 0.88rem;
}

.agenda-table td small {
  display: block;
  color: #706e6b;
  font-size: 0.75rem;
  margin-top: 2px;
}

.agenda-reason-cell {
  max-width: 280px;
  color: #3e3e3c;
  line-height: 1.35;
}

.agenda-due-inline {
  font-weight: 800;
  font-size: 0.8rem;
  white-space: nowrap;
}

.agenda-table-actions {
  white-space: nowrap;
}

.agenda-table-actions .sf-link-btn {
  margin-left: 8px;
}

/* Side panel */
.agenda-side {
  display: grid;
  gap: 12px;
  position: sticky;
  top: 62px;
}

.agenda-side-card h4 {
  margin: 0 0 12px;
  font-size: 0.92rem;
}

.agenda-side-stats {
  display: grid;
  gap: 8px;
}

.agenda-side-stats > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.86rem;
  padding: 6px 0;
  border-bottom: 1px solid #f0f0f0;
}

.agenda-side-stats span {
  color: #706e6b;
  font-weight: 600;
}

.agenda-side-stats strong {
  font-weight: 800;
}

.agenda-risk {
  margin-top: 12px;
  padding: 12px;
  border-radius: 8px;
  background: #fff5f5;
  border: 1px solid #f5c6cb;
}

.agenda-risk span {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  color: #8e030f;
  margin-bottom: 4px;
}

.agenda-risk strong {
  font-size: 1.05rem;
  color: #ba0517;
}

.agenda-playbook {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
  font-size: 0.86rem;
  color: #3e3e3c;
  line-height: 1.4;
}

.agenda-side-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.agenda-focus-name {
  margin: 0 0 4px;
  font-weight: 800;
  font-size: 0.95rem;
}

.agenda-empty {
  padding: 40px 20px !important;
}

.agenda-empty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 12px;
}

@media (max-width: 1100px) {
  .agenda-body {
    grid-template-columns: 1fr;
  }

  .agenda-side {
    position: relative;
    top: 0;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }

  .agenda-hero {
    grid-template-columns: 1fr;
  }

  .agenda-hero-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .agenda-row {
    grid-template-columns: 4px 1fr;
    gap: 8px 10px;
  }

  .agenda-row-due,
  .agenda-row-actions {
    grid-column: 2;
    max-width: none;
    justify-content: flex-start;
  }

  .agenda-group-head {
    top: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .agenda-group {
    animation: none;
  }
}

/* ========== CRM action buttons (unified) ========== */
.crm-actions {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  padding: 3px;
  border-radius: 10px;
  background: #f3f3f3;
  border: 1px solid #e5e5e5;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.crm-actions.stack {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 6px;
  width: 100%;
}

.crm-actions.stack .crm-act {
  border-radius: 8px !important;
  justify-content: flex-start;
  min-height: 36px;
  padding: 0 10px;
}

.crm-actions.drawer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: 100%;
  padding: 6px;
  margin: 12px 0 4px;
}

.crm-actions.drawer-actions .crm-act {
  border-radius: 8px !important;
  flex: 1 1 auto;
  min-width: 108px;
  justify-content: center;
  min-height: 36px;
}

.crm-act {
  appearance: none;
  border: 0;
  background: transparent;
  color: #181818;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 11px;
  border-radius: 0;
  cursor: pointer;
  position: relative;
  transition:
    background 0.12s ease,
    color 0.12s ease,
    box-shadow 0.12s ease,
    transform 0.1s ease;
  white-space: nowrap;
}

.crm-act + .crm-act {
  box-shadow: inset 1px 0 0 #e0e0e0;
}

.crm-act:first-child {
  border-radius: 7px 0 0 7px;
}

.crm-act:last-child {
  border-radius: 0 7px 7px 0;
}

.crm-act:only-child {
  border-radius: 7px;
}

.crm-act:hover {
  background: #fff;
  z-index: 1;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.crm-act:active {
  transform: translateY(1px);
}

.crm-act:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #0176d3;
  z-index: 2;
}

.crm-act-ico {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  line-height: 1;
  background: rgba(0, 0, 0, 0.06);
  color: inherit;
  flex-shrink: 0;
}

.crm-act-lbl {
  line-height: 1;
}

/* Variants */
.crm-act.primary {
  color: #014486;
}

.crm-act.primary .crm-act-ico {
  background: #eef4ff;
  color: #0176d3;
}

.crm-act.primary:hover {
  background: #eef4ff;
  color: #014486;
}

.crm-act.wa {
  color: #0b6b3a;
}

.crm-act.wa .crm-act-ico {
  background: #e6f6ec;
  color: #128c4a;
}

.crm-act.wa:hover {
  background: #e9f8ef;
  color: #0b6b3a;
}

.crm-act.msg {
  color: #16325c;
}

.crm-act.msg .crm-act-ico {
  background: #e8eef8;
  color: #0176d3;
}

.crm-act.msg:hover {
  background: #eef4ff;
}

.crm-act.cat {
  color: #8a5a10;
}

.crm-act.cat .crm-act-ico {
  background: #fff4e0;
  color: #c27a24;
}

.crm-act.cat:hover {
  background: #fff8ec;
}

.crm-act.done {
  color: #1b5e20;
}

.crm-act.done .crm-act-ico {
  background: #e8f5e9;
  color: #2e844a;
}

.crm-act.next {
  color: #032d60;
}

.crm-act.next .crm-act-ico {
  background: #e8eef8;
  color: #032d60;
}

.crm-act.ai {
  color: #5b21b6;
}

.crm-act.ai .crm-act-ico {
  background: #f3e8ff;
  color: #7c3aed;
}

/* Compact = icon only (kanban / table) */
.crm-actions.compact {
  gap: 0;
  padding: 2px;
}

.crm-actions.compact .crm-act {
  min-height: 30px;
  min-width: 32px;
  padding: 0 8px;
}

.crm-actions.compact .crm-act-lbl {
  display: none;
}

.crm-actions.compact .crm-act-ico {
  width: 16px;
  height: 16px;
  font-size: 0.7rem;
  background: transparent;
}

.crm-actions.compact .crm-act.primary:hover,
.crm-actions.compact .crm-act.wa:hover,
.crm-actions.compact .crm-act.msg:hover,
.crm-actions.compact .crm-act.cat:hover,
.crm-actions.compact .crm-act.next:hover {
  background: #fff;
}

/* Agenda row: place actions cleanly */
.agenda-row {
  grid-template-columns: 4px 118px minmax(0, 1fr) auto !important;
  align-items: center !important;
  padding: 12px 12px 12px 0 !important;
}

.agenda-row-actions {
  max-width: none !important;
}

.agenda-row .crm-actions {
  flex-shrink: 0;
}

.agenda-table-actions .crm-actions {
  background: #f7f7f7;
}

.kanban-card .crm-actions {
  width: 100%;
  justify-content: space-between;
  border-radius: 0;
  border: 0;
  border-top: 1px solid #eee;
  background: #fafaf9;
  box-shadow: none;
  padding: 6px 8px;
}

.kanban-card .crm-actions .crm-act {
  flex: 1;
  border-radius: 6px !important;
  box-shadow: none !important;
}

.kanban-card .crm-actions .crm-act + .crm-act {
  box-shadow: none !important;
}

.kanban-card .crm-actions .crm-act:hover {
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08) !important;
}

/* Queue cards (reativação etc.) */
.queue-card .crm-actions {
  margin-top: 10px;
  width: 100%;
  justify-content: stretch;
}

.queue-card .crm-actions .crm-act {
  flex: 1 1 auto;
}

@media (max-width: 900px) {
  .agenda-row {
    grid-template-columns: 4px 1fr !important;
  }

  .agenda-row .crm-actions {
    grid-column: 2;
    width: 100%;
    margin-top: 4px;
  }

  .agenda-row .crm-act-lbl {
    display: none;
  }

  .agenda-row .crm-act {
    flex: 1;
    min-width: 0;
    padding: 0 6px;
  }

  .crm-actions.drawer-actions .crm-act {
    min-width: calc(50% - 6px);
  }
}

@media (max-width: 520px) {
  .crm-actions:not(.compact):not(.stack) .crm-act-lbl {
    display: none;
  }

  .crm-actions:not(.compact):not(.stack) .crm-act {
    min-width: 36px;
    padding: 0 8px;
  }
}

/* Pipeline filters */
.pipeline-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.pipeline-search,
.pipeline-select,
.pipeline-toolbar select {
  border-radius: 8px;
  border: 1px solid var(--sf-border, #c9c9c9);
  background: #fff;
  padding: 8px 10px;
  font: inherit;
  font-size: 0.84rem;
  min-height: 36px;
  min-width: 140px;
}

.pipeline-search {
  min-width: 200px;
  flex: 1 1 180px;
}

.pipeline-select.state {
  min-width: 150px;
  font-weight: 750;
  border-color: #0176d3;
  color: #014486;
}

.pipeline-state-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: 100%;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--sf-border-soft, #e5e5e5);
}

.pipe-chip {
  border: 1px solid #d8d8d8;
  background: #fff;
  border-radius: 999px;
  padding: 6px 11px;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 750;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #181818;
  transition: 0.12s ease;
}

.pipe-chip em {
  font-style: normal;
  font-size: 0.7rem;
  font-weight: 800;
  min-width: 18px;
  text-align: center;
  padding: 1px 5px;
  border-radius: 999px;
  background: #f3f3f3;
  color: #444;
}

.pipe-chip.core {
  border-color: #b5d4f4;
  background: #f5f9ff;
}

.pipe-chip:hover {
  border-color: #0176d3;
}

.pipe-chip.active {
  background: #0176d3;
  border-color: #0176d3;
  color: #fff;
}

.pipe-chip.active em {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.pipeline-filter-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  margin: 10px 0 4px;
  padding: 8px 12px;
  border-radius: 8px;
  background: #eef4ff;
  border: 1px solid #d0e2f7;
  font-size: 0.82rem;
  color: #014486;
  font-weight: 650;
}

.pipeline-filter-summary strong {
  font-weight: 800;
}

.pipeline-head {
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
}

@media (max-width: 900px) {
  .pipeline-search,
  .pipeline-select,
  .pipeline-toolbar select {
    min-width: 0;
    width: 100%;
    flex: 1 1 100%;
  }
}

/* —— Lista de produtos (pedido por checkbox) —— */
.catalog-mode-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}

.product-list-panel {
  display: grid;
  gap: 12px;
}

.product-list-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 2fr) minmax(120px, 0.7fr) minmax(110px, 0.6fr) auto;
  gap: 10px;
  align-items: end;
}

.product-list-toolbar label {
  display: grid;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--sf-muted, #706e6b);
}

.product-list-toolbar input[type="search"],
.product-list-toolbar select,
.product-list-qty-row input {
  border: 1px solid var(--sf-border, #c9c9c9);
  border-radius: 4px;
  padding: 8px 10px;
  font: inherit;
  background: #fff;
  width: 100%;
}

.product-list-checkopt {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  grid-auto-flow: column;
  padding-bottom: 8px;
  white-space: nowrap;
  font-size: 0.82rem !important;
  font-weight: 600 !important;
  color: #3e3e3c !important;
}

.product-list-checkopt input {
  width: auto !important;
}

.product-list-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  color: var(--sf-muted, #706e6b);
}

.product-list-bulk {
  display: flex;
  gap: 12px;
}

.product-list-qty-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
  padding: 10px 12px;
  border: 1px solid var(--sf-border-soft, #e5e5e5);
  border-radius: 6px;
  background: #fafaf9;
}

.product-list-qty-row label {
  display: grid;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--sf-muted, #706e6b);
}

.product-list-qty-row label.grow {
  flex: 1 1 180px;
}

.product-list-qty-row input[type="number"] {
  width: 72px;
}

.product-list-table-wrap {
  max-height: min(62vh, 640px);
  overflow: auto;
  border: 1px solid var(--sf-border-soft, #e5e5e5);
  border-radius: 6px;
  background: #fff;
}

.product-list-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.product-list-table thead {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f3f3f3;
}

.product-list-table th {
  text-align: left;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: #706e6b;
  padding: 8px 10px;
  border-bottom: 1px solid #e5e5e5;
}

.product-list-table td {
  padding: 9px 10px;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: top;
}

.product-list-table tbody tr {
  cursor: pointer;
  transition: background 0.1s ease;
}

.product-list-table tbody tr:hover {
  background: #f7fbff;
}

.product-list-table tbody tr.checked {
  background: #eef6ff;
}

.product-list-table .col-check {
  width: 36px;
  text-align: center;
}

.product-list-table .col-code {
  width: 120px;
  white-space: nowrap;
}

.product-list-table .col-code code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
  font-weight: 700;
  color: #014486;
  background: #eef4ff;
  padding: 2px 6px;
  border-radius: 4px;
}

.product-list-table .col-code code.no-code {
  color: #8c4b02;
  background: #fff4e5;
  font-weight: 600;
}

.product-list-table .col-name {
  min-width: 180px;
}

.product-list-table .col-name strong {
  display: block;
  font-size: 0.9rem;
  line-height: 1.3;
}

.product-list-table .col-name small,
.product-list-table .col-brand small {
  display: block;
  color: #706e6b;
  font-size: 0.75rem;
  margin-top: 2px;
  line-height: 1.35;
}

.product-list-table .col-brand {
  width: 130px;
}

.product-list-table .col-brand span {
  font-weight: 600;
}

.product-list-table .col-page {
  width: 48px;
  text-align: center;
  color: #706e6b;
  font-variant-numeric: tabular-nums;
}

.product-list-table .col-act {
  width: 48px;
  text-align: right;
}

.product-list-more {
  display: flex;
  justify-content: center;
}

.product-list-selected {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 6px;
  background: #f4f9f4;
  border: 1px solid #c9e7c9;
}

.product-list-selected strong {
  font-size: 0.82rem;
  color: #194e31;
}

@media (max-width: 900px) {
  .product-list-toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .product-list-search {
    grid-column: 1 / -1;
  }

  .product-list-table .col-brand,
  .product-list-table .col-name small {
    display: none;
  }
}

/* —— Condições comerciais / Precificação —— */
.pricing-workspace {
  display: grid;
  gap: 12px;
  padding: 0 16px 20px;
}

.pricing-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-end;
  padding: 16px 18px;
}

.pricing-header h3 {
  margin: 4px 0;
}

.pricing-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: end;
}

.pricing-header-actions label {
  display: grid;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--sf-muted, #706e6b);
  min-width: 240px;
}

.pricing-header-actions select {
  border: 1px solid var(--sf-border, #c9c9c9);
  border-radius: 4px;
  padding: 8px 10px;
  font: inherit;
  background: #fff;
}

.pricing-kpis {
  display: flex;
  gap: 12px;
}

.pricing-kpis > div {
  min-width: 88px;
  padding: 8px 12px;
  border-radius: 6px;
  background: #eef4ff;
  border: 1px solid #d0e2f7;
  display: grid;
  gap: 2px;
}

.pricing-kpis span {
  font-size: 0.68rem;
  font-weight: 700;
  color: #014486;
  text-transform: uppercase;
}

.pricing-kpis strong {
  font-size: 1.05rem;
  color: #032d60;
}

.pricing-grid {
  display: grid;
  grid-template-columns: minmax(240px, 0.85fr) minmax(0, 1.5fr) minmax(280px, 0.95fr);
  gap: 12px;
  align-items: start;
}

.pricing-tables {
  max-height: calc(100vh - 180px);
  overflow: auto;
  padding-bottom: 12px;
}

.pricing-filters {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.pricing-filters input,
.pricing-filters select,
.pricing-cond-grid input,
.pricing-cond-grid select,
.pricing-cond-grid textarea,
.pricing-add-grid input,
.pricing-quote-edit input {
  border: 1px solid var(--sf-border, #c9c9c9);
  border-radius: 4px;
  padding: 8px 10px;
  font: inherit;
  background: #fff;
  width: 100%;
}

.pricing-table-list {
  display: grid;
  gap: 8px;
}

.pricing-table-card {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--sf-border-soft, #e5e5e5);
  border-radius: 8px;
  background: #fff;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.pricing-table-card:hover,
.pricing-table-card.active {
  border-color: #0176d3;
  box-shadow: 0 2px 10px rgba(1, 118, 211, 0.12);
}

.pricing-table-card.active {
  background: #f4f9ff;
}

.pricing-table-cover {
  width: 56px;
  height: 72px;
  border-radius: 4px;
  overflow: hidden;
  background: #f0f0f0;
  display: grid;
  place-items: center;
}

.pricing-table-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pricing-cover-fallback {
  font-weight: 800;
  color: #014486;
}

.pricing-table-meta {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.pricing-table-meta strong {
  font-size: 0.9rem;
}

.pricing-table-meta small {
  color: #706e6b;
  font-size: 0.74rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pricing-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.pricing-tag {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 999px;
  background: #0176d3;
  color: #fff;
}

.pricing-tag.soft {
  background: #eef4ff;
  color: #014486;
}

.pricing-viewer-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--sf-border-soft, #e5e5e5);
}

.pricing-page-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.pricing-page-nav label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
}

.pricing-page-nav input[type="number"] {
  width: 60px;
  border: 1px solid var(--sf-border, #c9c9c9);
  border-radius: 4px;
  padding: 6px 8px;
  font: inherit;
}

.pricing-stage {
  border: 1px solid var(--sf-border-soft, #e5e5e5);
  border-radius: 8px;
  background: #f6f6f5;
  min-height: 360px;
  max-height: 58vh;
  overflow: auto;
  display: grid;
  place-items: start center;
  padding: 8px;
}

.pricing-stage.zoomed {
  max-height: none;
}

.pricing-stage img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
  cursor: zoom-in;
  background: #fff;
}

.pricing-stage.zoomed img {
  max-width: none;
  width: 1200px;
  cursor: zoom-out;
}

.pricing-page-text {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 6px;
  background: #fafaf9;
  border: 1px solid #eee;
  font-size: 0.82rem;
}

.pricing-page-text strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.72rem;
  text-transform: uppercase;
  color: #706e6b;
}

.pricing-page-text p {
  margin: 0;
  color: #3e3e3c;
  line-height: 1.45;
}

.pricing-add-form {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--sf-border-soft, #e5e5e5);
  display: grid;
  gap: 10px;
}

.pricing-add-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pricing-add-grid label {
  display: grid;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #706e6b;
  min-width: 90px;
}

.pricing-add-grid label.grow {
  flex: 1 1 160px;
}

.pricing-empty {
  padding: 48px 20px;
  text-align: center;
}

.pricing-rail {
  display: grid;
  gap: 12px;
  align-content: start;
}

.pricing-cond-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.pricing-cond-grid label {
  display: grid;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #706e6b;
}

.pricing-cond-grid label.full {
  grid-column: 1 / -1;
}

.pricing-quote-list {
  display: grid;
  gap: 8px;
  max-height: 42vh;
  overflow: auto;
}

.pricing-quote-line {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 8px;
  align-items: start;
  padding: 8px;
  border: 1px solid #eee;
  border-radius: 6px;
  background: #fff;
}

.pricing-quote-thumb {
  width: 44px;
  height: 56px;
  border-radius: 4px;
  overflow: hidden;
  background: #f0f0f0;
}

.pricing-quote-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pricing-quote-body {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.pricing-quote-body strong {
  font-size: 0.84rem;
  line-height: 1.3;
}

.pricing-quote-body small {
  color: #706e6b;
  font-size: 0.74rem;
}

.pricing-quote-edit {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.pricing-quote-edit label {
  display: grid;
  gap: 2px;
  font-size: 0.65rem;
  font-weight: 700;
  color: #706e6b;
}

.pricing-quote-edit input {
  width: 64px;
  padding: 4px 6px !important;
}

.pricing-totals {
  margin-top: 12px;
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 6px;
  background: #f3f3f3;
}

.pricing-totals > div {
  display: flex;
  justify-content: space-between;
  font-size: 0.86rem;
}

.pricing-totals .net {
  padding-top: 6px;
  border-top: 1px solid #ddd;
  font-size: 0.95rem;
}

.pricing-totals .net strong {
  color: #194e31;
}

.pricing-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.pricing-actions .sf-btn.brand:nth-child(4) {
  grid-column: 1 / -1;
}

@media (max-width: 1200px) {
  .pricing-grid {
    grid-template-columns: 1fr 1fr;
  }

  .pricing-rail {
    grid-column: 1 / -1;
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 800px) {
  .pricing-grid,
  .pricing-rail {
    grid-template-columns: 1fr;
  }

  .pricing-tables {
    max-height: none;
  }
}

/* Produtos OCR clicáveis */
.pricing-products-panel {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #d0e2f7;
  border-radius: 8px;
  background: linear-gradient(180deg, #f7fbff 0%, #fff 40%);
  display: grid;
  gap: 10px;
}

.pricing-products-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.pricing-products-head strong {
  display: block;
  font-size: 0.9rem;
  margin-top: 2px;
}

.pricing-auto-add {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #014486;
  white-space: nowrap;
}

.pricing-products-toolbar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.pricing-products-toolbar input[type="search"] {
  border: 1px solid var(--sf-border, #c9c9c9);
  border-radius: 4px;
  padding: 8px 10px;
  font: inherit;
  background: #fff;
  width: 100%;
}

.pricing-scope-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pricing-product-list {
  display: grid;
  gap: 4px;
  max-height: 280px;
  overflow: auto;
  border: 1px solid #e8eef5;
  border-radius: 6px;
  background: #fff;
  padding: 4px;
}

.pricing-product-row {
  display: grid;
  grid-template-columns: 88px 1fr auto 28px;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: background 0.1s ease, border-color 0.1s ease;
}

.pricing-product-row:hover {
  background: #eef6ff;
  border-color: #b5d4f4;
}

.pricing-product-row:active {
  background: #dcecff;
}

.pp-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  font-weight: 700;
  color: #014486;
  background: #eef4ff;
  padding: 3px 6px;
  border-radius: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pp-name {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.pp-name strong {
  font-size: 0.86rem;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pp-name small {
  color: #706e6b;
  font-size: 0.72rem;
}

.pp-price {
  font-weight: 800;
  font-size: 0.9rem;
  color: #194e31;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.pp-add {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #0176d3;
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
  line-height: 1;
}

.pricing-product-row:hover .pp-add {
  background: #014486;
}

@media (max-width: 800px) {
  .pricing-products-toolbar {
    grid-template-columns: 1fr;
  }

  .pricing-product-row {
    grid-template-columns: 72px 1fr auto;
  }

  .pp-add {
    display: none;
  }
}

/* Lista de preços dedicada */
.pricing-mode-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 12px 16px;
}

.pricing-mode-hint {
  margin-left: 4px;
}

.pricing-list-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(300px, 0.9fr);
  gap: 12px;
  align-items: start;
}

.pricing-list-main {
  padding-bottom: 16px;
}

.pricing-list-filters {
  display: grid;
  grid-template-columns: minmax(200px, 2fr) repeat(3, minmax(120px, 0.7fr));
  gap: 10px;
  margin-bottom: 12px;
}

.pricing-list-filters label,
.pricing-list-qty-bar label {
  display: grid;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--sf-muted, #706e6b);
}

.pricing-list-filters input,
.pricing-list-filters select,
.pricing-list-qty-bar input {
  border: 1px solid var(--sf-border, #c9c9c9);
  border-radius: 4px;
  padding: 8px 10px;
  font: inherit;
  background: #fff;
  width: 100%;
}

.pricing-list-qty-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 6px;
  background: #f4f9ff;
  border: 1px solid #d0e2f7;
}

.pricing-list-qty-bar label.grow {
  flex: 1 1 180px;
}

.pricing-list-qty-bar input[type="number"] {
  width: 80px;
}

.pricing-price-table-wrap {
  max-height: min(65vh, 700px);
  overflow: auto;
  border: 1px solid var(--sf-border-soft, #e5e5e5);
  border-radius: 8px;
  background: #fff;
}

.pricing-price-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.pricing-price-table thead {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #032d60;
  color: #fff;
}

.pricing-price-table th {
  text-align: left;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 10px 12px;
  white-space: nowrap;
}

.pricing-price-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: middle;
}

.pricing-price-table tbody tr {
  cursor: pointer;
  transition: background 0.1s ease;
}

.pricing-price-table tbody tr:hover {
  background: #eef6ff;
}

.pricing-price-table tbody tr:active {
  background: #dcecff;
}

.pricing-price-table code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8rem;
  font-weight: 700;
  color: #014486;
  background: #eef4ff;
  padding: 2px 6px;
  border-radius: 4px;
}

.pricing-price-table td strong {
  display: block;
  font-size: 0.9rem;
  line-height: 1.3;
}

.pricing-price-table td small {
  color: #706e6b;
  font-size: 0.72rem;
}

.pricing-price-table .price-cell {
  font-weight: 800;
  color: #194e31;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  font-size: 0.95rem;
}

.pricing-price-table .sf-btn.sm {
  padding: 6px 10px;
  font-size: 0.78rem;
}

.pricing-empty-list {
  padding: 28px 12px;
  text-align: center;
}

@media (max-width: 1100px) {
  .pricing-list-layout {
    grid-template-columns: 1fr;
  }

  .pricing-list-filters {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 700px) {
  .pricing-list-filters {
    grid-template-columns: 1fr;
  }

  .pricing-price-table th:nth-child(3),
  .pricing-price-table td:nth-child(3) {
    display: none;
  }
}
