:root {
  --bg: #f0f2f5;
  --panel: #ffffff;
  --ink: #1c1e21;
  --muted: #65676b;
  --line: #d8dde6;
  --blue: #1877f2;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "SF Pro Text", "PingFang SC", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

.meta-root {
  height: 100vh;
  display: grid;
  grid-template-columns: 60px 1fr;
  overflow: hidden;
}

.left-nav {
  position: relative;
  z-index: 30;
  overflow: visible;
  width: 60px;
  transition: all 220ms ease;
}

.left-nav.expanded {
  width: 300px;
}

.compact-nav {
  position: relative;
  width: 60px;
  height: 100vh;
  background: #fff;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 8px 6px;
  z-index: 2;
}

.compact-brand {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #d8dde6;
  margin: 0 auto;
}

.compact-brand img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.compact-main,
.compact-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.compact-main {
  margin-top: 12px;
}

.compact-item {
  width: 44px;
  height: 44px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: #71798a;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 180ms ease;
  font-size: 18px;
  font-weight: 700;
}

.compact-item svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.compact-item img {
  width: 20px;
  height: 20px;
  border-radius: 4px;
}

.compact-item:hover {
  background: #edf2f8;
  color: #4d5a71;
}

.compact-item.active {
  background: #e7f3ff;
  color: #0d62d9;
}

.compact-item.muted {
  color: #a1a8b7;
  cursor: default;
}

.compact-item.muted:hover {
  background: transparent;
}

.compact-sep {
  width: 28px;
  height: 1px;
  background: #e2e7ef;
  margin: 2px 0;
}

.compact-avatar {
  width: 44px;
  height: 44px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
}

.compact-avatar img {
  width: 100%;
  height: 100%;
}

.expanded-panel {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 300px;
  background: #fff;
  border-right: 1px solid var(--line);
  box-shadow: 8px 0 24px rgba(16, 24, 40, 0.14);
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateX(-8px);
  pointer-events: none;
  transition: all 220ms ease;
  z-index: 50;
}

.left-nav.expanded .expanded-panel {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.panel-brand {
  height: 84px;
  border-bottom: 1px solid #e2e7ef;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
}

.panel-brand-badge {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #d8dde6;
}

.panel-brand-badge img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.panel-brand-text {
  font-size: 28px;
  font-weight: 800;
  color: #1f2937;
  letter-spacing: 0;
}

.panel-main {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px;
}

.panel-section-title {
  margin: 12px 8px 8px;
  color: #9aa4b2;
  font-size: 12px;
  font-weight: 800;
}

.panel-item {
  width: 100%;
  height: 44px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: #3f4d63;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 180ms ease;
}

.panel-item svg {
  width: 26px;
  height: 26px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

.panel-item img {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  flex: 0 0 auto;
}

.panel-label {
  flex: 1;
  text-align: left;
  font-size: 14px;
  font-weight: 800;
  color: #1f2937;
  opacity: 0;
  transform: translateX(-4px);
  transition: all 220ms ease;
}

.left-nav.expanded .panel-label {
  opacity: 1;
  transform: translateX(0);
}

.panel-item:hover {
  background: #eef2f8;
  color: #48546a;
}

.panel-item.active {
  background: #e7f3ff;
  color: #0d62d9;
}

.panel-sep {
  height: 1px;
  background: #e2e7ef;
  margin: 8px 8px;
}

.panel-bottom {
  border-top: 1px solid #e2e7ef;
  padding: 10px 12px 14px;
}

.user-card {
  margin-top: 8px;
  border: 1px solid #e2e7ef;
  border-radius: 10px;
  background: #fff;
  padding: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-card img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

.user-text {
  flex: 1;
  min-width: 0;
}

.user-text p {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  color: #1f2937;
}

.user-text span {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: #9aa4b2;
  font-weight: 700;
}

.logout-btn {
  border: none;
  background: transparent;
  color: #b6bdc9;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.login-btn {
  margin-top: 8px;
  width: 100%;
  height: 38px;
  border: 1px dashed #c8d1df;
  border-radius: 10px;
  background: #f8fafc;
  color: #0d62d9;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.platform-icon {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #5b6068;
  flex: 0 0 auto;
}

.platform-icon svg {
  width: 100%;
  height: 100%;
}

.platform-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.platform-meta {
  color: #0866ff;
}

.platform-adsterra {
  color: #2563eb;
}

.platform-propellerads {
  color: #f26b2f;
}

.content {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.ad-detail-view {
  min-height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.overview-view {
  min-height: 0;
  flex: 1;
  overflow: auto;
  padding: 14px 12px;
}

.overview-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.overview-head h2 {
  margin: 0;
  font-size: 18px;
}

.overview-range {
  color: #6b7280;
  font-size: 12px;
  font-weight: 600;
}

.overview-kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(140px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.overview-kpi {
  border: 1px solid #d8dde6;
  border-radius: 8px;
  background: #fff;
  padding: 8px 10px;
}

.overview-kpi p {
  margin: 0;
  font-size: 11px;
  color: #6b7280;
}

.overview-kpi b {
  display: block;
  margin-top: 3px;
  font-size: 19px;
  color: #0f172a;
}

.overview-table-shell {
  border: 1px solid #d8dde6;
  border-radius: 8px;
  background: #fff;
  overflow: auto;
}

.overview-table {
  width: 100%;
  border-collapse: collapse;
}

.overview-table th,
.overview-table td {
  border-bottom: 1px solid #edf1f5;
  padding: 8px 10px;
  text-align: center;
  font-size: 12px;
  white-space: nowrap;
}

.overview-table th {
  background: #f5f6f7;
  color: #3a3b3c;
  font-weight: 700;
}

.platform-config-view,
.app-mapping-view {
  min-height: 0;
  flex: 1;
  overflow: auto;
  padding: 14px 12px 18px;
}

.mapping-v2-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.mapping-v2-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mapping-v2-card {
  border: 1px solid #d8dde6;
  border-radius: 10px;
  background: #fff;
  padding: 14px;
  margin-bottom: 12px;
}

.mapping-v2-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.mapping-v2-section-title {
  font-size: 16px;
  color: #1f2937;
  font-weight: 800;
}

.mapping-v2-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.mapping-v2-platform-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mapping-v2-platform-label {
  font-size: 11px;
  color: #475467;
  font-weight: 700;
}

.mapping-v2-platform-tabs {
  min-height: 32px;
  border: 1px solid #d5dce7;
  border-radius: 8px;
  padding: 3px;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.mapping-v2-platform-tab {
  height: 24px;
  border-radius: 6px;
  border: 1px solid transparent;
  padding: 0 10px;
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  color: #667085;
  cursor: pointer;
}

.mapping-v2-platform-tab.active {
  background: #eef4ff;
  color: #2563eb;
  border-color: #c7ddff;
}

.mapping-v2-hint-badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid #d8dde6;
  border-radius: 8px;
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
  color: #4b5563;
  font-weight: 700;
  background: #f8fafc;
}

.mapping-v2-table-head,
.mapping-v2-event-row,
.mapping-v2-field-head,
.mapping-v2-field-row {
  display: grid;
  gap: 10px;
  align-items: center;
}

.mapping-v2-table-head,
.mapping-v2-event-row {
  grid-template-columns: minmax(0, 1fr) 26px minmax(0, 1fr) 84px;
}

.mapping-v2-field-head,
.mapping-v2-field-row {
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 0.8fr) 84px;
}

.mapping-v2-table-head,
.mapping-v2-field-head {
  margin-bottom: 8px;
  font-size: 11px;
  color: #667085;
  font-weight: 800;
}

.mapping-v2-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mapping-v2-event-row,
.mapping-v2-field-row {
  border: 1px solid #e5e9f0;
  border-radius: 8px;
  padding: 8px;
  background: #fcfdff;
}

.mapping-v2-arrow {
  text-align: center;
  color: #98a2b3;
  font-size: 18px;
  font-weight: 700;
}

.mapping-v2-row-actions {
  display: flex;
  justify-content: flex-end;
}

.mapping-v2-add-btn {
  margin-top: 8px;
  border: none;
  background: transparent;
  color: #4f46e5;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  padding: 0;
}

.mapping-v2-row-select,
.mapping-v2-row-input {
  width: 100%;
  min-height: 34px;
  border: 1px solid #d5dce7;
  border-radius: 8px;
  background: #fff;
  padding: 6px 10px;
  font-size: 12px;
  color: #111827;
  font-weight: 700;
  font-family: inherit;
}

.mapping-v2-required-list {
  margin-top: 10px;
  border: 1px solid #e5e9f0;
  border-radius: 8px;
  overflow: hidden;
}

.mapping-v2-required-item {
  border-top: 1px solid #eef2f7;
  padding: 10px 12px;
  background: #fcfdff;
}

.mapping-v2-required-item:first-child {
  border-top: none;
}

.mapping-v2-required-main {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.mapping-v2-required-key {
  font-size: 12px;
  color: #0f172a;
  background: #f1f5f9;
  border: 1px solid #dbe4f0;
  border-radius: 6px;
  padding: 1px 6px;
}

.mapping-v2-required-label {
  font-size: 12px;
  font-weight: 700;
  color: #1f2937;
}

.mapping-v2-required-type {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  text-transform: lowercase;
}

.mapping-v2-required-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  border-radius: 999px;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 800;
}

.mapping-v2-required-badge.required {
  color: #b42318;
  background: #fee4e2;
  border: 1px solid #fecdca;
}

.mapping-v2-required-badge.optional {
  color: #0369a1;
  background: #e0f2fe;
  border: 1px solid #bae6fd;
}

.mapping-v2-required-desc {
  margin-top: 6px;
  font-size: 12px;
  color: #475467;
}

.mapping-v2-required-empty {
  padding: 12px;
  font-size: 12px;
  color: #667085;
  font-weight: 700;
  background: #fcfdff;
}

.config-head-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.config-title {
  margin: 0;
  font-size: 18px;
  color: #111827;
}

.config-subtitle {
  margin: 4px 0 0;
  color: #6b7280;
  font-size: 12px;
  font-weight: 600;
}

.config-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.config-summary-card {
  border: 1px solid #d8dde6;
  border-radius: 8px;
  background: #fff;
  padding: 10px 12px;
  cursor: pointer;
}

.config-summary-card.active {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.config-summary-card b {
  display: block;
  margin-top: 4px;
  font-size: 16px;
  color: #0f172a;
}

.config-summary-platform {
  display: flex;
  align-items: center;
  gap: 8px;
}

.config-summary-platform .platform-icon {
  width: 24px;
  height: 24px;
}

.config-summary-platform-text {
  min-width: 0;
}

.config-summary-platform-name {
  margin: 0;
  font-size: 14px;
  color: #111827;
  font-weight: 800;
  line-height: 1.2;
}

.config-summary-platform-code {
  margin: 2px 0 0;
  font-size: 10px;
  color: #64748b;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.config-summary-meta {
  margin: 4px 0 0;
  font-size: 11px;
  color: #475467;
  font-weight: 700;
}

.config-main-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.config-card {
  border: 1px solid #d8dde6;
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.config-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.config-card-head h3 {
  margin: 0;
  font-size: 14px;
  color: #1f2937;
}

.config-card-head span {
  font-size: 11px;
  color: #6b7280;
  font-weight: 700;
}

.config-form-grid {
  display: grid;
  gap: 8px;
}

.config-form-grid.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.config-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  color: #475467;
  font-weight: 700;
}

.config-field input,
.config-field select,
.config-field textarea,
.config-inline-field select {
  width: 100%;
  min-height: 32px;
  border: 1px solid #d5dce7;
  border-radius: 6px;
  background: #fff;
  padding: 6px 8px;
  font-size: 12px;
  color: #111827;
  font-weight: 600;
  font-family: inherit;
}

.config-field textarea {
  min-height: 160px;
  resize: vertical;
  line-height: 1.45;
}

.config-inline-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #6b7280;
  font-weight: 700;
}

.config-inline-field select {
  min-width: 96px;
}

.config-actions {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.config-check {
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #475467;
  font-weight: 700;
}

.config-check input {
  width: 16px;
  height: 16px;
}

.config-note {
  margin: 8px 0 0;
  font-size: 12px;
  color: #6b7280;
  font-weight: 600;
}

.policy-block {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #edf1f5;
}

.config-table-wrap {
  border: 1px solid #e5e9f0;
  border-radius: 8px;
  overflow: auto;
  max-height: 280px;
}

.config-table {
  width: 100%;
  border-collapse: collapse;
}

.config-table th,
.config-table td {
  border-bottom: 1px solid #edf1f5;
  padding: 8px;
  text-align: left;
  font-size: 12px;
  white-space: nowrap;
}

.config-table th {
  background: #f7f8fa;
  color: #475467;
  font-weight: 800;
}

.config-table tr:last-child td {
  border-bottom: none;
}

.config-table tbody tr {
  cursor: pointer;
}

.config-table tbody tr:hover {
  background: #f8fbff;
}

.config-table tbody tr.active {
  background: #eaf3ff;
}

.json-preview {
  margin: 8px 0 0;
  border: 1px solid #e5e9f0;
  background: #f8fafc;
  border-radius: 8px;
  padding: 8px;
  font-size: 11px;
  color: #1f2937;
  max-height: 180px;
  overflow: auto;
}

.headbar {
  height: 48px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 0 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.head-left,
.head-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.head-title {
  font-size: 14px;
  font-weight: 700;
  color: #5b6068;
}

.account-chip,
.freq-chip {
  height: 28px;
  border-radius: 6px;
  border: 1px solid #d6dce6;
  background: #f7f8fa;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
}

.freq-chip {
  background: #eaf3ff;
  border-color: #c7ddff;
  color: #0d62d9;
}

.account-select-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.account-select {
  height: 30px;
  min-width: 240px;
  max-width: 360px;
  border: 1px solid #d6dce6;
  border-radius: 6px;
  background: #f7f8fa;
  color: #1f2937;
  font-size: 12px;
  font-weight: 700;
  padding: 0 26px 0 10px;
  appearance: none;
  cursor: pointer;
}

.account-select-arrow {
  position: absolute;
  right: 9px;
  color: #6b7280;
  font-size: 10px;
  pointer-events: none;
}

.update-time {
  font-size: 11px;
  color: #8a8d91;
}

.ghost-btn,
.primary-btn {
  height: 28px;
  border-radius: 6px;
  border: 1px solid #ccd3dd;
  background: #fff;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.primary-btn {
  border-color: transparent;
  background: var(--blue);
  color: #fff;
}

.toolbar-wrap {
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
}

.top-tabs {
  display: flex;
  gap: 18px;
  border-bottom: 1px solid #eceff3;
  padding-bottom: 8px;
}

.top-tab {
  border: none;
  background: transparent;
  color: #65676b;
  font-size: 13px;
  font-weight: 700;
  padding: 0;
  cursor: pointer;
}

.top-tab.active {
  color: var(--blue);
}

.toolbar-row {
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.level-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid #d7dde7;
  border-radius: 8px;
  background: #f5f6f7;
}

.level-tab {
  border: 1px solid transparent;
  background: transparent;
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  color: #65676b;
  cursor: pointer;
}

.level-tab.active {
  background: #fff;
  border-color: #d6dce6;
  color: #0d62d9;
}

.date-trigger {
  height: 32px;
  border-radius: 6px;
  border: 1px solid #ccd3dd;
  background: #f7f8fa;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 600;
  color: #4b5563;
  cursor: pointer;
}

.date-trigger-wrap {
  position: relative;
}

.column-config-wrap {
  position: relative;
}

.column-config-panel {
  position: absolute;
  right: 0;
  top: 30px;
  width: 320px;
  max-height: 430px;
  border: 1px solid #d7dde7;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.18);
  z-index: 52;
  display: flex;
  flex-direction: column;
}

.column-config-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid #edf1f5;
}

.column-config-head h4 {
  margin: 0;
  font-size: 13px;
  color: #1f2937;
}

.column-config-head span {
  font-size: 11px;
  color: #6b7280;
}

.column-config-list {
  overflow: auto;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.column-config-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-radius: 6px;
  padding: 6px 8px;
  border: 1px solid transparent;
}

.column-config-item:hover {
  background: #f8fafc;
}

.column-config-item.dragging {
  opacity: 0.6;
}

.column-config-item.drag-over {
  border-color: #93c5fd;
  background: #eff6ff;
}

.column-config-item label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #374151;
  cursor: pointer;
  min-width: 0;
}

.column-config-handle {
  font-size: 13px;
  color: #6b7280;
  cursor: grab;
  user-select: none;
}

.column-config-item.dragging .column-config-handle {
  cursor: grabbing;
}

.column-config-item input[type="checkbox"] {
  margin: 0;
}

.column-config-item .column-config-tag {
  font-size: 10px;
  color: #6b7280;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  padding: 2px 6px;
}

.column-config-item.locked {
  opacity: 0.72;
}

.column-config-empty {
  padding: 10px 12px;
  color: #6b7280;
  font-size: 12px;
}

.column-config-actions {
  border-top: 1px solid #edf1f5;
  padding: 8px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.column-config-actions-right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.date-panel {
  position: absolute;
  right: 0;
  top: 38px;
  width: 680px;
  background: #fff;
  border: 1px solid #d7dde7;
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.18);
  z-index: 50;
}

.date-panel-inner {
  display: grid;
  grid-template-columns: 150px 1fr;
  min-height: 360px;
}

.date-left {
  border-right: 1px solid #edf1f5;
  background: #fafbfc;
  padding: 8px;
  max-height: 460px;
  overflow-y: auto;
}

.date-left-title {
  font-size: 11px;
  color: #3a3b3c;
  font-weight: 800;
  margin: 4px 0 8px;
}

.dp-item {
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 12px;
  color: #65676b;
  cursor: pointer;
}

.date-left-sep {
  height: 1px;
  background: #d9dee8;
  margin: 8px 4px;
}

.dp-item.active {
  background: #eaf3ff;
  color: #0d62d9;
  font-weight: 700;
}

.date-right {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.date-cal-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 8px;
}

.date-cal-head-right {
  justify-content: flex-end;
}

.date-cal-wrap {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.date-cal-block {
  min-width: 0;
}

.date-nav-btn {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid #d9dee8;
  background: #fff;
  color: #344054;
  font-size: 16px;
  line-height: 20px;
  cursor: pointer;
}

.date-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.date-cal-grid span {
  display: grid;
  place-content: center;
  height: 28px;
  border-radius: 6px;
  font-size: 12px;
  color: #4b5563;
}

.date-cal-grid span[data-date] {
  cursor: pointer;
}

.date-cal-grid span[data-date]:hover {
  background: #eef2f6;
}

.date-cal-grid span.disabled {
  color: #c2c8d1;
  cursor: not-allowed;
}

.date-cal-grid span.disabled:hover {
  background: transparent;
}

.date-cal-grid span.weekday {
  color: #98a2b3;
  font-size: 11px;
  height: 20px;
}

.date-cal-grid span.muted {
  color: #c2c8d1;
}

.date-cal-grid span.in {
  background: #edf4ff;
}

.date-cal-grid span.sel {
  background: var(--blue);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 0 0 1px #0b5fd3 inset;
}

.date-cal-grid span.sel.in,
.date-cal-grid span.sel:hover,
.date-cal-grid span.sel.in:hover {
  background: var(--blue);
  color: #fff;
}

.date-draft-row {
  border-top: 1px solid #edf1f5;
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#dateDraftLabel {
  font-size: 12px;
  color: #344054;
  font-weight: 700;
}

#dateDraftRange {
  font-size: 13px;
  color: #101828;
  font-weight: 700;
}

.date-validation-text {
  min-height: 18px;
  font-size: 12px;
  color: #dc2626;
}

#dateApplyBtn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.date-foot {
  border-top: 1px solid #edf1f5;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: #8a8d91;
}

.date-actions {
  display: flex;
  gap: 8px;
}

.ops-row {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.meta-btn {
  height: 32px;
  border-radius: 6px;
  border: 1px solid #ccd3dd;
  background: #f5f6f7;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 700;
}

.meta-btn.primary {
  background: #e7f3ff;
  border-color: #bfd8fb;
  color: #0d62d9;
}

.meta-btn.ghost {
  background: #fff;
}

.search-row {
  margin-top: 8px;
}

.search-input {
  width: 100%;
  height: 34px;
  border: 1px solid #d7dde7;
  border-radius: 6px;
  background: #fff;
  padding: 0 10px;
  color: #8a8d91;
  font-size: 12px;
}

.selection-filter-bar {
  margin-top: 8px;
  min-height: 36px;
  border: 1px solid #d7dde7;
  border-radius: 6px;
  background: #fff;
  padding: 4px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.selection-filter-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.selection-filter-summary {
  font-size: 12px;
  font-weight: 700;
  color: #48556a;
  white-space: nowrap;
}

.selection-filter-tags {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
}

.selection-filter-right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.filter-chip {
  height: 26px;
  display: inline-flex;
  align-items: center;
  border: 1px solid #cfd8e5;
  border-radius: 6px;
  background: #f5f8fc;
  color: #32527f;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.clear-filter-btn {
  border: none;
  background: transparent;
  color: #3d4b60;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
}

.clear-filter-btn:hover {
  background: #eef2f7;
}

.clear-filter-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.sync-text {
  margin: 8px 12px 0;
  font-size: 12px;
  color: #606770;
  font-weight: 600;
}

.kpi-grid {
  margin: 8px 12px 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}

.kpi-grid[hidden] {
  display: none !important;
}

.kpi {
  border: 1px solid #d9dee6;
  border-radius: 8px;
  background: #fff;
  padding: 8px 10px;
}

.kpi-label {
  margin: 0;
  color: #6b7280;
  font-size: 11px;
}

.kpi-value {
  margin: 4px 0 0;
  font-size: 18px;
  font-weight: 800;
}

.table-shell {
  margin: 8px 12px 0;
  border: 1px solid #d9dee6;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
  min-height: 0;
}

.table-wrap {
  overflow: auto;
  max-height: calc(100vh - 330px);
}

.perf-table {
  border-collapse: collapse;
  width: 100%;
  min-width: 2400px;
}

.perf-table th,
.perf-table td {
  border-bottom: 1px solid #e7ebf1;
  border-right: 1px solid #edf1f5;
  padding: 8px 10px;
  font-size: 12px;
  text-align: center;
  white-space: nowrap;
  background: #fff;
}

.perf-table th {
  position: sticky;
  top: 0;
  background: #f5f6f7;
  color: #3a3b3c;
  z-index: 4;
  font-weight: 700;
}

.pin {
  position: sticky;
  z-index: 8;
}

.perf-table th.pin {
  background: #f5f6f7 !important;
  opacity: 1;
  background-clip: padding-box;
  z-index: 12;
}

.perf-table td.pin {
  background: #fff !important;
  opacity: 1;
  background-clip: padding-box;
  z-index: 9;
}

.pin-1 {
  left: 0;
  width: 44px;
  min-width: 44px;
  max-width: 44px;
}

.pin-2 {
  left: 44px;
  width: 86px;
  min-width: 86px;
  max-width: 86px;
}

.pin-3 {
  left: 130px;
  width: 260px;
  min-width: 260px;
  max-width: 260px;
  text-align: left;
}

.pin-4 {
  left: 390px;
  width: 110px;
  min-width: 110px;
  max-width: 110px;
}

.pin-5 {
  left: 500px;
}

.head-checkbox,
.row-selector {
  width: 22px;
  height: 22px;
  border: 1px solid #cfd6e0;
  border-radius: 6px;
  appearance: none;
  background: #fff;
  cursor: pointer;
  position: relative;
}

.head-checkbox:checked::after,
.row-selector:checked::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 3px;
  width: 5px;
  height: 10px;
  border: solid #1877f2;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.switch-pill {
  width: 34px;
  height: 20px;
  border-radius: 999px;
  display: inline-block;
  position: relative;
  vertical-align: middle;
}

.switch-pill::after {
  content: "";
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: #fff;
  position: absolute;
  top: 2px;
  left: 2px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.switch-on {
  background: #1b74e4;
}

.switch-on::after {
  left: 16px;
}

.switch-off {
  background: #d0d7e2;
}

.perf-table tr.selected td {
  background: #eef5ff;
}

.perf-table tr.selected td.pin {
  background: #e8f2ff;
}

.perf-table tr.paused-row td {
  color: #9aa4b2;
  background: #f7f8fa;
}

.perf-table tr.paused-row td.pin {
  background: #f4f6f8 !important;
}

.perf-table tr.paused-row td.row-name {
  color: #6b7280;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
  background: #16a34a;
  margin-right: 6px;
  vertical-align: middle;
}

.status-off {
  background: #9ca3af;
}

.summary-bar {
  height: 42px;
  border-top: 1px solid #d9dee6;
  background: #fff;
  margin-top: auto;
  padding: 0 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #606770;
  font-weight: 700;
}

.summary-items {
  display: flex;
  gap: 18px;
}

.global-toast {
  position: fixed;
  top: 16px;
  right: 18px;
  z-index: 120;
  min-width: 260px;
  max-width: 460px;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid #d9e1ef;
  background: #ffffff;
  color: #243147;
  box-shadow: 0 10px 30px rgba(16, 24, 40, 0.16);
  font-size: 13px;
  font-weight: 600;
}

.global-toast.show {
  animation: toastFadeIn 0.16s ease-out;
}

.global-toast.error {
  border-color: #f4c3c3;
  background: #fff6f6;
  color: #9b1c1c;
}

@keyframes toastFadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1320px) {
  .config-main-grid {
    grid-template-columns: 1fr;
  }

  .mapping-v2-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mapping-v2-table-head,
  .mapping-v2-event-row {
    grid-template-columns: minmax(0, 1fr) 20px minmax(0, 1fr) 70px;
  }

  .mapping-v2-field-head,
  .mapping-v2-field-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mapping-v2-field-head span:nth-child(5) {
    display: none;
  }

  .mapping-v2-field-row .mapping-v2-row-actions {
    grid-column: 2;
    justify-content: flex-start;
  }
}

@media (max-width: 860px) {
  .mapping-v2-head {
    flex-direction: column;
    align-items: stretch;
  }

  .mapping-v2-head-actions {
    justify-content: flex-end;
  }

  .mapping-v2-grid {
    grid-template-columns: 1fr;
  }

  .mapping-v2-platform-tabs {
    width: 100%;
  }

  .mapping-v2-section-head {
    flex-direction: column;
    align-items: flex-start;
  }
}
