/* =========================================================
   GENIA Protect Admin — CRM light dense
   Estética: Linear/Notion meets GENIA editorial (warm light)
   ========================================================= */

* { box-sizing: border-box; }
html, body, h1, h2, h3, h4, h5, h6, p, ul, ol { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; background: none; border: 0; color: inherit; padding: 0; }
input, select, textarea { font: inherit; color: inherit; }
img, svg { display: block; max-width: 100%; }

:root {
  --bg-0: #FAFAF9;
  --bg-1: #FFFFFF;
  --bg-2: #F4F4EE;
  --bg-3: #ECECE5;
  --bg-4: #E1E1D8;
  --surface-1: rgba(11,26,43,.03);
  --surface-2: rgba(11,26,43,.06);
  --surface-3: rgba(11,26,43,.10);
  --border-1: rgba(11,26,43,.08);
  --border-2: rgba(11,26,43,.12);
  --border-3: rgba(11,26,43,.20);
  --text-0: #0B1A2B;
  --text-1: #2D3344;
  --text-2: #595F6E;
  --text-3: #8A93A6;
  --text-4: #B5BAC4;
  --accent: #1D9E75;
  --accent-strong: #0F6E56;
  --accent-soft: rgba(29,158,117,.10);
  --violet: #6B3FE0;
  --violet-soft: rgba(107,63,224,.10);
  --coral: #C7491F;
  --coral-soft: rgba(199,73,31,.10);
  --lime: #97B814;
  --amber: #E89A30;
  --amber-soft: rgba(232,154,48,.12);
  --rose: #DC2F5C;
  --rose-soft: rgba(220,47,92,.10);
  --blue: #2B7BD8;
  --blue-soft: rgba(43,123,216,.10);

  --r-xs: 6px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;

  --sidebar-w: 240px;
  --topbar-h: 56px;
  --ease: cubic-bezier(.22,.61,.36,1);
}

body {
  font-family: 'Inter', 'Albert Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-0);
  color: var(--text-0);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}

#root {
  height: 100vh;
}
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  height: 100%;
}

/* ---------- Sidebar ---------- */
.sidebar {
  border-right: 1px solid var(--border-1);
  background: var(--bg-1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.sidebar-head {
  padding: 14px 16px;
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--border-1);
  height: var(--topbar-h);
  flex-shrink: 0;
}
.sidebar-head .mark {
  width: 32px; height: 32px;
  border-radius: 9px;
  background: #0B1A2B;
  display: grid; place-items: center;
  color: #1D9E75;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(11,26,43,.28);
}
.sidebar-head .mark svg { width: 20px; height: 20px; }
.sidebar-head .brand-copy { display: flex; flex-direction: column; line-height: 1; }
.sidebar-head .brand-copy strong {
  font-size: 13px;
  letter-spacing: .14em;
  color: var(--text-0);
  font-weight: 700;
}
.sidebar-head .brand-copy > span {
  font-size: 8px;
  letter-spacing: .55em;
  color: var(--accent);
  margin-top: 4px;
  font-weight: 600;
}
.sidebar-head .name { font-size: 13px; font-weight: 600; letter-spacing: -0.01em; }
.sidebar-head .name span { color: var(--text-2); font-weight: 400; }
.sidebar-head .badge {
  margin-left: auto;
  font-size: 10px;
  padding: 3px 7px;
  background: var(--surface-2);
  border-radius: 6px;
  color: var(--text-2);
  letter-spacing: .04em;
  font-weight: 500;
}

.sidebar-nav {
  padding: 12px 10px;
  display: flex; flex-direction: column; gap: 1px;
  overflow-y: auto;
  flex: 1;
}
.sidebar-section {
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 12px 10px 6px;
  font-weight: 600;
}
.sidebar-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px;
  border-radius: 7px;
  color: var(--text-1);
  font-size: 13px;
  transition: background 120ms var(--ease), color 120ms var(--ease);
  cursor: pointer;
  width: 100%;
  text-align: left;
}
.sidebar-item svg { width: 16px; height: 16px; color: var(--text-2); flex-shrink: 0; transition: color 120ms var(--ease); }
.sidebar-item:hover { background: var(--surface-1); color: var(--text-0); }
.sidebar-item:hover svg { color: var(--text-1); }
.sidebar-item.is-active { background: var(--surface-2); color: var(--text-0); }
.sidebar-item.is-active svg { color: var(--accent); }
.sidebar-item .count {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-3);
  background: var(--surface-2);
  padding: 2px 7px;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}
