:root {
  --bg: #f3f4f6;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --primary: #4f46e5;
  --border: #e5e7eb;
}
body.dark {
  --bg: #0f172a;
  --card: #1f2937;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --primary: #a78bfa;
  --border: #334155;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
}
a { color: inherit; text-decoration: none; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.logo { font-weight: 700; font-size: 18px; }
.top-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.admin-label { color: var(--muted); }
.admin-nav { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.admin-nav a { padding: 6px 10px; border-radius: 8px; border: 1px solid var(--border); }

.page { max-width: 1100px; margin: 24px auto; padding: 0 16px; }
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.05);
  margin-bottom: 16px;
}
.card.narrow { max-width: 420px; margin: 40px auto; }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }

h1, h2, h3 { margin: 0 0 12px 0; }
p { margin: 0 0 8px 0; }
label { display: block; margin-bottom: 6px; font-weight: 600; }
input, textarea, select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  margin-bottom: 12px;
}
select, option {
  background: var(--card);
  color: var(--text);
}
textarea { min-height: 80px; }

.btn {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  padding: 10px 16px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: transform .1s ease, box-shadow .2s ease;
  text-align: center;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 20px rgba(0,0,0,0.12); }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn.small { padding: 6px 10px; margin-top: 6px; }
.btn.danger { background: #ef4444; }

.alert { padding: 12px; border-radius: 10px; background: #e0f2fe; color: #0f172a; margin-bottom: 12px; }
.alert.error { background: #fee2e2; color: #991b1b; }

.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.table, table { width: 100%; border-collapse: collapse; }
.table th, .table td, table th, table td { padding: 10px; border-bottom: 1px solid var(--border); text-align: left; }
.table tr:nth-child(even), table tr:nth-child(even) { background: rgba(0,0,0,0.02); }

.title-card { display: flex; gap: 12px; align-items: center; margin: 12px 0; }
.title-card img { width: 90px; height: 130px; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); }
.title-card.compact img { width: 60px; height: 85px; }
.title-card .label { font-size: 12px; color: var(--muted); margin: 0; }

.list { display: flex; flex-direction: column; gap: 14px; }
.list-item { display: flex; justify-content: space-between; gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; }

.inline-form { display: flex; gap: 6px; align-items: center; margin-bottom: 8px; }
.inline-form input { margin: 0; }

.filters { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }

.stacked { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }

.muted { color: var(--muted); font-size: 14px; }

.footer {
  padding: 16px 24px 32px;
  font-size: 0.9rem;
  color: var(--muted);
  text-align: right;
}
.footer a {
  color: inherit;
  text-decoration: underline;
}

@media (max-width: 900px) {
  .list-item { flex-direction: column; }
  .topbar { position: relative; }
}
