:root {
  --bg: #08090d;
  --panel: #12141b;
  --panel-2: #171a23;
  --line: #2a2f3d;
  --text: #f4f7fb;
  --muted: #9ba6b8;
  --accent: #ffffff;
  --green: #47f0a3;
  --danger: #ff6b6b;
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Inter', system-ui, sans-serif;
  background:
    radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.09), transparent 26rem),
    radial-gradient(circle at 80% 10%, rgba(71, 240, 163, 0.13), transparent 22rem),
    var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

input {
  min-width: 0;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #0b0d12;
  color: var(--text);
  padding: 16px 18px;
  outline: none;
}

input:focus {
  border-color: rgba(255, 255, 255, 0.75);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.08);
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.check-row {
  grid-template-columns: 18px 1fr;
  align-items: center;
}

.check-row input {
  width: 18px;
  height: 18px;
  padding: 0;
  accent-color: #fff;
}

.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 480px);
  gap: 28px;
  align-items: stretch;
  padding: 28px;
}

.auth-visual,
.auth-card,
.panel,
.sidebar {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(18, 20, 27, 0.86);
  backdrop-filter: blur(22px);
  box-shadow: 0 22px 80px rgba(0, 0, 0, 0.35);
}

.auth-visual {
  border-radius: 32px;
  padding: 54px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  position: relative;
}

.auth-visual::before {
  content: '';
  position: absolute;
  inset: 10%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  transform: rotate(-12deg);
}

.auth-visual h1 {
  max-width: 720px;
  font-size: clamp(46px, 7vw, 92px);
  line-height: 0.96;
  margin: 14px 0 0;
  letter-spacing: 0;
}

.auth-visual p {
  color: var(--green);
  text-transform: uppercase;
  font-weight: 800;
}

.logo-orbit {
  width: 148px;
  height: 148px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 36px;
  background: linear-gradient(145deg, #ffffff, #80848e);
  color: #050608;
  font-size: 84px;
  font-weight: 900;
  margin-bottom: auto;
  z-index: 1;
}

.auth-card {
  border-radius: 32px;
  padding: 34px;
  align-self: center;
}

.auth-card h2 {
  margin: 28px 0 8px;
  font-size: 38px;
}

.auth-card form,
.stack {
  display: grid;
  gap: 16px;
}

.muted,
.hint,
.empty {
  color: var(--muted);
}

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

.ghost-icon {
  width: 44px;
  height: 44px;
  border-radius: 15px;
  background: #fff;
  color: #07080b;
  display: grid;
  place-items: center;
  font-weight: 900;
}

.primary-btn,
.soft-btn,
.nav-btn,
.copy-btn {
  border: 0;
  border-radius: 18px;
  min-height: 54px;
  padding: 0 22px;
  font-weight: 800;
}

.primary-btn {
  background: var(--accent);
  color: #07080b;
}

.soft-btn,
.copy-btn {
  background: #202431;
  color: var(--text);
  border: 1px solid var(--line);
}

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

.error {
  color: var(--danger);
  min-height: 24px;
  margin-top: 14px;
}

.boot-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
}

.boot-page strong {
  font-size: 18px;
}

.boot-page span {
  width: 46px;
  height: 46px;
  border-radius: 999px;
  border: 4px solid #2a2f3d;
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
}

.dashboard {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
  min-width: 0;
}

.sidebar {
  border-radius: 0;
  border-top: 0;
  border-bottom: 0;
  border-left: 0;
  padding: 26px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar nav {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.profile-card {
  margin-top: 26px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #0d1017;
  padding: 16px;
  display: grid;
  gap: 5px;
}

.profile-card span {
  width: 44px;
  height: 44px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  background: var(--green);
  color: #06100b;
  font-weight: 900;
  margin-bottom: 6px;
}

.profile-card strong,
.profile-card em {
  overflow-wrap: anywhere;
}

.profile-card small {
  color: var(--muted);
}

.profile-card em {
  color: var(--green);
  font-style: normal;
  font-size: 13px;
}

.nav-btn {
  text-align: left;
  background: transparent;
  color: var(--muted);
}

.nav-btn.active,
.nav-btn:hover {
  background: #202431;
  color: var(--text);
}

.workspace {
  padding: 28px;
  display: grid;
  gap: 22px;
  align-content: start;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-width: 0;
}

.topbar h1,
.panel h2 {
  margin: 4px 0 0;
  letter-spacing: 0;
}

.topbar h1 {
  font-size: clamp(26px, 4vw, 48px);
  overflow-wrap: anywhere;
}

.eyebrow {
  margin: 0;
  color: var(--green);
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 900;
}

.grid {
  display: grid;
  gap: 22px;
}

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

.grid.split {
  grid-template-columns: minmax(320px, 0.75fr) minmax(0, 1.25fr);
}

.panel {
  border-radius: var(--radius);
  padding: 24px;
  min-width: 0;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 20px;
}

.pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  white-space: nowrap;
}

.phone-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}

.iti {
  width: 100%;
}

.iti__country-list {
  background: #11141b;
  border-color: var(--line);
}

.link-list,
.visit-list {
  display: grid;
  gap: 12px;
}

