@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
  --bg: #f6f7f2;
  --ink: #17241a;
  --muted: #778078;
  --green: #c9f36a;
  --deep: #152319;
  --line: #e4e8df;
  --purple: #e9e1ff;
  --orange: #ffe8d2;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
}

button, input, textarea, select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 245px;
  flex-shrink: 0;
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 28px 18px 20px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font: 700 20px 'Space Grotesk', sans-serif;
  letter-spacing: -.8px;
}

.workspace-label {
  margin: 48px 12px 13px;
  font-size: 10px;
  letter-spacing: 1.6px;
  font-weight: 700;
  color: #8a948b;
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-item {
  text-align: left;
  padding: 13px 14px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #6e786f;
  font-weight: 600;
  transition: .2s;
}

.nav-item:hover,
.nav-item.active {
  background: #eef5e6;
  color: #1a2b1c;
}

.sidebar-bottom {
  margin-top: auto;
}

.local-card {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 13px;
  background: #f5f7f2;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #8fc73e;
  flex-shrink: 0;
}

.local-card strong,
.local-card small {
  display: block;
}

.local-card strong {
  font-size: 12px;
}

.local-card small {
  font-size: 10px;
  color: var(--muted);
  margin-top: 4px;
}

.main-content {
  flex: 1;
  min-width: 0;
  padding: 0 38px;
  max-width: 1600px;
  margin: 0 auto;
}

.topbar {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.breadcrumb {
  font-size: 12px;
  color: #8a948b;
}

.privacy-pill {
  border: 1px solid var(--line);
  border-radius: 30px;
  padding: 8px 12px;
  font-size: 11px;
  background: white;
}

.view {
  display: none;
  padding: 34px 0 18px;
  animation: fadein .35s ease;
}

.view.active {
  display: block;
}

@keyframes fadein {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero {
  min-height: 355px;
  border-radius: 26px;
  background: var(--deep);
  color: white;
  display: grid;
  grid-template-columns: 1.08fr .92fr;
  overflow: hidden;
  position: relative;
}

.hero-copy {
  padding: 43px 25px 34px 44px;
  position: relative;
  z-index: 2;
}

.eyebrow {
  font-size: 10px;
  letter-spacing: 1.6px;
  font-weight: 700;
  color: #8a948b;
}

.hero .eyebrow {
  color: #b8d58e;
}

.hero h1,
.page-intro h1 {
  font: 600 clamp(36px, 4vw, 57px)/1.05 'Space Grotesk', sans-serif;
  letter-spacing: -2.5px;
  margin: 20px 0 16px;
}

.hero h1 em,
.page-intro h1 em {
  font-style: normal;
  color: var(--green);
}

.hero-copy > p {
  max-width: 435px;
  color: #bac5b9;
  line-height: 1.8;
  font-size: 13px;
}

.hero-actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.btn {
  border: 0;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 700;
  transition: transform .2s, background .2s;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--green);
  color: #172419;
}

.btn-primary:hover {
  background: #d8ff86;
}

.btn-ghost {
  background: #f2f5ee;
  color: #26352a;
  border: 1px solid var(--line);
}

.hero .btn-ghost {
  background: #253529;
  border-color: #3a4b3c;
  color: #e9efe7;
}

.btn-full {
  width: 100%;
  margin-top: 8px;
}

.hero-art {
  position: relative;
  min-height: 330px;
  overflow: hidden;
  background: radial-gradient(ellipse, #304632, #152319);
}

.main-orb {
  position: absolute;
  left: 50%;
  top: 49%;
  transform: translate(-50%, -50%);
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 25%, #f3ffd7, #b4e957 24%, #76a82e 54%, #36551d 75%);
  box-shadow: 0 0 55px #a8df5144;
  display: grid;
  place-items: center;
  animation: float 5s ease-in-out infinite;
}

.orb-inner {
  width: 95px;
  height: 95px;
  border-radius: 28px;
  background: #f5ffd9;
  display: grid;
  place-items: center;
  color: #24391c;
  font: 700 42px 'Space Grotesk';
  transform: rotate(-8deg);
}

.orbit {
  position: absolute;
  border: 1px solid #b3d48c40;
  border-radius: 50%;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.orbit-one {
  width: 310px;
  height: 245px;
  transform: translate(-50%, -50%) rotate(28deg);
}

.orbit-two {
  width: 355px;
  height: 300px;
  transform: translate(-50%, -50%) rotate(-36deg);
}

.floating-card {
  position: absolute;
  z-index: 3;
  background: #fafff3;
  color: #233124;
  border-radius: 12px;
  padding: 11px 13px;
  box-shadow: 0 15px 35px #0003;
  font-size: 10px;
}

.floating-card strong {
  display: block;
  margin-top: 4px;
}

.card-top {
  top: 13%;
  right: 5%;
}

.card-bottom {
  bottom: 13%;
  left: 4%;
}

@keyframes float {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -10px; }
}

.section-heading {
  margin: 34px 0 17px;
}

.section-heading h2,
.panel h2 {
  font: 600 21px 'Space Grotesk', sans-serif;
  letter-spacing: -.6px;
  margin: 8px 0 0;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.tool-card {
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
  padding: 21px;
  transition: .22s;
  color: var(--ink);
}

.tool-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 30px #1b2b1b0c;
}

.tool-icon {
  width: 39px;
  height: 39px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  font-size: 19px;
  margin-bottom: 18px;
}

.purple { background: var(--purple); color: #6241a5; }
.lime { background: #e9f8d7; color: #5e8b2c; }
.orange { background: var(--orange); color: #a75e1d; }

.tool-card small {
  font-size: 9px;
  letter-spacing: 1px;
  font-weight: 700;
  color: #818b80;
}

.tool-card h3 {
  font: 600 17px 'Space Grotesk';
  margin: 7px 0;
}

.tool-card p {
  font-size: 11px;
  line-height: 1.65;
  color: #7b857b;
}

.tool-link {
  display: block;
  font-size: 11px;
  font-weight: 700;
  margin-top: 19px;
}

.open-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-top: 18px;
  padding: 18px 20px;
  border-radius: 17px;
  background: #e9f2df;
  border: 1px solid #dce8d1;
}

.open-banner > div {
  flex: 1;
}

.open-banner strong {
  font-size: 12px;
}

.open-banner p {
  font-size: 11px;
  line-height: 1.6;
  color: #687664;
}

.disclaimer {
  font-size: 10px;
  color: #8c968c;
}

.page-intro {
  padding: 12px 0 26px;
}

.page-intro .eyebrow {
  color: #6e8b48;
}

.page-intro h1 {
  font-size: 43px;
  margin: 13px 0;
}

.page-intro p {
  color: #798379;
  line-height: 1.7;
  max-width: 570px;
  font-size: 13px;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(300px, .9fr) minmax(300px, 1.1fr);
  gap: 18px;
  align-items: start;
}

.panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 23px;
  min-width: 0;
}

.form-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

label {
  font-size: 11px;
  font-weight: 700;
  color: #4c594d;
  margin-top: 5px;
}

input, textarea, select {
  width: 100%;
  border: 1px solid #e1e6de;
  background: #fcfdfb;
  border-radius: 9px;
  padding: 11px 12px;
  color: #263329;
  outline: none;
  font-size: 12px;
}

input:focus, textarea:focus, select:focus {
  border-color: #a5c776;
  box-shadow: 0 0 0 3px #e9f5dc;
}

textarea {
  resize: vertical;
  line-height: 1.6;
}

.two-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.output-panel {
  display: flex;
  flex-direction: column;
  min-height: 480px;
}

.output-content {
  flex: 1;
  padding: 24px 2px;
  line-height: 1.75;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.empty-state,
.invoice-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  color: #7f8b7e;
}

.output-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid #edf0ea;
  padding-top: 16px;
}

.output-actions button:disabled {
  opacity: .4;
  cursor: not-allowed;
}

.invoice-preview-wrap {
  min-width: 0;
}

.output-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-bottom: 17px;
  border-bottom: 1px solid #edf0ea;
  margin-bottom: 20px;
}

.invoice-paper {
  background: white;
  border: 1px solid #e8e9e3;
  min-height: 420px;
  padding: 28px;
  color: #273229;
}

.invoice-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 2px solid #243b26;
  padding-bottom: 20px;
}

.invoice-brand {
  font: 700 22px 'Space Grotesk';
}

.invoice-brand span {
  color: #83a94b;
}

.invoice-number {
  text-align: right;
}

.invoice-number strong {
  font-size: 17px;
  display: block;
}

.invoice-number small,
.invoice-muted {
  color: #818b80;
  font-size: 10px;
}

.invoice-bill {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: 23px 0;
}

.invoice-bill strong {
  display: block;
  font-size: 11px;
  margin: 7px 0;
}

.invoice-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.invoice-table th {
  text-align: left;
  background: #f1f5ec;
  padding: 10px 7px;
}

.invoice-table td {
  padding: 14px 7px;
  border-bottom: 1px solid #edf0e8;
}

.invoice-table th:last-child,
.invoice-table td:last-child {
  text-align: right;
}

.invoice-total {
  margin: 17px 0 0 auto;
  width: 190px;
}

.invoice-total div {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 11px;
}

.invoice-total .grand {
  border-top: 1px solid #dfe5d9;
  margin-top: 6px;
  padding-top: 12px;
  font-weight: 700;
  font-size: 14px;
}

.invoice-notes {
  border-top: 1px solid #e7ebe3;
  margin-top: 28px;
  padding-top: 14px;
  font-size: 10px;
  color: #788477;
  white-space: pre-wrap;
}

.profit-layout {
  display: grid;
  grid-template-columns: minmax(280px, .8fr) minmax(300px, 1.2fr);
  gap: 18px;
  align-items: start;
}

.profit-results {
  display: grid;
  gap: 13px;
}

.result-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px;
  overflow-wrap: anywhere;
}

