/* ThreatReact Command Center — Styles */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #111118;
  --bg-card: #16161f;
  --bg-hover: #1a1a25;
  --bg-input: #0e0e15;
  --border: #1e1e2e;
  --border-light: #2a2a3e;
  --text-primary: #e8e8ed;
  --text-secondary: #8888a0;
  --text-muted: #55556a;
  --accent-red: #ef4444;
  --accent-red-dim: #dc2626;
  --accent-amber: #f59e0b;
  --accent-green: #22c55e;
  --accent-cyan: #06b6d4;
  --accent-purple: #a855f7;
  --accent-red-glow: rgba(239, 68, 68, 0.15);
  --accent-amber-glow: rgba(245, 158, 11, 0.1);
  --accent-green-glow: rgba(34, 197, 94, 0.1);
}

body {
  font-family: 'Space Grotesk', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

.mono { font-family: 'JetBrains Mono', monospace; }

/* ====== AUTH SCREENS ====== */
.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  position: relative;
}

.auth-container::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image:
    linear-gradient(rgba(30, 30, 46, 0.3) 1px, transparent 1px),
    linear-gradient(90deg, rgba(30, 30, 46, 0.3) 1px, transparent 1px);
  background-size: 60px 60px;
  z-index: 0;
  pointer-events: none;
}

.auth-container::after {
  content: '';
  position: fixed;
  top: 10%;
  right: 10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--accent-red-glow) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

.auth-box {
  position: relative;
  z-index: 1;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 3rem;
  width: 100%;
  max-width: 440px;
}

.auth-logo {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.auth-logo .dot {
  width: 10px;
  height: 10px;
  background: var(--accent-red);
  border-radius: 50%;
  animation: pulse-auth 2s ease-in-out infinite;
}

@keyframes pulse-auth {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
}

.auth-subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

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

.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

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

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

.form-group select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%238888a0' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0.75rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  color: var(--text-primary);
  background: var(--bg-card);
}

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

.btn-primary {
  background: var(--accent-red);
  border-color: var(--accent-red);
  color: #fff;
  width: 100%;
}

.btn-primary:hover { background: var(--accent-red-dim); }

.btn-sm { padding: 0.5rem 1rem; font-size: 0.8rem; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--bg-card); }

.btn-green { background: rgba(34, 197, 94, 0.15); border-color: rgba(34, 197, 94, 0.3); color: var(--accent-green); }
.btn-green:hover { background: rgba(34, 197, 94, 0.25); }
.btn-amber { background: rgba(245, 158, 11, 0.15); border-color: rgba(245, 158, 11, 0.3); color: var(--accent-amber); }
.btn-amber:hover { background: rgba(245, 158, 11, 0.25); }
.btn-cyan { background: rgba(6, 182, 212, 0.15); border-color: rgba(6, 182, 212, 0.3); color: var(--accent-cyan); }
.btn-cyan:hover { background: rgba(6, 182, 212, 0.25); }
.btn-danger { background: rgba(239, 68, 68, 0.15); border-color: rgba(239, 68, 68, 0.3); color: var(--accent-red); }
.btn-danger:hover { background: rgba(239, 68, 68, 0.25); }

.auth-toggle {
  text-align: center;
  margin-top: 1.5rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.auth-toggle a {
  color: var(--accent-red);
  cursor: pointer;
  text-decoration: none;
}

.auth-toggle a:hover { text-decoration: underline; }

.auth-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  color: #f87171;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

/* ====== APP LAYOUT ====== */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 240px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
}

