/* ===== CSS Variables & Reset ===== */
:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: #1a1a2e;
  --bg-card-hover: #22223a;
  --bg-input: #16162a;
  --text-primary: #e8e8f0;
  --text-secondary: #9090a8;
  --text-muted: #606078;
  --accent: #7c5cfc;
  --accent-hover: #9478ff;
  --accent-glow: rgba(124, 92, 252, 0.3);
  --accent-subtle: rgba(124, 92, 252, 0.1);
  --success: #34d399;
  --warning: #fbbf24;
  --error: #f87171;
  --border: #2a2a3e;
  --border-light: #3a3a52;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.6);
  --transition: 0.2s ease;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--accent-hover);
}

img {
  max-width: 100%;
  display: block;
}

/* ===== Typography ===== */
h1, h2, h3, h4 {
  font-weight: 600;
  line-height: 1.2;
}

h1 { font-size: 3rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.125rem; }

/* ===== Layout ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 80px 0;
}

/* ===== Navigation ===== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-logo .logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--accent), #a78bfa);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text-primary);
}

.nav-cta {
  background: var(--accent);
  color: white !important;
  padding: 8px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.875rem;
  transition: background var(--transition), box-shadow var(--transition);
}

.nav-cta:hover {
  background: var(--accent-hover);
  box-shadow: 0 0 20px var(--accent-glow);
}

/* Mobile menu */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
}

@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 16px 24px;
    gap: 16px;
  }
  .nav-links.open { display: flex; }
}

/* ===== Hero ===== */
.hero {
  padding: 140px 0 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 600px;
  background: radial-gradient(ellipse, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: var(--accent-subtle);
  border: 1px solid rgba(124, 92, 252, 0.2);
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent-hover);
  margin-bottom: 24px;
}

.hero-badge .dot {
  width: 6px;
  height: 6px;
  background: var(--success);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  margin-bottom: 20px;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero h1 span {
  background: linear-gradient(135deg, var(--accent), #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.2rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 40px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  font-family: var(--font);
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: white;
}

.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 0 30px var(--accent-glow);
  color: white;
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-light);
  color: var(--text-primary);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.85rem;
}

/* ===== Feature Cards ===== */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  transition: all var(--transition);
}

.feature-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.feature-icon {
  width: 48px;
  height: 48px;
  background: var(--accent-subtle);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 16px;
}

.feature-card h3 {
  margin-bottom: 8px;
}

.feature-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* ===== Agent Version Cards ===== */
.agents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.agent-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: all var(--transition);
  cursor: pointer;
}

.agent-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
}

.agent-card.active {
  border-color: var(--accent);
  background: var(--accent-subtle);
}

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

.agent-version {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 100px;
  background: var(--accent-subtle);
  color: var(--accent-hover);
}

.agent-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

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

.agent-status .status-dot.online { background: var(--success); }
.agent-status .status-dot.offline { background: var(--text-muted); }
.agent-status .status-dot.beta { background: var(--warning); }

.agent-card h4 {
  margin-bottom: 8px;
}

.agent-card p {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 16px;
}

.agent-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.agent-tag {
  font-size: 0.7rem;
  padding: 3px 8px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-muted);
}

/* ===== Chat Widget ===== */
.chat-container {
  max-width: 800px;
  margin: 0 auto;
  height: calc(100vh - 180px);
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}

.chat-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-avatar {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent), #a78bfa);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  color: white;
}

.chat-agent-info h4 {
  font-size: 0.95rem;
  margin-bottom: 2px;
}

.chat-agent-info span {
  font-size: 0.75rem;
  color: var(--success);
}

.chat-header-right {
  display: flex;
  gap: 8px;
}

.chat-header-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  cursor: pointer;
  font-family: var(--font);
  transition: all var(--transition);
}

.chat-header-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-light);
  color: var(--text-primary);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chat-message {
  display: flex;
  gap: 12px;
  max-width: 85%;
  animation: messageIn 0.3s ease;
}

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

.chat-message.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  flex-shrink: 0;
}

.chat-message.assistant .msg-avatar {
  background: linear-gradient(135deg, var(--accent), #a78bfa);
  color: white;
}

.chat-message.user .msg-avatar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.msg-bubble {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 0.925rem;
  line-height: 1.5;
}

.chat-message.assistant .msg-bubble {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
}

.chat-message.user .msg-bubble {
  background: var(--accent);
  color: white;
}

.msg-bubble code {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 6px;
  border-radius: 4px;
}

.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 4px 0;
}

.typing-indicator span {
  width: 6px;
  height: 6px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-4px); }
}

