:root {
  --bg: #f7f7f5;
  --fg: #1f2328;
  --muted: #6b7280;
  --border: #e2e2df;
  --accent: #2563eb;
  --accent-fg: #ffffff;
  --card: #ffffff;
  --danger: #b91c1c;
  --ok: #15803d;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--fg);
}

header {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px 24px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}

header h1 {
  font-size: 16px;
  margin: 0;
  font-weight: 600;
}

nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  margin-right: 4px;
}

nav a.active, nav a:hover {
  color: var(--accent);
}

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
}

.card h2 {
  margin-top: 0;
  font-size: 15px;
}

label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin: 12px 0 4px;
}

input[type="file"], select, input[type="text"], input[type="number"] {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  background: #fff;
}

button {
  margin-top: 16px;
  padding: 9px 16px;
  background: var(--accent);
  color: var(--accent-fg);
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
}

button:disabled { opacity: 0.5; cursor: default; }
button.secondary { background: #eee; color: var(--fg); }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-top: 12px;
}

th, td {
  text-align: left;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.table-scroll { overflow-x: auto; }

.msg { font-size: 13px; margin-top: 10px; }
.msg.error { color: var(--danger); }
.msg.ok { color: var(--ok); }

.progress-wrap { margin-top: 14px; display: none; }
.progress-wrap.active { display: block; }
.progress-track {
  height: 10px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
.progress-bar {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.4s linear;
}
.progress-bar.indeterminate {
  width: 35%;
  position: absolute;
  animation: progress-slide 1.2s ease-in-out infinite;
}
@keyframes progress-slide {
  0% { left: -35%; }
  100% { left: 100%; }
}
.progress-label { font-size: 13px; color: var(--muted); margin-top: 6px; }
.spinner {
  display: inline-block;
  width: 12px; height: 12px;
  border: 2px solid #cbd5e1;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: -2px;
  margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef2ff;
  color: var(--accent);
  font-size: 12px;
}
