@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800;900&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@500;600;700&display=swap');

:root {
  --bg-sidebar: #07111D;
  --bg-main: #0C1625;
  --bg-card: #0E1E29;
  --bg-card-hover: #122637;

  --green: #22C55E;
  --green-soft: rgba(34, 197, 94, 0.14);
  --green-dark: #196F44;
  --green-badge: #113831;

  --blue: #2563EB;
  --blue-soft: rgba(37, 99, 235, 0.16);
  --blue-active: #0D2046;

  --text-title: #F8FAFC;
  --text-sub: #A5B0BE;
  --text-count: #8CB0BE;

  --border: rgba(140, 176, 190, 0.12);
  --border-strong: rgba(140, 176, 190, 0.22);

  --danger: #f87171;
  --warning: #fbbf24;

  --radius: 16px;
  --radius-sm: 10px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --font-head: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  background: var(--bg-main);
  color: var(--text-sub);
  font-family: var(--font-body);
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(700px at 8% 0%, rgba(34, 197, 94, 0.06), transparent 60%),
    radial-gradient(800px at 92% 12%, rgba(37, 99, 235, 0.09), transparent 60%),
    radial-gradient(900px at 50% 110%, rgba(34, 197, 94, 0.05), transparent 60%);
  animation: bgDrift 18s ease-in-out infinite alternate;
}
@keyframes bgDrift {
  0% { transform: translateY(0) scale(1); }
  100% { transform: translateY(-18px) scale(1.03); }
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #0A1421; }
::-webkit-scrollbar-thumb { background: #1c3144; border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: #2563EB; }

h1, h2, h3, h4, h5, h6 { font-family: var(--font-head); color: var(--text-title); font-weight: 800; line-height: 1.2; }

/* ============================================================
   LAYOUT
   ============================================================ */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 260px;
  flex-shrink: 0;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 20;
}

.main-area { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.content {
  padding: 24px 28px 60px;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
}

/* Sidebar */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 20px;
  border-bottom: 1px solid var(--border);
}
.brand-mark {
  width: 38px; height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--green), #16a34a);
  display: grid; place-items: center;
  font-family: var(--font-head); font-weight: 900; color: #04110a; font-size: 1.15rem;
  box-shadow: 0 0 0 4px var(--green-soft);
  animation: brandGlow 3.5s ease-in-out infinite;
}
@keyframes brandGlow {
  0%, 100% { box-shadow: 0 0 0 4px var(--green-soft), 0 0 0 8px rgba(34,197,94,0.04); }
  50% { box-shadow: 0 0 0 5px rgba(34,197,94,0.28), 0 0 22px rgba(34,197,94,0.35); }
}
.brand-name { font-family: var(--font-head); font-weight: 800; font-size: 1.02rem; color: var(--text-title); letter-spacing: -0.02em; }
.brand-name span { color: var(--green); }
.brand-sub { font-size: 0.68rem; color: var(--text-count); letter-spacing: 0.14em; text-transform: uppercase; }

.sidebar-nav { padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  color: var(--text-sub);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: var(--transition);
  cursor: pointer;
  border: 1px solid transparent;
  position: relative;
  overflow: hidden;
}
.nav-item .nav-icon { width: 22px; text-align: center; font-size: 1.05rem; filter: saturate(0.6); }
.nav-item:hover { background: rgba(140, 176, 190, 0.06); color: var(--text-title); }
.nav-item.active {
  background: var(--blue-active);
  color: var(--text-title);
  border-color: rgba(37, 99, 235, 0.35);
}
.nav-item.active::after {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(var(--green), var(--blue));
  animation: navGlow 2.6s ease-in-out infinite;
}
@keyframes navGlow { 0%, 100% { opacity: 0.7; } 50% { opacity: 1; } }
.nav-item.active .nav-icon { color: var(--blue); filter: none; }