.sidebar-item.is-active .count { background: var(--accent-soft); color: var(--accent); }

.sidebar-user {
  padding: 10px;
  border-top: 1px solid var(--border-1);
  display: flex; align-items: center; gap: 10px;
}
.sidebar-user .avatar {
  width: 32px; height: 32px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--violet), var(--accent));
  display: grid; place-items: center;
  color: var(--bg-0);
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}
.sidebar-user .info { font-size: 12px; flex: 1; min-width: 0; }
.sidebar-user .info strong { display: block; color: var(--text-0); font-weight: 500; }
.sidebar-user .info span { color: var(--text-3); font-size: 11px; }
.sidebar-user .out {
  width: 28px; height: 28px;
  border-radius: 7px;
  display: grid; place-items: center;
  color: var(--text-3);
  transition: color 120ms, background 120ms;
}
.sidebar-user .out:hover { color: var(--text-0); background: var(--surface-1); }
.sidebar-user .out svg { width: 14px; height: 14px; }

/* ---------- Main pane ---------- */
.main {
  display: grid;
  grid-template-rows: var(--topbar-h) 1fr;
  overflow: hidden;
}
.topbar {
  border-bottom: 1px solid var(--border-1);
  display: flex; align-items: center;
  padding: 0 20px;
  gap: 12px;
  background: rgba(255,255,255,.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.topbar .crumbs {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px;
  color: var(--text-2);
}
.topbar .crumbs strong { color: var(--text-0); font-weight: 500; }
.topbar .crumbs svg { width: 12px; height: 12px; opacity: .5; }
.topbar .search {
  margin-left: auto;
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px;
  background: var(--surface-1);
  border: 1px solid var(--border-1);
  border-radius: 8px;
  width: 280px;
  transition: border-color 120ms;
}
.topbar .search:focus-within { border-color: var(--border-3); }
.topbar .search svg { width: 14px; height: 14px; color: var(--text-3); }
.topbar .search input {
  background: transparent;
  border: 0; outline: 0;
  flex: 1;
  font-size: 13px;
  color: var(--text-0);
}
.topbar .kbd {
  font-size: 10px;
  padding: 2px 5px;
  background: var(--surface-2);
  border-radius: 4px;
  color: var(--text-3);
  font-family: 'JetBrains Mono', monospace;
}
.topbar .actions { display: flex; gap: 6px; }
.topbar .icon-btn {
  width: 32px; height: 32px;
  border-radius: 7px;
  display: grid; place-items: center;
  color: var(--text-2);
  transition: color 120ms, background 120ms;
  position: relative;
}
.topbar .icon-btn:hover { color: var(--text-0); background: var(--surface-1); }
.topbar .icon-btn svg { width: 16px; height: 16px; }
.topbar .icon-btn .pip {
  position: absolute;
  top: 7px; right: 7px;
  width: 7px; height: 7px;
  border-radius: 999px;
  background: var(--accent);
  border: 2px solid var(--bg-0);
}

/* ---------- View shell ---------- */
.view {
  overflow-y: auto;
  height: 100%;
  padding: 24px 32px 80px;
}
.view-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.view-head h1 {
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--text-0);
}
.view-head .sub {
  font-size: 13px;
  color: var(--text-2);
  margin-top: 4px;
}
.view-head-actions { display: flex; gap: 8px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 7px;
  height: 34px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid transparent;
  transition: background 120ms, border-color 120ms, color 120ms;
  white-space: nowrap;
}
.btn svg { width: 14px; height: 14px; }
.btn--primary {
  background: var(--text-0);
  color: var(--bg-0);
}
.btn--primary:hover { background: #1F2433; }
.btn--ghost {
  background: var(--surface-1);
  border-color: var(--border-2);
  color: var(--text-0);
}
.btn--ghost:hover { background: var(--surface-2); border-color: var(--border-3); }
.btn--accent {
  background: var(--accent);
  color: var(--bg-0);
}
.btn--accent:hover { background: #15856B; }
.btn--danger {
  background: var(--rose-soft);
  color: var(--rose);
}
.btn--icon { width: 34px; padding: 0; }
.btn--sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn--sm svg { width: 12px; height: 12px; }
.btn--lg { height: 40px; padding: 0 18px; font-size: 14px; }

/* ---------- Cards ---------- */
.card {
  background: var(--bg-1);
  border: 1px solid var(--border-1);
  border-radius: var(--r-md);
  padding: 18px;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
  gap: 12px;
}
.card-head h3 {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-2);
}
.card-head .meta { font-size: 12px; color: var(--text-3); }

/* ---------- KPI cards ---------- */
.kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}
.kpi {
  background: var(--bg-1);
  border: 1px solid var(--border-1);
  border-radius: var(--r-md);
  padding: 18px;
  position: relative;
  overflow: hidden;
}
.kpi-head {
  display: flex; align-items: center; gap: 10px;
  font-size: 12px;
  color: var(--text-2);
  margin-bottom: 14px;
}
.kpi-icon {
  width: 26px; height: 26px;
  border-radius: 7px;
  background: var(--surface-1);
  border: 1px solid var(--border-1);
  display: grid; place-items: center;
  color: var(--accent);
}
.kpi-icon svg { width: 14px; height: 14px; }
.kpi-value {
  font-size: 28px;
  font-weight: 300;
  letter-spacing: -0.02em;
  color: var(--text-0);
  font-variant-numeric: tabular-nums;
}
.kpi-foot {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px;
  margin-top: 8px;
  color: var(--text-2);
}
.kpi-delta {
  display: inline-flex; align-items: center; gap: 3px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.kpi-delta.up { color: var(--accent); }
.kpi-delta.down { color: var(--rose); }
.kpi-delta svg { width: 11px; height: 11px; }

.kpi-spark {
  position: absolute;
  right: 14px; top: 14px;
  width: 80px; height: 32px;
  opacity: .6;
}

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .02em;
  background: var(--surface-2);
  color: var(--text-1);
}
.badge--teal { background: var(--accent-soft); color: var(--accent); }
.badge--violet { background: var(--violet-soft); color: var(--violet); }
.badge--amber { background: var(--amber-soft); color: var(--amber); }
.badge--rose { background: var(--rose-soft); color: var(--rose); }
.badge--blue { background: var(--blue-soft); color: var(--blue); }
.badge--coral { background: var(--coral-soft); color: var(--coral); }
.badge .dot { width: 6px; height: 6px; border-radius: 999px; background: currentColor; }

/* ---------- Tables ---------- */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.table th {
  text-align: left;
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-1);
  font-weight: 500;
  background: var(--bg-1);
}
.table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-1);
  color: var(--text-1);
  vertical-align: middle;
}
.table tr { transition: background 120ms; }
.table tbody tr:hover { background: var(--surface-1); cursor: pointer; }
.table .cell-strong { color: var(--text-0); font-weight: 500; }
.table .cell-muted { color: var(--text-3); }
.table .cell-num { font-variant-numeric: tabular-nums; }
.table-wrap {
  background: var(--bg-1);
  border: 1px solid var(--border-1);
  border-radius: var(--r-md);
  overflow: hidden;
}

