:root {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  color: #121212;
  background-color: #f7f8fa;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Skeleton loading styles */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: 4px;
}

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

.skeleton-card {
  height: 120px;
  margin-bottom: 1rem;
}

.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

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

.dark .skeleton {
  background: linear-gradient(90deg, #374151 25%, #4b5563 50%, #374151 75%);
  background-size: 200% 100;
}

/* Dark mode variables */
.dark {
  --bg-primary: #1f2937;
  --bg-secondary: #374151;
  --bg-card: #111827;
  --text-primary: #f9fafb;
  --text-secondary: #d1d5db;
  --text-muted: #9ca3af;
  --border-color: #4b5563;
  --hover-bg: #374151;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, #f7f8fa 0%, #eef1f6 100%);
  transition: background-color 0.3s ease;
}

/* Dark mode body */
.dark body {
  background: linear-gradient(180deg, #1f2937 0%, #111827 100%);
  color: var(--text-primary);
}

#app {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 24px 64px;
}

.page-header {
  margin-bottom: 32px;
}

.page-header__nav {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
  align-items: center;
}

.page-header__nav a {
  font-size: 0.85rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  color: #5a6575;
  text-decoration: none;
  transition: background 150ms ease, color 150ms ease;
}

.dark .page-header__nav a {
  color: var(--text-secondary);
}

.page-header__nav a:hover {
  background: rgba(37, 99, 235, 0.08);
  color: #2563eb;
}

.dark .page-header__nav a:hover {
  background: rgba(37, 99, 235, 0.15);
  color: #60a5fa;
}

.page-header__nav .back-link {
  border: 1px solid #d1d5db;
  color: #374151;
}

.dark .page-header__nav .back-link {
  border-color: var(--border-color);
  color: var(--text-secondary);
}

.page-header__nav .back-link:hover {
  border-color: #2563eb;
  color: #2563eb;
  background: rgba(37, 99, 235, 0.06);
}

.dark .page-header__nav .back-link:hover {
  border-color: #60a5fa;
  color: #60a5fa;
  background: rgba(37, 99, 235, 0.12);
}

.page-header h1 {
  font-size: 2.4rem;
  margin: 0 0 0.5rem;
  color: #1d2736;
}

.dark .page-header h1 {
  color: var(--text-primary);
}

.page-header p {
  margin: 0;
  color: #5a6575;
}

.dark .page-header p {
  color: var(--text-secondary);
}

.page-header-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
}

.page-header-title {
  flex: 1;
}

.dark-mode-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(59, 130, 246, 0.1);
  border: 2px solid #2563eb;
  border-radius: 999px;
  color: #2563eb;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.9rem;
  font-weight: 500;
}

.dark .dark-mode-toggle {
  background: rgba(59, 130, 246, 0.15);
  border-color: #60a5fa;
  color: #60a5fa;
}

.dark-mode-toggle:hover {
  background: rgba(59, 130, 246, 0.15);
  transform: translateY(-1px);
}

.dark .dark-mode-toggle:hover {
  background: rgba(59, 130, 246, 0.2);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 12px 24px rgba(18, 24, 32, 0.08);
  transition: background-color 0.3s ease;
}

.dark .stat-card {
  background: var(--bg-card);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
}

.stat-card h2 {
  margin: 0 0 12px;
  font-size: 1rem;
  color: #64748b;
}

.dark .stat-card h2 {
  color: var(--text-muted);
}

.stat-card strong {
  font-size: 1.8rem;
  color: #1d2736;
}

.dark .stat-card strong {
  color: var(--text-primary);
}

.stat-card span {
  display: block;
  margin-top: 6px;
  color: #8895a7;
  font-size: 0.9rem;
}

.dark .stat-card span {
  color: var(--text-secondary);
}

.panel {
  background: #ffffff;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
  transition: background-color 0.3s ease;
}

.dark .panel {
  background: var(--bg-card);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.panel h2 {
  margin: 0 0 16px;
  font-size: 1.4rem;
  color: #1d2736;
}

.dark .panel h2 {
  color: var(--text-primary);
}

.offers-table {
  width: 100%;
  border-collapse: collapse;
}

.offers-table th,
.offers-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid #e5e9f1;
}