.link-item {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  text-align: left;
  padding: 16px;
  background: #0d1017;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 18px;
}

.link-item.active {
  border-color: #fff;
}

.link-item span {
  min-width: 0;
}

.link-item small {
  display: block;
  color: var(--muted);
  overflow-wrap: anywhere;
  margin-top: 5px;
}

.link-item em {
  color: var(--green);
  font-style: normal;
  font-weight: 900;
}

.copy-btn {
  width: 100%;
  min-height: 44px;
}

.user-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.user-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #0d1017;
  padding: 13px 14px;
}

.user-phone-form {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.readonly-phone {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #0d1017;
  padding: 18px;
}

.readonly-phone strong {
  display: block;
  font-size: 24px;
  overflow-wrap: anywhere;
}

.readonly-phone span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
}

.user-item small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}

.user-item em {
  font-style: normal;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.visit {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  background: #0d1017;
}

.visit summary {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  list-style: none;
  cursor: pointer;
  min-width: 0;
}

.visit summary::-webkit-details-marker {
  display: none;
}

.visit small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.visit b {
  color: var(--green);
}

.visit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.visit-grid p {
  margin: 0;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  overflow-wrap: anywhere;
}

.visit-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}

.pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  color: var(--muted);
  flex-wrap: wrap;
}

.pager .soft-btn {
  min-height: 44px;
}

.device-status {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, rgba(71, 240, 163, 0.08), rgba(255, 255, 255, 0.03));
}

.device-status span {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.device-status.working span {
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(71, 240, 163, 0.55);
  animation: pulseStatus 1.15s ease-in-out infinite;
}

.device-status.denied {
  background: rgba(255, 107, 107, 0.08);
}

.device-status.denied span {
  background: var(--danger);
}

.device-status strong {
  font-size: 16px;
}

.phone-preview {
  display: grid;
  place-items: start center;
}

.wa-frame {
  width: min(100%, 520px);
  min-height: min(760px, calc(100vh - 56px));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 32px;
  background: #050b0d;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.wa-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 34px 24px 18px;
}

.wa-head p {
  margin: 0;
  font-size: clamp(30px, 8vw, 40px);
  line-height: 1;
  font-weight: 900;
}

.wa-head span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 15px;
}

.wa-actions {
  display: flex;
  gap: 12px;
}

.wa-actions span {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 2px solid #dce4ec;
}

.wa-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 0 24px 14px;
  color: var(--muted);
  font-weight: 800;
}

.wa-tabs strong {
  color: var(--text);
  position: relative;
}

.wa-tabs strong::after {
  content: '';
  position: absolute;
  left: 0;
  right: 38%;
  bottom: -12px;
  height: 3px;
  border-radius: 999px;
  background: #22c55e;
}

.wa-sync {
  margin: 18px 24px 8px;
  border: 1px solid rgba(34, 197, 94, 0.25);
  border-radius: 18px;
  padding: 13px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(34, 197, 94, 0.08);
}

.wa-sync span {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: #22c55e;
  animation: pulseStatus 1.1s ease-in-out infinite;
}

.wa-sync b {
  font-size: 14px;
}

.wa-list {
  display: grid;
  padding: 8px 0 24px;
}

.wa-row {
  min-height: 86px;
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 12px 22px;
  min-width: 0;
}

.wa-avatar {
  width: 58px;
  height: 58px;
  border-radius: 999px;
  background: var(--avatar-color);
  display: grid;
  place-items: center;
  color: #f8fafc;
  font-size: 25px;
  font-weight: 900;
  position: relative;
  overflow: hidden;
}

.wa-avatar i {
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 0%, rgba(255, 255, 255, 0.13) 45%, transparent 80%);
  transform: translateX(-100%);
  animation: shimmer 1.7s linear infinite;
}

.wa-copy {
  min-width: 0;
}

.wa-copy strong {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 20px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.wa-copy p {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 6px 0 0;
  color: #8f98a6;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.wa-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #5ee51f;
  flex: 0 0 auto;
}

.wa-loader {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-top-color: #22c55e;
  flex: 0 0 auto;
  animation: spin 0.8s linear infinite;
}

.wa-message-skeleton {
  width: min(100%, 220px);
  height: 16px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(143, 152, 166, 0.18), rgba(244, 247, 251, 0.28), rgba(143, 152, 166, 0.18));
  background-size: 240% 100%;
  animation: loadingWave 1.15s ease-in-out infinite;
}

.wa-message-skeleton.call,
.wa-message-skeleton.missed,
.wa-message-skeleton.photo {
  width: 112px;
}

.wa-message-skeleton.image {
  width: 180px;
}

.wa-blur-text {
  display: inline-block;
  color: transparent;
  text-shadow: 0 0 10px rgba(244, 247, 251, 0.72);
  filter: blur(3px);
  position: relative;
  overflow: hidden;
  border-radius: 8px;
}

.wa-meta .wa-blur-text {
  text-shadow: 0 0 9px rgba(143, 152, 166, 0.7);
}

