:root {
  color-scheme: light;
  --ink: #202124;
  --muted: #667085;
  --line: #d7dce3;
  --panel: #ffffff;
  --soft: #f5f7fa;
  --brand: #0c6b5f;
  --brand-dark: #06483f;
  --brand-warm: #ffb15c;
  --brand-coral: #e85d45;
  --green: #067647;
  --red: #b42318;
  --shadow: 0 16px 50px rgba(32, 33, 36, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #eef2f6;
  color: var(--ink);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: progress;
  opacity: 0.65;
}

.hidden {
  display: none !important;
}

.landing {
  min-height: 100vh;
  background: #f4f7f7;
  color: var(--ink);
  overflow-x: hidden;
  scroll-behavior: smooth;
}

/* ---- Nav ---- */
.landing-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(20px, 5vw, 72px);
  background: rgba(6, 40, 35, 0.86);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.landing-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
  font-size: 18px;
}

.landing-brand strong {
  font-size: 20px;
  letter-spacing: 0;
}

.landing-nav-links {
  display: flex;
  gap: 26px;
  margin-left: auto;
}

.landing-nav-links a {
  color: rgba(255, 255, 255, 0.78);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}

.landing-nav-links a:hover {
  color: #fff;
}

.landing-nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.landing-nav-actions .nav-link {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  padding: 8px 12px;
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  padding: 9px 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brand-warm), var(--brand-coral));
  color: #2a1206;
  text-decoration: none;
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(232, 93, 69, 0.28);
}

.nav-cta:hover {
  filter: brightness(1.04);
}

/* ---- Hero ---- */
.landing-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 420px);
  align-items: center;
  gap: clamp(32px, 6vw, 80px);
  padding: clamp(48px, 8vw, 96px) clamp(20px, 5vw, 72px) clamp(60px, 9vw, 110px);
  background:
    radial-gradient(1200px 600px at 78% -10%, rgba(255, 177, 92, 0.26), transparent 60%),
    radial-gradient(900px 500px at 8% 110%, rgba(232, 93, 69, 0.14), transparent 60%),
    linear-gradient(155deg, #0d5a4e 0%, #084438 46%, #05302b 100%);
  color: #fff;
}

.hero-copy {
  max-width: 720px;
}

.login-panel-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-mark,
.app-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background:
    linear-gradient(135deg, var(--brand-warm), var(--brand-coral) 48%, #0f766e 49%, var(--brand) 100%);
  color: #fff;
  font-weight: 900;
  box-shadow: 0 12px 28px rgba(4, 48, 43, 0.22);
}

.logo-mark.small {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  box-shadow: none;
}

.hero-copy h1 {
  margin: 0;
  max-width: 640px;
  font-size: clamp(38px, 5.4vw, 62px);
  line-height: 1.02;
  letter-spacing: -0.01em;
  font-weight: 800;
}

.lead {
  max-width: 560px;
  margin: 20px 0 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: clamp(16px, 1.6vw, 19px);
  line-height: 1.55;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--brand-warm);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 28px 0 0;
}

.hero-points span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.88);
  background: rgba(255, 255, 255, 0.08);
  font-size: 13px;
  font-weight: 700;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(20px, 4vw, 44px);
  margin: 34px 0 0;
  padding-top: 26px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.hero-stats div {
  display: grid;
  gap: 2px;
}

.hero-stats strong {
  font-size: clamp(24px, 3vw, 30px);
  font-weight: 800;
  color: #fff;
}

.hero-stats span {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
}

/* ---- Hero CTA-d ---- */
.hero-cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin: 26px 0 0;
}

.primary-button.hero-cta {
  background: linear-gradient(135deg, var(--brand-warm), var(--brand-coral));
  color: #2a1206;
  border: none;
  font-weight: 800;
  font-size: 16px;
  padding: 14px 26px;
  border-radius: 999px;
  text-decoration: none;
  box-shadow: 0 14px 34px rgba(232, 93, 69, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.primary-button.hero-cta:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, var(--brand-warm), var(--brand-coral));
  box-shadow: 0 18px 40px rgba(232, 93, 69, 0.42);
  filter: brightness(1.03);
}

.hero-cta-ghost {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.35);
  padding-bottom: 2px;
}

.hero-cta-ghost:hover {
  border-bottom-color: #fff;
}

/* ---- Kuude sidumise mock ---- */
.mock-month-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin: 12px 0;
}

.mock-month-grid .m {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 4px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  background: #f8fafc;
}

.mock-month-grid .m.done {
  background: #dcfce7;
  border-color: #86efac;
  color: #166534;
}

.mock-month-grid .m.pend {
  background: #fef3c7;
  border-color: #fcd34d;
  color: #92400e;
}

.mock-tx {
  display: grid;
  gap: 6px;
}

.mock-tx-row {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
}

.mock-tx-row span {
  flex: 1;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mock-tx-row strong {
  font-size: 12px;
}

.mock-tx-row strong.pos {
  color: var(--green);
}

.mock-tx-row .chip {
  font-style: normal;
  font-size: 10px;
  font-weight: 700;
  background: #dcfce7;
  color: #166534;
  border-radius: 999px;
  padding: 2px 8px;
  white-space: nowrap;
}

.mock-tx-row .chip.warn {
  background: #fef3c7;
  color: #92400e;
}

/* ---- Hinnasektsioon ---- */
.land-pricing {
  background:
    radial-gradient(800px 400px at 50% 0%, rgba(12, 107, 95, 0.08), transparent 70%);
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  max-width: 860px;
  margin: 0 auto;
  align-items: stretch;
}

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

.pricing-name {
  margin: 12px 0 0;
  font-size: 19px;
  font-weight: 800;
}

.pricing-card.featured {
  border-color: var(--brand);
  box-shadow: 0 28px 80px rgba(12, 107, 95, 0.22);
}

.pricing-badge.premium {
  background: #fef3c7;
  color: #92400e;
  border-color: #fcd34d;
}

.pricing-oneoff {
  max-width: 860px;
  margin: 22px auto 0;
  text-align: center;
  font-size: 15px;
  color: var(--ink);
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: 12px;
  padding: 14px 18px;
}

.land-pricing .pricing-fine {
  text-align: center;
  margin-top: 12px;
}

.pricing-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: clamp(28px, 4vw, 40px);
  box-shadow: 0 24px 70px rgba(32, 33, 36, 0.12);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.pricing-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 5px;
  background: linear-gradient(90deg, var(--brand), var(--brand-warm), var(--brand-coral));
}

.pricing-badge {
  display: inline-block;
  background: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
  border-radius: 999px;
  padding: 5px 16px;
  font-size: 13px;
  font-weight: 800;
}

.pricing-amount {
  margin: 16px 0 6px;
}

