:root {
  --app-bg: #f4f6f8;
  --app-surface: #ffffff;
  --app-surface-2: #f8fafc;
  --app-border: #dde3ea;
  --app-text: #172033;
  --app-muted: #697586;
  --app-primary: #176b5b;
  --app-primary-dark: #105144;
  --app-primary-soft: #e6f3ef;
  --app-danger-soft: #fdecec;
  --app-radius: 8px;
  --app-shadow: 0 16px 34px rgba(23, 32, 51, 0.08);
}

html { min-height: 100%; }

body {
  background: var(--app-bg);
  color: var(--app-text);
  font-size: 14px;
}

a { color: var(--app-primary); }

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

.app-sidebar {
  background: #172033;
  color: #dbe3ee;
  display: flex;
  flex: 0 0 264px;
  flex-direction: column;
  height: 100vh;
  padding: 20px 16px;
  position: sticky;
  top: 0;
}

.app-brand {
  align-items: center;
  color: #fff;
  display: flex;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 24px;
  text-decoration: none;
}

.brand-mark {
  align-items: center;
  background: var(--app-primary);
  border-radius: 8px;
  display: inline-flex;
  height: 36px;
  justify-content: center;
  width: 36px;
}

.app-nav {
  display: grid;
  gap: 5px;
}

.app-nav-link {
  align-items: center;
  border-radius: 8px;
  color: #b9c5d4;
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  text-decoration: none;
}

.app-nav-link:hover,
.app-nav-link.active {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.app-sidebar-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  margin-top: auto;
  padding-top: 16px;
}

.user-chip {
  align-items: center;
  display: flex;
  gap: 10px;
  min-width: 0;
}

.user-avatar {
  align-items: center;
  background: #f0b45a;
  border-radius: 50%;
  color: #172033;
  display: inline-flex;
  font-weight: 700;
  height: 34px;
  justify-content: center;
  width: 34px;
}

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