.wa-blur-text::after {
  content: '';
  position: absolute;
  inset: -2px;
  background: linear-gradient(100deg, transparent 0%, rgba(255, 255, 255, 0.22) 48%, transparent 80%);
  transform: translateX(-120%);
  animation: shimmer 1.5s linear infinite;
}

.wa-meta {
  display: grid;
  justify-items: end;
  gap: 8px;
  color: #8f98a6;
  min-width: 58px;
}

.wa-meta b {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #22c55e;
  color: #041008;
}

@keyframes shimmer {
  to {
    transform: translateX(100%);
  }
}

@keyframes loadingWave {
  0% {
    background-position: 120% 0;
  }
  100% {
    background-position: -120% 0;
  }
}

@keyframes pulseStatus {
  0% {
    box-shadow: 0 0 0 0 rgba(71, 240, 163, 0.55);
    transform: scale(0.94);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(71, 240, 163, 0);
    transform: scale(1);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(71, 240, 163, 0);
    transform: scale(0.94);
  }
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: #fff;
  color: #07080b;
  border-radius: 16px;
  padding: 14px 18px;
  font-weight: 800;
}

.track-body {
  display: grid;
  place-items: center;
  min-height: 100vh;
}

.track-shell {
  width: min(92vw, 520px);
  text-align: center;
  padding: 44px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 32px;
  background: rgba(18, 20, 27, 0.8);
}

.ghost-mark {
  margin: 0 auto 18px;
  width: 92px;
  height: 92px;
  border-radius: 28px;
  display: grid;
  place-items: center;
  background: #fff;
  color: #08090d;
  font-weight: 900;
}

.loader {
  width: 46px;
  height: 46px;
  margin: 24px auto 0;
  border-radius: 999px;
  border: 4px solid #2a2f3d;
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 980px) {
  .auth-page,
  .dashboard,
  .grid.two,
  .grid.split {
    grid-template-columns: 1fr;
  }

  .auth-page {
    padding: 16px;
  }

  .auth-visual {
    min-height: 360px;
    padding: 32px;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .sidebar nav {
    display: flex;
    overflow-x: auto;
    padding-bottom: 4px;
    margin-top: 22px;
  }

  .nav-btn {
    flex: 0 0 auto;
  }

  .profile-card {
    grid-template-columns: 44px minmax(0, 1fr);
    align-items: center;
  }

  .profile-card span {
    grid-row: span 3;
    margin-bottom: 0;
  }
}

@media (max-width: 620px) {
  body {
    background:
      radial-gradient(circle at 15% 10%, rgba(255, 255, 255, 0.08), transparent 18rem),
      var(--bg);
  }

  .auth-page {
    padding: 12px;
  }

  .auth-visual {
    min-height: 250px;
    border-radius: 24px;
    padding: 24px;
  }

  .auth-visual h1 {
    font-size: clamp(34px, 12vw, 48px);
  }

  .logo-orbit {
    width: 96px;
    height: 96px;
    border-radius: 26px;
    font-size: 54px;
  }

  .workspace,
  .auth-card,
  .panel {
    padding: 18px;
  }

  .topbar,
  .phone-form,
  .user-phone-form,
  .panel-head,
  .visit summary {
    display: grid;
    grid-template-columns: 1fr;
  }

  .visit-grid {
    grid-template-columns: 1fr;
  }

  .dashboard {
    min-height: 100dvh;
  }

  .workspace {
    gap: 16px;
  }

  .sidebar {
    padding: 16px;
  }

  .sidebar nav {
    gap: 8px;
  }

  .nav-btn {
    min-height: 46px;
    padding: 0 16px;
  }

  .topbar h1 {
    font-size: 28px;
  }

  .panel h2 {
    font-size: 22px;
  }

  .readonly-phone strong {
    font-size: 20px;
  }

  .link-item {
    display: grid;
    grid-template-columns: 1fr auto;
  }

  .user-item {
    grid-template-columns: 1fr;
  }

  .user-item em {
    justify-self: start;
  }

  .pager {
    display: grid;
    grid-template-columns: 1fr;
    text-align: center;
  }

  .primary-btn,
  .soft-btn {
    width: 100%;
  }

  .wa-frame {
    min-height: min(680px, calc(100dvh - 32px));
    border-radius: 24px;
  }

  .wa-head {
    padding: 26px 18px 16px;
  }

  .wa-row {
    grid-template-columns: 50px minmax(0, 1fr) auto;
    gap: 10px;
    padding: 10px 14px;
  }

  .wa-avatar {
    width: 50px;
    height: 50px;
  }

  .wa-copy strong {
    font-size: 18px;
  }

  .wa-tabs,
  .wa-sync {
    margin-left: 18px;
    margin-right: 18px;
    padding-left: 0;
    padding-right: 0;
  }
}

@media (max-width: 390px) {
  .workspace,
  .auth-card,
  .panel {
    padding: 14px;
  }

  .wa-actions {
    display: none;
  }

  .wa-row {
    grid-template-columns: 46px minmax(0, 1fr);
  }

  .wa-meta {
    grid-column: 2;
    justify-items: start;
    display: flex;
    align-items: center;
  }

  .wa-avatar {
    width: 44px;
    height: 44px;
  }
}
