:root {
  --bg: #070a14;
  --bg-soft: #0e152b;
  --panel: rgba(16, 24, 48, 0.75);
  --panel-2: rgba(23, 34, 68, 0.85);
  --border: rgba(120, 150, 240, 0.16);
  --border-hover: rgba(99, 102, 241, 0.38);
  --border-focus: rgba(79, 124, 255, 0.65);
  --text: #f1f5f9;
  --text-soft: #cbd5e1;
  --muted: #94a3b8;
  --primary: #4f7cff;
  --primary-2: #38bdf8;
  --primary-gradient: linear-gradient(135deg, #4f46e5 0%, #3b82f6 50%, #06b6d4 100%);
  --success: #10b981;
  --danger: #f43f5e;
  --warning: #f59e0b;
  --cyan: #06b6d4;
  --purple: #8b5cf6;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --shadow: 0 20px 50px -10px rgba(2, 6, 23, 0.7);
  --shadow-lg: 0 28px 70px -12px rgba(2, 6, 23, 0.85);
  --shadow-glow: 0 0 24px -2px rgba(79, 124, 255, 0.3);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  height: 100%;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text);
  background:
    radial-gradient(1200px 700px at 10% -10%, rgba(79, 124, 255, 0.18), transparent 60%),
    radial-gradient(1000px 600px at 95% 5%, rgba(6, 182, 212, 0.14), transparent 55%),
    radial-gradient(900px 600px at 50% 100%, rgba(139, 92, 246, 0.08), transparent 70%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.15); }
::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.22);
  border-radius: 999px;
  transition: background 0.2s;
}
::-webkit-scrollbar-thumb:hover { background: rgba(148, 163, 184, 0.4); }

