/* ============================================================
   NEXI LEAD 360 — APP EXTRAS
   Padrões de página que estendem o kit (tokens + components).
   Importar DEPOIS de components.css.
   ============================================================ */

/* ──────────────────────────────────────────
   PAGE HEADER (dentro de .content)
────────────────────────────────────────── */
.page-head {
  display: flex;
  align-items: flex-end;
  gap: var(--space-4);
  flex-wrap: wrap;
}
.page-head__main { min-width: 0; }
.page-head__title {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  letter-spacing: -0.6px;
  color: var(--text-primary);
  line-height: 1.1;
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.page-head__title .ico-badge {
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  background: rgba(9,188,138,.10);
  color: var(--accent);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.page-head__title .ico-badge svg { width: 18px; height: 18px; }
/* título premium: branco esvaindo p/ cinza (régua #2) — usar em heros/visões */
.page-head__title--gradient {
  background: var(--gradient-text);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.page-head__desc {
  font-size: var(--text-base);
  color: var(--text-secondary);
  margin-top: var(--space-2);
  max-width: 70ch;
}
.page-head__desc a { color: var(--accent); text-decoration: none; }
.page-head__desc a:hover { text-decoration: underline; }
.page-head__actions { margin-left: auto; display: flex; align-items: center; gap: var(--space-2); }

/* ──────────────────────────────────────────
   SECTION (título + linha)
────────────────────────────────────────── */
.section { display: flex; flex-direction: column; gap: var(--space-3); }
.section__head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.section__head svg { width: 15px; height: 15px; color: var(--accent); flex-shrink: 0; }
.section__head h2 {
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  letter-spacing: -0.3px;
  color: var(--text-primary);
  white-space: nowrap;
}
/* chip numerado da seção (régua #2 — "01", "02"…) */
.section__num {
  width: 28px; height: 28px; border-radius: var(--radius-sm);
  display: grid; place-items: center; flex-shrink: 0;
  background: rgba(9,188,138,.12);
  border: 1px solid var(--accent-border);
  color: var(--color-green-400);
  font-family: var(--font-mono);
  font-size: 12px; font-weight: var(--weight-bold);
}
/* divisória que esvai em gradiente (em vez da linha chapada) */
.section__line { flex: 1; height: 1px; background: var(--gradient-divider); }
.section__count { font-size: var(--text-sm); color: var(--text-muted); font-family: var(--font-mono); }

/* ──────────────────────────────────────────
   FLEX / SPACING HELPERS
────────────────────────────────────────── */
.row { display: flex; align-items: center; gap: var(--space-3); }
.row--between { justify-content: space-between; }
.row--wrap { flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: var(--space-3); }
.col--gap4 { gap: var(--space-4); }
.col--gap5 { gap: var(--space-5); }
.spacer { flex: 1; }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-5); }
.w-full { width: 100%; }
.text-xs { font-size: var(--text-xs); }
.text-sm { font-size: var(--text-sm); }
.text-secondary { color: var(--text-secondary); }

/* ──────────────────────────────────────────
   TAGS / CHIPS
────────────────────────────────────────── */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: var(--weight-medium);
  padding: 3px 9px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  white-space: nowrap;
  cursor: default;
}
.chip--accent { background: var(--accent-soft); border-color: var(--accent-border); color: var(--accent); }
.chip--clickable { cursor: pointer; transition: var(--transition-fast); }
.chip--clickable:hover { border-color: var(--border-default); color: var(--text-primary); }
.chip--active { background: var(--accent); border-color: var(--accent); color: var(--text-on-accent); }