/* Avatar in table */
.av {
  display: inline-flex; align-items: center; gap: 10px;
}
.av-circle {
  width: 28px; height: 28px;
  border-radius: 999px;
  display: grid; place-items: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--bg-0);
  flex-shrink: 0;
}

/* ---------- Tabs ---------- */
.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border-1);
  margin-bottom: 20px;
}
.tab {
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-2);
  border-bottom: 2px solid transparent;
  transition: color 120ms, border-color 120ms;
  display: inline-flex; align-items: center; gap: 7px;
}
.tab:hover { color: var(--text-0); }
.tab.is-active { color: var(--text-0); border-bottom-color: var(--accent); }
.tab .count {
  font-size: 11px;
  background: var(--surface-2);
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--text-3);
}
.tab.is-active .count { background: var(--accent-soft); color: var(--accent); }

/* ---------- Filter bar ---------- */
.filterbar {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.filter-chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px;
  padding: 0 10px;
  background: var(--surface-1);
  border: 1px solid var(--border-1);
  border-radius: 7px;
  font-size: 12px;
  color: var(--text-1);
  transition: border-color 120ms, background 120ms;
}
.filter-chip:hover { border-color: var(--border-3); }
.filter-chip.is-active { background: var(--accent-soft); color: var(--accent); border-color: rgba(93,202,165,.3); }
.filter-chip svg { width: 12px; height: 12px; }