.pricing-amount strong {
  font-size: clamp(44px, 6vw, 58px);
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.pricing-amount span {
  font-size: 18px;
  color: var(--muted);
  font-weight: 600;
}

.pricing-note {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 14px;
}

.pricing-list {
  list-style: none;
  margin: 0 0 22px;
  padding: 18px 0 0;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 9px;
  text-align: left;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
}

.primary-button.pricing-cta {
  display: flex;
  justify-content: center;
  width: 100%;
  font-size: 16px;
  padding: 14px 20px;
  border-radius: 12px;
  text-decoration: none;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  box-shadow: 0 12px 30px rgba(12, 107, 95, 0.3);
}

.pricing-fine {
  margin: 14px 0 0;
  font-size: 12.5px;
  color: var(--muted);
}

/* ---- Unustasin parooli ---- */
.forgot-link {
  background: none;
  border: none;
  padding: 0;
  margin: -8px 0 0;
  justify-self: end;
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.final-fine {
  display: block;
  margin-top: 12px;
  font-size: 13px;
  opacity: 0.75;
}

.hero-form {
  justify-self: end;
  width: 100%;
  max-width: 420px;
}

.login-fineprint {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

/* ---- Trust bar ---- */
.landing-trust {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 14px 26px;
  padding: 26px clamp(20px, 5vw, 72px);
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}

.landing-trust > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.trust-items {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.trust-items span {
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #344054;
  background: var(--soft);
  font-size: 12px;
  font-weight: 700;
}

/* ---- Feature rows ---- */
.feature-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: clamp(32px, 6vw, 72px);
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(56px, 8vw, 90px) clamp(20px, 5vw, 40px);
}

.feature-row.reverse .feature-text {
  order: 2;
}

.feature-tag {
  margin: 0 0 10px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.feature-tag.center {
  text-align: center;
}

.feature-text h2 {
  margin: 0 0 14px;
  font-size: clamp(26px, 3.4vw, 38px);
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.feature-text > p {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.6;
}

.feature-list {
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}

.feature-list li {
  position: relative;
  padding-left: 30px;
  color: #344054;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
}

.feature-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: -1px;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(6, 118, 71, 0.12);
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.feature-visual {
  display: grid;
  place-items: center;
}

/* ---- Mockups (pure CSS) ---- */
.mock {
  width: 100%;
  max-width: 440px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 30px 70px rgba(6, 40, 35, 0.14);
  overflow: hidden;
}

.mock-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  background: var(--soft);
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  font-weight: 700;
  color: #344054;
}

.mock-bar .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #d7dce3;
}

.mock-bar .dot:nth-child(1) { background: #ff6b5c; }
.mock-bar .dot:nth-child(2) { background: #ffb15c; }
.mock-bar .dot:nth-child(3) { background: #37c98a; }

.mock-bar em {
  margin-left: 8px;
  font-style: normal;
  color: var(--muted);
  font-weight: 700;
}

/* dashboard mock */
.mock-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 18px 16px 4px;
}

.mock-metrics div {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-radius: 10px;
  background: var(--soft);
}

.mock-metrics span {
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
}

.mock-metrics strong {
  font-size: 17px;
  color: var(--ink);
}

.mock-metrics strong.pos {
  color: var(--green);
}

.mock-chart {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 120px;
  padding: 18px 18px 8px;
}

.mock-chart span {
  flex: 1;
  height: var(--h);
  border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, #0c8a78, #0b4a41);
}

.mock-chart span:last-child {
  background: linear-gradient(180deg, var(--brand-warm), var(--brand-coral));
}

.mock-chart-labels {
  display: flex;
  gap: 10px;
  padding: 0 18px 16px;
}

.mock-chart-labels span {
  flex: 1;
  text-align: center;
  font-size: 10px;
  color: var(--muted);
  font-weight: 600;
}

/* ocr mock */
.mock-ocr {
  display: grid;
  grid-template-columns: 40% 1fr;
  gap: 0;
}

.mock-photo {
  position: relative;
  padding: 18px;
  background: linear-gradient(160deg, #0b4a41, #05302b);
  display: grid;
  align-content: center;
}

.mock-photo-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #37c98a;
  color: #05302b;
  font-size: 11px;
  font-weight: 800;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.mock-receipt {
  display: grid;
  gap: 9px;
  margin-top: 22px;
  padding: 16px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
}

.mock-receipt span {
  height: 8px;
  width: var(--w);
  border-radius: 4px;
  background: #cbd5d1;
}

.mock-fields {
  display: grid;
  gap: 2px;
  padding: 8px 0;
}

.mock-fields div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.mock-fields div:last-child {
  border-bottom: 0;
}

.mock-fields span {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}

.mock-fields strong {
  font-size: 14px;
  color: var(--ink);
}

/* invoice mock */
.mock-invoice {
  padding: 0;
}

.mock-inv-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 22px 18px;
  border-bottom: 3px solid var(--brand);
}

.mock-inv-head strong {
  display: block;
  font-size: 22px;
  letter-spacing: 0.04em;
  color: var(--brand);
}

.mock-inv-head span {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}

.mock-logo {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand-warm), var(--brand-coral) 48%, #0f766e 49%, var(--brand) 100%);
  color: #fff;
  font-weight: 900;
}

.mock-inv-rows {
  display: grid;
  gap: 14px;
  padding: 24px 22px;
}

.mock-inv-rows span {
  height: 10px;
  width: var(--w);
  border-radius: 5px;
  background: #e3e8ec;
}

.mock-inv-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  background: var(--soft);
  border-top: 1px solid var(--line);
}

.mock-inv-total span {
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
}

.mock-inv-total strong {
  font-size: 22px;
  color: var(--brand);
}

/* ---- Steps ---- */
.landing-steps {
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(40px, 6vw, 70px) clamp(20px, 5vw, 40px);
}

.steps-title {
  margin: 0 0 40px;
  text-align: center;
  font-size: clamp(26px, 3.4vw, 38px);
  line-height: 1.1;
  letter-spacing: -0.01em;
}

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

.step-card {
  padding: 28px 24px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 12px 34px rgba(6, 40, 35, 0.06);
}

.step-num {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(12, 107, 95, 0.1);
  color: var(--brand);
  font-size: 18px;
  font-weight: 900;
  margin-bottom: 16px;
}

.step-card h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.step-card p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

/* ---- Final CTA ---- */
.landing-final {
  max-width: 760px;
  margin: clamp(20px, 4vw, 40px) auto;
  padding: clamp(44px, 6vw, 68px) clamp(24px, 5vw, 56px);
  text-align: center;
  border-radius: 24px;
  background:
    radial-gradient(700px 400px at 80% -30%, rgba(255, 177, 92, 0.28), transparent 60%),
    linear-gradient(150deg, #0b4a41, #05302b);
  color: #fff;
}

.landing-final h2 {
  margin: 0 0 12px;
  font-size: clamp(28px, 4vw, 40px);
  letter-spacing: -0.01em;
}

.landing-final p {
  margin: 0 auto 26px;
  max-width: 460px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 17px;
  line-height: 1.55;
}

.landing-final-cta {
  display: inline-flex;
  width: auto;
  padding: 14px 34px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 16px;
}

/* ---- Footer ---- */
.landing-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 32px clamp(20px, 5vw, 40px) 48px;
  color: var(--muted);
  font-size: 13px;
}

.landing-footer .landing-brand {
  color: var(--ink);
}

.landing-footer .landing-brand strong {
  color: var(--ink);
}

.login-panel,
.editor-panel,
.invoice-preview,
dialog {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-panel {
  display: grid;
  gap: 16px;
  padding: 26px;
}

.login-panel-head {
  margin-bottom: 4px;
}

.login-panel-head div {
  display: grid;
  gap: 2px;
}

.login-panel-head strong {
  font-size: 18px;
}

.login-panel-head span {
  color: var(--muted);
  font-size: 13px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  background: #eef1f5;
  border-radius: 8px;
}

.auth-tab {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 9px 12px;
  cursor: pointer;
}

.auth-tab.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.1);
}

label {
  display: grid;
  gap: 7px;
  color: #344054;
  font-size: 13px;
  font-weight: 700;
}

.company-search {
  position: relative;
  min-width: 0;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid #c7ced8;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 11px 12px;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(12, 107, 95, 0.14);
}

.company-suggestions {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 320px;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 6px;
}

.company-option,
.company-empty {
  width: 100%;
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #1d2939;
  text-align: left;
}

.company-option:hover,
.company-option.active {
  background: #e6f3ef;
}

.company-option strong {
  font-size: 14px;
}

.company-option span,
.company-empty {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.primary-button,
.secondary-button,
.danger-button,
.ghost-button,
.google-button,
.nav-button,
.icon-button {
  min-height: 42px;
  border-radius: 6px;
  border: 1px solid transparent;
  padding: 0 14px;
  font-weight: 800;
}

.primary-button {
  color: #fff;
  background: var(--brand);
}

.primary-button:hover {
  background: var(--brand-dark);
}

.secondary-button {
  color: #1d2939;
  background: #fff;
  border-color: var(--line);
}

.secondary-button.active-filter {
  border-color: #9fd5ca;
  background: #e6f3ef;
  color: var(--brand-dark);
}

.danger-button {
  color: var(--red);
  background: #fff;
  border-color: #fecdca;
}

.danger-button:hover {
  background: #fff3f2;
}

.ghost-button {
  color: #344054;
  background: transparent;
  border-color: var(--line);
}

.google-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #fff;
  border-color: var(--line);
  color: #1d2939;
}

.app-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}

.google-mark {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #f04438;
  color: #fff;
  font-weight: 900;
}

.small-text {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.workspace {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 22px;
  background: #fff;
  border-right: 1px solid var(--line);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-block span:last-child {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
  word-break: break-word;
}

.nav-tabs {
  display: grid;
  gap: 8px;
}

.nav-button {
  width: 100%;
  text-align: left;
  background: transparent;
  color: #344054;
}

.nav-button.active {
  background: #e6f3ef;
  color: var(--brand-dark);
}

.sidebar .ghost-button {
  margin-top: auto;
}

.main {
  min-width: 0;
  padding: 28px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

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

.topbar h2 {
  margin: 0;
  font-size: 30px;
}

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

.invoice-layout {
  display: grid;
  grid-template-columns: minmax(360px, 0.92fr) minmax(420px, 1.08fr);
  gap: 20px;
  align-items: start;
  min-width: 0;
}

.editor-panel {
  display: grid;
  gap: 16px;
  padding: 18px;
  box-shadow: none;
  min-width: 0;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-heading h3 {
  margin: 0;
  font-size: 16px;
}

.section-heading h4 {
  margin: 0;
  font-size: 14px;
}

.with-action .secondary-button {
  min-height: 34px;
}

.grid {
  display: grid;
  gap: 12px;
  min-width: 0;
}

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

.line-items {
  display: grid;
  gap: 8px;
}

.line-item {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) 84px 110px 40px;
  gap: 8px;
  min-width: 0;
}

.line-item input {
  min-width: 0;
}

.icon-button {
  min-height: 40px;
  padding: 0;
  background: #fff;
  color: var(--red);
  border-color: var(--line);
}

.invoice-preview {
  min-height: 780px;
  padding: clamp(18px, 4vw, 42px);
  box-shadow: none;
  min-width: 0;
}

.invoice-document {
  display: grid;
  gap: 28px;
  min-width: 0;
}

.invoice-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 2px solid var(--invoice-accent, #1d2939);
  padding-bottom: 18px;
  min-width: 0;
}

.invoice-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.invoice-logo {
  width: 96px;
  max-height: 64px;
  object-fit: contain;
}

.invoice-title {
  margin: 0;
  font-size: 38px;
  color: var(--invoice-accent, #202124);
}

.invoice-meta {
  display: grid;
  gap: 4px;
  text-align: right;
  color: #475467;
}

.party-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  min-width: 0;
}

.party-box {
  min-width: 0;
}

.party-box p,
.invoice-document footer p {
  overflow-wrap: anywhere;
}

.party-box h4,
.totals h4 {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.party-box p {
  margin: 3px 0;
}

.invoice-table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.invoice-table th,
.invoice-table td {
  padding: 11px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.invoice-table th {
  color: var(--invoice-accent, #202124);
}

.invoice-table th:nth-child(n + 2),
.invoice-table td:nth-child(n + 2) {
  text-align: right;
}

.totals {
  width: min(100%, 340px);
  margin-left: auto;
  display: grid;
  gap: 8px;
}

.total-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.total-row.grand {
  padding-top: 8px;
  border-top: 2px solid var(--invoice-accent, #1d2939);
  font-size: 20px;
  font-weight: 900;
}

/* ===================== MODERN ===================== */
.invoice-template-modern .invoice-head {
  background: linear-gradient(135deg, var(--invoice-accent, #0c6b5f), color-mix(in srgb, var(--invoice-accent, #0c6b5f) 52%, #05302b));
  border: 0;
  border-radius: 14px;
  padding: 26px 28px;
  color: #fff;
}

.invoice-template-modern .invoice-title {
  color: #fff;
  letter-spacing: 0.02em;
}

.invoice-template-modern .invoice-brand p {
  color: rgba(255, 255, 255, 0.85);
}

.invoice-template-modern .invoice-meta,
.invoice-template-modern .invoice-meta span {
  color: rgba(255, 255, 255, 0.9);
}

.invoice-template-modern .invoice-meta strong {
  color: #fff;
}

.invoice-template-modern .invoice-table th {
  background: var(--invoice-accent, #0c6b5f);
  color: #fff;
  padding: 12px 10px;
  border-bottom: 0;
}

.invoice-template-modern .invoice-table th:first-child {
  border-radius: 8px 0 0 8px;
}

.invoice-template-modern .invoice-table th:last-child {
  border-radius: 0 8px 8px 0;
}

.invoice-template-modern .total-row.grand {
  background: var(--invoice-accent, #0c6b5f);
  color: #fff;
  border: 0;
  border-radius: 12px;
  padding: 14px 18px;
  margin-top: 6px;
}

/* ===================== CLASSIC ===================== */
.invoice-template-classic {
  gap: 26px;
}

.invoice-template-classic .invoice-head {
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  border-bottom: 0;
  border-top: 3px double var(--invoice-accent, #0c6b5f);
  padding: 22px 0 4px;
}

.invoice-template-classic .invoice-brand {
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.invoice-template-classic .invoice-brand > div {
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 8px;
}

.invoice-template-classic .invoice-brand p {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.28em;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}

.invoice-template-classic .invoice-title {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 44px;
  font-weight: 700;
}

.invoice-template-classic .invoice-meta {
  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: 28px;
  width: 100%;
  padding: 10px 0;
  text-align: center;
  color: #475467;
  font-size: 13px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.invoice-template-classic .invoice-meta strong {
  font-weight: 600;
  color: var(--ink);
}

.invoice-template-classic .party-box p:first-of-type {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 16px;
  font-weight: 700;
}

.invoice-template-classic .invoice-table th {
  color: var(--ink);
  border-bottom: 1px solid var(--invoice-accent, #0c6b5f);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.invoice-template-classic .total-row.grand {
  border-top: 3px double var(--invoice-accent, #0c6b5f);
  font-family: Georgia, "Times New Roman", serif;
  color: var(--invoice-accent, #0c6b5f);
}

/* ===================== MINIMAL ===================== */
.invoice-template-minimal {
  gap: 34px;
}

.invoice-template-minimal .invoice-head {
  border-bottom: 0;
  align-items: flex-start;
  padding-bottom: 0;
}

.invoice-template-minimal .invoice-title {
  font-weight: 400;
  font-size: 48px;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.invoice-template-minimal .invoice-brand p {
  color: var(--muted);
}

.invoice-template-minimal .invoice-meta {
  color: var(--muted);
  font-size: 13px;
}

.invoice-template-minimal .invoice-meta strong {
  color: var(--ink);
  font-weight: 700;
}

.invoice-template-minimal .invoice-table th {
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
  border-bottom: 1.5px solid var(--ink);
}

.invoice-template-minimal .invoice-table td {
  border-bottom: 1px solid #f0f0f0;
}

.invoice-template-minimal .total-row.grand {
  position: relative;
  border-top: 1px solid var(--line);
  color: var(--ink);
}

.invoice-template-minimal .total-row.grand::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -10px;
  width: 64px;
  height: 3px;
  background: var(--invoice-accent, #0c6b5f);
}

.filters {
  display: grid;
  grid-template-columns: 150px 170px 200px 170px minmax(180px, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}

.dashboard-firm select {
  min-width: 190px;
}

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

.kpi-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  display: grid;
  gap: 4px;
}

.kpi-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.kpi-card strong {
  font-size: 24px;
  line-height: 1.2;
}

.kpi-card em {
  font-style: normal;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.kpi-card.good strong {
  color: var(--green);
}

.kpi-card.bad strong {
  color: var(--red);
}

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

.dashboard-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  min-width: 0;
}

.dashboard-card.span-2 {
  grid-column: span 2;
}

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

.bar-chart {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
  height: 190px;
}

.bar-column {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 6px;
  height: 100%;
  text-align: center;
}

.bar-value {
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  align-self: end;
}

.bar-stack {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 2px;
  border-radius: 6px 6px 0 0;
  overflow: hidden;
}

.bar-paid {
  background: var(--brand);
  border-radius: 0 0 4px 4px;
  min-height: 0;
}

.bar-open {
  background: #ffd6a8;
  border-radius: 4px 4px 0 0;
  min-height: 0;
}

.bar-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.status-chart {
  display: flex;
  align-items: center;
  gap: 20px;
}

.donut {
  width: 128px;
  height: 128px;
  border-radius: 50%;
  flex-shrink: 0;
  display: grid;
  place-items: center;
}

.donut-hole {
  width: 82px;
  height: 82px;
  border-radius: 50%;
  background: #fff;
  display: grid;
  place-content: center;
  text-align: center;
}

.donut-hole strong {
  font-size: 22px;
  line-height: 1;
}

.donut-hole span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.donut-legend {
  display: grid;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.legend-row i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}

.legend-row span {
  flex: 1;
  color: var(--muted);
  font-weight: 600;
}

.top-clients {
  display: grid;
  gap: 12px;
}

.client-row-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  margin-bottom: 5px;
}

.client-row-head span {
  color: var(--ink);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-bar {
  height: 8px;
  border-radius: 999px;
  background: var(--soft);
  overflow: hidden;
}

.client-bar div {
  height: 100%;
  border-radius: 999px;
  background: var(--brand);
}

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

.unpaid-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px 14px;
  font: inherit;
}

.unpaid-row:hover {
  border-color: var(--brand);
}

.unpaid-row strong {
  display: block;
  font-size: 14px;
}

.unpaid-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.unpaid-row span.due-late,
.due-late {
  color: var(--red);
}

.unpaid-row em {
  font-style: normal;
  font-weight: 900;
  font-size: 15px;
  white-space: nowrap;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.admin-summary {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.metric,
.archive-card,
.seller-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metric {
  padding: 16px;
}

.metric span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  margin-top: 6px;
  font-size: 24px;
}

.archive-list,
.seller-list,
.client-list {
  display: grid;
  gap: 10px;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(420px, 1.1fr);
  gap: 14px;
  align-items: start;
}

.admin-panel {
  display: grid;
  gap: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  min-width: 0;
}

.admin-user-list {
  display: grid;
  gap: 8px;
  max-height: 640px;
  overflow: auto;
}

.admin-compact-list {
  display: grid;
  gap: 8px;
  max-height: 360px;
  overflow: auto;
}

.admin-user-card,
.admin-compact-row {
  display: grid;
  gap: 10px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  color: var(--ink);
  text-align: left;
}

.admin-user-card:hover,
.admin-user-card.active,
.admin-compact-row:hover,
.admin-compact-row.active {
  border-color: #9fd5ca;
  background: #f3fbf8;
}

.admin-user-card strong,
.admin-compact-row strong {
  display: block;
  overflow-wrap: anywhere;
}

.admin-user-card span,
.admin-compact-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.admin-compact-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.admin-compact-row em {
  color: var(--brand-dark);
  font-style: normal;
  font-size: 12px;
  font-weight: 900;
  text-align: right;
}

.admin-user-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.admin-user-stats span,
.admin-detail-meta span {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #f2f4f7;
  padding: 0 8px;
  color: #344054;
  font-size: 12px;
  font-weight: 800;
}

.admin-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.admin-company-info {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.admin-company-info div {
  display: grid;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f8fafc;
  min-width: 0;
}

.admin-company-info strong {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.admin-company-info span {
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 700;
}

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

.admin-user-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  background: #f8fafc;
}

.admin-user-info {
  display: grid;
  gap: 2px;
  min-width: 0;
  flex: 1 1 200px;
}

.admin-user-info strong {
  font-size: 14px;
  overflow-wrap: anywhere;
}

.admin-user-info span {
  font-size: 12px;
  color: var(--muted);
}

.admin-user-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.admin-user-badge.badge-ok { background: #dcfce7; color: #166534; }
.admin-user-badge.badge-warn { background: #fef3c7; color: #92400e; }
.admin-user-badge.badge-locked { background: #fee2e2; color: #991b1b; }

.admin-user-credit {
  display: flex;
  gap: 6px;
  align-items: center;
}

.admin-user-credit .admin-credit-days {
  width: 70px;
}

.admin-settings-form {
  display: grid;
  gap: 12px;
}

.admin-settings-form label {
  display: grid;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.account-orders {
  grid-column: 1 / -1;
}

.account-premium {
  border: 2px solid var(--brand);
}

.account-premium-badge {
  display: inline-block;
  background: #dcfce7;
  color: #166534;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 11px;
  font-weight: 700;
  vertical-align: middle;
  margin-left: 6px;
}

.account-note.small {
  font-size: 12px;
  margin-top: 8px;
}

/* ---- Aastaaruande paywall ---- */
.report-paywall {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: clamp(20px, 3vw, 32px);
  background:
    radial-gradient(600px 300px at 50% 0%, rgba(12, 107, 95, 0.07), transparent 70%),
    #fff;
}

.paywall-head {
  text-align: center;
  max-width: 560px;
  margin: 0 auto 20px;
}

.paywall-lock {
  font-size: 30px;
}

.paywall-head h3 {
  margin: 8px 0 6px;
  font-size: 20px;
}

.paywall-head p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.paywall-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  max-width: 720px;
  margin: 0 auto;
}

@media (max-width: 680px) {
  .paywall-options {
    grid-template-columns: 1fr;
  }
}

.paywall-option {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  background: #f8fafc;
  align-content: start;
}

.paywall-option strong {
  font-size: 15px;
}

.paywall-price {
  font-size: 26px;
  font-weight: 800;
  color: var(--ink);
}

.paywall-price em {
  font-style: normal;
  font-size: 14px;
  color: var(--muted);
  font-weight: 600;
}

.paywall-desc {
  font-size: 13px;
  color: var(--muted);
  min-height: 52px;
}

/* ---- Aruande vormistamise riba (ettevalmistus vaba, PDF tasuline) ---- */
.report-finalize-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  border: 1px solid #fcd34d;
  background: #fffbeb;
  border-radius: 12px;
  padding: 14px 18px;
}

.report-finalize-note > div {
  display: grid;
  gap: 3px;
  min-width: 0;
  flex: 1 1 320px;
}

.report-finalize-note strong {
  font-size: 14px;
  color: #92400e;
}

.report-finalize-note span {
  font-size: 13px;
  color: var(--muted);
}

.report-finalize-note .primary-button {
  white-space: nowrap;
}

/* ---- Footeri õiguslikud lingid + dialoog ---- */
.footer-links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.footer-link {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.75);
  font-size: 14px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer-link:hover {
  color: #fff;
}

#legalDialog {
  width: min(680px, calc(100vw - 32px));
  max-height: 85vh;
}

.legal-content {
  max-height: 60vh;
  overflow-y: auto;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--ink);
}

.legal-content p {
  margin: 0 0 14px;
}

.legal-updated {
  margin-top: 18px;
  font-size: 12.5px;
  color: var(--muted);
  font-style: italic;
}

/* ---- Admini vahekaardid ---- */
.admin-subnav {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.admin-subnav .reports-tab {
  padding: 12px 14px;
  text-align: center;
  justify-items: center;
}

@media (max-width: 760px) {
  .admin-subnav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

#adminMarketingForm textarea {
  width: 100%;
  resize: vertical;
  font-family: inherit;
  font-size: 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

/* ---- Onboarding (uue firma andmed) ---- */
.onboarding {
  position: fixed;
  inset: 0;
  z-index: 4000;
  overflow-y: auto;
  background:
    radial-gradient(900px 500px at 80% -10%, rgba(255, 177, 92, 0.14), transparent 60%),
    linear-gradient(160deg, #0d5a4e 0%, #073b34 55%, #05302b 100%);
  padding: clamp(16px, 4vw, 40px);
}

.onboarding-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 720px;
  margin: 0 auto 20px;
  color: #fff;
}

.onboarding-topbar .landing-brand {
  color: #fff;
  font-size: 20px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
}

.onboarding-topbar .ghost-button {
  color: rgba(255, 255, 255, 0.85);
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.08);
}

.onboarding-card {
  max-width: 720px;
  margin: 0 auto;
  background: #fff;
  border-radius: 20px;
  padding: clamp(24px, 4vw, 40px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.3);
}

.onboarding-card h1 {
  margin: 0 0 6px;
  font-size: clamp(24px, 4vw, 32px);
  letter-spacing: -0.01em;
}

.onboarding-lead {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 15px;
}

.onboarding-field,
.onboarding-grid > label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 14px;
}

.onboarding-field input,
.onboarding-grid input,
.onboarding-grid select {
  font-weight: 500;
}

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

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

.company-search-wrap {
  position: relative;
}

.onboarding-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

.onboarding-actions .primary-button {
  font-size: 16px;
  padding: 13px 30px;
  border-radius: 12px;
}

/* ---- Aruannete alamvahekaardid ---- */
.reports-subnav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.reports-tab {
  display: grid;
  gap: 3px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 16px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.reports-tab:hover {
  border-color: #b6c2d1;
}

.reports-tab.active {
  border-color: var(--brand);
  background: #f0fdf4;
  box-shadow: inset 0 -3px 0 var(--brand);
}

.reports-tab-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--ink);
}

.reports-tab-sub {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.reports-tab.active .reports-tab-sub {
  color: var(--brand);
}

@media (max-width: 680px) {
  .reports-subnav {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .reports-tab {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
  }
}

/* ---- KMD (käibedeklaratsioon) ---- */
.kmd-result {
  display: grid;
  gap: 10px;
}

.kmd-table {
  display: grid;
  gap: 6px;
  max-width: 640px;
}

.kmd-row {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 14px;
  background: #f8fafc;
  font-size: 13.5px;
}

.kmd-row.grand {
  background: #f0fdf4;
  border-color: #86efac;
}

.kmd-nr {
  min-width: 28px;
  font-weight: 800;
  color: var(--brand);
}

.kmd-label {
  flex: 1;
  color: var(--muted);
}

.kmd-row strong {
  white-space: nowrap;
}

.kmd-inf-note {
  margin: 0;
  font-size: 13px;
  color: var(--green);
  font-weight: 600;
}

.kmd-inf-note.muted {
  color: var(--muted);
  font-weight: 500;
}

.kmd-disclaimer {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
}

/* ---- Aruande lukustatud eelvaade (numbrid peidus kuni ost) ---- */
.report-locked {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}

.report-locked-preview {
  padding: 22px 24px 60px;
  filter: blur(5px);
  opacity: 0.55;
  user-select: none;
  pointer-events: none;
}

.lp-title {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin: 14px 0 8px;
}

.lp-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

.lp-row span {
  color: var(--ink);
  font-weight: 600;
}

.lp-blur {
  font-weight: 800;
  color: var(--ink);
  letter-spacing: 1px;
}

.report-locked-fade {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 120px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), #fff 82%);
}

.report-locked-cta {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  text-align: center;
  gap: 8px;
  padding: 24px;
  background: radial-gradient(600px 300px at 50% 45%, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.94) 75%);
}

.report-locked-lock {
  font-size: 34px;
}

.report-locked-cta h3 {
  margin: 0;
  font-size: clamp(19px, 3vw, 24px);
  color: var(--ink);
}

.report-locked-cta p {
  margin: 0;
  max-width: 460px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.report-locked-cta .primary-button {
  margin-top: 8px;
  font-size: 16px;
  padding: 13px 28px;
  border-radius: 12px;
}

.report-locked-fine {
  font-size: 12.5px;
  color: var(--muted);
}

/* ---- Konto: aasta-nupp ---- */
.account-save {
  font-weight: 600;
  opacity: 0.85;
}

/* ---- Üksik hinnakaart ---- */
.pricing-grid.single {
  grid-template-columns: minmax(0, 560px);
  justify-content: center;
}

.pricing-list.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 560px) {
  .pricing-list.two-col {
    grid-template-columns: 1fr;
  }
}

.pricing-annual {
  margin: 14px 0 0;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
}

.account-order-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  background: #f8fafc;
  margin-top: 8px;
}

.account-order-info {
  display: grid;
  gap: 2px;
  flex: 1 1 220px;
  min-width: 0;
}

.account-order-info strong {
  font-size: 14px;
}

.account-order-info span {
  font-size: 12px;
  color: var(--muted);
}

.account-order-validity {
  font-weight: 600;
}

.auth-status-ok {
  color: var(--green) !important;
  font-weight: 600;
}

.seller-card.shared {
  border-color: #a5c9ff;
  background: #f5f9ff;
}

.shared-badge {
  display: inline-block;
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #a5c9ff;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 11px;
  font-weight: 700;
  vertical-align: middle;
  margin-left: 6px;
}

#shareCompanyDialog {
  width: min(560px, calc(100vw - 32px));
}

.share-invite-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.share-invite-form input[type="email"] {
  flex: 1 1 200px;
}

.share-subtitle {
  margin: 14px 0 6px;
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.share-list {
  display: grid;
  gap: 6px;
}

.share-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #f8fafc;
}

.share-row.pending {
  background: #fffbeb;
  border-color: #fde68a;
}

.share-row-info {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.share-row-info strong {
  font-size: 14px;
  overflow-wrap: anywhere;
}

.share-row-info span {
  font-size: 12px;
  color: var(--muted);
}

.account-message {
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 16px;
  font-weight: 600;
}

.account-message-success {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
}

.account-message-info {
  background: #e0f2fe;
  color: #075985;
  border: 1px solid #7dd3fc;
}

.archive-card,
.seller-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 16px;
}

.client-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.client-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: 0;
}

.client-card-main,
.client-card-foot {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.client-card h3 {
  margin: 0 0 5px;
  font-size: 16px;
}

.client-card p,
.client-card-foot span {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

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

.client-stats div {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 10px;
  border-radius: 8px;
  background: #f8fafc;
}

.client-stats span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.client-stats strong {
  overflow-wrap: anywhere;
  font-size: 14px;
}

.clients-filters {
  grid-template-columns: minmax(220px, 1fr) 220px;
}

.archive-card h3,
.seller-card h3 {
  margin: 0 0 5px;
  font-size: 16px;
}

.archive-card p,
.seller-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  margin-top: 10px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid #d0d5dd;
  background: #f8fafc;
  color: #344054;
  font-size: 12px;
  font-weight: 800;
}

.status-sent {
  border-color: #b2ddff;
  background: #eff8ff;
  color: #175cd3;
}

.status-paid {
  border-color: #abefc6;
  background: #ecfdf3;
  color: #067647;
}

.status-overdue {
  border-color: #fedf89;
  background: #fffaeb;
  color: #b54708;
}

.status-cancelled {
  border-color: #fecdca;
  background: #fff3f2;
  color: #b42318;
}

.status-accepted {
  border-color: #abefc6;
  background: #ecfdf3;
  color: #067647;
}

.status-rejected {
  border-color: #fecdca;
  background: #fff3f2;
  color: #b42318;
}

.status-expired {
  border-color: #e4e7ec;
  background: #f8fafc;
  color: #667085;
}

.doc-type-badge {
  border-color: #d6bbfb;
  background: #f9f5ff;
  color: #6941c6;
  margin-right: 6px;
}

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

.template-picker-hint {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--muted);
}

.template-card {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.template-card:hover {
  border-color: color-mix(in srgb, var(--tpl-accent, #0c6b5f) 55%, white);
}

.template-card.active {
  border-color: var(--tpl-accent, #0c6b5f);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--tpl-accent, #0c6b5f) 22%, transparent);
}

.tpl-thumb {
  display: block;
  height: 98px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.tpl-body {
  display: grid;
  gap: 6px;
  padding: 10px;
}

.tpl-body.center {
  justify-items: center;
  text-align: center;
  gap: 4px;
}

.tpl-row {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: #e5e9ee;
}

.tpl-row.short {
  width: 60%;
}

/* Modern thumb: accent band + summary chip */
.tpl-modern .tpl-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 34px;
  padding: 0 9px;
  background: linear-gradient(135deg, var(--tpl-accent, #0c6b5f), color-mix(in srgb, var(--tpl-accent, #0c6b5f) 52%, #05302b));
}

.tpl-modern .tpl-band b {
  width: 34%;
  height: 8px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.9);
}

.tpl-modern .tpl-band s {
  width: 20%;
  height: 6px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.55);
}

.tpl-modern .tpl-chip {
  margin: 2px 0 0 auto;
  width: 56%;
  height: 16px;
  border-radius: 5px;
  background: var(--tpl-accent, #0c6b5f);
}

/* Classic thumb: serif title + ornament rule */
.tpl-classic .tpl-eyebrow {
  width: 46%;
  height: 4px;
  border-radius: 2px;
  background: #cbd5d1;
}

.tpl-classic .tpl-serif {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  color: var(--ink);
}

.tpl-classic .tpl-rule {
  position: relative;
  width: 54%;
  height: 0;
  margin: 3px 0;
  border-top: 1px solid var(--tpl-accent, #0c6b5f);
}

.tpl-classic .tpl-rule::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 5px;
  height: 5px;
  background: var(--tpl-accent, #0c6b5f);
  transform: translate(-50%, -50%) rotate(45deg);
}

.tpl-classic .tpl-row {
  width: 72%;
}

.tpl-classic .tpl-row.short {
  width: 46%;
}

/* Minimal thumb: light title + accent underline */
.tpl-minimal .tpl-big {
  font-size: 22px;
  font-weight: 400;
  line-height: 1;
  color: var(--ink);
}

.tpl-minimal .tpl-underline {
  width: 34px;
  height: 3px;
  border-radius: 2px;
  margin-top: 2px;
  background: var(--tpl-accent, #0c6b5f);
}

.template-card strong {
  font-size: 13px;
}

.tpl-desc {
  font-size: 11px;
  color: var(--muted);
}

.quote-hero {
  background: linear-gradient(135deg, var(--invoice-accent, var(--brand)), color-mix(in srgb, var(--invoice-accent, var(--brand)) 55%, #101828));
  color: #fff;
  border-radius: 14px;
  padding: 26px 28px;
  margin-bottom: 20px;
}

.quote-hero-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 22px;
}

.quote-hero-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 14px;
}

.quote-hero-brand .invoice-logo {
  width: 86px;
  max-height: 38px;
  object-fit: contain;
  background: #fff;
  border-radius: 6px;
  padding: 4px 7px;
}

.quote-hero-meta {
  display: grid;
  text-align: right;
  font-size: 13px;
  gap: 2px;
}

.quote-hero-meta strong {
  font-size: 15px;
}

.quote-hero-meta span {
  opacity: 0.8;
}

.quote-hero h1 {
  margin: 0;
  font-size: 34px;
  letter-spacing: -0.02em;
}

.quote-hero-client {
  margin: 5px 0 16px;
  opacity: 0.85;
  font-size: 15px;
  font-weight: 600;
}

.quote-validity {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12.5px;
  font-weight: 700;
}

.quote-intro {
  margin: 0 0 20px;
  color: #344054;
  font-size: 14px;
  line-height: 1.65;
}

.quote-total-band {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 18px;
  margin: 16px 0 20px;
}

.quote-total-band > div:first-child {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.quote-grand {
  text-align: right;
}

.quote-grand span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.quote-grand strong {
  font-size: 27px;
  color: var(--invoice-accent, var(--brand));
}

.quote-note {
  margin: 0 0 18px;
  color: #344054;
  font-size: 13px;
  line-height: 1.55;
}

.quote-parties {
  margin-bottom: 20px;
}

.quote-accept {
  border-top: 2px solid var(--invoice-accent, var(--brand));
  padding-top: 16px;
}

.quote-accept h4 {
  margin: 0 0 6px;
}

.quote-accept p {
  margin: 0 0 26px;
  color: var(--muted);
  font-size: 13px;
}

.sign-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}

.sign-grid i {
  display: block;
  height: 26px;
  border-bottom: 1px solid #98a2b3;
  margin-bottom: 6px;
}

.sign-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.quote-footer {
  margin-top: 18px;
  color: var(--muted);
  font-size: 12px;
}

.amount {
  font-size: 18px;
  font-weight: 900;
  text-align: right;
}

.credit-amount {
  color: #c0392b;
}

.credit-ref {
  margin: 4px 0 12px;
  font-size: 13px;
  font-weight: 600;
  color: #c0392b;
}

.archive-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 8px;
}

.seller-card-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

dialog {
  width: min(860px, calc(100vw - 28px));
  padding: 0;
}

dialog::backdrop {
  background: rgba(16, 24, 40, 0.45);
}

.dialog-form {
  display: grid;
  gap: 14px;
  padding: 20px;
  max-height: min(86vh, 980px);
  overflow: auto;
}

.dialog-actions {
  position: sticky;
  bottom: -20px;
  margin: 4px -20px -20px;
  padding: 14px 20px 20px;
  background: #fff;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.settings-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.settings-tabs a {
  color: var(--brand-dark);
  background: #e6f3ef;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.settings-section {
  display: grid;
  gap: 12px;
  padding: 14px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.logo-control {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.logo-preview,
.seller-card-logo {
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.logo-preview {
  width: 140px;
  height: 92px;
  border-radius: 8px;
  overflow: hidden;
}

.logo-preview img {
  max-width: 118px;
  max-height: 72px;
  object-fit: contain;
}

.logo-actions {
  display: grid;
  gap: 10px;
}

.seller-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.seller-card-logo {
  width: 42px;
  height: 42px;
  border-radius: 6px;
  object-fit: contain;
  padding: 4px;
}

.seller-card-logo.empty {
  background: #e6f3ef;
  color: var(--brand-dark);
}

/* Ostuarved */
.purchase-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: #eef1f5;
  border-radius: 8px;
  margin-bottom: 14px;
}

.purchase-tab {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 14px;
  cursor: pointer;
}

.purchase-tab.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.1);
}

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

.purchase-card {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 16px;
}

.purchase-card.attention {
  border-color: #fedf89;
  background: #fffcf5;
}

.purchase-card.duplicate {
  border-color: #fda29b;
  background: #fef3f2;
}

.duplicate-badge {
  display: inline-block;
  background: #fee2e2;
  color: var(--red);
  border: 1px solid #fda29b;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  vertical-align: middle;
  margin-left: 6px;
}

.purchase-duplicate-warning {
  background: #fef3f2;
  border: 1px solid #fda29b;
  color: var(--red);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 8px;
}

.purchase-thumb {
  width: 56px;
  height: 56px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--soft);
  display: grid;
  place-items: center;
  cursor: pointer;
  border: 1px solid var(--line);
}

.purchase-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.purchase-thumb-empty {
  font-size: 20px;
  color: var(--muted);
}

.purchase-info {
  min-width: 0;
}

.purchase-info h3 {
  margin: 0 0 4px;
  font-size: 16px;
}

.purchase-info p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.purchase-tags {
  margin-top: 4px !important;
}

.mini-tag {
  display: inline-block;
  background: #f2f4f7;
  color: #475467;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  margin-right: 4px;
}

.purchase-side {
  display: grid;
  gap: 8px;
  justify-items: end;
}

.purchase-editor {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 16px;
}

.purchase-image-preview {
  width: 100%;
  min-height: 180px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
  overflow: hidden;
  position: sticky;
  top: 0;
}

.pdf-placeholder {
  display: grid;
  place-items: center;
  gap: 6px;
  padding: 30px 16px;
  font-size: 16px;
  font-weight: 700;
  color: var(--brand);
}

/* ---- Aasta-vahekaardid (arved + ostuarved) ---- */
.year-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.year-tab {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.year-tab:hover {
  border-color: var(--brand);
  color: var(--ink);
}

.year-tab.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  box-shadow: 0 4px 12px rgba(12, 107, 95, 0.25);
}

.purchase-image-preview img {
  width: 100%;
  height: auto;
  display: block;
}

.tag-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-chip {
  border: 1px solid #c7ced8;
  border-radius: 999px;
  background: #fff;
  color: #344054;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  cursor: pointer;
}

.tag-chip.active {
  border-color: var(--brand);
  background: #e6f3ef;
  color: var(--brand-dark);
}

.image-dialog-body {
  padding: 18px;
  display: grid;
  gap: 12px;
}

.image-dialog-body img {
  max-width: 100%;
  max-height: 70vh;
  border-radius: 8px;
  display: block;
  margin: 0 auto;
}

.purchase-card.clickable {
  cursor: pointer;
}

.purchase-card.clickable:hover {
  border-color: var(--brand);
}

.purchase-detail {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 18px;
}

.purchase-detail-image {
  display: grid;
  gap: 8px;
  align-content: start;
}

.purchase-detail-fields {
  display: grid;
  gap: 2px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.detail-row:last-child {
  border-bottom: 0;
}

.detail-row span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.detail-row strong {
  font-size: 14px;
  text-align: right;
  overflow-wrap: anywhere;
}

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

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 30;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .sidebar .nav-tabs,
  .sidebar .ghost-button {
    display: none;
  }

  .brand-block {
    flex: 0 0 auto;
  }

  .brand-block span:last-child {
    display: none;
  }

  .active-company {
    flex: 1;
    min-width: 0;
    margin: 0;
  }

  .active-company span {
    display: none;
  }

  .active-company select {
    padding: 9px 10px;
  }

  .main {
    padding-bottom: 88px;
  }

  .invoice-layout {
    grid-template-columns: 1fr;
  }

  .landing-hero {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .hero-form {
    justify-self: stretch;
    max-width: 480px;
  }

  .landing-nav-links {
    display: none;
  }

  .feature-row,
  .feature-row.reverse {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .feature-row.reverse .feature-text {
    order: 0;
  }

  .feature-visual {
    order: -1;
  }

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

@media (max-width: 680px) {
  .landing-hero {
    padding: 32px 20px 44px;
  }

  .landing-nav {
    padding: 12px 18px;
  }

  .purchase-editor,
  .purchase-detail {
    grid-template-columns: 1fr;
  }

  .purchase-image-preview {
    position: static;
    min-height: 120px;
    max-height: 220px;
  }

  .purchase-card {
    grid-template-columns: 48px minmax(0, 1fr) auto;
    gap: 10px;
    padding: 12px;
  }

  .hero-copy h1 {
    font-size: 34px;
    line-height: 1.05;
  }

  .lead {
    font-size: 16px;
  }

  .hero-points {
    margin-top: 18px;
  }

  .hero-stats {
    gap: 18px;
    margin-top: 26px;
    padding-top: 20px;
  }

  .login-panel {
    padding: 20px;
  }

  .landing-final {
    border-radius: 18px;
  }

  .main {
    padding: 16px;
    padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  }

  .topbar,
  .invoice-head,
  .archive-card,
  .seller-card,
  .client-card-main,
  .client-card-foot {
    display: grid;
  }

  .top-actions,
  .top-actions button,
  .archive-actions,
  .archive-actions button,
  .dialog-actions,
  .dialog-actions button {
    width: 100%;
  }

  .archive-actions {
    display: grid;
  }

  .grid.two,
  .party-grid,
  .filters,
  .clients-filters,
  .summary-strip,
  .dashboard-grid,
  .admin-layout,
  .admin-company-info,
  .admin-summary,
  .client-list,
  .template-picker {
    grid-template-columns: 1fr;
  }

  .client-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .dashboard-card.span-2 {
    grid-column: auto;
  }

  .status-chart {
    flex-direction: column;
    align-items: stretch;
  }

  .donut {
    margin: 0 auto;
  }

  .line-item {
    grid-template-columns: minmax(0, 1fr) 76px 38px;
  }

  .line-price {
    grid-column: 1 / 3;
  }

  .invoice-preview {
    padding: 16px;
    min-height: 0;
  }

  .invoice-title {
    font-size: 30px;
  }

  .invoice-meta {
    text-align: left;
  }

  .invoice-brand {
    align-items: flex-start;
  }

  .invoice-logo {
    width: 74px;
    max-height: 52px;
  }

  .invoice-table {
    font-size: 12px;
  }

  .invoice-table th,
  .invoice-table td {
    padding: 8px 5px;
    overflow-wrap: anywhere;
  }

  .logo-control {
    grid-template-columns: 1fr;
  }

  .logo-preview {
    width: 100%;
  }
}

@media print {
  body {
    background: #fff;
  }

  body.printing * {
    visibility: hidden;
  }

  body.printing #invoicePreview,
  body.printing #invoicePreview * {
    visibility: visible;
  }

  body.printing #invoicePreview {
    position: absolute;
    inset: 0;
    border: 0;
    box-shadow: none;
    width: 100%;
    min-height: 0;
  }
}

/* ===================== AASTAARUANNE ===================== */
.inline-select {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #344054;
}
.inline-select select {
  width: auto;
}

.report-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px;
  margin-bottom: 18px;
  box-shadow: 0 10px 30px rgba(6, 40, 35, 0.05);
}
.report-card-head {
  margin-bottom: 14px;
}
.report-card-head h3 {
  margin: 0 0 4px;
  font-size: 18px;
}
.report-hint {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

#reportSourceStrip {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.summary-item {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.summary-item span {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.summary-item strong {
  font-size: 18px;
}

.bank-months-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
}

.bank-months-progress strong {
  color: var(--ink);
}

.bank-month-clear {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  color: var(--muted);
}

.bank-months {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 6px;
}

.bank-month {
  display: grid;
  gap: 2px;
  justify-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 4px;
  background: #f8fafc;
  cursor: pointer;
  font-size: 11px;
  color: var(--muted);
  min-width: 0;
}

.bank-month strong {
  font-size: 12px;
  color: inherit;
  white-space: nowrap;
}

.bank-month.done {
  background: #dcfce7;
  border-color: #86efac;
  color: #166534;
}

.bank-month.pending {
  background: #fef3c7;
  border-color: #fcd34d;
  color: #92400e;
}

.bank-month.active {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}

@media (max-width: 680px) {
  .bank-months {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

.bank-month-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.bank-month-clear.danger {
  color: var(--red);
  border-color: #fda29b;
}

.bank-main[data-bank-match] {
  cursor: pointer;
}

.bank-main[data-bank-match]:hover strong {
  text-decoration: underline;
}

.bank-link-none {
  color: var(--muted);
  font-size: 11px;
}

#bankMatchDialog {
  width: min(680px, calc(100vw - 32px));
}

.bank-match-tx {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  background: var(--soft);
  font-size: 13px;
}

.bank-match-tx-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.bank-match-tx span {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.bank-match-linked {
  border: 1px solid #86efac;
  background: #dcfce7;
  color: #166534;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
}

.bank-match-linked.none {
  border-color: var(--line);
  background: #f8fafc;
  color: var(--muted);
}

.bank-match-linked.warn {
  border-color: #fcd34d;
  background: #fef3c7;
  color: #92400e;
}

.bank-match-list {
  display: grid;
  gap: 6px;
  max-height: 320px;
  overflow-y: auto;
}

.bank-match-cand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
}

.bank-match-cand.likely {
  border-color: #86efac;
  background: #f0fdf4;
}

.bank-match-cand.current {
  border-color: var(--brand);
}

.bank-match-cand-info {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.bank-match-cand-info strong {
  font-size: 13px;
  overflow-wrap: anywhere;
}

.bank-match-cand-info span {
  font-size: 12px;
  color: var(--muted);
}

.match-badge {
  display: inline-block;
  font-style: normal;
  font-size: 10px;
  font-weight: 700;
  border-radius: 999px;
  padding: 1px 8px;
  margin-left: 4px;
}

.match-badge.ok {
  background: #dcfce7;
  color: #166534;
}

.bank-list {
  display: grid;
  gap: 8px;
}
.bank-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 150px 96px 28px;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.bank-row.needs-review {
  border-color: #f5c518;
  background: #fffbeb;
}
.bank-row.reviewed {
  border-color: #cdeadd;
  background: #f5fbf8;
}
.bank-confirm-btn {
  padding: 7px 10px;
  border: 1px solid var(--brand);
  border-radius: 8px;
  background: #fff;
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
}
.bank-confirm-btn:hover {
  background: var(--brand);
  color: #fff;
}
.bank-confirmed {
  font-size: 12px;
  font-weight: 800;
  color: var(--green);
  text-align: center;
  white-space: nowrap;
}
.bank-main {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.bank-main strong {
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bank-main span {
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bank-amount {
  font-weight: 800;
  font-size: 14px;
  white-space: nowrap;
  text-align: right;
}
.bank-amount.pos {
  color: var(--green);
}
.bank-category {
  width: 100%;
  padding: 7px 8px;
  font-size: 12px;
}
.bank-flag {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #f5c518;
  color: #3a2c00;
  font-weight: 900;
  font-size: 12px;
}
.bank-ok {
  color: var(--green);
  text-align: center;
  font-weight: 900;
}

.report-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 8px;
}
.report-col h4 {
  margin: 0 0 12px;
  font-size: 15px;
}
.report-fields {
  display: grid;
  gap: 10px;
}
.report-company {
  grid-template-columns: 1fr 1fr;
  margin: 0 0 18px;
}
.report-field {
  display: grid;
  grid-template-columns: 1fr 130px;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  color: #344054;
}
.report-field input {
  text-align: right;
}
.report-total-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 2px solid var(--brand);
  font-weight: 800;
}
.report-total-line strong {
  font-size: 20px;
  color: var(--brand);
}
.balance-check {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}
.balance-check .ok {
  color: var(--green);
  font-weight: 800;
}
.balance-check .warn {
  color: var(--red);
  font-weight: 800;
}
.report-activity {
  margin-top: 22px;
}
.report-activity h4 {
  margin: 0 0 12px;
  font-size: 15px;
}
.report-activity textarea {
  margin-top: 12px;
  width: 100%;
  min-height: 180px;
  resize: vertical;
}
.empty-hint {
  padding: 18px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  background: var(--soft);
  border-radius: 10px;
}

@media (max-width: 780px) {
  #reportSourceStrip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .report-grid {
    grid-template-columns: 1fr;
  }
  .bank-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "main amount" "cat cat" "flags flags";
    row-gap: 8px;
  }
  .bank-main { grid-area: main; }
  .bank-amount { grid-area: amount; }
  .bank-category { grid-area: cat; }
}

/* Aastaaruanne — grupeeritud bilanss + kinnitamine */
.report-group {
  margin-bottom: 16px;
}
.report-group h5 {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.report-group .report-field {
  margin-bottom: 8px;
}
.report-subrow {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  font-size: 13px;
  color: var(--muted);
}
.report-subtotal {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  font-weight: 700;
}
.report-subtotal strong {
  font-size: 15px;
}
.link-button {
  border: 0;
  background: none;
  padding: 0;
  color: var(--brand);
  font-weight: 800;
  font-size: 13px;
  text-decoration: underline;
  cursor: pointer;
}

/* Aastaaruanne — firma valik, äriregister, käsitsi juhend */
.report-registry {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
}
.report-manual {
  margin: 0 0 18px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--soft);
}
.report-manual summary {
  cursor: pointer;
  font-weight: 800;
  font-size: 13px;
  color: var(--brand);
}
.report-manual p {
  margin: 10px 0 6px;
  font-size: 13px;
  color: #344054;
}
.report-manual ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
}
.report-manual li {
  font-size: 13px;
  line-height: 1.45;
  color: #475467;
}

.bank-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 3px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(6, 118, 71, 0.1);
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
  width: fit-content;
}

/* Globaalne aktiivse ettevõtte valik sidebaris */
.active-company {
  display: grid;
  gap: 5px;
  margin: 14px 0 18px;
}
.active-company span {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.active-company select {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
}

/* ===================== MOBIILIMENÜÜ ===================== */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 45;
  justify-content: space-around;
  gap: 2px;
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
  background: #fff;
  border-top: 1px solid var(--line);
  box-shadow: 0 -6px 22px rgba(6, 40, 35, 0.07);
}
.mobile-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 0;
  padding: 6px 2px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
}
.mobile-nav-item svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.mobile-nav-item.active {
  color: var(--brand);
}

.mobile-sheet {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-end;
  background: rgba(16, 24, 40, 0.42);
}
.mobile-sheet.hidden {
  display: none;
}
.mobile-sheet-panel {
  width: 100%;
  display: grid;
  gap: 4px;
  padding: 10px 16px calc(20px + env(safe-area-inset-bottom, 0px));
  background: #fff;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -10px 40px rgba(6, 40, 35, 0.2);
  animation: sheet-up 0.2s ease;
}
@keyframes sheet-up {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
.mobile-sheet-handle {
  width: 40px;
  height: 4px;
  margin: 4px auto 12px;
  border-radius: 2px;
  background: var(--line);
}
.mobile-sheet-item {
  width: 100%;
  text-align: left;
  padding: 15px 14px;
  border: 0;
  border-radius: 12px;
  background: none;
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
}
.mobile-sheet-item.active {
  background: #e6f3ef;
  color: var(--brand-dark);
}
.mobile-sheet-item.danger {
  color: var(--red);
}

@media (max-width: 980px) {
  .mobile-nav {
    display: flex;
  }
}

/* ===== Ostuarvete aasta/kuu kaustad ===== */
.year-folder {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  margin-bottom: 12px;
  overflow: hidden;
}
.year-folder > summary {
  padding: 16px 18px;
  font-size: 17px;
  font-weight: 900;
}
.year-folder-inner {
  padding: 4px 12px 12px;
  display: grid;
  gap: 8px;
}
.month-folder {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--soft);
  overflow: hidden;
}
.month-folder > summary {
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 800;
}
.year-folder > summary,
.month-folder > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  list-style: none;
}
.year-folder > summary::-webkit-details-marker,
.month-folder > summary::-webkit-details-marker {
  display: none;
}
.folder-name {
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: capitalize;
}
.folder-name::before {
  content: "▸";
  font-size: 12px;
  color: var(--muted);
  transition: transform 0.15s ease;
}
details[open] > summary .folder-name::before {
  transform: rotate(90deg);
}
.folder-meta {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}
.month-folder .purchase-list-inner {
  padding: 4px 10px 12px;
  display: grid;
  gap: 8px;
}

/* Müügiarvete import */
.import-help {
  margin: 4px 0;
  font-size: 13px;
  color: var(--muted);
}
.import-help summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--brand);
}
.import-help p {
  margin: 8px 0 4px;
}
.import-example {
  margin: 6px 0 0;
  padding: 10px 12px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12px;
  white-space: pre;
  overflow-x: auto;
}

/* Impordi-dialoog: eraldaja + PDF-sektsioon */
.import-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 6px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}
.import-divider::before,
.import-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
.import-pdf {
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: var(--soft);
  display: grid;
  gap: 8px;
}
.import-pdf strong {
  font-size: 14px;
}

/* ===================== AVALEHT — MODERN ===================== */
.landing-hero {
  position: relative;
  overflow: hidden;
}
.hero-glow {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.hero-glow::before,
.hero-glow::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
}
.hero-glow::before {
  width: 480px;
  height: 480px;
  top: -170px;
  right: -90px;
  background: radial-gradient(circle, rgba(255, 177, 92, 0.5), transparent 70%);
}
.hero-glow::after {
  width: 540px;
  height: 540px;
  bottom: -240px;
  left: -160px;
  background: radial-gradient(circle, rgba(55, 201, 138, 0.32), transparent 70%);
}
.hero-copy,
.landing-hero .hero-form {
  position: relative;
  z-index: 1;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}
.eyebrow-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand-warm);
  box-shadow: 0 0 0 4px rgba(255, 177, 92, 0.22);
}
.hero-grad {
  background: linear-gradient(100deg, var(--brand-warm), var(--brand-coral));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.landing-hero .login-panel {
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.36);
}

/* Aruande-mock */
.mock-report-body {
  padding: 16px 18px 18px;
  display: grid;
  gap: 11px;
}
.mock-report-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: var(--muted);
}
.mock-report-row strong {
  color: var(--ink);
}
.mock-report-row.grand {
  padding-top: 11px;
  border-top: 2px solid var(--brand);
  font-size: 15px;
}
.mock-report-row.grand strong {
  color: var(--brand);
  font-size: 19px;
}
.mock-report-check {
  margin-top: 4px;
  padding: 9px 12px;
  border-radius: 9px;
  background: rgba(6, 118, 71, 0.1);
  color: var(--green);
  font-weight: 800;
  font-size: 12px;
  text-align: center;
}

/* Bento */
.landing-bento {
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(40px, 6vw, 72px) clamp(20px, 5vw, 40px);
}
.bento-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 36px;
}
.bento-card {
  padding: 24px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 12px 34px rgba(6, 40, 35, 0.05);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.bento-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 22px 46px rgba(6, 40, 35, 0.11);
}
.bento-ico {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 13px;
  margin-bottom: 14px;
  background: color-mix(in srgb, var(--brand) 10%, white);
  font-size: 22px;
}
.bento-card h3 {
  margin: 0 0 6px;
  font-size: 17px;
}
.bento-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

/* Sammud + lõpp-CTA lihv */
.step-num {
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff;
}
.step-card {
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.step-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 42px rgba(6, 40, 35, 0.1);
}
.landing-final {
  position: relative;
  overflow: hidden;
}
.landing-final::before {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  top: -190px;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 50%;
  filter: blur(80px);
  background: radial-gradient(circle, rgba(255, 177, 92, 0.4), transparent 70%);
  pointer-events: none;
}
.landing-final > * {
  position: relative;
  z-index: 1;
}
.landing-final-cta {
  box-shadow: 0 16px 44px rgba(255, 177, 92, 0.32);
}

@media (max-width: 900px) {
  .bento-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 640px) {
  .bento-grid {
    grid-template-columns: 1fr;
  }
}

/* Aastaaruanne — mikroettevõtja kontroll + põhivara abimees */
.eligibility {
  margin: 0 0 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.eligibility-head {
  font-weight: 800;
  font-size: 14px;
  margin-bottom: 10px;
}
.eligibility-head.ok {
  color: var(--green);
}
.eligibility-head.warn {
  color: #b54708;
}
.eligibility-rows {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}
.elig-row {
  font-size: 13px;
  font-weight: 600;
  color: #344054;
}
.elig-row.ok {
  color: var(--green);
}
.elig-row.no {
  color: var(--red);
}
.elig-row em {
  color: var(--muted);
  font-style: normal;
  font-weight: 700;
}
.eligibility-note {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

.report-assets {
  margin: 0 0 18px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--soft);
}
.report-assets summary {
  cursor: pointer;
  font-weight: 800;
  font-size: 14px;
  color: var(--brand);
}
.report-assets .report-hint {
  margin: 10px 0;
}
.asset-list {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}
.asset-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  padding: 8px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  color: var(--muted);
}
.asset-row .asset-name {
  font-weight: 800;
  color: var(--ink);
  flex: 1;
  min-width: 120px;
}
.asset-row .icon-button {
  margin-left: auto;
}
.asset-add {
  display: grid;
  grid-template-columns: 1.6fr 1fr 0.8fr 1fr auto;
  gap: 8px;
  margin-bottom: 12px;
}
.asset-add input {
  padding: 9px 10px;
}
.asset-totals {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  font-size: 14px;
  color: #344054;
}
.asset-totals strong {
  color: var(--ink);
}
.asset-totals .primary-button {
  margin-left: auto;
}
@media (max-width: 680px) {
  .asset-add {
    grid-template-columns: 1fr 1fr;
  }
}

/* ===================== AVALEHT — PREMIUM v2 ===================== */

/* Scroll-reveal */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s cubic-bezier(0.2, 0.7, 0.2, 1), transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}
.reveal[data-delay="1"] { transition-delay: 0.12s; }
.reveal[data-delay="2"] { transition-delay: 0.24s; }
.reveal-stagger > * {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal-stagger.is-visible > * { opacity: 1; transform: none; }
.reveal-stagger.is-visible > *:nth-child(2) { transition-delay: 0.08s; }
.reveal-stagger.is-visible > *:nth-child(3) { transition-delay: 0.16s; }
.reveal-stagger.is-visible > *:nth-child(4) { transition-delay: 0.24s; }
.reveal-stagger.is-visible > *:nth-child(5) { transition-delay: 0.32s; }
.reveal-stagger.is-visible > *:nth-child(6) { transition-delay: 0.4s; }
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-stagger > * { opacity: 1 !important; transform: none !important; transition: none !important; }
}

/* Eristuvad sektsioonid */
.land-section {
  padding: clamp(48px, 7vw, 90px) 0;
  background: #fff;
}
.land-section.tint {
  background: linear-gradient(180deg, #eef4f2, #f4f7f7);
}
.land-section > * {
  width: min(1120px, calc(100% - 48px));
  margin-inline: auto;
}
.land-section .feature-row {
  padding: 0;
  max-width: none;
}
.section-head {
  text-align: center;
  margin-bottom: 4px;
}

/* 3D-kalle mockidele */
.mock-tilt {
  transform: perspective(1300px) rotateY(-7deg) rotateX(1.5deg);
  transition: transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.is-visible .mock-tilt,
.feature-visual:hover .mock-tilt,
.showcase-visual:hover .mock-tilt {
  transform: perspective(1300px) rotateY(0) rotateX(0);
}

/* Animeeritud tulpdiagramm */
.mock-chart.anim span {
  height: 0;
  transition: height 0.9s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.is-visible .mock-chart.anim span { height: var(--h); }
.is-visible .mock-chart.anim span:nth-child(2) { transition-delay: 0.06s; }
.is-visible .mock-chart.anim span:nth-child(3) { transition-delay: 0.12s; }
.is-visible .mock-chart.anim span:nth-child(4) { transition-delay: 0.18s; }
.is-visible .mock-chart.anim span:nth-child(5) { transition-delay: 0.24s; }
.is-visible .mock-chart.anim span:nth-child(6) { transition-delay: 0.3s; }

/* Tume showcase-riba (aastaaruanne) */
.land-showcase {
  position: relative;
  overflow: hidden;
  padding: clamp(56px, 8vw, 104px) 0;
  color: #fff;
  background:
    radial-gradient(1000px 520px at 82% -10%, rgba(255, 177, 92, 0.2), transparent 60%),
    linear-gradient(160deg, #0b4a41 0%, #073b34 50%, #05302b 100%);
}
.showcase-glow::before {
  content: "";
  position: absolute;
  width: 520px;
  height: 520px;
  bottom: -240px;
  left: -140px;
  border-radius: 50%;
  filter: blur(90px);
  background: radial-gradient(circle, rgba(55, 201, 138, 0.3), transparent 70%);
  pointer-events: none;
}
.showcase-inner {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
}
.showcase-text h2 {
  margin: 0 0 14px;
  font-size: clamp(28px, 3.6vw, 42px);
  line-height: 1.08;
  letter-spacing: -0.01em;
}
.showcase-text > p {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 17px;
  line-height: 1.6;
}
.feature-tag.light { color: var(--brand-warm); }
.feature-list.light li { color: rgba(255, 255, 255, 0.9); }
.feature-list.light li::before {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}
.showcase-cta {
  margin-top: 24px;
  display: inline-flex;
  width: auto;
  padding: 13px 30px;
  border-radius: 999px;
  text-decoration: none;
}
.mock.glass {
  box-shadow: 0 44px 100px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.08);
}

/* Statistika-riba */
.land-stats {
  padding: clamp(40px, 6vw, 72px) 0;
  color: #fff;
  background: linear-gradient(160deg, #0b4a41, #05302b);
}
.stats-inner {
  width: min(1000px, calc(100% - 48px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  text-align: center;
}
.stat strong {
  display: block;
  font-size: clamp(30px, 4vw, 46px);
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(100deg, var(--brand-warm), var(--brand-coral));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat span {
  display: block;
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  font-weight: 700;
}

/* KKK */
.faq-list {
  width: min(820px, calc(100% - 48px));
  margin: 34px auto 0;
  display: grid;
  gap: 12px;
}
.faq-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
  transition: box-shadow 0.15s ease;
}
.faq-item[open] {
  box-shadow: 0 12px 30px rgba(6, 40, 35, 0.07);
}
.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 18px 20px;
  font-weight: 800;
  font-size: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font-size: 24px;
  font-weight: 400;
  color: var(--brand);
  transition: transform 0.2s ease;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p {
  margin: 0;
  padding: 0 20px 18px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

@media (max-width: 820px) {
  .showcase-inner {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .showcase-visual { order: -1; }
  .stats-inner {
    grid-template-columns: repeat(2, 1fr);
    gap: 28px 20px;
  }
  .mock-tilt {
    transform: none;
  }
}

/* Krediit / prooviaja bänner */
.billing-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 12px 16px;
  margin-bottom: 18px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
}
.billing-banner.warn {
  background: #fff7e6;
  border: 1px solid #f3ce6a;
  color: #7a4d00;
}
.billing-banner.locked {
  background: #fdecea;
  border: 1px solid #f0b4ab;
  color: #b42318;
}
.billing-buy {
  padding: 9px 18px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brand-warm), var(--brand-coral));
  color: #2a1206;
  font-weight: 800;
  font-size: 13px;
  white-space: nowrap;
  box-shadow: 0 8px 20px rgba(232, 93, 69, 0.24);
}
.billing-buy:hover { filter: brightness(1.05); }

/* ===================== MINU KONTO ===================== */
.account-content {
  display: grid;
  gap: 18px;
  max-width: 780px;
}
.account-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.account-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 12px 34px rgba(6, 40, 35, 0.05);
}
.account-status {
  position: relative;
  overflow: hidden;
  color: #fff;
  border: 0;
  background: linear-gradient(150deg, #0b4a41, #05302b);
}
.account-status.status-warn {
  background: linear-gradient(150deg, #a86a12, #7a4d00);
}
.account-status.status-locked {
  background: linear-gradient(150deg, #b42318, #7a1810);
}
.account-badge {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.account-days {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 18px 0 6px;
}
.account-days strong {
  font-size: 52px;
  font-weight: 900;
  line-height: 1;
}
.account-days span {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.82);
  font-weight: 700;
}
.account-until {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 13px;
}
.account-buy h3 {
  margin: 0 0 6px;
  font-size: 18px;
}
.account-price {
  margin: 0 0 10px;
}
.account-price strong {
  font-size: 30px;
  font-weight: 900;
  color: var(--brand);
}
.account-price span {
  color: var(--muted);
  font-weight: 700;
}
.account-note {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}
.account-buy .primary-button {
  width: 100%;
}
.account-info h3 {
  margin: 0 0 12px;
  font-size: 16px;
}
.account-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--muted);
}
.account-info-row:first-of-type {
  border-top: 0;
}
.account-info-row strong {
  color: var(--ink);
}
@media (max-width: 680px) {
  .account-grid {
    grid-template-columns: 1fr;
  }
}

/* ===================== Projektid (kulude analüütika) ===================== */

.project-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.project-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px 18px;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.project-card:hover {
  border-color: var(--brand);
  box-shadow: 0 6px 18px rgba(32, 33, 36, 0.08);
}

.project-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.project-card-head strong {
  font-size: 16px;
}

.project-card-total {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 2px;
}

.project-card-total strong {
  font-size: 20px;
  color: var(--brand);
}

.status-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.status-badge.active {
  background: #e6f4ef;
  color: var(--green);
}

.status-badge.done {
  background: #eef2ff;
  color: #3538cd;
}

.status-badge.archived {
  background: var(--soft);
  color: var(--muted);
}

.budget-bar {
  height: 6px;
  border-radius: 999px;
  background: var(--soft);
  overflow: hidden;
}

.budget-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--brand);
}

.budget-bar.over .budget-bar-fill {
  background: var(--red);
}

.budget-over-note,
.project-repay-note {
  color: var(--red) !important;
}

.project-financier-bits {
  margin: 0;
}

/* Rahastajate tabel (Makstud / Tagastatud / Saldo) */
.financier-table {
  display: flex;
  flex-direction: column;
}

.financier-table-head,
.financier-table-row {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) 1fr 1fr 1fr;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.financier-table-head {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.financier-table-row span:not(:first-child),
.financier-table-row strong,
.financier-table-head span:not(:first-child) {
  text-align: right;
}

.balance-open {
  color: var(--red);
}

.repayment-heading {
  margin: 16px 0 6px;
  font-size: 13px;
}

.repayment-row {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr) minmax(0, 1.4fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 13px;
}

.repayment-row .ghost-button {
  padding: 2px 8px;
}

/* Kululiikide horisontaalsed ribad */
.category-bars {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.category-bar-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  font-size: 13px;
}

.category-bar-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-bar-track {
  height: 10px;
  border-radius: 999px;
  background: var(--soft);
  overflow: hidden;
}

.category-bar-fill {
  height: 100%;
  border-radius: 999px;
}

.category-bar-value {
  white-space: nowrap;
  font-size: 12px;
}

/* Rahastajate redaktor projekti dialoogis */
.financier-editor {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.financier-editor-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.financier-editor-row input {
  flex: 1;
}

/* Muudatuste ajalugu */
.audit-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 180px;
  overflow-y: auto;
  padding: 10px 12px;
  background: var(--soft);
  border-radius: 8px;
}

.audit-row {
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-size: 13px;
  padding-bottom: 6px;
  border-bottom: 1px dashed var(--line);
}

.audit-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.export-select {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}

.project-expense .purchase-info {
  min-width: 0;
}

@media (max-width: 720px) {
  .project-cards {
    grid-template-columns: 1fr;
  }
  .repayment-row {
    grid-template-columns: 80px minmax(0, 1fr) auto auto;
  }
  .repayment-row span:nth-child(3) {
    display: none;
  }
  .category-bar-row {
    grid-template-columns: 80px minmax(0, 1fr) auto;
  }
}

/* Projekti otsekulu märgis (kulu, mis ei kuulu ostuarvete alla) */
.direct-expense-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fef0c7;
  color: #b54708;
  vertical-align: middle;
  margin-left: 6px;
  white-space: nowrap;
}

/* ===================== Pealehe värskendus ===================== */

/* "Uus" teadaande-pill hero kohal */
.hero-announce {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 18px;
  padding: 7px 15px 7px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.92);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 700;
  backdrop-filter: blur(8px);
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.hero-announce:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 177, 92, 0.6);
  transform: translateY(-1px);
}

.hero-announce-badge {
  padding: 3px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brand-warm), var(--brand-coral));
  color: #2a1206;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.hero-announce-arrow {
  transition: transform 0.15s ease;
}

.hero-announce:hover .hero-announce-arrow {
  transform: translateX(3px);
}

/* "Uus" märgis feature-tag'i sees */
.tag-new {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 9px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brand-warm), var(--brand-coral));
  color: #2a1206;
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  vertical-align: middle;
}

/* Projekti mock: rahastajate jaotus */
.mock-project-body {
  padding: 16px 18px 18px;
  display: grid;
  gap: 14px;
}

.mock-project-total {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.mock-project-total span {
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 700;
}

.mock-project-total strong {
  font-size: 24px;
  color: var(--ink);
}

.mock-budget-ok {
  margin-left: auto;
  font-style: normal;
  font-size: 11.5px;
  font-weight: 800;
  color: var(--green);
  background: rgba(6, 118, 71, 0.1);
  padding: 4px 10px;
  border-radius: 999px;
}

.mock-split {
  display: flex;
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  gap: 3px;
}

.mock-split .seg {
  width: var(--w);
  border-radius: 4px;
}

.mock-split .seg.a,
.mock-split-legend i.a {
  background: var(--brand);
}

.mock-split .seg.b,
.mock-split-legend i.b {
  background: #2e90fa;
}

.mock-split .seg.c,
.mock-split-legend i.c {
  background: var(--brand-warm);
}

.mock-split-legend {
  display: grid;
  gap: 8px;
}

.mock-split-legend div {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
}

.mock-split-legend i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex: none;
}

.mock-split-legend span {
  color: var(--muted);
}

.mock-split-legend strong {
  margin-left: auto;
  color: var(--ink);
  font-size: 12.5px;
}

.mock-repay-chip {
  padding: 10px 13px;
  border-radius: 10px;
  background: rgba(232, 93, 69, 0.09);
  border: 1px dashed rgba(232, 93, 69, 0.35);
  color: #9a2f1c;
  font-size: 12.5px;
  font-weight: 700;
  text-align: center;
}

.mock-repay-chip strong {
  color: var(--brand-coral);
}

/* Bento kaartide lihv: värviline ülaserv hoveril + ikoonide toonid */
.bento-card {
  position: relative;
  overflow: hidden;
}

.bento-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand), var(--brand-warm), var(--brand-coral));
  opacity: 0;
  transition: opacity 0.16s ease;
}

.bento-card:hover::before {
  opacity: 1;
}

.bento-card:nth-child(3n + 2) .bento-ico {
  background: color-mix(in srgb, var(--brand-warm) 16%, white);
}

.bento-card:nth-child(3n) .bento-ico {
  background: color-mix(in srgb, #2e90fa 12%, white);
}

@media (max-width: 640px) {
  .hero-announce {
    font-size: 12.5px;
  }
}

/* iOS Safari zoomib sisestusväljale fookusel sisse, kui välja kirjasuurus on
   alla 16px. Puuteseadmetel hoiame väljad 16px — siis zoomi ei toimu üldse. */
@media (hover: none) and (pointer: coarse) {
  input,
  select,
  textarea {
    font-size: 16px;
  }
}

/* Pildivaataja: peaaegu täisekraan, et tšekk/arve oleks päriselt loetav */
#purchaseImageDialog {
  width: auto;
  max-width: calc(100vw - 24px);
}

#purchaseImageDialog .image-dialog-body {
  padding: 12px;
}

#purchaseImageDialog .image-dialog-body img {
  max-width: calc(100vw - 48px);
  max-height: 86vh;
  width: auto;
  height: auto;
}

/* ============================================================================
   AVERO REDISAIN 2026 — modernne hele & õhuline (AINULT sisselogitud rakendus)
   Skoobitud #workspace / dialog / .mobile-nav / .mobile-sheet alla, et avalik
   esileht (landing) ja arve-printmall jääksid täpselt endiseks.
   ============================================================================ */

/* ---- Inter Variable font (iselaaditud, CSP font-src 'self') ---- */
@font-face {
  font-family: "Inter";
  src: url("./fonts/InterVariable.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ---- Uued disainitokenid (ainult rakenduse skoobis) ---- */
#workspace,
dialog,
.mobile-nav,
.mobile-sheet {
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --panel: #ffffff;
  --soft: #f1f5f9;
  --brand: #4f46e5;
  --brand-dark: #4338ca;
  --brand-tint: #eef2ff;
  --brand-warm: #f59e0b;
  --brand-coral: #e11d48;
  --green: #059669;
  --green-tint: #ecfdf5;
  --red: #dc2626;
  --red-tint: #fef2f2;
  --amber: #f59e0b;
  --amber-tint: #fffbeb;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --shadow: 0 4px 12px rgba(15, 23, 42, 0.07), 0 2px 4px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05), 0 1px 3px rgba(15, 23, 42, 0.07);
  --shadow-lg: 0 24px 48px rgba(15, 23, 42, 0.16), 0 10px 20px rgba(15, 23, 42, 0.08);
  --focus-ring: 0 0 0 3px rgba(79, 70, 229, 0.22);
  letter-spacing: -0.011em;
}

/* ---- Töölaua põhi ---- */
#workspace.workspace {
  grid-template-columns: 268px minmax(0, 1fr);
  background: #f8fafc;
  color: var(--ink);
}

#workspace .sidebar {
  background: #ffffff;
  border-right: 1px solid var(--line);
  padding: 22px 16px;
  gap: 18px;
}

#workspace .sidebar .brand-block strong {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

#workspace .active-company {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 10px 12px;
}

