:root {
  --bg: #071321;
  --bg2: #0d1f35;
  --card: rgba(12, 29, 48, 0.78);
  --line: rgba(157, 190, 225, 0.18);
  --text: #e7f2ff;
  --muted: #b6cae2;
  --brand: #2dd4bf;
  --brand2: #38bdf8;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Avenir Next", "SF Pro Text", "Helvetica Neue", sans-serif;
  color: var(--text);
  background: radial-gradient(1200px 600px at 90% -10%, #1c3f63 0%, transparent 55%),
              linear-gradient(160deg, var(--bg) 0%, var(--bg2) 100%);
  min-height: 100vh;
  padding-bottom: calc(78px + env(safe-area-inset-bottom));
}

.bg-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(40% 20% at 10% 0%, rgba(48, 179, 212, 0.2), transparent 70%);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  backdrop-filter: blur(10px);
  background: rgba(8, 19, 33, 0.65);
  border-bottom: 1px solid var(--line);
}

.brand {
  color: var(--text);
  text-decoration: none;
  font-size: 1.15rem;
  font-weight: 700;
}

.home-button {
  color: #032029;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  text-decoration: none;
  font-weight: 700;
  border-radius: 999px;
  padding: 10px 14px;
}

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

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 12px 30px rgba(2, 10, 20, 0.34);
  margin-bottom: 14px;
}

.hero h1 { margin: 0 0 8px; font-size: 1.6rem; }
.hero p { margin: 0 0 12px; color: var(--muted); }

.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 11px 14px;
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  border: 1px solid var(--line);
  background: rgba(24, 45, 67, 0.7);
}
.btn.primary {
  color: #04232e;
  font-weight: 700;
  border: none;
  background: linear-gradient(135deg, #2dd4bf 0%, #60a5fa 100%);
}
.submit { width: 100%; font-size: 1.02rem; }
.success { border-color: rgba(45, 212, 191, 0.45); }

.grid-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.big { font-size: 2rem; margin: 6px 0 0; font-weight: 700; }

.stack label {
  display: block;
  font-weight: 500;
  color: var(--muted);
  margin-top: 10px;
}

input, select, textarea {
  width: 100%;
  margin-top: 6px;
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(12, 26, 41, 0.9);
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
}

textarea { min-height: 90px; }
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.hint { margin-top: -6px; color: var(--muted); }

.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; min-width: 620px; }
th, td {
  border-bottom: 1px solid var(--line);
  text-align: left;
  padding: 10px;
  white-space: nowrap;
}
th { color: var(--muted); font-weight: 600; }

.chart-card { height: 280px; }
.chart-card h2 { margin: 0 0 8px; }

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 11;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: rgba(7, 15, 26, 0.95);
  border-top: 1px solid var(--line);
}

.tabbar a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.88rem;
  text-align: center;
  padding: 10px 6px;
  border-radius: 10px;
}

.tabbar a:hover, .tabbar a:focus {
  color: var(--text);
  background: rgba(41, 66, 95, 0.45);
}

@media (max-width: 560px) {
  .grid-two, .field-row { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.35rem; }
}