/* ---------- Kanban ---------- */
.kanban {
  display: grid;
  grid-template-columns: repeat(5, minmax(260px, 1fr));
  gap: 12px;
  height: calc(100vh - 200px);
  overflow-x: auto;
}
.kanban-col {
  background: var(--bg-1);
  border: 1px solid var(--border-1);
  border-radius: var(--r-md);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.kanban-col-head {
  padding: 12px 14px;
  display: flex; align-items: center; gap: 8px;
  border-bottom: 1px solid var(--border-1);
  flex-shrink: 0;
}
.kanban-col-head .dot {
  width: 8px; height: 8px;
  border-radius: 999px;
  background: var(--text-3);
}
.kanban-col-head h4 {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-1);
}
.kanban-col-head .count {
  font-size: 11px;
  color: var(--text-3);
  background: var(--surface-1);
  padding: 1px 7px;
  border-radius: 999px;
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}
.kanban-col-head .add {
  width: 22px; height: 22px;
  border-radius: 5px;
  display: grid; place-items: center;
  color: var(--text-3);
  transition: color 120ms, background 120ms;
}
.kanban-col-head .add:hover { color: var(--text-0); background: var(--surface-2); }
.kanban-col-head .add svg { width: 12px; height: 12px; }
.kanban-list {
  padding: 10px;
  display: flex; flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  flex: 1;
}
.kanban-card {
  background: var(--bg-2);
  border: 1px solid var(--border-1);
  border-radius: 8px;
  padding: 12px;
  cursor: grab;
  transition: border-color 120ms, transform 120ms;
}
.kanban-card:hover { border-color: var(--border-3); transform: translateY(-1px); }
.kanban-card-head {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 8px;
}
.kanban-card-head .product-tag {
  font-size: 10px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-2);
  font-weight: 500;
}
.kanban-card-head .priority {
  margin-left: auto;
  width: 8px; height: 8px;
  border-radius: 999px;
}
.kanban-card .name { font-size: 13px; color: var(--text-0); font-weight: 500; margin-bottom: 4px; }
.kanban-card .meta { font-size: 12px; color: var(--text-2); margin-bottom: 10px; }
.kanban-card .foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-1);
}
.kanban-card .foot .value { font-size: 13px; color: var(--accent); font-weight: 500; font-variant-numeric: tabular-nums; }
.kanban-card .foot .av-circle { width: 22px; height: 22px; font-size: 10px; }

/* Status dot colors */
.dot--novo { background: var(--blue); }
.dot--qualificando { background: var(--violet); }
.dot--cotando { background: var(--amber); }
.dot--proposta { background: var(--coral); }
.dot--fechado { background: var(--accent); }
.dot--perdido { background: var(--rose); }