a { color: var(--primary-2); text-decoration: none; transition: color 0.18s; }
a:hover { color: #93c5fd; }

.app-shell {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ===== Sidebar ===== */
.sidebar {
  width: 256px;
  flex: 0 0 256px;
  padding: 24px 18px;
  background: linear-gradient(180deg, rgba(14, 21, 42, 0.95), rgba(7, 10, 20, 0.98));
  border-right: 1px solid var(--border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 20;
}

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

.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: var(--primary-gradient);
  color: #06122b;
  box-shadow: 0 8px 24px -2px rgba(79, 124, 255, 0.45);
  flex-shrink: 0;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.brand-logo:hover { transform: scale(1.05) rotate(-3deg); }
.brand-logo svg { width: 22px; height: 22px; color: #fff; }

.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong {
  font-size: 16.5px;
  font-weight: 800;
  letter-spacing: -0.3px;
  background: linear-gradient(135deg, #ffffff 40%, #93c5fd 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.brand-text span {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin-top: 2px;
}

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

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 12px;
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
  position: relative;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #f1f5f9;
  transform: translateX(3px);
}
.nav-item.active {
  background: linear-gradient(90deg, rgba(79, 124, 255, 0.22), rgba(6, 182, 212, 0.08));
  color: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.35);
}
.nav-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  bottom: 9px;
  width: 3.5px;
  border-radius: 4px;
  background: var(--primary-gradient);
  box-shadow: 0 0 10px rgba(79, 124, 255, 0.8);
}
.nav-icon {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  color: inherit;
  opacity: 0.85;
}
.nav-icon svg { width: 17px; height: 17px; }

.nav-badge {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(244, 63, 94, 0.22);
  color: #fca5a5;
  border: 1px solid rgba(244, 63, 94, 0.4);
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
  box-shadow: 0 0 12px rgba(244, 63, 94, 0.3);
}

.sidebar-footer {
  border-top: 1px solid var(--border);
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.user-chip { display: flex; align-items: center; gap: 11px; }
.user-chip strong { display: block; font-size: 13px; font-weight: 700; }
.user-chip span { color: var(--muted); font-size: 11px; }
.avatar {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 14px;
  background: linear-gradient(135deg, rgba(79, 124, 255, 0.3), rgba(6, 182, 212, 0.2));
  color: #93c5fd;
  border: 1px solid rgba(147, 197, 253, 0.3);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* ===== Main Viewport ===== */
.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 34px 16px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: linear-gradient(180deg, rgba(7, 10, 20, 0.8), rgba(7, 10, 20, 0.3));
  border-bottom: 1px solid rgba(120, 150, 240, 0.08);
}
.page-kicker {
  color: var(--primary-2);
  font-size: 10.5px;
  letter-spacing: 1.5px;
  font-weight: 700;
  text-transform: uppercase;
}
.page-title {
  margin: 4px 0 0;
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -0.4px;
}

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

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  transition: all 0.2s ease;
}
.status-pill i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
}
.status-pill.running {
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.1);
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.2);
}
.status-pill.running i {
  background: var(--success);
  box-shadow: 0 0 10px #10b981;
  animation: pulseGlow 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
.status-pill.error {
  color: #fca5a5;
  border-color: rgba(244, 63, 94, 0.4);
  background: rgba(244, 63, 94, 0.1);
}
.status-pill.error i { background: var(--danger); box-shadow: 0 0 8px #f43f5e; }

@keyframes pulseGlow {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.content {
  padding: 24px 34px 50px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* ===== Card Architecture ===== */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  padding: 24px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  position: relative;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.2s ease;
}
.card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-lg), 0 0 24px -4px rgba(79, 124, 255, 0.12);
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.card-head-left {
  display: flex;
  align-items: center;
  gap: 14px;
}
.card-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(79, 124, 255, 0.2), rgba(6, 182, 212, 0.12));
  border: 1px solid rgba(79, 124, 255, 0.3);
  color: #93c5fd;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}
.card-icon svg { width: 20px; height: 20px; }
.card-icon.blue { background: linear-gradient(135deg, rgba(59, 130, 246, 0.25), rgba(37, 99, 235, 0.1)); border-color: rgba(59, 130, 246, 0.35); color: #93c5fd; }
.card-icon.green { background: linear-gradient(135deg, rgba(16, 185, 129, 0.25), rgba(5, 150, 105, 0.1)); border-color: rgba(16, 185, 129, 0.35); color: #6ee7b7; }
.card-icon.purple { background: linear-gradient(135deg, rgba(139, 92, 246, 0.25), rgba(124, 58, 237, 0.1)); border-color: rgba(139, 92, 246, 0.35); color: #c4b5fd; }
.card-icon.amber { background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(217, 119, 6, 0.1)); border-color: rgba(245, 158, 11, 0.35); color: #fcd34d; }
.card-icon.cyan { background: linear-gradient(135deg, rgba(6, 182, 212, 0.25), rgba(14, 165, 233, 0.1)); border-color: rgba(6, 182, 212, 0.35); color: #67e8f9; }
.card-icon.rose { background: linear-gradient(135deg, rgba(244, 63, 94, 0.25), rgba(225, 29, 72, 0.1)); border-color: rgba(244, 63, 94, 0.35); color: #fda4af; }

.card-head h2, .card-head h3 {
  margin: 0;
  font-size: 16.5px;
  font-weight: 700;
  letter-spacing: -0.2px;
  display: flex;
  align-items: center;
  gap: 9px;
}
.card-head h2::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 16px;
  border-radius: 2px;
  background: var(--primary-gradient);
}
.card-head p { margin: 6px 0 0; font-size: 12.5px; color: var(--muted); }
.card-head.wrap { flex-wrap: wrap; align-items: center; }
.card-head.column { flex-direction: column; align-items: stretch; }

.muted { color: var(--muted); }
.small { font-size: 12px; }
.divider { height: 1px; background: rgba(120, 150, 240, 0.12); margin: 22px 0; }
.link { font-size: 12px; color: var(--primary-2); }
.link:hover { text-decoration: underline; }

/* ===== Stats Grid ===== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}
.stat-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.stat-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--primary-gradient);
  opacity: 0.8;
}
.stat-card.accent-green::before { background: linear-gradient(90deg, #10b981, #06b6d4); }
.stat-card.accent-blue::before { background: linear-gradient(90deg, #3b82f6, #6366f1); }
.stat-card.accent-purple::before { background: linear-gradient(90deg, #8b5cf6, #ec4899); }
.stat-card.accent-cyan::before { background: linear-gradient(90deg, #06b6d4, #3b82f6); }

.stat-card::after {
  content: "";
  position: absolute;
  top: 0; right: 0;
  width: 100px; height: 100px;
  background: radial-gradient(circle at top right, rgba(79, 124, 255, 0.15), transparent 70%);
  pointer-events: none;
}
.stat-card:hover {
  transform: translateY(-3px);
  border-color: rgba(79, 124, 255, 0.4);
  box-shadow: var(--shadow-lg), 0 0 24px -2px rgba(79, 124, 255, 0.2);
}
.stat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.stat-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--muted);
}
.stat-icon svg { width: 16px; height: 16px; }
.stat-card.accent-green .stat-icon { background: rgba(16, 185, 129, 0.15); border-color: rgba(16, 185, 129, 0.3); color: #6ee7b7; }
.stat-card.accent-blue .stat-icon { background: rgba(59, 130, 246, 0.15); border-color: rgba(59, 130, 246, 0.3); color: #93c5fd; }
.stat-card.accent-purple .stat-icon { background: rgba(139, 92, 246, 0.15); border-color: rgba(139, 92, 246, 0.3); color: #c4b5fd; }
.stat-card.accent-cyan .stat-icon { background: rgba(6, 182, 212, 0.15); border-color: rgba(6, 182, 212, 0.3); color: #67e8f9; }

.stat-value {
  font-size: 32px;
  font-weight: 900;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #ffffff 50%, #b9ceff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.15;
}
.stat-meta { color: var(--muted); font-size: 12px; word-break: break-all; }

/* ===== Badges & Tags ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  background: rgba(79, 124, 255, 0.15);
  color: #93c5fd;
  border: 1px solid rgba(79, 124, 255, 0.3);
}
.badge.green { background: rgba(16, 185, 129, 0.15); color: #6ee7b7; border-color: rgba(16, 185, 129, 0.35); }
.badge.red { background: rgba(244, 63, 94, 0.15); color: #fca5a5; border-color: rgba(244, 63, 94, 0.35); }
.badge.gray { background: rgba(148, 163, 184, 0.12); color: var(--muted); border-color: rgba(148, 163, 184, 0.2); }
.badge.orange { background: rgba(245, 158, 11, 0.15); color: #fcd34d; border-color: rgba(245, 158, 11, 0.35); }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }

/* ===== Buttons ===== */
.btn {
  appearance: none;
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  user-select: none;
}
.btn:hover {
  transform: translateY(-1.5px);
  filter: brightness(1.08);
}
.btn:active {
  transform: translateY(0.5px) scale(0.99);
}
.btn-primary {
  background: var(--primary-gradient);
  box-shadow: 0 4px 18px -2px rgba(79, 124, 255, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.18);
}
.btn-primary:hover {
  box-shadow: 0 8px 24px -2px rgba(79, 124, 255, 0.6), 0 0 16px rgba(6, 182, 212, 0.35);
}
.btn-success {
  background: linear-gradient(135deg, #059669, #10b981);
  box-shadow: 0 4px 16px -2px rgba(16, 185, 129, 0.4);
}
.btn-danger {
  background: linear-gradient(135deg, #e11d48, #f43f5e);
  box-shadow: 0 4px 16px -2px rgba(244, 63, 94, 0.4);
}
.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(148, 163, 184, 0.2);
  color: #e2e8f0;
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(148, 163, 184, 0.35);
  color: #fff;
}
.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--muted);
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  border-color: var(--border-hover);
}
.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 9px;
}
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; transform: none !important; filter: none !important; }

.row-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }

/* ===== Form Inputs & Controls ===== */
.input {
  width: 100%;
  padding: 10px 14px;
  background: rgba(9, 14, 28, 0.75);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.input:focus {
  border-color: var(--border-focus);
  background: rgba(12, 18, 36, 0.95);
  box-shadow: 0 0 0 3px rgba(79, 124, 255, 0.2), inset 0 1px 2px rgba(0, 0, 0, 0.2);
}
.input::placeholder { color: rgba(148, 163, 184, 0.45); }
.input.select { width: auto; min-width: 160px; cursor: pointer; }
.input.code, textarea.code { font-family: "JetBrains Mono", Consolas, "Courier New", monospace; font-size: 12.5px; }
textarea.input { resize: vertical; line-height: 1.6; }
.grow { flex: 1; }

.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.field > span { font-size: 12.5px; color: var(--text-soft); font-weight: 600; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; }

/* ===== Custom Fluid Toggle Switch (iOS / Raycast style) ===== */
.check {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-soft);
  margin: 6px 0 16px;
  cursor: pointer;
  user-select: none;
}
.check.inline { margin: 0 0 14px; }
.check input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 42px;
  height: 24px;
  background: rgba(51, 65, 85, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 999px;
  position: relative;
  cursor: pointer;
  outline: none;
  flex-shrink: 0;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.check input[type="checkbox"]::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #cbd5e1;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.35);
}
.check input[type="checkbox"]:hover {
  border-color: rgba(99, 102, 241, 0.45);
}
.check input[type="checkbox"]:checked {
  background: var(--primary-gradient);
  border-color: rgba(79, 124, 255, 0.6);
  box-shadow: 0 0 16px rgba(79, 124, 255, 0.45);
}
.check input[type="checkbox"]:checked::after {
  transform: translateX(18px);
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

/* ===== Webhook Banner Box ===== */
.webhook-banner {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 20px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(79, 124, 255, 0.12), rgba(6, 182, 212, 0.06));
  border: 1px solid rgba(79, 124, 255, 0.3);
  margin-bottom: 22px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}
.webhook-banner-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(79, 124, 255, 0.25), rgba(6, 182, 212, 0.15));
  border: 1px solid rgba(79, 124, 255, 0.4);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: #93c5fd;
  box-shadow: 0 4px 14px rgba(79, 124, 255, 0.25);
}
.webhook-banner-icon svg { width: 22px; height: 22px; }
.webhook-banner-content { flex: 1; min-width: 0; }
.webhook-banner-top { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.webhook-banner-top strong { font-size: 14.5px; color: #fff; font-weight: 700; }
.webhook-code-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(4, 8, 20, 0.85);
  border: 1px solid rgba(79, 124, 255, 0.35);
  padding: 8px 14px;
  border-radius: 9px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.webhook-code-box code {
  color: #67e8f9;
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 12.5px;
  word-break: break-all;
  flex: 1;
}

.copy-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-soft);
  font-size: 11.5px;
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
}
.copy-pill:hover {
  background: rgba(79, 124, 255, 0.2);
  border-color: rgba(79, 124, 255, 0.45);
  color: #fff;
  transform: translateY(-1px);
}
.copy-pill svg { width: 13px; height: 13px; }

