* {
  box-sizing: border-box;
}

:root {
  --bg: #f4f1eb;
  --ink: #111827;
  --muted: #6b7280;
  --card: #ffffff;
  --line: #e5e7eb;
  --dark: #0f172a;
  --accent: #c6924b;
  --accent-dark: #9b6b30;
  --good: #047857;
  --bad: #b91c1c;
  --shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
}

.hidden {
  display: none !important;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 25% 10%, rgba(198, 146, 75, 0.22), transparent 35%),
    linear-gradient(135deg, #0b1120, #111827 55%, #020617);
}

.login-shell {
  width: min(980px, 100%);
  display: grid;
  place-items: center;
}

.login-panel {
  width: min(440px, 100%);
  padding: 36px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 30px;
  background: rgba(15, 23, 42, 0.78);
  color: #fff;
  box-shadow: 0 30px 80px rgba(0,0,0,0.35);
  backdrop-filter: blur(18px);
}

.brand-mark {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--accent), #f0c27a);
  color: #111827;
  font-weight: 950;
  letter-spacing: -0.05em;
}

.brand-mark.small {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  font-size: 14px;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 850;
  color: var(--accent-dark);
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.login-panel .eyebrow {
  margin-top: 24px;
  color: #f0c27a;
}

h1, h2, h3 {
  margin: 0;
  letter-spacing: -0.04em;
}

h1 {
  font-size: clamp(34px, 5vw, 64px);
  line-height: 0.95;
}

h2 {
  font-size: clamp(24px, 3vw, 34px);
}

h3 {
  margin-bottom: 14px;
  font-size: 18px;
}

.muted {
  color: var(--muted);
  line-height: 1.6;
}

.login-panel .muted,
.login-panel .tiny {
  color: #cbd5e1;
}

.tiny {
  font-size: 12px;
  line-height: 1.5;
}

.login-form {
  margin-top: 24px;
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 8px;
  font-size: 13px;
  font-weight: 750;
  color: #374151;
}

.login-panel label {
  color: #e5e7eb;
}

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 13px 14px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  outline: none;
}

textarea {
  min-height: 150px;
  resize: vertical;
  font-weight: 500;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(198, 146, 75, 0.16);
}

button {
  border: 0;
  border-radius: 16px;
  padding: 13px 18px;
  background: var(--dark);
  color: #fff;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.16);
}

.error {
  min-height: 20px;
  color: #fecaca;
  font-size: 13px;
  font-weight: 700;
}

.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: rgba(255,255,255,0.74);
  backdrop-filter: blur(18px);
}

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

.logo-row strong,
.logo-row span {
  display: block;
}

.logo-row span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

nav {
  margin-top: 34px;
  display: grid;
  gap: 8px;
}

nav a {
  color: #374151;
  text-decoration: none;
  font-weight: 800;
  padding: 12px 14px;
  border-radius: 15px;
}

nav a:hover {
  background: #fff;
  color: #111827;
}

.ghost-btn {
  margin-top: auto;
  background: #fff;
  color: var(--dark);
  border: 1px solid var(--line);
}

.content {
  padding: 30px;
  display: grid;
  gap: 22px;
}

.hero {
  padding: clamp(26px, 4vw, 48px);
  display: grid;
  grid-template-columns: 1fr 310px;
  gap: 24px;
  align-items: end;
  border-radius: 34px;
  background: linear-gradient(135deg, #fff, #fbf8f2);
  border: 1px solid rgba(229, 231, 235, 0.85);
  box-shadow: var(--shadow);
}

.hero-card {
  padding: 24px;
  border-radius: 28px;
  background: var(--dark);
  color: #fff;
}

.hero-card span,
.hero-card small {
  display: block;
  color: #cbd5e1;
}

.hero-card strong {
  display: block;
  margin: 10px 0;
  font-size: 34px;
  letter-spacing: -0.04em;
}

.card {
  padding: 24px;
  border-radius: 30px;
  background: var(--card);
  border: 1px solid rgba(229, 231, 235, 0.9);
  box-shadow: var(--shadow);
}

.section-title {
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}

.mini-btn {
  background: #f8fafc;
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 10px 13px;
  border-radius: 14px;
  white-space: nowrap;
}

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

.grid.three {
  grid-template-columns: repeat(3, 1fr);
}

.grid.four {
  grid-template-columns: repeat(4, 1fr);
}

.results {
  margin-top: 18px;
  display: grid;
  gap: 14px;
}

.results.three {
  grid-template-columns: repeat(3, 1fr);
}

.result {
  padding: 18px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: #fbfbfb;
}

.result.dark {
  background: var(--dark);
  color: #fff;
  border-color: var(--dark);
}

.result.compact {
  margin-top: 21px;
}

.result.wide {
  margin-top: 18px;
}

.result span,
.result small {
  display: block;
  color: var(--muted);
}

.result.dark span,
.result.dark small {
  color: #cbd5e1;
}

.result strong {
  display: block;
  margin-top: 7px;
  font-size: clamp(22px, 3vw, 34px);
  letter-spacing: -0.04em;
}

.result small {
  margin-top: 7px;
  font-size: 12px;
  line-height: 1.35;
}

.notice {
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 18px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #7c2d12;
  line-height: 1.5;
  font-size: 14px;
}

.two-col {
  margin-top: 22px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.breakdown {
  display: grid;
  gap: 8px;
}

.row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 16px;
  background: #f8fafc;
  border: 1px solid #eef2f7;
}

.row strong {
  white-space: nowrap;
}

.row.total {
  background: var(--dark);
  color: #fff;
  border-color: var(--dark);
}

.row.positive strong {
  color: var(--good);
}

.row.negative strong {
  color: var(--bad);
}

.checklist {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px 16px;
  margin-bottom: 16px;
}

.checklist label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

.checklist input {
  width: auto;
}

@media (max-width: 980px) {
  .app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    height: auto;
  }

  nav {
    grid-template-columns: repeat(3, 1fr);
  }

  .hero,
  .grid.three,
  .grid.four,
  .results.three,
  .two-col,
  .checklist {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .content,
  .sidebar {
    padding: 16px;
  }

  .card,
  .hero {
    border-radius: 24px;
    padding: 18px;
  }

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