/* ---------- Detail panel (slide-over) ---------- */
.detail {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 520px;
  background: var(--bg-1);
  border-left: 1px solid var(--border-2);
  z-index: 50;
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform 280ms var(--ease);
  box-shadow: -16px 0 60px rgba(11,26,43,.18);
  pointer-events: none;
  opacity: 0;
}
.detail.is-open { transform: translateX(0); pointer-events: auto; opacity: 1; }
.detail-backdrop {
  position: fixed; inset: 0;
  background: rgba(11,26,43,.30);
  z-index: 49;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms;
}
.detail-backdrop.is-open { opacity: 1; pointer-events: auto; }
.detail-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-1);
  display: flex; align-items: center; gap: 12px;
}
.detail-head h2 { font-size: 16px; font-weight: 500; }
.detail-head .close {
  margin-left: auto;
  width: 30px; height: 30px;
  border-radius: 7px;
  display: grid; place-items: center;
  color: var(--text-2);
  transition: background 120ms, color 120ms;
}
.detail-head .close:hover { background: var(--surface-2); color: var(--text-0); }
.detail-head .close svg { width: 16px; height: 16px; }
.detail-body { overflow-y: auto; flex: 1; padding: 20px; }
.detail-foot {
  padding: 14px 20px;
  border-top: 1px solid var(--border-1);
  display: flex; gap: 8px;
  background: var(--bg-1);
}

/* ---------- Fields ---------- */
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field-label {
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-3);
  font-weight: 500;
}
.field-input,
.field-select,
.field-textarea {
  background: var(--bg-2);
  border: 1px solid var(--border-1);
  border-radius: 7px;
  padding: 10px 12px;
  color: var(--text-0);
  font-size: 13px;
  outline: 0;
  transition: border-color 120ms, background 120ms;
}
.field-input:focus,
.field-select:focus,
.field-textarea:focus { border-color: var(--accent); background: var(--bg-3); }
.field-textarea { min-height: 90px; resize: vertical; }
.field-select { appearance: none; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238A93A6' stroke-width='1.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 14px; padding-right: 30px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ---------- Wizard ---------- */
.wizard {
  max-width: 720px;
  margin: 0 auto;
}
.wizard-steps {
  display: flex;
  gap: 8px;
  margin-bottom: 28px;
}
.wizard-step {
  flex: 1;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: var(--bg-1);
  border: 1px solid var(--border-1);
  border-radius: 8px;
  font-size: 12px;
  color: var(--text-2);
}
.wizard-step .num {
  width: 22px; height: 22px;
  border-radius: 999px;
  background: var(--surface-2);
  display: grid; place-items: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);
}
.wizard-step.is-active { border-color: var(--accent); color: var(--text-0); background: var(--bg-2); }
.wizard-step.is-active .num { background: var(--accent); color: var(--bg-0); }
.wizard-step.is-done .num { background: var(--accent-soft); color: var(--accent); }
.wizard-card {
  background: var(--bg-1);
  border: 1px solid var(--border-1);
  border-radius: var(--r-md);
  padding: 28px;
}
.wizard-card h2 {
  font-size: 22px;
  font-weight: 400;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.wizard-card .help {
  font-size: 14px;
  color: var(--text-2);
  margin-bottom: 24px;
}
.wizard-foot {
  display: flex; justify-content: space-between;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--border-1);
}

/* Product picker in wizard */
.product-pick {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.product-pick-item {
  padding: 14px 12px;
  background: var(--bg-2);
  border: 1px solid var(--border-1);
  border-radius: 10px;
  text-align: left;
  cursor: pointer;
  transition: border-color 120ms, background 120ms, transform 120ms;
  display: flex; flex-direction: column; gap: 10px;
}
.product-pick-item:hover { border-color: var(--border-3); transform: translateY(-1px); }
.product-pick-item.is-selected { border-color: var(--accent); background: var(--bg-3); }
.product-pick-item .ic {
  width: 32px; height: 32px;
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--accent);
  display: grid; place-items: center;
}
.product-pick-item .ic svg { width: 16px; height: 16px; }
.product-pick-item .pn { font-size: 13px; color: var(--text-0); font-weight: 500; }
.product-pick-item .pf { font-size: 11px; color: var(--text-3); }

