:root {
  color-scheme: dark;
  --bg: #090c12;
  --panel: #101722;
  --panel-2: #141d2a;
  --line: rgba(148, 163, 184, 0.18);
  --text: #f8fafc;
  --muted: #95a3b8;
  --muted-2: #cbd5e1;
  --blue: #3b82f6;
  --green: #22c55e;
  --amber: #f59e0b;
  --red: #ef4444;
}

* {
  box-sizing: border-box;
}

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

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

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

.login-card,
.blocked-card {
  width: min(440px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 28px;
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.35);
}

.brand {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 0;
  margin: 0;
}

.subtitle {
  color: var(--muted);
  margin: 8px 0 24px;
  line-height: 1.5;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.field span {
  color: var(--muted-2);
  font-size: 13px;
  font-weight: 800;
}

.input,
.select {
  width: 100%;
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #0c121b;
  color: var(--text);
  padding: 0 12px;
  outline: none;
}

.textarea {
  min-height: 88px;
  padding: 10px 12px;
  resize: vertical;
}

.input:focus,
.select:focus {
  border-color: rgba(59, 130, 246, 0.75);
}

.hidden {
  display: none;
}

.primary,
.secondary,
.danger,
.ghost {
  min-height: 36px;
  border-radius: 8px;
  padding: 0 12px;
  color: var(--text);
  font-weight: 850;
  white-space: nowrap;
}

.primary {
  background: var(--blue);
}

.secondary {
  background: rgba(34, 197, 94, 0.18);
  color: #bbf7d0;
}

.danger {
  background: rgba(239, 68, 68, 0.18);
  color: #fecaca;
}

.ghost {
  background: rgba(148, 163, 184, 0.12);
  color: var(--muted-2);
}

.error {
  color: #fecaca;
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  padding: 10px 12px;
  margin: 12px 0;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 20;
  min-width: 260px;
  max-width: 420px;
  border-radius: 8px;
  padding: 12px 14px;
  background: #102235;
  border: 1px solid rgba(59, 130, 246, 0.35);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.4);
  color: var(--text);
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 250px 1fr;
}