/* segmented control (filtros rápidos) */
.segmented {
  display: inline-flex;
  background: var(--bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 2px;
}
.segmented__item {
  padding: 5px var(--space-3);
  border-radius: 5px;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
  user-select: none;
}
.segmented__item.active { background: var(--surface-2); color: var(--text-primary); }
.segmented__item:hover:not(.active) { color: var(--text-primary); }

/* ──────────────────────────────────────────
   ALERT / BANNER
────────────────────────────────────────── */
.alert {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 11px var(--space-4);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  border: 1px solid;
}
.alert svg { width: 16px; height: 16px; flex-shrink: 0; }
.alert a { color: inherit; font-weight: var(--weight-semibold); text-decoration: underline; white-space: nowrap; margin-left: auto; }
.alert--warning { background: var(--warning-soft); border-color: rgba(240,160,32,.25); color: var(--warning); }
.alert--info { background: var(--info-soft); border-color: rgba(58,126,240,.25); color: var(--info); }
.alert--danger { background: var(--danger-soft); border-color: rgba(232,72,74,.25); color: var(--danger); }
.alert--success { background: rgba(9,188,138,.08); border-color: var(--accent-border); color: var(--accent); }
.alert strong { color: inherit; }

/* ──────────────────────────────────────────
   EMPTY STATE
────────────────────────────────────────── */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-10) var(--space-6);
  text-align: center;
  color: var(--text-muted);
}
.empty__icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  display: grid; place-items: center;
  color: var(--text-muted);
}
.empty__icon svg { width: 22px; height: 22px; }
.empty__title { font-size: var(--text-md); font-weight: var(--weight-semibold); color: var(--text-secondary); }
.empty__desc { font-size: var(--text-sm); max-width: 42ch; }

/* ──────────────────────────────────────────
   KANBAN
────────────────────────────────────────── */
.kanban {
  display: flex;
  gap: var(--space-3);
  overflow-x: auto;
  padding-bottom: var(--space-3);
  flex: 1;
  min-height: 0;
}
.kanban__col {
  width: 270px;
  flex-shrink: 0;
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  max-height: 100%;
}
.kanban__col-head {
  padding: var(--space-3) var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}
.kanban__col-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.kanban__col-title { font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--text-primary); }
.kanban__col-count {
  margin-left: auto;
  font-size: 10.5px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  background: var(--bg);
  padding: 2px 7px;
  border-radius: var(--radius-full);
}
.kanban__col-body {
  padding: var(--space-2);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  flex: 1;
}
.kanban-card {
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: var(--space-3);
  cursor: pointer;
  transition: var(--transition-fast);
}
.kanban-card:hover { border-color: var(--border-accent); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.kanban-card__name { font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--text-primary); margin-bottom: 3px; }
.kanban-card__sub { font-size: 10.5px; color: var(--text-muted); font-family: var(--font-mono); }
.kanban-card__foot { display: flex; align-items: center; gap: var(--space-2); margin-top: var(--space-3); }