.phone-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.28);
  color: #67e8f9;
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  margin: 2px;
  transition: all 0.18s ease;
  user-select: none;
}
.phone-chip:hover {
  background: rgba(6, 182, 212, 0.25);
  border-color: rgba(6, 182, 212, 0.55);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.35);
  transform: translateY(-1px);
}
.phone-chip svg { width: 12px; height: 12px; opacity: 0.8; }

.prompt-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.prompt-chip {
  appearance: none;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(120, 150, 240, 0.2);
  color: var(--text-soft);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.18s ease;
}
.prompt-chip:hover {
  background: rgba(79, 124, 255, 0.2);
  border-color: rgba(79, 124, 255, 0.45);
  color: #ffffff;
  transform: translateY(-1px);
}

.btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}


/* ===== Data Tables ===== */
.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}
.table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  text-align: left;
  padding: 12px 14px;
  color: var(--muted);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  background: rgba(14, 21, 42, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table tbody td {
  padding: 13px 14px;
  border-bottom: 1px solid rgba(120, 150, 240, 0.08);
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background 0.15s ease; }
.table tbody tr:hover td { background: rgba(79, 124, 255, 0.05); }
.table .right { text-align: right; }
.table .empty { text-align: center; color: var(--muted); padding: 36px 0; }
.cell-title { font-weight: 700; display: block; color: #f8fafc; }
.cell-sub { color: var(--muted); font-size: 11.5px; display: block; margin-top: 3px; }
.cell-clip { max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag-list { display: flex; flex-wrap: wrap; gap: 5px; }
.tag {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11.5px;
  color: var(--text-soft);
}

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  margin-right: 6px;
}
.dot.green { background: var(--success); box-shadow: 0 0 8px rgba(16, 185, 129, 0.6); }
.dot.gray { background: #64748b; }

/* ===== Alerts ===== */
.alert {
  padding: 13px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  border: 1px solid transparent;
  line-height: 1.5;
}
.alert-error {
  background: rgba(244, 63, 94, 0.12);
  border-color: rgba(244, 63, 94, 0.35);
  color: #fca5a5;
}
.alert-warning {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.35);
  color: #fcd34d;
}
.alert-success {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.35);
  color: #6ee7b7;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 20px;
}

/* ===== Modals ===== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal[hidden] { display: none; }
.modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(3, 7, 18, 0.78);
  backdrop-filter: blur(8px);
}
.modal-panel {
  position: relative;
  width: min(640px, 100%);
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  background: var(--bg-soft);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg), 0 0 36px rgba(79, 124, 255, 0.2);
  overflow: hidden;
  animation: modalIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-panel.wide { width: min(880px, 100%); }
@keyframes modalIn {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to { opacity: 1; transform: none; }
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}
.modal-head h2 { margin: 0; font-size: 17px; font-weight: 700; }
.modal-body { padding: 22px; overflow-y: auto; }
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}
.icon-btn {
  appearance: none;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 8px;
  transition: all 0.15s;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.08); color: var(--text); }

.inline-row { display: grid; grid-template-columns: 1.1fr 1.4fr 1.4fr auto; gap: 10px; align-items: center; }

/* ===== Sticky Save Action Bar ===== */
.sticky-actions {
  position: sticky;
  bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  z-index: 25;
  padding: 14px 24px;
  border-radius: 16px;
  background: rgba(14, 21, 42, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(79, 124, 255, 0.35);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7), 0 0 24px rgba(79, 124, 255, 0.2);
}

/* ===== Toast Floating Pill ===== */
.toast {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 22px;
  border-radius: 14px;
  background: rgba(14, 21, 42, 0.96);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 20px 45px -8px rgba(0, 0, 0, 0.75), 0 0 24px rgba(79, 124, 255, 0.25);
  font-size: 13.5px;
  font-weight: 600;
  color: #ffffff;
  animation: toastSlideIn 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes toastSlideIn {
  from { opacity: 0; transform: translateY(18px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.toast.success {
  border-color: rgba(16, 185, 129, 0.45);
  color: #6ee7b7;
  box-shadow: 0 20px 45px -8px rgba(0, 0, 0, 0.75), 0 0 24px rgba(16, 185, 129, 0.25);
}
.toast.error {
  border-color: rgba(244, 63, 94, 0.45);
  color: #fca5a5;
  box-shadow: 0 20px 45px -8px rgba(0, 0, 0, 0.75), 0 0 24px rgba(244, 63, 94, 0.25);
}

/* ===== Login View ===== */
.auth-body { display: grid; place-items: center; min-height: 100vh; padding: 24px; }
.auth-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(700px 400px at 20% 20%, rgba(79, 124, 255, 0.22), transparent 70%),
    radial-gradient(600px 350px at 80% 80%, rgba(6, 182, 212, 0.18), transparent 65%);
}
.auth-card {
  position: relative;
  width: min(440px, 100%);
  background: rgba(15, 23, 46, 0.88);
  border: 1px solid var(--border-hover);
  border-radius: 22px;
  box-shadow: var(--shadow-lg), 0 0 40px rgba(79, 124, 255, 0.2);
  padding: 34px;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}
.auth-brand { display: flex; align-items: center; gap: 16px; margin-bottom: 26px; }
.auth-brand h1 { margin: 0; font-size: 19px; font-weight: 800; letter-spacing: -0.3px; }
.auth-brand p { margin: 4px 0 0; color: var(--muted); font-size: 12.5px; }
.auth-card .btn-block { margin-top: 10px; padding: 12px; font-size: 14px; }
.auth-tip {
  margin-top: 22px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}
.auth-tip code { color: #93c5fd; background: rgba(79, 124, 255, 0.15); padding: 2px 6px; border-radius: 4px; }

/* ===== Live Chat Workbench ===== */
.chat-layout {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 20px;
  align-items: stretch;
  min-height: 72vh;
}
.chat-sidebar { display: flex; flex-direction: column; padding: 18px; }
.session-list { display: flex; flex-direction: column; gap: 7px; overflow-y: auto; max-height: 70vh; }
.session-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 13px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}
.session-item:hover {
  background: rgba(255, 255, 255, 0.04);
  transform: translateX(2px);
}
.session-item.active {
  background: linear-gradient(90deg, rgba(79, 124, 255, 0.18), rgba(6, 182, 212, 0.06));
  border-color: rgba(79, 124, 255, 0.4);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}
.session-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.8);
  color: #93c5fd;
  border: 2px solid rgba(147, 197, 253, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  position: relative;
}
.session-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.session-avatar-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}
.chat-head .session-avatar {
  width: 44px;
  height: 44px;
  font-size: 16px;
}
.session-info { flex: 1; min-width: 0; }
.session-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.session-top strong { font-size: 13.5px; font-weight: 700; color: #f8fafc; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.session-sub {
  color: var(--muted);
  font-size: 11.5px;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.session-meta { display: flex; align-items: center; gap: 7px; margin-top: 6px; }

.sound-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
}
.sound-toggle-btn svg { width: 14px; height: 14px; }
.sound-toggle-btn:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.sound-toggle-btn.active {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.35);
  color: #6ee7b7;
}
.unread {
  min-width: 19px;
  height: 19px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 10.5px;
  font-weight: 800;
  display: grid;
  place-items: center;
  box-shadow: 0 0 10px rgba(244, 63, 94, 0.5);
}

.chat-main { display: flex; flex-direction: column; padding: 18px; min-height: 72vh; }
.empty { color: var(--muted); text-align: center; padding: 28px; }
.chat-window { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.chat-window[hidden],
.chat-window.hidden,
div#chatWindow[hidden],
div#chatWindow.hidden {
  display: none !important;
}
.chat-empty[hidden],
.chat-empty.hidden,
div#chatEmpty[hidden],
div#chatEmpty.hidden {
  display: none !important;
}
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.chat-banner {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 11px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fcd34d;
  font-size: 12.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.chat-stream {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 6px;
  min-height: 340px;
  max-height: 54vh;
}
.bubble {
  max-width: 76%;
  padding: 10px 15px;
  border-radius: 15px;
  font-size: 13.5px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  position: relative;
}
.bubble.in {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-bottom-left-radius: 3px;
}
.bubble.out {
  align-self: flex-end;
  background: linear-gradient(135deg, rgba(79, 124, 255, 0.32), rgba(99, 102, 241, 0.18));
  border: 1px solid rgba(79, 124, 255, 0.35);
  border-bottom-right-radius: 3px;
  box-shadow: 0 4px 16px rgba(79, 124, 255, 0.15);
}
.bubble-meta { font-size: 10.5px; color: var(--muted); margin-top: 6px; }

/* Telegram HTML Formatting within chat bubbles and simulator */
.bubble strong,
.tg-msg strong {
  font-weight: 700;
  color: #ffffff;
}
.bubble u,
.tg-msg u {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.bubble del,
.tg-msg del {
  text-decoration: line-through;
  opacity: 0.75;
}
.bubble em,
.tg-msg em {
  font-style: italic;
  color: #cbd5e1;
}
.bubble code.tg-code,
.tg-msg code.tg-code,
.bubble code,
.tg-msg code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12.5px;
  background: rgba(14, 165, 233, 0.16);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #7dd3fc;
  padding: 2px 7px;
  border-radius: 6px;
  display: inline-block;
  margin: 1px 2px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: all;
}
.bubble code.tg-code:hover,
.tg-msg code.tg-code:hover,
.bubble code:hover,
.tg-msg code:hover {
  background: rgba(14, 165, 233, 0.28);
  border-color: rgba(56, 189, 248, 0.6);
  color: #ffffff;
  transform: translateY(-1px);
}
.bubble pre.tg-pre,
.tg-msg pre.tg-pre,
.bubble pre,
.tg-msg pre {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 10px 14px;
  margin: 6px 0;
  font-family: monospace;
  font-size: 12px;
  overflow-x: auto;
  white-space: pre-wrap;
  color: #e2e8f0;
}
.bubble blockquote.tg-quote,
.tg-msg blockquote.tg-quote,
.bubble blockquote,
.tg-msg blockquote {
  margin: 8px 0;
  padding: 4px 0 4px 12px;
  border-left: 3px solid rgba(79, 124, 255, 0.75);
  color: #cbd5e1;
  background: rgba(79, 124, 255, 0.08);
  border-radius: 0 6px 6px 0;
}
.bubble a.tg-link,
.tg-msg a.tg-link,
.bubble a,
.tg-msg a {
  color: #38bdf8;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 500;
  transition: color 0.15s;
}
.bubble a.tg-link:hover,
.tg-msg a.tg-link:hover,
.bubble a:hover,
.tg-msg a:hover {
  color: #7dd3fc;
}

.chat-composer {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}
.chat-composer textarea { flex: 1; }

.chat-upload-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.18s ease;
  flex-shrink: 0;
  margin-bottom: 2px;
}
.chat-upload-btn:hover {
  background: rgba(79, 124, 255, 0.2);
  border-color: rgba(79, 124, 255, 0.45);
  color: #ffffff;
}
.chat-upload-btn svg {
  width: 18px;
  height: 18px;
}

