:root {
  color-scheme: dark;
  --bg: #181818;
  --card: #222222;
  --muted: #cfcfcf;
  --text: #f3f6fb;
  --border: rgba(255, 255, 255, 0.08);
  --accent: #25b117;
  --accent-2: #25b117;
  --positive: #36d399;
  --negative: #ff6b6b;
}

h1, h2, h3, .eyebrow {
  font-family: Calibri, 'Trebuchet MS', Arial, sans-serif;
}

.chart-controls select {
  background: #0b1523;
  color: var(--text);
  border: 1px solid var(--border);
  padding: 8px 10px;
  border-radius: 8px;
}

.visually-hidden {
  position: absolute !important;
  height: 1px; width: 1px;
  overflow: hidden; clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap; border: 0; padding: 0; margin: -1px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Calibri, 'Trebuchet MS', Arial, sans-serif;
  background: #181818;
  color: var(--text);
}

.app-shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px;
}

.hidden {
  display: none !important;
}

.auth-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: min(480px, 100%);
  padding: 28px;
  border-radius: 28px;
  background: #222222;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.auth-badge {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  font-size: 1.35rem;
  box-shadow: 0 10px 24px rgba(35, 198, 200, 0.24);
}

.auth-text {
  color: var(--muted);
  margin: 8px 0 16px;
  line-height: 1.6;
}

.auth-features {
  display: none;
}

.auth-actions {
  display: flex;
  gap: 10px;
}

.google-btn,
.signout-btn {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border: 1px solid var(--border);
}

.auth-message {
  min-height: 24px;
  margin-top: 10px;
  font-size: 0.95rem;
}

input:focus,
select:focus,
button:focus-visible {
  outline: 2px solid rgba(35, 198, 200, 0.5);
  outline-offset: 2px;
}

button {
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(35, 198, 200, 0.16);
}

button:disabled {
  opacity: 0.65;
  cursor: wait;
  transform: none;
  box-shadow: none;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-pill {
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(35, 198, 200, 0.16);
  color: var(--accent);
  font-size: 0.9rem;
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: #222222;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.24em;
  color: var(--accent);
  font-size: 0.75rem;
  margin: 0 0 6px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(1.5rem, 2.3vw, 2.2rem);
}

.hero-text {
  margin: 10px 0 0;
  color: var(--muted);
  max-width: 700px;
}

.hero-badge {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(35, 198, 200, 0.15);
  color: var(--accent);
  font-weight: 600;
  white-space: nowrap;
}

.app-status {
  margin: -8px 0 16px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(54, 211, 153, 0.12);
  border: 1px solid rgba(54, 211, 153, 0.2);
  color: #8ff0bc;
}

.summary-grid,
.forms-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin-bottom: 16px;
}

.card {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: #222222;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.16);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.card-header h2,
.card h3 {
  margin: 0;
  font-size: 1.05rem;
}

.card-header span {
  color: var(--muted);
  font-size: 0.85rem;
}

.value {
  font-size: 1.6rem;
  font-weight: 700;
  margin: 8px 0 0;
}

.positive { color: var(--positive); }
.negative { color: var(--negative); }

.chart-card { min-height: 320px; margin-bottom: 16px; }

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.field-row {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.95rem;
  color: var(--muted);
}

input,
select,
button {
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 10px 12px;
  font: inherit;
}

input,
select {
  background: #0b1523;
  color: var(--text);
}

button {
  cursor: pointer;
  background: #25b117;
  color: white;
  font-weight: 600;
}

.list {
  list-style: none;
  padding: 0;
  margin: 14px 0 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #0b1523;
  color: var(--muted);
}

.list button {
  padding: 6px 10px;
  font-size: 0.82rem;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
}

.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.78rem;
  color: white;
  background: rgba(35, 198, 200, 0.2);
}

.progress {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-top: 8px;
}

.progress > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--positive), var(--accent));
}

@media (max-width: 700px) {
  .hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .field-row {
    grid-template-columns: 1fr;
  }
}
