:root {
  --ink: #18231f;
  --muted: #66736d;
  --line: #e2e9e5;
  --surface: #ffffff;
  --canvas: #f4f7f5;
  --green-950: #0a2e25;
  --green-900: #0d3b2f;
  --green-700: #167a5c;
  --green-600: #1c9470;
  --green-500: #26aa80;
  --green-100: #dff3eb;
  --green-50: #edf8f4;
  --red-600: #d95858;
  --red-100: #fbe9e8;
  --amber-500: #d89b36;
  --shadow: 0 24px 70px rgba(18, 54, 43, 0.12);
  --small-shadow: 0 10px 30px rgba(18, 54, 43, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--canvas);
  color: var(--ink);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

button,
input,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button {
  border: 0;
}

.hidden {
  display: none !important;
}

.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  z-index: 30;
  inset: 0 auto 0 0;
  display: flex;
  width: 248px;
  flex-direction: column;
  padding: 28px 20px 22px;
  background: var(--green-950);
  color: #fff;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.08);
}

.brand-mark svg {
  width: 27px;
  fill: none;
  stroke: #70d2ad;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 23px;
  letter-spacing: -0.02em;
}

.brand small {
  margin-top: -1px;
  color: #8bb7a7;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.sidebar-nav {
  display: grid;
  gap: 8px;
  margin-top: 46px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  padding: 12px 14px;
  border-radius: 11px;
  background: transparent;
  color: #a9c2b9;
  text-align: left;
  transition: 160ms ease;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
}

.nav-item.active {
  box-shadow: inset 3px 0 #55c99e;
}

.nav-icon {
  display: inline-grid;
  flex: 0 0 auto;
  width: 19px;
  height: 19px;
  place-items: center;
}

.nav-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.sidebar-bottom {
  display: grid;
  gap: 16px;
  margin-top: auto;
}

.privacy-note {
  display: flex;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.045);
  color: #79c5aa;
}

.privacy-note strong,
.privacy-note span {
  display: block;
}

.privacy-note strong {
  color: #dcebe5;
  font-size: 12px;
}

.privacy-note span {
  margin-top: 4px;
  color: #8faea2;
  font-size: 10px;
  line-height: 1.45;
}

.help-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  color: #8faea2;
  font-size: 13px;
  text-decoration: none;
}

.main-content {
  min-height: 100vh;
  margin-left: 248px;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  min-height: 74px;
  align-items: center;
  gap: 16px;
  padding: 14px clamp(22px, 4vw, 58px);
  border-bottom: 1px solid rgba(226, 233, 229, 0.8);
  background: rgba(255, 255, 255, 0.89);
  backdrop-filter: blur(18px);
}

.topbar-title {
  min-width: 0;
  margin-right: auto;
}

.topbar-title p {
  margin: 0;
  font-weight: 700;
}

.topbar-title span {
  display: block;
  overflow: hidden;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.menu-button {
  display: none !important;
}

.icon-button {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  color: var(--ink);
}

.primary-button,
.secondary-button,
.text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-radius: 11px;
  font-weight: 700;
  transition: 160ms ease;
}

.primary-button {
  padding: 12px 18px;
  background: var(--green-700);
  box-shadow: 0 9px 20px rgba(22, 122, 92, 0.22);
  color: #fff;
}

.primary-button:hover {
  background: var(--green-900);
  transform: translateY(-1px);
}

.primary-button.large {
  min-height: 52px;
  padding: 14px 22px;
}

.primary-button.compact {
  padding: 10px 15px;
}

