/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  line-height: 1.6;
  color: var(--text-primary, #fafafa);
  background: var(--bg-base, #09090b);
}

/* App Container */
.app-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Navigation — glassmorphism */
.navbar {
  background: var(--glass-bg, rgba(24, 24, 27, 0.8));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--glass-border, rgba(255, 255, 255, 0.08));
  color: var(--text-primary, #fafafa);
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.nav-brand a {
  color: var(--text-primary, #fafafa);
  text-decoration: none;
  font-size: 1.5rem;
  font-weight: bold;
  letter-spacing: 0.5px;
}

.nav-menu {
  list-style: none;
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-menu li a {
  color: var(--text-secondary, #a1a1aa);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  transition: all 0.3s ease;
}

.nav-menu li a:hover {
  color: var(--text-primary, #fafafa);
  background: var(--bg-hover, #3f3f46);
}

.nav-menu li.active a {
  color: white;
  background: var(--color-primary-600, #7c3aed);
}

/* Main Content */
main {
  flex: 1;
  padding: 2rem;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

/* Buttons */
.btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.btn-primary {
  background: var(--color-primary-600, #7c3aed);
  color: white;
}

.btn-primary:hover {
  background: var(--color-primary-700, #6d28d9);
  transform: translateY(-1px);
  box-shadow: var(--shadow-glow);
}

.btn-primary:active {
  transform: scale(0.97) translateY(0);
}

.btn-secondary {
  background: var(--bg-overlay, #3f3f46);
  color: var(--text-primary, #fafafa);
}

.btn-secondary:hover {
  background: var(--bg-active, #52525b);
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
}

.btn-danger {
  background: var(--color-error-600, #dc2626);
  color: white;
}

.btn-danger:hover {
  background: var(--color-error-700, #991b1b);
}

/* Forms */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-primary, #fafafa);
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-default, #e4e4e7);
  border-radius: 4px;
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--color-primary-500, #8b5cf6);
}

/* Cards — hover lift */
.card {
  background: var(--bg-surface, #18181b);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
  margin-bottom: 1rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  max-width: 100%;
  overflow-x: auto;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md, 0 4px 12px rgba(0, 0, 0, 0.3));
}

.card-header {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.06));
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal {
  background: var(--bg-surface, #18181b);
  border-radius: 8px;
  padding: 2rem;
  max-width: 500px;
  width: 90%;
  box-shadow: var(--shadow-lg);
}

.error-modal {
  border-left: 4px solid var(--color-error-600, #dc2626);
}

.modal h3 {
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.modal p {
  margin-bottom: 1.5rem;
  color: var(--text-secondary, #a1a1aa);
}

/* Loading Indicator */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(9, 9, 11, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.spinner {
  display: flex;
  gap: 0.5rem;
}

.spinner > div {
  width: 1rem;
  height: 1rem;
  background: var(--color-primary-600, #7c3aed);
  border-radius: 50%;
  animation: bounce 1.4s infinite ease-in-out both;
}

.spinner .bounce1 {
  animation-delay: -0.32s;
}

.spinner .bounce2 {
  animation-delay: -0.16s;
}

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

/* Dashboard Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-surface, #18181b);
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  animation: fade-in-up 0.4s ease-out both;
}

.stat-card:nth-child(1) { animation-delay: 0.05s; }
.stat-card:nth-child(2) { animation-delay: 0.1s; }
.stat-card:nth-child(3) { animation-delay: 0.15s; }
.stat-card:nth-child(4) { animation-delay: 0.2s; }
.stat-card:nth-child(5) { animation-delay: 0.25s; }
.stat-card:nth-child(6) { animation-delay: 0.3s; }

.stat-value {
  font-size: 2.5rem;
  font-weight: bold;
  color: var(--color-primary-500, #8b5cf6);
  margin: 0.5rem 0;
}

.stat-label {
  color: var(--text-secondary, #a1a1aa);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Chat Interface */
.chat-container {
  background: var(--bg-surface, #18181b);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  height: 600px;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.chat-message {
  max-width: 70%;
  padding: 1rem;
  border-radius: 8px;
  line-height: 1.6;
}

.chat-message.user {
  background: var(--color-primary-600, #7c3aed);
  color: white;
  align-self: flex-end;
}

.chat-message.assistant {
  background: var(--bg-elevated, #27272a);
  align-self: flex-start;
}

.chat-input {
  padding: 1rem;
  border-top: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.06));
  display: flex;
  gap: 1rem;
}

.chat-input input {
  flex: 1;
  padding: 0.75rem;
  border: 1px solid var(--border-default, #e4e4e7);
  border-radius: 4px;
  font-size: 1rem;
}

.chat-input input:focus {
  outline: none;
  border-color: var(--color-primary-500, #8b5cf6);
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-surface, #18181b);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

thead {
  background: var(--bg-elevated, #27272a);
}

th, td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.06));
}

th {
  font-weight: 600;
  color: var(--text-primary, #fafafa);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
}

tbody tr:hover {
  background: var(--bg-elevated, #27272a);
}

/* Status Badges */
.status-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.status-available {
  background: var(--color-success-100, #d1fae5);
  color: var(--color-success-800, #065f46);
}

.status-busy {
  background: var(--color-warning-400, #fbbf24);
  color: var(--color-warning-800, #92400e);
}

.status-offline {
  background: var(--border-default);
  color: var(--text-secondary, #a1a1aa);
}

.status-maintenance {
  background: var(--color-error-400, #f87171);
  color: var(--color-error-800, #991b1b);
}

/* ===== Dashboard Layout ===== */
.dashboard-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.dashboard-layout {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.dashboard-main {
  min-height: 600px;
}

.dashboard-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* ===== Chat Panel ===== */
.chat-panel {
  display: flex;
  flex-direction: column;
  height: 600px;
}

.chat-header {
  border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.06));
  padding-bottom: 1rem;
}

.chat-description {
  color: var(--text-secondary, #a1a1aa);
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.chat-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-tertiary, #71717a);
}

.chat-empty-state .empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.chat-message {
  padding: 1rem;
  border-radius: 8px;
  max-width: 85%;
}

.chat-message.user {
  background: var(--color-primary-600, #7c3aed);
  color: white;
  margin-left: auto;
}

.chat-message.assistant {
  background: var(--bg-elevated, #27272a);
  margin-right: auto;
}

.message-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  font-size: 0.75rem;
}

.message-role {
  font-weight: 600;
}

.message-time {
  opacity: 0.7;
}

.message-content {
  line-height: 1.6;
}

/* Typing Indicator */
.typing-indicator {
  display: flex;
  gap: 4px;
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  background: var(--text-tertiary, #71717a);
  border-radius: 50%;
  animation: bounce 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

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

/* Chat Input */
.chat-input-container {
  display: flex;
  gap: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.06));
}

.chat-textarea {
  flex: 1;
  padding: 0.75rem;
  border: 1px solid var(--border-default, #e4e4e7);
  border-radius: 8px;
  resize: none;
  font-family: inherit;
  font-size: 0.875rem;
}

.chat-textarea:focus {
  outline: none;
  border-color: var(--color-primary-500, #8b5cf6);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.chat-send-btn {
  align-self: flex-end;
}

/* ===== Markdown Content ===== */
.markdown-content {
  font-size: 0.9375rem;
}

.markdown-content h2, .markdown-content h3, .markdown-content h4 {
  margin: 1rem 0 0.5rem;
  font-weight: 600;
}

.markdown-content p {
  margin-bottom: 0.5rem;
}

.markdown-content ul, .markdown-content ol {
  padding-left: 1.5rem;
  margin: 0.5rem 0;
}

.markdown-content li {
  margin-bottom: 0.25rem;
}

/* Code Blocks */
.code-block {
  background: var(--bg-base, #09090b);
  border-radius: 8px;
  margin: 1rem 0;
  overflow: hidden;
}

.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 1rem;
  background: var(--bg-surface, #18181b);
  border-bottom: 1px solid var(--border-default);
}

.code-language {
  color: var(--text-tertiary, #71717a);
  font-size: 0.75rem;
  text-transform: uppercase;
}

.copy-code-btn {
  background: transparent;
  border: 1px solid var(--border-default);
  color: var(--text-tertiary, #71717a);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.75rem;
}

.copy-code-btn:hover {
  background: var(--bg-active, #52525b);
  color: white;
}

.code-block code {
  display: block;
  padding: 1rem;
  color: var(--text-primary, #fafafa);
  font-family: 'Fira Code', 'Monaco', monospace;
  font-size: 0.875rem;
  line-height: 1.5;
  overflow-x: auto;
}

.inline-code {
  background: var(--border-default, rgba(255, 255, 255, 0.1));
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  font-family: 'Fira Code', 'Monaco', monospace;
  font-size: 0.875em;
}

.chat-message.assistant .inline-code {
  background: var(--border-default);
}

/* ===== File Drop Zone ===== */
.file-drop-zone {
  border: 2px dashed var(--border-default, #3f3f46);
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  transition: all 0.3s ease;
  background: var(--bg-elevated, #27272a);
}

.file-drop-zone:hover {
  border-color: var(--color-primary-500, #8b5cf6);
  background: var(--color-primary-50, rgba(139, 92, 246, 0.05));
}

.file-drop-zone.dragging {
  border-color: var(--color-primary-500, #8b5cf6);
  background: var(--color-primary-100, rgba(139, 92, 246, 0.1));
  transform: scale(1.02);
}

.file-drop-zone.uploading {
  border-color: var(--color-success-500, #10b981);
  background: var(--color-success-50, rgba(16, 185, 129, 0.05));
}

.drop-zone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.drop-icon {
  font-size: 3rem;
}

.drop-text {
  font-weight: 500;
  color: var(--text-primary, #fafafa);
}

.drop-divider {
  color: var(--text-tertiary, #71717a);
  font-size: 0.875rem;
}

.file-types {
  color: var(--text-tertiary, #71717a);
  font-size: 0.75rem;
}

.hidden-input {
  display: none;
}

/* Upload Progress */
.upload-progress-container {
  width: 100%;
  max-width: 300px;
}

.upload-progress-bar {
  height: 8px;
  background: var(--border-default, rgba(255, 255, 255, 0.1));
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.upload-progress-fill {
  height: 100%;
  background: var(--gradient-primary, linear-gradient(135deg, #7c3aed, #06b6d4));
  transition: width 0.3s ease;
}

.upload-progress-text {
  font-size: 0.875rem;
  color: var(--text-secondary, #a1a1aa);
}

.upload-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-default, #3f3f46);
  border-top-color: var(--color-primary-500, #8b5cf6);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

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

/* ===== Document Cards ===== */
.documents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.document-card {
  background: var(--bg-surface, #18181b);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.06));
  border-radius: 8px;
  padding: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.document-card:hover {
  border-color: var(--color-primary-500, #8b5cf6);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.document-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.document-name {
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-meta {
  display: flex;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-secondary, #a1a1aa);
}

.document-actions {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.06));
}

.btn-icon {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  font-size: 1rem;
  opacity: 0.5;
  transition: opacity 0.2s;
}

.btn-icon:hover {
  opacity: 1;
}

/* ===== Document Preview Modal ===== */
.document-preview-modal {
  max-width: 500px;
}

.preview-content {
  display: flex;
  gap: 1.5rem;
  padding: 1.5rem 0;
}

.preview-icon {
  font-size: 4rem;
}

.preview-details {
  flex: 1;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-subtle);
}

.detail-label {
  color: var(--text-secondary, #a1a1aa);
  font-size: 0.875rem;
}

.detail-value {
  font-weight: 500;
}

/* ===== OAuth Buttons ===== */
.oauth-divider {
  display: flex;
  align-items: center;
  margin: 1.5rem 0;
  color: var(--text-tertiary, #71717a);
  font-size: 0.875rem;
}

.oauth-divider::before,
.oauth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-default, rgba(255, 255, 255, 0.1));
}

.oauth-divider span {
  padding: 0 1rem;
}

.oauth-buttons {
  display: flex;
  gap: 1rem;
}

.btn-oauth {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem;
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.06));
  border-radius: 8px;
  background: var(--bg-surface, #18181b);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-oauth:hover {
  background: var(--bg-elevated, #27272a);
  border-color: var(--border-default, rgba(255, 255, 255, 0.1));
}

.oauth-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.875rem;
}

.btn-google .oauth-icon {
  color: #4285f4;
}

.btn-microsoft .oauth-icon {
  color: #00a4ef;
}

/* ===== Login Card ===== */
.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  background: radial-gradient(ellipse at 50% 30%, rgba(139, 92, 246, 0.15) 0%, transparent 60%),
              radial-gradient(ellipse at 30% 70%, rgba(6, 182, 212, 0.08) 0%, transparent 50%);
}

.login-card {
  width: 100%;
  max-width: 400px;
  animation: fade-in-up 0.5s ease-out;
}

.btn-full {
  width: 100%;
}

/* ===== Usage Warning Banner ===== */
.usage-warning-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
}

.usage-warning-banner.approaching {
  background: var(--color-warning-50, rgba(245, 158, 11, 0.1));
  border: 1px solid var(--color-warning-500, #f59e0b);
}

.usage-warning-banner.critical {
  background: var(--color-error-50, rgba(239, 68, 68, 0.1));
  border: 1px solid var(--color-error-500, #ef4444);
}

.warning-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.warning-icon {
  font-size: 1.25rem;
}

.warning-message {
  font-weight: 500;
}

.usage-stats {
  color: var(--text-secondary, #a1a1aa);
  font-size: 0.875rem;
}

.warning-actions {
  display: flex;
  gap: 0.5rem;
}

/* ===== Panel Headers ===== */
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.document-count {
  font-size: 0.875rem;
  color: var(--text-secondary, #a1a1aa);
}

.count-badge {
  background: var(--color-primary-600, #7c3aed);
  color: white;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  font-weight: 600;
}

/* ===== Responsive Design ===== */
@media (max-width: 1024px) {
  .dashboard-two-col {
    grid-template-columns: 1fr;
  }

  .dashboard-layout {
    grid-template-columns: 1fr;
  }

  .dashboard-sidebar {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .dashboard-sidebar > * {
    flex: 1;
    min-width: 300px;
  }
}

@media (max-width: 768px) {
  .nav-container {
    flex-direction: column;
    gap: 1rem;
  }

  .nav-menu {
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .stat-value {
    font-size: 2rem;
  }

  .oauth-buttons {
    flex-direction: column;
  }

  .documents-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== NEW ENTERPRISE FEATURE STYLES ===== */

/* Badge Variants */
.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.badge-primary { background: var(--color-primary-600, #7c3aed); color: white; }
.badge-success { background: var(--color-success-500, #10b981); color: white; }
.badge-warning { background: var(--color-warning-500, #f59e0b); color: white; }
.badge-danger { background: var(--color-error-500, #ef4444); color: white; }
.badge-info { background: var(--color-info-500, #3b82f6); color: white; }
.badge-muted { background: var(--bg-overlay, #3f3f46); color: var(--text-secondary, #a1a1aa); }
.badge-secondary { background: var(--bg-elevated, #27272a); color: var(--text-primary, #fafafa); }

/* ===== Notifications ===== */
.notifications-panel {
  padding: 2rem;
  max-width: 800px;
  margin: 0 auto;
}

.notification-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.notification-item {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg-surface, white);
  border-radius: 8px;
  border: 1px solid var(--border-default, #e5e7eb);
  cursor: pointer;
  transition: all 0.2s;
}

.notification-item:hover {
  border-color: var(--color-primary-400, #4f46e5);
}

.notification-item.unread {
  background: var(--bg-elevated, #f5f3ff);
  border-color: var(--color-primary-200, #c4b5fd);
}

.notification-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-overlay, #e5e7eb);
}

.notification-content {
  flex: 1;
}

.notification-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.25rem;
}

.notification-title {
  font-weight: 600;
}

.notification-time {
  font-size: 0.75rem;
  color: var(--text-secondary, #6b7280);
}

.notification-message {
  font-size: 0.875rem;
  color: var(--text-secondary, #6b7280);
}

.unread-indicator {
  width: 8px;
  height: 8px;
  background: var(--color-primary-600, #7c3aed);
  border-radius: 50%;
}

.notification-filters {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-default, #e5e7eb);
}

.notification-filters .form-control {
  max-width: 200px;
}

.notification-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.notification-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.notification-count-badge {
  margin-left: 0.5rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  accent-color: var(--color-primary-500, #8b5cf6);
}

.notification-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--color-error-500, #ef4444);
  color: white;
  font-size: 0.625rem;
  padding: 0.125rem 0.375rem;
  border-radius: 9999px;
  min-width: 16px;
  text-align: center;
}

.nav-notifications {
  position: relative;
}

.nav-theme-toggle {
  display: flex;
  align-items: center;
}

.nav-theme-toggle .theme-toggle {
  padding: 0.375rem 0.5rem;
  line-height: 1;
  border-radius: var(--radius-md);
}

/* ===== Tickets / Support ===== */
.tickets-panel {
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.ticket-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.ticket-filters {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.filter-select {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-default, #d1d5db);
  border-radius: 6px;
  background: var(--bg-surface, white);
  color: var(--text-primary, inherit);
}

.ticket-row {
  cursor: pointer;
}

.ticket-row:hover {
  background: var(--bg-hover, #f5f3ff);
}

.create-ticket-form {
  padding: 2rem;
  max-width: 600px;
  margin: 0 auto;
  background: var(--bg-surface, white);
  border-radius: 12px;
  box-shadow: var(--shadow-md, 0 1px 3px rgba(0,0,0,0.1));
}

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

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

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-default, #d1d5db);
  border-radius: 6px;
  font-size: 0.875rem;
  background: var(--input-bg, white);
  color: var(--text-primary, inherit);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-primary-400, #4f46e5);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.form-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
}

.ticket-detail {
  padding: 2rem;
  max-width: 900px;
  margin: 0 auto;
}

.ticket-detail-header {
  margin-bottom: 2rem;
}

.ticket-title {
  display: flex;
  gap: 1rem;
  align-items: baseline;
}

.ticket-meta {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.ticket-info {
  display: flex;
  gap: 2rem;
  padding: 1rem;
  background: var(--bg-elevated, #f9fafb);
  border-radius: 8px;
  margin-bottom: 1.5rem;
}

.info-item .label {
  font-size: 0.75rem;
  color: var(--text-secondary, #6b7280);
  text-transform: uppercase;
}

.ticket-comments {
  margin-top: 2rem;
}

.ticket-comment {
  padding: 1rem;
  background: var(--bg-elevated, #f9fafb);
  border-radius: 8px;
  margin-bottom: 1rem;
}

.ticket-comment.internal {
  background: var(--bg-overlay, #fef3c7);
  border-left: 3px solid var(--color-warning, #f59e0b);
}

.comment-header {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
}

.comment-author {
  font-weight: 600;
}

.comment-date {
  color: var(--text-secondary, #6b7280);
}

.add-comment-form {
  margin-top: 1.5rem;
}

.add-comment-form textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-default, #d1d5db);
  border-radius: 6px;
  margin-bottom: 0.5rem;
  background: var(--input-bg, white);
  color: var(--text-primary, inherit);
}

/* ===== Marketplace ===== */
.marketplace-panel {
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

.marketplace-header {
  margin-bottom: 2rem;
}

.marketplace-header h1 {
  margin-bottom: 0.5rem;
}

.marketplace-header p {
  color: var(--text-secondary, #6b7280);
}

.marketplace-filters {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
}

.marketplace-search {
  flex: 1;
  display: flex;
  gap: 0.5rem;
}

.marketplace-search input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-default, #d1d5db);
  border-radius: 6px;
  background: var(--input-bg, white);
  color: var(--text-primary, inherit);
}

.listings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.listing-card {
  background: var(--bg-surface, white);
  border: 1px solid var(--border-default, #e5e7eb);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s;
}

.listing-card:hover {
  border-color: var(--color-primary-400, #4f46e5);
  box-shadow: var(--shadow-lg, 0 4px 12px rgba(0, 0, 0, 0.1));
  transform: translateY(-2px);
}

.listing-thumbnail {
  height: 160px;
  background: var(--bg-overlay, #f3f4f6);
  display: flex;
  align-items: center;
  justify-content: center;
}

.listing-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.placeholder-thumbnail {
  font-size: 3rem;
  color: var(--text-tertiary, #9ca3af);
}

.listing-content {
  padding: 1rem;
}

.listing-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.listing-category {
  font-size: 0.75rem;
  color: var(--text-secondary, #6b7280);
  text-transform: uppercase;
}

.listing-price {
  font-weight: 700;
  color: var(--color-success-600, #059669);
}

.listing-name {
  font-size: 1.125rem;
  margin-bottom: 0.5rem;
}

.listing-description {
  font-size: 0.875rem;
  color: var(--text-secondary, #6b7280);
  margin-bottom: 0.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.listing-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
}

.star-rating {
  display: flex;
  gap: 0.125rem;
}

.star.filled {
  color: var(--color-warning-500, #f59e0b);
}

.star.empty {
  color: var(--text-tertiary, #71717a);
}

.listing-seller {
  font-size: 0.75rem;
  color: var(--text-secondary, #6b7280);
  margin-top: 0.5rem;
}

.listing-detail {
  padding: 2rem;
  max-width: 1000px;
  margin: 0 auto;
}

.listing-detail-header {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2rem;
  margin-bottom: 2rem;
}

.listing-actions {
  background: var(--bg-elevated, #f9fafb);
  padding: 1.5rem;
  border-radius: 12px;
}

.price-box {
  text-align: center;
  margin-bottom: 1rem;
}

.price-box .price {
  font-size: 2rem;
  font-weight: 700;
}

.free-badge {
  display: block;
  color: var(--color-success-600, #059669);
  font-size: 0.875rem;
}

.btn-large {
  width: 100%;
  padding: 1rem;
  font-size: 1rem;
}

.marketplace-nav {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border-default, #e5e7eb);
  padding-bottom: 1rem;
}

.marketplace-nav button {
  padding: 0.5rem 1rem;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-secondary, inherit);
  border-bottom: 2px solid transparent;
}

.marketplace-nav button.active {
  border-color: var(--color-primary-400, #4f46e5);
  color: var(--color-primary-400, #4f46e5);
  font-weight: 600;
}

.price-lg {
  font-size: 2rem;
  font-weight: 700;
}

.listing-tab-content {
  margin-top: 1.5rem;
}

.content-section {
  margin-bottom: 2rem;
}

.content-section h2 {
  margin-bottom: 0.75rem;
  font-size: 1.25rem;
}

.review-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.25rem;
}

.review-author {
  font-weight: 600;
}

.review-date {
  font-size: 0.75rem;
  color: var(--text-secondary, #6b7280);
}

.review-item {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-default, #e5e7eb);
}

.review-item:last-child {
  border-bottom: none;
}

.version-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.version-item {
  display: flex;
  gap: 1rem;
  align-items: baseline;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-default, #e5e7eb);
}

.version-number {
  font-weight: 600;
  font-family: monospace;
}

.version-date {
  font-size: 0.75rem;
  color: var(--text-secondary, #6b7280);
}

.version-changelog {
  font-size: 0.875rem;
  color: var(--text-secondary, #6b7280);
}

.seller-card {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.documentation-content {
  line-height: 1.8;
}

.purchases-panel {
  padding: 2rem;
  max-width: 1000px;
  margin: 0 auto;
}

.btn-group {
  display: flex;
  gap: 0.5rem;
}

.listing-stats {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
  font-size: 0.875rem;
}

/* ===== Reports ===== */
.reports-panel {
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.reports-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2rem;
}

.templates-panel {
  margin-bottom: 2rem;
}

.templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.template-card {
  padding: 1rem;
  background: var(--bg-elevated, #f9fafb);
  border: 1px solid var(--border-default, #e5e7eb);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.template-card:hover {
  border-color: var(--color-primary-400, #4f46e5);
  background: var(--bg-hover, #f5f3ff);
}

.template-icon {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.template-card h4 {
  margin-bottom: 0.25rem;
}

.template-card p {
  font-size: 0.75rem;
  color: var(--text-secondary, #6b7280);
}

.template-category {
  font-size: 0.625rem;
  text-transform: uppercase;
  color: var(--text-tertiary, #9ca3af);
}

.reports-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.report-card {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg-surface, white);
  border: 1px solid var(--border-default, #e5e7eb);
  border-radius: 8px;
}

.report-icon {
  width: 48px;
  height: 48px;
  background: var(--bg-overlay, #f3f4f6);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.report-content {
  flex: 1;
}

.report-name {
  margin-bottom: 0.25rem;
}

.report-description {
  font-size: 0.875rem;
  color: var(--text-secondary, #6b7280);
  margin-bottom: 0.5rem;
}

.report-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.75rem;
  color: var(--text-tertiary, #9ca3af);
}

.report-actions {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
}

.create-report-form {
  padding: 2rem;
  max-width: 800px;
  margin: 0 auto;
  background: var(--bg-surface, white);
  border-radius: 12px;
}

.report-type-selector {
  margin: 1.5rem 0;
}

.type-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.type-option {
  padding: 1rem;
  border: 2px solid var(--border-default, #e5e7eb);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.type-option:hover {
  border-color: var(--color-primary-200, #a5b4fc);
}

.type-option.selected {
  border-color: var(--color-primary-400, #4f46e5);
  background: var(--bg-hover, #f5f3ff);
}

.type-name {
  display: block;
  font-weight: 600;
  margin: 0.5rem 0 0.25rem;
}

.type-desc {
  font-size: 0.75rem;
  color: var(--text-secondary, #6b7280);
}

.column-selector {
  margin: 1.5rem 0;
}

.column-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.column-options label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg-elevated, #f9fafb);
  border-radius: 6px;
  cursor: pointer;
}

.column-options label:hover {
  background: var(--bg-overlay, #f3f4f6);
}

.date-range-selector {
  margin: 1.5rem 0;
}

.date-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.results-table-container {
  max-height: 500px;
  overflow: auto;
  margin-top: 1rem;
}

.results-summary {
  display: flex;
  gap: 2rem;
  margin-bottom: 1rem;
  color: var(--text-secondary, #6b7280);
}

.export-buttons {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

/* ===== Pricing / Spot / Reserved ===== */
.pricing-dashboard {
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

.pricing-tabs {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border-default, #e5e7eb);
  padding-bottom: 1rem;
}

.pricing-tabs button {
  padding: 0.5rem 1.5rem;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 1rem;
  color: var(--text-secondary, inherit);
  border-bottom: 2px solid transparent;
}

.pricing-tabs button.active {
  border-color: var(--color-primary-400, #4f46e5);
  color: var(--color-primary-400, #4f46e5);
  font-weight: 600;
}

.spot-prices-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.spot-price-card {
  background: var(--bg-surface, white);
  border: 1px solid var(--border-default, #e5e7eb);
  border-radius: 12px;
  padding: 1.5rem;
}

.gpu-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.gpu-model {
  font-size: 1.25rem;
  margin: 0;
}

.availability {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

.availability.good { background: var(--color-success-100, #d1fae5); color: var(--color-success-800, #065f46); }
.availability.low { background: var(--color-warning-50, rgba(245, 158, 11, 0.1)); color: var(--color-warning-800, #92400e); }
.availability.none { background: var(--color-error-50, rgba(239, 68, 68, 0.1)); color: var(--color-error-800, #991b1b); }

.price-info {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.price-info .label {
  display: block;
  font-size: 0.625rem;
  text-transform: uppercase;
  color: var(--text-secondary, #6b7280);
}

.price-info .value {
  font-size: 1rem;
  font-weight: 600;
}

.strikethrough {
  text-decoration: line-through;
  color: var(--text-tertiary, #71717a);
}

.savings-value.positive {
  color: var(--color-success-600, #059669);
}

.savings-value.negative {
  color: var(--color-error-600, #dc2626);
}

.demand-indicator {
  margin-bottom: 1rem;
}

.demand-bar {
  height: 4px;
  background: var(--border-default, #e5e7eb);
  border-radius: 2px;
  margin: 0.25rem 0;
}

.demand-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-success-500, #10b981), var(--color-warning-500, #f59e0b), var(--color-error-500, #ef4444));
  border-radius: 2px;
}

.offerings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.offering-card {
  background: var(--bg-surface, white);
  border: 1px solid var(--border-default, #e5e7eb);
  border-radius: 12px;
  padding: 1.5rem;
}

.offering-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.offering-header h3 {
  margin: 0;
}

.term {
  font-size: 0.875rem;
  color: var(--text-secondary, #6b7280);
}

.offering-details {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.detail {
  display: flex;
  justify-content: space-between;
}

.detail .label {
  color: var(--text-secondary, #6b7280);
  font-size: 0.875rem;
}

.detail.discount .value {
  color: var(--color-success-600, #059669);
  font-weight: 600;
}

.offering-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  border-top: 1px solid var(--border-default, #e5e7eb);
}

.reservations-section,
.spot-instances-section {
  margin-top: 2rem;
}

.usage-bar {
  position: relative;
  height: 20px;
  background: var(--border-default, #e5e7eb);
  border-radius: 4px;
  overflow: hidden;
}

.usage-fill {
  height: 100%;
  background: var(--color-primary-600, #7c3aed);
}

.usage-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 500;
}

.pricing-calculator {
  margin-top: 2rem;
  padding: 1.5rem;
  background: var(--bg-surface, white);
  border-radius: 12px;
  border: 1px solid var(--border-default, #e5e7eb);
}

.calculator-inputs {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.calculator-results {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 2rem;
}

.on-demand-price {
  padding: 1rem;
  background: var(--bg-elevated, #f9fafb);
  border-radius: 8px;
}

.pricing-table {
  font-size: 0.875rem;
}

.pricing-table td.savings {
  color: var(--color-success-600, #059669);
  font-weight: 600;
}

.panel-header-stacked {
  flex-direction: column;
  gap: 0.25rem;
}

.panel-header-stacked p {
  color: var(--text-secondary, #6b7280);
  font-size: 0.875rem;
  margin: 0;
}

.spot-request-form {
  margin-top: 1rem;
}

.form-row-flex {
  display: flex;
  gap: 1rem;
}

.flex-1 {
  flex: 1;
}

.form-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.confirm-actions {
  display: flex;
  gap: 0.25rem;
}

.savings-highlight {
  color: var(--color-success-500, #10b981);
  font-weight: 600;
}

.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.empty-hint {
  font-size: 0.8rem;
  color: var(--text-secondary, #9ca3af);
  margin-top: 0.25rem;
}

/* ===== Utility Classes ===== */
.btn-back {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary, #6b7280);
  padding: 0.5rem 0;
  margin-bottom: 1rem;
}

.btn-back:hover {
  color: var(--color-primary-400, #4f46e5);
}

.btn-small {
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
}

.btn-danger {
  background: var(--color-error-500, #ef4444);
  color: white;
}

.btn-danger:hover {
  background: var(--color-error-600, #dc2626);
}

.empty-state {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--text-secondary, #6b7280);
}

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

.empty-state h3 {
  margin-bottom: 0.5rem;
  color: var(--text-primary, #374151);
}

.empty-state-small {
  text-align: center;
  padding: 2rem;
  color: var(--text-tertiary, #9ca3af);
}

.loading-state {
  text-align: center;
  padding: 3rem;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border-default, #3f3f46);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 0.75rem;
  background: conic-gradient(from 0deg, transparent, var(--color-primary-500, #8b5cf6));
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), black calc(100% - 3px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 3px), black calc(100% - 3px));
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.checkbox input {
  width: auto;
}

.hint {
  font-size: 0.75rem;
  color: var(--text-secondary, #6b7280);
  margin-top: 0.25rem;
}

.main-content {
  flex: 1;
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-surface, white);
  border-radius: 8px;
  overflow: hidden;
}

.data-table th {
  background: var(--bg-elevated, #f9fafb);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
}

.data-table td,
.data-table th {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-default, #e5e7eb);
  text-align: left;
}

.data-table tbody tr:hover {
  background: var(--bg-hover, #f9fafb);
}

/* ===== Enterprise Features Responsive ===== */

@media (max-width: 1024px) {
  .listing-detail-header {
    grid-template-columns: 1fr;
  }
  .calculator-results {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  /* Tickets */
  .ticket-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .ticket-filters {
    flex-direction: column;
  }
  .ticket-info {
    flex-direction: column;
    gap: 0.75rem;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
  .create-ticket-form {
    margin: 1rem;
  }

  /* Marketplace */
  .marketplace-filters {
    flex-direction: column;
  }
  .listings-grid {
    grid-template-columns: 1fr;
  }

  /* Reports */
  .reports-header {
    flex-direction: column;
    gap: 1rem;
  }
  .type-options {
    grid-template-columns: 1fr;
  }
  .date-inputs {
    grid-template-columns: 1fr;
  }
  .create-report-form {
    margin: 1rem;
  }

  /* Notifications */
  .notification-filters {
    flex-direction: column;
  }

  /* Pricing */
  .calculator-inputs {
    flex-direction: column;
  }
  .form-row-flex {
    flex-direction: column;
  }
  .price-info {
    grid-template-columns: 1fr;
  }

  /* Tables */
  .data-table {
    font-size: 0.8rem;
  }
  .data-table td, .data-table th {
    padding: 0.5rem;
  }

  /* Main layout */
  .main-content {
    padding: 1rem;
  }
}

@media (max-width: 480px) {
  /* Single-column stats */
  .ticket-stats {
    grid-template-columns: 1fr;
  }

  .dashboard-grid {
    gap: 0.75rem;
  }

  .stat-value {
    font-size: 1.75rem;
  }

  /* Full-width buttons */
  .form-actions {
    flex-direction: column;
  }

  .form-actions .btn {
    width: 100%;
  }

  /* Smaller padding */
  .card {
    padding: 1rem;
  }

  .main-content,
  .tickets-panel,
  .marketplace-panel,
  .reports-panel,
  .notifications-panel {
    padding: 0.75rem;
  }

  /* Touch-friendly targets (44px minimum) */
  .btn {
    min-height: 44px;
    min-width: 44px;
  }

  .btn-sm {
    min-height: 36px;
  }

  /* Stack nav */
  .nav-menu {
    gap: 0.5rem;
  }

  .nav-menu li a {
    padding: 0.5rem 0.625rem;
    font-size: 0.8125rem;
  }

  /* Prevent dashboard items from overflowing viewport */
  .dashboard-row > *,
  .dashboard-sidebar > * {
    min-width: 0;
  }
}

/* Toast System */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 400px;
}

.toast {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  color: white;
  font-size: 0.875rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  animation: toast-slide-in 0.3s ease-out;
}

.toast-success { background: var(--color-success-500, #10b981); }
.toast-error { background: var(--color-error-500, #ef4444); }
.toast-warning { background: var(--color-warning-500, #f59e0b); }
.toast-info { background: var(--color-info-500, #3b82f6); }

.toast-message { flex: 1; margin-right: 0.75rem; }

.toast-dismiss {
  background: none;
  border: none;
  color: white;
  font-size: 1.25rem;
  cursor: pointer;
  opacity: 0.7;
  padding: 0;
  line-height: 1;
}

.toast-dismiss:hover { opacity: 1; }

@keyframes toast-slide-in {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1rem 0;
}

.pagination-info {
  font-size: 0.875rem;
  color: var(--text-secondary, #a1a1aa);
}

/* Clickable table rows */
.clickable-row { cursor: pointer; }
.clickable-row:hover { background: rgba(79, 70, 229, 0.05); }

/* ===== Inference Page ===== */
.inference-page {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.inference-page > .card {
  margin-bottom: 0;
}

/* Advanced Parameters */
.inference-params-section {
  margin-top: 0.5rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border-default, #e5e7eb);
  border-radius: 8px;
  overflow: hidden;
}

.inference-params-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 0.625rem 1rem;
  background: var(--bg-elevated, #f9fafb);
  border: none;
  cursor: pointer;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary, #6b7280);
  transition: background 0.15s ease, color 0.15s ease;
}

.inference-params-toggle:hover {
  background: var(--bg-hover, #f3f4f6);
  color: var(--text-primary, #374151);
}

.inference-params-toggle:focus-visible {
  outline: 2px solid var(--color-primary-400, #4f46e5);
  outline-offset: -2px;
}

.toggle-chevron {
  font-size: 0.625rem;
  transition: transform 0.2s ease;
}

.inference-params-body {
  padding: 1rem;
  border-top: 1px solid var(--border-default, #e5e7eb);
}

.inference-params-body .form-group {
  margin-bottom: 1rem;
}

.inference-params-body .form-group:last-child {
  margin-bottom: 0;
}

.param-value {
  font-family: var(--font-family-mono, 'JetBrains Mono', monospace);
  font-size: 0.8125rem;
  color: var(--color-primary-400, #5c6bc0);
  margin-left: 0.5rem;
}

.param-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.6875rem;
  color: var(--text-muted, #9ca3af);
  margin-top: 0.25rem;
}

.inference-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--border-default, #e5e7eb);
  outline: none;
  cursor: pointer;
}

.inference-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--color-primary-500, #3f51b5);
  border: 2px solid var(--bg-surface, white);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.inference-range::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.inference-range::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--color-primary-500, #3f51b5);
  border: 2px solid var(--bg-surface, white);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  cursor: pointer;
}

.inference-range:focus-visible {
  outline: 2px solid var(--color-primary-400, #4f46e5);
  outline-offset: 2px;
}

/* Result Panel */
.inference-result-card {
  margin-top: 0;
}

.inference-result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.btn-copy {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.3rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary, #6b7280);
  background: var(--bg-elevated, #f9fafb);
  border: 1px solid var(--border-default, #e5e7eb);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-copy:hover {
  background: var(--bg-hover, #f3f4f6);
  border-color: var(--color-primary-400, #4f46e5);
  color: var(--color-primary-400, #4f46e5);
}

.btn-copy:focus-visible {
  outline: 2px solid var(--color-primary-400, #4f46e5);
  outline-offset: 1px;
}

.inference-output {
  padding: 1rem;
  background: var(--bg-elevated, #1a2035);
  border: 1px solid var(--border-subtle, #1e293b);
  border-radius: 8px;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--font-family-mono, 'JetBrains Mono', monospace);
  font-size: 0.875rem;
  line-height: 1.7;
  color: var(--text-primary, #f1f5f9);
  max-height: 500px;
  overflow-y: auto;
}

.inference-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-subtle, #1e293b);
}

.inference-meta-item {
  font-size: 0.8125rem;
  color: var(--text-secondary, #94a3b8);
}

.inference-meta-item strong {
  color: var(--text-tertiary, #64748b);
  font-weight: 500;
}

/* Loading states */
.inference-loading {
  padding: 1rem 0;
}

.inference-status-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.inference-status-text {
  margin-top: 0.75rem;
  color: var(--text-muted, #475569);
  font-size: 0.875rem;
}

.inference-progress-bar {
  height: 3px;
  margin-top: 1rem;
  background: var(--border-default, #e5e7eb);
  border-radius: 2px;
  overflow: hidden;
}

.inference-progress-fill {
  height: 100%;
  width: 30%;
  background: var(--color-primary-500, #3f51b5);
  border-radius: 2px;
}

.inference-progress-fill.animate-pulse {
  animation: inference-pulse 2s ease-in-out infinite;
}

.inference-progress-fill.animate-progress {
  animation: inference-progress 2s ease-in-out infinite;
}

@keyframes inference-pulse {
  0%, 100% { opacity: 0.4; width: 30%; }
  50% { opacity: 1; width: 30%; }
}

@keyframes inference-progress {
  0% { width: 10%; margin-left: 0%; }
  50% { width: 40%; margin-left: 30%; }
  100% { width: 10%; margin-left: 90%; }
}

/* Focus ring improvements */
.inference-page .form-control:focus-visible {
  outline: none;
  border-color: var(--color-primary-400, #4f46e5);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.inference-page .btn:focus-visible {
  outline: 2px solid var(--color-primary-400, #4f46e5);
  outline-offset: 2px;
}

@media (max-width: 768px) {
  .inference-meta-row {
    flex-direction: column;
    gap: 0.25rem;
  }

  .inference-output {
    font-size: 0.8125rem;
    max-height: 300px;
  }
}

/* Form hints and errors */
.form-hint {
  display: block;
  font-size: 0.75rem;
  color: var(--text-tertiary, #71717a);
  margin-top: 0.25rem;
}

.form-error { border-color: var(--color-error-500, #ef4444) !important; }

.form-error-message {
  display: block;
  font-size: 0.75rem;
  color: var(--color-error-500, #ef4444);
  margin-top: 0.25rem;
}

/* Modal header */
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: var(--text-tertiary, #71717a);
  padding: 0;
}

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

/* Tab styling */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border-subtle, rgba(255, 255, 255, 0.06));
  margin-bottom: 1.5rem;
}

.tab {
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  font-size: 0.875rem;
  background: none;
  border: none;
  font-family: inherit;
  font-weight: 500;
  color: var(--text-secondary, #a1a1aa);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s ease;
}

.tab:hover { color: var(--text-primary, #fafafa); }

.tab.active {
  color: var(--color-primary-500, #8b5cf6);
  border-bottom-color: var(--color-primary-500, #8b5cf6);
}

/* ===== Token-based Component Rules ===== */
/* (Migrated from themes.css — single source of truth for component styles) */

.card-description {
  color: var(--text-secondary, #a1a1aa);
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
}

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

.btn-primary:hover:not(:disabled) {
  background: var(--button-primary-hover, var(--color-primary-500, #8b5cf6));
  border-color: var(--button-primary-hover, var(--color-primary-500, #8b5cf6));
  box-shadow: var(--shadow-glow, 0 0 20px rgba(139, 92, 246, 0.4));
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-hover, #3f3f46);
  border-color: var(--border-strong, rgba(255, 255, 255, 0.16));
}

.btn-danger:hover:not(:disabled) {
  background: var(--color-error-500, #ef4444);
  border-color: var(--color-error-500, #ef4444);
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1rem;
}

/* Form control class (used by form-control elements) */
.form-control {
  width: 100%;
  padding: 0.5rem 1rem;
  font-family: var(--font-family-sans, inherit);
  font-size: 0.875rem;
  color: var(--text-primary, #fafafa);
  background: var(--input-bg, #27272a);
  border: 1px solid var(--input-border, rgba(255, 255, 255, 0.1));
  border-radius: 8px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--border-focus, var(--color-primary-400, #a78bfa));
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.form-control::placeholder {
  color: var(--text-muted, #52525b);
}

/* Status badge semantic variants */
.status-badge.status-available,
.status-badge.status-paid,
.status-badge.status-completed,
.status-badge.status-success {
  background: var(--badge-success-bg, rgba(16, 185, 129, 0.15));
  color: var(--badge-success-text, #34d399);
}

.status-badge.status-pending,
.status-badge.status-processing,
.status-badge.status-warning {
  background: var(--badge-warning-bg, rgba(245, 158, 11, 0.15));
  color: var(--badge-warning-text, #fbbf24);
}

.status-badge.status-failed,
.status-badge.status-error,
.status-badge.status-unhealthy,
.status-badge.status-offline {
  background: var(--badge-error-bg, rgba(239, 68, 68, 0.15));
  color: var(--badge-error-text, #f87171);
}

.status-badge.status-busy,
.status-badge.status-running,
.status-badge.status-info {
  background: var(--badge-info-bg, rgba(59, 130, 246, 0.15));
  color: var(--badge-info-text, #60a5fa);
}

/* Tier Badges */
.tier-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 4px;
}

.tier-badge.tier-s {
  background: linear-gradient(135deg, #a78bfa, #06b6d4);
  color: #fafafa;
}

.tier-badge.tier-a {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  color: #fafafa;
}

.tier-badge.tier-b {
  background: linear-gradient(135deg, #22d3ee, #0891b2);
  color: #09090b;
}

.tier-badge.tier-c {
  background: var(--bg-overlay, #3f3f46);
  color: var(--text-secondary, #a1a1aa);
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
}

.stat-item {
  text-align: center;
  padding: 1rem;
  background: var(--bg-elevated, #27272a);
  border-radius: 8px;
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.06));
}

.stat-value.total { color: var(--color-primary-400, #a78bfa); }
.stat-value.pending { color: var(--color-accent-500, #06b6d4); }
.stat-value.paid { color: var(--color-success-500, #10b981); }

/* Dashboard Row */
.dashboard-row {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.dashboard-row > * {
  flex: 1;
  min-width: 300px;
}

/* Modal Actions */
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.06));
}

/* Connect Status Icons */
.status-icon {
  width: 48px;
  height: 48px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.status-icon.success {
  background: var(--badge-success-bg, rgba(16, 185, 129, 0.15));
  color: var(--badge-success-text, #34d399);
}

.status-icon.warning {
  background: var(--badge-warning-bg, rgba(245, 158, 11, 0.15));
  color: var(--badge-warning-text, #fbbf24);
}

.help-text {
  font-size: 0.875rem;
  color: var(--text-tertiary, #71717a);
}

/* Spinner sizes */
.spinner-sm { width: 16px; height: 16px; }
.spinner-md { width: 24px; height: 24px; }
.spinner-lg { width: 40px; height: 40px; }

/* API Key Display */
.api-key-display {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
  background: var(--bg-elevated, #27272a);
  border-radius: 8px;
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.06));
  margin: 1rem 0;
}

.api-key-value {
  flex: 1;
  font-family: var(--font-family-mono, 'JetBrains Mono', monospace);
  font-size: 0.875rem;
  word-break: break-all;
}

.key-prefix {
  font-family: var(--font-family-mono, 'JetBrains Mono', monospace);
  font-size: 0.75rem;
  color: var(--text-secondary, #a1a1aa);
}

/* Navbar Brand & Actions */
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-text {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary, #fafafa);
  letter-spacing: -0.02em;
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-email {
  font-size: 0.875rem;
  color: var(--text-secondary, #a1a1aa);
}

/* Theme Toggle */
.theme-toggle {
  padding: 0.5rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle svg {
  transition: transform 0.25s ease;
}

.theme-toggle:hover svg {
  transform: rotate(15deg);
}

/* Page Layout */
.page-layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-content {
  flex: 1;
  padding: 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

/* Loading Message */
.loading-message {
  color: var(--text-tertiary, #71717a);
  font-size: 0.875rem;
}

/* Empty State Box */
.empty-state-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  text-align: center;
  background: var(--bg-elevated, #27272a);
  border-radius: 12px;
  border: 1px dashed var(--border-default, rgba(255, 255, 255, 0.1));
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-message {
  color: var(--text-tertiary, #71717a);
  margin-bottom: 1.5rem;
}

/* Alert */
.alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.alert-info {
  background: var(--badge-info-bg, rgba(59, 130, 246, 0.15));
  border: 1px solid var(--badge-info-text, #60a5fa);
  color: var(--badge-info-text, #60a5fa);
}

.alert-success {
  background: var(--badge-success-bg, rgba(16, 185, 129, 0.15));
  border: 1px solid var(--badge-success-text, #34d399);
  color: var(--badge-success-text, #34d399);
}

.alert-warning {
  background: var(--badge-warning-bg, rgba(245, 158, 11, 0.15));
  border: 1px solid var(--badge-warning-text, #fbbf24);
  color: var(--badge-warning-text, #fbbf24);
}

.alert-error {
  background: var(--badge-error-bg, rgba(239, 68, 68, 0.15));
  border: 1px solid var(--badge-error-text, #f87171);
  color: var(--badge-error-text, #f87171);
}

.alert-dismiss {
  background: transparent;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  opacity: 0.7;
  color: inherit;
}

.alert-dismiss:hover {
  opacity: 1;
}

/* Confirm Dialog */
.confirm-dialog {
  text-align: center;
}

.confirm-dialog h3 {
  margin-bottom: 1rem;
}

.confirm-dialog p {
  margin-bottom: 1.5rem;
}

/* Responsive additions */
@media (max-width: 768px) {
  .dashboard-row {
    flex-direction: column;
  }

  .dashboard-row > * {
    min-width: auto;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ===== Utility Classes (Phase 2) ===== */

.gradient-text {
  background: var(--gradient-primary, linear-gradient(135deg, #7c3aed, #06b6d4));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.btn-gradient {
  background: var(--gradient-primary, linear-gradient(135deg, #7c3aed, #06b6d4));
  color: white;
  border: none;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-gradient:hover {
  background: var(--gradient-primary-hover, linear-gradient(135deg, #8b5cf6, #22d3ee));
  box-shadow: var(--shadow-glow, 0 0 20px rgba(139, 92, 246, 0.4));
}

.glass-card {
  background: var(--glass-bg, rgba(24, 24, 27, 0.8));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.08));
  border-radius: 12px;
}

@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fade-in-up 0.4s ease-out both;
}

/* Stagger delay utilities */
.animate-delay-1 { animation-delay: 0.05s; }
.animate-delay-2 { animation-delay: 0.1s; }
.animate-delay-3 { animation-delay: 0.15s; }
.animate-delay-4 { animation-delay: 0.2s; }

/* Semantic text color utilities */
.text-success { color: var(--color-success-500, #10b981); }
.text-warning { color: var(--color-warning-500, #f59e0b); }
.text-danger { color: var(--color-error-500, #ef4444); }
.text-info { color: var(--color-info-500, #3b82f6); }
.text-muted { color: var(--text-tertiary, #71717a); }

/* ===== Integrations Page ===== */

.integrations-page {
  max-width: 900px;
}

.integration-card {
  transition: border-color 0.2s ease;
}

.integration-card:hover {
  border-color: var(--color-primary-600, #8b5cf6);
}

.integration-code-block {
  position: relative;
}

.integration-code-block pre {
  white-space: pre-wrap;
  word-break: break-all;
}

.copy-snippet-btn {
  opacity: 0;
  transition: opacity 0.2s ease;
}

.integration-code-block:hover .copy-snippet-btn {
  opacity: 1;
}

/* ===== Phase 3: UI/UX Polish ===== */

/* -- Skeleton Loading Screens -- */
.skeleton {
  background: linear-gradient(90deg,
    var(--bg-elevated, #27272a) 25%,
    var(--bg-hover, #3f3f46) 50%,
    var(--bg-elevated, #27272a) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: 4px;
}

.skeleton-text {
  height: 1rem;
  margin-bottom: 0.5rem;
  width: 100%;
}

.skeleton-text:last-child {
  width: 60%;
}

.skeleton-heading {
  height: 1.5rem;
  width: 40%;
  margin-bottom: 1rem;
}

.skeleton-stat {
  height: 3rem;
  border-radius: 8px;
}

.skeleton-card {
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid var(--border-primary, #27272a);
}

@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* -- GPU Heartbeat Pulse -- */
.heartbeat-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 0.5rem;
  vertical-align: middle;
}

.heartbeat-dot.online {
  background: var(--color-success-500, #10b981);
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
  animation: heartbeat-pulse 2s ease-in-out infinite;
}

.heartbeat-dot.busy {
  background: var(--color-warning-500, #f59e0b);
}

.heartbeat-dot.offline {
  background: var(--text-muted, #71717a);
}

@keyframes heartbeat-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
}

/* -- Usage Progress Meter -- */
.usage-meter {
  margin-top: 0.75rem;
}

.usage-meter-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted, #71717a);
  margin-bottom: 0.35rem;
}

.usage-meter-track {
  height: 8px;
  background: var(--bg-tertiary, #27272a);
  border-radius: 4px;
  overflow: hidden;
}

.usage-meter-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
  background: linear-gradient(90deg, var(--color-primary-600, #8b5cf6), var(--color-accent-500, #06b6d4));
}

.usage-meter-fill.warning {
  background: linear-gradient(90deg, var(--color-warning-500, #f59e0b), var(--color-error-500, #ef4444));
}

.usage-meter-fill.critical {
  background: var(--color-error-500, #ef4444);
}

/* -- Page Transitions -- */
.main-content {
  animation: page-fade-in 0.2s ease-out;
}

@keyframes page-fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* -- Streaming Token Display -- */
.streaming-output {
  font-family: inherit;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

.streaming-cursor {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  background: var(--color-primary-600, #8b5cf6);
  animation: cursor-blink 1s step-end infinite;
  vertical-align: text-bottom;
  margin-left: 1px;
}

@keyframes cursor-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* -- Earnings Sparkline -- */
.sparkline-container {
  height: 40px;
  display: flex;
  align-items: flex-end;
  gap: 2px;
}

.sparkline-bar {
  flex: 1;
  min-width: 4px;
  background: var(--color-primary-600, #8b5cf6);
  border-radius: 2px 2px 0 0;
  transition: height 0.3s ease;
  opacity: 0.7;
}

.sparkline-bar:hover {
  opacity: 1;
}

/* -- Empty State Box (enhanced) -- */
.empty-state-box {
  text-align: center;
  padding: 2.5rem 1.5rem;
  color: var(--text-muted, #71717a);
}

.empty-state-box .empty-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  opacity: 0.6;
}

.empty-state-box .empty-message {
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
}

/* -- Stat Card Fade-in (stagger) -- */
.dashboard-grid .stat-card {
  animation: stat-fade-in 0.4s ease-out both;
}

.dashboard-grid .stat-card:nth-child(1) { animation-delay: 0s; }
.dashboard-grid .stat-card:nth-child(2) { animation-delay: 0.08s; }
.dashboard-grid .stat-card:nth-child(3) { animation-delay: 0.16s; }
.dashboard-grid .stat-card:nth-child(4) { animation-delay: 0.24s; }

@keyframes stat-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* -- Button loading state -- */
.btn-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.85;
}

.btn-loading::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  top: 50%;
  right: 0.75rem;
  margin-top: -7px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: btn-spin 0.6s linear infinite;
}

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

/* -- Reduced motion -- */
@media (prefers-reduced-motion: reduce) {
  .skeleton,
  .heartbeat-dot.online,
  .streaming-cursor,
  .dashboard-grid .stat-card,
  .main-content {
    animation: none !important;
  }
  .usage-meter-fill {
    transition: none !important;
  }
}
