:root {
  color-scheme: light;
  --bg: #f5f7f8;
  --panel: #ffffff;
  --text: #172026;
  --muted: #60717b;
  --line: #dbe3e7;
  --brand: #096b5a;
  --brand-dark: #064e43;
  --danger: #a63a2d;
  --ok: #157347;
}

* {
  box-sizing: border-box;
}

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding: 0 24px;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}

.topbar strong {
  display: block;
  font-size: 18px;
}

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

.topbar nav {
  display: flex;
  align-items: center;
  gap: 14px;
}

a {
  color: var(--brand);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.nav-link {
  min-height: auto;
  padding: 0;
  color: var(--brand);
  background: transparent;
  font-weight: 600;
}

.nav-link:hover {
  color: var(--brand-dark);
  background: transparent;
  text-decoration: underline;
}

.shell {
  width: min(960px, calc(100% - 32px));
  margin: 32px auto;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 8px 30px rgba(20, 35, 45, 0.06);
}

.auth-panel {
  max-width: 420px;
  margin: 10vh auto 0;
}

.wide {
  width: 100%;
}

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

h1 {
  margin: 0 0 18px;
  font-size: 24px;
  line-height: 1.2;
}

.panel-head h1 {
  margin: 0;
}

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

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

.span-2 {
  grid-column: span 2;
}

.receipt-form {
  gap: 14px;
}

.form-row {
  display: grid;
  gap: 16px;
}

.form-row.split {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

label {
  display: grid;
  gap: 7px;
  color: #31434d;
  font-weight: 600;
}

input {
  width: 100%;
  min-height: 42px;
  border: 1px solid #cbd6dc;
  border-radius: 6px;
  padding: 9px 11px;
  color: var(--text);
  font: inherit;
  font-weight: 400;
  background: #ffffff;
}

input:focus {
  outline: 3px solid rgba(9, 107, 90, 0.18);
  border-color: var(--brand);
}

input:disabled {
  color: var(--muted);
  background: #f2f5f6;
}

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  padding: 0 16px;
  color: #ffffff;
  background: var(--brand);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

button:hover,
.button:hover {
  background: var(--brand-dark);
  text-decoration: none;
}

button:disabled {
  cursor: progress;
  opacity: 0.7;
}

.button.muted {
  background: #e8eef0;
  color: #263942;
}

.button.small {
  min-height: 32px;
  padding: 0 10px;
  font-size: 13px;
}

.alert,
.status,
.hint {
  margin: 0 0 14px;
  border-radius: 6px;
  padding: 10px 12px;
  background: #f7e8e5;
  color: var(--danger);
}

.status {
  background: #eef3f5;
  color: #425761;
}

.status.ok {
  background: #e5f3ed;
  color: var(--ok);
}

.action-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.hint {
  margin-top: 16px;
  background: #eef3f5;
  color: #425761;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
}

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

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

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

th {
  color: #435762;
  font-size: 13px;
  font-weight: 700;
  background: #f8fafb;
}

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

.app-loading {
  padding: 32px;
  color: var(--muted);
}

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

  .topbar nav {
    flex-wrap: wrap;
  }

  .action-status {
    align-items: stretch;
    flex-direction: column;
  }

  .shell {
    margin: 18px auto;
  }

  .panel {
    padding: 18px;
  }

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

  .form-row.split {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: auto;
  }
}