.result-card > span {
  display: block;
  font-size: 9px;
  letter-spacing: 1.4px;
  font-weight: 700;
  color: #818c80;
}

.result-card > strong {
  display: block;
  font: 600 31px 'Space Grotesk';
  margin: 11px 0 5px;
}

.result-card > small {
  font-size: 10px;
  color: #879187;
}

.result-primary {
  background: var(--deep);
  color: white;
}

.result-primary > span {
  color: #b1c3ae;
}

.result-primary > strong {
  color: var(--green);
  font-size: 38px;
}

.result-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
}

.recommendation {
  padding: 21px;
}

.recommendation p {
  font-size: 11px;
  line-height: 1.7;
  color: #788378;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding: 19px 0 25px;
  color: #8a9489;
  font-size: 10px;
}

.toast {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translate(-50%, 20px);
  padding: 12px 18px;
  border-radius: 12px;
  background: #18281c;
  color: white;
  opacity: 0;
  pointer-events: none;
  transition: .25s;
  z-index: 20;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 1000px) {
  .main-content { padding: 0 22px; }
  .sidebar { width: 205px; }
  .hero-copy { padding-left: 25px; }
}

@media (max-width: 800px) {
  .sidebar { width: 70px; padding: 22px 8px; }
  .brand { font-size: 0; }
  .workspace-label, .sidebar-bottom { display: none; }
  .nav-item { font-size: 0; text-align: center; padding: 14px 4px; }
  .hero { grid-template-columns: 1fr; }
  .hero-copy { padding: 30px 24px 10px; }
  .hero-art { min-height: 260px; }
  .workspace-grid, .profit-layout { grid-template-columns: 1fr; }
  .tool-grid { grid-template-columns: 1fr; }
  .open-banner { align-items: flex-start; flex-direction: column; }
  .main-content { padding: 0 16px; }
  .breadcrumb { display: none; }
}

@media (max-width: 460px) {
  .sidebar { display: none; }
  .main-content { padding: 0 12px; }
  .hero h1 { font-size: 39px; }
  .hero-copy { padding: 25px 18px 10px; }
  .page-intro h1 { font-size: 33px; }
  .panel { padding: 16px; }
  .two-fields { gap: 8px; }
  .invoice-paper { padding: 14px; }
  .footer { flex-direction: column; }
  .result-pair .result-card > strong { font-size: 20px; }
}

@media print {
  body { background: white; }
  .sidebar, .topbar, .page-intro, .footer, .toast,
  .invoice-grid > .form-panel,
  .invoice-preview-wrap > .output-head {
    display: none !important;
  }
  .main-content { padding: 0; }
  .view { display: none !important; }
  #invoiceView { display: block !important; padding: 0; }
  .workspace-grid { display: block; }
  .invoice-preview-wrap { border: 0; padding: 0; }
  .invoice-paper { border: 0; box-shadow: none; }
}