.tool-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
  padding: 2px 0;
}

.tool-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--accent, #3b82f6);
  border-radius: 50%;
  animation: tool-spin 0.8s linear infinite;
  flex-shrink: 0;
}

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

.chat-input-area {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--bg-card);
}

.chat-input-wrapper {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.chat-input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.925rem;
  resize: none;
  outline: none;
  transition: border-color var(--transition);
  min-height: 44px;
  max-height: 120px;
}

.chat-input:focus {
  border-color: var(--accent);
}

.chat-input::placeholder {
  color: var(--text-muted);
}

.chat-send {
  background: var(--accent);
  color: white;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all var(--transition);
  flex-shrink: 0;
}

.chat-send:hover {
  background: var(--accent-hover);
  box-shadow: 0 0 20px var(--accent-glow);
}

.chat-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ===== Playground ===== */
.playground-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
  min-height: calc(100vh - 180px);
}

@media (max-width: 960px) {
  .playground-layout {
    grid-template-columns: 1fr;
  }
}

.playground-sidebar {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  overflow-y: auto;
}

.playground-sidebar h3 {
  margin-bottom: 20px;
  font-size: 1.1rem;
}

.config-group {
  margin-bottom: 24px;
}

.config-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.config-select,
.config-input,
.config-textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition);
}

.config-select:focus,
.config-input:focus,
.config-textarea:focus {
  border-color: var(--accent);
}

.config-textarea {
  resize: vertical;
  min-height: 80px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.config-range {
  width: 100%;
  -webkit-appearance: none;
  background: var(--border);
  height: 4px;
  border-radius: 2px;
  outline: none;
}

.config-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
}

.range-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.playground-main {
  display: flex;
  flex-direction: column;
}

.playground-preview {
  flex: 1;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ===== Code Block ===== */
.code-block {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin: 16px 0;
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.code-copy {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.75rem;
  font-family: var(--font);
  transition: color var(--transition);
}

.code-copy:hover {
  color: var(--text-primary);
}

.code-content {
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.6;
  overflow-x: auto;
  color: var(--text-secondary);
}

/* ===== Section Headers ===== */
.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-header h2 {
  margin-bottom: 12px;
}

.section-header p {
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

/* ===== Stats ===== */
.stats-row {
  display: flex;
  justify-content: center;
  gap: 48px;
  flex-wrap: wrap;
  padding: 40px 0;
}

.stat-item {
  text-align: center;
}

.stat-value {
  font-size: 2.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ===== Footer ===== */
.footer {
  padding: 40px 0;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 16px;
  list-style: none;
}

.footer-links a {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* ===== Annie Status Showcase (top of page) ===== */
.status-showcase-bar {
  padding: 90px 0 0;
}

.status-showcase {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  position: relative;
  overflow: hidden;
}

.status-showcase::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(124, 92, 252, 0.12), transparent 60%);
  pointer-events: none;
}

.status-showcase-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  position: relative;
}

.status-showcase a {
  display: inline-block;
  line-height: 0;
  position: relative;
  transition: transform var(--transition);
}

.status-showcase a:hover {
  transform: scale(1.03);
}

.status-showcase img {
  max-height: 38px;
  vertical-align: middle;
}

/* Reduce the top padding of the next section so the showcase sits cleanly
   under the fixed nav without excessive whitespace. */
.status-showcase-bar + .hero {
  padding-top: 40px;
}

.status-showcase-bar + .page-header {
  padding-top: 24px;
}

/* ===== Utility ===== */
.text-gradient {
  background: linear-gradient(135deg, var(--accent), #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-8 { margin-top: 32px; }
.mb-4 { margin-bottom: 16px; }

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-light);
}

/* ===== Page Header (for subpages) ===== */
.page-header {
  padding: 100px 0 40px;
  text-align: center;
}

.page-header h1 {
  font-size: 2.5rem;
  margin-bottom: 12px;
}

.page-header p {
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

/* ===== API Status Banner ===== */
.api-banner {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  margin-bottom: 24px;
}

.api-banner-left {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-secondary);
}

.api-banner code {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  background: var(--bg-primary);
  padding: 2px 8px;
  border-radius: 4px;
  color: var(--text-muted);
}

/* ===== Support Module ===== */

.support-container {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 24px 60px;
  width: 100%;
}

.support-view {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.support-view h3 {
  font-size: 0.95rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.tickets-section {
  width: 100%;
}

/* Admin-specific layout (two panels) */
.support-admin-layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 24px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px 60px;
  min-height: 70vh;
}

.support-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.support-sidebar h3 {
  font-size: 0.95rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

/* Ticket form */
.ticket-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.ticket-form .form-group {
  margin-bottom: 14px;
}

.ticket-form label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-weight: 500;
}

.ticket-form input,
.ticket-form select,
.ticket-form textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.85rem;
  transition: border-color var(--transition);
}

.ticket-form input:focus,
.ticket-form select:focus,
.ticket-form textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.ticket-form textarea {
  resize: vertical;
  min-height: 80px;
}

.ticket-form .btn {
  width: 100%;
  margin-top: 4px;
}

/* Ticket list */
.ticket-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 500px;
  overflow-y: auto;
}

.ticket-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  cursor: pointer;
  transition: all var(--transition);
}

