:root {
  color-scheme: light;
  --bg: #f9f9f7;
  --text: #1a1a1a;
  --muted: #767676;
  --line: #deded9;
  --soft: #efefeb;
  --danger: #a33328;
  --free: #206f4a;
  --reserved: #8a5b12;
  --sold: #174d8a;
  --unavailable: #6f6f6f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, sans-serif;
  font-size: 15px;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  background: var(--text);
  border: 0;
  color: var(--bg);
  cursor: pointer;
  min-height: 36px;
  padding: 0 14px;
}

button:hover {
  opacity: 0.86;
}

button.secondary {
  background: var(--soft);
  color: var(--text);
}

button.danger {
  background: var(--danger);
}

.topbar {
  align-items: end;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  padding: 28px 32px 18px;
}

.eyebrow {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 4px;
}

h1,
h2 {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.05;
  margin: 0;
}

h2 {
  font-size: 24px;
}

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

main {
  padding: 0 32px 48px;
}

.login {
  max-width: 420px;
  padding-top: 54px;
}

.login form,
.filters,
.summary {
  display: flex;
  gap: 12px;
}

.login form {
  align-items: end;
}

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

input,
select,
textarea {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--text);
  min-height: 36px;
  padding: 7px 9px;
  width: 100%;
}

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

.summary {
  border-bottom: 1px solid var(--line);
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
  margin: 8px 0 18px;
  padding: 14px 0;
}

.metric {
  min-width: 120px;
}

.metric strong {
  display: block;
  font-size: 22px;
  line-height: 1.1;
}

.metric span {
  color: var(--muted);
  font-size: 13px;
}

.filters {
  align-items: end;
  margin-bottom: 14px;
}

.filters label:first-child {
  max-width: 420px;
  width: 100%;
}

.check {
  align-items: center;
  color: var(--text);
  display: flex;
  gap: 8px;
  min-height: 36px;
}

.check input {
  min-height: auto;
  width: auto;
}

.tableWrap {
  overflow-x: auto;
}

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

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

th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}

.dateCell {
  white-space: nowrap;
  width: 112px;
}

.videoTitle {
  font-weight: 700;
  margin-bottom: 4px;
}

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

.gapText {
  color: var(--muted);
  display: grid;
  gap: 3px;
  min-width: 150px;
}

.slots {
  display: grid;
  gap: 7px;
  grid-template-columns: repeat(2, minmax(190px, 1fr));
}

.slot {
  background: #fff;
  border-left: 4px solid var(--line);
  min-height: 64px;
  padding: 8px 9px;
}

.slot.free {
  border-left-color: var(--free);
}

.slot.reserved {
  border-left-color: var(--reserved);
}

.slot.sold {
  border-left-color: var(--sold);
}

.slot.unavailable {
  border-left-color: var(--unavailable);
}

.slotTop {
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.slotName {
  font-weight: 700;
}

.status {
  color: var(--muted);
  white-space: nowrap;
}

.money {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.rowActions {
  display: flex;
  gap: 8px;
  justify-content: end;
}

dialog {
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--text);
  max-width: 980px;
  padding: 0;
  width: min(980px, calc(100vw - 24px));
}

dialog::backdrop {
  background: rgb(0 0 0 / 0.22);
}

#videoForm {
  display: grid;
  gap: 18px;
  padding: 22px;
}

.dialogHead,
.formActions {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.formGrid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.wide {
  grid-column: 1 / -1;
}

.slotFields {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

fieldset {
  border: 1px solid var(--line);
  margin: 0;
  padding: 12px;
}

legend {
  font-weight: 700;
  padding: 0 6px;
}

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

.slotGrid .wide {
  grid-column: 1 / -1;
}

#formError {
  color: var(--danger);
  margin-left: auto;
}

[hidden] {
  display: none !important;
}

@media (max-width: 760px) {
  .topbar {
    align-items: start;
    flex-direction: column;
    padding: 20px 16px 14px;
  }

  h1 {
    font-size: 28px;
  }

  main {
    padding: 0 16px 34px;
  }

  .toolbar,
  .login form,
  .filters,
  .dialogHead,
  .formActions {
    align-items: stretch;
    flex-direction: column;
    width: 100%;
  }

  .toolbar button,
  .login button {
    width: 100%;
  }

  .formGrid,
  .slotFields,
  .slotGrid {
    grid-template-columns: 1fr;
  }
}
