/* Animal Inventory Admin — brand: Inter, palette locked. */
:root {
  --bg: #0a0a0a;
  --surface: #1a1a1a;
  --surface-hover: #222;
  --fg: #e6e6e6;
  --muted: #9a9a9a;
  --brass: #c69c69;
  --wheat: #f4cfa1;
  --border: #2a2a2a;
  --danger: #e47a6a;
  --success: #7dbf88;
  --warning: #d9b347;

  --radius: 10px;
  --radius-lg: 14px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-feature: "ss01", "ss02", "cv11";

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-8: 3rem;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-feature-settings: var(--font-feature);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  min-height: 100vh;
}

button, input, select, textarea { font: inherit; color: inherit; }

a { color: var(--wheat); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

.muted { color: var(--muted); }
.accent { color: var(--brass); }
.small { font-size: 0.85rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* Boot / login screens */
.boot {
  min-height: 100vh;
  display: grid;
  place-items: center;
}
.boot-inner {
  text-align: center;
}
.logo-mark { display: flex; justify-content: center; margin-bottom: var(--space-3); }

/* App shell */
.app {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}
.sidebar {
  background: #050505;
  border-right: 1px solid var(--border);
  padding: var(--space-5) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.brand {
  display: flex; align-items: center; gap: var(--space-3);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border);
}
.brand-title { font-weight: 600; line-height: 1.1; font-size: 0.95rem; }
.brand-sub { font-size: 0.75rem; color: var(--muted); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  color: var(--fg);
  text-decoration: none;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius);
  font-size: 0.92rem;
  display: flex; align-items: center; gap: var(--space-3);
}
.nav a:hover { background: var(--surface); }
.nav a.active {
  background: var(--surface);
  color: var(--wheat);
  box-shadow: inset 2px 0 0 var(--brass);
}

.sidebar-footer { margin-top: auto; font-size: 0.78rem; color: var(--muted); }
.sidebar-footer strong { color: var(--fg); font-weight: 500; }

.content {
  padding: var(--space-6) var(--space-6) var(--space-8);
  max-width: 1100px;
  width: 100%;
}
@media (max-width: 800px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { border-right: none; border-bottom: 1px solid var(--border); }
  .content { padding: var(--space-4); }
}

h1 { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.01em; margin: 0 0 var(--space-4); }
h2 { font-size: 1.1rem; font-weight: 600; margin: var(--space-5) 0 var(--space-3); }
h3 { font-size: 0.95rem; font-weight: 600; margin: 0 0 var(--space-2); }

/* Sync strip */
.sync-strip {
  display: flex; align-items: center; gap: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  margin-bottom: var(--space-5);
  flex-wrap: wrap;
}
.sync-strip .label { font-size: 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.sync-strip .value { font-size: 0.95rem; font-weight: 500; }
.sync-strip .pill {
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.78rem;
  border: 1px solid var(--border);
}
.sync-strip .pill.healthy { background: rgba(125, 191, 136, 0.1); color: var(--success); border-color: #2f4a3a; }
.sync-strip .pill.degraded { background: rgba(217, 179, 71, 0.1); color: var(--warning); border-color: #4a3f2a; }
.sync-strip .pill.failing { background: rgba(228, 122, 106, 0.1); color: var(--danger); border-color: #4a2f2f; }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--space-2);
}

/* Change-event rows */
.changes { display: flex; flex-direction: column; gap: var(--space-3); }
.change {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.1rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-3);
  align-items: center;
}
.change-type {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 6px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: #2a2418;
  color: var(--wheat);
  border: 1px solid #3a3020;
  margin-right: 0.5rem;
}
.change-type.added    { background: #1a2a1a; color: var(--success); border-color: #254530; }
.change-type.modified { background: #2a2418; color: var(--wheat);   border-color: #3a3020; }
.change-type.removed  { background: #2a1818; color: var(--danger);  border-color: #452525; }
.change-type.photo_changed { background: #1a1e2a; color: #a7b9d6; border-color: #25324a; }
.change-summary { color: var(--fg); font-size: 0.95rem; margin-top: 0.15rem; }
.change-meta { color: var(--muted); font-size: 0.78rem; margin-top: 0.3rem; }
.change-actions { display: flex; gap: 0.5rem; }

/* Buttons */
.btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--fg);
  padding: 0.55rem 1rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 120ms, border-color 120ms, color 120ms;
  font-size: 0.9rem;
}
.btn:hover { background: var(--surface-hover); border-color: #3a3a3a; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.btn.primary { background: var(--brass); color: #0a0a0a; border-color: var(--brass); font-weight: 500; }
.btn.primary:hover { background: var(--wheat); border-color: var(--wheat); }
.btn.approve { color: var(--success); border-color: #2a4a35; }
.btn.approve:hover { background: rgba(125, 191, 136, 0.08); }
.btn.reject { color: var(--danger); border-color: #4a2f2f; }
.btn.reject:hover { background: rgba(228, 122, 106, 0.08); }
.btn.small { padding: 0.35rem 0.7rem; font-size: 0.82rem; }

/* Tables */
table.list {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
table.list th, table.list td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
table.list th {
  background: #141414;
  color: var(--muted);
  font-weight: 500;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
table.list tr:last-child td { border-bottom: none; }
table.list tr:hover td { background: #1f1f1f; }

/* Forms */
.field { display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: var(--space-3); }
.field label { font-size: 0.82rem; color: var(--muted); }
.field input, .field select {
  background: #0f0f0f;
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.55rem 0.7rem;
  font-size: 0.9rem;
}
.field input:focus, .field select:focus { outline: 2px solid var(--brass); outline-offset: 1px; }

.switch { display: flex; align-items: center; gap: 0.6rem; cursor: pointer; padding: 0.35rem 0; }
.switch input { appearance: none; width: 34px; height: 20px; background: #2a2a2a; border-radius: 999px; position: relative; transition: background 120ms; cursor: pointer; border: none; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; background: #eee; border-radius: 50%; transition: left 120ms; }
.switch input:checked { background: var(--brass); }
.switch input:checked::after { left: 16px; background: #0a0a0a; }

/* Empty / loading states */
.empty { text-align: center; padding: 3rem 1rem; color: var(--muted); border: 1px dashed var(--border); border-radius: var(--radius-lg); }
.spinner {
  width: 1rem; height: 1rem;
  border: 2px solid var(--muted); border-top-color: transparent;
  border-radius: 50%; animation: spin 0.6s linear infinite;
  display: inline-block; vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Login card */
.login {
  max-width: 380px;
  margin: 0 auto;
  padding: 2.5rem 2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.login h1 { margin-top: 0; }
.login p.muted { margin-bottom: 2rem; font-size: 0.92rem; }

/* Audit log */
.audit-row {
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 130px 160px 1fr;
  gap: var(--space-3);
  font-size: 0.85rem;
  align-items: center;
}
.audit-row:last-child { border-bottom: none; }
.audit-time { color: var(--muted); }
.audit-action {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
  color: var(--wheat);
}

/* Embed snippet box */
.code-box {
  background: #060606;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8rem;
  color: #d8d8d8;
  white-space: pre-wrap;
  word-break: break-all;
}
