:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --text: #1a1d23;
  --muted: #5c6570;
  --border: #d5dae0;
  --accent: #1f6feb;
  --error: #b42318;
  --mono: "Cascadia Mono", "Consolas", "Liberation Mono", monospace;
  --sans: "Segoe UI", "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  background:
    radial-gradient(ellipse at top left, #e8eef8 0%, transparent 45%),
    var(--bg);
  min-height: 100vh;
}

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.brand {
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.02em;
}

.topbar nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user { color: var(--muted); font-size: 0.9rem; }

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  margin-top: 1.5rem;
}

.card.narrow {
  max-width: 380px;
  margin: 3rem auto;
}

h1 { margin-top: 0; font-size: 1.6rem; }
h2 { margin-top: 0; font-size: 1.15rem; }

label {
  display: block;
  margin-bottom: 0.85rem;
  font-size: 0.9rem;
  font-weight: 600;
}

input, select, button {
  font: inherit;
}

input, select {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}

button {
  margin-top: 0.5rem;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

button:hover { filter: brightness(1.05); }

form.inline { display: inline; margin: 0; }
form.inline button {
  margin: 0;
  padding: 0.35rem 0.7rem;
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

th, td {
  text-align: left;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border);
}

th {
  background: #eef1f5;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

tr:last-child td { border-bottom: none; }

.mono { font-family: var(--mono); font-size: 0.9rem; }
.muted { color: var(--muted); }
.error {
  color: var(--error);
  background: #fef3f2;
  border: 1px solid #fecdca;
  padding: 0.65rem 0.85rem;
  border-radius: 6px;
}
.crumb { color: var(--muted); font-size: 0.9rem; }
.meta { display: grid; grid-template-columns: 8rem 1fr; gap: 0.35rem 1rem; }
.meta dt { color: var(--muted); }
.meta dd { margin: 0; }

.type-grid {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.75rem;
}

.type-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
}

.type-card:hover {
  border-color: var(--accent);
  text-decoration: none;
}

.type-name { font-weight: 700; }
.type-count {
  color: var(--muted);
  font-size: 0.9rem;
}

.type-count::after { content: " assets"; }

.type-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.type-tab {
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
}

.type-tab:hover { text-decoration: none; border-color: var(--accent); }

.type-tab.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.type-tab .type-count {
  color: inherit;
  opacity: 0.8;
  font-size: 0.8rem;
}

.type-tab .type-count::before { content: "("; }
.type-tab .type-count::after { content: ")"; }

.status {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  background: #eef1f5;
  color: var(--text);
}

.status-candidate,
.status-in_review { background: #fff4ce; color: #7a5b00; }
.status-approved,
.status-client_ready { background: #d8f3dc; color: #1b4332; }
.status-approved_restricted { background: #caf0f8; color: #023e8a; }
.status-broken,
.status-failed,
.status-withdrawn { background: #fde2e1; color: #7f1d1d; }
.status-superseded,
.status-processing { background: #e9ecef; color: #495057; }

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  margin: 0;
}

.inline-actions select,
.inline-actions input {
  width: auto;
  margin: 0;
  font-size: 0.85rem;
  padding: 0.3rem 0.4rem;
}

.inline-actions button {
  margin: 0;
  padding: 0.3rem 0.6rem;
  font-size: 0.85rem;
}