/* Quote summary card */
.quote-sum {
  position: sticky;
  top: 0;
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: var(--r-md);
  padding: 18px;
  margin-top: 18px;
}
.quote-sum h3 { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); margin-bottom: 12px; }
.quote-sum-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 13px; color: var(--text-1); }
.quote-sum-row.total {
  border-top: 1px solid var(--border-1);
  padding-top: 12px; margin-top: 8px;
  font-size: 15px; color: var(--text-0); font-weight: 500;
}
.quote-sum-row .v { font-variant-numeric: tabular-nums; color: var(--text-0); }
.quote-sum-row.total .v { color: var(--accent); font-size: 20px; font-weight: 400; }

/* ---------- Two col grid ---------- */
.two-col {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 20px;
}
.three-col {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
}
.two-third {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}

/* ---------- Activity feed ---------- */
.activity {
  display: flex; flex-direction: column;
  gap: 0;
}
.activity-item {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-1);
  align-items: center;
}
.activity-item:last-child { border-bottom: 0; }
.activity-ic {
  width: 28px; height: 28px;
  border-radius: 7px;
  background: var(--surface-1);
  border: 1px solid var(--border-1);
  display: grid; place-items: center;
  color: var(--accent);
}
.activity-ic svg { width: 13px; height: 13px; }
.activity-text { font-size: 13px; color: var(--text-1); }
.activity-text strong { color: var(--text-0); font-weight: 500; }
.activity-time { font-size: 11px; color: var(--text-3); white-space: nowrap; }

/* ---------- Chart placeholder ---------- */
.chart {
  height: 200px;
  display: flex; align-items: flex-end; gap: 4px;
  padding: 12px 0;
}
.chart-bar {
  flex: 1;
  background: linear-gradient(180deg, var(--accent), transparent);
  border-radius: 3px 3px 0 0;
  min-height: 8px;
  opacity: .85;
  transition: opacity 120ms;
}
.chart-bar:hover { opacity: 1; }
.chart-bar.is-current { background: linear-gradient(180deg, var(--text-0), transparent); opacity: 1; }

/* ---------- WhatsApp mock ---------- */
.wa {
  display: grid;
  grid-template-columns: 280px 1fr;
  height: calc(100vh - var(--topbar-h) - 80px);
  background: var(--bg-1);
  border: 1px solid var(--border-1);
  border-radius: var(--r-md);
  overflow: hidden;
}
.wa-list {
  border-right: 1px solid var(--border-1);
  overflow-y: auto;
  background: var(--bg-1);
}
.wa-thread {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-1);
  cursor: pointer;
  display: flex; gap: 10px;
  align-items: center;
}
.wa-thread:hover { background: var(--surface-1); }
.wa-thread.is-active { background: var(--surface-2); }
.wa-thread .av-circle { width: 32px; height: 32px; font-size: 11px; }
.wa-thread .info { flex: 1; min-width: 0; }
.wa-thread .info strong { font-size: 13px; color: var(--text-0); font-weight: 500; display: block; }
.wa-thread .info p { font-size: 12px; color: var(--text-2); margin: 2px 0 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wa-thread .pip {
  width: 8px; height: 8px;
  border-radius: 999px;
  background: var(--accent);
}
.wa-chat { display: flex; flex-direction: column; background: var(--bg-0); }
.wa-chat-head { padding: 12px 16px; border-bottom: 1px solid var(--border-1); display: flex; gap: 10px; align-items: center; background: var(--bg-1); }
.wa-msgs { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.wa-msg {
  max-width: 70%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13px;
}
.wa-msg--in { background: var(--bg-2); align-self: flex-start; border-bottom-left-radius: 4px; color: var(--text-0); }
.wa-msg--out { background: var(--accent-soft); align-self: flex-end; border-bottom-right-radius: 4px; color: var(--text-0); }
.wa-msg .t { font-size: 10px; color: var(--text-3); margin-top: 4px; display: block; }
.wa-input {
  padding: 12px;
  border-top: 1px solid var(--border-1);
  display: flex; gap: 8px;
  background: var(--bg-1);
}
.wa-input input {
  flex: 1;
  background: var(--bg-2);
  border: 1px solid var(--border-1);
  border-radius: 999px;
  padding: 9px 14px;
  font-size: 13px;
  color: var(--text-0);
  outline: 0;
}

/* ---------- Misc ---------- */
.muted { color: var(--text-2); }
.t-num { font-variant-numeric: tabular-nums; }
.divider { height: 1px; background: var(--border-1); margin: 16px 0; }
.empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
}

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface-2); border-radius: 999px; border: 2px solid var(--bg-0); }
::-webkit-scrollbar-thumb:hover { background: var(--surface-3); }

