:root {
  --bg: #111111;
  --surface: #1e1e1e;
  --border: gray;
  --border-strong: gray;
  --text: #f0f0f0;
  --text-muted: #a1a1aa;
  --text-subtle: #71717a;
  --accent: #ffffff;
  --accent-foreground: #000000;
  --success: #4ade80;
  --success-bg: rgba(74, 222, 128, 0.15);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.15);
  --warning-bg: rgba(250, 204, 21, 0.15);
  --warning-text: #fef08a;
  --radius: 8px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 20px 80px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 0.5px solid var(--border);
  background: var(--surface);
}
.topbar h1 { font-size: 15px; margin: 0; font-weight: 600; letter-spacing: -0.01em; }
.topbar nav { display: flex; gap: 16px; align-items: center; }
.topbar nav a { font-size: 13px; color: var(--text-muted); text-decoration: none; }
.topbar nav a:hover, .topbar nav a.active { color: var(--text); }

h2 { font-size: 18px; font-weight: 600; margin: 32px 0 16px; letter-spacing: -0.01em; }
h3 { font-size: 14px; font-weight: 600; margin: 0 0 8px; }
.muted { color: var(--text-muted); font-size: 13px; }
.subtle { color: var(--text-subtle); font-size: 12px; }

.card {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  background: var(--surface);
  color: var(--text);
  border: 0.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.btn:hover { background: #27272a; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
  background: var(--accent);
  color: var(--accent-foreground);
  border-color: var(--accent);
}
.btn-primary:hover { background: #000; }
.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-success:hover { background: #15803d; }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { background: #b91c1c; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: #27272a; color: var(--text); }

.input, .textarea, select {
  width: 100%;
  padding: 8px 10px;
  font: inherit;
  font-size: 13px;
  background: var(--surface);
  color: var(--text);
  border: 0.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  outline: none;
}
.input:focus, .textarea:focus, select:focus { border-color: var(--text); }
.textarea { min-height: 70px; resize: vertical; font-family: var(--font); }
label { display: block; font-size: 12px; font-weight: 500; margin-bottom: 4px; color: var(--text-muted); }

.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 180px; }

.radio-group { display: flex; gap: 12px; flex-wrap: wrap; }
.radio-group label {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 10px; border: 0.5px solid var(--border-strong);
  border-radius: var(--radius-sm); cursor: pointer; font-size: 13px;
  color: var(--text); margin: 0;
}
.radio-group input[type=radio] { accent-color: var(--accent); }
.radio-group label:has(input:checked) { background: var(--text); color: #fff; border-color: var(--text); }

/* Dropzone */
.dropzone {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 40px 20px;
  text-align: center;
  background: var(--surface);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.dropzone:hover, .dropzone.dragover { background: #27272a; border-color: var(--text); }
.dropzone .icon { font-size: 28px; margin-bottom: 8px; opacity: 0.4; }
.dropzone p { margin: 4px 0; color: var(--text-muted); font-size: 13px; }

/* Grid of cards */
.grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (max-width: 720px) {
  .grid { grid-template-columns: 1fr; }
}
.mini-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

/* Sample form card */
.sample-card { display: flex; flex-direction: column; gap: 12px; }
.sample-card .thumb-row { display: flex; gap: 12px; align-items: center; }
.sample-card img.thumb {
  width: 96px; height: 96px; object-fit: cover;
  border-radius: var(--radius-sm); border: 0.5px solid var(--border);
}
.sample-card .filename { font-size: 12px; color: var(--text-muted); word-break: break-all; }

/* Mini card */
.mini-card {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex; flex-direction: column;
}
.mini-card img { width: 100%; height: 140px; object-fit: cover; display: block; background: #27272a; }
.mini-card .body { padding: 10px 12px; font-size: 12px; }
.mini-card .row-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; }

.badge {
  display: inline-block; font-size: 11px; padding: 2px 8px;
  border-radius: 999px; border: 0.5px solid var(--border-strong);
  background: var(--surface); color: var(--text-muted);
}
.badge-pending { background: var(--warning-bg); color: var(--warning-text); border-color: transparent; }
.badge-approved { background: var(--success-bg); color: var(--success); border-color: transparent; }
.badge-rejected { background: var(--danger-bg); color: var(--danger); border-color: transparent; }

/* Folder list */
.folder-list { display: flex; flex-direction: column; gap: 6px; }
.folder-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px; border: 0.5px solid var(--border);
  border-radius: var(--radius-sm); background: var(--surface);
  cursor: pointer; transition: background 0.15s;
}
.folder-item:hover { background: #27272a; }
.folder-item .count { color: var(--text-muted); font-size: 12px; }

/* Auth pages */
.auth-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px;
}
.auth-card {
  width: 100%; max-width: 380px;
  background: var(--surface); border: 0.5px solid var(--border);
  border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow);
}
.auth-card h1 { font-size: 18px; margin: 0 0 4px; font-weight: 600; }
.auth-card .sub { color: var(--text-muted); font-size: 13px; margin-bottom: 20px; }
.auth-card form { display: flex; flex-direction: column; gap: 12px; }

/* Tinder mode */
.tinder-stage {
  position: relative;
  height: 540px;
  display: flex; align-items: center; justify-content: center;
  user-select: none;
}
.tinder-card {
  position: absolute;
  width: min(420px, 92vw); height: 500px;
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
  overflow: hidden;
  display: flex; flex-direction: column;
  cursor: grab;
  touch-action: none;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.tinder-card.grabbing { cursor: grabbing; transition: none; }
.tinder-card img { width: 100%; height: 300px; object-fit: cover; background: #27272a; }
.tinder-card .meta { padding: 14px; font-size: 13px; flex: 1; overflow-y: auto; }
.tinder-card .meta dt { font-weight: 600; color: var(--text); font-size: 12px; margin-top: 6px; }
.tinder-card .meta dd { margin: 0 0 4px; color: var(--text-muted); font-size: 12px; }
.tinder-overlay {
  position: absolute; inset: 0;
  pointer-events: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 42px; font-weight: 700;
  opacity: 0;
  transition: opacity 0.1s;
}
.tinder-overlay.approve { background: rgba(22, 163, 74, 0.18); color: var(--success); }
.tinder-overlay.reject { background: rgba(220, 38, 38, 0.18); color: var(--danger); }

.tinder-actions {
  display: flex; gap: 16px; justify-content: center; margin-top: 16px;
}
.tinder-actions button {
  width: 56px; height: 56px; border-radius: 50%;
  font-size: 22px; padding: 0; display: flex; align-items: center; justify-content: center;
}

.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: var(--text); color: #fff;
  padding: 10px 16px; border-radius: var(--radius-sm);
  font-size: 13px; box-shadow: 0 4px 12px rgba(0,0,0,0.18);
  opacity: 0; pointer-events: none; transition: opacity 0.2s;
  z-index: 1000;
}
.toast.show { opacity: 1; }
.toast.error { background: var(--danger); }

.empty {
  text-align: center; padding: 40px 20px; color: var(--text-muted); font-size: 13px;
}

.section-divider { height: 0.5px; background: var(--border); margin: 24px 0; }

.users-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.users-table th, .users-table td {
  text-align: left; padding: 8px 10px; border-bottom: 0.5px solid var(--border);
}
.users-table th { color: var(--text-muted); font-weight: 500; font-size: 12px; }

.note {
  padding: 12px 14px; background: var(--warning-bg); color: var(--warning-text);
  border-radius: var(--radius-sm); font-size: 12px; margin-bottom: 16px;
}

.spinner {
  width: 14px; height: 14px;
  border: 2px solid var(--border-strong); border-top-color: var(--text);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

.hidden { display: none !important; }