.sidebar {
  background: #080b11;
  border-right: 1px solid var(--line);
  padding: 20px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.nav-title {
  font-size: 22px;
  font-weight: 950;
  margin: 0 10px 20px;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav button {
  min-height: 42px;
  border-radius: 8px;
  background: transparent;
  color: var(--muted-2);
  text-align: left;
  padding: 0 12px;
  font-weight: 850;
}

.nav button.active {
  background: var(--panel-2);
  color: var(--text);
}

.main {
  min-width: 0;
  padding: 28px;
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

.page-title {
  margin: 0;
  font-size: 28px;
  font-weight: 950;
}

.page-note {
  margin: 6px 0 0;
  color: var(--muted);
}

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

.card {
  text-align: left;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
}

.card.clickable {
  min-height: 112px;
  transition: border-color 160ms ease, transform 160ms ease, background 160ms ease;
}

.card.clickable:hover {
  transform: translateY(-1px);
  border-color: rgba(59, 130, 246, 0.55);
  background: var(--panel-2);
}

.card.good {
  border-color: rgba(34, 197, 94, 0.32);
}

.card.warn {
  border-color: rgba(245, 158, 11, 0.34);
}

.card.bad {
  border-color: rgba(239, 68, 68, 0.34);
}

.card-label {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.card-value {
  display: block;
  font-size: 30px;
  font-weight: 950;
  margin-top: 8px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.search {
  width: min(360px, 100%);
}

.compact {
  width: auto;
  min-width: 180px;
}

.wide-select {
  min-width: 240px;
}

.earnings-cards {
  margin: 12px 0;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}

.tabs button {
  min-height: 36px;
  border-radius: 999px;
  padding: 0 12px;
  background: rgba(148, 163, 184, 0.12);
  color: var(--muted-2);
  font-weight: 850;
}

.tabs button.active {
  background: rgba(59, 130, 246, 0.22);
  color: #dbeafe;
  border: 1px solid rgba(59, 130, 246, 0.38);
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}

.booking-group {
  margin-bottom: 18px;
}

.booking-group-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 14px;
  margin: 12px 0 8px;
  background: var(--panel);
  color: var(--text);
  text-align: left;
}

.booking-group-title {
  font-size: 16px;
  font-weight: 900;
}

.booking-group-head h3 {
  margin: 0;
  font-size: 16px;
}

.booking-group-head span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

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

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

th {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-size: 11px;
  background: rgba(255, 255, 255, 0.02);
}

td strong {
  display: block;
  font-size: 14px;
}

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

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

.action-menu-trigger {
  min-width: 112px;
}

.action-backdrop {
  align-items: start;
  justify-items: end;
}

.action-sheet {
  width: min(360px, calc(100vw - 40px));
  max-height: calc(100vh - 40px);
  overflow: auto;
  margin-top: 72px;
  margin-right: 28px;
  padding: 16px;
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 10px;
  background: #0c121b;
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.55);
}

.action-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.action-item {
  width: 100%;
  justify-content: flex-start;
  min-height: 42px;
  text-align: left;
}

.action-item:hover,
.action-menu-trigger:hover {
  filter: brightness(1.12);
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 900;
  background: rgba(148, 163, 184, 0.14);
  color: var(--muted-2);
}

.badge.good {
  color: #bbf7d0;
  background: rgba(34, 197, 94, 0.16);
}

.badge.warn {
  color: #fde68a;
  background: rgba(245, 158, 11, 0.18);
}

.badge.bad {
  color: #fecaca;
  background: rgba(239, 68, 68, 0.16);
}

.empty,
.loading {
  color: var(--muted);
  padding: 28px;
  text-align: center;
}

.details {
  display: grid;
  gap: 8px;
  color: var(--muted-2);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(2, 6, 23, 0.72);
  overflow: hidden;
}

.modal {
  width: min(420px, 100%);
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px;
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.45);
  scrollbar-color: rgba(148, 163, 184, 0.65) rgba(15, 23, 42, 0.35);
}

.modal.wide {
  width: min(880px, 100%);
}

.modal-head {
  position: sticky;
  top: -18px;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin: -18px -18px 0;
  padding: 18px;
  background: linear-gradient(180deg, var(--panel) 78%, rgba(15, 23, 42, 0));
}

.modal h3 {
  margin: 0;
  font-size: 18px;
}

.modal h4 {
  margin: 18px 0 8px;
  font-size: 14px;
  color: var(--muted-2);
}

.modal p {
  margin: 10px 0 0;
  color: var(--muted-2);
  line-height: 1.5;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.metric-box {
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #0c121b;
  padding: 12px;
}

.metric-box span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.metric-box strong {
  display: block;
  margin-top: 6px;
  font-size: 18px;
}

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

.recent-list div {
  border: 1px solid var(--line);
  background: #0c121b;
  border-radius: 8px;
  padding: 10px;
}

.recent-list strong,
.recent-list span {
  display: block;
}

.recent-list span {
  color: var(--muted);
  margin-top: 3px;
}

.modal-action-row {
  margin-top: 16px;
}

.panel-section {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  padding: 16px;
}

.panel-section h3 {
  margin: 0 0 12px;
  font-size: 16px;
}

.reason-field {
  margin-top: 14px;
}

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

.history-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0c121b;
  padding: 10px;
}

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

.history-item span {
  color: var(--muted);
  margin-top: 3px;
}

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

  .sidebar {
    position: static;
    height: auto;
  }

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

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

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

@media (max-width: 560px) {
  .main {
    padding: 18px;
  }

  .cards,
  .nav,
  .detail-grid {
    grid-template-columns: 1fr;
  }
}