.secondary-button {
  min-height: 42px;
  padding: 10px 15px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.secondary-button:hover {
  border-color: #b8cbc3;
  background: var(--green-50);
}

.text-button {
  padding: 10px 6px;
  background: transparent;
  color: var(--green-700);
}

.empty-state {
  display: grid;
  min-height: calc(100vh - 74px);
  grid-template-columns: minmax(340px, 0.92fr) minmax(420px, 1.08fr);
  align-items: center;
  gap: clamp(32px, 5vw, 80px);
  overflow: hidden;
  padding: 60px clamp(32px, 6vw, 90px);
  background:
    radial-gradient(circle at 78% 47%, rgba(76, 184, 143, 0.13), transparent 26%),
    linear-gradient(140deg, #f9fbfa 0%, #f2f7f4 62%, #ebf5f0 100%);
}

.eyebrow {
  display: block;
  color: var(--green-700);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.welcome-copy {
  position: relative;
  z-index: 2;
  max-width: 590px;
}

.welcome-copy h1 {
  margin: 18px 0 22px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(54px, 6.4vw, 90px);
  font-weight: 400;
  letter-spacing: -0.055em;
  line-height: 0.91;
}

.welcome-copy h1 span {
  color: var(--green-700);
  font-style: italic;
}

.welcome-copy > p {
  max-width: 540px;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.welcome-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 31px;
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 28px;
  color: #74817c;
  font-size: 11px;
}

.trust-row span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.trust-row .nav-icon {
  width: 14px;
  height: 14px;
  color: var(--green-600);
}

.sample-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 20px;
  color: var(--green-700);
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
}

.sample-link .nav-icon {
  width: 14px;
  height: 14px;
}

.use-cases {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 20px;
}

.use-cases span {
  padding: 6px 10px;
  border: 1px solid #d8e7e1;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  color: #597169;
  font-size: 9px;
  font-weight: 700;
}

.upload-visual {
  position: relative;
  min-height: 560px;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(3px);
}

.orb-one {
  top: 40px;
  right: 8%;
  width: 300px;
  height: 300px;
  border: 1px solid rgba(23, 122, 92, 0.12);
}

.orb-two {
  right: 18%;
  bottom: 25px;
  width: 210px;
  height: 210px;
  background: rgba(41, 171, 128, 0.06);
}

.drop-zone {
  position: absolute;
  z-index: 3;
  top: 50%;
  left: 50%;
  display: flex;
  width: min(430px, 84%);
  min-height: 310px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 30px;
  border: 1px dashed #88b7a5;
  border-radius: 25px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
  color: var(--ink);
  transform: translate(-50%, -50%) rotate(-1deg);
  backdrop-filter: blur(14px);
}

.drop-zone:hover,
.drop-zone.dragging {
  border-color: var(--green-600);
  background: #fff;
  transform: translate(-50%, -50%) rotate(0deg) scale(1.015);
}

.upload-icon {
  display: grid;
  width: 66px;
  height: 66px;
  margin-bottom: 22px;
  place-items: center;
  border-radius: 18px;
  background: var(--green-100);
  color: var(--green-700);
}

.upload-icon .nav-icon {
  width: 30px;
  height: 30px;
}

.drop-zone strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 23px;
}

.drop-zone > span:not(.upload-icon) {
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
}

.drop-zone small {
  margin-top: 28px;
  padding: 7px 11px;
  border-radius: 999px;
  background: #f1f5f3;
  color: #85918c;
  font-size: 10px;
}

.floating-card {
  position: absolute;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 230px;
  padding: 13px 15px;
  border: 1px solid rgba(221, 231, 226, 0.9);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--small-shadow);
}

.floating-card small,
.floating-card strong {
  display: block;
}

.floating-card small {
  color: var(--muted);
  font-size: 9px;
}

.floating-card strong {
  margin-top: 3px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 16px;
}

.floating-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 11px;
}

.floating-icon .nav-icon {
  width: 18px;
  height: 18px;
}

.floating-icon.income {
  background: var(--green-100);
  color: var(--green-700);
}

.floating-icon.balance {
  background: #edf0f7;
  color: #4c5d85;
}

.card-income {
  top: 80px;
  right: 0;
  transform: rotate(2deg);
}

.positive-pill {
  margin-left: auto;
  padding: 5px 7px;
  border-radius: 999px;
  background: var(--green-50);
  color: var(--green-700);
  font-size: 9px;
  font-weight: 800;
}

.card-balance {
  bottom: 60px;
  left: 1%;
  transform: rotate(-2deg);
}

.mini-line {
  width: 70px;
  margin-left: auto;
  fill: none;
  stroke: var(--green-600);
  stroke-width: 2;
}

.dashboard {
  padding: 38px clamp(22px, 4vw, 58px) 70px;
}

.dashboard-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 25px;
}

