:root {
  color-scheme: light;
  --bg: #f6f7f4;
  --panel: #ffffff;
  --ink: #172026;
  --muted: #667085;
  --line: #d8ddd6;
  --primary: #0f766e;
  --primary-dark: #115e59;
  --accent: #facc15;
  --danger: #b42318;
  --shadow: 0 18px 45px rgba(23, 32, 38, 0.09);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  width: min(980px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0 18px;
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(1.9rem, 6vw, 3rem);
  line-height: 1;
}

h2 {
  margin-bottom: 18px;
  font-size: 1.45rem;
}

.login-panel,
.work-area,
.user-strip,
.tabs,
.summary-grid,
.filters {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-panel {
  max-width: 440px;
  margin: 42px auto;
  padding: 24px;
}

.brand-mark {
  width: 76px;
  height: 76px;
  margin-bottom: 18px;
}

.brand-mark svg {
  width: 100%;
  height: 100%;
  display: block;
}

.stack {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
}

label span,
.metric span,
.muted {
  color: var(--muted);
  font-size: 0.83rem;
}

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

input:focus,
select:focus {
  border-color: var(--primary);
  outline: 3px solid rgba(15, 118, 110, 0.16);
}

button {
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
}

.primary {
  background: var(--primary);
  color: white;
}

.primary:active {
  background: var(--primary-dark);
}

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

.icon-button {
  width: 46px;
  min-width: 46px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
}

.user-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 14px;
  margin-bottom: 12px;
}

.user-strip div {
  display: grid;
  gap: 3px;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 6px;
  margin-bottom: 12px;
  box-shadow: none;
}

.tab {
  background: transparent;
  color: var(--muted);
}

.tab.active {
  background: var(--ink);
  color: white;
}

.work-area {
  padding: 16px;
}

.entry-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
}

.wide {
  grid-column: 1 / -1;
}

.filters {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(150px, 1fr) 100px 86px;
  gap: 10px;
  align-items: end;
  box-shadow: none;
  padding: 12px;
  margin-bottom: 12px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  box-shadow: none;
  padding: 12px;
  margin-bottom: 12px;
}

.metric {
  display: grid;
  gap: 5px;
  border-left: 4px solid var(--primary);
  padding-left: 11px;
}

.metric strong {
  font-size: 1.3rem;
}

.entry-list {
  display: grid;
  gap: 10px;
}

.entry-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.entry-main {
  display: grid;
  gap: 5px;
}

.entry-route {
  font-weight: 800;
}

.entry-meta {
  color: var(--muted);
  font-size: 0.86rem;
}

.entry-money {
  display: grid;
  gap: 5px;
  justify-items: end;
  text-align: right;
  min-width: 96px;
}

.entry-money strong {
  color: var(--primary);
}

.delete-btn {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid #f1b8b4;
  background: #fff5f5;
  color: var(--danger);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  width: min(460px, calc(100% - 28px));
  padding: 13px 15px;
  border-radius: 8px;
  background: var(--ink);
  color: white;
  box-shadow: var(--shadow);
  text-align: center;
}

.small {
  font-size: 0.88rem;
}

.hidden {
  display: none !important;
}

@media (max-width: 680px) {
  .app-shell {
    padding: 14px;
  }

  .login-panel {
    margin-top: 22px;
  }

  .entry-grid,
  .filters,
  .summary-grid {
    grid-template-columns: 1fr;
  }

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

  .entry-money {
    justify-items: start;
    text-align: left;
  }
}
