/* ============================================================
   ASC — Dashboard mockup styles
   Scoped under .asc-sac so it can be embedded inside any page.
   ============================================================ */

.asc-sac, .asc-sac * { box-sizing: border-box; }

.asc-sac .stage {
  position: relative;
  width: 1180px;
  max-width: 100%;
}

/* ─── Window chrome ─── */
.asc-sac .window {
  position: relative;
  background: #fff;
  border-radius: 22px;
  box-shadow:
    0 38px 70px -28px rgba(36, 12, 48, .35),
    0 12px 28px -12px rgba(36, 12, 48, .18);
  overflow: hidden;
  display: grid;
  grid-template-columns: 88px 320px minmax(0, 1fr);
  height: 640px;
}

/* ─── Sidebar ─── */
.asc-sac .sidebar {
  background: linear-gradient(180deg, #4A1A62 0%, #5C2178 55%, #6A2A88 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 22px 0 24px;
  position: relative;
}
.asc-sac .sidebar::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(80% 50% at 50% 0%, rgba(255,255,255,.08), transparent 65%),
    radial-gradient(120% 80% at 50% 100%, rgba(160,45,176,.4), transparent 60%);
  pointer-events: none;
}
.asc-sac .brand-mark {
  position: relative; z-index: 1;
  width: 56px; height: 56px; border-radius: 14px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.18);
  display: grid; place-items: center;
  margin-bottom: 32px;
}
.asc-sac .brand-mark svg { width: 40px; height: auto; }
.asc-sac .brand-mark .tagline {
  position: absolute; bottom: -16px; left: 50%; transform: translateX(-50%);
  font-size: 10px; font-weight: var(--asc-fw-bold); letter-spacing: .14em;
  color: rgba(255,255,255,.85);
}

.asc-sac .nav-icons {
  position: relative; z-index: 1;
  margin-top: 18px;
  display: flex; flex-direction: column; gap: 8px;
  width: 100%; align-items: center;
  flex: 1;
}
.asc-sac .nav-icons a {
  width: 48px; height: 48px;
  display: grid; place-items: center;
  border-radius: 14px;
  color: rgba(255,255,255,.7);
  transition: background .2s ease, color .2s ease;
  position: relative;
}
.asc-sac .nav-icons a svg { width: 22px; height: 22px; }
.asc-sac .nav-icons a:hover { background: rgba(255,255,255,.08); color: #fff; }
.asc-sac .nav-icons a.is-active {
  background: rgba(255,255,255,.14);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.16);
}
.asc-sac .nav-icons a.is-active::before {
  content: ""; position: absolute; left: -16px; top: 50%; transform: translateY(-50%);
  width: 4px; height: 22px; border-radius: 0 4px 4px 0;
  background: #E5C8FF;
}
.asc-sac .nav-spacer { flex: 1; }

/* ─── Conversation list ─── */
.asc-sac .col-list {
  background: #FAFAFB;
  border-right: 1px solid var(--asc-divider);
  display: flex; flex-direction: column;
  min-width: 0;
}
.asc-sac .col-list-head { padding: 20px 20px 14px; }
.asc-sac .col-list-head h1 {
  margin: 0 0 14px;
  font-size: 22px; font-weight: var(--asc-fw-bold);
  color: var(--asc-fg-strong);
  letter-spacing: -0.01em;
}
.asc-sac .search { position: relative; }
.asc-sac .search svg {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--asc-fg-subtle);
}
.asc-sac .search input {
  width: 100%; height: 38px;
  padding: 0 12px 0 36px;
  border-radius: 10px; border: 1px solid var(--asc-border);
  background: #fff;
  font: inherit; font-size: 13px;
  color: var(--asc-fg);
  outline: none;
}
.asc-sac .search input::placeholder { color: var(--asc-fg-subtle); }