.app-topbar {
  align-items: center;
  background: rgba(244, 246, 248, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--app-border);
  display: flex;
  justify-content: space-between;
  min-height: 64px;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.app-content {
  margin: 0 auto;
  max-width: 1180px;
  padding: 28px;
}

.page-header {
  align-items: flex-start;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 22px;
}

.page-title {
  font-size: 26px;
  font-weight: 750;
  letter-spacing: 0;
  line-height: 1.2;
  margin: 0 0 5px;
}

.page-kicker,
.muted-label {
  color: var(--app-muted);
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.panel {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  box-shadow: 0 1px 2px rgba(23, 32, 51, 0.04);
}

.panel-header {
  align-items: center;
  border-bottom: 1px solid var(--app-border);
  display: flex;
  justify-content: space-between;
  min-height: 48px;
  padding: 12px 16px;
}

.panel-title {
  font-size: 14px;
  font-weight: 700;
  margin: 0;
}

.panel-body {
  padding: 18px;
}

.metric-card {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  box-shadow: 0 1px 2px rgba(23, 32, 51, 0.04);
  min-height: 104px;
  padding: 16px;
}

.metric-icon {
  align-items: center;
  background: var(--app-primary-soft);
  border-radius: 8px;
  color: var(--app-primary);
  display: inline-flex;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.metric-card .metric-icon {
  margin-bottom: 12px;
}

.metric-value {
  font-size: 24px;
  font-weight: 750;
  line-height: 1.15;
}

.table {
  --bs-table-color: var(--app-text);
  margin-bottom: 0;
}

.table thead th {
  background: var(--app-surface-2);
  border-bottom: 1px solid var(--app-border);
  color: var(--app-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding-bottom: 11px;
  padding-top: 11px;
  text-transform: uppercase;
  white-space: nowrap;
}

.table tbody td {
  border-color: #edf1f5;
  padding-bottom: 13px;
  padding-top: 13px;
}

.table-hover tbody tr:hover {
  --bs-table-hover-bg: #f8fbfa;
}

.badge {
  border-radius: 999px;
  font-weight: 650;
  padding: 0.42rem 0.62rem;
}

.status-draft { background: #eef2f6; color: #4a5568; }
.status-validated { background: var(--app-primary-soft); color: var(--app-primary-dark); }
.status-sent { background: #e7f1ff; color: #245a96; }
.status-paid { background: #e7f8ed; color: #17603b; }
.status-cancelled { background: var(--app-danger-soft); color: #a73333; }

.btn {
  align-items: center;
  border-radius: 8px;
  display: inline-flex;
  font-weight: 650;
  gap: 7px;
}

.btn-primary,
.btn-success {
  background: var(--app-primary);
  border-color: var(--app-primary);
}

.btn-primary:hover,
.btn-success:hover {
  background: var(--app-primary-dark);
  border-color: var(--app-primary-dark);
}

.btn-outline-primary {
  border-color: var(--app-primary);
  color: var(--app-primary);
}

.btn-outline-primary:hover {
  background: var(--app-primary);
  border-color: var(--app-primary);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--app-muted);
}

.btn-ghost:hover {
  background: #eef2f6;
  color: var(--app-text);
}

.icon {
  height: 16px;
  stroke-width: 2.2;
  width: 16px;
}

.form-control,
.form-select,
.app-form input:not([type="checkbox"]):not([type="hidden"]),
.app-form textarea,
.app-form select {
  border-color: #cfd7e2;
  border-radius: 8px;
  color: var(--app-text);
  min-height: 39px;
}

.app-form input:not([type="checkbox"]):not([type="hidden"]),
.app-form textarea,
.app-form select {
  display: block;
  width: 100%;
}

.form-control:focus,
.form-select:focus,
.app-form input:focus,
.app-form textarea:focus,
.app-form select:focus {
  border-color: var(--app-primary);
  box-shadow: 0 0 0 0.2rem rgba(23, 107, 91, 0.12);
}

.app-form label {
  color: #344054;
  font-size: 13px;
  font-weight: 650;
  margin-bottom: 6px;
}

.app-form p {
  margin-bottom: 14px;
}

.auth-layout {
  align-items: center;
  display: grid;
  min-height: calc(100vh - 56px);
  padding: 34px 0;
}

.auth-card {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow);
  margin: 0 auto;
  max-width: 420px;
  padding: 28px;
  width: 100%;
}

.auth-card h1 {
  font-size: 26px;
  font-weight: 750;
  margin-bottom: 6px;
}

.subscription-banner {
  align-items: center;
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(23, 32, 51, 0.12);
  color: #fff;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 20px;
  padding: 14px 16px;
}

.subscription-banner-trial {
  background: #9a5b00;
}

.subscription-banner-warning {
  background: #b54708;
}

.subscription-banner-danger {
  background: #b42318;
}

.subscription-banner-title {
  font-weight: 750;
  margin-bottom: 2px;
}

.subscription-banner-message {
  opacity: 0.95;
}

.public-body {
  background: #ffffff;
  color: var(--app-text);
}

.public-nav {
  align-items: center;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid rgba(221, 227, 234, 0.92);
  display: flex;
  justify-content: space-between;
  left: 0;
  min-height: 72px;
  padding: 0 40px;
  position: fixed;
  right: 0;
  top: 0;
  z-index: 20;
}

.public-brand {
  align-items: center;
  color: var(--app-text);
  display: inline-flex;
  gap: 10px;
  font-size: 18px;
  font-weight: 750;
  text-decoration: none;
}

.public-nav-actions {
  align-items: center;
  display: flex;
  gap: 18px;
}

.public-nav-link {
  color: #475467;
  font-weight: 650;
  text-decoration: none;
}

.public-nav-link:hover {
  color: var(--app-primary);
}

.landing-hero {
  align-items: center;
  display: flex;
  min-height: 88vh;
  overflow: hidden;
  padding: 116px 40px 72px;
  position: relative;
}

.landing-hero-bg {
  height: 100%;
  inset: 0;
  object-fit: cover;
  object-position: center;
  position: absolute;
  width: 100%;
}

.landing-hero-overlay {
  background: rgba(13, 24, 38, 0.72);
  inset: 0;
  position: absolute;
}

.landing-hero-content {
  color: #ffffff;
  max-width: 760px;
  position: relative;
  z-index: 1;
}

.landing-eyebrow {
  color: #f0b45a;
  font-size: 13px;
  font-weight: 760;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
  text-transform: uppercase;
}

.landing-hero h1 {
  font-size: 64px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.02;
  margin: 0 0 20px;
}

.landing-hero-copy {
  color: rgba(255, 255, 255, 0.88);
  font-size: 20px;
  line-height: 1.55;
  margin-bottom: 28px;
  max-width: 720px;
}

.landing-actions,
.landing-proof {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.landing-proof {
  color: rgba(255, 255, 255, 0.86);
  margin-top: 26px;
}

.landing-proof span,
.integration-list span {
  align-items: center;
  display: inline-flex;
  gap: 8px;
}

.landing-section {
  margin: 0 auto;
  max-width: 1180px;
  padding: 76px 28px;
}

.landing-section-head {
  margin-bottom: 26px;
  max-width: 720px;
}

.landing-section h2,
.landing-band h2 {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.16;
  margin-bottom: 12px;
}

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

.feature-card {
  background: #ffffff;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(23, 32, 51, 0.04);
  min-height: 210px;
  padding: 22px;
}

.feature-grid .feature-card:nth-child(n + 7) {
  min-height: 190px;
}

.feature-icon {
  color: var(--app-primary);
  height: 28px;
  margin-bottom: 18px;
  width: 28px;
}

.feature-card h3 {
  font-size: 18px;
  font-weight: 760;
  margin-bottom: 10px;
}

.feature-card p,
.landing-band p,
.pricing-copy p {
  color: var(--app-muted);
  font-size: 15px;
  line-height: 1.62;
  margin-bottom: 0;
}

.landing-band {
  align-items: center;
  background: #172033;
  color: #ffffff;
  display: grid;
  gap: 32px;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  padding: 72px max(28px, calc((100vw - 1180px) / 2 + 28px));
}

.landing-band p {
  color: rgba(255, 255, 255, 0.76);
  max-width: 720px;
}

.integration-list {
  display: grid;
  gap: 12px;
}

.integration-list span {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  color: #ffffff;
  font-weight: 700;
  padding: 14px 16px;
}

.landing-pricing {
  display: block;
}

.pricing-card {
  background: #ffffff;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  box-shadow: var(--app-shadow);
  padding: 26px;
}

.pricing-price {
  font-size: 40px;
  font-weight: 820;
  line-height: 1;
  margin-bottom: 6px;
}

.pricing-yearly {
  background: #ecfdf3;
  border: 1px solid #abefc6;
  border-radius: 8px;
  color: #067647;
  display: grid;
  gap: 2px;
  margin-top: 16px;
  padding: 12px 14px;
}

.pricing-yearly span {
  color: #344054;
  font-size: 13px;
}

.pricing-card ul {
  color: #344054;
  display: grid;
  gap: 10px;
  margin: 22px 0;
  padding-left: 18px;
}

.landing-pricing .pricing-copy {
  max-width: 860px;
}

.public-pricing-plans {
  margin-top: 34px;
}

.public-pricing-plans .subscription-plan-card {
  min-height: 840px;
}

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

.subscription-plan-card {
  background: #ffffff;
  border: 1px solid #e6e8ec;
  border-radius: 0;
  box-shadow: 0 14px 30px rgba(23, 32, 51, 0.07);
  display: flex;
  flex-direction: column;
  min-height: 760px;
  overflow: hidden;
  position: relative;
}

.plan-ribbon {
  background: #050505;
  color: #ffffff;
  font-size: 13px;
  font-weight: 850;
  left: 0;
  letter-spacing: 0;
  line-height: 1;
  padding: 11px 16px;
  position: absolute;
  top: 0;
  z-index: 2;
}

.plan-hero {
  background: #ffffff;
  min-height: 260px;
  padding: 62px 32px 34px;
  position: relative;
}

.subscription-plan-card.featured .plan-hero {
  background: #1279c9;
  color: #ffffff;
}

.plan-discount-bubble {
  align-items: center;
  background: #ffffff;
  border: 4px solid #050505;
  border-radius: 999px;
  color: #050505;
  display: inline-flex;
  font-size: 24px;
  font-weight: 900;
  height: 82px;
  justify-content: center;
  line-height: 1;
  position: absolute;
  right: 24px;
  top: 18px;
  transform: rotate(-5deg);
  width: 82px;
}

.plan-kicker {
  color: inherit;
  font-size: 13px;
  font-weight: 820;
  margin-bottom: 10px;
  opacity: 0.78;
  text-transform: uppercase;
}

.plan-hero h2 {
  color: inherit;
  font-size: 42px;
  font-weight: 900;
  line-height: 1.08;
  margin: 0 0 30px;
  max-width: 390px;
}

.plan-price {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.plan-price span {
  color: #eb0050;
  font-size: 48px;
  font-weight: 900;
  line-height: 1;
}

.subscription-plan-card.featured .plan-price span,
.subscription-plan-card.featured .plan-price small {
  color: #ffffff;
}

.plan-price small {
  color: #050505;
  font-size: 23px;
  font-weight: 900;
}

.plan-strike {
  color: rgba(255, 255, 255, 0.86);
  font-size: 15px;
  font-weight: 800;
  margin-top: 12px;
}

.plan-tax-summary {
  color: #344054;
  font-size: 14px;
  font-weight: 800;
  margin-top: 14px;
}

.subscription-plan-card.featured .plan-tax-summary {
  color: rgba(255, 255, 255, 0.9);
}

.plan-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 28px 32px 30px;
}

.plan-benefit {
  align-items: flex-start;
  border-top: 1px solid #d7dbe2;
  display: grid;
  gap: 18px;
  grid-template-columns: 38px minmax(0, 1fr);
  padding: 26px 0;
}

.plan-benefit:first-child {
  border-top: 0;
  padding-top: 4px;
}

.plan-icon {
  color: #050505;
  height: 30px;
  margin-top: 2px;
  stroke-width: 2.4;
  width: 30px;
}

.plan-benefit strong {
  color: #050505;
  display: block;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.25;
  margin-bottom: 3px;
}

.plan-benefit span {
  color: #172033;
  display: block;
  font-size: 16px;
  font-weight: 650;
  line-height: 1.45;
}

.plan-note {
  background: #fbf6f2;
  border-radius: 8px;
  color: #172033;
  display: grid;
  gap: 4px;
  margin: 8px 0 28px;
  padding: 18px 20px;
  text-align: center;
}

.plan-note strong {
  color: #eb0050;
  font-size: 18px;
  font-weight: 900;
}

.plan-note span {
  font-size: 14px;
  font-weight: 650;
}

.plan-actions {
  display: grid;
  gap: 18px;
  margin-top: auto;
}

.plan-select-button {
  align-items: center;
  background: #eb0050;
  border: 0;
  border-radius: 4px;
  color: #ffffff;
  display: inline-flex;
  font-size: 18px;
  font-weight: 900;
  justify-content: center;
  min-height: 58px;
  padding: 14px 18px;
  width: 100%;
}

.plan-select-button,
.plan-select-button:hover {
  text-decoration: none;
}

.plan-select-button:hover {
  background: #c90043;
}

.plan-detail-button {
  align-items: center;
  background: transparent;
  border: 0;
  color: #050505;
  display: inline-flex;
  font-size: 16px;
  font-weight: 900;
  gap: 8px;
  justify-content: center;
  padding: 4px 8px;
  width: 100%;
}

.plan-detail-button,
.plan-detail-button:hover {
  text-decoration: none;
}

.plan-detail-button .icon {
  color: #eb0050;
  height: 20px;
  width: 20px;
}

.subscription-payment-note,
.subscription-status-card {
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  display: flex;
  gap: 12px;
  margin-top: 18px;
  padding: 16px 18px;
}

.subscription-status-card {
  align-items: stretch;
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.subscription-status-card div {
  display: grid;
  gap: 4px;
}

.subscription-status-card strong {
  color: var(--app-text);
  font-size: 15px;
}

.public-footer {
  align-items: center;
  border-top: 1px solid var(--app-border);
  color: var(--app-muted);
  display: flex;
  justify-content: space-between;
  margin: 0 auto;
  max-width: 1180px;
  padding: 24px 28px;
}

.guide-article {
  background: #ffffff;
}

.guide-hero {
  margin: 0 auto;
  max-width: 980px;
  padding: 136px 28px 64px;
}

.guide-hero h1 {
  color: #101828;
  font-size: 54px;
  font-weight: 820;
  letter-spacing: 0;
  line-height: 1.05;
  margin-bottom: 20px;
}

.guide-hero p {
  color: var(--app-muted);
  font-size: 19px;
  line-height: 1.62;
  max-width: 820px;
}

.guide-note,
.guide-section {
  margin: 0 auto;
  max-width: 980px;
  padding: 44px 28px;
}

.guide-note {
  align-items: flex-start;
  background: #fff8ed;
  border: 1px solid #ffd9a6;
  border-radius: 8px;
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
}

.guide-note h2,
.guide-section h2 {
  color: #101828;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.18;
  margin-bottom: 12px;
}

.guide-note p,
.guide-section p {
  color: var(--app-muted);
  font-size: 16px;
  line-height: 1.72;
}

.guide-checklist {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 22px;
}

.guide-checklist div {
  border: 1px solid var(--app-border);
  border-radius: 8px;
  padding: 20px;
}

.guide-checklist h3 {
  color: #101828;
  font-size: 17px;
  font-weight: 760;
  margin-bottom: 8px;
}

.guide-checklist p {
  font-size: 15px;
  margin-bottom: 0;
}

.guide-cta {
  margin-top: 36px;
}

.backoffice-shell {
  display: grid;
  gap: 18px;
}

.backoffice-tabs,
.backoffice-actions,
.backoffice-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.backoffice-filter {
  align-items: end;
}

.backoffice-filter p {
  flex: 1 1 220px;
}

.audit-row {
  border-bottom: 1px solid #edf1f5;
  padding: 10px 0;
}

.audit-row:first-child {
  padding-top: 0;
}

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

@media (max-width: 900px) {
  .app-shell { display: block; }

  .app-sidebar {
    height: auto;
    padding: 12px 16px;
    position: static;
  }

  .app-brand {
    margin-bottom: 12px;
  }

  .app-nav {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .app-nav-link {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .app-sidebar-footer {
    display: none;
  }

  .app-topbar {
    padding: 0 16px;
  }

  .app-content {
    padding: 20px 16px;
  }

  .page-header {
    display: grid;
  }

  .page-actions {
    justify-content: flex-start;
  }

  .subscription-banner {
    align-items: flex-start;
    display: grid;
  }

  .public-nav {
    align-items: flex-start;
    display: grid;
    gap: 12px;
    padding: 14px 16px;
    position: static;
  }

  .public-nav-actions {
    flex-wrap: wrap;
    gap: 10px;
  }

  .public-nav-link {
    display: none;
  }

  .landing-hero {
    min-height: 84vh;
    padding: 46px 18px 48px;
  }

  .landing-hero h1 {
    font-size: 42px;
  }

  .landing-hero-copy {
    font-size: 17px;
  }

  .landing-proof {
    display: grid;
  }

  .feature-grid,
  .landing-band,
  .landing-pricing,
  .subscription-plan-grid,
  .subscription-status-card {
    grid-template-columns: 1fr;
  }

  .subscription-plan-card {
    min-height: auto;
  }

  .plan-hero {
    min-height: 230px;
    padding: 58px 22px 28px;
  }

  .plan-hero h2 {
    font-size: 34px;
    max-width: 270px;
  }

  .plan-price span {
    font-size: 38px;
  }

  .plan-price small {
    font-size: 20px;
  }

  .plan-discount-bubble {
    height: 68px;
    right: 14px;
    top: 18px;
    width: 68px;
  }

  .plan-body {
    padding: 24px 22px 26px;
  }

  .plan-benefit {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .landing-section,
  .landing-band {
    padding: 52px 18px;
  }

  .landing-section h2,
  .landing-band h2 {
    font-size: 28px;
  }

  .guide-hero {
    padding: 52px 18px 34px;
  }

  .guide-hero h1 {
    font-size: 38px;
  }

  .guide-note,
  .guide-section {
    padding: 34px 18px;
  }

  .guide-note,
  .guide-checklist {
    grid-template-columns: 1fr;
  }

  .guide-note {
    display: grid;
  }

  .pricing-card {
    width: 100%;
  }

  .public-footer {
    display: grid;
    gap: 8px;
    padding: 22px 18px;
  }
}
