/* ============================================================
   SANT CRM — style.css
   Dark mode refinado. Fonte: IBM Plex Sans + IBM Plex Mono
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=IBM+Plex+Sans:wght@300;400;500;600;700&display=swap');

/* ── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Cores base */
  --bg:          #0d0f12;
  --surface:     #13161b;
  --surface2:    #1a1e25;
  --surface3:    #21262f;
  --border:      #272c36;
  --border2:     #313844;

  /* Texto */
  --text:        #e8ecf0;
  --text2:       #a8b2bd;
  --muted:       #5e6a78;

  /* Acento — verde SANT */
  --accent:      #00c785;
  --accent-dim:  rgba(0,199,133,.12);
  --accent-glow: rgba(0,199,133,.25);

  /* Semânticas */
  --green:       #00c785;
  --green-dim:   rgba(0,199,133,.15);
  --yellow:      #f5c542;
  --yellow-dim:  rgba(245,197,66,.15);
  --red:         #f05252;
  --red-dim:     rgba(240,82,82,.15);
  --blue:        #4a9eff;
  --blue-dim:    rgba(74,158,255,.15);
  --purple:      #a78bfa;
  --purple-dim:  rgba(167,139,250,.15);
  --orange:      #fb923c;
  --orange-dim:  rgba(251,146,60,.15);

  /* Layout */
  --sidebar-w:   230px;
  --topbar-h:    56px;
  --radius:      8px;
  --radius-sm:   5px;
  --radius-lg:   12px;

  /* Sombras */
  --shadow:      0 2px 12px rgba(0,0,0,.4);
  --shadow-lg:   0 8px 32px rgba(0,0,0,.5);

  /* Tipografia */
  --font:        'IBM Plex Sans', system-ui, sans-serif;
  --font-mono:   'IBM Plex Mono', monospace;
}

html { font-size: 14px; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ── Tipografia ────────────────────────────────────────────── */
h1 { font-size: 1.4rem; font-weight: 600; letter-spacing: -.02em; line-height: 1.2; }
h2 { font-size: 1.05rem; font-weight: 600; letter-spacing: -.015em; }
h3 { font-size: .9rem; font-weight: 600; }
p  { line-height: 1.6; }
.muted { color: var(--muted); font-size: .82rem; }
.tag   { font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.mono  { font-family: var(--font-mono); font-size: .82rem; }

/* ── Sidebar ───────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  height: 100vh;
  position: sticky;
  top: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 100;
}

.sidebar-logo {
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--border);
}
.logo-mark {
  display: flex;
  align-items: baseline;
  gap: 2px;
  margin-bottom: 2px;
}
.logo-sant {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -.04em;
  color: var(--text);
}
.logo-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  margin-left: 1px;
  margin-bottom: 4px;
  flex-shrink: 0;
}
.logo-sub {
  font-size: .68rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.nav-section-label {
  font-size: .65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
  padding: 10px 8px 4px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text2);
  font-family: var(--font);
  font-size: .84rem;
  font-weight: 400;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--surface2); color: var(--text); }
.nav-item.active {
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 500;
}
.nav-item .nav-icon {
  font-size: .9rem;
  width: 16px;
  text-align: center;
  flex-shrink: 0;
  opacity: .7;
}
.nav-item.active .nav-icon { opacity: 1; }

.sidebar-footer {
  padding: 12px 10px;
  border-top: 1px solid var(--border);
}
.user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .15s;
}
.user-pill:hover { background: var(--surface2); }
.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; }
.user-name {
  font-size: .82rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-role {
  font-size: .7rem;
  color: var(--muted);
}

/* ── Main ──────────────────────────────────────────────────── */
.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* ── Topbar ────────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  min-height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  gap: 12px;
}
.topbar-left  { display: flex; align-items: center; gap: 12px; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.breadcrumb   { font-size: .82rem; color: var(--muted); }
#pageTitle    { font-size: 1rem; font-weight: 600; }
.status-pill  { display: flex; align-items: center; gap: 6px; font-size: .75rem; color: var(--muted); }
.status-dot   { width: 7px; height: 7px; border-radius: 50%; background: var(--border2); transition: background .3s; }
.status-dot.online { background: var(--green); box-shadow: 0 0 6px var(--accent-glow); }

/* ── Content area ──────────────────────────────────────────── */
.content-area {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ── Views ─────────────────────────────────────────────────── */
.view { display: none; flex-direction: column; gap: 20px; }
.view.active { display: flex; }

/* ── Cards / Panels ────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.card-sm { padding: 14px 16px; }
.panel   { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }

.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.section-header h2 { margin: 0; }
.section-header .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Buttons ───────────────────────────────────────────────── */
button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border2);
  background: var(--surface3);
  color: var(--text);
  font-family: var(--font);
  font-size: .82rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s;
  line-height: 1;
}
button:hover, .btn:hover { background: var(--surface2); border-color: var(--border2); }

button.primary, .btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
  font-weight: 600;
}
button.primary:hover { background: #00e096; border-color: #00e096; }

button.ghost, .btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text2);
}
button.ghost:hover { background: var(--surface2); color: var(--text); border-color: var(--border); }

