/* ═══════════════════════════════════════════
   CRM v2 — THEME SYSTEM
   Dark blue default / body.light override
═══════════════════════════════════════════ */

:root {
  /* ── Backgrounds (Finpad slate — degraus mais nítidos p/ separar superfícies) ── */
  --bg0:    #070a10;   /* page background (bem escuro p/ os cartões saltarem) */
  --bg1:    #0b0f17;   /* sidebar */
  --bg2:    #141b29;   /* panels / columns */
  --bg3:    #1c2434;   /* cards (claramente acima da página) */
  --bg4:    #2a3550;   /* hover / elevated */
  --bg5:    #141b29;   /* inputs (recuados, definidos pela borda) */
  --border: #2f3b55;   /* bordas visíveis */
  --border2:#43526f;

  /* ── Text ── */
  --t1: #eef2f8;       /* primary */
  --t2: #a2afc4;       /* secondary */
  --t3: #7e8ca2;       /* muted (AA em cartão) */
  --t4: #6e7c94;       /* very muted (legível) */

  /* ── Marca = verde (conceito Finpad). Os tokens "blue" apontam para o verde,
        então todo elemento primário/interativo segue a marca automaticamente. ── */
  --green:      #22c55e;
  --green-h:    #16a34a;
  --green-dim:  rgba(34,197,94,.15);
  --blue:       #22c55e;   /* primário da marca (verde) */
  --blue-h:     #16a34a;
  --blue-dim:   rgba(34,197,94,.15);
  --accent:     #4ade80;   /* verde vivo p/ destaques */

  /* ── Info: o único azul de verdade, para sinais informativos ── */
  --info:       #4f8ef7;
  --info-dim:   rgba(79,142,247,.16);

  --red:        #f87171;
  --red-h:      #ef4444;
  --red-dim:    rgba(248,113,113,.15);
  --orange:     #fb923c;
  --orange-dim: rgba(251,146,60,.15);
  --yellow:     #facc15;
  --purple:     #c084fc;
  --purple-dim: rgba(192,132,252,.16);
  --teal:       #2dd4bf;
  --teal-dim:   rgba(45,212,191,.16);

  --shadow:    0 10px 34px rgba(0,0,0,.5);
  --shadow-sm: 0 2px 12px rgba(0,0,0,.35);
  --radius:    12px;
}

body.light {
  --bg0:    #f4f6fa;
  --bg1:    #0c1017;   /* sidebar sempre escura (slate) */
  --bg2:    #ffffff;
  --bg3:    #ffffff;
  --bg4:    #eef2f8;
  --bg5:    #f1f4f9;
  --border: #e3e8f0;
  --border2:#cdd6e4;
  --t1: #0e1420;
  --t2: #47546a;
  --t3: #6b7688;
  --t4: #aab4c4;
  --green:      #16a34a;
  --green-h:    #15803d;
  --green-dim:  rgba(22,163,74,.12);
  --blue:       #16a34a;   /* marca (verde) */
  --blue-h:     #15803d;
  --blue-dim:   rgba(22,163,74,.12);
  --accent:     #22c55e;
  --info:       #2563eb;
  --info-dim:   rgba(37,99,235,.12);
  --red:        #dc2626;
  --red-h:      #b91c1c;
  --red-dim:    rgba(220,38,38,.1);
  --orange:     #ea580c;
  --orange-dim: rgba(234,88,12,.1);
  --shadow:     0 6px 24px rgba(15,23,42,.1);
  --shadow-sm:  0 1px 6px rgba(15,23,42,.08);
}

/* ─── BASE ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: var(--bg0); color: var(--t1); line-height: 1.5; }
a { text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 4px; }

/* ═══════════════════════════════════════════
   LAYOUT
═══════════════════════════════════════════ */
.app { display: flex; height: 100vh; overflow: hidden; }
.main { flex: 1; overflow: hidden; display: flex; flex-direction: column; }