.sidebar-foot { margin-top: auto; padding: 16px 20px; border-top: 1px solid var(--border); }
.lock-chip {
  display: flex; align-items: center; gap: 10px;
  font-size: 0.78rem; color: var(--text-count);
  background: var(--green-badge);
  border: 1px solid rgba(34, 197, 94, 0.25);
  border-radius: 999px;
  padding: 8px 12px;
}
.lock-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); animation: pulse 1.4s infinite; }

/* Topbar */
.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 28px;
  border-bottom: 1px solid var(--border);
  background: rgba(12, 22, 37, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 15;
}
.topbar-title h1 { font-size: 1.25rem; }
.topbar-title p { font-size: 0.78rem; color: var(--text-count); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.icon-btn {
  width: 40px; height: 40px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-sub);
  cursor: pointer;
  font-size: 1.05rem;
  display: grid; place-items: center;
  transition: var(--transition);
}
.icon-btn:hover { color: var(--text-title); border-color: var(--border-strong); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0,0,0,0.3); }

.search-box { position: relative; }
.search-box input {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-title);
  border-radius: 11px;
  padding: 10px 14px 10px 38px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  width: 220px;
  transition: var(--transition);
}
.search-box input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); width: 260px; }
.search-box .mag { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-count); font-size: 0.9rem; }

/* Ticker / metrics */
.ticker {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(90deg, rgba(17, 56, 49, 0.6), rgba(13, 32, 70, 0.6), rgba(14, 30, 41, 0.9));
  border: 1px solid rgba(34, 197, 94, 0.25);
  border-radius: 14px;
  padding: 13px 18px;
  margin-bottom: 20px;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.2), 0 10px 30px rgba(0,0,0,0.25);
  position: relative;
  opacity: 0;
  animation: fadeUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.ticker::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  width: 90px;
  background: linear-gradient(90deg, transparent, rgba(34,197,94,0.12), transparent);
  animation: shimmer 3.2s linear infinite;
}
@keyframes shimmer { 0% { left: -90px; } 100% { left: 110%; } }
.ticker .live-tag {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--green-badge); color: var(--green);
  font-size: 0.68rem; font-weight: 800; letter-spacing: 0.07em;
  border-radius: 999px; padding: 5px 11px; flex-shrink: 0;
}
.ticker .live-tag .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); animation: pulse 1.4s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(34,197,94,0.6); } 50% { opacity: 0.6; box-shadow: 0 0 0 5px rgba(34,197,94,0); } }
.ticker-msg { font-size: 0.88rem; color: var(--text-sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ticker-msg .metric { color: var(--green); font-family: var(--font-mono); font-weight: 700; }

/* KPI cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(205px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
  opacity: 0;
  animation: fadeUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--green), transparent);
  opacity: 0.85;
}
.kpi-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(220px at 80% 0%, rgba(34,197,94,0.06), transparent 70%);
  opacity: 0;
  transition: opacity 0.4s;
}
.kpi-card:hover { transform: translateY(-4px) scale(1.01); border-color: rgba(34,197,94,0.3); box-shadow: 0 14px 40px rgba(0,0,0,0.4), 0 0 0 1px rgba(34,197,94,0.1); }
.kpi-card:hover::after { opacity: 1; }
.kpi-card:hover .kpi-value { text-shadow: 0 0 22px rgba(34,197,94,0.4); }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

.kpi-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.kpi-label { font-size: 0.74rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-count); font-weight: 600; }
.kpi-icon {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 1rem;
  transition: transform 0.3s;
}
.kpi-card:hover .kpi-icon { transform: rotate(-6deg) scale(1.08); }
.kpi-value {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.85rem;
  color: var(--green);
  letter-spacing: -0.02em;
  transition: text-shadow 0.3s;
}
.kpi-value small { font-size: 0.95rem; font-weight: 700; }
.kpi-delta { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 0.78rem; font-weight: 600; }
.kpi-delta.up { color: var(--green); }
.kpi-delta.down { color: var(--danger); }
.kpi-delta .pill { background: var(--green-badge); border-radius: 999px; padding: 2px 8px; font-size: 0.7rem; }

.kpi-roas::before { background: linear-gradient(90deg, var(--warning), transparent); }
.kpi-roas .roas-icon { background: rgba(251,191,36,0.14); color: var(--warning); }
.kpi-value-roas { color: var(--warning); }
.kpi-roas:hover { border-color: rgba(251,191,36,0.3); }
.kpi-roas:hover .kpi-value-roas { text-shadow: 0 0 22px rgba(251,191,36,0.4); }

/* Charts */
.charts-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin-bottom: 20px; }
.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  opacity: 0;
  animation: fadeUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.chart-card:hover { border-color: rgba(37,99,235,0.25); box-shadow: 0 16px 44px rgba(0,0,0,0.35); }
.chart-card.full { grid-column: 1 / -1; }
.chart-card.full::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--green), var(--blue), transparent);
  opacity: 0.8;
}