button.danger, .btn-danger {
  background: var(--red-dim);
  border-color: var(--red);
  color: var(--red);
}
button.danger:hover { background: var(--red); color: #fff; }

button.sm, .btn-sm { padding: 5px 10px; font-size: .78rem; }
button.xs, .btn-xs { padding: 3px 8px; font-size: .73rem; }

button:disabled { opacity: .4; cursor: not-allowed; }

/* ── Inputs ────────────────────────────────────────────────── */
input, select, textarea {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: .84rem;
  padding: 7px 10px;
  transition: border-color .15s;
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
input::placeholder, textarea::placeholder { color: var(--muted); }
select option { background: var(--surface2); }
textarea { resize: vertical; min-height: 80px; line-height: 1.5; }

label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: .82rem;
  font-weight: 500;
  color: var(--text2);
}
label input, label select, label textarea { color: var(--text); }

.form-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }

/* ── Badges ────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: .7rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge-default  { background: var(--surface3); color: var(--text2); border: 1px solid var(--border2); }
.badge-green    { background: var(--green-dim);  color: var(--green);  border: 1px solid var(--green); }
.badge-yellow   { background: var(--yellow-dim); color: var(--yellow); border: 1px solid var(--yellow); }
.badge-red      { background: var(--red-dim);    color: var(--red);    border: 1px solid var(--red); }
.badge-blue     { background: var(--blue-dim);   color: var(--blue);   border: 1px solid var(--blue); }
.badge-purple   { background: var(--purple-dim); color: var(--purple); border: 1px solid var(--purple); }
.badge-orange   { background: var(--orange-dim); color: var(--orange); border: 1px solid var(--orange); }
.badge-accent   { background: var(--accent-dim); color: var(--accent); border: 1px solid var(--accent); }

/* ── Filters bar ───────────────────────────────────────────── */
.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.filters input, .filters select {
  flex: 1;
  min-width: 140px;
  max-width: 220px;
}
.filters input[type="search"], .filters .search-input {
  min-width: 200px;
  max-width: 320px;
}

/* ── Métricas / KPIs ───────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.kpi-card .kpi-label { font-size: .72rem; font-weight: 500; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.kpi-card .kpi-value { font-size: 1.8rem; font-weight: 700; color: var(--text); letter-spacing: -.03em; line-height: 1; }
.kpi-card .kpi-sub   { font-size: .75rem; color: var(--muted); }
.kpi-card.accent  { border-color: var(--accent); }
.kpi-card.green   { border-color: var(--green); }
.kpi-card.yellow  { border-color: var(--yellow); }
.kpi-card.red     { border-color: var(--red); }

/* ── Dashboard ─────────────────────────────────────────────── */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.dash-row { display: flex; flex-direction: column; gap: 12px; }

