:root {
  --bg: #070a0f;
  --surface: #0d1219;
  --surface-elevated: #121923;
  --surface-card: #151e2a;
  --surface-hover: #1b2635;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #f1f5f9;
  --muted: #8b9bb0;
  --primary: #25d366;
  --primary-soft: rgba(37, 211, 102, 0.14);
  --primary-glow: rgba(37, 211, 102, 0.25);
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #38bdf8;
  --radius: 14px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  letter-spacing: -0.02em;
}

.ambient-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(110px);
  opacity: 0.28;
  animation: floatGlow 18s ease-in-out infinite alternate;
}

.glow-1 {
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, rgba(37, 211, 102, 0.35), transparent 70%);
  top: -160px;
  right: -120px;
}

.glow-2 {
  width: 460px;
  height: 460px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.22), transparent 70%);
  bottom: -160px;
  left: 140px;
  animation-delay: -9s;
}

@keyframes floatGlow {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(-30px, 24px, 0) scale(1.08); }
}

.app-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 268px 1fr;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  background: rgba(13, 18, 25, 0.88);
  backdrop-filter: blur(18px);
  border-right: 1px solid var(--border);
  padding: 20px 15px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.workspace-switcher {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.ws-switcher-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ws-add-btn {
  background: rgba(37, 211, 102, 0.14);
  border: 1px solid rgba(37, 211, 102, 0.3);
  color: #6ee7b7;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
  cursor: pointer;
}

.workspace-switcher select {
  padding: 7px 10px;
  font-size: 12.5px;
  font-weight: 600;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-section-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #64748b;
  padding: 0 10px;
  margin-bottom: 3px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 6px;
}

.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #25d366, #10b981);
  color: #032211;
  display: grid;
  place-items: center;
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.28);
}

.brand h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
}

.brand p {
  margin: 0;
  font-size: 12px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  text-align: left;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.22s var(--ease);
}

.nav-icon {
  display: inline-flex;
  opacity: 0.78;
  transition: transform 0.22s var(--ease);
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.nav-btn:hover .nav-icon {
  transform: translateX(2px);
}

.nav-btn.active {
  background: linear-gradient(90deg, rgba(37, 211, 102, 0.16), rgba(37, 211, 102, 0.04));
  border-color: rgba(37, 211, 102, 0.3);
  color: #6ee7b7;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.nav-btn.active .nav-icon {
  opacity: 1;
  color: var(--primary);
}

.sidebar-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.guide-pill {
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.2);
  color: #bae6fd;
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s var(--ease);
}

.guide-pill:hover {
  background: rgba(56, 189, 248, 0.14);
  transform: translateY(-1px);
}

.sidebar-status {
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 12.5px;
}

.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Main */
.main {
  padding: 20px 34px 36px;
  max-width: 1360px;
  width: 100%;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 16px;
  margin-bottom: 22px;
  background: rgba(13, 18, 25, 0.72);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: 12px;
  position: sticky;
  top: 12px;
  z-index: 40;
}

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

.topbar-sep {
  color: #475569;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hero-banner {
  background: linear-gradient(135deg, rgba(37, 211, 102, 0.12), rgba(15, 21, 30, 0.92) 55%, rgba(56, 189, 248, 0.08));
  border-color: rgba(37, 211, 102, 0.25);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.hero-banner h2 {
  margin: 0 0 6px;
  font-size: 22px;
}

.hero-banner p {
  margin: 0;
  max-width: 640px;
  font-size: 13.5px;
}

.seq-step-card,
.deploy-step-card {
  background: rgba(9, 13, 19, 0.85);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.seq-step-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.pack-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.page-header h2 {
  margin: 0 0 4px;
  font-size: 24px;
  font-weight: 800;
}

.page-header p {
  margin: 0;
  font-size: 14px;
}

.header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
  animation: panelReveal 0.36s var(--ease) both;
}

@keyframes panelReveal {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

.stat-card {
  background: linear-gradient(180deg, rgba(21, 30, 42, 0.85), rgba(13, 18, 25, 0.9));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease);
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
}

.stat-label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

.stat-value {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 26px;
  font-weight: 800;
}

.stat-value.accent {
  color: var(--primary);
}

/* Cards */
.card {
  background: rgba(15, 21, 30, 0.82);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 20px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 14px 36px rgba(0, 0, 0, 0.25);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.card h3 {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 700;
}

.card-header h3 {
  margin: 0;
}

/* WhatsApp Pairing Card */
.wa-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.wa-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.wa-title-row h3 {
  margin: 0;
}

.pulse-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--muted);
  position: relative;
}

.pulse-dot.online {
  background: var(--primary);
  box-shadow: 0 0 10px var(--primary);
}

.pulse-dot.online::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  animation: pulseRing 2s infinite;
}