.ticket-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-light);
}

.ticket-card.active {
  border-color: var(--accent);
  background: var(--bg-card-hover);
}

.ticket-card.needs-human {
  border-left: 3px solid var(--warning);
  animation: pulse-border 2s ease-in-out infinite;
}

@keyframes pulse-border {
  0%, 100% { border-left-color: var(--warning); }
  50% { border-left-color: rgba(251, 191, 36, 0.4); }
}

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

.ticket-card-id {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 500;
}

.ticket-card-subject {
  font-size: 0.85rem;
  color: var(--text-primary);
  font-weight: 500;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ticket-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.ticket-empty {
  text-align: center;
  padding: 24px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Status badges */
.status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.status-badge.open { background: rgba(96, 165, 250, 0.15); color: #60a5fa; }
.status-badge.needs-human { background: rgba(251, 191, 36, 0.15); color: #fbbf24; }
.status-badge.in-progress { background: rgba(124, 92, 252, 0.15); color: #7c5cfc; }
.status-badge.resolved { background: rgba(52, 211, 153, 0.15); color: #34d399; }
.status-badge.closed { background: rgba(96, 96, 120, 0.15); color: #606078; }

/* Priority badges */
.priority-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.priority-badge.low { background: rgba(96, 96, 120, 0.15); color: #9090a8; }
.priority-badge.medium { background: rgba(96, 165, 250, 0.15); color: #60a5fa; }
.priority-badge.high { background: rgba(251, 146, 60, 0.15); color: #fb923c; }
.priority-badge.critical { background: rgba(248, 113, 113, 0.15); color: #f87171; }

/* Support chat messages */
.chat-message.admin .msg-avatar {
  background: rgba(52, 211, 153, 0.15);
  color: var(--success);
}

.chat-message.admin .msg-bubble {
  border-left: 3px solid var(--success);
}

.chat-message.system {
  justify-content: center;
  padding: 8px 0;
}

.chat-message.system .msg-bubble {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.8rem;
  text-align: center;
  max-width: 100%;
}

/* Ticket detail / admin meta bar */
.ticket-meta-bar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.ticket-meta-bar .meta-group {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.ticket-meta-bar select {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 8px;
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.8rem;
}

.ticket-meta-bar select:focus {
  outline: none;
  border-color: var(--accent);
}

.ticket-meta-bar .ticket-id-display {
  font-family: var(--font-mono);
  color: var(--accent);
  font-weight: 600;
  font-size: 0.85rem;
}

.ticket-meta-bar .meta-spacer {
  flex: 1;
}

/* Admin response area */
.admin-response-area {
  border-top: 1px solid var(--border);
  padding: 16px 0 0;
  margin-top: 16px;
}

.admin-response-area textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.85rem;
  resize: vertical;
  min-height: 80px;
  margin-bottom: 8px;
}

.admin-response-area textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.admin-response-area .btn {
  float: right;
}

/* Support chat panel */
.support-chat-panel {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-height: 560px;
  max-height: 75vh;
  width: 100%;
}

.support-chat-panel .chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.support-chat-panel .chat-input-area {
  border-top: 1px solid var(--border);
  padding: 16px 20px;
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.support-chat-panel .chat-input-area textarea {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.85rem;
  resize: none;
  max-height: 120px;
}

.support-chat-panel .chat-input-area textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.support-chat-panel .chat-input-area textarea:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.support-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 400px;
  color: var(--text-muted);
  text-align: center;
  padding: 40px;
}

.support-welcome h2 {
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.support-welcome p {
  font-size: 0.85rem;
  max-width: 300px;
}

/* Admin panel no-selection */
.admin-no-selection {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 500px;
  color: var(--text-muted);
  text-align: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
}

.admin-no-selection h2 {
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

/* Responsive support */
@media (max-width: 768px) {
  .support-admin-layout {
    grid-template-columns: 1fr;
  }
  .support-container {
    padding: 0 16px 40px;
  }
}
