/* ═══════════════════════════════════════════════════════════════
   Dashboard Styles
   ═══════════════════════════════════════════════════════════════ */

/* ─── Auth Screen ────────────────────────────────────────── */
.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.auth-bg {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
}

.auth-bg .hero-orb-1 {
  width: 400px; height: 400px;
  top: -100px; right: -50px;
}

.auth-bg .hero-orb-2 {
  width: 300px; height: 300px;
  bottom: -80px; left: -80px;
}

.auth-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  margin: 20px;
  padding: 40px;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 28px;
}

.auth-brand .icon {
  width: 40px;
  height: 40px;
  background: var(--gradient-primary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.auth-card h2 {
  font-size: 1.5rem;
  margin-bottom: 6px;
}

.auth-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

.auth-toggle {
  text-align: center;
  margin-top: 20px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ─── Dashboard Layout ───────────────────────────────────── */
.dashboard {
  display: flex;
  min-height: 100vh;
}

/* ─── Sidebar ────────────────────────────────────────────── */
.sidebar {
  width: 260px;
  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-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 24px;
  font-size: 1.3rem;
  font-weight: 800;
  border-bottom: 1px solid var(--border);
}

.sidebar-brand .icon {
  width: 34px;
  height: 34px;
  background: var(--gradient-primary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
}

.sidebar-link:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.sidebar-link.active {
  background: rgba(99,102,241,0.1);
  color: var(--primary-light);
  border: 1px solid rgba(99,102,241,0.15);
}

.sidebar-icon { font-size: 1.1rem; }

.alert-count {
  position: absolute;
  right: 12px;
  background: var(--danger);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  background: var(--gradient-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}

.user-info {
  display: flex;
  flex-direction: column;
}

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

.user-tier {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* ─── Main Content ───────────────────────────────────────── */
.main-content {
  flex: 1;
  margin-left: 260px;
  padding: 32px;
  min-height: 100vh;
}

.panel-header {
  margin-bottom: 28px;
}

.panel-header h2 { margin-bottom: 4px; }
.panel-header p { color: var(--text-secondary); font-size: 0.95rem; }

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

.stat-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px;
}

.stat-card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.stat-card-number {
  font-size: 1.5rem;
  font-weight: 700;
}

.stat-card-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Mobile Header */
.mobile-header {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 90;
}

.mobile-header .sidebar-brand {
  border-bottom: none;
  padding: 0;
}

.mobile-menu-btn {
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 5px;
}

@media (max-width: 768px) {
  .mobile-header { display: flex; }
  .dashboard { flex-direction: column; }
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    width: 280px;
    box-shadow: 4px 0 20px rgba(0,0,0,0.5);
    z-index: 100;
  }
  .sidebar.show { transform: translateX(0); }
  .main-content { margin-left: 0; padding: 20px; }
  .stats-grid { grid-template-columns: 1fr; }
}

/* ─── Filter Bar ─────────────────────────────────────────── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  flex-wrap: wrap;
}

/* ─── Regulation Items ───────────────────────────────────── */
.regulation-item {
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  transition: var(--transition);
  background: var(--bg-card);
  cursor: pointer;
}

.regulation-item:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-sm);
}

.regulation-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.regulation-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.regulation-summary {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* ─── Alert Items ────────────────────────────────────────── */
.alert-item {
  display: flex;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  transition: var(--transition);
  background: var(--bg-card);
}

.alert-item.unread {
  border-left: 3px solid var(--primary);
  background: rgba(99,102,241,0.04);
}

.alert-type-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.alert-item-content { flex: 1; }

.alert-item-title {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.alert-item-message {
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.alert-item-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 6px;
}

/* ─── API Key Display ────────────────────────────────────── */
.api-key-display {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 14px 18px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.api-key-display code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  color: var(--accent);
  flex: 1;
  word-break: break-all;
}

/* ─── Code Block ─────────────────────────────────────────── */
.code-block {
  margin-top: 16px;
  padding: 20px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow-x: auto;
}

.code-block code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  color: var(--accent);
  white-space: pre;
}

/* ─── Usage Bar ──────────────────────────────────────────── */
.usage-bar-container {
  display: flex;
  align-items: center;
  gap: 16px;
}

.usage-bar {
  flex: 1;
  height: 10px;
  background: var(--bg-primary);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.usage-fill {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: var(--radius-full);
  transition: width 0.5s ease;
}

/* ─── Current Plan ───────────────────────────────────────── */
.current-plan {
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
}

.plan-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

/* ─── Pricing Grid (Small) ───────────────────────────────── */
.pricing-grid-sm {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

@media (max-width: 1024px) {
  .pricing-grid-sm { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .pricing-grid-sm { grid-template-columns: 1fr; }
}

.tier-card {
  padding: 24px;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  transition: var(--transition);
}

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

.tier-card.current {
  border-color: var(--primary);
  box-shadow: var(--shadow-glow);
}

.tier-card h4 {
  font-size: 1rem;
  margin-bottom: 8px;
}

.tier-price {
  font-size: 1.8rem;
  font-weight: 800;
}

.tier-price span {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text-muted);
}

/* ─── Checklist in Modal ─────────────────────────────────── */
.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

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

.checklist-priority.high { background: var(--danger); }
.checklist-priority.medium { background: var(--warning); }
.checklist-priority.low { background: var(--success); }

.checklist-text {
  flex: 1;
}

.checklist-text strong { display: block; font-size: 0.9rem; }
.checklist-text p { color: var(--text-secondary); font-size: 0.82rem; margin-top: 2px; }

/* ─── Empty State ────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

.empty-state h4 { color: var(--text-secondary); margin-bottom: 6px; }

/* ─── AI Chat ────────────────────────────────────────────── */
.chat-msg {
  display: flex;
  margin-bottom: 4px;
}

.chat-msg.user {
  justify-content: flex-end;
}

.chat-msg.assistant {
  justify-content: flex-start;
}

.chat-bubble {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: calc(var(--radius-md) + 4px);
  font-size: 0.95rem;
  line-height: 1.5;
}

.chat-msg.user .chat-bubble {
  background: var(--gradient-primary);
  color: white;
  border-bottom-right-radius: 4px;
}

.chat-msg.assistant .chat-bubble {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
}

.chat-bubble p { margin-bottom: 8px; }
.chat-bubble p:last-child { margin-bottom: 0; }
.chat-bubble ul { margin: 8px 0; padding-left: 20px; }
.chat-bubble li { margin-bottom: 4px; }