.chart-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 18px; gap: 12px; }
.chart-title { font-size: 1.02rem; font-weight: 800; }
.chart-sub { font-size: 0.76rem; color: var(--text-count); margin-top: 2px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 0.75rem; color: var(--text-sub); font-weight: 600; }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; box-shadow: 0 0 8px currentColor; }

.chart-body { position: relative; width: 100%; }
.chart-body svg { display: block; width: 100%; height: auto; }
.chart-body .empty { color: var(--text-count); font-size: 0.85rem; padding: 24px 0; text-align: center; }

/* Daily bars */
.daily-bar { transition: opacity 0.2s; }
.chart-card:hover .daily-bar { opacity: 0.85; }
.daily-bar:hover { opacity: 1 !important; }

/* Product / channel bars */
.bar-list { display: flex; flex-direction: column; gap: 14px; }
.bar-row { display: flex; flex-direction: column; gap: 6px; transition: var(--transition); }
.bar-row:hover { transform: translateX(3px); }
.bar-row.active-bar {
  outline: 2px solid var(--green);
  outline-offset: 3px;
  border-radius: 8px;
  padding: 4px;
  background: rgba(34,197,94,0.05);
}
.bar-row-head { display: flex; align-items: center; justify-content: space-between; font-size: 0.82rem; }
.bar-row-head .name { color: var(--text-title); font-weight: 700; }
.bar-row-head .val { color: var(--green); font-family: var(--font-mono); font-weight: 600; }
.bar-track { height: 9px; background: rgba(140, 176, 190, 0.08); border-radius: 999px; overflow: hidden; }
.bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--green-dark), var(--green));
  transition: width 0.9s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 0 12px rgba(34,197,94,0.3);
}

