:root {
  color-scheme: dark;
  --bg: #101014;
  --panel: #1a1a20;
  --line: #303039;
  --text: #f5f3f0;
  --muted: #a7a6b1;
  --orange: #ff713b;
  --green: #63e2a1;
  --red: #ff777c;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  font-size: 14px;
  line-height: 1.5;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 14px;
  background: #24242c;
  color: var(--text);
  min-height: 44px;
  font-weight: 650;
}
button:disabled {
  opacity: 0.45;
  cursor: wait;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 2px;
}
a {
  color: var(--orange);
  text-decoration: none;
}
input,
select,
textarea {
  font-size: 16px;
  width: 100%;
  background: #111116;
  border: 1px solid #44434d;
  border-radius: 12px;
  padding: 12px;
  color: var(--text);
  min-height: 46px;
}
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--orange);
  border-color: transparent;
}
label {
  display: block;
  font-size: 14px;
  margin: 13px 0 6px;
  color: #d2d0d9;
}
input[type="checkbox"] {
  width: 22px;
  min-height: 22px;
  accent-color: var(--orange);
  vertical-align: middle;
  margin-right: 9px;
}
h1,
h2,
h3,
p {
  margin: 0 0 12px;
}
h1 {
  font-size: clamp(24px, 4vw, 30px);
  line-height: 1.15;
  letter-spacing: -1.3px;
}
h2 {
  font-size: 20px;
  letter-spacing: -0.5px;
}
h3 {
  font-size: 18px;
}
.muted,
small {
  color: var(--muted);
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 2px;
  font-weight: 750;
  color: var(--orange);
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px max(14px, calc((100vw - 1100px) / 2));
  border-bottom: 1px solid var(--line);
  gap: 12px;
}
header > div {
  display: flex;
  gap: 12px;
  align-items: center;
}
.wordmark {
  font-weight: 850;
  font-size: 14px;
  letter-spacing: 0.7px;
  color: var(--text);
  white-space: nowrap;
}
.wordmark b {
  color: var(--orange);
}
.connection {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--green);
}
.connection::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}
.connection.connecting {
  color: var(--muted);
}
.connection.offline {
  color: var(--red);
}
.operator {
  font-size: 12px;
  padding: 7px 10px;
  min-height: 36px;
}
main {
  max-width: 1100px;
  margin: auto;
  padding: 20px 18px 145px;
}
.topline {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 15px;
  margin-bottom: 24px;
}
.counter {
  color: var(--orange);
  font-variant-numeric: tabular-nums;
  font-size: 30px;
  font-weight: 800;
  text-align: right;
  white-space: nowrap;
}
.counter small {
  font-size: 12px;
  display: block;
  font-weight: 400;
}
.checkin-topline {
  align-items: center;
  margin-bottom: 4px;
}
.checkin-topline h1 {
  font-size: 22px;
  letter-spacing: -0.5px;
  margin: 0;
}
.checkin-topline .counter {
  font-size: 18px;
}
.checkin-topline .counter small {
  display: inline;
  font-size: 11px;
  margin-left: 5px;
}
.searchbox {
  position: sticky;
  top: 0;
  background: var(--bg);
  padding: 8px 0;
  z-index: 4;
}
.searchbox input {
  font-size: 16px;
  padding: 12px 14px;
  background: var(--panel);
  border: 1px solid #55505a;
}
.filters {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 4px 0 10px;
  scrollbar-width: none;
}
.filters button {
  white-space: nowrap;
  min-height: 40px;
  font-size: 12px;
  padding: 7px 12px;
  border-radius: 24px;
}
.filters .active {
  background: var(--orange);
  border-color: var(--orange);
  color: #190d08;
}
.section-label {
  display: flex;
  justify-content: space-between;
  margin: 5px 0 10px;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.5px;
}
.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  align-items: start;
}
.person {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
}
.person .info {
  min-width: 0;
  flex: 1;
}
.person h3 {
  font-size: 15px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  margin: 0;
}
.person-name {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.person-details {
  margin: 2px 0 0;
}
.person-details summary {
  font-size: 12px;
  padding: 6px 0;
  width: fit-content;
}
.person-details[open] summary {
  margin-bottom: 3px;
}
.person p {
  font-size: 13px;
  color: var(--muted);
  margin: 3px 0;
}
.person .amount {
  color: var(--text);
}
.person .enter {
  min-width: 78px;
  background: var(--green);
  border: 0;
  color: #082b19;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 750;
  flex-shrink: 0;
}
.person .entered {
  color: var(--red);
  border-color: #773e45;
  background: #312027;
  font-size: 11px;
  line-height: 1.2;
  min-width: 78px;
  flex-shrink: 0;
}
.status {
  font-size: 11px;
  color: var(--muted);
  margin-top: 8px;
}
.due {
  color: #ffbe73 !important;
  font-weight: 750;
}
.tag {
  font-size: 9px;
  letter-spacing: 1px;
  color: #c5b2ff;
  background: #342b48;
  padding: 2px 5px;
  border-radius: 5px;
  display: inline-block;
  margin: 0;
}
.bottom {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 0;
  background: #18181ff5;
  border-top: 1px solid var(--line);
  padding: 5px 10px calc(5px + env(safe-area-inset-bottom));
  z-index: 6;
  backdrop-filter: blur(15px);
}
.bottom a {
  width: 110px;
  text-align: center;
  color: var(--muted);
  font-size: 19px;
  padding: 3px 5px;
  border-radius: 10px;
}
.bottom span {
  display: block;
  font-size: 10px;
  font-weight: 650;
}
.bottom a.active {
  color: var(--orange);
  background: #ff713b12;
}
.new-entry {
  position: fixed;
  bottom: calc(70px + env(safe-area-inset-bottom));
  right: max(20px, calc((100vw - 1100px) / 2));
  background: var(--orange);
  color: #241109;
  border: 0;
  box-shadow: 0 5px 30px #0008;
  z-index: 5;
  min-height: 48px;
  font-size: 14px;
}
.primary {
  background: var(--orange);
  color: #221108;
  border: 0;
}
.success {
  background: var(--green);
  color: #082b19;
  border: 0;
}
.danger {
  color: var(--red);
  border-color: #79464b;
}
.full {
  width: 100%;
  margin-top: 18px;
}
.row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.row > * {
  flex: 1;
}
.row .no-flex {
  flex: none;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0;
}
.stat {
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.stat span {
  display: block;
  font-size: 12px;
  color: var(--muted);
}
.stat strong {
  font-size: 24px;
  letter-spacing: -0.6px;
  display: block;
  margin-top: 8px;
}
.stat.accent {
  border-color: #77412b;
  background: linear-gradient(130deg, #352319, #201a18);
}
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 22px;
  margin: 15px 0;
}
.tablewrap {
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
th,
td {
  text-align: left;
  padding: 13px 10px;
  border-bottom: 1px solid var(--line);
}
th {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
}
td:last-child {
  text-align: right;
}
.empty {
  padding: 50px 20px;
  text-align: center;
  color: var(--muted);
  grid-column: 1/-1;
}
.notice {
  border: 1px solid #7d6032;
  background: #362b1c;
  padding: 14px;
  border-radius: 12px;
  margin: 12px 0;
  font-size: 14px;
}
.error {
  color: var(--red);
  white-space: pre-wrap;
}
.mini {
  font-size: 12px;
  min-height: 38px;
  padding: 7px 11px;
}
.time {
  font-variant-numeric: tabular-nums;
}
dialog {
  max-width: 530px;
  width: calc(100% - 24px);
  max-height: 90dvh;
  background: #1a1a20;
  color: var(--text);
  border: 1px solid #49464f;
  border-radius: 20px;
  padding: 24px;
  overscroll-behavior: contain;
}
dialog::backdrop {
  background: #000b;
  backdrop-filter: blur(5px);
}
.dialoghead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.close {
  padding: 5px 12px;
  font-size: 23px;
  min-height: 40px;
}
#toast {
  position: fixed;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  background: var(--green);
  color: #062b19;
  box-shadow: 0 6px 40px #0008;
  border-radius: 12px;
  padding: 16px 22px;
  font-weight: 750;
  display: none;
  width: max-content;
  max-width: 92vw;
}
#toast.error {
  background: #642c34;
  color: #fff;
}
form .error {
  margin-top: 12px;
}
.login {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse at 20% 10%, #3b231a 0, transparent 55%), var(--bg);
}
.login-card {
  width: min(100%, 420px);
  padding: 35px 25px;
}
.login h1 {
  font-size: 26px;
  letter-spacing: -0.5px;
}
.login form {
  margin: 24px 0 0;
}
.login .primary {
  width: 100%;
  margin-top: 14px;
}
.history-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.history-item strong {
  display: block;
  font-size: 15px;
}
details {
  margin: 10px 0;
}
summary {
  cursor: pointer;
  color: var(--muted);
}
.paymentrow {
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.hidden {
  display: none !important;
}
@media (max-width: 650px) {
  header {
    padding: 8px 14px;
  }
  .connection {
    font-size: 10px;
  }
  header > div {
    gap: 7px;
  }
  .wordmark {
    font-size: 11px;
  }
  .operator {
    max-width: 95px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  main {
    padding: 14px 12px 145px;
  }
  .cards {
    grid-template-columns: 1fr;
  }
  .person {
    padding: 11px 12px;
    gap: 10px;
  }
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .stat {
    padding: 12px;
  }
  .stat strong {
    font-size: 22px;
  }
  .counter {
    font-size: 21px;
  }
  .new-entry {
    left: 12px;
    right: 12px;
    width: calc(100% - 24px);
  }
  .panel {
    padding: 16px;
  }
  dialog {
    padding: 20px;
  }
  .bottom a {
    width: 20%;
    max-width: 100px;
  }
  .row.fields {
    display: block;
  }
  .row.fields > div {
    margin-top: 10px;
  }
  table {
    font-size: 12px;
  }
  th,
  td {
    padding: 10px 6px;
  }
}

.dashboard {
  max-width: 720px;
}
.dashboard h1 {
  font-size: 22px;
  letter-spacing: -0.5px;
  margin-bottom: 16px;
}
.dashboard-counts {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0 0 12px;
  gap: 10px;
}
.dashboard-counts .stat {
  padding: 14px;
}
.dashboard-counts .stat strong {
  font-size: 24px;
  margin-top: 4px;
}
.dashboard-money {
  padding: 0 16px;
  margin: 0 0 12px;
}
.dashboard-money > div,
.dashboard-metrics > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}
.dashboard-money span {
  color: var(--muted);
}
.dashboard-money strong {
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.dashboard-money .net {
  border: 0;
  color: var(--orange);
}
.dashboard-money .net span {
  color: inherit;
  font-weight: 650;
}
.dashboard-money .net strong {
  font-size: 24px;
}
.dashboard-details {
  margin: 0;
  padding: 0 16px;
}
.dashboard-details > summary {
  padding: 13px 0;
  min-height: 46px;
  color: var(--text);
}
.dashboard-metrics {
  margin: 0 0 22px;
  font-size: 13px;
}
.dashboard-metrics dt {
  color: var(--muted);
}
.dashboard-metrics dd {
  margin: 0;
  font-weight: 650;
  text-align: right;
  white-space: nowrap;
}
.dashboard-details h2 {
  font-size: 16px;
}
.dashboard-note {
  font-size: 11px;
  margin: 14px 0;
}
.dashboard-history {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 4px;
  font-size: 12px;
}
