:root {
  --night: #08090a;
  --asphalt: #101215;
  --graphite: #15181c;
  --raised: #1d2126;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.18);
  --platinum: #e6e6e3;
  --silver: #8d9299;
  --silver-dim: #62676e;
  --red: #bb0a1e;
  --red-hover: #d3122a;
  --red-text: #ff4d5e;
  --led: #e8f1ff;
  --green: #5fd38d;
  --amber: #f2b84b;
  --display: "Fira Sans Extra Condensed", "Arial Narrow", sans-serif;
  --body: "Fira Sans", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--night);
  color: var(--platinum);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

h1,
h2,
p,
ul {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

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

:focus-visible {
  outline: 2px solid var(--led);
  outline-offset: 2px;
}

code {
  font-size: 0.92em;
  color: #fff;
}

.muted {
  color: var(--silver);
  font-weight: 400;
}

.wordmark {
  font-family: var(--display);
  font-weight: 700;
  font-size: 22px;
  color: #fff;
  letter-spacing: 0.01em;
}

.wordmark span {
  color: var(--red-text);
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  color: var(--silver);
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
}

.link {
  color: #fff;
  text-decoration: underline;
  text-decoration-color: var(--red);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
  font-size: 14px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 22px;
  border: 1px solid transparent;
  background: none;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s;
}

.btn-red {
  background: var(--red);
  color: #fff;
}

.btn-red:hover {
  background: var(--red-hover);
}

.btn-line {
  border-color: var(--line-strong);
  color: #fff;
}

.btn-line:hover {
  border-color: #fff;
}

.btn-xs {
  min-height: 34px;
  padding: 0 12px;
  font-size: 13px;
}

.login {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
}

.login-card {
  display: grid;
  gap: 16px;
  width: min(420px, 100%);
  padding: 32px;
  background: var(--asphalt);
  border: 1px solid var(--line-strong);
  border-top: 3px solid var(--red);
}

.login-card h1 {
  font-family: var(--display);
  font-size: 34px;
  line-height: 1;
  color: #fff;
}

.login-card .link {
  justify-self: start;
}

.field {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: var(--silver);
}

.field input {
  height: 48px;
  padding: 0 14px;
  background: var(--night);
  border: 1px solid var(--line-strong);
  font-size: 16px;
}

.field input:focus {
  border-color: #fff;
  outline: none;
}

.alert {
  padding: 10px 12px;
  border-left: 3px solid var(--red);
  background: rgba(187, 10, 30, 0.12);
  font-size: 14px;
}

.top {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 28px;
  padding: 14px clamp(16px, 3vw, 40px);
  background: rgba(8, 9, 10, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  flex: 1 1 auto;
}

.tabs a {
  padding: 8px 12px;
  color: var(--silver);
  font-size: 14px;
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

.tabs a:hover {
  color: #fff;
}

.tabs a.is-active {
  color: #fff;
  border-bottom-color: var(--red);
}

.top-actions {
  display: flex;
  gap: 8px;
}

.top-actions form {
  margin: 0;
}

.wrap {
  display: grid;
  gap: 24px;
  padding: 24px clamp(16px, 3vw, 40px) 48px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.stat {
  display: grid;
  gap: 2px;
  padding: 16px 20px;
  background: var(--asphalt);
  text-decoration: none;
  transition: background-color 0.2s;
}

.stat:hover {
  background: var(--graphite);
}

.stat b {
  font-family: var(--display);
  font-size: 40px;
  line-height: 1;
  color: #fff;
}

.stat span {
  font-size: 13px;
  color: var(--silver);
}

.panel {
  display: grid;
  gap: 16px;
}

.panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-head h1 {
  font-family: var(--display);
  font-size: 32px;
  line-height: 1;
  color: #fff;
}

.panel-head h1 .muted {
  font-size: 0.7em;
  margin-left: 6px;
}

.week-nav {
  display: flex;
  gap: 6px;
}

.legend {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--silver);
}

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-left: 8px;
}

.dot:first-child {
  margin-left: 0;
}

.dot-td {
  background: var(--red);
}

.dot-sv {
  background: var(--led);
}

.calendar {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.day {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 360px;
  padding: 12px;
  background: var(--asphalt);
}

.day h2 {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--silver);
}

.day.is-today {
  background: var(--graphite);
  box-shadow: inset 0 3px 0 var(--red);
}

.day.is-today h2 {
  color: #fff;
}

.day.is-past {
  opacity: 0.55;
}

.empty-day {
  font-size: 13px;
  color: var(--silver-dim);
}

.event {
  display: grid;
  gap: 1px;
  padding: 8px 10px;
  background: var(--raised);
  border-left: 3px solid var(--red);
  text-decoration: none;
  font-size: 13px;
  line-height: 1.35;
  transition: background-color 0.2s;
}

.event:hover {
  background: #262b31;
}

.ev-sv {
  border-left-color: var(--led);
}

.ev-time {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}

.ev-title {
  font-weight: 500;
  color: #fff;
}

.ev-meta,
.ev-foot {
  color: var(--silver);
}

.ev-foot {
  font-size: 12px;
}

.event.st-cancelled {
  opacity: 0.45;
  text-decoration: line-through;
}

.event.st-done {
  opacity: 0.7;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
}

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

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

th {
  position: sticky;
  top: 0;
  background: var(--graphite);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--silver);
}

tbody tr {
  background: var(--asphalt);
  scroll-margin-top: 90px;
}

tbody tr:target {
  box-shadow: inset 3px 0 0 var(--red);
  background: var(--graphite);
}

tbody tr.is-past,
tbody tr.st-done {
  opacity: 0.6;
}

tbody tr.st-cancelled {
  opacity: 0.45;
}

td small {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--silver);
}

td.num {
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
}

td.when b {
  display: block;
  font-family: var(--display);
  font-size: 20px;
  color: #fff;
}

td.when {
  white-space: nowrap;
}

td.sum {
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
}

td.details {
  max-width: 320px;
  color: #c9cbcd;
}

td.details.wide {
  max-width: 460px;
}

.phone {
  color: var(--led);
  text-decoration: none;
}

.phone:hover {
  text-decoration: underline;
}

.items li + li {
  margin-top: 4px;
}

.tag {
  display: inline-block;
  padding: 2px 8px;
  border: 1px solid var(--line-strong);
  font-size: 12px;
}

.status-form {
  display: flex;
  gap: 6px;
  margin: 0;
}

.status-form select {
  height: 34px;
  padding: 0 8px;
  background: var(--night);
  border: 1px solid var(--line-strong);
  font-size: 13px;
}

tr.st-new .status-form select {
  border-color: var(--amber);
}

tr.st-confirmed .status-form select {
  border-color: var(--green);
}

.empty {
  padding: 32px;
  background: var(--asphalt);
  border: 1px dashed var(--line-strong);
  color: var(--silver);
}

@media (max-width: 960px) {
  .calendar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .day {
    min-height: 180px;
  }
}

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

  .top {
    gap: 8px;
  }
}