.pulse-dot.qr {
  background: var(--warning);
}

@keyframes pulseRing {
  0% { transform: scale(0.8); opacity: 0.8; }
  100% { transform: scale(1.9); opacity: 0; }
}

.qr-box {
  background: #ffffff;
  color: #111;
  padding: 14px;
  border-radius: 14px;
  text-align: center;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.45);
  animation: popIn 0.35s var(--ease);
}

.qr-box img {
  display: block;
  width: 210px;
  height: 210px;
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.94); }
  to { opacity: 1; transform: scale(1); }
}

/* Search & Filter Toolbar */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.search-wrap {
  position: relative;
  flex: 1;
  min-width: 240px;
}

.search-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.search-wrap input[type="text"] {
  padding-left: 38px;
  padding-right: 34px;
}

.search-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: var(--text);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  cursor: pointer;
  line-height: 1;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-chip {
  background: var(--surface-card);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}

.filter-chip:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.filter-chip.active {
  background: var(--primary-soft);
  border-color: rgba(37, 211, 102, 0.45);
  color: #6ee7b7;
}

/* Groups Grid */
.groups-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 14px;
}

.group-card {
  background: linear-gradient(180deg, rgba(21, 30, 42, 0.85), rgba(16, 23, 33, 0.92));
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.group-card.animate-in {
  animation: cardStagger 0.35s var(--ease) both;
}

.group-card:hover {
  transform: translateY(-3px);
  border-color: rgba(37, 211, 102, 0.35);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.32);
}

.group-card.is-active {
  border-color: rgba(37, 211, 102, 0.28);
}

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

.group-avatar {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, rgba(37, 211, 102, 0.22), rgba(56, 189, 248, 0.16));
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
  color: #a7f3d0;
  flex-shrink: 0;
}

.group-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.group-head-left {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.group-title {
  font-weight: 600;
  font-size: 14.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.group-meta-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  transition: 0.25s var(--ease);
}

.slider::before {
  position: absolute;
  content: '';
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.25s var(--ease);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.switch input:checked + .slider {
  background: var(--primary);
  box-shadow: 0 0 12px var(--primary-glow);
}

.switch input:checked + .slider::before {
  transform: translateX(18px);
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

/* Forms & Inputs */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-card {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
}

.field-label {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 6px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="time"],
input[type="date"],
input[type="datetime-local"],
input[type="file"],
select,
textarea {
  width: 100%;
  background: rgba(10, 14, 20, 0.85);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  color-scheme: dark;
  padding: 10px 12px;
  font-size: 13.5px;
  font-family: inherit;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(37, 211, 102, 0.65);
  box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.14);
}

.checkbox-row {
  flex-direction: row;
  align-items: center;
  gap: 9px;
  color: var(--text);
  cursor: pointer;
}

.checkbox-row input {
  width: auto;
  accent-color: var(--primary);
}

.weekday-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  flex-direction: row;
  align-items: center;
  gap: 6px;
  background: var(--surface-card);
  border: 1px solid var(--border);
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
}

.chip input {
  width: auto;
  accent-color: var(--primary);
}

.group-picker-box {
  background: rgba(9, 13, 19, 0.8);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  max-height: 210px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.picker-item {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s ease;
}

.picker-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.picker-item-left {
  display: flex;
  align-items: center;
  gap: 9px;
}

.picker-item input {
  width: auto;
  accent-color: var(--primary);
}

/* Buttons */
.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.btn {
  border: none;
  border-radius: 10px;
  padding: 9px 15px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: transform 0.16s var(--ease), background 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

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

.btn:active {
  transform: scale(0.97);
}

.btn-sm {
  padding: 6px 11px;
  font-size: 12px;
  border-radius: 8px;
}

.btn-primary {
  background: linear-gradient(135deg, #25d366, #16b955);
  color: #032211;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.25);
}

.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.36);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.14);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.32);
}

.icon-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--text);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
}

