:root {
  --primary: #2563eb;
  --bg: #ffffff;
  --fg: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --error: #dc2626;
  --success: #16a34a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--fg);
  min-height: 100vh;
}

header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}

header h1 { font-size: 1.25rem; margin: 0; }
header nav { display: flex; gap: 0.5rem; }
header a, header button {
  padding: 0.5rem 0.75rem; border-radius: 6px;
  text-decoration: none; color: var(--fg); font: inherit;
  background: transparent; border: 1px solid transparent; cursor: pointer;
}
header a[aria-current="page"] { background: var(--primary); color: white; }

main { padding: 1rem; max-width: 720px; margin: 0 auto; }

body.login main {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 90vh;
}
body.login form {
  display: flex; flex-direction: column; gap: 0.75rem; width: 100%; max-width: 320px;
}
body.login label { display: flex; flex-direction: column; font-weight: 500; }
body.login input {
  margin-top: 0.25rem; padding: 0.6rem; border: 1px solid var(--border); border-radius: 6px;
  font-size: 1rem;
}
body.login button {
  background: var(--primary); color: white; border: none; padding: 0.6rem;
  border-radius: 6px; font-size: 1rem; cursor: pointer;
}
body.login #error { color: var(--error); margin: 0; }

#dropzone {
  border: 2px dashed var(--border); border-radius: 12px;
  padding: 3rem 1rem; text-align: center; cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
#dropzone:hover, #dropzone.dragover {
  border-color: var(--primary); background: rgba(37, 99, 235, 0.04);
}
#dropzone p { margin: 0 0 1rem; color: var(--muted); }
.btn {
  display: inline-block; background: var(--primary); color: white;
  padding: 0.6rem 1rem; border-radius: 6px; cursor: pointer;
}

#status-list { list-style: none; padding: 0; margin: 1.5rem 0 0; }
#status-list li {
  padding: 0.5rem 0.75rem; border: 1px solid var(--border);
  border-radius: 6px; margin-bottom: 0.5rem;
  display: flex; align-items: center; justify-content: space-between;
}
.status-uploading { color: var(--muted); }
.status-done { color: var(--success); }
.status-error { color: var(--error); }

table {
  width: 100%; border-collapse: collapse; margin-top: 1rem; font-size: 0.95rem;
}
th, td { text-align: left; padding: 0.5rem 0.5rem; border-bottom: 1px solid var(--border); }
th { background: #f9fafb; font-weight: 600; }
.badge {
  display: inline-block; padding: 0.15rem 0.5rem; border-radius: 999px;
  font-size: 0.8rem; background: var(--border); color: var(--fg);
}
.badge.done { background: #dcfce7; color: #166534; }
.badge.uploaded { background: #dbeafe; color: #1e40af; }
.badge.classifying { background: #fef3c7; color: #92400e; }
.badge.needs_review { background: #fee2e2; color: #991b1b; }
.badge.failed { background: #f3f4f6; color: #374151; }

.app-version {
  position: fixed; bottom: 0; right: 0;
  padding: 0.25rem 0.6rem;
  font-size: 0.72rem; color: var(--muted);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  background: rgba(255, 255, 255, 0.85);
  border-top-left-radius: 6px;
  pointer-events: auto;
}
.app-version a { color: inherit; text-decoration: none; }
.app-version a:hover { color: var(--primary); text-decoration: underline; }
