/* ============================================================
   tintim.css — Painel Tintim Analytics
   ============================================================ */
.tintim-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--ease);
}
.tintim-overlay.active {
  opacity: 1;
  pointer-events: all;
}
.tintim-panel {
  position: fixed;
  top: 0;
  right: -100%;
  width: min(95vw, 1100px);
  height: 100vh;
  height: 100dvh;
  z-index: var(--z-tintim);
  background: var(--bg-2);
  border-left: 1px solid var(--border-strong);
  display: flex;
  flex-direction: column;
  transition: right 0.4s var(--ease);
  overflow: hidden;
}
.tintim-panel.open {
  right: 0;
}
.tintim-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 64px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.tintim-header__left {
  display: flex;
  align-items: center;
  gap: 14px;
}
.tintim-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
}
.tintim-logo i {
  width: 20px;
  height: 20px;
}
.tintim-subtitle {
  font-size: 0.76rem;
  color: var(--text-faint);
}
.tintim-header__right {
  display: flex;
  align-items: center;
  gap: 14px;
}
.tintim-live {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--accent);
  text-transform: uppercase;
}
.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: liveBlink 1.5s var(--ease) infinite;
}
.tintim-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  transition:
    background 0.25s var(--ease),
    color 0.25s var(--ease);
}
.tintim-close:hover {
  background: rgba(255, 80, 80, 0.15);
  color: #ff5050;
}
.tintim-close i {
  width: 16px;
  height: 16px;
}
.tintim-tabs {
  display: flex;
  gap: 4px;
  padding: 12px 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  overflow-x: auto;
}
.tintim-tab {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: var(--r-sm);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-dim);
  white-space: nowrap;
  border: 1px solid transparent;
  transition:
    color 0.25s var(--ease),
    background 0.25s var(--ease);
}
.tintim-tab:hover,
.tintim-tab.active {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: var(--border);
}
.tintim-tab i {
  width: 15px;
  height: 15px;
}
.tintim-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}
.tintim-body::-webkit-scrollbar {
  width: 5px;
}
.tintim-body::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 3px;
}
.tintim-content {
  display: none;
}
.tintim-content.active {
  display: block;
}
.tintim-footer {
  padding: 14px 24px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  font-size: 0.78rem;
  color: var(--text-faint);
}
.btn-clear-all {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 0.78rem;
  transition:
    border-color 0.25s var(--ease),
    color 0.25s var(--ease);
}
.btn-clear-all:hover {
  border-color: rgba(255, 80, 80, 0.3);
  color: #ff5050;
}
.btn-clear-all i {
  width: 14px;
  height: 14px;
}