.action-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.action-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.action-card .ac-count  { font-size: 2rem; font-weight: 700; line-height: 1; margin-bottom: 4px; }
.action-card .ac-label  { font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.action-card .ac-desc   { font-size: .75rem; color: var(--muted); margin-top: 6px; }
.action-card.overdue  { border-color: var(--red);    }  .action-card.overdue .ac-count  { color: var(--red);    }
.action-card.ready    { border-color: var(--green);  }  .action-card.ready .ac-count    { color: var(--green);  }
.action-card.waiting  { border-color: var(--yellow); }  .action-card.waiting .ac-count  { color: var(--yellow); }
.action-card.manual   { border-color: var(--orange); }  .action-card.manual .ac-count   { color: var(--orange); }

.step-breakdown { display: flex; flex-direction: column; gap: 6px; }
.step-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--surface2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .15s;
}
.step-row:hover { background: var(--surface3); }
.step-name  { flex: 1; font-size: .82rem; font-weight: 500; }
.step-count { font-size: .9rem; font-weight: 700; font-family: var(--font-mono); min-width: 28px; text-align: right; }
.step-bar-wrap { width: 80px; height: 4px; background: var(--border); border-radius: 99px; overflow: hidden; flex-shrink: 0; }
.step-bar { height: 100%; background: var(--accent); border-radius: 99px; transition: width .5s; }

/* ── Company list ──────────────────────────────────────────── */
.company-list { display: flex; flex-direction: column; gap: 8px; }
.company-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all .15s;
}
.company-card:hover { background: var(--surface3); border-color: var(--border2); }
.company-card.selected { border-color: var(--accent); background: var(--accent-dim); }

.company-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--surface3);
  border: 1px solid var(--border2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  font-weight: 700;
  color: var(--muted);
  flex-shrink: 0;
  text-transform: uppercase;
}
.company-info     { flex: 1; min-width: 0; }
.company-name     { font-weight: 600; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.company-sub      { font-size: .74rem; color: var(--muted); margin-top: 2px; }
.company-badges   { display: flex; gap: 4px; flex-wrap: wrap; flex-shrink: 0; }

/* ── Contact list ──────────────────────────────────────────── */
.contact-list { display: flex; flex-direction: column; gap: 8px; }
.contact-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.contact-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--surface3);
  display: flex; align-items: center; justify-content: center;
  font-size: .72rem; font-weight: 700; color: var(--muted);
  flex-shrink: 0; text-transform: uppercase;
}
.contact-info   { flex: 1; min-width: 0; }
.contact-name   { font-weight: 500; font-size: .84rem; }
.contact-meta   { font-size: .75rem; color: var(--muted); margin-top: 1px; }
.contact-acts   { display: flex; gap: 4px; }

/* ── Cadências — Kanban ────────────────────────────────────── */
.cadence-board {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
  min-height: 400px;
}
.cadence-col {
  min-width: 240px;
  width: 240px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cadence-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  position: sticky;
  top: 0;
  z-index: 2;
}
.cadence-col-title { font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.cadence-col-count { font-size: .78rem; font-weight: 700; font-family: var(--font-mono); color: var(--muted); }

.cadence-col.c1 .cadence-col-header { border-color: var(--blue);   }
.cadence-col.c1 .cadence-col-title  { color: var(--blue); }
.cadence-col.c2 .cadence-col-header { border-color: var(--purple); }
.cadence-col.c2 .cadence-col-title  { color: var(--purple); }
.cadence-col.meeting .cadence-col-header { border-color: var(--green); }
.cadence-col.meeting .cadence-col-title  { color: var(--green); }
.cadence-col.noreturn .cadence-col-header { border-color: var(--muted); }

.cadence-cards { display: flex; flex-direction: column; gap: 6px; }
.cad-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  cursor: pointer;
  transition: all .15s;
}
.cad-card:hover { border-color: var(--border2); background: var(--surface2); transform: translateY(-1px); box-shadow: var(--shadow); }
.cad-card-name   { font-size: .84rem; font-weight: 500; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cad-card-meta   { font-size: .72rem; color: var(--muted); line-height: 1.5; }
.cad-card-status { margin-top: 6px; }

/* Status dots dentro dos cards de cadência */
.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .7rem;
  font-weight: 500;
}
.status-indicator::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.si-ready    { color: var(--green); }
.si-waiting  { color: var(--yellow); }
.si-overdue  { color: var(--red); }
.si-manual   { color: var(--orange); }
.si-neutral  { color: var(--muted); }

/* ── Activity feed ─────────────────────────────────────────── */
.activity-list  { display: flex; flex-direction: column; }
.activity-item  {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.activity-item:last-child { border-bottom: none; }
.activity-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--border2);
  margin-top: 5px;
  flex-shrink: 0;
}
.activity-dot.email   { background: var(--blue);   }
.activity-dot.cadencia{ background: var(--purple);  }
.activity-dot.reuniao { background: var(--green);   }
.activity-dot.comercial{background: var(--yellow);  }
.activity-dot.manual  { background: var(--orange);  }
.activity-text  { font-size: .82rem; line-height: 1.5; }
.activity-meta  { font-size: .72rem; color: var(--muted); margin-top: 2px; }