/* Donut */
.donut-wrap { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.donut-legend { display: flex; flex-direction: column; gap: 10px; min-width: 130px; }
.donut-legend-item { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; cursor: pointer; transition: var(--transition); }
.donut-legend-item:hover { color: var(--text-title); transform: translateX(2px); }
.donut-legend-item.active { color: var(--text-title); font-weight: 700; }
.donut-legend-item .swatch { width: 11px; height: 11px; border-radius: 3px; flex-shrink: 0; box-shadow: 0 0 8px rgba(0,0,0,0.4); }
.donut-legend-item .cnt { margin-left: auto; color: var(--text-count); font-family: var(--font-mono); font-size: 0.72rem; }
.donut-slice { transition: opacity 0.2s, transform 0.2s; transform-origin: 110px 110px; }
.donut-slice:hover { opacity: 0.8; transform: scale(1.04); }
.donut-slice.active { stroke: var(--green); stroke-width: 3; }

/* Table */
.table-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  opacity: 0;
  animation: fadeUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  transition: var(--transition);
}
.table-card:hover { border-color: rgba(140,176,190,0.18); box-shadow: 0 16px 44px rgba(0,0,0,0.3); }
.table-toolbar { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.table-toolbar .h { font-family: var(--font-head); font-weight: 800; font-size: 1.02rem; color: var(--text-title); }
.table-toolbar .count { font-size: 0.76rem; color: var(--text-count); }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
thead th {
  text-align: left;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-count);
  font-weight: 700;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: var(--transition);
}
thead th:hover { color: var(--text-title); background: rgba(140,176,190,0.04); }
thead th .arr { color: var(--green); margin-left: 4px; }
tbody td { padding: 12px 16px; font-size: 0.84rem; border-bottom: 1px solid rgba(140, 176, 190, 0.07); color: var(--text-sub); white-space: nowrap; }
tbody tr { transition: var(--transition); }
tbody tr:hover { background: rgba(140, 176, 190, 0.05); }
tbody tr:last-child td { border-bottom: none; }
td.contact { color: var(--text-title); font-weight: 600; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
td.amount { color: var(--green); font-family: var(--font-mono); font-weight: 600; }
td .country { display: inline-flex; align-items: center; gap: 6px; }
.pill { display: inline-flex; align-items: center; gap: 5px; background: var(--green-badge); color: var(--green); border-radius: 999px; padding: 3px 10px; font-size: 0.72rem; font-weight: 700; }
.pill.blue { background: var(--blue-soft); color: #93c5fd; }

.pagination { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; flex-wrap: wrap; gap: 10px; }
.pagination .info { font-size: 0.78rem; color: var(--text-count); }
.pagination .btns { display: flex; gap: 6px; }
.pagination button {
  background: var(--bg-main);
  border: 1px solid var(--border);
  color: var(--text-sub);
  border-radius: 9px;
  padding: 7px 13px;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  transition: var(--transition);
}
.pagination button:hover:not(:disabled) { color: var(--text-title); border-color: var(--border-strong); transform: translateY(-1px); }
.pagination button:disabled { opacity: 0.4; cursor: default; }
.pagination button.cur { background: var(--green-dark); color: #fff; border-color: transparent; }

/* ============================================================
   LOCK GATE
   ============================================================ */
.app-blur {
  filter: blur(18px) saturate(0.5);
  pointer-events: none;
  user-select: none;
  transition: filter 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.app-blur.unlocked { filter: blur(0) saturate(1); pointer-events: auto; }

.gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 30%, rgba(34, 197, 94, 0.10), transparent 55%),
    radial-gradient(circle at 80% 80%, rgba(37, 99, 235, 0.12), transparent 50%),
    rgba(7, 17, 29, 0.66);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
.gate.hidden { opacity: 0; visibility: hidden; pointer-events: none; }

.gate-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 22px;
  padding: 36px 32px;
  text-align: center;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  animation: gateIn 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes gateIn {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.gate-lock {
  width: 60px; height: 60px; margin: 0 auto 18px;
  border-radius: 18px;
  background: var(--green-badge);
  border: 1px solid rgba(34, 197, 94, 0.3);
  display: grid; place-items: center;
  font-size: 1.6rem;
  animation: lockBob 3s ease-in-out infinite;
}
@keyframes lockBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
.gate-card h2 { font-size: 1.4rem; margin-bottom: 8px; }
.gate-card .sub { font-size: 0.86rem; color: var(--text-count); margin-bottom: 24px; line-height: 1.55; }

.gate-input { position: relative; margin-bottom: 14px; }
.gate-input input {
  width: 100%;
  background: var(--bg-main);
  border: 1px solid var(--border-strong);
  border-radius: 13px;
  padding: 14px 46px 14px 16px;
  color: var(--text-title);
  font-family: var(--font-mono);
  font-size: 1.05rem;
  letter-spacing: 0.1em;
  text-align: center;
  transition: var(--transition);
}
.gate-input input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.gate-input .eye {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--text-count); cursor: pointer; font-size: 1rem; padding: 6px;
}
.gate-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--green), #16a34a);
  color: #04110a;
  border: none;
  border-radius: 13px;
  padding: 14px;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: var(--transition);
  box-shadow: 0 8px 24px rgba(34, 197, 94, 0.25);
}
.gate-btn:hover { transform: translateY(-1px); box-shadow: 0 12px 30px rgba(34, 197, 94, 0.35); }
.gate-btn:active { transform: translateY(0) scale(0.99); }
.gate-error { color: var(--danger); font-size: 0.8rem; min-height: 20px; margin-top: 10px; font-weight: 600; }
.gate-shake { animation: shake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97); }
@keyframes shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-6px); }
  40%, 60% { transform: translateX(6px); }
}

