:root {
  --dark: #2d2d2d;
  --panel: #343434;
  --line: #1b1b1b;
  --soft: #8b8b8b;
  --green: #24d366;
  --blue: #16a7f5;
  --orange: #f46f28;
  --red: #ff0047;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--dark);
  color: #f4f4f4;
}

button, input { font: inherit; }

.hidden { display: none !important; }

.app-shell {
  min-height: 100vh;
  background: #303030;
}

.topbar {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  background: #2d2d2d;
  border-bottom: 1px solid #202020;
}

.brand-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.mini-whatsapp {
  width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  background: #1cc969;
  color: #fff;
  font-weight: 700;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tool {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: #3e3e3e;
  color: #fff;
  cursor: pointer;
}

.tool.active {
  outline: 3px solid #0aaeea;
}

.workspace {
  min-height: calc(100vh - 72px);
  display: grid;
  grid-template-columns: minmax(620px, 1fr) 444px;
  gap: 6px;
}

.login-stage {
  position: relative;
  padding: 18px 10px 0;
  background: #f6efe6;
  overflow: hidden;
}

.whatsapp-heading {
  margin-left: 40px;
  color: #0bc661;
  font-size: 18px;
  font-weight: 700;
}

.qr-card {
  position: relative;
  width: min(58vw, 535px);
  min-height: 360px;
  margin: 52px auto;
  padding: 32px;
  border: 1px solid #111;
  border-radius: 24px 24px 0 0;
  background: #fff;
  color: #162132;
  text-align: center;
}

.qr-card h1 {
  margin: 34px 0 0;
  font-size: clamp(28px, 3vw, 42px);
  font-weight: 400;
}

.qr-code {
  width: 228px;
  height: 228px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  opacity: .09;
}

.qr-code span {
  background: #333;
}

.qr-code span:nth-child(3n),
.qr-code span:nth-child(7n) { background: transparent; }

.qr-overlay {
  position: absolute;
  inset: 46px 50% auto auto;
  transform: translateX(50%);
  width: 200px;
  height: 200px;
  border: 0;
  border-radius: 14px;
  background: #050505;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.reload-symbol {
  display: block;
  font-size: 48px;
  line-height: 1.1;
}

.logo-lockup {
  position: absolute;
  left: 58px;
  bottom: 28px;
  display: grid;
  grid-template-columns: auto auto;
  align-items: end;
  column-gap: 8px;
}

.logo-mark {
  width: 74px;
  height: 58px;
  display: grid;
  place-items: center;
  border: 7px solid #fff;
  border-radius: 16px;
  background: #25c3ae;
  color: #fff;
  font-size: 36px;
}

.logo-main {
  font-size: 56px;
  font-weight: 900;
  line-height: .82;
}

.logo-sub {
  grid-column: 2;
  justify-self: end;
  color: #22d0c5;
  font-size: 38px;
  font-weight: 800;
  font-style: italic;
}

.side-panel {
  background: #303030;
  border-left: 1px solid #151515;
  color: #e8e8e8;
}

.login-side {
  padding: 46px 36px;
}

.load-icon,
.round-load {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: conic-gradient(var(--orange) 0 72%, #171717 72% 100%);
  color: #f8f8f8;
  font-size: 34px;
}

.round-load {
  cursor: pointer;
}

.round-load.small {
  width: 38px;
  height: 38px;
  font-size: 30px;
}

.contact-card {
  height: 56px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px 0 14px;
  padding: 6px 12px;
  background: #fff;
  color: #111;
}

.contact-card small {
  display: block;
  color: #777;
  filter: blur(2px);
}

.qr-code { display:grid; place-items:center; opacity:1; }
.qr-code img { width:100%; height:100%; object-fit:contain; }
.qr-placeholder { display:grid; place-items:center; width:100%; height:100%; padding:20px; color:#667085; background:#f5f6f7; border:1px dashed #adb5bd; border-radius:8px; font-size:15px; }
.qr-overlay { display:none; }
.connection-label { color:#5f6b7a; margin:12px 0; }
.contact-card small { filter:none; }
.empty-state { padding:18px; color:#9ca3af; text-align:center; font-size:13px; }

.contact-avatar,
.avatar {
  width: 48px;
  height: 48px;
  flex: none;
  border-radius: 50%;
  background: linear-gradient(135deg, #a8e5df, #e7e7e7);
}

.operation-workspace {
  grid-template-columns: minmax(760px, 1fr) 444px;
}

.phone-panel {
  display: grid;
  grid-template-columns: 64px 400px minmax(360px, 1fr);
  min-height: calc(100vh - 72px);
  background: #f7f4f0;
  color: #111;
}

.wa-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding-top: 20px;
  background: #f2f2f2;
  border-right: 1px solid #ddd;
  color: #606060;
}

.chat-list {
  padding: 20px;
  background: #fff;
  border-right: 1px solid #ddd;
}

.wa-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #09a957;
  font-size: 23px;
}

.wa-title button {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: #18b869;
  color: #fff;
  cursor: pointer;
}

.search-box {
  height: 40px;
  margin: 22px 0 10px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 20px;
  background: #f3f3f3;
  color: #777;
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
}

.chips {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.chips button {
  border: 1px solid #ddd;
  border-radius: 18px;
  padding: 7px 14px;
  background: #fff;
  color: #666;
}

.chips .selected {
  background: #d9ffd9;
  color: #0b8c44;
}

.chat-item {
  min-height: 76px;
  display: grid;
  grid-template-columns: 54px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border-radius: 10px;
  cursor: pointer;
}

.chat-item.active,
.chat-item:hover { background: #f1f1f1; }

.chat-item small { color: #6b6b6b; }

.chat-time { color: #a2776b; font-size: 12px; }

.conversation {
  display: grid;
  grid-template-rows: 64px 1fr 70px;
  min-width: 0;
  background: #efe8de;
}

.conversation-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  background: #fff;
  border-bottom: 1px solid #ddd;
}

.conversation-head small { display: block; color: #6c6c6c; }

.conversation-actions { margin-left: auto; color: #111; }

.group {
  display: grid;
  place-items: center;
  background: #bdf1ed;
}

.messages-pane {
  padding: 18px 24px;
  overflow: auto;
  background-color: #f1eadf;
  background-image: radial-gradient(#dacfc0 1px, transparent 1px);
  background-size: 22px 22px;
}

.bubble {
  width: fit-content;
  max-width: 78%;
  margin: 10px 0;
  padding: 9px 12px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 1px #ddd;
}

.bubble.mine {
  margin-left: auto;
  background: #fff5df;
}

.bubble strong {
  display: block;
  margin-bottom: 5px;
  color: #b05e12;
  font-size: 13px;
}

.bubble time {
  display: block;
  text-align: right;
  color: #777;
  font-size: 12px;
}

.composer {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 12px;
  padding: 0 18px;
  border-radius: 26px;
  background: #fff;
}

.composer input {
  flex: 1;
  height: 46px;
  border: 0;
  outline: 0;
}

.control-panel {
  display: grid;
  grid-template-rows: 214px 1fr 1.85fr;
  min-height: calc(100vh - 72px);
  background: #2f2f2f;
  border-left: 1px solid #171717;
}

.instruction-box,
.incoming-box,
.approved-box {
  position: relative;
  border-bottom: 1px solid #161616;
  padding: 12px;
}

.instruction-box {
  display: grid;
  align-items: center;
  justify-items: center;
  text-align: left;
}

.instruction-box p {
  max-width: 270px;
  margin: 0;
  line-height: 1.35;
}

.panel-label {
  position: absolute;
  top: 0;
  left: 6px;
  transform: translateY(-50%);
  padding: 2px 6px;
  border: 1px solid #121212;
  background: #2c2c2c;
  font-size: 12px;
}

.incoming-list,
.approved-list {
  height: 100%;
  overflow: auto;
  border: 2px solid #1b1b1b;
  background: #7f7f7f;
}

.incoming-item {
  height: 29px;
  display: grid;
  grid-template-columns: 28px 1fr 42px;
  align-items: center;
  padding: 0 8px 0 4px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  color: #e4e4e4;
  font-size: 14px;
}

.download {
  width: 22px;
  height: 22px;
  border: 2px solid #1ba9ff;
  border-radius: 50%;
  background: #a7a7a7;
  color: #126fa4;
  cursor: pointer;
  line-height: 16px;
  text-align: center;
}

.incoming-text,
.approved-text {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.incoming-time {
  justify-self: end;
}

.mode-icons {
  display: flex;
  gap: 14px;
  margin: 16px 0 8px;
  font-size: 25px;
}

.pink { color: #ff3978; }
.blue { color: #4bb6e9; }
.orange { color: #ff671d; }
.cyan { color: #75e5ff; }

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 44px;
}

.tabs button {
  min-width: 67px;
  height: 20px;
  border: 0;
  border-radius: 4px;
  background: #777;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.tabs .blue-tab { background: #0a9ee4; }
.tabs .yellow-tab { background: #ffd400; color: #fff; }
.tabs .red-tab { background: #f45a4a; }
.tabs .black-tab { background: #000; }

.approved-list {
  position: absolute;
  inset: 108px 6px 78px;
}

.approved-item {
  height: 60px;
  display: grid;
  grid-template-columns: 60px 1fr 28px 34px 34px;
  align-items: center;
  background: #858585;
  color: #f1f1f1;
}

.approved-item:nth-child(even) { background: #c8c8c8; color: #fff; }

.approved-item img {
  width: 60px;
  height: 60px;
  object-fit: cover;
}

.lock { color: #d8d8d8; font-size: 25px; }
.move { display: grid; gap: 0; color: #14c64b; font-size: 24px; line-height: .7; }
.move button {
  width: 28px;
  height: 22px;
  border: 0;
  background: transparent;
  color: #14c64b;
  font-size: 24px;
  font-weight: 900;
  line-height: 18px;
  cursor: pointer;
}
.remove {
  border: 0;
  background: transparent;
  color: var(--red);
  font-size: 28px;
  font-weight: 900;
  cursor: pointer;
}

.play-row {
  position: absolute;
  left: 16px;
  right: 14px;
  bottom: 12px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.play-button {
  width: 66px;
  height: 66px;
  border: 5px solid #ffc400;
  border-radius: 50%;
  background: var(--orange);
  color: #fff;
  font-size: 35px;
  cursor: pointer;
}

.gc-link {
  margin-left: auto;
  color: #8fd7ff;
  text-decoration: none;
  font-size: 13px;
}

.gc-body {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: transparent;
}

.gc-stage {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: transparent;
}

.media-layer {
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
  opacity: 0;
}

.gc-card {
  position: absolute;
  left: 12.5vw;
  top: 20vh;
  width: min(980px, 72vw);
  transform: translateY(24px);
  opacity: 0;
}

.gc-card.on {
  animation: gcTextIn 520ms ease-out forwards;
}

.gc-card p {
  margin: 0;
  color: #030303;
  font-size: clamp(44px, 4.7vw, 88px);
  line-height: 1.18;
  font-weight: 900;
  letter-spacing: 0;
  text-wrap: balance;
}

.gc-avatar {
  position: absolute;
  left: 6vw;
  bottom: 7vh;
  width: clamp(110px, 13vw, 230px);
  aspect-ratio: 1;
  margin: 0;
  transform: translateX(-24px);
  opacity: 0;
}

.gc-avatar.on {
  animation: gcAvatarIn 520ms ease-out 120ms forwards;
}

.gc-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 8px solid #fff;
  border-radius: 50%;
  filter: grayscale(1);
}

.gc-whatsapp {
  position: absolute;
  right: 0;
  bottom: 3%;
  width: 24%;
  height: 24%;
  display: grid;
  place-items: center;
  border: 4px solid #fff;
  border-radius: 50%;
  background: #1ec95c;
  color: #fff;
  font-size: clamp(20px, 2vw, 38px);
  font-weight: 900;
}

@keyframes gcTextIn {
  to { transform: translateY(0); opacity: 1; }
}

@keyframes gcAvatarIn {
  to { transform: translateX(0); opacity: 1; }
}

@media (max-width: 1100px) {
  .workspace,
  .operation-workspace {
    grid-template-columns: 1fr;
  }

  .control-panel {
    min-height: 560px;
  }

  .phone-panel {
    grid-template-columns: 54px minmax(270px, 370px) 1fr;
  }
}