/* Chat Media & File Cards */
.chat-media-wrap {
  margin-top: 4px;
  margin-bottom: 4px;
  border-radius: 10px;
  overflow: hidden;
  max-width: 320px;
}
.chat-media-img {
  max-width: 100%;
  max-height: 280px;
  display: block;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.2s ease;
}
.chat-media-img:hover {
  transform: scale(1.02);
}
.chat-media-video {
  max-width: 100%;
  max-height: 280px;
  border-radius: 8px;
  display: block;
  background: #000;
}
.chat-media-audio {
  width: 260px;
  height: 38px;
  margin-top: 4px;
  display: block;
}
.chat-sticker-img {
  max-width: 120px;
  max-height: 120px;
  display: block;
}
.chat-media-caption {
  margin-top: 6px;
  font-size: 13px;
  color: #e2e8f0;
  line-height: 1.5;
}
.chat-file-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  margin: 4px 0;
  min-width: 220px;
  max-width: 340px;
}
.chat-file-icon {
  font-size: 24px;
  flex-shrink: 0;
}
.chat-file-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}
.chat-file-name {
  color: #38bdf8;
  font-weight: 600;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-decoration: none;
}
.chat-file-name:hover {
  text-decoration: underline;
  color: #7dd3fc;
}
.chat-file-size {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.quick-phrases {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 6px 0 10px;
  border-top: 1px solid var(--border);
}
.quick-phrase-pill {
  appearance: none;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text-soft);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.18s ease;
}
.quick-phrase-pill:hover {
  background: rgba(79, 124, 255, 0.18);
  border-color: rgba(79, 124, 255, 0.45);
  color: #ffffff;
  transform: translateY(-1px);
}

