:root {
  --bg: #050505;
  --bg-soft: #101010;
  --panel: #131313;
  --panel-soft: #1a1a1a;
  --panel-line: rgba(255, 255, 255, 0.08);
  --text: #f4f4f4;
  --muted: #9a9a9a;
  --accent: #ff335f;
  --accent-soft: #ff6a3c;
  --danger: #ff5d73;
  --live: #24c97b;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  background:
    radial-gradient(circle at top right, rgba(255, 51, 95, 0.14), transparent 24%),
    radial-gradient(circle at bottom left, rgba(123, 47, 247, 0.14), transparent 20%),
    var(--bg);
  color: var(--text);
  font-family: "Montserrat", sans-serif;
}

body {
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

.screen-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
}

.shell-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--panel-line);
  border-radius: 26px;
  box-shadow: var(--shadow);
}

.auth-card {
  width: min(100%, 460px);
  padding: 32px;
}

.brand-chip {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  display: inline-grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-soft));
  font-weight: 800;
  font-size: 1.5rem;
  margin-bottom: 18px;
}

.warning-chip {
  background: linear-gradient(135deg, #ff8a00, var(--danger));
}

.eyebrow {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.screen-title,
.page-title,
.sidebar-title,
.section-title {
  font-weight: 700;
}

.screen-title {
  font-size: clamp(1.8rem, 5vw, 2.3rem);
  margin: 0 0 10px;
}

.page-title {
  font-size: clamp(1.9rem, 4vw, 2.35rem);
}

.section-title {
  font-size: 1.15rem;
  margin: 0;
}

.muted {
  color: var(--muted);
}

.compact-label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.compact-input {
  min-height: 46px;
  border-radius: 14px;
  border: 1px solid var(--panel-line);
  background: var(--panel-soft);
  color: var(--text);
}

.compact-input:focus {
  background: var(--panel-soft);
  color: var(--text);
  border-color: rgba(255, 51, 95, 0.4);
  box-shadow: 0 0 0 0.22rem rgba(255, 51, 95, 0.15);
}

.btn {
  min-height: 42px;
  border-radius: 999px;
  font-weight: 700;
  border-width: 1px;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.btn-danger,
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn-danger:hover,
.btn-danger:focus,
.btn-primary:hover,
.btn-primary:focus {
  background: #e71f4b;
  border-color: #e71f4b;
  color: #fff;
}

.btn-outline-light {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.22);
  color: var(--text);
}

.btn-outline-light:hover,
.btn-outline-light:focus {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.32);
  color: #fff;
}

.compact-btn {
  min-height: 42px;
  border-radius: 999px;
  font-weight: 700;
}

.info-panel {
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--panel-line);
  display: grid;
  gap: 10px;
}

code {
  color: #ff9db0;
}

.sidebar {
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 18px;
  background: rgba(0, 0, 0, 0.52);
  border-right: 1px solid var(--panel-line);
  backdrop-filter: blur(22px);
}

.nav-stack {
  display: grid;
  gap: 10px;
}

.nav-link {
  padding: 14px 16px;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 16px;
  background: transparent;
  color: var(--text);
  font-weight: 600;
  transition: background 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
}

.nav-link:hover {
  transform: translateY(-1px);
}

.nav-link.active {
  background: linear-gradient(135deg, rgba(255, 51, 95, 0.18), rgba(123, 47, 247, 0.12));
  border-color: rgba(255, 51, 95, 0.22);
}

.sidebar-email {
  font-size: 0.92rem;
  font-weight: 600;
  word-break: break-word;
}

.content-shell {
  padding: 26px;
}

.status-pill {
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--panel-line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.view-panel {
  display: grid;
  gap: 18px;
}

.section-panel {
  padding: 22px;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.metric-card {
  padding: 20px;
}

.metric-label,
.metric-note,
.row-meta {
  color: var(--muted);
}

.metric-label {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
}

.metric-value {
  display: block;
  margin-top: 10px;
  font-size: 2rem;
  line-height: 1;
}

.metric-note {
  display: block;
  margin-top: 10px;
  font-size: 0.85rem;
}

.table-stack,
.bundle-stack,
.user-list,
.message-list {
  display: grid;
  gap: 12px;
}

.table-row,
.bundle-row,
.user-row,
.message-row {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--panel-line);
  background: rgba(255, 255, 255, 0.02);
}

.table-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
}

.table-row h4,
.user-row h4 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.table-row p,
.user-row p {
  margin: 0;
}

.bundle-row {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 0.9fr 1fr auto;
  gap: 12px;
  align-items: end;
}

.user-row {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
}

.message-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
}

.message-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.message-body {
  margin: 0 0 10px;
  color: var(--text);
}

.message-actions {
  display: flex;
  justify-content: flex-end;
}

.user-head {
  display: flex;
  gap: 14px;
  align-items: center;
}

.avatar-shell {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(255, 51, 95, 0.88), rgba(123, 47, 247, 0.74));
  color: white;
  font-weight: 800;
}

.avatar-shell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.meta-stack {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.soft-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  border: 1px solid var(--panel-line);
}

.neutral-badge {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.danger-badge {
  background: rgba(255, 93, 115, 0.12);
  color: #ffafbc;
  border-color: rgba(255, 93, 115, 0.25);
}

.live-badge {
  background: rgba(36, 201, 123, 0.12);
  color: #81efb1;
  border-color: rgba(36, 201, 123, 0.24);
}

.verified-badge {
  background: rgba(94, 212, 255, 0.12);
  color: #9ee9ff;
  border-color: rgba(94, 212, 255, 0.28);
}

.user-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  min-width: 260px;
  max-width: 380px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(12, 12, 12, 0.95);
  border: 1px solid var(--panel-line);
  box-shadow: var(--shadow);
  z-index: 50;
}

.error-text {
  color: #ff95a9;
}

@media (max-width: 1200px) {
  .bundle-row,
  .user-row,
  .message-row {
    grid-template-columns: 1fr;
  }

  .user-actions {
    justify-content: flex-start;
  }

  .message-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: none;
    border-bottom: 1px solid var(--panel-line);
  }
}

@media (max-width: 720px) {
  .content-shell,
  .sidebar,
  .auth-card {
    padding: 18px;
  }

  .section-head,
  .table-row {
    grid-template-columns: 1fr;
  }
}