#workspace .active-company span {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--muted);
}

#workspace .active-company select {
  border: none;
  background: transparent;
  padding: 2px 0 0;
  font-weight: 600;
  min-height: 0;
}

#workspace .nav-tabs {
  gap: 3px;
}

#workspace .nav-button {
  min-height: 42px;
  border-radius: var(--r-sm);
  padding: 0 14px;
  font-weight: 550;
  font-size: 14.5px;
  color: #334155;
  background: transparent;
  border: none;
  justify-content: flex-start;
  transition: background 0.14s ease, color 0.14s ease;
}

#workspace .nav-button:hover {
  background: var(--soft);
  color: var(--ink);
}

#workspace .nav-button.active {
  background: var(--brand-tint);
  color: var(--brand);
  font-weight: 650;
  box-shadow: none;
}

#workspace .main {
  padding: 30px clamp(20px, 3.4vw, 44px) 56px;
}

/* ---- Topbar ---- */
#workspace .topbar {
  margin-bottom: 22px;
  gap: 18px;
  align-items: flex-start;
}

#workspace .topbar h2 {
  font-size: clamp(22px, 2.6vw, 28px);
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 2px 0 4px;
}

#workspace .eyebrow {
  color: var(--brand);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

#workspace .topbar .small-text {
  color: var(--muted);
}