.sidebar-logo {
  padding: 1.5rem;
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo .dot {
  width: 8px;
  height: 8px;
  background: var(--accent-red);
  border-radius: 50%;
  animation: pulse-auth 2s ease-in-out infinite;
}

.sidebar-nav {
  flex: 1;
  padding: 1rem 0;
  overflow-y: auto;
}

.nav-section {
  padding: 0 0.75rem;
  margin-bottom: 0.5rem;
}

.nav-section-title {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  padding: 0.5rem 0.75rem;
  margin-top: 0.5rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.88rem;
  transition: all 0.15s;
  text-decoration: none;
}

.nav-item:hover { background: var(--bg-card); color: var(--text-primary); }
.nav-item.active { background: var(--accent-red-glow); color: var(--accent-red); }

.nav-icon { font-size: 1.1rem; width: 22px; text-align: center; }

.sidebar-user {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
}

.sidebar-user-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-user-name {
  font-size: 0.85rem;
  font-weight: 500;
}

.sidebar-user-role {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sidebar-logout {
  font-size: 0.8rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: color 0.15s;
}

.sidebar-logout:hover { color: var(--accent-red); }

/* Main content */
.main-content {
  flex: 1;
  margin-left: 240px;
  min-height: 100vh;
}

.page-header {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-secondary);
  position: sticky;
  top: 0;
  z-index: 50;
}

.page-title {
  font-size: 1.3rem;
  font-weight: 600;
}

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

.page-body {
  padding: 2rem;
}

/* ====== STAT CARDS ====== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
}

.stat-card-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.stat-card-value {
  font-size: 2rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
}

.stat-critical .stat-card-value { color: var(--accent-red); }
.stat-high .stat-card-value { color: var(--accent-amber); }
.stat-medium .stat-card-value { color: var(--accent-cyan); }
.stat-low .stat-card-value { color: var(--accent-green); }
.stat-active .stat-card-value { color: var(--text-primary); }
.stat-resolved .stat-card-value { color: var(--text-secondary); }

/* ====== TABLE ====== */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  text-align: left;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  font-weight: 500;
}

.data-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.data-table tr { cursor: pointer; transition: background 0.1s; }
.data-table tbody tr:hover { background: var(--bg-hover); }

.data-table .incident-title-cell {
  color: var(--text-primary);
  font-weight: 500;
}

/* ====== BADGES ====== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: 'JetBrains Mono', monospace;
}

.badge-critical { background: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }
.badge-high { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-medium { background: rgba(6, 182, 212, 0.15); color: #22d3ee; border: 1px solid rgba(6, 182, 212, 0.3); }
.badge-low { background: rgba(34, 197, 94, 0.15); color: #4ade80; border: 1px solid rgba(34, 197, 94, 0.3); }

.badge-open { background: rgba(239, 68, 68, 0.1); color: #f87171; }
.badge-investigating { background: rgba(245, 158, 11, 0.1); color: #fbbf24; }
.badge-contained { background: rgba(6, 182, 212, 0.1); color: #22d3ee; }
.badge-resolved { background: rgba(34, 197, 94, 0.1); color: #4ade80; }
.badge-closed { background: rgba(136, 136, 160, 0.1); color: var(--text-secondary); }

.badge-admin { background: rgba(168, 85, 247, 0.15); color: #c084fc; }
.badge-team_lead { background: rgba(6, 182, 212, 0.15); color: #22d3ee; }
.badge-responder { background: rgba(136, 136, 160, 0.1); color: var(--text-secondary); }

/* ====== INCIDENT DETAIL ====== */
.incident-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.incident-meta {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.incident-meta-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.incident-meta-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.incident-meta-value {
  font-size: 0.9rem;
  color: var(--text-primary);
}

.incident-description {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
  white-space: pre-wrap;
}

/* Playbook Steps */
.playbook-section {
  margin-bottom: 2rem;
}

.section-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-red);
  margin-bottom: 1rem;
}

.playbook-steps {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.playbook-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.step-number {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-red-glow);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-red);
  flex-shrink: 0;
  font-family: 'JetBrains Mono', monospace;
}

.step-content { flex: 1; }
.step-title { font-size: 0.9rem; font-weight: 500; margin-bottom: 4px; }
.step-desc { font-size: 0.8rem; color: var(--text-secondary); line-height: 1.5; }
.step-role { font-size: 0.7rem; color: var(--text-muted); margin-top: 4px; font-family: 'JetBrains Mono', monospace; }

/* ====== THREAD & MESSAGES ====== */
.threads-container {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  height: 500px;
}

.thread-list {
  border-right: 1px solid var(--border);
  overflow-y: auto;
}