/* section title */
.section-row { display: flex; align-items: center; justify-content: space-between; margin: 26px 0 14px; }
.section-row h2 { font-size: 1.05rem; }

/* ============================================================
   PERIOD SELECTOR (mes / ano)
   ============================================================ */
.period-select {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: -6px 0 16px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(12, 22, 37, 0.5);
  transition: var(--transition);
}
.period-select.has-filter { border-color: rgba(34, 197, 94, 0.5); box-shadow: 0 0 0 3px var(--green-soft), 0 0 18px rgba(34,197,94,0.15); }
.ps-label { font-size: 0.68rem; color: var(--text-count); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; }
.period-select select {
  background: var(--bg-main);
  border: 1px solid var(--border-strong);
  color: var(--text-title);
  border-radius: 10px;
  padding: 8px 12px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--green) 50%), linear-gradient(135deg, var(--green) 50%, transparent 50%);
  background-position: calc(100% - 16px) 55%, calc(100% - 11px) 55%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  padding-right: 30px;
}
.period-select select:hover { border-color: var(--border-strong); }
.period-select select:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.ps-reset {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-count);
  width: 34px; height: 34px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.9rem;
  margin-left: auto;
  transition: var(--transition);
}
.ps-reset:hover { color: var(--text-title); border-color: var(--danger); transform: rotate(90deg); }

/* ============================================================
   CHART TOOLTIP
   ============================================================ */
.chart-tip {
  position: fixed;
  z-index: 90;
  pointer-events: none;
  background: #0A1421;
  border: 1px solid rgba(34, 197, 94, 0.35);
  color: var(--text-title);
  font-size: 0.76rem;
  font-family: var(--font-mono);
  padding: 8px 12px;
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.55), 0 0 0 1px rgba(0,0,0,0.4);
  opacity: 0;
  visibility: hidden;
  transform: translateY(3px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  white-space: nowrap;
  max-width: 280px;
}
.chart-tip.visible { opacity: 1; visibility: visible; transform: translateY(0); }
.chart-tip b { color: var(--green); }

/* ============================================================
   BACK TO TOP
   ============================================================ */
.to-top {
  position: fixed;
  bottom: 24px; right: 24px;
  width: 46px; height: 46px;
  border-radius: 14px;
  background: var(--green-dark);
  color: #fff;
  border: 1px solid rgba(34, 197, 94, 0.45);
  font-size: 1.25rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(34,197,94,0.3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: var(--transition);
  z-index: 60;
}
.to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.to-top:hover { background: var(--green); color: #04110a; transform: translateY(-3px); box-shadow: 0 14px 40px rgba(34,197,94,0.45); }

/* ============================================================
   DAILY BAR GROW
   ============================================================ */
.daily-bar {
  transform-box: fill-box;
  transform-origin: center bottom;
  animation: barGrow 0.65s cubic-bezier(0.22, 1, 0.36, 1) both;
  transition: opacity 0.2s;
}
.daily-best { filter: drop-shadow(0 0 6px rgba(34,197,94,0.7)); }
@keyframes barGrow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.chart-card:hover .daily-bar { opacity: 0.82; }
.daily-bar:hover { opacity: 1 !important; }

/* ============================================================
   GRID BACKGROUND + EXTRA FX
   ============================================================ */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(140,176,190,0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(140,176,190,0.028) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 82%);
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 82%);
}

tbody tr { position: relative; }
tbody tr:hover { background: rgba(140, 176, 190, 0.05); box-shadow: inset 3px 0 0 var(--green); }
tbody tr td:first-child { border-top-left-radius: 8px; border-bottom-left-radius: 8px; }