/* ---- Nupud (skoobitud, et landing ei muutuks) ---- */
#workspace .primary-button,
dialog .primary-button,
.mobile-sheet .primary-button {
  background: var(--brand);
  border: none;
  border-radius: 12px;
  min-height: 42px;
  padding: 0 18px;
  font-weight: 600;
  font-size: 14.5px;
  letter-spacing: -0.01em;
  color: #fff;
  box-shadow: 0 1px 2px rgba(79, 70, 229, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  transition: background 0.14s ease, transform 0.12s ease, box-shadow 0.14s ease;
}

#workspace .primary-button:hover,
dialog .primary-button:hover {
  background: var(--brand-dark);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
}

#workspace .secondary-button,
dialog .secondary-button {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  min-height: 42px;
  padding: 0 16px;
  font-weight: 550;
  font-size: 14px;
  color: #334155;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.14s ease, background 0.14s ease, box-shadow 0.14s ease;
}

#workspace .secondary-button:hover,
dialog .secondary-button:hover {
  border-color: #cbd5e1;
  background: #fbfcfe;
}

#workspace .secondary-button.active-filter,
dialog .secondary-button.active-filter {
  background: var(--brand-tint);
  border-color: rgba(79, 70, 229, 0.35);
  color: var(--brand);
}

#workspace .ghost-button,
dialog .ghost-button {
  border-radius: 12px;
  font-weight: 550;
  color: var(--muted);
}

#workspace .ghost-button:hover,
dialog .ghost-button:hover {
  color: var(--ink);
  background: var(--soft);
}

#workspace .danger-button,
dialog .danger-button {
  border-radius: 12px;
  font-weight: 550;
  background: #fff;
  border: 1px solid #fecaca;
  color: var(--red);
}

#workspace .danger-button:hover,
dialog .danger-button:hover {
  background: var(--red-tint);
  border-color: #fca5a5;
}

/* ---- Vormid ---- */
#workspace input,
#workspace select,
#workspace textarea,
dialog input,
dialog select,
dialog textarea {
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: #fff;
  padding: 11px 13px;
  font-size: 14.5px;
  color: var(--ink);
  transition: border-color 0.13s ease, box-shadow 0.13s ease;
}

#workspace input:focus,
#workspace select:focus,
#workspace textarea:focus,
dialog input:focus,
dialog select:focus,
dialog textarea:focus {
  border-color: var(--brand);
  box-shadow: var(--focus-ring);
}

#workspace label,
dialog label {
  font-size: 13px;
  font-weight: 550;
  color: #475569;
}

/* ---- KPI kaardid ---- */
#workspace .kpi-grid {
  gap: 14px;
}

