:root {
  color-scheme: light;
  --ink: #1e293b;
  --muted: #64748b;
  --line: rgba(226, 232, 240, 0.8);
  --panel: rgba(255, 255, 255, 0.7);
  --wash: #f8fafc;
  --brand: #2563eb;
  --brand-strong: #1d4ed8;
  --brand-light: #eff6ff;
  --accent: #f59e0b;
  --good: #10b981;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

* {
  box-sizing: border-box;
  transition: all 0.2s ease-in-out;
}

body {
  margin: 0;
  background: linear-gradient(135deg, #f0f4f8 0%, #e2e8f0 100%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
}

.app-shell {
  width: min(1440px, calc(100vw - 48px));
  margin: 32px auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.topbar,
.status-panel,
.actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--panel);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.topbar {
  background: linear-gradient(120deg, #ffffff 0%, rgba(255, 255, 255, 0.8) 100%);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: 'Outfit', sans-serif;
}

h1 {
  margin: 0;
  font-size: 32px;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, #1e293b, #3b82f6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

button,
.download {
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--brand);
  color: #fff;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  padding: 12px 24px;
  text-decoration: none;
  box-shadow: 0 4px 14px 0 rgba(37, 99, 235, 0.39);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

button:hover:not(:disabled),
.download:hover {
  background: var(--brand-strong);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

button:active:not(:disabled),
.download:active {
  transform: translateY(0);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
  background: var(--muted);
  box-shadow: none;
  transform: none;
}

.download.secondary {
  background: #475569;
  box-shadow: 0 4px 14px 0 rgba(71, 85, 105, 0.39);
}

.download.secondary:hover {
  background: #334155;
  box-shadow: 0 6px 20px rgba(71, 85, 105, 0.4);
}

.status-panel {
  position: relative;
  overflow: hidden;
}

#statusLabel {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  font-family: 'Outfit', sans-serif;
}

#statusDetail {
  display: block;
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
}

progress {
  width: min(420px, 45vw);
  height: 10px;
  border-radius: 5px;
  overflow: hidden;
  appearance: none;
}
progress::-webkit-progress-bar {
  background-color: var(--line);
  border-radius: 5px;
}
progress::-webkit-progress-value {
  background: linear-gradient(90deg, #10b981, #34d399);
  border-radius: 5px;
  transition: width 0.4s ease;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.metrics div {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.metrics div:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: rgba(59, 130, 246, 0.3);
}

.metrics span {
  display: block;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  font-family: 'Outfit', sans-serif;
}

.metrics strong {
  font-size: 36px;
  font-weight: 800;
  color: var(--brand-strong);
  line-height: 1;
}

.actions {
  justify-content: flex-start;
  gap: 12px;
}

#filterInput {
  margin-left: auto;
  width: min(400px, 40vw);
  border: 2px solid var(--line);
  border-radius: var(--radius-md);
  font-size: 15px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.9);
  outline: none;
  font-family: 'Inter', sans-serif;
}

#filterInput:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.table-shell {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-lg);
  overflow: auto;
  max-height: calc(100vh - 350px);
  box-shadow: var(--shadow-md);
}

table {
  width: 100%;
  min-width: 1180px;
  border-collapse: separate;
  border-spacing: 0;
}

th,
td {
  padding: 16px 20px;
  text-align: left;
  vertical-align: middle;
}

th {
  position: sticky;
  top: 0;
  background: rgba(248, 250, 252, 0.95);
  backdrop-filter: blur(10px);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  z-index: 10;
  border-bottom: 2px solid var(--line);
  font-family: 'Outfit', sans-serif;
}

td {
  font-size: 14px;
  line-height: 1.5;
  border-bottom: 1px solid var(--line);
  color: #334155;
}

tr {
  transition: background-color 0.2s ease;
}

tr:hover td {
  background-color: var(--brand-light);
}

tr:last-child td {
  border-bottom: none;
}

.empty {
  color: var(--muted);
  padding: 60px 28px;
  text-align: center;
  font-size: 16px;
  font-weight: 500;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.3);
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
  background-color: rgba(100, 116, 139, 0.5);
}

@media (max-width: 900px) {
  .app-shell {
    width: calc(100vw - 32px);
    margin: 16px auto;
  }

  .topbar,
  .status-panel,
  .actions {
    align-items: stretch;
    flex-direction: column;
    padding: 20px;
  }

  progress,
  #filterInput {
    width: 100%;
    margin-left: 0;
    margin-top: 12px;
  }

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