:root {
  --bg: #0a0a0c;
  --surface: #121214;
  --surface-2: #1a1a1e;
  --accent: #e8a838;
  --accent-dim: rgba(232, 168, 56, 0.15);
  --text: #f5f5f4;
  --muted: #78716c;
  --danger: #f87171;
  --ok: #4ade80;
  --border: rgba(232, 168, 56, 0.12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
}

header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

h1 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.subtitle {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

input, textarea, select, button {
  font: inherit;
}

input, textarea, select {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
}

input:focus, textarea:focus, select:focus {
  outline: 2px solid var(--accent-dim);
  border-color: var(--accent);
}

button {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 8px;
  padding: 0.5rem 0.9rem;
  cursor: pointer;
}

button.primary {
  background: var(--accent);
  color: #1a1204;
  border-color: transparent;
  font-weight: 600;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

main {
  padding: 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
}

.status {
  min-height: 1.25rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.status.error { color: var(--danger); }
.status.ok { color: var(--ok); }

.samples-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.samples-table th,
.samples-table td {
  text-align: left;
  padding: 0.65rem 0.5rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.samples-table th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.thumb {
  width: 72px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--surface-2);
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
}

.badge.published { background: rgba(74, 222, 128, 0.15); color: var(--ok); }
.badge.draft { background: rgba(248, 113, 113, 0.12); color: var(--danger); }

.tag {
  display: inline-block;
  margin: 0.1rem 0.2rem 0.1rem 0;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 0.75rem;
}

.row-actions {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

dialog {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  padding: 0;
  width: min(520px, calc(100vw - 2rem));
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.65);
}

.dialog-body {
  padding: 1.25rem;
}

.dialog-body h2 {
  margin: 0 0 1rem;
  font-size: 1rem;
  color: var(--accent);
}

.form-grid {
  display: grid;
  gap: 0.75rem;
}

.form-grid label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1rem;
}

.settings-panel {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.settings-panel summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 600;
}

@media (max-width: 720px) {
  .samples-table thead { display: none; }
  .samples-table tr {
    display: block;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
  }
  .samples-table td {
    display: block;
    border: none;
    padding: 0.25rem 0;
  }
}
