:root {
  --ink: #0a0a0a;
  --muted: #5c6370;
  --line: #e5e7eb;
  --bg: #f5f5f7;
  --card: #fff;
  --accent: #0066cc;
  --accent-hover: #005bb8;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: Poppins, "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.card {
  width: min(420px, 100%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.brand-lockup,
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-weight: 700;
}

.brand-lockup span,
.brand span {
  font-size: 22px;
  letter-spacing: -0.03em;
  line-height: 1;
}

.logo,
.brand img {
  display: block;
  height: 36px;
  width: auto;
  max-width: 180px;
  object-fit: contain;
  object-position: left center;
}

h1 { font-size: 22px; margin: 8px 0 0; font-weight: 650; }
.muted { color: var(--muted); margin: 0 0 12px; font-size: 14px; }

label { font-size: 13px; font-weight: 600; margin-top: 8px; }

input[type="text"],
input[type="password"] {
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  font-size: 15px;
}

button,
.button,
.file-btn {
  margin-top: 16px;
  height: 44px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  text-decoration: none;
}

button:hover,
.button:hover,
.file-btn:hover {
  background: var(--accent-hover);
  text-decoration: none;
  color: #fff;
}

button:disabled,
.button:disabled,
button:disabled:hover,
.button:disabled:hover,
.button.secondary:disabled:hover {
  opacity: 0.45;
  cursor: not-allowed;
  background: transparent;
}

button.ghost,
.button.secondary {
  margin: 0;
  height: 36px;
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

button.ghost:hover,
.button.secondary:hover {
  background: #e8f3fc;
  color: var(--accent);
}

.alert {
  background: #e8f3fc;
  color: #0a3d73;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
}

.brand:hover { text-decoration: none; }

body.is-busy {
  overflow: hidden;
}

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

.crumb { font-size: 14px; color: var(--muted); }
.crumb span { margin: 0 6px; }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
}

.toolbar form { margin: 0; }

.toolbar button,
.toolbar .button,
.toolbar .file-btn {
  margin-top: 0;
}

.file-btn {
  margin: 0;
  position: relative;
  overflow: hidden;
}

.file-btn input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.buckets { list-style: none; padding: 0; }
.buckets li { margin: 0 0 8px; }
.buckets a {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  color: var(--ink);
  min-height: 44px;
}

.files {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.files th, .files td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

.files th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
}

.files .check {
  width: 44px;
  padding-left: 12px;
  padding-right: 0;
}

.files input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  cursor: pointer;
}

.row-actions { text-align: right; white-space: nowrap; }

.progress-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.4);
  display: grid;
  place-items: center;
  z-index: 1000;
  padding: 24px;
}

.progress-overlay[hidden] {
  display: none !important;
}

.progress-card {
  width: min(420px, 100%);
  background: var(--card);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.16);
}

.progress-label {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 600;
}

.progress-track {
  height: 8px;
  background: var(--line);
  border-radius: 99px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0;
  background: var(--accent);
  border-radius: 99px;
  transition: width 0.15s linear;
}

.progress-overlay.indeterminate .progress-track {
  background: #d7e8f8;
}

.progress-overlay.indeterminate .progress-fill {
  width: 100% !important;
  animation: progress-pulse 1s ease-in-out infinite;
}

.progress-meta {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--muted);
}

@keyframes progress-pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}