/* ═══════════════════════════════════════════
   SIDEBAR
═══════════════════════════════════════════ */
.sidebar {
  width: 220px;
  height: 100vh;
  background: var(--bg1);
  border-right: 1px solid var(--border2);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
}
.sidebar-logo {
  padding: 18px 16px 14px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.sidebar-logo-icon {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, #4ade80, #16a34a);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 12px; color: #fff; flex-shrink: 0;
  letter-spacing: .03em;
}
.sidebar-logo-text { font-weight: 700; font-size: 15px; color: #edf2ff; letter-spacing: -.01em; }

.sidebar-nav { flex: 1; padding: 12px 10px; display: flex; flex-direction: column; gap: 3px; overflow-y: auto; }
.sidebar-section { font-size: 10px; font-weight: 700; color: rgba(255,255,255,.25); text-transform: uppercase; letter-spacing: .1em; padding: 10px 10px 4px; }

.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 9px;
  color: rgba(237,242,255,.5);
  font-size: 13.5px; font-weight: 500;
  transition: all .15s;
  text-decoration: none;
  white-space: nowrap;
}
.nav-link:hover { background: rgba(255,255,255,.07); color: #edf2ff; }
.nav-link.active { background: rgba(34,197,94,.16); color: #edf2ff; font-weight: 600; }
.nav-link.active svg { color: var(--blue); }
.nav-link svg { width: 16px; height: 16px; flex-shrink: 0; transition: color .15s; }
.nav-badge { margin-left: auto; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; line-height: 1.6; }

.sidebar-footer {
  padding: 12px 10px 16px;
  border-top: 1px solid rgba(255,255,255,.07);
  flex-shrink: 0;
}
.sidebar-footer .nav-link { border: none; background: none; width: 100%; text-align: left; }

/* ═══════════════════════════════════════════
   PAGE HEADER
═══════════════════════════════════════════ */
.page-header {
  padding: 14px 22px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
  background: var(--bg0);
}
.page-title { font-size: 17px; font-weight: 700; color: var(--t1); }
.page-subtitle { font-size: 12px; color: var(--t3); margin-top: 1px; }

/* ═══════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════ */
.btn {
  padding: 8px 18px; border-radius: 8px; font-size: 13.5px; font-weight: 600;
  border: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px;
  transition: all .15s; line-height: 1.2;
}
.btn-green  { background: var(--green); color: #06240f; }
.btn-green:hover { background: var(--green-h); color: #06240f; }
.btn-blue   { background: var(--blue); color: #fff; }
.btn-blue:hover { background: var(--blue-h); }
.btn-orange { background: var(--orange); color: #fff; }
.btn-orange:hover { opacity: .88; }
.btn-ghost  { background: transparent; border: 1px solid var(--border2); color: var(--t2); }
.btn-ghost:hover { background: var(--bg3); color: var(--t1); }
.btn-danger { background: transparent; border: 1px solid var(--border); color: var(--red); }
.btn-danger:hover { background: var(--red-dim); }
.btn-sm { padding: 6px 13px; font-size: 12.5px; }
.btn-xs { padding: 4px 10px; font-size: 12px; border-radius: 6px; }
.btn-icon {
  padding: 6px; border-radius: 7px; border: none; background: transparent;
  color: var(--t3); transition: all .15s;
  display: inline-flex; align-items: center; justify-content: center;
}
.btn-icon:hover { background: var(--bg4); color: var(--t1); }
.btn-icon svg { width: 15px; height: 15px; }

/* ═══════════════════════════════════════════
   BADGES / TAGS
═══════════════════════════════════════════ */
.tag { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; gap: 4px; }
.tag-blue   { background: var(--info-dim); color: #93c5fd; }
.tag-green  { background: var(--green-dim); color: #86efac; }
.tag-red    { background: var(--red-dim); color: #fca5a5; }
.tag-orange { background: var(--orange-dim); color: #fdba74; }
.tag-gray   { background: var(--bg4); color: var(--t2); }
.tag-yellow { background: rgba(250,204,21,.15); color: #fde047; }
.tag-purple { background: var(--purple-dim); color: var(--purple); }
.tag-teal   { background: var(--teal-dim); color: var(--teal); }

/* ═══════════════════════════════════════════
   FORM FIELDS
═══════════════════════════════════════════ */
.field-label { display: block; font-size: 11px; font-weight: 700; color: var(--t3); text-transform: uppercase; letter-spacing: .07em; margin-bottom: 5px; }
.field-input { width: 100%; background: var(--bg5); border: 1px solid var(--border2); border-radius: 8px; padding: 8px 12px; font-size: 13.5px; color: var(--t1); outline: none; transition: all .15s; }
.field-input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-dim); }
.field-input::placeholder { color: var(--t4); }
.field-input[disabled] { opacity: .5; cursor: not-allowed; }
textarea.field-input { resize: vertical; min-height: 80px; }
select.field-input { cursor: pointer; }
.field-group { margin-bottom: 14px; }
.field-row-inline { display: flex; gap: 12px; }
.field-row-inline .field-group { flex: 1; }

/* ═══════════════════════════════════════════
   PIPELINE
═══════════════════════════════════════════ */
.pipeline-wrapper { flex: 1; overflow: hidden; display: flex; flex-direction: column; }
.pipeline-board { flex: 1; display: flex; gap: 14px; overflow-x: auto; padding: 18px 22px 22px; align-items: flex-start; }
.pipeline-col { min-width: 266px; max-width: 266px; flex-shrink: 0; display: flex; flex-direction: column; gap: 8px; }
.col-header { display: flex; align-items: center; gap: 8px; padding: 6px 2px; }
.col-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.col-title { font-size: 13.5px; font-weight: 700; color: var(--t1); flex: 1; }
.col-count { background: var(--bg3); border: 1px solid var(--border); color: var(--t2); font-size: 11px; font-weight: 700; padding: 1px 9px; border-radius: 999px; }
.col-edit-btn { opacity: 0; transition: opacity .15s; }
.pipeline-col:hover .col-edit-btn { opacity: 1; }
.col-body { background: var(--bg2); border: 1px solid var(--border); border-radius: 11px; min-height: 180px; padding: 8px; transition: all .2s; }
.col-body.drag-over { border-color: var(--blue); background: rgba(34,197,94,.08); }
.col-add-btn { display: flex; align-items: center; gap: 6px; width: 100%; padding: 7px 10px; border-radius: 8px; border: none; background: transparent; color: var(--t3); font-size: 13px; cursor: pointer; transition: all .15s; }
.col-add-btn:hover { background: var(--bg2); color: var(--t2); }
.col-add-stage { min-width: 220px; flex-shrink: 0; padding-top: 38px; }
.col-add-stage-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 42px; border: 2px dashed var(--border2); border-radius: 11px; background: transparent; color: var(--t3); font-size: 13px; cursor: pointer; transition: all .15s; }
.col-add-stage-btn:hover { border-color: var(--blue); color: var(--blue); }

/* ─── PIPELINE CARD ─── */
.p-card { background: var(--bg3); border: 1px solid var(--border); border-radius: 10px; padding: 12px 13px; cursor: pointer; transition: all .2s; margin-bottom: 8px; border-left: 3px solid transparent; }
.p-card:last-child { margin-bottom: 0; }
.p-card:hover { border-color: var(--border2); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.p-card.dragging { opacity: .3; transform: rotate(1.5deg); }
.p-card.p-card-lost { opacity: .55; }
.p-card.p-card-lost .p-card-name { text-decoration: line-through; }
.p-card-name { color: var(--t1); font-weight: 700; font-size: 14px; margin-bottom: 5px; line-height: 1.3; }
.p-card-line { font-size: 12px; color: var(--t2); margin-top: 3px; }
.p-card-footer { display: flex; align-items: center; gap: 6px; margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--border); }
.avatar-sm { width: 24px; height: 24px; border-radius: 50%; background: var(--blue); color: #fff; font-size: 10px; font-weight: 800; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.card-stat { display: flex; align-items: center; gap: 3px; font-size: 12px; color: var(--t3); }
.card-stat svg { width: 12px; height: 12px; }
.card-stat-red { color: var(--red); }

/* ═══════════════════════════════════════════
   EMPRESA PAGE
═══════════════════════════════════════════ */
.empresa-top { flex-shrink: 0; background: var(--bg1); border-bottom: 1px solid var(--border2); }
.empresa-header { display: flex; align-items: center; gap: 12px; padding: 14px 22px; }
.empresa-name { font-size: 19px; font-weight: 700; color: var(--t1); }
.stage-trail { display: flex; align-items: center; overflow-x: auto; padding: 0 22px 14px; gap: 0; }
.stage-trail::-webkit-scrollbar { height: 0; }
.stage-step { display: flex; align-items: center; flex-shrink: 0; }
.stage-step-btn { padding: 5px 14px; font-size: 12.5px; font-weight: 500; color: var(--t3); background: transparent; border: 1px solid var(--border2); border-radius: 6px; cursor: pointer; transition: all .15s; white-space: nowrap; }
.stage-step-btn:hover { border-color: var(--border2); color: var(--t2); background: var(--bg3); }
.stage-step-btn.active { background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 600; }
.stage-step-btn .days { font-size: 11px; opacity: .75; margin-left: 5px; }
.stage-arrow { color: var(--t4); margin: 0 4px; font-size: 14px; }

.empresa-layout { flex: 1; display: flex; overflow: hidden; }
.empresa-left { width: 300px; flex-shrink: 0; background: var(--bg1); border-right: 1px solid var(--border); overflow-y: auto; }
.empresa-main { flex: 1; overflow-y: auto; background: var(--bg0); }

/* Left panel */
.panel-section { padding: 10px 16px 6px; display: flex; align-items: center; justify-content: space-between; }
.panel-section-title { font-size: 11px; font-weight: 700; color: var(--t3); text-transform: uppercase; letter-spacing: .07em; }
.panel-field { padding: 8px 16px; border-bottom: 1px solid var(--border); }
.panel-field:hover { background: rgba(255,255,255,.025); }
.panel-field-key { font-size: 11px; color: var(--t4); margin-bottom: 3px; text-transform: uppercase; letter-spacing: .04em; }
.panel-field-val { font-size: 13.5px; color: var(--t2); }
.panel-field-val.editable { color: var(--t1); cursor: pointer; }
.panel-field-val.editable:hover { color: var(--blue); }
.panel-field-val.empty { color: var(--t4); font-style: italic; }

/* ─── INFO FIELDS (clean HubSpot-style) ─── */
.info-section-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border);
}
.info-section-label {
  font-size: 11px; font-weight: 700; color: var(--t3);
  text-transform: uppercase; letter-spacing: .08em;
}
.info-fields-list { padding: 6px 0 10px; }
.info-field {
  display: flex; flex-direction: column; gap: 3px;
  padding: 8px 16px;
  cursor: pointer;
  border-radius: 6px;
  margin: 0 6px;
  transition: background .15s;
}
.info-field:hover { background: rgba(255,255,255,.05); }
.info-field-key {
  font-size: 10.5px; font-weight: 700;
  color: var(--t4); text-transform: uppercase; letter-spacing: .07em;
}
.info-field-val { font-size: 13.5px; color: var(--t1); line-height: 1.4; word-break: break-all; }
.info-field-val.empty { color: var(--t4); font-style: italic; font-size: 13px; }
.info-field-val a { color: var(--blue); }
.info-field-val a:hover { text-decoration: underline; }
.info-field:hover .info-field-val.empty { color: var(--t3); }

/* ─── CONTACT CARDS (redesigned) ─── */
.contact-section-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px 10px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-top: 8px;
}

/* Contacts */
.contact-card { padding: 12px 16px; border-bottom: 1px solid var(--border); }
.contact-card:hover { background: rgba(255,255,255,.025); }
.contact-name { font-size: 13.5px; font-weight: 600; color: var(--t1); margin-bottom: 2px; }
.contact-role { font-size: 12px; color: var(--t3); margin-bottom: 6px; }
.contact-detail { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--t2); margin-top: 3px; }
.contact-detail svg { width: 12px; height: 12px; color: var(--t3); flex-shrink: 0; }
.contact-detail a { color: var(--blue); }

/* Main area tasks */
.empresa-tasks-area { padding: 18px 22px; border-bottom: 1px solid var(--border); }
.empresa-tasks-title { font-size: 13px; font-weight: 700; color: var(--t2); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.empresa-action-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* Task card */
.task-row { display: flex; align-items: flex-start; gap: 12px; background: var(--bg2); border: 1px solid var(--border); border-radius: 9px; padding: 11px 13px; margin-bottom: 8px; }
.task-row:last-child { margin-bottom: 0; }
.task-row.overdue { border-left: 3px solid var(--red); }
.task-row.upcoming { border-left: 3px solid var(--blue); }
.task-check { width: 16px; height: 16px; accent-color: var(--green); cursor: pointer; margin-top: 2px; flex-shrink: 0; }
.task-title { font-size: 13.5px; font-weight: 500; color: var(--t1); }
.task-desc  { font-size: 12px; color: var(--t3); margin-top: 2px; }
.task-meta  { font-size: 12px; color: var(--t3); margin-top: 4px; display: flex; align-items: center; gap: 8px; }
.task-meta svg { width: 12px; height: 12px; }
.task-actions { margin-left: auto; display: flex; gap: 4px; flex-shrink: 0; align-items: center; }

/* Tabs */
.tabs-bar { display: flex; border-bottom: 1px solid var(--border); padding: 0 22px; background: var(--bg0); }
.tab-btn { padding: 11px 16px; font-size: 13.5px; color: var(--t3); border-bottom: 2px solid transparent; cursor: pointer; transition: all .15s; margin-bottom: -1px; }
.tab-btn:hover { color: var(--t1); }
.tab-btn.active { color: var(--blue); border-bottom-color: var(--blue); font-weight: 600; }
.tab-body { padding: 20px 22px; }

/* ─── Timeline / Histórico de movimentações ─── */
.tl { position: relative; padding: 2px 0 4px; }
.tl-day { display: flex; align-items: center; gap: 12px; margin: 20px 0 12px; }
.tl-day:first-child { margin-top: 2px; }
.tl-day-label { font-size: 11px; font-weight: 700; color: var(--t3); text-transform: uppercase; letter-spacing: .08em; white-space: nowrap; }
.tl-day-line { flex: 1; height: 1px; background: var(--border); }

.tl-entry { position: relative; display: flex; gap: 14px; padding: 0 0 16px; }
.tl-entry::before { content: ''; position: absolute; left: 15px; top: 32px; bottom: -2px; width: 2px; background: var(--border); }
.tl-entry:last-child::before { display: none; }
.tl-node {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0; z-index: 1;
  display: flex; align-items: center; justify-content: center; font-size: 14px;
  border: 1.5px solid var(--border2); background: var(--bg4);
}
.tl-node.c-info   { border-color: var(--info);   background: var(--info-dim); }
.tl-node.c-green  { border-color: var(--green);  background: var(--green-dim); }
.tl-node.c-orange { border-color: var(--orange); background: var(--orange-dim); }
.tl-node.c-teal   { border-color: var(--teal);   background: var(--teal-dim); }
.tl-node.c-purple { border-color: var(--purple); background: var(--purple-dim); }
.tl-node.c-red    { border-color: var(--red);    background: var(--red-dim); }
.tl-node.c-gray   { border-color: var(--border2); background: var(--bg4); }

.tl-body { flex: 1; min-width: 0; padding-top: 4px; }
.tl-kind { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--t3); margin-bottom: 2px; }
.tl-content { font-size: 13.5px; color: var(--t1); line-height: 1.5; }
.tl-content b { font-weight: 700; }
.tl-meta { font-size: 11.5px; color: var(--t4); margin-top: 3px; }
.tl-empty { text-align: center; padding: 40px 20px; color: var(--t3); }
.tl-empty-icon { font-size: 30px; opacity: .5; margin-bottom: 10px; }

/* Note input */
.note-bar { display: flex; gap: 10px; padding: 12px 22px; border-bottom: 1px solid var(--border); background: var(--bg0); }
.note-bar .field-input { font-size: 13px; }

/* ═══════════════════════════════════════════
   TODAY / TAREFAS PAGE
═══════════════════════════════════════════ */
.today-content { max-width: 700px; margin: 0 auto; padding: 24px 20px; }
.today-section-title { font-size: 11px; font-weight: 700; color: var(--t3); text-transform: uppercase; letter-spacing: .07em; margin: 20px 0 10px; }
.today-task { background: var(--bg3); border: 1px solid var(--border); border-radius: 10px; padding: 13px 16px; display: flex; align-items: flex-start; gap: 12px; margin-bottom: 8px; }
.today-task.overdue { border-left: 3px solid var(--red); }
.today-task-company { display: inline-flex; align-items: center; gap: 4px; color: var(--blue); font-size: 12px; font-weight: 600; margin-top: 4px; cursor: pointer; }
.today-task-company:hover { text-decoration: underline; }
.today-empty { text-align: center; padding: 40px 20px; }
.today-empty-icon { font-size: 40px; margin-bottom: 12px; }
.today-empty-text { color: var(--t2); font-size: 16px; font-weight: 600; }
.today-empty-sub  { color: var(--t3); font-size: 14px; margin-top: 4px; }

/* ═══════════════════════════════════════════
   DASHBOARD
═══════════════════════════════════════════ */
.dash-content { flex: 1; overflow-y: auto; padding: 22px; }

/* KPI grid */
.dash-kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin-bottom: 24px; }
.dash-kpi {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  display: flex; flex-direction: column; gap: 6px;
  transition: all .2s;
  position: relative;
  overflow: hidden;
}
.dash-kpi:hover { border-color: var(--border2); box-shadow: var(--shadow-sm); }
.dash-kpi-accent { position: absolute; top: 0; left: 0; right: 0; height: 3px; border-radius: 12px 12px 0 0; }
.dash-kpi-label { font-size: 11px; font-weight: 700; color: var(--t3); text-transform: uppercase; letter-spacing: .07em; }
.dash-kpi-val { font-size: 32px; font-weight: 800; color: var(--t1); line-height: 1; }
.dash-kpi-sub { font-size: 12px; color: var(--t3); }
.dash-kpi-icon { position: absolute; right: 16px; top: 14px; font-size: 22px; opacity: .25; }

/* ─── Dashboard revamp (gestão) ─── */
.dash-section-title { font-size: 12px; font-weight: 700; color: var(--t2); text-transform: uppercase; letter-spacing: .06em; margin: 6px 0 12px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dash-section-title .st-tag { color: var(--t3); font-weight: 600; text-transform: none; letter-spacing: 0; font-size: 12px; }

/* KPI delta badge + prev value */
.dash-kpi-sub-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.kpi-delta { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 99px; white-space: nowrap; }
.kpi-delta.up   { color: var(--green); background: var(--green-dim); }
.kpi-delta.down { color: var(--red);   background: var(--red-dim); }
.kpi-delta.flat { color: var(--t3);    background: var(--bg5); }

/* Horizontal bar list (segmentos / cidades / ranking) */
.hbar-list { display: flex; flex-direction: column; gap: 12px; }
.hbar-row { display: grid; grid-template-columns: 118px 1fr auto; align-items: center; gap: 10px; }
.hbar-label { font-size: 12.5px; color: var(--t1); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar-track { height: 20px; background: var(--bg5); border-radius: 6px; overflow: hidden; position: relative; }
.hbar-fill { height: 100%; border-radius: 6px; transition: width .5s ease; min-width: 2px; }
.hbar-val { font-size: 12.5px; font-weight: 700; color: var(--t1); text-align: right; white-space: nowrap; line-height: 1.15; }
.hbar-sub { font-size: 10.5px; color: var(--t3); font-weight: 500; }

/* Line chart */
.line-chart { width: 100%; height: auto; max-height: 190px; display: block; overflow: visible; }
.lc-grid { stroke: var(--border); stroke-width: 1; }
.lc-axis { fill: var(--t3); font-size: 10px; }

/* Conversion funnel */
.funnel-list { display: flex; flex-direction: column; gap: 11px; }
.funnel-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; margin-bottom: 3px; gap: 8px; }
.funnel-name { color: var(--t1); font-weight: 600; }
.funnel-meta { color: var(--t2); font-weight: 700; white-space: nowrap; }
.funnel-conv { color: var(--t3); font-weight: 500; }

/* Segmented toggle */
.seg-toggle { display: inline-flex; background: var(--bg5); border-radius: 8px; padding: 2px; gap: 2px; }
.seg-toggle button { border: none; background: transparent; color: var(--t3); font-size: 11.5px; font-weight: 600; padding: 4px 10px; border-radius: 6px; cursor: pointer; transition: all .15s; }
.seg-toggle button.active { background: var(--bg2); color: var(--t1); box-shadow: var(--shadow-sm); }
.seg-toggle button:not(.active):hover { color: var(--t1); }

/* Config — navegação por categorias */
.cfg-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; position: sticky; top: 0; z-index: 5; background: var(--bg0); padding: 4px 0 10px; }
.cfg-nav button { border: 1px solid var(--border); background: var(--bg2); color: var(--t2); font-size: 13px; font-weight: 600; padding: 7px 13px; border-radius: 9px; cursor: pointer; transition: all .15s; display: inline-flex; align-items: center; gap: 6px; }
.cfg-nav button:hover { border-color: var(--border2); color: var(--t1); }
.cfg-nav button.active { background: var(--blue); border-color: var(--blue); color: #fff; }
/* Config — etapas (visual) */
.stage-item { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 9px; margin: 6px 0; background: var(--bg3); border: 1px solid var(--border); border-left-width: 4px; transition: all .15s; }
.stage-item:hover { border-color: var(--border2); box-shadow: var(--shadow-sm); }
.stage-item .stage-name { flex: 1; font-size: 14px; font-weight: 600; color: var(--t1); }
.cfg-pill { font-size: 11px; font-weight: 700; color: var(--t2); border: 1px solid var(--border); padding: 2px 10px; border-radius: 99px; white-space: nowrap; }

/* Config — grade de segmentos/subsegmentos */
.seg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.seg-card { background: var(--bg3); border: 1px solid var(--border); border-radius: 11px; padding: 12px 14px; display: flex; flex-direction: column; gap: 9px; transition: border-color .15s; }
.seg-card:hover { border-color: var(--border2); }
.seg-card-head { display: flex; align-items: center; gap: 8px; }
.seg-card-name { flex: 1; font-size: 14px; font-weight: 700; color: var(--t1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seg-card-count { font-size: 10.5px; font-weight: 700; color: var(--t3); background: var(--bg5); padding: 2px 8px; border-radius: 99px; }
.seg-subs { display: flex; flex-wrap: wrap; gap: 6px; min-height: 4px; }
.seg-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--t1); background: var(--bg5); border: 1px solid var(--border); padding: 3px 4px 3px 10px; border-radius: 99px; }
.seg-pill button { background: none; border: none; color: var(--t3); cursor: pointer; font-size: 15px; line-height: .6; padding: 0 3px; border-radius: 99px; }
.seg-pill button:hover { color: var(--red); }
.seg-add { font-size: 12.5px !important; padding: 6px 10px !important; }

/* Dashboard 2-col layout */
.dash-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 22px; }
@media (max-width: 900px) { .dash-row { grid-template-columns: 1fr; } }

.dash-card { background: var(--bg2); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.dash-card-header { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.dash-card-title { font-size: 13px; font-weight: 700; color: var(--t1); text-transform: uppercase; letter-spacing: .05em; }
.dash-card-body { padding: 14px 18px; }

/* Call funnel */
.dash-funnel { display: flex; flex-direction: column; gap: 10px; }
.dash-funnel-row { display: flex; align-items: center; gap: 12px; }
.dash-funnel-label { font-size: 13px; color: var(--t2); width: 120px; flex-shrink: 0; }
.dash-funnel-bar { flex: 1; height: 8px; background: var(--bg5); border-radius: 99px; overflow: hidden; }
.dash-funnel-fill { height: 100%; border-radius: 99px; transition: width .5s ease; }
.dash-funnel-count { font-size: 13px; font-weight: 700; color: var(--t1); min-width: 28px; text-align: right; }

/* Stage summary rows */
.dash-stage-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.dash-stage-row:last-child { border-bottom: none; }
.dash-stage-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.dash-stage-name { flex: 1; font-size: 13.5px; color: var(--t1); }
.dash-stage-count { font-size: 13px; font-weight: 700; color: var(--blue); min-width: 20px; text-align: right; }

/* Recent calls table */
.dash-table { width: 100%; border-collapse: collapse; }
.dash-table th { font-size: 11px; font-weight: 700; color: var(--t3); text-transform: uppercase; letter-spacing: .06em; padding: 8px 14px; text-align: left; border-bottom: 1px solid var(--border); }
.dash-table td { font-size: 13px; color: var(--t1); padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.dash-table tr:last-child td { border-bottom: none; }
.dash-table tr:hover td { background: rgba(255,255,255,.025); }

/* Result badges */
.result-atendida   { background: var(--green-dim);  color: var(--green);  }
.result-naofoi     { background: var(--red-dim);    color: var(--red);    }
.result-caixa      { background: var(--orange-dim); color: var(--orange); }
.result-reagendou  { background: var(--info-dim);   color: var(--info);   }
.result-enviado    { background: var(--teal-dim);   color: var(--teal);   }

/* Activity feed */
.dash-activity-item { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.dash-activity-item:last-child { border-bottom: none; }
.dash-activity-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 5px; }
.dash-activity-text { font-size: 13px; color: var(--t1); line-height: 1.4; }
.dash-activity-meta { font-size: 11px; color: var(--t3); margin-top: 2px; }

/* ═══════════════════════════════════════════
   CONFIG PAGE
═══════════════════════════════════════════ */
.config-content { max-width: 720px; margin: 0 auto; padding: 24px 20px; }
.config-section { margin-bottom: 32px; }
.config-section-title { font-size: 15px; font-weight: 700; color: var(--t1); margin-bottom: 14px; }
.config-card { background: var(--bg2); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.config-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.config-row:last-child { border-bottom: none; }
.config-row-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.config-row-label { flex: 1; font-size: 13.5px; color: var(--t1); font-weight: 500; }
.config-row-meta  { font-size: 12.5px; color: var(--t3); }
.tags-grid { display: flex; flex-wrap: wrap; gap: 8px; }

/* ═══════════════════════════════════════════
   DIALOG
═══════════════════════════════════════════ */
.dlg-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.65); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; }
.dlg-box { background: var(--bg2); border: 1px solid var(--border2); border-radius: 14px; width: 100%; max-width: 480px; padding: 24px; box-shadow: var(--shadow); }
.dlg-title { font-size: 16px; font-weight: 700; color: var(--t1); margin-bottom: 18px; }
.dlg-footer { display: flex; gap: 10px; margin-top: 20px; }
.dlg-footer .btn { flex: 1; justify-content: center; }

/* ═══════════════════════════════════════════
   TOAST
═══════════════════════════════════════════ */
.toast-wrap { position: fixed; bottom: 20px; right: 20px; z-index: 200; pointer-events: none; }
.toast { background: var(--bg4); border: 1px solid var(--border2); color: var(--t1); padding: 11px 18px; border-radius: 10px; font-size: 13.5px; font-weight: 500; box-shadow: var(--shadow); margin-top: 8px; opacity: 0; transition: opacity .25s; }
.toast.show { opacity: 1; }
.toast.success { border-left: 3px solid var(--green); }
.toast.error   { border-left: 3px solid var(--red); }
.toast.info    { border-left: 3px solid var(--info); }

/* ═══════════════════════════════════════════
   MISC UTILITIES
═══════════════════════════════════════════ */
.divider { height: 1px; background: var(--border); }
.icon    { width: 16px; height: 16px; flex-shrink: 0; }
.icon-sm { width: 13px; height: 13px; }
.text-muted  { color: var(--t3); font-size: 13px; }
.text-red    { color: var(--red); }
.text-green  { color: var(--green); }
.text-blue   { color: var(--blue); }
.text-orange { color: var(--orange); }

.gcal-btn { background: #1a73e8; color: #fff; border: none; padding: 5px 11px; border-radius: 6px; font-size: 11.5px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; transition: background .15s; }
.gcal-btn:hover { background: #1557b0; }

.call-btn { background: var(--green); color: #06240f; border: none; padding: 5px 11px; border-radius: 6px; font-size: 11.5px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; transition: all .15s; }
.call-btn:hover { background: var(--green-h); }

.email-btn { background: var(--info-dim); color: var(--info); border: 1px solid rgba(79,142,247,.3); padding: 5px 11px; border-radius: 6px; font-size: 11.5px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; transition: all .15s; }
.email-btn:hover { background: rgba(79,142,247,.3); }

/* ═══════════════════════════════════════════
   QUEUE BAR — task queue mode
═══════════════════════════════════════════ */
.queue-bar {
  background: linear-gradient(90deg, #10141e 0%, #12201a 100%);
  border-bottom: 2px solid var(--blue);
  padding: 10px 20px;
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0;
  position: relative;
  z-index: 20;
}
.queue-progress-pill {
  background: var(--blue);
  color: #fff;
  font-size: 11px; font-weight: 800;
  padding: 3px 11px; border-radius: 999px;
  white-space: nowrap; flex-shrink: 0;
  letter-spacing: .02em;
}
.queue-task-info {
  flex: 1; min-width: 0;
  display: flex; align-items: baseline; gap: 8px;
}
.queue-task-title {
  font-size: 13.5px; font-weight: 700; color: var(--t1);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.queue-task-meta { font-size: 12px; color: var(--t3); white-space: nowrap; flex-shrink: 0; }
.queue-company-name { font-size: 12px; color: var(--blue); font-weight: 600; white-space: nowrap; flex-shrink: 0; }
.queue-sep { color: var(--t4); font-size: 12px; }
.queue-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

/* Highlighted task row in queue mode */
.task-row.queue-active {
  border: 2px solid var(--blue) !important;
  background: rgba(34,197,94,.08) !important;
  box-shadow: 0 0 0 3px rgba(34,197,94,.12);
}
.task-row.queue-active .task-title {
  color: #edf2ff;
  font-weight: 700;
}
.queue-active-badge {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--blue); color: #fff;
  font-size: 10px; font-weight: 800; text-transform: uppercase;
  padding: 2px 8px; border-radius: 999px; letter-spacing: .05em;
  margin-left: 8px; flex-shrink: 0;
}

/* Queue complete screen */
.queue-done {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 100%; padding: 60px 20px; text-align: center;
}
.queue-done-icon { font-size: 60px; margin-bottom: 20px; }
.queue-done-title { font-size: 22px; font-weight: 800; color: var(--t1); margin-bottom: 8px; }
.queue-done-sub { font-size: 14px; color: var(--t3); }

/* ─── Operational chart (HTML div bars) ─── */
.op-chart {
  display: flex; gap: 3px; align-items: flex-end;
  height: 180px; padding-top: 18px; position: relative;
}
.op-col {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; border-radius: 4px 4px 0 0;
  padding: 0 1px; min-width: 0;
}
.op-col.op-today {
  background: rgba(34,197,94,.06);
  outline: 1px solid rgba(34,197,94,.18);
  border-radius: 4px;
}
.op-bars {
  display: flex; align-items: flex-end; gap: 2px;
  width: 100%; justify-content: center; flex: 1;
}
.op-bar {
  border-radius: 3px 3px 0 0;
  min-width: 7px; flex: 1; max-width: 15px;
  position: relative; transition: filter .12s, opacity .12s;
  min-height: 3px; cursor: pointer;
}
.op-bar.empty { cursor: default; pointer-events: none; }
.op-bar:not(.empty):hover { filter: brightness(1.4); }
.op-bar-val {
  position: absolute; top: -15px; left: 50%;
  transform: translateX(-50%);
  font-size: 9px; font-weight: 700; white-space: nowrap;
  pointer-events: none;
}
.op-label {
  font-size: 10px; color: var(--t3); text-align: center;
  padding-top: 5px; white-space: nowrap; overflow: hidden;
  width: 100%; line-height: 1.2;
}
.op-col.op-today .op-label { color: var(--t1); font-weight: 700; }
.op-hint { font-size:11px; color:var(--t4); text-align:center; margin-top:6px; }

/* ─── Detail item (used in dashboard bar click modal) ─── */
.detail-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.detail-item:last-child { border-bottom: none; }

/* Empty states */
.empty-state { text-align: center; padding: 32px 20px; color: var(--t3); }
.empty-state-icon { font-size: 32px; margin-bottom: 10px; opacity: .6; }
.empty-state-text { font-size: 13.5px; }