.dark .offers-table th,
.dark .offers-table td {
  border-bottom-color: var(--border-color);
}

.offers-table th {
  color: #64748b;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.dark .offers-table th {
  color: var(--text-muted);
}

.offers-table tbody tr:hover {
  background-color: rgba(99, 102, 241, 0.08);
}

.dark .offers-table tbody tr:hover {
  background-color: var(--hover-bg);
}

.offer-card {
  background: #ffffff;
  border: 1px solid #e5e9f1;
  border-radius: 14px;
  padding: 20px;
  transition: box-shadow 200ms ease, transform 200ms ease;
}

.dark .offer-card {
  background: var(--bg-card);
  border-color: var(--border-color);
}

.offer-card:hover {
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.12);
  transform: translateY(-2px);
}

.offer-gpu-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: #1d2736;
}

.dark .offer-gpu-name {
  color: var(--text-primary);
}

.offer-provider {
  font-size: 0.85rem;
  color: #64748b;
  margin-bottom: 16px;
}

.dark .offer-provider {
  color: var(--text-secondary);
}

.offer-specs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  background: #f8fafc;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 16px;
}

.dark .offer-specs {
  background: var(--bg-secondary);
}

.spec-label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  margin-bottom: 4px;
}

.dark .spec-label {
  color: var(--text-muted);
}

.spec-value {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  color: #1e293b;
}

.dark .spec-value {
  color: var(--text-primary);
}

.offer-price {
  font-size: 1.3rem;
  font-weight: 700;
  color: #6366f1;
}

.dark .offer-price {
  color: #a78bfa;
}

.offer-price small {
  font-size: 0.75rem;
  font-weight: 500;
  color: #94a3b8;
}

.dark .offer-price small {
  color: var(--text-muted);
}

.offer-sla {
  font-size: 0.8rem;
  color: #64748b;
}

.dark .offer-sla {
  color: var(--text-secondary);
}

.model-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 500;
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #e2e8f0;
}

.dark .model-tag {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-color: var(--border-color);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}

.status-open {
  background-color: rgba(34, 197, 94, 0.12);
  color: #15803d;
}

.status-reserved {
  background-color: rgba(59, 130, 246, 0.12);
  color: #1d4ed8;
}

.dark .status-reserved {
  background-color: rgba(59, 130, 246, 0.2);
  color: #1d4ed8;
}

.bid-form {
  display: grid;
  gap: 16px;
}

.bid-form label {
  font-weight: 600;
  color: #374151;
  display: block;
  margin-bottom: 6px;
}

.dark .bid-form label {
  color: var(--text-primary);
}

.bid-form input,
.bid-form select,
.bid-form textarea {
  width: 100%;
  border-radius: 10px;
  border: 1px solid #d1d9e6;
  padding: 10px 12px;
  font-size: 1rem;
  font-family: inherit;
  background-color: #f9fbff;
}

.dark .bid-form input,
.dark .bid-form select,
.dark .bid-form textarea {
  border-color: var(--border-color);
  background-color: var(--bg-secondary);
  color: var(--text-primary);
}

.bid-form button {
  justify-self: flex-start;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #ffffff;
  border: none;
  border-radius: 999px;
  padding: 10px 20px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.bid-form button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(99, 102, 241, 0.3);
}

.empty-state {
  padding: 24px;
  text-align: center;
  color: #6b7280;
  border: 1px dashed #cbd5f5;
  border-radius: 12px;
  background-color: rgba(99, 102, 241, 0.05);
}

.dark .empty-state {
  color: var(--text-secondary);
  border-color: var(--border-color);
  background-color: rgba(99, 102, 241, 0.1);
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 14px 18px;
  background: #111827;
  color: #ffffff;
  border-radius: 12px;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.3);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 200ms ease, transform 200ms ease;
}

.dark .toast {
  background: var(--bg-card);
  color: var(--text-primary);
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 720px) {
  #app {
    padding: 32px 16px 48px;
  }

  .dashboard-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }

  .offers-table th,
  .offers-table td {
    padding: 10px 12px;
    font-size: 0.95rem;
  }
}