/* ── Company detail panel ──────────────────────────────────── */
.detail-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.detail-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.detail-title   { font-size: 1.1rem; font-weight: 600; }
.detail-sub     { font-size: .78rem; color: var(--muted); margin-top: 3px; }
.detail-body    { padding: 20px; display: flex; flex-direction: column; gap: 20px; overflow-y: auto; }
.detail-tabs    { display: flex; gap: 4px; border-bottom: 1px solid var(--border); padding: 0 20px; }
.detail-tab {
  padding: 10px 14px;
  font-size: .82rem;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  border: none;
  background: transparent;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all .15s;
}
.detail-tab:hover { color: var(--text); }
.detail-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.detail-tab-content { display: none; padding: 16px 20px; }
.detail-tab-content.active { display: flex; flex-direction: column; gap: 14px; }

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.info-item { display: flex; flex-direction: column; gap: 3px; }
.info-label { font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.info-value { font-size: .84rem; color: var(--text); }

/* ── Meetings ──────────────────────────────────────────────── */
.meeting-list { display: flex; flex-direction: column; gap: 10px; }
.meeting-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.meeting-date {
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--accent);
  flex-shrink: 0;
  min-width: 80px;
}
.meeting-info { flex: 1; }
.meeting-company { font-weight: 600; font-size: .88rem; }
.meeting-meta    { font-size: .75rem; color: var(--muted); margin-top: 3px; }
.meeting-acts    { display: flex; gap: 6px; }
.meeting-card.realized { border-color: var(--green); }
.meeting-card.realized .meeting-date { color: var(--green); }

/* ── Commercial Kanban ─────────────────────────────────────── */
.commercial-board {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
  min-height: 500px;
}
.commercial-col {
  min-width: 220px;
  width: 220px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 40px;
}
.commercial-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  position: sticky;
  top: 0;
  z-index: 2;
}
.commercial-col-title { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text2); }
.commercial-col-count { font-size: .78rem; font-weight: 700; font-family: var(--font-mono); color: var(--muted); }
.commercial-col.ganho   .commercial-col-header { border-color: var(--green);  } .commercial-col.ganho   .commercial-col-title { color: var(--green); }
.commercial-col.perdido .commercial-col-header { border-color: var(--red);    } .commercial-col.perdido .commercial-col-title { color: var(--red); }
.commercial-col.proposta .commercial-col-header { border-color: var(--yellow); } .commercial-col.proposta .commercial-col-title { color: var(--yellow); }
.commercial-col.drop-over { background: var(--accent-dim); }

.com-cards { display: flex; flex-direction: column; gap: 6px; min-height: 80px; }
.com-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  cursor: grab;
  user-select: none;
  transition: all .15s;
}
.com-card:hover  { border-color: var(--border2); box-shadow: var(--shadow); }
.com-card.dragging { opacity: .4; }
.com-card.drag-ghost {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  opacity: .95;
  box-shadow: var(--shadow-lg);
  transform: rotate(2deg);
}
.com-card-name  { font-size: .84rem; font-weight: 600; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.com-card-value { font-size: .88rem; font-weight: 700; color: var(--accent); font-family: var(--font-mono); }
.com-card-meta  { font-size: .72rem; color: var(--muted); line-height: 1.5; margin-top: 4px; }
.com-card-hint  { font-size: .67rem; color: var(--muted); margin-top: 6px; opacity: .6; }

/* ── Templates ─────────────────────────────────────────────── */
.templates-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 16px;
}
.template-list    { display: flex; flex-direction: column; gap: 4px; }
.template-item {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .15s;
  font-size: .82rem;
}
.template-item:hover  { background: var(--surface2); }
.template-item.active { background: var(--accent-dim); color: var(--accent); font-weight: 500; }
.template-step-label  { font-size: .7rem; color: var(--muted); margin-top: 1px; }

.preview-box {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: .82rem;
  line-height: 1.65;
  white-space: pre-wrap;
  min-height: 60px;
}
.preview-box.email-preview { min-height: 140px; }