.thread-list-header {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.thread-list-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.thread-item {
  padding: 0.75rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}

.thread-item:hover { background: var(--bg-hover); }
.thread-item.active { background: var(--accent-red-glow); border-left: 2px solid var(--accent-red); }

.thread-item-title {
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 2px;
}

.thread-item-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.message-panel {
  display: flex;
  flex-direction: column;
}

.message-panel-header {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  font-weight: 500;
}

.message-list {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.message {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  flex-shrink: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.message-body { flex: 1; min-width: 0; }

.message-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.message-author {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
}

.message-time {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

.message-role-badge {
  font-size: 0.6rem;
  padding: 1px 6px;
  border-radius: 4px;
}

.message-content {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
  word-break: break-word;
}

.message-content strong { color: var(--text-primary); }

.message.system-message .message-content {
  color: var(--accent-cyan);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
}

.message.status-message .message-content {
  color: var(--accent-amber);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
}

.message.escalation-message .message-content {
  color: var(--accent-red);
  font-weight: 500;
}

.message-input-area {
  border-top: 1px solid var(--border);
  padding: 1rem;
  display: flex;
  gap: 8px;
}

.message-input-area input {
  flex: 1;
  padding: 0.65rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.9rem;
  outline: none;
}

.message-input-area input:focus { border-color: var(--accent-red); }

/* ====== ACTIVITY TIMELINE ====== */
.activity-list {
  display: flex;
  flex-direction: column;
}

.activity-item {
  display: flex;
  gap: 12px;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
}

.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
}

.activity-dot.created { background: var(--accent-red); }
.activity-dot.updated { background: var(--accent-amber); }
.activity-dot.login { background: var(--accent-green); }
.activity-dot.default { background: var(--text-muted); }

.activity-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.activity-text strong { color: var(--text-primary); }

.activity-time {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  margin-top: 2px;
}

/* ====== MODALS ====== */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 560px;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title { font-size: 1.1rem; font-weight: 600; }

.modal-close {
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1.2rem;
  padding: 4px;
  transition: color 0.15s;
}

.modal-close:hover { color: var(--text-primary); }

.modal-body { padding: 1.5rem; }
.modal-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* ====== FILTERS ====== */
.filters-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.filter-chip {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  cursor: pointer;
  transition: all 0.15s;
}

.filter-chip:hover { border-color: var(--border-light); color: var(--text-primary); }
.filter-chip.active { border-color: var(--accent-red); color: var(--accent-red); background: var(--accent-red-glow); }

/* ====== AUDIT LOG TABLE ====== */
.audit-action {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
}

/* ====== EMPTY STATE ====== */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
}

.empty-state-icon { font-size: 3rem; margin-bottom: 1rem; }
.empty-state-title { font-size: 1.1rem; font-weight: 500; color: var(--text-secondary); margin-bottom: 0.5rem; }
.empty-state-desc { font-size: 0.9rem; max-width: 400px; margin: 0 auto; line-height: 1.5; }

/* ====== TEAM PAGE ====== */
.user-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 0.5rem;
}

.user-card-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-card-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
}

.user-card-name { font-size: 0.9rem; font-weight: 500; }
.user-card-email { font-size: 0.75rem; color: var(--text-muted); }

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

/* ====== RESPONSIVE ====== */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .main-content { margin-left: 0; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .threads-container { grid-template-columns: 1fr; height: auto; }
  .thread-list { border-right: none; border-bottom: 1px solid var(--border); max-height: 200px; }
  .page-body { padding: 1rem; }
  .page-header { padding: 1rem; }
  .incident-meta { gap: 1rem; }
}

/* ====== 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); }

/* ====== LOADING ====== */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  color: var(--text-muted);
  gap: 10px;
}

.loading-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-red);
  animation: bounce 1.4s infinite ease-in-out;
}

.loading-dot:nth-child(1) { animation-delay: -0.32s; }
.loading-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

/* Back button */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  margin-bottom: 1rem;
  transition: color 0.15s;
}

.back-link:hover { color: var(--text-primary); }

/* Template card */
.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.template-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.15s;
}

.template-card:hover { border-color: var(--border-light); background: var(--bg-hover); }
.template-card.selected { border-color: var(--accent-red); background: var(--accent-red-glow); }

.template-card-type {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-red);
  margin-bottom: 0.5rem;
  font-family: 'JetBrains Mono', monospace;
}

.template-card-name { font-size: 1rem; font-weight: 600; margin-bottom: 0.5rem; }
.template-card-desc { font-size: 0.8rem; color: var(--text-secondary); line-height: 1.5; }
.template-card-meta { font-size: 0.7rem; color: var(--text-muted); margin-top: 0.75rem; }

/* Misc helpers */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: 0.5rem; }
.gap-md { gap: 1rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.8rem; }
.text-xs { font-size: 0.7rem; }
.hidden { display: none; }
