:root {
  --bg: #f6f6f4;
  --panel: #ffffff;
  --panel-strong: #ffffff;
  --ink: #111111;
  --muted: #5a5a58;
  --line: rgba(17, 17, 17, 0.16);
  --accent: #0f0f0f;
  --accent-soft: rgba(17, 17, 17, 0.06);
  --shadow: none;
  --radius: 0px;
  --radius-sm: 0px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: linear-gradient(180deg, #fafafa 0%, #f2f2ee 100%);
  color: var(--ink);
  font-family: 'IBM Plex Sans', Arial, Helvetica, sans-serif;
  line-height: 1.42;
  overflow-x: hidden;
}

body.lightbox-open {
  overflow: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: linear-gradient(rgba(17, 17, 17, 0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(17, 17, 17, 0.035) 1px, transparent 1px);
  background-size: 64px 64px;
  pointer-events: none;
  opacity: 0.35;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

.page-grid,
.page-orb {
  position: fixed;
  pointer-events: none;
}

.page-grid {
  inset: 0;
  opacity: 0.18;
  background: linear-gradient(transparent calc(100% - 1px), rgba(17, 17, 17, 0.05) 1px), linear-gradient(90deg, transparent calc(100% - 1px), rgba(17, 17, 17, 0.05) 1px);
  background-size: 96px 96px;
}

.page-orb {
  border-radius: 50%;
  mix-blend-mode: multiply;
  filter: blur(3px);
}

.page-orb-a {
  width: 18rem;
  height: 18rem;
  top: -6rem;
  right: -5rem;
  background: radial-gradient(circle, rgba(17, 17, 17, 0.12), rgba(17, 17, 17, 0));
}

.page-orb-b {
  width: 14rem;
  height: 14rem;
  bottom: -4rem;
  left: -3rem;
  background: radial-gradient(circle, rgba(17, 17, 17, 0.09), rgba(17, 17, 17, 0));
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.85rem 3.5vw;
  backdrop-filter: blur(10px);
  background: rgba(250, 250, 248, 0.9);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: block;
  font-family: 'Archivo Black', sans-serif;
  font-size: clamp(1rem, 1.8vw, 1.35rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand-sub {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
}

.nav-links a {
  padding: 0.35rem 0.2rem;
  border-bottom: 1px solid transparent;
  transition: border-color 160ms ease, opacity 160ms ease;
}

.nav-links a:hover {
  border-color: var(--ink);
}

.shell {
  position: relative;
  z-index: 1;
  width: min(1240px, calc(100% - 1.5rem));
  margin: 0 auto;
  padding: 1rem 0 2rem;
}

.hero {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 1rem;
  align-items: end;
  padding: 1rem 0 0.75rem;
}

.eyebrow,
.card-kicker {
  margin: 0 0 0.45rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
h3,
.brand {
  margin: 0;
  line-height: 0.95;
}

h1 {
  max-width: 12ch;
  font-family: 'Archivo Black', sans-serif;
  font-size: clamp(2.5rem, 6.5vw, 5.6rem);
  letter-spacing: -0.05em;
}

h2 {
  font-family: 'Archivo Black', sans-serif;
  font-size: clamp(1.25rem, 2.4vw, 2rem);
  letter-spacing: -0.04em;
}

.lede {
  max-width: 60ch;
  margin: 0.75rem 0 0;
  font-size: 0.98rem;
  color: var(--muted);
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
}

.hero-metrics.small {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.metric {
  padding: 0.85rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
  box-shadow: none;
}

.metric span {
  display: block;
  font-family: 'Archivo Black', sans-serif;
  font-size: clamp(1.25rem, 2.4vw, 2rem);
}

.metric small {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
  margin-top: 0.75rem;
}

.admin-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card,
.info-band {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--panel);
  box-shadow: none;
  backdrop-filter: none;
}

.card {
  padding: 1rem;
}

.card.accent {
  background: linear-gradient(180deg, rgba(17, 17, 17, 0.97), rgba(17, 17, 17, 0.88));
  color: #f5f1e8;
}

.card.accent p,
.card.accent .card-kicker,
.card.accent .microcopy {
  color: rgba(245, 241, 232, 0.82);
}

.card p {
  color: var(--muted);
}

.card.accent .button.primary {
  background: #f5f1e8;
  color: #111;
}

.card.accent .button.primary:hover {
  background: #ffffff;
}

.info-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  margin: 0.75rem 0;
  padding: 0.95rem 1rem;
}

.info-band.compact {
  align-items: center;
}

.feature-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.25rem 1rem;
  margin: 0;
  padding-left: 1.1rem;
}

.feature-list li {
  color: var(--muted);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 40px;
  padding: 0.62rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
  background: #f8f8f8;
  border-color: rgba(17, 17, 17, 0.35);
}

.button.primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.button.secondary {
  background: transparent;
}

.button.ghost {
  background: transparent;
}

.button.small {
  min-height: 34px;
  padding: 0.45rem 0.75rem;
  font-size: 0.9rem;
}

.inline-form,
.stack-form {
  display: grid;
  gap: 0.65rem;
}

.inline-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.inline-form.compact-form {
  grid-template-columns: 1.2fr 0.8fr auto;
  align-items: end;
}

.stack-form {
  width: 100%;
}

.form-card.narrow {
  width: min(520px, 100%);
  margin: 0 auto;
}

label {
  display: grid;
  gap: 0.4rem;
  font-size: 0.95rem;
}

label span {
  font-weight: 700;
  color: var(--ink);
}

input,
select,
textarea {
  width: 100%;
  padding: 0.72rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
  color: var(--ink);
  font: inherit;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(17, 17, 17, 0.55);
  box-shadow: 0 0 0 4px rgba(17, 17, 17, 0.08);
}

textarea {
  resize: vertical;
  min-height: 76px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.microcopy {
  margin: 0;
  font-size: 0.92rem;
  color: var(--muted);
}

.upload-stack {
  display: grid;
  gap: 0.9rem;
}

.upload-row {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 0.7rem;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
}

.toggle-row input {
  width: auto;
  min-width: 20px;
  min-height: 20px;
}

.flash {
  margin: 0.75rem 0 0;
  padding: 0.75rem 0.9rem;
  border-radius: 0;
  border: 1px solid var(--line);
  background: #fff;
}

.flash-success {
  border-color: rgba(30, 90, 40, 0.24);
  background: rgba(240, 250, 242, 0.96);
}

.flash-error {
  border-color: rgba(120, 30, 30, 0.24);
  background: rgba(255, 242, 242, 0.96);
}

.table-card {
  margin-top: 0.75rem;
}

.table-wrap {
  overflow-x: auto;
  margin-top: 0.75rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 820px;
}

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

th {
  position: sticky;
  top: 0;
  background: rgba(250, 250, 248, 0.98);
  font-size: 0.74rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

td small {
  color: var(--muted);
}

.table-thumb-media {
  width: 96px;
  height: 72px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: #f4f4f2;
  overflow: hidden;
}

.table-thumb-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.table-thumb-empty {
  color: var(--muted);
  font-size: 0.72rem;
  text-align: center;
  padding: 0.3rem;
}

details {
  padding: 0.1rem 0;
}

summary {
  cursor: pointer;
  font-weight: 700;
}

.score-form {
  display: grid;
  gap: 0.35rem;
}

.score-form select,
.score-form input {
  min-width: 100%;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-top: 0.75rem;
}

.toolbar-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.thumb-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
  margin-top: 0.75rem;
}

.thumb-card {
  border: 1px solid var(--line);
  background: #fff;
  display: grid;
  gap: 0.55rem;
  padding: 0.55rem;
}

.thumb-media {
  display: block;
  border: 1px solid var(--line);
  background: #f4f4f2;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.thumb-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb-empty {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.86rem;
  text-align: center;
  padding: 0.5rem;
}

.thumb-meta {
  display: grid;
  gap: 0.15rem;
}

.thumb-meta strong {
  font-size: 0.92rem;
}

.thumb-meta span,
.thumb-meta small {
  color: var(--muted);
  font-size: 0.84rem;
}

.thumb-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(8, 8, 8, 0.94);
  z-index: 1200;
  display: none;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.7rem;
  padding: 1rem;
}

.lightbox.is-open {
  display: grid;
}

.lightbox-figure {
  margin: 0;
  width: min(92vw, 1280px);
  justify-self: center;
  display: grid;
  gap: 0.55rem;
}

.lightbox-figure img {
  width: 100%;
  max-height: 84vh;
  object-fit: contain;
  background: #0f0f0f;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.lightbox-figure figcaption {
  color: rgba(255, 255, 255, 0.84);
  font-size: 0.92rem;
  letter-spacing: 0.02em;
}

.lightbox-close,
.lightbox-nav {
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(20, 20, 20, 0.8);
  color: #fff;
  cursor: pointer;
}

.lightbox-close {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  width: 2.2rem;
  height: 2.2rem;
  font-size: 1.4rem;
  line-height: 1;
}

.lightbox-nav {
  width: 2.6rem;
  height: 3.2rem;
  font-size: 1.6rem;
  line-height: 1;
}

.receipt-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  margin-top: 0.75rem;
}

.receipt-item {
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
}

.receipt-item strong,
.receipt-item span,
.receipt-item small {
  display: block;
}

.receipt-item strong {
  font-size: 1.1rem;
}

.receipt-item span,
.receipt-item small {
  color: var(--muted);
}

.receipt-card {
  max-width: 900px;
  margin: 0.75rem auto 0;
}

.top-gap {
  margin-top: 0.7rem;
}

@media (max-width: 980px) {
  .hero,
  .card-grid,
  .admin-grid,
  .feature-list,
  .receipt-list,
  .form-grid,
  .upload-row,
  .inline-form,
  .info-band {
    grid-template-columns: 1fr;
    display: grid;
  }

  .hero,
  .card-grid,
  .admin-grid,
  .receipt-list,
  .form-grid,
  .upload-row,
  .inline-form {
    gap: 0.9rem;
  }

  .hero-metrics,
  .hero-metrics.small,
  .inline-form.compact-form {
    grid-template-columns: 1fr;
  }

  .thumb-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lightbox {
    grid-template-columns: 1fr;
    align-items: start;
    padding: 0.6rem;
  }

  .lightbox-figure {
    width: min(98vw, 1280px);
  }

  .lightbox-nav {
    position: fixed;
    bottom: 0.8rem;
    width: 2.8rem;
    height: 2.8rem;
  }

  .lightbox-prev {
    left: 0.8rem;
  }

  .lightbox-next {
    right: 0.8rem;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .shell {
    width: min(100% - 0.75rem, 1240px);
  }

  table {
    min-width: 740px;
  }
}

@media (max-width: 620px) {
  .thumb-grid {
    grid-template-columns: 1fr;
  }
}
