:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --text: #1c1e21;
  --muted: #6b7280;
  --border: #e2e4e9;
  --accent: #2563eb;
  --accent-text: #ffffff;
  --good: #16a34a;
  --warn: #d97706;
  --bad: #dc2626;
  --radius: 10px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17181a;
    --card: #232427;
    --text: #f2f3f5;
    --muted: #9aa0a8;
    --border: #35363a;
    --accent: #3b82f6;
    --accent-text: #ffffff;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  padding: 16px;
  max-width: 640px;
  margin-inline: auto;
}

h1 { font-size: 1.25rem; margin: 0 0 4px; }
h2 { font-size: 1.05rem; margin: 0 0 8px; }
p.sub { color: var(--muted); margin: 0 0 20px; font-size: 0.9rem; }

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

label { display: block; font-size: 0.85rem; color: var(--muted); margin-bottom: 4px; margin-top: 12px; }
label:first-child { margin-top: 0; }

input[type="text"], input[type="password"], input[type="date"], select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  background: var(--card);
  color: var(--text);
}

button, .btn {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-text);
  border: none;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  width: 100%;
  margin-top: 16px;
}

button.secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

button.small {
  width: auto;
  padding: 8px 12px;
  font-size: 0.85rem;
  margin-top: 0;
}

button:disabled { opacity: 0.5; cursor: not-allowed; }

.error { color: var(--bad); font-size: 0.85rem; margin-top: 8px; }

.slot {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.slot:last-child { border-bottom: none; }

.slot-thumb {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--bg);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.slot-thumb.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 1.4rem;
}

.slot-info { flex: 1; min-width: 0; }
.slot-label { font-weight: 500; font-size: 0.95rem; }
.slot-status { font-size: 0.8rem; color: var(--muted); }
.slot-status.ok { color: var(--good); }

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge.incomplete { background: #fef3c7; color: #92400e; }
.badge.submitted { background: #dbeafe; color: #1e40af; }
.badge.approved { background: #dcfce7; color: #166534; }
.badge.needs_revision { background: #fee2e2; color: #991b1b; }

.thumb-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.thumb-row img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); }

.queue-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
}
.queue-item:last-child { border-bottom: none; }
.queue-store { font-weight: 600; }
.queue-date { color: var(--muted); font-size: 0.85rem; }

textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 1rem;
  font-family: inherit;
  background: var(--card);
  color: var(--text);
  min-height: 70px;
}

.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.topbar a { color: var(--muted); font-size: 0.85rem; text-decoration: none; }

/* display:none file inputs fail to open the camera/picker on some mobile
   browsers (notably older iOS Safari) -- keep them rendered but invisible. */
.visually-hidden-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