#workspace .kpi-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  display: grid;
  gap: 4px;
  position: relative;
  overflow: hidden;
}

#workspace .kpi-card::after {
  content: "";
  position: absolute;
  left: 20px;
  right: auto;
  top: 0;
  width: 34px;
  height: 3px;
  border-radius: 0 0 4px 4px;
  background: var(--brand);
  opacity: 0.9;
}

#workspace .kpi-card.good::after { background: var(--green); }
#workspace .kpi-card.bad::after { background: var(--red); }

#workspace .kpi-card span {
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}

#workspace .kpi-card strong {
  font-size: clamp(20px, 2vw, 26px);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

#workspace .kpi-card.good strong { color: var(--green); }
#workspace .kpi-card.bad strong { color: var(--red); }

#workspace .kpi-card em {
  font-style: normal;
  font-size: 12.5px;
  color: var(--muted);
}

/* ---- Dashboard kaardid ---- */
#workspace .dashboard-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
  padding: 20px 22px;
}

#workspace .dashboard-card h3 {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.015em;
  margin: 0 0 4px;
}

#workspace .summary-strip {
  gap: 12px;
}

#workspace .metric {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
  padding: 14px 18px;
}

#workspace .metric span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

#workspace .metric strong {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

/* ---- Aasta-tabid: segmenteeritud kontroll ---- */
#workspace .year-tabs {
  display: inline-flex;
  gap: 4px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 16px;
}

