:root {
  color-scheme: light;
  --ink: #07313a;
  --muted: #64748b;
  --line: #cce7e9;
  --mist: #f4fbfb;
  --paper: #ffffff;
  --teal: #0f9f9a;
  --deep: #005f73;
  --soft: #e7f7f6;
  --danger: #b42318;
  --ok: #027a48;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--mist);
  color: var(--ink);
}

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

button {
  border: 0;
}

.app-shell {
  min-height: 100vh;
}

.login {
  min-height: 100vh;
  display: grid;
  align-items: center;
  padding: 24px;
  background:
    linear-gradient(160deg, rgba(0, 95, 115, 0.94), rgba(15, 159, 154, 0.84)),
    url("assets/icon.svg") center 12% / 180px no-repeat;
}

.login-panel {
  width: min(440px, 100%);
  margin: auto;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 24px 60px rgba(2, 42, 53, 0.24);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand img {
  width: 48px;
  height: 48px;
}

.eyebrow {
  margin: 0;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: 28px;
  line-height: 1.08;
}

h2 {
  margin-bottom: 4px;
  font-size: 24px;
}

h3 {
  margin-bottom: 8px;
  font-size: 16px;
}

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

.field {
  display: grid;
  gap: 7px;
  margin-top: 14px;
}

.field span {
  font-size: 13px;
  font-weight: 750;
  color: #334155;
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px 12px;
  color: var(--ink);
  outline: none;
}

.textarea {
  resize: vertical;
  min-height: 82px;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(15, 159, 154, 0.14);
}

.btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 8px;
  padding: 0 14px;
  font-weight: 850;
  cursor: pointer;
}

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

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

.btn-light {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.btn-danger {
  border: 1px solid #fecaca;
  background: #fff5f5;
  color: var(--danger);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.page {
  min-height: 100vh;
  padding-bottom: 86px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: max(14px, env(safe-area-inset-top)) 16px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
}

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

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--deep);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 900;
}

.content {
  width: min(980px, 100%);
  margin: 0 auto;
  padding: 16px;
}

.hero {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 8px;
  background: linear-gradient(135deg, #ffffff, #e7f7f6);
  border: 1px solid var(--line);
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.stat {
  min-height: 76px;
  border-radius: 8px;
  padding: 10px;
  background: #fff;
  border: 1px solid rgba(204, 231, 233, 0.84);
}

.stat strong {
  display: block;
  font-size: 20px;
}

.stat span {
  color: var(--muted);
  font-size: 12px;
}

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

.grid {
  display: grid;
  gap: 12px;
}

.card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  padding: 14px;
  box-shadow: 0 8px 24px rgba(2, 42, 53, 0.05);
}

.card-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  background: var(--soft);
  padding: 0 9px;
  color: var(--deep);
  font-size: 12px;
  font-weight: 850;
}

.money {
  font-weight: 900;
  color: var(--deep);
}

.empty,
.alert {
  border-radius: 8px;
  padding: 14px;
  font-weight: 750;
}

.empty {
  border: 1px dashed var(--line);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
}

.alert-error {
  border: 1px solid #fecaca;
  background: #fff5f5;
  color: var(--danger);
}

.alert-ok {
  border: 1px solid #bbf7d0;
  background: #f0fdf4;
  color: var(--ok);
}

.tabs {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: 8px max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
}

.tab {
  min-height: 54px;
  display: grid;
  place-items: center;
  gap: 2px;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.tab svg {
  width: 20px;
  height: 20px;
  stroke-width: 2.4;
}

.tab.active {
  background: var(--soft);
  color: var(--deep);
}

.form-section {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.item-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 84px;
  gap: 8px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

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

.summary-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid #e2f2f3;
}

@media (min-width: 760px) {
  .page {
    padding-bottom: 20px;
  }

  .content {
    padding: 24px;
  }

  .tabs {
    left: 50%;
    right: auto;
    bottom: 18px;
    width: min(620px, calc(100% - 32px));
    transform: translateX(-50%);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 18px 48px rgba(2, 42, 53, 0.16);
  }

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

  .hero {
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
    align-items: center;
  }
}