.dashboard-heading h1 {
  margin: 8px 0 5px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 39px;
  font-weight: 400;
  letter-spacing: -0.035em;
}

.dashboard-heading p,
.panel-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.heading-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.profile-badge {
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--green-100);
  color: var(--green-700);
  font-size: 9px;
  font-weight: 800;
}

.filter-group {
  display: flex;
  gap: 10px;
}

.filter-group label,
.sheet-selector {
  display: grid;
  gap: 5px;
}

.filter-group label > span,
.sheet-selector label {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

select {
  min-height: 40px;
  padding: 0 34px 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: 0;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
}

select:focus,
input:focus {
  border-color: var(--green-500);
  box-shadow: 0 0 0 3px rgba(38, 170, 128, 0.11);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.kpi-card {
  position: relative;
  overflow: hidden;
  min-height: 155px;
  padding: 21px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(29, 66, 54, 0.04);
}

.kpi-card.featured {
  border-color: #c8e2d8;
  background: linear-gradient(145deg, #effaf6, #fff);
}

.kpi-card.featured::after {
  position: absolute;
  right: -22px;
  bottom: -60px;
  width: 130px;
  height: 130px;
  border: 24px solid rgba(39, 161, 119, 0.06);
  border-radius: 50%;
  content: "";
}

.kpi-top {
  display: flex;
  align-items: center;
  gap: 9px;
}

.kpi-icon {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border-radius: 9px;
}

.kpi-icon .nav-icon {
  width: 16px;
  height: 16px;
}

.kpi-icon.revenue,
.secondary-icon.receivable {
  background: var(--green-100);
  color: var(--green-700);
}

.kpi-icon.expense,
.secondary-icon.payable {
  background: var(--red-100);
  color: var(--red-600);
}

.kpi-icon.balance,
.secondary-icon.ticket {
  background: #e9eef8;
  color: #53698e;
}

.kpi-icon.margin,
.secondary-icon.entries {
  background: #faf0dc;
  color: var(--amber-500);
}

.kpi-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.kpi-card > strong {
  position: relative;
  z-index: 1;
  display: block;
  overflow: hidden;
  margin-top: 18px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(25px, 2.25vw, 34px);
  font-weight: 400;
  letter-spacing: -0.035em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kpi-foot {
  display: block;
  margin-top: 9px;
  color: #86908c;
  font-size: 10px;
}

.insight-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 15px 0;
  padding: 13px 16px;
  border: 1px solid #d7ebe3;
  border-radius: 13px;
  background: linear-gradient(90deg, var(--green-50), #f9fcfb);
}

.insight-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 9px;
  background: #fff;
  color: var(--green-700);
  box-shadow: 0 4px 12px rgba(22, 122, 92, 0.1);
}

.insight-strip p {
  margin: 0;
  color: #3f5b50;
  font-size: 12px;
  line-height: 1.5;
}

.chart-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(330px, 0.75fr);
  gap: 15px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 17px;
  background: #fff;
  box-shadow: 0 7px 24px rgba(29, 66, 54, 0.04);
}

.cashflow-panel,
.category-panel {
  min-height: 370px;
  padding: 22px;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
}

.panel-heading h2 {
  margin: 0 0 5px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  font-weight: 400;
}

.legend {
  display: flex;
  gap: 13px;
  color: var(--muted);
  font-size: 9px;
}

.legend span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.legend-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.legend-dot.revenue {
  background: var(--green-600);
}

.legend-dot.expense {
  background: #e58a84;
}

.bar-chart {
  position: relative;
  display: flex;
  height: 270px;
  align-items: stretch;
  gap: 12px;
  margin-top: 20px;
  padding: 20px 4px 28px 46px;
  background: repeating-linear-gradient(to bottom, transparent 0, transparent 53px, #edf1ef 54px);
}

.bar-chart::after {
  position: absolute;
  right: 0;
  bottom: 27px;
  left: 43px;
  height: 1px;
  background: var(--line);
  content: "";
}

.axis-labels {
  position: absolute;
  inset: 11px auto 29px 0;
  display: flex;
  width: 40px;
  justify-content: space-between;
  flex-direction: column;
  color: #9aa49f;
  font-size: 8px;
  text-align: right;
}

.month-group {
  position: relative;
  z-index: 2;
  display: flex;
  min-width: 28px;
  flex: 1;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
}

.month-group > span {
  position: absolute;
  bottom: -21px;
  left: 50%;
  color: #7e8984;
  font-size: 8px;
  transform: translateX(-50%);
  white-space: nowrap;
}

.chart-bar {
  width: min(16px, 35%);
  min-height: 2px;
  border-radius: 5px 5px 2px 2px;
  transition: 200ms ease;
}

.chart-bar:hover {
  filter: brightness(0.9);
  transform: translateY(-2px);
}

.chart-bar.revenue {
  background: linear-gradient(to top, var(--green-700), #4fc49a);
}

.chart-bar.expense {
  background: linear-gradient(to top, #cf6c68, #efa39d);
}

.category-chart-layout {
  display: grid;
  grid-template-columns: 150px 1fr;
  align-items: center;
  gap: 24px;
  margin-top: 42px;
}

.donut-chart {
  position: relative;
  display: grid;
  width: 150px;
  height: 150px;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(#dfe8e4 0 100%);
}

.donut-chart::before {
  position: absolute;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: #fff;
  content: "";
}

.donut-center {
  position: relative;
  z-index: 1;
  max-width: 82px;
  text-align: center;
}

.donut-center small,
.donut-center strong {
  display: block;
}

.donut-center small {
  color: var(--muted);
  font-size: 9px;
}

.donut-center strong {
  overflow: hidden;
  margin-top: 3px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  text-overflow: ellipsis;
}

.category-list {
  display: grid;
  gap: 13px;
}

.category-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 8px;
  font-size: 10px;
}

.category-item-name {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
  color: #52605a;
}

.category-item-name span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-color {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
}

.category-value {
  color: var(--ink);
  font-weight: 700;
}

.category-track {
  grid-column: 1 / -1;
  height: 3px;
  overflow: hidden;
  border-radius: 99px;
  background: #edf1ef;
}

.category-track i {
  display: block;
  height: 100%;
  border-radius: 99px;
}

.secondary-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 15px 0;
}

.secondary-kpis article {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.secondary-icon {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 11px;
}

.secondary-icon .nav-icon {
  width: 17px;
  height: 17px;
}

.secondary-kpis small,
.secondary-kpis strong {
  display: block;
}

.secondary-kpis small {
  color: var(--muted);
  font-size: 9px;
}

.secondary-kpis strong {
  overflow: hidden;
  margin-top: 4px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.transactions-panel {
  overflow: hidden;
}

.table-heading {
  align-items: center;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}

.table-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-box {
  display: flex;
  min-width: 220px;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: #89938f;
}

.search-box input {
  min-width: 0;
  height: 40px;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 11px;
}

.search-box .nav-icon {
  width: 15px;
  height: 15px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 13px 22px;
  border-bottom: 1px solid #edf1ef;
  font-size: 11px;
  text-align: left;
  white-space: nowrap;
}

th {
  background: #fafcfb;
  color: #84908b;
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

td {
  color: #4c5a54;
}

tbody tr:hover {
  background: #fafcfb;
}

.number-cell {
  text-align: right;
}

.value-positive {
  color: var(--green-700);
  font-weight: 800;
}

.value-negative {
  color: var(--red-600);
  font-weight: 800;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
}

.status-pill::before {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  content: "";
}

.status-pill.paid {
  background: var(--green-50);
  color: var(--green-700);
}

.status-pill.paid::before {
  background: var(--green-500);
}

.status-pill.pending {
  background: #fff4df;
  color: #9a6c1e;
}

.status-pill.pending::before {
  background: #d8a13f;
}

.table-empty {
  padding: 42px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.how-it-works {
  padding: 62px 0 0;
  text-align: center;
}

.how-it-works h2 {
  margin: 10px 0 25px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 30px;
  font-weight: 400;
}

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

.steps article {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
}

.steps article > span {
  display: grid;
  width: 31px;
  height: 31px;
  margin: 0 auto 14px;
  place-items: center;
  border-radius: 50%;
  background: var(--green-100);
  color: var(--green-700);
  font-size: 11px;
  font-weight: 800;
}

.steps strong {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
}

.steps p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.modal-backdrop {
  position: fixed;
  z-index: 80;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(6, 24, 19, 0.64);
  backdrop-filter: blur(7px);
}

.modal {
  width: min(720px, 100%);
  max-height: min(820px, 92vh);
  overflow-y: auto;
  padding: 26px;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 28px 90px rgba(5, 28, 20, 0.28);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.modal-header h2 {
  margin: 8px 0 6px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px;
  font-weight: 400;
}

.modal-header p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.sheet-selector {
  margin: 24px 0 15px;
}

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

.mapping-grid label {
  display: grid;
  gap: 6px;
  color: #51615a;
  font-size: 10px;
  font-weight: 700;
}

.mapping-grid select,
.sheet-selector select {
  width: 100%;
}

.data-profile-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.data-profile-summary span {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fafcfb;
  color: var(--muted);
  font-size: 9px;
}

.data-profile-summary strong {
  color: var(--ink);
}

.mapping-tip {
  display: flex;
  gap: 9px;
  margin-top: 17px;
  padding: 12px;
  border-radius: 10px;
  background: #f1f7f4;
  color: #577068;
  font-size: 10px;
  line-height: 1.5;
}

.mapping-tip .nav-icon {
  color: var(--green-700);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

.demo-modal {
  width: min(650px, 100%);
}

.demo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 24px;
}

.demo-grid button {
  display: grid;
  gap: 6px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  transition: 160ms ease;
}

.demo-grid button:hover {
  border-color: #a9cec0;
  background: var(--green-50);
  transform: translateY(-2px);
}

.demo-grid span {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
}

.demo-grid small {
  color: var(--muted);
  font-size: 10px;
}

.toast {
  position: fixed;
  z-index: 100;
  right: 24px;
  bottom: 24px;
  display: flex;
  min-width: 290px;
  align-items: center;
  gap: 11px;
  padding: 14px;
  border: 1px solid #cee5dc;
  border-radius: 13px;
  background: #fff;
  box-shadow: var(--shadow);
}

.toast-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  background: var(--green-100);
  color: var(--green-700);
}

.toast strong,
.toast span {
  display: block;
}

.toast strong {
  font-size: 11px;
}

.toast div > span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

@media (max-width: 1100px) {
  .empty-state {
    grid-template-columns: 1fr;
    padding-top: 75px;
    text-align: center;
  }

  .welcome-copy {
    margin: 0 auto;
  }

  .welcome-copy > p {
    margin: 0 auto;
  }

  .welcome-actions,
  .trust-row {
    justify-content: center;
  }

  .use-cases {
    justify-content: center;
  }

  .upload-visual {
    min-height: 500px;
  }

  .kpi-grid,
  .secondary-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .chart-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 800px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 180ms ease;
  }

  .sidebar.open {
    box-shadow: 20px 0 60px rgba(0, 0, 0, 0.2);
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .menu-button {
    display: grid !important;
  }

  .topbar {
    padding: 12px 18px;
  }

  .empty-state {
    min-height: auto;
    padding: 55px 22px 70px;
  }

  .welcome-copy h1 {
    font-size: clamp(52px, 16vw, 74px);
  }

  .dashboard {
    padding: 30px 17px 60px;
  }

  .dashboard-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .filter-group {
    width: 100%;
  }

  .filter-group label {
    flex: 1;
  }

  .filter-group select {
    width: 100%;
  }

  .table-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .table-tools {
    width: 100%;
  }

  .search-box {
    min-width: 0;
    flex: 1;
  }
}

@media (max-width: 560px) {
  .button-label,
  .topbar .secondary-button {
    display: none;
  }

  .topbar-title p {
    font-size: 13px;
  }

  .welcome-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .trust-row {
    gap: 11px;
  }

  .upload-visual {
    min-height: 430px;
  }

  .drop-zone {
    min-height: 280px;
  }

  .card-income {
    top: 20px;
    right: -16px;
  }

  .card-balance {
    bottom: 15px;
    left: -18px;
  }

  .floating-card {
    min-width: 205px;
  }

  .kpi-grid,
  .secondary-kpis,
  .steps {
    grid-template-columns: 1fr;
  }

  .filter-group {
    flex-direction: column;
  }

  .category-chart-layout {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .category-list {
    width: 100%;
  }

  .mapping-grid {
    grid-template-columns: 1fr;
  }

  .demo-grid {
    grid-template-columns: 1fr;
  }

  .table-tools {
    align-items: stretch;
    flex-direction: column;
  }

  .toast {
    right: 14px;
    bottom: 14px;
    left: 14px;
    min-width: 0;
  }
}

/* SaaS account layer */
body.auth-loading .app-shell,
body:not(.authenticated) .app-shell {
  display: none;
}

.saas-auth-screen {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(360px, 0.9fr) minmax(480px, 1.1fr);
  background: #fff;
}

.auth-brand-panel {
  position: relative;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  overflow: hidden;
  padding: 42px clamp(38px, 6vw, 92px);
  background:
    radial-gradient(circle at 95% 15%, rgba(83, 203, 157, 0.2), transparent 33%),
    radial-gradient(circle at 5% 95%, rgba(47, 151, 116, 0.18), transparent 34%),
    var(--green-950);
  color: #fff;
}

.auth-brand-panel::after {
  position: absolute;
  right: -140px;
  bottom: 10%;
  width: 370px;
  height: 370px;
  border: 1px solid rgba(122, 213, 179, 0.15);
  border-radius: 50%;
  box-shadow:
    0 0 0 70px rgba(122, 213, 179, 0.04),
    0 0 0 140px rgba(122, 213, 179, 0.025);
  content: "";
}

.auth-brand {
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 13px;
  color: #fff;
  text-decoration: none;
}

.auth-brand .brand-mark {
  width: 48px;
  height: 48px;
}

.auth-brand .brand-mark svg {
  width: 30px;
  fill: none;
  stroke: #70d2ad;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.auth-brand strong,
.auth-brand small {
  display: block;
}

.auth-brand strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 26px;
}

.auth-brand small {
  margin-top: -2px;
  color: #8bb7a7;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.auth-promise {
  z-index: 1;
  max-width: 540px;
  margin: auto 0;
}

.auth-promise .eyebrow {
  color: #68cda7;
}

.auth-promise h1 {
  margin: 20px 0 22px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(46px, 5vw, 72px);
  font-weight: 400;
  letter-spacing: -0.055em;
  line-height: 0.98;
}

.auth-promise > p {
  max-width: 500px;
  margin: 0;
  color: #aec8be;
  font-size: 16px;
  line-height: 1.7;
}

.auth-benefits {
  display: grid;
  gap: 13px;
  margin-top: 34px;
  color: #d7e8e1;
  font-size: 13px;
}

.auth-benefits span::first-letter {
  color: #67cda6;
}

.auth-copyright {
  z-index: 1;
  color: #78998d;
  font-size: 11px;
}

.auth-form-panel {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 48px 24px;
  background:
    linear-gradient(rgba(238, 247, 243, 0.5) 1px, transparent 1px),
    linear-gradient(90deg, rgba(238, 247, 243, 0.5) 1px, transparent 1px),
    #fff;
  background-size: 36px 36px;
}

.auth-card {
  width: min(100%, 440px);
  padding: 40px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 28px 80px rgba(13, 59, 47, 0.12);
}

.auth-card h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 36px;
  font-weight: 400;
  letter-spacing: -0.035em;
}

.auth-card > p {
  margin: 9px 0 28px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.auth-mobile-brand {
  display: none;
  margin-bottom: 24px;
  color: var(--green-700);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.17em;
}

.saas-form {
  display: grid;
  gap: 17px;
}

.saas-form label {
  display: grid;
  gap: 7px;
  color: #394840;
  font-size: 11px;
  font-weight: 700;
}

.saas-form input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid #d7e2dd;
  border-radius: 11px;
  outline: none;
  background: #fbfdfc;
  color: var(--ink);
  font-size: 13px;
  font-weight: 400;
  transition: 160ms ease;
}

.saas-form input:focus {
  border-color: var(--green-600);
  box-shadow: 0 0 0 4px rgba(28, 148, 112, 0.1);
}

.saas-form input:disabled {
  color: #87938e;
  cursor: not-allowed;
}

.auth-submit {
  width: 100%;
  min-height: 49px;
  margin-top: 3px;
}

.auth-submit:disabled,
.plan-action:disabled {
  cursor: wait;
  opacity: 0.65;
}

.auth-link,
.auth-switch button {
  padding: 0;
  background: transparent;
  color: var(--green-700);
  font-size: 11px;
  font-weight: 700;
}

.auth-link.align-right {
  margin-top: -8px;
  justify-self: end;
}

.auth-card .auth-switch {
  margin: 25px 0 0;
  text-align: center;
}

.form-result {
  margin-top: 18px;
  padding: 13px 14px;
  border-radius: 10px;
  background: var(--green-50);
  color: var(--green-700);
  font-size: 12px;
  line-height: 1.5;
}

.form-result.error {
  background: var(--red-100);
  color: var(--red-600);
}

.form-result button {
  display: block;
  margin-top: 9px;
  padding: 0;
  background: transparent;
  color: inherit;
  font-weight: 800;
  text-decoration: underline;
}

.user-menu-button {
  display: flex;
  min-width: 148px;
  align-items: center;
  gap: 9px;
  padding: 6px 9px 6px 7px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.user-avatar {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 10px;
  background: var(--green-100);
  color: var(--green-700);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.user-avatar.large {
  width: 58px;
  height: 58px;
  border-radius: 17px;
  font-size: 16px;
}

.user-menu-copy {
  min-width: 0;
  flex: 1;
}

.user-menu-copy strong,
.user-menu-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-menu-copy strong {
  font-size: 11px;
}

.user-menu-copy small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.user-chevron {
  color: #87938e;
}

.save-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green-500);
}

.nav-separator {
  height: 1px;
  margin: 10px 12px;
  background: rgba(255, 255, 255, 0.09);
}

.usage-card {
  padding: 13px 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.055);
}

.usage-card > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.usage-card span,
.usage-card strong {
  color: #dcebe5;
  font-size: 10px;
}

.usage-card strong {
  color: #7bd2b1;
}

.usage-track {
  height: 4px;
  overflow: hidden;
  margin: 9px 0;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.13);
}

.usage-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #62c99f;
}

.usage-card small {
  color: #87a69a;
  font-size: 8px;
  line-height: 1.4;
}

.workspace-modal {
  width: min(1100px, calc(100vw - 36px));
  max-height: min(86vh, 850px);
}

#closeWorkspaceModal {
  font-size: 23px;
  line-height: 1;
}

.workspace-loading,
.workspace-empty {
  padding: 60px 20px;
  color: var(--muted);
  text-align: center;
}

.workspace-empty strong {
  display: block;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 25px;
  font-weight: 400;
}

.workspace-empty p {
  font-size: 12px;
}

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

.analysis-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfdfc;
}

.analysis-file-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 12px;
  background: var(--green-100);
  color: var(--green-700);
  font-size: 10px;
  font-weight: 900;
}

.analysis-main {
  min-width: 0;
  flex: 1;
}

.analysis-main strong,
.analysis-main span,
.analysis-main small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analysis-main strong {
  font-size: 13px;
}

.analysis-main span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.analysis-main small {
  margin-top: 5px;
  color: #929d98;
  font-size: 9px;
}

.analysis-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.small-action {
  min-height: 36px;
  padding: 9px 12px;
  font-size: 10px;
  text-decoration: none;
}

.danger-text {
  padding: 8px;
  background: transparent;
  color: var(--red-600);
  font-size: 10px;
  font-weight: 700;
}

.current-plan-banner {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  overflow: hidden;
  margin-bottom: 22px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--line);
}

.current-plan-banner > div {
  padding: 14px 16px;
  background: #fbfdfc;
}

.current-plan-banner span,
.current-plan-banner strong {
  display: block;
}

.current-plan-banner span {
  color: var(--muted);
  font-size: 9px;
}

.current-plan-banner strong {
  margin-top: 4px;
  font-size: 12px;
}

.plan-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.plan-card {
  position: relative;
  padding: 23px 20px 20px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: #fff;
}

.plan-card.recommended {
  border-color: var(--green-600);
  box-shadow: 0 14px 35px rgba(22, 122, 92, 0.12);
}

.plan-card.current {
  background: var(--green-50);
}

.plan-ribbon {
  position: absolute;
  top: -9px;
  right: 15px;
  padding: 5px 8px;
  border-radius: 99px;
  background: var(--green-700);
  color: #fff;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.plan-card h3 {
  margin: 0;
  font-size: 14px;
}

.plan-price {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin: 15px 0 17px;
}

.plan-price strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 31px;
  font-weight: 400;
}