/* Animations */
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.view { animation: fadeUp 240ms var(--ease); }

@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .two-col { grid-template-columns: 1fr; }
  .three-col { grid-template-columns: 1fr; }
  .two-third { grid-template-columns: 1fr; }
  .product-pick { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Mobile (< 800px) ---------- */
@media (max-width: 800px) {
  body { overflow: auto; }
  #root, .app, .main { height: auto !important; }
  .app {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto auto 1fr;
  }
  .main { grid-template-rows: auto 1fr; }

  /* Sidebar vira top nav horizontal scrollável */
  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--border-1);
    position: sticky; top: 0; z-index: 30;
    background: var(--bg-1);
  }
  .sidebar-head {
    border-bottom: 1px solid var(--border-1);
    padding: 10px 14px;
  }
  .sidebar-nav {
    display: flex; flex-direction: row;
    overflow-x: auto;
    padding: 8px 12px;
    gap: 6px;
    scrollbar-width: none;
  }
  .sidebar-nav::-webkit-scrollbar { display: none; }
  .sidebar-section { display: none; }
  .sidebar-item {
    flex-shrink: 0;
    width: auto; padding: 8px 12px;
    font-size: 13px;
    border-radius: 999px;
    background: var(--surface-1);
    white-space: nowrap;
  }
  .sidebar-item .count { margin-left: 4px; }
  .sidebar-user { display: none; }

  /* Topbar compacto */
  .topbar {
    height: auto; padding: 10px 16px;
    flex-wrap: wrap; gap: 8px;
  }
  .topbar .search { display: none; }
  .topbar .crumbs { font-size: 12px; }
  .topbar .crumbs span:not(:last-child),
  .topbar .crumbs svg { display: none; }
  .topbar .crumbs strong { font-weight: 600; }
  .topbar .actions { margin-left: auto; gap: 4px; }

  /* View padding menor */
  .view { padding: 16px 14px 60px; overflow: visible; height: auto; }
  .view-head { gap: 12px; }
  .view-head h1 { font-size: 20px; }
  .view-head-actions { width: 100%; flex-wrap: wrap; }

  /* KPIs em 1 coluna no mobile pequeno */
  .kpis { grid-template-columns: 1fr; gap: 10px; }
  .product-pick { grid-template-columns: 1fr; }

  /* Tabelas scrolláveis */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table { min-width: 640px; }

  /* Kanban scroll horizontal */
  .kanban { grid-template-columns: repeat(5, 280px); overflow-x: auto; gap: 12px; }

  /* Filtros wrap */
  .filterbar { flex-wrap: wrap; gap: 6px; }

  /* Detail panel ocupa tela toda */
  .detail { width: 100% !important; }

  /* Modal */
  .wizard { padding: 0; }
  .wizard-card { padding: 18px; }

  /* WhatsApp em 1 coluna */
  .wa { grid-template-columns: 1fr; height: auto; }
  .wa-list { max-height: 260px; }

  /* Cards de catálogo */
  .card { padding: 14px; }

  /* Wizard cotação: resumo abaixo */
  .view .wizard + div,
  .view > div[style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
}
