:root {
  --ink: #172026;
  --muted: #65717d;
  --line: #d9e1e7;
  --panel: #ffffff;
  --bg: #f4f7f8;
  --field: #edf3f5;
  --green: #0b7f5c;
  --blue: #1f5c9e;
  --amber: #9b6312;
  --danger: #b93b2f;
  --shadow: 0 14px 30px rgba(23, 32, 38, .08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a { color: inherit; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid var(--line);
  background: #fbfcfc;
}

.brand {
  text-decoration: none;
}

.brand span, .eyebrow {
  display: block;
  margin: 0 0 4px;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.brand strong {
  font-size: 19px;
}

nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

nav a {
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 800;
}

nav a:hover {
  background: var(--field);
  color: var(--ink);
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(135deg, #e7f3ee, #f4f7f8 55%, #e8f0f7);
}

.login-panel, .panel, .table-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.login-panel {
  width: min(440px, 100%);
  padding: 28px;
}

h1 {
  margin: 0 0 18px;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.05;
}

.page {
  width: min(1240px, calc(100% - 32px));
  margin: 24px auto 48px;
}

.narrow {
  width: min(560px, calc(100% - 32px));
}

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, .8fr);
  gap: 16px;
}

.hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.field, input, select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  color: var(--ink);
  padding: 0 12px;
  font: inherit;
}

.toolbar input {
  width: min(340px, 74vw);
}

.toolbar select {
  width: auto;
}

.form {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 800;
}

button, .actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  padding: 0 14px;
  color: #fff;
  background: var(--green);
  cursor: pointer;
  font: inherit;
  font-weight: 900;
  text-decoration: none;
}

.summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.summary div {
  background: var(--panel);
  padding: 16px;
}

.summary span {
  display: block;
  font-size: 24px;
  font-weight: 900;
}

.summary small {
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.video-wrap {
  aspect-ratio: 16 / 9;
  background: #101417;
}

video {
  display: block;
  width: 100%;
  height: 100%;
}

.card-body, .panel {
  padding: 16px;
}

.card-title-row {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

h2 {
  margin: 0;
  font-size: 17px;
}

.pill {
  flex: 0 0 auto;
  border-radius: 999px;
  background: #e7f3ee;
  color: var(--green);
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 900;
}

.pill.fourk {
  background: #fff2d8;
  color: var(--amber);
}

dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

dt {
  color: var(--muted);
  font-size: 12px;
}

dd {
  margin: 2px 0 0;
  font-size: 13px;
  font-weight: 800;
}

.actions {
  display: flex;
  gap: 10px;
}

.actions .secondary {
  color: var(--blue);
  background: #e8f0f7;
}

.messages {
  width: min(1240px, calc(100% - 32px));
  margin: 16px auto 0;
}

.messages p {
  margin: 0 0 8px;
  border-radius: 8px;
  padding: 10px 12px;
  background: #e7f3ee;
  color: var(--green);
  font-weight: 800;
}

.messages .error {
  background: #fdecea;
  color: var(--danger);
}

.empty {
  color: var(--muted);
  text-align: center;
}

.empty.left {
  text-align: left;
}

.list {
  display: grid;
  gap: 8px;
}

.list-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
}

.list-row span {
  color: var(--muted);
}

.table-wrap {
  overflow-x: auto;
}

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

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

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

ul.errorlist {
  margin: 4px 0 0;
  padding-left: 18px;
  color: var(--danger);
  font-weight: 700;
}

@media (max-width: 760px) {
  .topbar, .hero {
    display: block;
  }

  nav, .toolbar {
    justify-content: flex-start;
    margin-top: 14px;
  }

  .toolbar input, .toolbar select {
    width: 100%;
  }

  .summary, .two-col {
    grid-template-columns: 1fr;
  }

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