#workspace .year-tab {
  border: none;
  background: transparent;
  border-radius: 9px;
  min-height: 34px;
  padding: 0 16px;
  font-weight: 600;
  font-size: 13.5px;
  color: var(--muted);
  box-shadow: none;
  transition: background 0.14s ease, color 0.14s ease, box-shadow 0.14s ease;
}

#workspace .year-tab:hover {
  color: var(--ink);
}

#workspace .year-tab.active {
  background: #fff;
  color: var(--brand);
  box-shadow: var(--shadow-sm);
}

/* ---- Kuu-accordionid: "nupp kuu nimega" ---- */
#workspace .year-folder,
#workspace .month-folder {
  border: none;
  background: transparent;
  padding: 0;
}

#workspace .month-folder {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
  margin-bottom: 12px;
  overflow: hidden;
  transition: box-shadow 0.15s ease;
}

#workspace .month-folder[open] {
  box-shadow: var(--shadow);
}

#workspace .month-folder summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 18px;
  cursor: pointer;
  list-style: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.13s ease;
}

#workspace .month-folder summary::-webkit-details-marker { display: none; }

#workspace .month-folder summary:hover {
  background: #fbfcfe;
}

#workspace .month-folder[open] summary {
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
}

#workspace .month-folder .folder-name {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.015em;
  color: var(--ink);
  text-transform: capitalize;
  display: flex;
  align-items: center;
  gap: 10px;
}

