[hidden] {
  display: none !important;
}

.empty-state {
  margin-bottom: 13px;
  padding: 18px 20px;
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: 15px;
  color: #31523e;
  background: #eaf8ef;
  border: 1px solid #ccebd7;
  border-radius: 16px;
}

.empty-state[hidden] { display: none; }
.empty-state-icon { width: 40px; height: 40px; display: grid; place-items: center; color: #fff; background: #18a957; border-radius: 50%; font-weight: 800; }
.empty-state strong { display: block; margin-bottom: 4px; font-size: 13px; }
.empty-state p { margin: 0; color: #698073; font-size: 11px; line-height: 1.5; }
.empty-state a { padding: 9px 12px; color: #167d45; background: #fff; border: 1px solid #ccebd7; border-radius: 9px; text-decoration: none; font-size: 11px; font-weight: 700; white-space: nowrap; }

@media (max-width: 700px) {
  .empty-state { grid-template-columns: 40px 1fr; }
  .empty-state a { grid-column: 1 / -1; text-align: center; }
}

.filter-bar {
  margin-bottom: 13px;
  padding: 14px 16px;
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) repeat(5, minmax(110px, .7fr)) auto;
  align-items: end;
  gap: 10px;
  background: #fff;
  border: 1px solid #e8ece9;
  border-radius: 16px;
}

.filter-bar > div { display: grid; gap: 5px; align-self: center; }
.filter-title { min-width: 220px; }
.page-toggle { width: 100%; max-width: 210px; height: 32px; margin-top: 7px; padding: 3px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; background: #f6f8f6; border: 1px solid #e5eae7; border-radius: 9px; }
.page-toggle button { height: 24px; padding: 0 8px; border: 0; border-radius: 7px; background: transparent; color: #68736c; font-size: 10px; font-weight: 800; cursor: pointer; }
.page-toggle button.active { color: #fff; background: #17201b; }
.filter-bar > div strong { font-size: 13px; }
.filter-bar label { display: grid; gap: 5px; color: #8a948d; font-size: 9px; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
.filter-bar select { height: 36px; padding: 0 9px; color: #26312a; background: #f6f8f6; border: 1px solid #e5eae7; border-radius: 9px; outline: none; font-size: 11px; text-transform: none; }
.filter-bar button { height: 36px; padding: 0 13px; color: #68736c; background: #fff; border: 1px solid #dfe5e1; border-radius: 9px; font-size: 10px; font-weight: 700; cursor: pointer; }

.heatmap-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(250px, .65fr); gap: 13px; margin-bottom: 13px; }
.heatmap-panel { min-width: 0; }
.heatmap-viewport { position: relative; width: 100%; height: 680px; overflow: auto; background: #e9eeeb; border: 1px solid #dde4df; border-radius: 12px; }
.heatmap-canvas { position: relative; width: 100%; min-height: 680px; overflow: hidden; background: #fff; }
.heatmap-canvas iframe { position: absolute; top: 0; left: 0; width: 1280px; height: 1000px; border: 0; pointer-events: none; transform-origin: 0 0; }
.heatmap-points { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.heat-point { position: absolute; display: grid; place-items: center; color: #fff; background: rgba(238, 68, 48, .68); border: 2px solid rgba(255,255,255,.72); border-radius: 50%; box-shadow: 0 0 0 9px rgba(255, 94, 50, .16), 0 2px 9px rgba(112, 31, 18, .25); transform: translate(-50%, -50%); font-size: 9px; font-weight: 800; }
.heat-point.cta { background: rgba(236, 44, 28, .85); box-shadow: 0 0 0 12px rgba(255, 50, 29, .2), 0 2px 9px rgba(112, 31, 18, .3); }
.heat-point.rage { background: rgba(119, 52, 201, .88); box-shadow: 0 0 0 12px rgba(119, 52, 201, .2), 0 2px 9px rgba(67, 25, 118, .32); }
.click-insights .rank-row { grid-template-columns: minmax(90px, 1.4fr) 1fr 30px; }
.leads-panel { margin-bottom: 13px; }
.leads-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.lead-card { padding: 15px; text-align: left; background: #f8faf8; border: 1px solid #e8ece9; border-radius: 12px; cursor: pointer; transition: .2s ease; }
.lead-card:hover { border-color: #a9dabb; background: #f1faf4; transform: translateY(-1px); }
.lead-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 11px; }
.lead-card-head strong { font-size: 12px; }
.lead-card-head time { color: #9aa39d; font-size: 9px; }
.lead-card p { margin: 4px 0; color: #67736b; font-size: 10px; line-height: 1.5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lead-card-tags { margin-top: 11px; display: flex; flex-wrap: wrap; gap: 5px; }
.lead-card-tags span { padding: 4px 7px; color: #167d45; background: #e4f6ea; border-radius: 6px; font-size: 9px; font-weight: 700; }
.geo-quality-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 13px; margin-bottom: 13px; }
.quality-list { display: grid; gap: 9px; }
.quality-row { padding: 10px 11px; display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 10px; background: #f7f9f7; border-radius: 10px; }
.quality-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; font-size: 13px; }
.quality-icon.bot { color: #758078; background: #e9eeeb; }
.quality-icon.short { color: #b27320; background: #fff0d9; }
.quality-icon.engaged { color: #2c6bd0; background: #e7efff; }
.quality-icon.hot_lead { color: #fff; background: #18a957; }
.quality-icon.returning { color: #8059c7; background: #eee7fa; }
.quality-row div:nth-child(2) { display: grid; gap: 3px; }
.quality-row strong { font-size: 11px; }
.quality-row small { color: #929d95; font-size: 9px; }
.quality-row > b { font-size: 14px; }
.quality-pill { padding: 4px 8px; display: inline-block; border-radius: 99px; color: #58645c; background: #eef2ef; font-size: 9px; font-weight: 750; }
.quality-pill.hot_lead { color: #108646; background: #e3f8ea; }
.quality-pill.engaged { color: #2862bc; background: #e7efff; }
.quality-pill.returning { color: #714bb5; background: #eee7fa; }
.quality-pill.bot { color: #69736c; background: #e8ece9; }
.session-delete { width: 27px; height: 27px; display: grid; place-items: center; color: #b85454; background: #fff3f3; border: 1px solid #f1d4d4; border-radius: 8px; cursor: pointer; font-size: 16px; line-height: 1; transition: .15s ease; }
.session-delete:hover { color: #fff; background: #c94747; border-color: #c94747; }
.session-delete:disabled { cursor: wait; opacity: .55; }
#sessionsBody tr.is-deleting { opacity: .5; pointer-events: none; }
#sessionsBody tr.current-ip-session { background: #f3fbf6; }
.session-geo { min-width: 150px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 3px 6px; white-space: normal; line-height: 1.35; }
.session-geo small { grid-column: 1 / -1; color: #98a19b; font-size: 9px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.current-user-badge { padding: 3px 6px; color: #0f8444; background: #dff6e7; border-radius: 99px; font-size: 9px; }

.custom-range {
  height: 42px;
  padding: 4px 9px;
  display: flex;
  align-items: center;
  gap: 7px;
  background: #fff;
  border: 1px solid #e8ece9;
  border-radius: 10px;
}

.custom-range label {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #8a948d;
  font-size: 9px;
  font-weight: 750;
  text-transform: uppercase;
}

.custom-range input {
  width: 118px;
  color: #26312a;
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 11px;
}

.icon-button.is-loading {
  animation: spin .8s linear infinite;
  pointer-events: none;
}

.kpi-delta {
  position: absolute;
  right: 18px;
  bottom: 18px;
  padding: 4px 7px;
  border-radius: 99px;
  font-size: 9px;
  font-weight: 800;
}

.kpi-delta.positive { color: #108646; background: #e3f8ea; }
.kpi-delta.negative { color: #bd4646; background: #fff0f0; }
.kpi-delta.neutral { color: #768079; background: #eef2ef; }
.kpi.featured .kpi-delta.positive,
.kpi.featured .kpi-delta.negative,
.kpi.featured .kpi-delta.neutral { color: #fff; background: rgba(255, 255, 255, .16); }

.insights-panel,
.ad-performance-panel,
.form-detail-panel { margin-bottom: 13px; }

.insights-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.insight {
  min-height: 92px;
  padding: 14px;
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 11px;
  background: #f7f9f7;
  border: 1px solid #eef1ef;
  border-radius: 12px;
}

.insight > i {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: #3977e9;
  background: #e8effd;
  border-radius: 9px;
  font-style: normal;
  font-size: 12px;
  font-weight: 850;
}

.insight.positive > i { color: #108646; background: #e3f8ea; }
.insight.warning > i { color: #ae6f17; background: #fff0d9; }
.insight strong { display: block; margin: 2px 0 6px; font-size: 11px; }
.insight p { margin: 0; color: #748078; font-size: 10px; line-height: 1.5; }

.performance-table td,
.form-funnel-table td { height: 46px; }
.performance-table td strong,
.form-funnel-table td strong { font-size: 11px; }
.metric-pill {
  padding: 5px 8px;
  color: #6f7872;
  background: #eef2ef;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 800;
}
.metric-pill.good { color: #108646; background: #e3f8ea; }

.form-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(240px, .7fr);
  gap: 28px;
}

.form-detail-grid h3 {
  margin: 0 0 18px;
  font-size: 12px;
}

.funnel-row > span {
  display: grid;
  gap: 3px;
}

.funnel-row > span small {
  color: #9aa39d;
  font-size: 8px;
}

.heatmap-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  flex-wrap: wrap;
}

.heatmap-controls select {
  height: 32px;
  padding: 0 8px;
  color: #556159;
  background: #f6f8f6;
  border: 1px solid #e5eae7;
  border-radius: 8px;
  outline: none;
  font-size: 9px;
}

.heatmap-controls small {
  min-width: 110px;
  text-align: right;
}

@media (max-width: 1100px) {
  .filter-bar { grid-template-columns: 1fr 1fr 1fr; }
  .filter-bar > div { grid-column: 1 / -1; }
  .heatmap-grid { grid-template-columns: 1fr; }
  .leads-grid { grid-template-columns: 1fr 1fr; }
  .geo-quality-grid { grid-template-columns: 1fr 1fr; }
  .geo-quality-grid > .panel:last-child { grid-column: 1 / -1; }
  .topbar { align-items: flex-start; }
  .top-actions { flex-wrap: wrap; justify-content: flex-end; }
  .form-detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .filter-bar { grid-template-columns: 1fr; }
  .filter-bar > div { grid-column: auto; }
  .heatmap-viewport { height: 520px; }
  .leads-grid { grid-template-columns: 1fr; }
  .geo-quality-grid { grid-template-columns: 1fr; }
  .geo-quality-grid > .panel:last-child { grid-column: auto; }
  .custom-range { width: 100%; height: auto; flex-wrap: wrap; }
  .custom-range label { flex: 1; }
  .custom-range input { width: 100%; }
  .kpi-delta { right: 12px; bottom: 12px; }
  .insights-list { grid-template-columns: 1fr; }
  .heatmap-panel .panel-head { display: grid; }
  .heatmap-controls { justify-content: flex-start; }
  .heatmap-controls small { text-align: left; }
}