.plan-price span {
  color: var(--muted);
  font-size: 9px;
}

.plan-card ul {
  display: grid;
  gap: 10px;
  min-height: 120px;
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
}

.plan-card li {
  color: #52615a;
  font-size: 10px;
}

.plan-card li::before {
  margin-right: 7px;
  color: var(--green-600);
  content: "✓";
}

.plan-action {
  width: 100%;
}

.plan-action:disabled {
  cursor: default;
}

.billing-note {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
  text-align: center;
}

.account-layout {
  display: grid;
  grid-template-columns: 1.4fr 0.6fr;
  gap: 28px;
}

.account-form {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.account-summary {
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  padding: 25px;
  border-radius: 16px;
  background: var(--green-50);
  text-align: center;
}

.account-summary > strong {
  margin-top: 12px;
  font-size: 13px;
}

.account-summary > p {
  margin: 5px 0 15px;
  color: var(--muted);
  font-size: 10px;
}

.account-plan {
  padding: 6px 9px;
  border-radius: 99px;
  background: var(--green-100);
  color: var(--green-700);
  font-size: 9px;
  font-weight: 800;
}

.danger-outline {
  margin-top: 24px;
  padding: 9px 13px;
  border: 1px solid #efc4c2;
  border-radius: 9px;
  background: transparent;
  color: var(--red-600);
  font-size: 10px;
  font-weight: 700;
}

.team-section {
  margin-top: 22px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.team-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.team-heading h3,
.team-heading p {
  margin: 0;
}

.team-heading h3 {
  font-size: 14px;
}

.team-heading p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
}

.team-list {
  display: grid;
  gap: 8px;
}

.team-member {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f8fbf9;
}

.team-member > div {
  min-width: 0;
  flex: 1;
}

.team-member strong,
.team-member span {
  display: block;
}

.team-member strong {
  font-size: 11px;
}

.team-member div span,
.team-member small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.invite-form {
  display: grid;
  grid-template-columns: 1fr 1.3fr auto;
  gap: 10px;
  align-items: end;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}

.invite-form label {
  display: grid;
  gap: 6px;
  color: #394840;
  font-size: 9px;
  font-weight: 700;
}

.invite-form input {
  height: 40px;
  padding: 0 11px;
  border: 1px solid #d7e2dd;
  border-radius: 9px;
  outline: none;
  background: #fbfdfc;
  font-size: 10px;
}

.dev-invite-link {
  display: block;
  margin-top: 8px;
  color: inherit;
  font-weight: 800;
}

@media (max-width: 960px) {
  .saas-auth-screen {
    grid-template-columns: minmax(320px, 0.75fr) minmax(430px, 1fr);
  }

  .auth-brand-panel {
    padding: 38px;
  }

  .auth-promise h1 {
    font-size: 48px;
  }

  .plan-grid {
    grid-template-columns: 1fr;
  }

  .plan-card ul {
    min-height: 0;
  }
}

@media (max-width: 720px) {
  .saas-auth-screen {
    display: block;
  }

  .auth-brand-panel {
    display: none;
  }

  .auth-form-panel {
    min-height: 100vh;
    padding: 24px 15px;
  }

  .auth-card {
    padding: 29px 23px;
  }

  .auth-mobile-brand {
    display: block;
  }

  .user-menu-button {
    min-width: 0;
  }

  .user-menu-copy,
  .user-chevron {
    display: none;
  }

  .analysis-row {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .analysis-main {
    width: calc(100% - 60px);
  }

  .analysis-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .current-plan-banner,
  .account-layout {
    grid-template-columns: 1fr;
  }

  .invite-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  #saveAnalysisButton {
    display: none;
  }

  .workspace-modal {
    width: calc(100vw - 20px);
    padding: 22px 16px;
  }
}
