:root {
  --bg: #ffffff;
  --canvas: #fafaf9;
  --text: #1a1a1a;
  --muted: #6b6b6b;
  --line: #e6e6e3;
  --accent: #2f4a6d;
  --ok: #2f855a;
  --warn: #b7791f;
  --err: #c53030;
  --radius: 6px;
  --sidebar: 220px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.45;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .small { font-size: 12px; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.error-text { color: var(--err); }
.grow { margin-left: auto; }

.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar);
  flex-shrink: 0;
  background: var(--canvas);
  border-right: 1px solid var(--line);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.wordmark { font-weight: 600; font-size: 16px; letter-spacing: 0.02em; margin-bottom: 24px; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a {
  color: var(--text);
  padding: 8px 10px;
  border-radius: var(--radius);
  text-decoration: none;
}
.nav a:hover { background: #f0f0ee; }
.nav a.active { background: #ecece8; font-weight: 600; }
.sidebar-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); }

.content { flex: 1; padding: 32px; max-width: 1200px; }
.content--auth { max-width: none; }

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}
.page-header h1 { margin: 0; font-size: 20px; font-weight: 600; }
.section-label {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  margin: 16px 0 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  font: inherit;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { text-decoration: none; background: #f7f7f5; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn--primary:hover { background: #243a57; }
.btn--secondary { background: #fff; }
.btn--block { width: 100%; }
.link-btn, .link-danger {
  background: none; border: none; padding: 0; font: inherit; cursor: pointer; color: var(--accent);
}
.link-danger { color: var(--err); }

input[type="text"], input[type="password"], input[type="number"], input[type="date"],
input[type="file"], select, textarea {
  width: 100%;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 10px;
  font: inherit;
  background: #fff;
  color: var(--text);
}
textarea { height: auto; padding: 8px 10px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field > span { color: var(--muted); font-size: 12px; }
.inline { display: flex; gap: 8px; align-items: center; }
.inline input { flex: 1; }
.inline-form { margin-top: 16px; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 16px;
}
.panel { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-top: 16px; }
.hairline { border: none; border-top: 1px solid var(--line); margin: 16px 0; }

.flash {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 16px;
}
.flash--ok { border-color: #c6e6d3; background: #f3faf6; color: var(--ok); }
.flash--error { border-color: #f0c2c2; background: #fdf4f4; color: var(--err); }

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 8px;
}
.metric {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
}
.metric__label { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.metric__value { font-size: 24px; font-weight: 600; margin-top: 4px; font-variant-numeric: tabular-nums; }

.table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.table th, .table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); }
.table th { color: var(--muted); font-weight: 600; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; }

.dot {
  display: inline-block;
  width: 8px; height: 8px; border-radius: 50%;
  background: #bbb; margin-right: 6px; vertical-align: middle;
}
.dot--green { background: var(--ok); }
.dot--amber { background: var(--warn); }
.dot--red { background: var(--err); }
.dot--grey { background: #bbb; }

.badge {
  display: inline-block;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 11px;
  color: var(--muted);
}

.profile-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 960px) {
  .profile-grid { grid-template-columns: 1fr 1fr; }
}
.profile-card__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.profile-letter {
  width: 40px; height: 40px; border-radius: var(--radius); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px;
}
.toggle { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.thumb-strip { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.thumb {
  width: 96px; height: 96px; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; position: relative; background: var(--canvas);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb__remove {
  position: absolute; top: 2px; right: 2px; width: 22px; height: 22px; border-radius: 50%;
  border: 1px solid var(--line); background: #fff; cursor: pointer; line-height: 1;
}
.dropzone {
  display: flex; align-items: center; justify-content: center;
  border: 1px dashed var(--line); border-radius: var(--radius);
  padding: 18px; color: var(--muted); cursor: pointer; margin-bottom: 12px;
}
.dropzone input { display: none; }
.actions { display: flex; gap: 8px; margin-top: 8px; }
.actions-stack { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }

.filter-bar {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  padding-bottom: 12px; margin-bottom: 16px; border-bottom: 1px solid var(--line);
}
.filter-bar select, .filter-bar input { width: auto; min-width: 140px; }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.gallery-card { padding: 0; overflow: hidden; color: inherit; text-decoration: none; display: block; }
.gallery-card:hover { text-decoration: none; border-color: #d0d0cc; }
.gallery-card__imgs { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); }
.gallery-card__half { aspect-ratio: 1; overflow: hidden; background: var(--canvas); }
.gallery-card__half + .gallery-card__half { border-left: 1px solid var(--line); }
.gallery-card__half img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-card__meta {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px; flex-wrap: wrap;
}
.placeholder {
  display: flex; align-items: center; justify-content: center; height: 100%;
  color: var(--muted); background: var(--canvas);
}
.placeholder.tall { min-height: 240px; border: 1px solid var(--line); border-radius: var(--radius); }
.pager { display: flex; gap: 16px; align-items: center; justify-content: center; margin-top: 24px; }

.job-layout { display: grid; grid-template-columns: 1fr 320px; gap: 20px; }
@media (max-width: 900px) { .job-layout { grid-template-columns: 1fr; } }
.job-images { display: grid; gap: 16px; }
.job-images img { width: 100%; border: 1px solid var(--line); border-radius: var(--radius); display: block; }
.defs { margin: 0; }
.defs > div {
  display: grid; grid-template-columns: 110px 1fr; gap: 8px;
  padding: 8px 0; border-bottom: 1px solid var(--line);
}
.defs dt { margin: 0; color: var(--muted); font-size: 12px; }
.defs dd { margin: 0; }
.defs--form > div {
  grid-template-columns: 200px 1fr;
  align-items: center;
}
.prompt-box {
  white-space: pre-wrap; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px; background: var(--canvas); font-size: 13px; max-height: 160px; overflow: auto;
}
.settings-form { max-width: 820px; }

.preview-frame { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.preview-caption { padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--canvas); }
.preview-stage {
  width: 100%; overflow: auto; background: #111;
  display: flex; justify-content: center; padding: 16px;
}
.preview-stage iframe {
  border: 0; background: #000;
  transform-origin: top center;
  max-width: 100%;
}

.login-body {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--canvas);
}
.login-card {
  width: 360px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px;
}
.login-card .wordmark { margin-bottom: 4px; }