.asc-sac .chat-list { flex: 1; overflow: hidden; }
.asc-sac .chat-item {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  grid-template-rows: auto auto;
  column-gap: 12px;
  padding: 14px 18px;
  cursor: pointer;
  border-left: 3px solid transparent;
  position: relative;
  transition: background .15s ease;
}
.asc-sac .chat-item + .chat-item { border-top: 1px solid var(--asc-divider); }
.asc-sac .chat-item:hover { background: rgba(92,33,120,.04); }
.asc-sac .chat-item.is-active {
  background: #fff;
  border-left-color: var(--asc-purple-600);
  box-shadow: inset 0 0 0 1px var(--asc-divider);
}

.asc-sac .avatar {
  grid-row: 1 / span 2;
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  color: #fff; font-weight: var(--asc-fw-bold); font-size: 14px;
  letter-spacing: -0.01em;
  position: relative;
  flex-shrink: 0;
}
.asc-sac .avatar.av-1 { background: linear-gradient(135deg, #F9A8D4, #DB2777); }
.asc-sac .avatar.av-2 { background: linear-gradient(135deg, #FCD34D, #D97706); }
.asc-sac .avatar.av-3 { background: linear-gradient(135deg, #6EE7B7, #047857); }
.asc-sac .avatar.av-4 { background: linear-gradient(135deg, #C4B5FD, #6D28D9); }
.asc-sac .avatar.av-5 { background: linear-gradient(135deg, #93C5FD, #1D4ED8); }
.asc-sac .avatar .ch-dot {
  position: absolute; right: -2px; bottom: -2px;
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid #FAFAFB;
  display: grid; place-items: center;
}
.asc-sac .chat-item.is-active .avatar .ch-dot { border-color: #fff; }
.asc-sac .ch-dot svg { width: 9px; height: 9px; color: #fff; }
.asc-sac .ch-wa { background: #25D366; }
.asc-sac .ch-ig { background: #E1306C; }
.asc-sac .ch-fb { background: #0866FF; }
.asc-sac .ch-tg { background: #229ED9; }
.asc-sac .ch-em { background: var(--asc-purple-600); }

.asc-sac .chat-name {
  font-weight: var(--asc-fw-bold);
  font-size: 14px;
  color: var(--asc-fg-strong);
  display: flex; align-items: center; gap: 6px;
}
.asc-sac .chat-time {
  font-size: 11px; color: var(--asc-fg-subtle);
  font-weight: var(--asc-fw-medium);
  text-align: right;
}
.asc-sac .chat-preview {
  grid-column: 2 / span 2;
  font-size: 12.5px;
  color: var(--asc-fg-muted);
  line-height: 1.4;
  margin-top: 2px;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical;
  overflow: hidden;
  padding-right: 6px;
}
.asc-sac .chat-tags {
  grid-column: 2 / span 2;
  margin-top: 8px;
  display: flex; gap: 6px; flex-wrap: wrap;
}
.asc-sac .tag {
  font-size: 10.5px; font-weight: var(--asc-fw-bold);
  padding: 3px 8px; border-radius: 6px;
  letter-spacing: .01em;
  text-transform: lowercase;
}
.asc-sac .tag.t-wa { background: #DCFCE7; color: #047857; }
.asc-sac .tag.t-ig { background: #FCE7F3; color: #BE185D; }
.asc-sac .tag.t-fb { background: #DBEAFE; color: #1D4ED8; }
.asc-sac .tag.t-tg { background: #DBEAFE; color: #1E40AF; }
.asc-sac .tag.t-em { background: #EDE9FE; color: #6D28D9; }
.asc-sac .tag.t-sales { background: #FEF3C7; color: #B45309; }
.asc-sac .tag.t-support { background: var(--asc-purple-50); color: var(--asc-purple-700); }
.asc-sac .tag.t-vip { background: #FEE2E2; color: #B91C1C; }

.asc-sac .unread {
  position: absolute; right: 18px; top: 16px;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--asc-purple-600);
  color: #fff; font-size: 10px; font-weight: var(--asc-fw-bold);
  display: grid; place-items: center;
}

/* ─── Conversation panel ─── */
.asc-sac .col-chat {
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: #fff;
  min-width: 0;
}
.asc-sac .chat-head {
  padding: 14px 22px;
  border-bottom: 1px solid var(--asc-divider);
  display: flex; align-items: center; gap: 12px;
}
.asc-sac .chat-head .avatar { width: 38px; height: 38px; font-size: 13px; grid-row: auto; }
.asc-sac .chat-head-info { flex: 1; min-width: 0; }
.asc-sac .chat-head-info b {
  display: block; font-size: 14px; color: var(--asc-fg-strong);
  font-weight: var(--asc-fw-bold);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.asc-sac .chat-head-info .status {
  font-size: 12px; color: var(--asc-fg-muted);
  display: flex; align-items: center; gap: 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.asc-sac .chat-head-info .status::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--asc-success-500); flex-shrink: 0;
}
.asc-sac .chat-head-actions { display: flex; gap: 4px; flex-shrink: 0; }
.asc-sac .chat-head-actions button {
  width: 34px; height: 34px;
  border: 0; background: transparent; border-radius: 10px;
  color: var(--asc-fg-muted); cursor: pointer;
  display: grid; place-items: center;
  transition: background .15s ease;
}
.asc-sac .chat-head-actions button:hover { background: var(--asc-bg-subtle); color: var(--asc-fg-strong); }
.asc-sac .chat-head-actions svg { width: 18px; height: 18px; }

.asc-sac .chat-body {
  padding: 22px 26px;
  overflow-y: auto;
  background:
    radial-gradient(60% 40% at 50% 0%, rgba(92,33,120,.04), transparent 70%),
    #FAFAFB;
  display: flex; flex-direction: column; gap: 14px;
}
.asc-sac .day-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 4px 0 6px;
}
.asc-sac .day-divider::before,
.asc-sac .day-divider::after {
  content: ""; flex: 1; height: 1px; background: var(--asc-divider);
}
.asc-sac .day-divider span {
  font-size: 11px; font-weight: var(--asc-fw-medium);
  color: var(--asc-fg-muted);
  padding: 4px 10px; border-radius: 999px;
  background: #fff; border: 1px solid var(--asc-divider);
}

.asc-sac .bubble {
  max-width: 75%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px; line-height: 1.5;
  color: var(--asc-fg-strong);
  box-shadow: 0 1px 2px rgba(22, 22, 28, .05);
  position: relative;
  word-wrap: break-word;
}
.asc-sac .bubble small {
  display: block;
  font-size: 10.5px; color: var(--asc-fg-subtle);
  margin-top: 4px; font-weight: var(--asc-fw-medium);
}

.asc-sac .row-in { display: flex; gap: 10px; align-items: flex-end; }
.asc-sac .row-in .avatar { width: 28px; height: 28px; font-size: 11px; grid-row: auto; }
.asc-sac .row-in .bubble {
  background: #fff;
  border: 1px solid var(--asc-divider);
  border-bottom-left-radius: 4px;
}
.asc-sac .row-out { display: flex; justify-content: flex-end; }
.asc-sac .row-out .bubble {
  background: linear-gradient(135deg, var(--asc-purple-600), #7A37A4);
  color: #fff;
  border-bottom-right-radius: 4px;
  box-shadow: var(--asc-shadow-brand);
}
.asc-sac .row-out .bubble small { color: rgba(255,255,255,.7); text-align: right; }
.asc-sac .row-out .bubble .read {
  display: inline-block; margin-left: 4px;
  color: #E5C8FF;
}

.asc-sac .typing {
  display: flex; gap: 4px; padding: 12px 14px;
  background: #fff; border: 1px solid var(--asc-divider);
  border-radius: 16px; border-bottom-left-radius: 4px;
  width: max-content;
}
.asc-sac .typing span {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--asc-purple-300);
  animation: asc-sac-typing 1.2s infinite ease-in-out;
}
.asc-sac .typing span:nth-child(2) { animation-delay: .15s; }
.asc-sac .typing span:nth-child(3) { animation-delay: .3s; }

@keyframes asc-sac-typing {
  0%, 60%, 100% { transform: translateY(0); opacity: .6; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.asc-sac .chat-composer {
  border-top: 1px solid var(--asc-divider);
  padding: 14px 18px;
  display: flex; align-items: center; gap: 10px;
  background: #fff;
}
.asc-sac .chat-composer .ic-btn {
  width: 36px; height: 36px;
  border: 0; background: transparent; border-radius: 10px;
  color: var(--asc-fg-muted); cursor: pointer;
  display: grid; place-items: center;
}
.asc-sac .chat-composer .ic-btn:hover { background: var(--asc-bg-subtle); color: var(--asc-fg-strong); }
.asc-sac .chat-composer .ic-btn svg { width: 18px; height: 18px; }
.asc-sac .chat-composer .input {
  flex: 1; height: 40px;
  border-radius: 999px; border: 1px solid var(--asc-border);
  background: var(--asc-bg-subtle);
  padding: 0 16px;
  display: flex; align-items: center;
  font-size: 13.5px; color: var(--asc-fg-subtle);
}
.asc-sac .chat-composer .send {
  width: 40px; height: 40px;
  border: 0; border-radius: 50%;
  background: var(--asc-purple-600);
  color: #fff; cursor: pointer;
  display: grid; place-items: center;
  box-shadow: var(--asc-shadow-brand);
  transition: transform .15s ease;
}
.asc-sac .chat-composer .send:hover { transform: translateY(-1px); }
.asc-sac .chat-composer .send svg { width: 18px; height: 18px; }

.asc-sac .by-asc {
  position: absolute; right: 18px; bottom: 12px;
  font-size: 11px; color: var(--asc-fg-subtle);
  letter-spacing: .04em;
}
.asc-sac .by-asc b { color: var(--asc-purple-600); font-weight: var(--asc-fw-bold); }

/* ─── Floating channel bubbles ─── */
.asc-sac .channel-bubble {
  position: absolute;
  width: 84px; height: 84px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: #fff;
  box-shadow:
    0 24px 40px -16px rgba(0,0,0,.3),
    0 8px 16px -8px rgba(0,0,0,.2),
    inset 0 1px 0 rgba(255,255,255,.3);
  z-index: 2;
  animation: asc-sac-bob 6s ease-in-out infinite;
}
.asc-sac .channel-bubble svg { width: 42px; height: 42px; }
.asc-sac .channel-bubble.cb-fb {
  background: linear-gradient(135deg, #00B2FF 0%, #006AFF 55%, #A033FF 82%, #FF5280 100%);
  top: -32px; left: 26%;
  animation-delay: 0s;
}
.asc-sac .channel-bubble.cb-wa {
  background: linear-gradient(135deg, #25D366, #128C7E);
  top: -30px; right: 6%;
  animation-delay: 1.5s;
}
.asc-sac .channel-bubble.cb-tg {
  background: linear-gradient(135deg, #37BBFE, #007AB8);
  bottom: 32%; left: -38px;
  animation-delay: 3s;
}
.asc-sac .channel-bubble.cb-ig {
  background:
    radial-gradient(circle at 30% 110%, #FFDC80 0%, #FCAF45 15%, #F77737 30%, #F56040 40%, #FD1D1D 55%, #E1306C 65%, #C13584 75%, #833AB4 90%);
  bottom: -32px; right: 28%;
  animation-delay: 4.5s;
}
@keyframes asc-sac-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* ─── Embedded variant (inside hero) ─── */
.asc-sac.is-embed .stage { width: 100%; }
.asc-sac.is-embed .channel-bubble { z-index: 5; }
/* dashboard bleeds past the right edge — reposition right-side bubbles
   so they sit over the visible portion of the window */
.asc-sac.is-embed .channel-bubble.cb-wa {
  top: -34px;
  right: auto;
  left: 56%;
}
.asc-sac.is-embed .channel-bubble.cb-ig {
  bottom: -34px;
  right: auto;
  left: 48%;
}
