:root {
  --ink: #17202a;
  --muted: #64707a;
  --paper: #f7f5ef;
  --panel: #ffffff;
  --navy: #133d63;
  --blue: #0f5b93;
  --olive: #4d5a2e;
  --red: #c7332b;
  --gold: #f2ae24;
  --line: rgba(23, 32, 42, 0.14);
  --shadow: 0 18px 48px rgba(23, 32, 42, 0.14);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.75), rgba(255,255,255,0) 310px),
    var(--paper);
  color: var(--ink);
  font-family: Barlow, Arial, sans-serif;
}

a { color: inherit; }

button,
input {
  font: inherit;
}

.login-page,
.app-shell {
  min-height: 100vh;
}

.login-page {
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    linear-gradient(120deg, rgba(19,61,99,0.92), rgba(23,32,42,0.78)),
    url("../assets/hero-chieftain-field.jpg") center / cover;
}

.login-card {
  width: min(440px, 100%);
  padding: 34px;
  background: rgba(247,245,239,0.96);
  border-top: 5px solid var(--gold);
  box-shadow: var(--shadow);
}

.login-card img {
  width: 230px;
  max-width: 80%;
  margin-bottom: 28px;
}

.kicker {
  margin: 0 0 10px;
  color: var(--red);
  text-transform: uppercase;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.05;
}

.login-card h1 {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 2.45rem;
  letter-spacing: 0;
}

.login-card p {
  color: var(--muted);
  line-height: 1.55;
}

.form-stack {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

label {
  display: grid;
  gap: 6px;
  color: #344250;
  font-weight: 800;
  font-size: 0.88rem;
}

input {
  width: 100%;
  min-height: 46px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--ink);
}

input:focus {
  outline: 3px solid rgba(242,174,36,0.28);
  border-color: var(--gold);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 12px 18px;
  border: 0;
  border-radius: 6px;
  background: var(--red);
  color: white;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(199, 51, 43, 0.22);
}

.button.secondary {
  background: var(--navy);
  box-shadow: none;
}

.button.ghost {
  background: transparent;
  color: var(--blue);
  border: 1px solid var(--line);
  box-shadow: none;
}

.error {
  padding: 10px 12px;
  background: rgba(199,51,43,0.10);
  border-left: 4px solid var(--red);
  color: #79201c;
  font-weight: 700;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(190px, 280px) 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 14px clamp(18px, 4vw, 52px);
  background: rgba(247,245,239,0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
  transition: transform 180ms ease;
}

.app-header img {
  width: min(260px, 46vw);
}

.app-title {
  min-width: 0;
}

.app-title strong {
  display: block;
  color: var(--navy);
  font-size: 1.05rem;
}

.app-title span {
  color: var(--muted);
  font-size: 0.92rem;
}

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

.mx-hero {
  padding: 54px clamp(18px, 4vw, 52px) 34px;
  background:
    linear-gradient(90deg, rgba(19,61,99,0.94), rgba(23,32,42,0.72)),
    url("../assets/fv432-mk1-night-field.jpg") center / cover;
  color: white;
}

.mx-hero h1 {
  max-width: 900px;
  font-family: "Source Serif 4", Georgia, serif;
  font-size: clamp(2.8rem, 5.5vw, 5.6rem);
  letter-spacing: 0;
}

.mx-hero p {
  max-width: 780px;
  color: rgba(255,255,255,0.82);
  font-size: 1.06rem;
  line-height: 1.6;
}

.search-bar {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  width: min(980px, 100%);
  margin-top: 24px;
}

.search-bar input {
  border: 0;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(280px, 390px) minmax(0, 1fr);
  gap: 22px;
  padding: 26px clamp(18px, 4vw, 52px) 52px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(23,32,42,0.08);
}

.side-panel {
  position: sticky;
  top: 96px;
  align-self: start;
  overflow: hidden;
}

.panel-head {
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.panel-head h2 {
  font-size: 1.05rem;
}

.filter-row {
  display: flex;
  gap: 8px;
  padding: 14px 18px 0;
}

.list {
  display: grid;
  max-height: calc(100vh - 230px);
  overflow: auto;
}

.list-button {
  width: 100%;
  padding: 14px 18px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: white;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.list-button:hover,
.list-button.is-active {
  background: #f0ede4;
}

.list-button strong {
  display: block;
  margin-bottom: 4px;
}

.meta {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

.content {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.detail-panel {
  padding: clamp(18px, 3vw, 28px);
}

.detail-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.detail-head h2 {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: clamp(2rem, 3.2vw, 3.4rem);
  letter-spacing: 0;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 999px;
  background: #eef3f5;
  color: #344250;
  font-size: 0.8rem;
  font-weight: 800;
}

.data-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.data-cell {
  padding: 11px 12px;
  background: #f7f5ef;
  border: 1px solid rgba(23,32,42,0.08);
  border-radius: 6px;
  min-width: 0;
}

.data-cell span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.10em;
  text-transform: uppercase;
}

.data-cell strong {
  overflow-wrap: anywhere;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

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

th {
  color: #344250;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.10em;
}

tr.clickable {
  cursor: pointer;
}

tr.clickable:hover {
  background: #f3f0e8;
}

.plate-image {
  display: grid;
  gap: 10px;
}

.plate-image img {
  width: 100%;
  max-height: 720px;
  object-fit: contain;
  background: #e8e2d4;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.plate-thumb {
  width: 92px;
  height: 68px;
  object-fit: contain;
  background: #e8e2d4;
  border: 1px solid var(--line);
  border-radius: 5px;
}

.plate-thumb[data-src] {
  background:
    linear-gradient(90deg, #e8e2d4, #f4efe4, #e8e2d4);
  background-size: 180% 100%;
  animation: thumb-loading 1.2s ease-in-out infinite;
}

@keyframes thumb-loading {
  0% { background-position: 0 0; }
  100% { background-position: 180% 0; }
}

.status {
  padding: 18px;
  color: var(--muted);
  line-height: 1.55;
}

@media (max-width: 940px) {
  .app-header {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .app-header.is-hidden {
    transform: translateY(-100%);
  }

  .app-actions {
    justify-content: flex-start;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .side-panel {
    position: static;
  }

  .list {
    max-height: 420px;
  }
}

@media (max-width: 640px) {
  .search-bar {
    grid-template-columns: 1fr;
  }

  .detail-head {
    display: grid;
  }

  .data-grid {
    grid-template-columns: 1fr;
  }
}