/* ── Modals ────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(3px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-backdrop.hidden { display: none; }
.modal-box {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.modal-box.wide { max-width: 760px; }
.modal-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 1;
}
.modal-title  { font-size: 1rem; font-weight: 600; }
.modal-sub    { font-size: .78rem; color: var(--muted); margin-top: 2px; }
.modal-close  { flex-shrink: 0; }
.modal-body   { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.modal-footer { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; }

/* ── Import ────────────────────────────────────────────────── */
.import-area {
  border: 2px dashed var(--border2);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  transition: border-color .15s;
}
.import-area:hover  { border-color: var(--accent); }
.import-textarea { min-height: 120px; font-family: var(--font-mono); font-size: .8rem; }

/* ── Settings ──────────────────────────────────────────────── */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.settings-textarea { min-height: 100px; }

/* ── Empty states ──────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  gap: 10px;
  color: var(--muted);
}
.empty-state .empty-icon { font-size: 2.5rem; opacity: .5; }
.empty-state p { font-size: .84rem; text-align: center; max-width: 320px; }

/* ── Dispatch modal specifics ──────────────────────────────── */
.dispatch-contact-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .15s;
}
.dispatch-contact-row:hover { background: var(--surface3); }
.dispatch-contact-row input[type="checkbox"] {
  width: auto;
  margin-top: 3px;
  flex-shrink: 0;
  accent-color: var(--accent);
}
.dispatch-contact-info strong { font-size: .84rem; display: block; }
.dispatch-contact-info span   { font-size: .75rem; color: var(--muted); }
.dispatch-contacts-list { display: flex; flex-direction: column; gap: 6px; }

/* ── Login page ────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-box {
  width: 100%;
  max-width: 360px;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  box-shadow: var(--shadow-lg);
}
.login-logo { margin-bottom: 28px; }
.login-logo .logo-mark { margin-bottom: 4px; }
.login-title { font-size: 1.2rem; font-weight: 700; margin-bottom: 6px; }
.login-sub   { font-size: .82rem; color: var(--muted); margin-bottom: 24px; }
.login-form  { display: flex; flex-direction: column; gap: 14px; }
.login-error {
  background: var(--red-dim);
  border: 1px solid var(--red);
  color: var(--red);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: .82rem;
}

/* ── Scrollable inner panels ───────────────────────────────── */
.scroll-y { overflow-y: auto; }
.h-full   { height: 100%; }

/* ── Divider ───────────────────────────────────────────────── */
.divider { border: none; border-top: 1px solid var(--border); margin: 4px 0; }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .dash-grid        { grid-template-columns: 1fr; }
  .templates-grid   { grid-template-columns: 1fr; }
  .settings-grid    { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  :root { --sidebar-w: 200px; }
  .form-row   { grid-template-columns: 1fr; }
  .form-row-3 { grid-template-columns: 1fr; }
  .content-area { padding: 14px 16px; }
}
@media (max-width: 600px) {
  .sidebar { display: none; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .action-cards { grid-template-columns: repeat(2, 1fr); }
}

/* ── Toasts / Notificações ─────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: .84rem;
  box-shadow: var(--shadow-lg);
  pointer-events: all;
  animation: toast-in .2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 260px;
  max-width: 380px;
}
.toast.success { border-color: var(--green);  }
.toast.error   { border-color: var(--red);    }
.toast.warning { border-color: var(--yellow); }
.toast .toast-icon { font-size: 1rem; flex-shrink: 0; }
.toast .toast-text { flex: 1; }
@keyframes toast-in { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

/* ── Misc ──────────────────────────────────────────────────── */
.hidden   { display: none !important; }
.text-center { text-align: center; }
.mt-1  { margin-top: 4px;  }
.mt-2  { margin-top: 8px;  }
.mt-3  { margin-top: 12px; }
.mt-4  { margin-top: 16px; }
.flex  { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.gap-1 { gap: 4px; }  .gap-2 { gap: 8px; } .gap-3 { gap: 12px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-1 { flex: 1; min-width: 0; }
.w-full { width: 100%; }
.font-mono { font-family: var(--font-mono); }

/* Highlight c1/c2 separação visual */
.c1-tag { color: var(--blue);   font-size: .7rem; font-weight: 600; }
.c2-tag { color: var(--purple); font-size: .7rem; font-weight: 600; }