.dash-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
  transition:
    transform 0.3s var(--ease),
    border-color 0.3s var(--ease);
}
.kpi-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-3px);
}
.kpi-card__label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-faint);
  margin-bottom: 10px;
}
.kpi-card__label i {
  width: 14px;
  height: 14px;
}
.kpi-card__value {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 6px;
}
.kpi-card__sub {
  font-size: 0.75rem;
  color: var(--text-faint);
}
.kpi-card__sub span {
  color: #22c55e;
}
.dash-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.dash-row:last-child {
  grid-template-columns: repeat(3, 1fr);
}
.dash-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
}
.dash-card h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-dim);
}
.dash-card h4 i {
  width: 15px;
  height: 15px;
  color: var(--accent);
}
.dash-card--wide {
  grid-column: 1 / 2;
}
.chart-bar-container {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 140px;
  padding: 0 4px;
}
.chart-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.chart-bar {
  width: 100%;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(var(--accent), var(--accent-2));
  min-height: 4px;
  cursor: pointer;
  transition: filter 0.3s var(--ease);
}
.chart-bar:hover {
  filter: brightness(1.3);
}
.chart-bar-label {
  font-size: 0.65rem;
  color: var(--text-faint);
}
.device-chart {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.device-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.device-row-label {
  font-size: 0.82rem;
  min-width: 80px;
  color: var(--text-dim);
}
.device-bar-wrap {
  flex: 1;
  height: 10px;
  background: var(--surface-2);
  border-radius: 100px;
  overflow: hidden;
}
.device-bar {
  height: 100%;
  border-radius: 100px;
  transition: width 0.6s var(--ease);
}
.device-pct {
  font-size: 0.78rem;
  font-weight: 700;
  min-width: 36px;
  text-align: right;
}
.stat-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.stat-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  font-size: 0.82rem;
}
.stat-list-item__label {
  color: var(--text-dim);
}
.stat-list-item__bar-wrap {
  flex: 1;
  height: 4px;
  margin: 0 12px;
  background: var(--surface-2);
  border-radius: 100px;
  overflow: hidden;
}
.stat-list-item__bar {
  height: 100%;
  border-radius: 100px;
  background: var(--accent);
}
.stat-list-item__count {
  font-weight: 700;
  font-size: 0.8rem;
  min-width: 30px;
  text-align: right;
}
.visitors-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.visitors-search {
  flex: 1;
  padding: 10px 16px;
  border-radius: var(--r);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.25s var(--ease);
}
.visitors-search:focus {
  border-color: var(--border-strong);
}
.btn-export {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: var(--r);
  background: var(--accent-soft);
  border: 1px solid var(--border);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 600;
  transition:
    background 0.25s var(--ease),
    color 0.25s var(--ease);
}
.btn-export:hover {
  background: var(--accent);
  color: #fff;
}
.btn-export i {
  width: 14px;
  height: 14px;
}
.visitors-table-wrap {
  overflow-x: auto;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
}
.visitors-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}
.visitors-table th {
  background: var(--surface);
  padding: 12px 14px;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-faint);
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
.visitors-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-dim);
  white-space: nowrap;
}
.visitors-table tr:hover td {
  background: var(--accent-soft);
  color: var(--text);
}
.badge-device {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 0.7rem;
  font-weight: 600;
}
.badge-desktop {
  background: var(--accent-soft);
  color: var(--accent);
}
.badge-mobile {
  background: rgba(34, 197, 94, 0.12);
  color: #22c55e;
}
.badge-tablet {
  background: rgba(251, 191, 36, 0.12);
  color: #fbbf24;
}
.sessions-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.sessions-header-bar h4 {
  font-family: var(--font-display);
  font-weight: 600;
}
.sessions-count {
  font-size: 0.82rem;
  color: var(--text-faint);
}
.sessions-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.session-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px 22px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 16px;
  align-items: center;
  transition: border-color 0.25s var(--ease);
}
.session-item:hover {
  border-color: var(--border-strong);
}
.session-field label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-faint);
  display: block;
  margin-bottom: 4px;
}
.session-field span {
  font-size: 0.85rem;
  font-weight: 500;
}
.session-path-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}
.session-path {
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 100px;
  background: var(--accent-soft);
  border: 1px solid var(--border);
  color: var(--accent);
}
.heatmap-info {
  margin-bottom: 20px;
}
.heatmap-stat {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.heatmap-kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px;
  text-align: center;
}
.heatmap-kpi span {
  display: block;
}
.heatmap-kpi__val {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--accent);
}
.heatmap-kpi__label {
  font-size: 0.75rem;
  color: var(--text-faint);
  margin-top: 4px;
  text-transform: uppercase;
}
.scroll-heatmap-wrap,
.clicks-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
  margin-bottom: 16px;
}
.scroll-heatmap-wrap h4,
.clicks-wrap h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-dim);
}
.scroll-heatmap-wrap h4 i,
.clicks-wrap h4 i {
  width: 15px;
  height: 15px;
  color: var(--accent);
}
.scroll-section-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}
.scroll-section-name {
  min-width: 120px;
  font-size: 0.82rem;
  color: var(--text-dim);
}
.scroll-section-bar-wrap {
  flex: 1;
  height: 14px;
  background: var(--surface-2);
  border-radius: 100px;
  overflow: hidden;
}
.scroll-section-bar {
  height: 100%;
  border-radius: 100px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.6s var(--ease);
}
.scroll-section-pct {
  min-width: 40px;
  font-size: 0.78rem;
  font-weight: 700;
  text-align: right;
}
.click-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  margin-bottom: 6px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  font-size: 0.8rem;
}
.click-item__el {
  font-weight: 600;
  color: var(--accent);
}
.click-item__count {
  font-weight: 700;
}
.click-item__time {
  color: var(--text-faint);
}
.logs-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 10px;
}
.logs-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.log-filter {
  padding: 5px 14px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-dim);
  transition:
    background 0.25s var(--ease),
    color 0.25s var(--ease);
}
.log-filter:hover,
.log-filter.active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--border-strong);
}
.btn-clear-logs {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 100px;
  font-size: 0.75rem;
  background: rgba(255, 80, 80, 0.08);
  border: 1px solid rgba(255, 80, 80, 0.2);
  color: #ff7070;
  transition: background 0.25s var(--ease);
}
.btn-clear-logs:hover {
  background: rgba(255, 80, 80, 0.15);
}
.btn-clear-logs i {
  width: 12px;
  height: 12px;
}
.logs-terminal {
  background: #050508;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  height: 480px;
  overflow-y: auto;
  line-height: 1.6;
}
.logs-terminal::-webkit-scrollbar {
  width: 4px;
}
.logs-terminal::-webkit-scrollbar-thumb {
  background: var(--border-strong);
}
.log-entry {
  display: flex;
  gap: 12px;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}
.log-time {
  color: #555;
  min-width: 90px;
}
.log-type {
  min-width: 80px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
}
.log-type--pageview {
  background: rgba(54, 200, 255, 0.1);
  color: var(--accent-2);
}
.log-type--click {
  background: rgba(251, 191, 36, 0.1);
  color: #fbbf24;
}
.log-type--scroll {
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
}
.log-type--session {
  background: rgba(167, 139, 250, 0.1);
  color: #a78bfa;
}
.log-type--error {
  background: rgba(255, 80, 80, 0.1);
  color: #ff5050;
}
.log-type--info {
  background: rgba(148, 163, 184, 0.1);
  color: #94a3b8;
}
.log-msg {
  color: #94a3b8;
  flex: 1;
}
.log-msg strong {
  color: #e8eaf0;
}