#workspace .month-folder .folder-name::before {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--brand);
  border-bottom: 2px solid var(--brand);
  transform: rotate(-45deg);
  transition: transform 0.18s ease;
  margin-right: 2px;
  flex: none;
}

#workspace .month-folder[open] .folder-name::before {
  transform: rotate(45deg);
}

#workspace .folder-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  background: var(--soft);
  border-radius: 999px;
  padding: 5px 12px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

#workspace .month-folder .purchase-list-inner {
  padding: 10px 12px 12px;
  display: grid;
  gap: 8px;
}

/* Aasta-kaust (kui year-tabid pole aktiivsed, nt otsingul) */
#workspace .year-folder {
  margin-bottom: 14px;
}

#workspace .year-folder > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 4px;
  cursor: pointer;
  list-style: none;
  font-weight: 700;
}

#workspace .year-folder > summary::-webkit-details-marker { display: none; }

#workspace .year-folder-inner {
  display: grid;
  gap: 0;
}

/* ---- Dokumendi/arve kaardid ---- */
#workspace .archive-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 14px 16px;
  box-shadow: none;
  transition: border-color 0.14s ease, box-shadow 0.14s ease, transform 0.12s ease;
}

#workspace .purchase-list-inner .archive-card,
#workspace .purchase-list-inner .purchase-card {
  border-color: #eaeef4;
  border-radius: var(--r-sm);
  box-shadow: none;
}