/* ──────────────────────────────────────────
   LIST ROWS (filas, qualificação, contatos)
────────────────────────────────────────── */
.list { display: flex; flex-direction: column; }
.list-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  border-bottom: 1px solid var(--border-subtle);
  transition: background .1s;
}
.list-row:last-child { border-bottom: none; }
.list-row:hover { background: rgba(255,255,255,.02); }
.list-row__avatar {
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  display: grid; place-items: center;
  font-size: 11px; font-weight: var(--weight-bold);
  color: var(--text-secondary);
  flex-shrink: 0;
  overflow: hidden;
}
/* avatar redondo com foto real (régua #3 — colaboradores) */
.list-row__avatar--photo { border-radius: 50%; }
.list-row__avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.list-row__main { flex: 1; min-width: 0; }
.list-row__name { font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--text-primary); }
.list-row__sub { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.list-row__end { display: flex; align-items: center; gap: var(--space-2); flex-shrink: 0; }

/* ──────────────────────────────────────────
   STAT INLINE (rótulo + valor mono)
────────────────────────────────────────── */
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat__label { font-size: 10.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .8px; font-weight: var(--weight-semibold); }
.stat__value { font-size: var(--text-lg); font-weight: var(--weight-bold); color: var(--text-primary); font-variant-numeric: tabular-nums; letter-spacing: -.4px; }
.stat__value--mono { font-family: var(--font-mono); font-size: var(--text-md); }

/* ──────────────────────────────────────────
   MINI BAR CHART (hbars)
────────────────────────────────────────── */
.hbars { display: flex; flex-direction: column; gap: var(--space-3); }
.hbar { display: flex; align-items: center; gap: var(--space-3); }
.hbar__label { width: 120px; flex-shrink: 0; font-size: var(--text-sm); color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar__track { flex: 1; height: 10px; background: var(--bg); border-radius: var(--radius-full); overflow: hidden; }
.hbar__fill { height: 100%; border-radius: var(--radius-full); background: var(--accent); width: 0; transition: width 1s cubic-bezier(.4,0,.2,1); }
.hbar__fill--warn { background: var(--warning); }
.hbar__fill--info { background: var(--info); }
.hbar__val { width: 60px; text-align: right; flex-shrink: 0; font-family: var(--font-mono); font-size: 12px; color: var(--text-primary); }

/* ──────────────────────────────────────────
   LINE CHART (SVG)
────────────────────────────────────────── */
.linechart { width: 100%; }
.linechart svg { width: 100%; height: auto; display: block; }
.linechart .lc-grid { stroke: rgba(255,255,255,.05); stroke-width: 1; }
.linechart .lc-axis { fill: var(--text-muted); font-size: 9px; font-family: var(--font-mono); }
.linechart .lc-line { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.linechart .lc-area { opacity: .08; }
.linechart .lc-dot { stroke: var(--surface-1); stroke-width: 1.5; }
.chart-legend { display: flex; flex-wrap: wrap; gap: var(--space-4); margin-top: var(--space-3); }
.chart-legend__item { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-sm); color: var(--text-secondary); }
.chart-legend__swatch { width: 14px; height: 3px; border-radius: 2px; flex-shrink: 0; }

/* NexiUI.lineChart (js/ui.js) emite .np-linechart / .np-chart-legend, que
   divergiram das classes .linechart / .chart-legend acima — sem estas regras
   o helper renderia polígonos e linhas preenchidos de preto. Espelha o .linechart. */
.np-linechart { position: relative; width: 100%; }
.np-linechart svg { display: block; width: 100%; height: 220px; overflow: visible; }
.np-linechart .lc-grid { stroke: rgba(255,255,255,.05); stroke-width: 1; }
.np-linechart .lc-axis { fill: var(--text-muted); font-size: 9px; font-family: var(--font-mono); }
.np-linechart .lc-line { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.np-linechart .lc-area { opacity: .08; }
.np-linechart .lc-dot { stroke: var(--surface-1); stroke-width: 1.5; }
.np-chart-legend { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-2);
  font-size: var(--text-xs); color: var(--text-secondary); }
.np-chart-legend .lg-item { display: inline-flex; align-items: center; gap: 6px; }
.np-chart-legend .lg-swatch { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.np-chart-legend .lg-swatch.dash { border-radius: 0; height: 3px; }
.np-chart-legend .lg-swatch.dot { border-radius: 50%; }

/* ──────────────────────────────────────────
   BULLET / PROGRESS (meta)
────────────────────────────────────────── */
.bullet { display: flex; flex-direction: column; gap: var(--space-2); }
.bullet__head { display: flex; align-items: baseline; gap: var(--space-2); }
.bullet__val { font-size: var(--text-2xl); font-weight: var(--weight-bold); color: var(--accent); letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.bullet__of { font-size: var(--text-sm); color: var(--text-muted); }
.bullet__track { position: relative; height: 12px; background: var(--bg); border-radius: var(--radius-full); overflow: hidden; }
.bullet__fill { height: 100%; border-radius: var(--radius-full); background: linear-gradient(90deg, var(--accent), var(--accent-hover)); width: 0; transition: width 1.1s cubic-bezier(.4,0,.2,1); }
.bullet__scale { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--text-muted); font-family: var(--font-mono); }

/* ──────────────────────────────────────────
   FORM (estende .input do kit)
────────────────────────────────────────── */
.form-grid { display: grid; gap: var(--space-4); }
.field { display: flex; flex-direction: column; gap: var(--space-2); }
.field__label { font-size: var(--text-xs); font-weight: var(--weight-semibold); color: var(--text-secondary); text-transform: uppercase; letter-spacing: .8px; }
.field__hint { font-size: 11px; color: var(--text-muted); }
textarea.input { resize: vertical; min-height: 90px; line-height: var(--leading-normal); font-family: var(--font-sans); }
select.input { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238fa3b8' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; padding-right: 30px; }

/* input[type=date] em TODA tela (não só .input) — o ícone nativo de calendário nasce
   preto sólido no Chrome mesmo com color-scheme:dark (tokens.css), então some contra
   qualquer fundo escuro do kit. invert() é a correção padrão pra isso; sem class="input"
   também cobre os poucos date inputs "crus" (ex.: bd-pop de prazo em massa no board). */
input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(.85); cursor: pointer; opacity: .75; transition: opacity .15s ease; }
input[type="date"]::-webkit-calendar-picker-indicator:hover { opacity: 1; }

/* ──────────────────────────────────────────
   MODAL
────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(3px);
  z-index: var(--z-modal);
  display: flex; align-items: center; justify-content: center;
  padding: var(--space-6);
  opacity: 0; pointer-events: none;
  transition: opacity .2s ease;
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }
.modal {
  background: var(--surface-1);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  display: flex; flex-direction: column;
  overflow: hidden;
  transform: scale(.96);
  transition: transform .2s cubic-bezier(.4,0,.2,1);
}
.modal-overlay.open .modal { transform: scale(1); }
.modal__head { padding: var(--space-5); border-bottom: 1px solid var(--border-subtle); display: flex; align-items: center; gap: var(--space-3); flex-shrink: 0; }
.modal__title { font-size: var(--text-md); font-weight: var(--weight-semibold); color: var(--text-primary); }
.modal__close { margin-left: auto; }
.modal__body { padding: var(--space-5); overflow-y: auto; flex: 1; }
.modal__foot { padding: var(--space-4) var(--space-5); border-top: 1px solid var(--border-subtle); display: flex; justify-content: flex-end; gap: var(--space-2); flex-shrink: 0; }

/* ──────────────────────────────────────────
   MAP LAYOUT (Descobrir)
────────────────────────────────────────── */
.map-layout { display: grid; grid-template-columns: 300px 1fr; gap: var(--space-4); flex: 1; min-height: 0; }
.map-panel { display: flex; flex-direction: column; gap: var(--space-4); overflow-y: auto; }
.map-canvas {
  position: relative;
  border-radius: var(--radius);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  background: var(--surface-1);
  min-height: 420px;
}
.map-canvas__placeholder {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--space-3);
  color: var(--text-muted);
  background:
    radial-gradient(circle at 30% 40%, rgba(9,188,138,.06), transparent 40%),
    radial-gradient(circle at 70% 65%, rgba(58,126,240,.05), transparent 40%),
    linear-gradient(rgba(255,255,255,.02) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(90deg, rgba(255,255,255,.02) 1px, transparent 1px) 0 0 / 28px 28px;
}
.map-pin {
  position: absolute;
  width: 12px; height: 12px;
  border-radius: 50%;
  border: 2px solid var(--surface-1);
  transform: translate(-50%, -50%);
  cursor: pointer;
  transition: transform .15s;
}
.map-pin:hover { transform: translate(-50%, -50%) scale(1.4); z-index: 2; }
.map-pin--gerado { background: var(--accent); box-shadow: 0 0 8px var(--accent-glow); }
.map-pin--pendente { background: var(--warning); }

/* ──────────────────────────────────────────
   DATA-DRIVEN GRID OVERRIDES
────────────────────────────────────────── */
.grid-3-2 { display: grid; grid-template-columns: 2fr 1fr; gap: var(--space-4); }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--space-3); align-items: stretch; }

/* utilitário: ocultar */
[hidden] { display: none !important; }

/* responsivo */
@media (max-width: 1100px) {
  .grid-sidebar, .grid-3-2 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .map-layout { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-xl); }
  .sidebar.open { transform: translateX(0); }
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
}