.tab-btn {
  appearance: none;
  cursor: pointer;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.18s ease;
}
.tab-btn:hover { color: #fff; border-color: var(--border-hover); }
.tab-btn.active {
  background: rgba(79, 124, 255, 0.2);
  border-color: rgba(79, 124, 255, 0.45);
  color: #fff;
  box-shadow: 0 0 12px rgba(79, 124, 255, 0.25);
}

/* ===== Simulator ===== */
.sim-layout {
  display: grid;
  grid-template-columns: minmax(0, 420px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.diag {
  margin-top: 18px;
  padding: 14px;
  border-radius: 12px;
  background: rgba(8, 13, 28, 0.7);
  border: 1px solid var(--border);
  font-size: 12.5px;
  line-height: 1.85;
  color: var(--muted);
}
.diag strong { color: #f1f5f9; }
.sim-preview {
  min-height: 460px;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, rgba(14, 22, 44, 0.96), rgba(8, 12, 26, 0.98));
}
.tg-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.tg-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  background: linear-gradient(135deg, #229ed9, #22d3ee);
  color: #06283d;
  box-shadow: 0 4px 14px rgba(34, 158, 217, 0.4);
}
.tg-stream {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 4px;
  overflow-y: auto;
  max-height: 60vh;
}
.tg-msg {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  white-space: pre-wrap;
  font-size: 13.5px;
  line-height: 1.6;
  transition: transform 0.16s ease;
}
.tg-msg:hover { transform: translateY(-1px); }
.tg-msg.out {
  align-self: flex-end;
  background: rgba(34, 158, 217, 0.2);
  border-color: rgba(34, 158, 217, 0.4);
}
.tg-btns { display: flex; flex-direction: column; gap: 7px; margin-top: 10px; }
.tg-btn {
  padding: 6px 12px;
  border-radius: 9px;
  background: rgba(79, 124, 255, 0.18);
  border: 1px solid rgba(79, 124, 255, 0.35);
  font-size: 12.5px;
  color: #cfe0ff;
  text-align: center;
  font-weight: 600;
}
.tg-media { margin-top: 10px; font-size: 12.5px; color: var(--muted); }

/* ===== Help Guide Modal & Cards ===== */
.help-guide-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  padding: 0 0 12px;
  margin-bottom: 18px;
  overflow-x: auto;
}
.help-tab-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text-soft);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}
.help-tab-btn:hover {
  background: rgba(79, 124, 255, 0.15);
  color: #fff;
}
.help-tab-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 4px 14px rgba(79, 124, 255, 0.35);
}
.help-section { display: none; }
.help-section.active { display: block; animation: fadeIn 0.25s ease; }

