/* EMII Admin — Sales Channels Module v5.6 */
#pagChannels {
  animation: chIn .18s ease;
  padding-bottom: 18px;
}

@keyframes chIn {
  from { opacity: .08; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.ch-page { display: none; }
.ch-page.is-active { display: block; }

.ch-shell-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
  padding: 16px;
  border-radius: 26px;
}

.ch-shell-head h2 {
  margin: 5px 0 3px;
  font-size: 20px;
  font-weight: 950;
  letter-spacing: -.03em;
}

.ch-shell-head p {
  margin: 0;
  color: var(--emii-muted);
  font-size: 12px;
  font-weight: 720;
}

.ch-head-actions,
.ch-wizard-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ch-kpi-row,
.ch-detail-kpi {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.ch-list-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.ch-card {
  position: relative;
  overflow: hidden;
  min-height: 164px;
  padding: 14px;
  border: 1px solid rgba(120,120,128,.16);
  border-radius: 24px;
  background: rgba(255,255,255,.82);
  box-shadow: 0 18px 52px rgba(15,23,42,.07), inset 0 1px 0 rgba(255,255,255,.7);
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.ch-card::after {
  content: '';
  position: absolute;
  inset-inline-end: -38px;
  inset-block-start: -42px;
  width: 110px;
  height: 110px;
  border-radius: 999px;
  background: var(--ch-color, rgba(10,132,255,.16));
  opacity: .13;
  pointer-events: none;
}

.ch-card:hover {
  transform: translateY(-2px);
  border-color: rgba(10,132,255,.28);
  box-shadow: 0 24px 70px rgba(15,23,42,.10), inset 0 1px 0 rgba(255,255,255,.76);
}

.ch-card.is-warning { border-color: rgba(255,149,0,.30); }
.ch-card.is-error { border-color: rgba(255,59,48,.30); }

.ch-card-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 11px;
}

.ch-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: #fff;
  font-size: 18px;
  font-weight: 950;
  box-shadow: 0 14px 28px rgba(10,132,255,.14);
}

.ch-card-head strong,
.ch-detail-header strong {
  display: block;
  color: var(--emii-text);
  font-size: 14px;
  font-weight: 950;
  line-height: 1.25;
}

.ch-card-head small,
.ch-detail-header small {
  display: block;
  margin-top: 3px;
  color: var(--emii-muted);
  font-size: 10.8px;
  font-weight: 760;
  line-height: 1.35;
}

.ch-card-head .emii-pill {
  margin-inline-start: auto;
  font-size: 10px;
}

.ch-stats {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin: 10px 0;
}

.ch-stat {
  min-width: 0;
  padding: 8px 6px;
  border-radius: 14px;
  background: rgba(242,242,247,.72);
  text-align: center;
}

.ch-stat strong {
  display: block;
  font-size: 12px;
  font-weight: 950;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ch-stat small {
  display: block;
  margin-top: 2px;
  color: var(--emii-muted);
  font-size: 9.5px;
  font-weight: 780;
}

.ch-actions {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.ch-detail-nav {
  margin-bottom: 10px;
}

.ch-detail-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding: 14px;
  border-radius: 24px;
}

.ch-sub-nav {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  scrollbar-width: none;
  margin: 12px 0;
  padding: 7px;
  border-radius: 22px;
}
.ch-sub-nav::-webkit-scrollbar { display: none; }

.ch-sub-nav button {
  flex: 0 0 auto;
  min-width: 82px;
  height: 38px;
  border: 0;
  border-radius: 16px;
  background: rgba(120,120,128,.10);
  color: var(--emii-muted);
  font-family: inherit;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}
.ch-sub-nav button.is-active {
  background: linear-gradient(135deg, var(--emii-blue), #5856d6);
  color: #fff;
  box-shadow: 0 14px 26px rgba(10,132,255,.20);
}

.ch-ledger-row,
.ch-product-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  padding: 12px;
  border: 1px solid rgba(120,120,128,.14);
  border-radius: 18px;
  background: rgba(255,255,255,.68);
}

.ch-ledger-row { cursor: pointer; }
.ch-ledger-row strong,
.ch-product-row strong { display: block; font-size: 12.5px; font-weight: 950; }
.ch-ledger-row small,
.ch-product-row small { display: block; margin-top: 3px; color: var(--emii-muted); font-size: 10.5px; font-weight: 760; }
.ch-ledger-row b { white-space: nowrap; font-size: 13px; font-weight: 950; }

.ch-sync-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: 0 0 auto;
}
.ch-sync-dot.is-ok { background: var(--emii-green); }
.ch-sync-dot.is-warn { background: var(--emii-orange); }
.ch-sync-dot.is-err { background: var(--emii-red); }

.ch-connect-card {
  padding: 16px;
  border-radius: 22px;
  border: 1.5px dashed rgba(120,120,128,.22);
  background: rgba(255,255,255,.66);
  text-align: center;
}

.ch-wizard-steps {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  margin-bottom: 10px;
  padding: 8px;
  border-radius: 22px;
}

.ch-wizard-steps .emii-btn {
  flex: 0 0 auto;
}

.ch-wizard-actions {
  margin-top: 10px;
  justify-content: flex-end;
}

.emii-app[data-theme="dark"] .ch-card,
.emii-app[data-theme="dark"] .ch-stat,
.emii-app[data-theme="dark"] .ch-ledger-row,
.emii-app[data-theme="dark"] .ch-product-row,
[data-theme="dark"] .ch-card,
[data-theme="dark"] .ch-stat,
[data-theme="dark"] .ch-ledger-row,
[data-theme="dark"] .ch-product-row {
  background: rgba(44,44,46,.74);
  border-color: rgba(255,255,255,.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 18px 52px rgba(0,0,0,.18);
}

@media (max-width: 920px) {
  #pagChannels {
    padding-bottom: calc(92px + var(--emii-safe-bottom, 0px));
  }
  .ch-shell-head {
    align-items: stretch;
    flex-direction: column;
    border-radius: 22px;
    padding: 13px;
  }
  .ch-shell-head h2 {
    font-size: 17px;
  }
  .ch-head-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .ch-head-actions .emii-btn {
    width: 100%;
  }
  .ch-kpi-row,
  .ch-detail-kpi {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
  }
  .ch-list-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .ch-card {
    min-height: 146px;
    padding: 12px;
    border-radius: 22px;
  }
  .ch-detail-header {
    border-radius: 22px;
    padding: 12px;
  }
  .ch-product-row,
  .ch-ledger-row {
    align-items: flex-start;
  }
}
