*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --brand:      #0078d4;
  --brand-dark: #005a9e;
  --success:    #107c10;
  --warning:    #797500;
  --surface:    #ffffff;
  --bg:         #f3f2f1;
  --border:     #e1dfdd;
  --text:       #323130;
  --text-muted: #605e5c;
  --radius:     6px;
  --shadow:     0 2px 8px rgba(0,0,0,.08);
}

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ── Top bar ─────────────────────────────────────────────────── */
.topbar {
  background: var(--brand);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  height: 48px;
}
.topbar h1 { font-size: 16px; font-weight: 600; flex: 1; }
.topbar .user-info { font-size: 13px; opacity: .9; }
.topbar button {
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.3);
  color: #fff;
  padding: 4px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13px;
}
.topbar button:hover { background: rgba(255,255,255,.25); }

/* ── Page layout ─────────────────────────────────────────────── */
main { max-width: 900px; margin: 0 auto; padding: 24px 16px; }

/* ── Cards ───────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 24px;
}
.card h2 { font-size: 15px; font-weight: 600; margin-bottom: 16px; }

/* ── Upload area ─────────────────────────────────────────────── */
.upload-drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  transition: border-color .2s, background .2s;
  cursor: pointer;
}
.upload-drop-zone:hover,
.upload-drop-zone.drag-over {
  border-color: var(--brand);
  background: #f0f6ff;
}
.upload-drop-zone p {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 8px;
}
.upload-drop-zone .upload-icon { font-size: 32px; line-height: 1; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: background .15s;
}
.btn-primary   { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-secondary { background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn:disabled  { opacity: .5; cursor: not-allowed; }

/* ── Progress ────────────────────────────────────────────────── */
.progress-wrap {
  margin-top: 16px;
  display: none;
}
.progress-wrap.visible { display: block; }
.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.progress-bar-track {
  background: var(--border);
  border-radius: 99px;
  height: 8px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: var(--brand);
  border-radius: 99px;
  width: 0;
  transition: width .2s;
}

/* ── Files table ─────────────────────────────────────────────── */
.files-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.files-table th {
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  padding: 8px 12px;
  border-bottom: 2px solid var(--border);
}
.files-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.files-table tr:last-child td { border-bottom: none; }
.files-table tr:hover td { background: #faf9f8; }
.files-table .filename { font-weight: 500; word-break: break-all; }
.files-table .date { color: var(--text-muted); white-space: nowrap; }
.files-table .size  { color: var(--text-muted); white-space: nowrap; }

/* ── Status badges ───────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.badge-processing {
  background: #fff4ce;
  color: var(--warning);
}
.badge-completed {
  background: #dff6dd;
  color: var(--success);
}
.badge .spinner {
  width: 10px; height: 10px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin .8s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Empty state ─────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 32px;
  color: var(--text-muted);
  font-size: 14px;
}

/* ── Full-page loading / auth screens ───────────────────────── */
#loading-screen, #auth-screen {
  position: fixed; inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  gap: 16px;
  font-size: 15px;
  color: var(--text-muted);
}
.big-spinner {
  width: 40px; height: 40px;
  border: 4px solid var(--border);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin .9s linear infinite;
}

.hidden { display: none !important; }