.guide-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.guide-card {
  background: rgba(18, 24, 48, 0.7);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  transition: all 0.22s ease;
}
.guide-card:hover {
  border-color: rgba(79, 124, 255, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}
.guide-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.guide-card-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  background: rgba(79, 124, 255, 0.15);
  color: #79a1ff;
}
.guide-card h3 {
  font-size: 15px;
  margin: 0;
  color: #fff;
}
.guide-card p {
  font-size: 13px;
  color: var(--text-soft);
  line-height: 1.6;
  margin: 0 0 10px;
}
.guide-card-tip {
  font-size: 12px;
  background: rgba(255, 255, 255, 0.04);
  border-left: 3px solid var(--primary);
  padding: 6px 10px;
  border-radius: 4px;
  color: var(--muted);
}
.field-hint {
  display: block;
  font-size: 11.5px;
  color: #7c8ba1;
  margin-top: 5px;
  line-height: 1.45;
}


/* ===== Responsive Breakpoints ===== */
@media (max-width: 1180px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: 1fr; }
  .chat-layout { grid-template-columns: 300px minmax(0, 1fr); }
  .sim-layout { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .app-shell { flex-direction: column; }
  .sidebar {
    width: 100%;
    flex: none;
    height: auto;
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    padding: 14px 18px;
    gap: 12px;
  }
  .brand-text span { display: none; }
  .nav { flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .sidebar-footer { border: none; padding: 0; }
  .content, .topbar { padding-left: 18px; padding-right: 18px; }
  .stat-grid { grid-template-columns: 1fr; }
  .form-grid, .form-grid.three { grid-template-columns: 1fr; }
  .chat-layout { grid-template-columns: 1fr; }
  .inline-row { grid-template-columns: 1fr; }
  .sticky-actions { left: 16px; right: 16px; bottom: 16px; }
}