@media (hover: hover) and (pointer: fine) {
  #workspace .archive-card:hover,
  #workspace .purchase-card.clickable:hover {
    border-color: rgba(79, 70, 229, 0.4);
    box-shadow: var(--shadow);
    transform: translateY(-1px);
  }
}

#workspace .archive-card h3 {
  font-size: 14.5px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

#workspace .archive-card .amount {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

#workspace .purchase-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 12px 16px;
}

#workspace .purchase-thumb {
  border-radius: 8px;
  overflow: hidden;
  background: var(--soft);
}

#workspace .purchase-amounts strong {
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

/* ---- Staatuse badge'id: pehmed tint-pillid ---- */
#workspace .status-badge,
dialog .status-badge {
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 650;
  padding: 4px 11px;
  letter-spacing: 0.01em;
  border: none;
}

#workspace .status-badge.status-paid { background: var(--green-tint); color: var(--green); }
#workspace .status-badge.status-sent { background: #eff6ff; color: #2563eb; }
#workspace .status-badge.status-overdue { background: var(--amber-tint); color: #b45309; }
#workspace .status-badge.status-draft { background: var(--soft); color: var(--muted); }
#workspace .status-badge.status-cancelled { background: var(--red-tint); color: var(--red); }
#workspace .status-badge.active { background: var(--green-tint); color: var(--green); }
#workspace .status-badge.done { background: var(--brand-tint); color: var(--brand); }
#workspace .status-badge.archived { background: var(--soft); color: var(--muted); }

#workspace .direct-expense-badge {
  background: var(--brand-tint);
  color: var(--brand);
}

/* ---- Graafikud ---- */
#workspace .bar-chart {
  height: 200px;
  gap: 10px;
  padding-top: 8px;
}

#workspace .bar-stack {
  border-radius: 8px 8px 4px 4px;
  overflow: hidden;
  background: var(--soft);
}

#workspace .bar-paid { background: var(--brand); }
#workspace .bar-open { background: #c7d2fe; }

#workspace .bar-label {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
}

#workspace .bar-value {
  font-size: 11px;
  font-weight: 650;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

#workspace .donut {
  width: 152px;
  height: 152px;
}

#workspace .donut-hole {
  width: 104px;
  height: 104px;
  background: #fff;
  box-shadow: inset 0 1px 4px rgba(15, 23, 42, 0.06);
}

#workspace .donut-hole strong {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

#workspace .legend-row i {
  border-radius: 4px;
  width: 10px;
  height: 10px;
}

#workspace .legend-row {
  font-size: 13px;
}

#workspace .legend-row strong {
  font-variant-numeric: tabular-nums;
  font-weight: 650;
}

#workspace .category-bar-track {
  height: 8px;
  background: var(--soft);
}

#workspace .category-bar-fill {
  border-radius: 999px;
}

#workspace .financier-table-head {
  font-size: 10.5px;
  letter-spacing: 0.08em;
  border-bottom: 1px solid var(--line);
}

#workspace .financier-table-row {
  border-bottom: 1px solid #eef2f6;
  font-size: 14px;
}

#workspace .financier-table-row:last-child {
  border-bottom: none;
}

/* ---- Projektikaardid ---- */
#workspace .project-card {
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  padding: 18px 20px;
  transition: border-color 0.14s ease, box-shadow 0.15s ease, transform 0.12s ease;
}

@media (hover: hover) and (pointer: fine) {
  #workspace .project-card:hover {
    border-color: rgba(79, 70, 229, 0.4);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
  }
}

#workspace .project-card-total strong {
  color: var(--brand);
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
}

#workspace .budget-bar {
  height: 7px;
  background: var(--soft);
}

#workspace .budget-bar-fill {
  background: var(--brand);
}

#workspace .budget-bar.over .budget-bar-fill {
  background: var(--red);
}

/* ---- Tag-chipid ---- */
#workspace .tag-chip,
dialog .tag-chip {
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  font-weight: 550;
  transition: all 0.13s ease;
}

#workspace .tag-chip.active,
dialog .tag-chip.active {
  background: var(--brand-tint);
  border-color: rgba(79, 70, 229, 0.4);
  color: var(--brand);
}

/* ---- Purchase tabs (Kõik / Vajab tähelepanu) ---- */
#workspace .purchase-tab {
  border-radius: 999px;
  font-weight: 600;
}

#workspace .purchase-tab.active {
  background: var(--brand-tint);
  color: var(--brand);
  border-color: rgba(79, 70, 229, 0.35);
}

/* ---- Dialoogid: desktop = pehme modaal ---- */
dialog {
  border: none;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
}

dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

dialog .dialog-form {
  padding: 24px;
}

dialog .section-heading h3 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

dialog .dialog-actions {
  bottom: -24px;
  margin: 8px -24px -24px;
  padding: 14px 24px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid var(--line);
}

/* ---- Mobiilikiht ---- */
@media (max-width: 980px) {
  /* Mobiilis üks veerg — see ID-klass reegel peab lööma üle desktopi 2-veeru reegli */
  #workspace.workspace {
    grid-template-columns: 1fr;
  }

  #workspace .sidebar {
    flex-direction: row;
    align-items: center;
    gap: 12px;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--line);
    padding: 10px 16px;
    position: sticky;
    top: 0;
    z-index: 30;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }

  #workspace .sidebar .active-company {
    flex: 1;
    min-width: 0;
    padding: 8px 12px;
  }

  #workspace .main {
    padding: 18px 16px calc(96px + env(safe-area-inset-bottom));
  }

  #workspace .topbar h2 {
    font-size: 21px;
  }
}

/* Bottom-nav: modernne, safe-area'ga */
.mobile-nav {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.06);
}

.mobile-nav-item,
.mobile-nav .nav-button {
  border-radius: 12px;
  color: var(--muted);
  font-weight: 550;
  background: transparent;
  border: none;
  transition: color 0.14s ease, background 0.14s ease;
}

.mobile-nav-item svg {
  stroke: currentColor;
}

.mobile-nav .nav-button.active,
.mobile-nav-item.active {
  color: var(--brand);
  background: var(--brand-tint);
}

.mobile-sheet-panel {
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  padding-bottom: calc(14px + env(safe-area-inset-bottom));
  box-shadow: var(--shadow-lg);
}

.mobile-sheet-item {
  border-radius: var(--r-sm);
  font-weight: 550;
}

/* Dialoogid mobiilis: bottom-sheet */
@media (max-width: 680px) {
  dialog {
    position: fixed;
    inset: auto 0 0 0;
    width: 100%;
    max-width: 100%;
    margin: 0;
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    max-height: 93dvh;
    animation: avero-sheet-up 0.26s cubic-bezier(0.2, 0.8, 0.25, 1);
  }

  @keyframes avero-sheet-up {
    from { transform: translateY(24%); opacity: 0.4; }
    to { transform: translateY(0); opacity: 1; }
  }

  dialog .dialog-form {
    max-height: calc(93dvh - 10px);
    padding: 10px 18px 18px;
  }

  /* Sheet-käepide */
  dialog .dialog-form::before {
    content: "";
    display: block;
    width: 40px;
    height: 4px;
    border-radius: 999px;
    background: #cbd5e1;
    margin: 4px auto 10px;
  }

  dialog .dialog-actions {
    bottom: -18px;
    margin: 8px -18px calc(-18px);
    padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
    flex-direction: row;
    flex-wrap: wrap;
  }

  dialog .dialog-actions .primary-button {
    flex: 1 1 100%;
    order: -1;
    min-height: 48px;
  }

  dialog .dialog-actions .secondary-button,
  dialog .dialog-actions .ghost-button,
  dialog .dialog-actions .danger-button {
    flex: 1 1 auto;
    width: auto;
  }

  /* Pildivaataja jääb keskele täisekraanina, mitte sheet */
  #purchaseImageDialog {
    inset: 0;
    margin: auto;
    border-radius: var(--r-md);
    max-height: 96dvh;
    animation: none;
    width: auto;
    max-width: calc(100vw - 16px);
  }

  /* Kaardid mobiilis kompaktsemad */
  #workspace .archive-card,
  #workspace .purchase-card {
    padding: 12px 14px;
  }

  #workspace .month-folder summary {
    padding: 13px 14px;
  }

  #workspace .kpi-card {
    padding: 14px 16px;
  }

  #workspace .kpi-card strong {
    font-size: 19px;
  }

  #workspace .dashboard-card {
    padding: 16px;
  }

  #workspace .year-tabs {
    width: 100%;
    overflow-x: auto;
  }
}

/* ---- Peened üleminekud ja kerimisribad ---- */
#workspace .view.active {
  animation: avero-fade-in 0.22s ease;
}

@keyframes avero-fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  #workspace .view.active,
  dialog {
    animation: none !important;
  }
}

#workspace ::-webkit-scrollbar,
dialog ::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

#workspace ::-webkit-scrollbar-thumb,
dialog ::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
}

/* Tulpgraafik toetagu suvalist tulpade arvu (nt 12 kuud) */
#workspace .bar-chart {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  grid-template-columns: none;
}

#workspace .project-last-expense {
  color: var(--muted);
  margin: 0;
}

/* iOS Safari zoomib sisestusväljale fookusel sisse, kui kiri < 16px. Redisaini
   14.5px reeglid lõid varasema 16px puutereegli üle — taastame selle KÕRGEMA
   spetsiifikaga, et puuteseadmetel (telefon/tahvel) zoomi ei tekiks. */
@media (hover: none) and (pointer: coarse) {
  #workspace input,
  #workspace select,
  #workspace textarea,
  dialog input,
  dialog select,
  dialog textarea {
    font-size: 16px;
  }
}

/* Kindlus, et dialoog ei tekita horisontaalset ületäitumist mobiilis */
@media (max-width: 680px) {
  dialog {
    box-sizing: border-box;
    overflow-x: hidden;
  }
  dialog .dialog-form {
    max-width: 100%;
  }
}