.donut-slice { cursor: pointer; transition: opacity 0.2s, transform 0.2s; transform-origin: 110px 110px; }
.donut-slice:hover { opacity: 0.85; transform: scale(1.05); }
.donut-slice.active { stroke: var(--green); stroke-width: 3; }

select option { background: var(--bg-card); color: var(--text-title); }

/* ============================================================
   EXTRA UX / FX
   ============================================================ */
.topbar { position: sticky; top: 0; }
.topbar::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--green), var(--blue), transparent);
  background-size: 200% 100%;
  animation: lineMove 4.5s linear infinite;
  opacity: 0.85;
}
@keyframes lineMove { 0% { background-position: 0% 0; } 100% { background-position: 200% 0; } }

.kpi-value { font-variant-numeric: tabular-nums; }
.brand-name { text-shadow: 0 0 18px rgba(34, 197, 94, 0.18); }

.kpi-roas .kpi-icon { position: relative; }
.kpi-roas .kpi-icon::after {
  content: '';
  position: absolute;
  inset: -5px;
  border-radius: 13px;
  border: 1px solid rgba(251, 191, 36, 0.45);
  animation: ringPulse 2.4s ease-out infinite;
  pointer-events: none;
}
@keyframes ringPulse { 0% { transform: scale(0.75); opacity: 1; } 100% { transform: scale(1.35); opacity: 0; } }
.kpi-value-roas { animation: roasGlow 3.2s ease-in-out infinite; }
@keyframes roasGlow { 0%, 100% { text-shadow: none; } 50% { text-shadow: 0 0 18px rgba(251, 191, 36, 0.5); } }

tbody tr { animation: rowIn 0.32s ease both; }
@keyframes rowIn { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }

button:focus-visible, select:focus-visible, input:focus-visible, a:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.bar-row:hover .bar-fill { filter: brightness(1.18); box-shadow: 0 0 16px rgba(34, 197, 94, 0.5); }
.bar-row:hover { transform: translateX(3px); }

.icon-btn:active, .gate-btn:active, .ps-reset:active, .pagination button:active { transform: scale(0.96); }

.donut-slice { cursor: pointer; }
.donut-slice:hover { filter: drop-shadow(0 0 8px rgba(34, 197, 94, 0.35)); }

.chart-card { transition: var(--transition), box-shadow 0.3s ease; }
.chart-card:hover { box-shadow: 0 16px 44px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(37, 99, 235, 0.08); }

.ticker .live-tag .dot { animation: pulse 1.4s infinite; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ============================================================
   SVG ICONS
   ============================================================ */
.ico {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.nav-icon { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; }
.nav-icon .ico { width: 19px; height: 19px; }
.kpi-icon .ico { width: 18px; height: 18px; }
.icon-btn .ico { width: 18px; height: 18px; }
.search-box .mag .ico { width: 16px; height: 16px; display: block; }
.to-top .ico { width: 22px; height: 22px; }
.ps-reset .ico { width: 16px; height: 16px; }
.gate-lock .ico { width: 34px; height: 34px; color: var(--green); }

/* Eye toggle (mostrar / ocultar codigo) */
.eye { display: inline-flex; align-items: center; justify-content: center; }
.eye .ico { width: 18px; height: 18px; display: block; }
.eye .eye-off { display: none; }
.eye.off .eye-on { display: none; }
.eye.off .eye-off { display: block; }

/* responsive */
@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
  .charts-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .sidebar { position: fixed; left: -280px; transition: left 0.3s ease; }
  .sidebar.open { left: 0; box-shadow: 0 0 60px rgba(0,0,0,0.6); }
  .topbar { padding: 14px 18px; }
  .content { padding: 18px 16px 50px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .kpi-value { font-size: 1.5rem; }
}
@media (max-width: 560px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .search-box input { width: 150px; }
  .search-box input:focus { width: 170px; }
}
