:root {
  --bg: #0d1117;
  --surface: #161b22;
  --surface-2: #1f262f;
  --border: #2a313a;
  --text: #e6edf3;
  --muted: #8b949e;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --danger: #b91c1c;
  --success: #16a34a;
  --warning: #d97706;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.45;
}

button {
  font: inherit;
  background: var(--accent);
  color: #fff;
  border: 0;
  padding: .55rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background .15s;
}
button:hover:not(:disabled) { background: var(--accent-hover); }
button:disabled { opacity: .5; cursor: not-allowed; }

button.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
button.ghost:hover { background: var(--surface-2); }

button.danger { background: var(--danger); }
button.danger:hover { background: #991b1b; }

input, textarea {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  padding: .55rem .75rem;
  border-radius: 6px;
  font: inherit;
  width: 100%;
}
input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }

textarea { font-family: ui-monospace, "SF Mono", monospace; font-size: 13px; resize: vertical; }

label { display: block; margin-bottom: .8rem; }
label > input { margin-top: .3rem; }

.screen { min-height: 100vh; padding: 2rem; max-width: 1100px; margin: 0 auto; }

#login { display: flex; align-items: center; justify-content: center; }
#login .card { width: 100%; max-width: 360px; }

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

h1 { margin: 0 0 1rem; font-size: 1.5rem; font-weight: 600; }
h2 { margin: 0 0 1rem; font-size: 1.1rem; font-weight: 600; }
h3 { margin: 0 0 .5rem; font-size: 1rem; font-weight: 600; }

#dashboard > header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 2rem;
}
#dashboard > header h1 { margin: 0; }
#dashboard > header > div { display: flex; gap: 1rem; align-items: center; }
#user-email { color: var(--muted); font-size: .85rem; }

.section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.section-head h2 { margin: 0; }

#upload-zone { display: flex; gap: 1rem; align-items: center; }
#picked-file-name { color: var(--muted); }
#upload-progress-wrap { margin-top: 1rem; display: flex; gap: 1rem; align-items: center; }
#upload-progress { flex: 1; height: 8px; }
#upload-progress::-webkit-progress-bar { background: var(--surface-2); border-radius: 4px; }
#upload-progress::-webkit-progress-value { background: var(--accent); border-radius: 4px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .7rem .6rem; text-align: left; border-bottom: 1px solid var(--border); }
th { font-weight: 500; color: var(--muted); font-size: .85rem; }
tbody tr:last-child td { border-bottom: none; }
td .actions { display: flex; gap: .4rem; }
td button { padding: .35rem .7rem; font-size: .85rem; }

.status {
  display: inline-block; padding: .15rem .55rem; border-radius: 999px;
  font-size: .75rem; font-weight: 500; text-transform: uppercase; letter-spacing: .03em;
}
.status-uploading  { background: #1e293b; color: #93c5fd; }
.status-queued     { background: #1f1f3f; color: #c4b5fd; }
.status-processing { background: #422006; color: #fbbf24; }
.status-ready      { background: #052e16; color: #4ade80; }
.status-failed     { background: #450a0a; color: #fca5a5; }

.empty { color: var(--muted); text-align: center; padding: 1rem; }
.error { color: #fca5a5; margin: .5rem 0 0; font-size: .85rem; }
.muted { color: var(--muted); }
.small { font-size: .8rem; }

dialog {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem;
  max-width: 600px;
  width: 92%;
}
dialog::backdrop { background: rgba(0,0,0,.6); }
.dialog-actions { display: flex; gap: .5rem; justify-content: flex-end; margin-top: 1rem; }

@media (max-width: 600px) {
  .screen { padding: 1rem; }
  th:nth-child(4), td:nth-child(4),
  th:nth-child(5), td:nth-child(5),
  th:nth-child(6), td:nth-child(6) { display: none; }
}