/* Pills */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.pill-green { background: rgba(37, 211, 102, 0.15); color: #6ee7b7; border: 1px solid rgba(37, 211, 102, 0.25); }
.pill-amber { background: rgba(245, 158, 11, 0.15); color: #fcd34d; border: 1px solid rgba(245, 158, 11, 0.25); }
.pill-red { background: rgba(239, 68, 68, 0.15); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.25); }
.pill-blue { background: rgba(56, 189, 248, 0.14); color: #7dd3fc; border: 1px solid rgba(56, 189, 248, 0.25); }
.pill-gray { background: rgba(255, 255, 255, 0.06); color: var(--muted); border: 1px solid var(--border); }

.badge {
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 999px;
  margin-left: auto;
}

.item-card {
  background: rgba(21, 30, 42, 0.72);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  transition: border-color 0.2s var(--ease);
}

.item-card:hover {
  border-color: var(--border-strong);
}

.item-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.item-title {
  font-weight: 600;
  font-size: 14.5px;
}

.muted { color: var(--muted); }
.small { font-size: 12px; }

/* WhatsApp Simulator Chat Preview */
.wa-preview {
  margin-top: 12px;
  background: #0b141a;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: popIn 0.3s var(--ease);
}

.wa-bubble {
  max-width: 88%;
  padding: 10px 13px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.45;
  white-space: pre-wrap;
  animation: bubbleSlide 0.3s var(--ease) both;
}

.wa-bubble.user {
  align-self: flex-start;
  background: #202c33;
  border-top-left-radius: 3px;
}

.wa-bubble.bot {
  align-self: flex-end;
  background: #005c4b;
  border-top-right-radius: 3px;
}

.wa-bubble-sender {
  font-size: 11px;
  font-weight: 700;
  color: #53bdeb;
  margin-bottom: 3px;
}

.wa-bubble.bot .wa-bubble-sender {
  color: #86efac;
}

.sim-meta {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
}

.confidence-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.confidence-fill {
  height: 100%;
  background: linear-gradient(90deg, #25d366, #38bdf8);
  border-radius: 999px;
  transition: width 0.5s var(--ease);
}

.typing-dots {
  display: inline-flex;
  gap: 4px;
  padding: 4px 2px;
}

.typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
  animation: bounceDot 1.2s infinite ease-in-out;
}
.typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.typing-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes bounceDot {
  0%, 80%, 100% { transform: scale(0.7); opacity: 0.4; }
  40% { transform: scale(1.1); opacity: 1; }
}

@keyframes bubbleSlide {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Slide-over Drawer & Modals */
.drawer-backdrop,
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 7, 12, 0.72);
  backdrop-filter: blur(8px);
  z-index: 90;
  transition: opacity 0.25s ease;
}

.modal-backdrop {
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 100;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(490px, 100vw);
  height: 100vh;
  background: #0f151f;
  border-left: 1px solid var(--border-strong);
  z-index: 95;
  display: flex;
  flex-direction: column;
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.6);
  animation: drawerSlide 0.3s var(--ease);
}

@keyframes drawerSlide {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.modal {
  width: min(500px, 100%);
  max-height: 88vh;
  background: #101722;
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.65);
  animation: popIn 0.25s var(--ease);
}

.modal-lg {
  width: min(640px, 100%);
}

.drawer-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.drawer-header h3 {
  margin: 0 0 2px;
  font-size: 16px;
}

.drawer-body {
  padding: 18px 20px;
  overflow-y: auto;
  flex: 1;
}

.drawer-section {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
}

.drawer-section-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.drawer-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.inline-send {
  display: flex;
  gap: 8px;
}

.chat-feed-box {
  background: #0a1118;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  max-height: 230px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-msg {
  padding: 8px 10px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.04);
  font-size: 12.5px;
  line-height: 1.4;
}

.chat-msg.bot {
  background: rgba(37, 211, 102, 0.12);
  border: 1px solid rgba(37, 211, 102, 0.25);
}

.chat-msg-head {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  margin-bottom: 3px;
}

.info-callout {
  background: rgba(56, 189, 248, 0.07);
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 12px;
  padding: 14px;
}

.info-callout.warning {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.3);
}

.info-callout.danger {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.32);
}

.safety-list {
  margin: 8px 0 0 18px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.safety-list code {
  background: rgba(255, 255, 255, 0.08);
  padding: 1px 5px;
  border-radius: 5px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
}

.clickable-pill {
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.clickable-pill:hover {
  transform: translateY(-1px);
  opacity: 0.92;
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(7, 10, 15, 0.85);
  backdrop-filter: blur(18px);
}

.auth-card {
  width: min(430px, 100%);
  background: rgba(15, 21, 30, 0.94);
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  padding: 28px 26px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  animation: popIn 0.28s var(--ease);
}

.auth-error {
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
  padding: 8px 12px;
  border-radius: 9px;
  font-size: 12.5px;
}

.user-bar {
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.info-callout p {
  margin: 6px 0 0;
}

/* Toasts */
.toast-container {
  position: fixed;
  right: 24px;
  bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 200;
}

.toast {
  background: #141c27;
  border: 1px solid rgba(37, 211, 102, 0.45);
  color: var(--text);
  padding: 11px 16px;
  border-radius: 11px;
  font-size: 13px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  animation: popIn 0.22s var(--ease);
}

.toast.error {
  border-color: rgba(239, 68, 68, 0.6);
}

.hidden {
  display: none !important;
}

@media (max-width: 1080px) {
  .app-shell { grid-template-columns: 230px 1fr; }
  .main { padding: 24px 24px; }
}

@media (max-width: 820px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .two-col, .form-row { grid-template-columns: 1fr; }
}
