* {
  box-sizing: border-box;
}

:root {
  --bg: #ffffff;
  --bg-muted: #f5f6f8;
  --bg-subtle: #eef2f6;
  --text: #1a1a1a;
  --text-secondary: #444444;
  --text-muted: #6b7280;
  --border: #e2e5ea;
  --border-strong: #cfd6df;
  --accent: #1e5a95;
  --accent-hover: #174a7a;
  --accent-active: #2d74b8;
  --accent-soft: #e8f1f8;
  --accent-on-accent: #ffffff;
  --card: #ffffff;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 14px rgba(15, 23, 42, 0.08);
  --radius: 10px;
  --radius-sm: 8px;

  /* Top bar — light icy blue + slate links (Razorpay-style) */
  --topbar-bg: #e8f2fb;
  --topbar-border: #c5d9e8;
  --topbar-brand: #0f2744;
  --topbar-link: #4a5568;
  --topbar-link-hover: #1e293b;
  --topbar-link-hover-bg: rgba(255, 255, 255, 0.65);
  --topbar-muted: #64748b;
}

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Tahoma, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

a {
  color: var(--accent);
  text-decoration-color: rgba(30, 90, 149, 0.35);
}

a:hover {
  color: var(--accent-hover);
  text-decoration-color: var(--accent-hover);
}

.wrap {
  width: min(1320px, 96vw);
  margin: 0 auto;
}

.topbar {
  border-bottom: 1px solid var(--topbar-border);
  background: var(--topbar-bg);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset;
}

.topbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  min-height: 52px;
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: var(--topbar-brand);
  font-weight: 700;
  font-size: 1.06rem;
  letter-spacing: -0.02em;
}

.brand-logo {
  display: block;
  height: 75px;
  width: auto;
  max-width: min(220px, 48vw);
  object-fit: contain;
}

.brand:hover {
  color: var(--accent);
}

.nav {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-wrap: wrap;
}

.nav a {
  text-decoration: none;
  color: var(--topbar-link);
  font-weight: 500;
  font-size: 0.9375rem;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  transition: background 0.14s ease, color 0.14s ease;
}

.nav a:hover {
  color: var(--topbar-link-hover);
  background: var(--topbar-link-hover-bg);
}

.nav-user {
  color: var(--topbar-muted);
  font-size: 0.75rem;
  line-height: 1.2;
  padding: 0 6px;
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-account-block {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
}

.nav-account-block > a {
  padding-bottom: 2px;
}

.content {
  padding: 28px 0 48px;
}

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.auth-card {
  max-width: 460px;
  margin-left: auto;
  margin-right: auto;
}

.thank-you-card {
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

.thank-you-card h1 {
  margin-bottom: 8px;
}

.thank-you-card h2 {
  margin-top: 24px;
  margin-bottom: 10px;
  font-size: 1.15rem;
}

.thank-you-details {
  margin: 0;
  padding-left: 1.2rem;
  line-height: 1.7;
}

.thank-you-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 8px;
}

.form {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
}

input,
select,
textarea,
button {
  font: inherit;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--text);
  padding: 10px 12px;
}

input:focus,
select:focus,
button:focus-visible,
textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

button {
  cursor: pointer;
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-on-accent);
  font-weight: 600;
}

button:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.flash {
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 14px;
  border: 1px solid transparent;
}

.flash-success {
  background: #ecfdf3;
  border-color: #86efac;
  color: #14532d;
}

.flash-error {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #7f1d1d;
}

.flash-warn {
  background: #fffbeb;
  border-color: #fcd34d;
  color: #78350f;
}

.flash-warn .flash-warn-line {
  margin: 8px 0 0;
}

.muted {
  color: var(--text-muted);
}

.actions {
  margin-top: 12px;
}

.btn {
  display: inline-block;
  text-decoration: none;
  border-radius: var(--radius-sm);
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-on-accent);
  padding: 10px 16px;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.btn:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--accent-on-accent);
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  border-bottom: 1px solid var(--border);
  text-align: left;
  padding: 10px 8px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

th {
  color: var(--text);
  font-weight: 600;
  background: var(--bg-muted);
}

.promo-reseller-name {
  display: block;
  margin-top: 1px;
  font-size: 0.72rem;
  line-height: 1.05;
  color: var(--text-muted);
  white-space: nowrap;
}

code {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 7px;
  font-size: 0.88em;
  color: var(--text-secondary);
}

.footer {
  border-top: 1px solid var(--border);
  padding: 20px 0 32px;
  font-size: 0.85rem;
  color: var(--text-muted);
  background: var(--bg-muted);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px 32px;
}

.footer-main {
  flex: 1 1 280px;
  min-width: 0;
}

.footer-legal {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0;
  flex: 0 0 auto;
  padding-right: 76px;
  text-align: right;
  line-height: 1.45;
}

.footer-legal a {
  white-space: nowrap;
}

.footer-legal a + a::before {
  content: '|';
  margin: 0 10px;
  color: var(--text-muted);
  font-weight: 400;
  pointer-events: none;
}

@media (max-width: 720px) {
  .footer-legal {
    justify-content: flex-start;
    text-align: left;
    padding-right: 0;
    width: 100%;
  }
}

.legal-page-card h1 {
  margin-top: 0;
}

.legal-page-prose h2,
.legal-page-prose h3,
.legal-page-prose h4 {
  margin: 20px 0 10px;
  color: var(--text);
  line-height: 1.35;
}

.legal-page-prose h2 {
  font-size: 1.35rem;
}

.legal-page-prose h3 {
  font-size: 1.1rem;
}

.footer a {
  font-weight: 500;
}

.footer p {
  margin: 6px 0;
}

.hero {
  padding: 8px 0 12px;
}

.home-hero {
  /* Pull hero up so it visually touches the top bar */
  margin-top: -28px;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

.home-hero .hero-inner {
  padding-top: 18px;
  padding-bottom: 18px;
}

.hero.hero-with-bg {
  padding: 0;
  border-radius: 0;
  background-color: #0b1738;
  background-image: var(--hero-bg-image);
  background-size: cover;
  background-position: center;
  border: 0;
  color: var(--hero-text-color, #ffffff);
}

.hero.hero-with-bg h1,
.hero.hero-with-bg .hero-lead,
.hero.hero-with-bg .hero-lead-rich,
.hero.hero-with-bg .hero-sub,
.hero.hero-with-bg .hero-sub a {
  color: var(--hero-text-color, #ffffff);
}

.hero.hero-with-bg h1,
.hero.hero-with-bg .hero-lead,
.hero.hero-with-bg .hero-sub {
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
}

@media (max-width: 560px) {
  .home-hero .hero-inner {
    padding-top: 14px;
    padding-bottom: 16px;
  }
}

.hero h1 {
  margin: 0 0 14px;
  font-size: clamp(1.5rem, 4vw, 1.85rem);
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.hero-lead {
  font-size: 1.05rem;
  line-height: 1.65;
  max-width: 52rem;
  color: var(--text-secondary);
}

.hero-lead-rich p {
  margin: 0 0 12px;
}

.hero-lead-rich p:last-child {
  margin-bottom: 0;
}

.hero-lead-rich ul,
.hero-lead-rich ol {
  margin: 0 0 12px 1.25rem;
  padding: 0;
}

.hero-lead-rich li {
  margin-bottom: 6px;
}

.hero-sub {
  margin-top: 16px;
}

.hero-sub a {
  font-weight: 500;
}

.section-block {
  margin-top: 36px;
}

.section-title {
  margin: 0 0 8px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
}

.section-intro {
  margin: 0 0 20px;
}

#products .section-title,
#products .section-intro {
  text-align: center;
}

.product-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
}

.product-card {
  flex: 0 1 calc((100% - 60px) / 4);
  min-width: 240px;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}

@media (max-width: 620px) {
  .product-card {
    flex-basis: 100%;
    max-width: 100%;
    min-width: 0;
  }
}

.product-card:hover {
  border-color: rgba(30, 90, 149, 0.45);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.product-card-image {
  aspect-ratio: 16 / 10;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
}

.product-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.product-card-body {
  padding: 16px;
  flex: 1;
}

.product-card-body h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
  color: var(--text);
}

.product-tagline {
  margin: 0 0 8px;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.product-short {
  font-size: 0.85rem;
  margin: 0 0 12px;
  line-height: 1.5;
  color: var(--text-muted);
}

.product-price {
  margin: 0;
  font-weight: 700;
  color: var(--accent);
  font-size: 1rem;
}

/* Card footer CTA bar — pro software catalog style */
.product-card::after {
  content: "More info →";
  display: block;
  padding: 10px 16px;
  background: var(--accent);
  color: var(--accent-on-accent);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: center;
}

.product-card:hover::after {
  background: var(--accent-hover);
}

.muted-card {
  background: var(--accent-soft);
  border-color: #c5d9ec;
}

.muted-card h2 {
  color: var(--text);
}

.muted-card a {
  font-weight: 600;
}

.breadcrumb {
  font-size: 0.88rem;
  margin-bottom: 12px;
  color: var(--text-muted);
}

.breadcrumb a {
  font-weight: 500;
}

.product-hero-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 28px;
  align-items: start;
}

@media (max-width: 820px) {
  .product-hero-grid {
    grid-template-columns: 1fr;
  }
}

.product-hero-image img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}

.product-tagline-lg {
  color: var(--text-secondary);
  margin: 0 0 12px;
}

.product-price-lg {
  font-size: 1.25rem;
  margin: 0 0 16px;
  font-weight: 700;
  color: var(--accent);
}

.product-price-hype {
  color: var(--text);
  line-height: 1.45;
}

.product-price-mrp {
  text-decoration: line-through;
  color: var(--text-muted);
  font-weight: 600;
  margin-right: 0.12em;
}

.product-price-arrow {
  margin: 0 0.18em;
  color: var(--text-muted);
  font-weight: 600;
}

.product-price-sale {
  color: var(--accent);
  font-weight: 800;
}

.product-price-lg .product-price-sale {
  font-size: 1.12em;
}

.product-price-promo {
  margin-left: 0.4em;
  font-weight: 600;
  font-size: 0.92em;
  color: var(--text-secondary);
}

.product-price-promo-inline {
  margin-left: 0.25em;
}

.product-card .product-price-mrp {
  font-size: 0.88em;
  font-weight: 600;
}

.product-card .product-price-sale {
  font-size: 1.02em;
}

/* Lifetime + SaaS both shown */
.product-price-dual {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.2rem 0.35rem;
  line-height: 1.4;
}

.product-price-dual .product-price-kind {
  font-weight: 600;
  font-size: 0.78em;
}

.product-price-dual .product-price-sep {
  font-weight: 500;
}

.product-price-dual-lg {
  line-height: 1.55;
}

.product-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.product-actions-cta {
  gap: 12px;
}

.product-actions .product-trial-claim-form {
  display: inline-flex;
  margin: 0;
  align-items: center;
}

.checkout-pay-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.checkout-promo-inline {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

@media (max-width: 760px) {
  .checkout-pay-row {
    grid-template-columns: 1fr;
  }
}

.product-offer-urgency {
  margin: 0 0 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.testimonial-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 8px;
}

.testimonial-card {
  margin: 0;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-muted);
}

.testimonial-quote {
  margin: 0 0 12px;
  font-size: 0.98rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

.testimonial-meta {
  font-size: 0.88rem;
  color: var(--text);
}

.testimonial-name {
  font-weight: 600;
}

.product-cta-hints {
  margin: 2px 0 10px;
}

.product-cta-hint-line {
  margin: 0 0 3px;
  font-size: 0.82rem;
  line-height: 1.35;
  color: var(--text-muted);
}

.product-cta-hint-line:last-child {
  margin-bottom: 0;
}

.btn-cta-trial {
  background: #2563eb;
  border-color: #1d4ed8;
  color: #fff;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.35);
}

.btn-cta-trial:hover {
  background: #1d4ed8;
  border-color: #1e40af;
  color: #fff;
}

.btn-cta-buy {
  background: #16a34a;
  border-color: #15803d;
  color: #fff;
  box-shadow: 0 1px 2px rgba(22, 163, 74, 0.35);
}

.btn-cta-buy:hover {
  background: #15803d;
  border-color: #166534;
  color: #fff;
}

.btn-secondary {
  background: var(--bg);
  color: var(--accent);
  border-color: var(--accent);
  box-shadow: none;
}

.btn-secondary:hover {
  background: var(--accent-soft);
  color: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-as-link {
  display: inline;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
}

.btn-as-link:hover {
  color: var(--accent-hover);
}

.btn-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
  filter: grayscale(0.35);
}

.payments-disabled-notice {
  margin: 0.5rem 0 0;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.small {
  font-size: 0.8rem;
}

.inline-form {
  display: inline;
  margin: 0;
}

.prose {
  line-height: 1.65;
  color: var(--text-secondary);
}

.prose p {
  margin: 0 0 12px;
}

/* Overview lists — compact like plain text blocks (no stacked <p> gaps inside <li>) */
.prose ul,
.prose ol {
  margin: 0 0 12px;
  padding-left: 1.35rem;
}

.prose li {
  margin-bottom: 3px;
  line-height: 1.5;
}

.prose li > p {
  margin: 0;
}

.prose li > p + p {
  margin-top: 6px;
}

.prose ul:last-child,
.prose ol:last-child {
  margin-bottom: 0;
}

.feature-list {
  margin: 0;
  padding-left: 1.25rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.feature-list li {
  margin-bottom: 8px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: background-color 0.16s ease, transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.feature-list li:hover {
  background: var(--accent-soft);
  border-color: #c5d9ec;
  box-shadow: 0 4px 10px rgba(30, 90, 149, 0.12);
  transform: translateX(3px);
}

.product-features-layout--split {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: 28px;
  align-items: start;
}

@media (max-width: 760px) {
  .product-features-layout--split {
    grid-template-columns: 1fr;
  }
}

.product-features-list {
  margin-top: 0;
}

.product-features-html {
  margin-top: 0;
  color: var(--text-secondary);
  /* Tighter than Overview body: authors often use <br> per line; 1.65 reads as “double spacing” */
  line-height: 1.4;
}

/* Plain <br><br> often collapses visually; block + margin makes each break (and doubles) predictable */
.product-features-html br {
  display: block;
  line-height: 0;
  margin: 0.55em 0 0;
}

.product-features-html > br:first-child {
  margin-top: 0;
}

.product-features-html ul,
.product-features-html ol {
  margin: 0 0 12px;
  padding-left: 1.35rem;
}

.product-features-html li {
  margin-bottom: 3px;
  line-height: 1.5;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: background-color 0.16s ease, transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.product-features-html li:hover {
  background: var(--accent-soft);
  border-color: #c5d9ec;
  box-shadow: 0 4px 10px rgba(30, 90, 149, 0.12);
  transform: translateX(3px);
}

/* Some products use plain paragraphs instead of <li>; hover should still work. */
.product-features-html p {
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 6px 10px;
  transition: background-color 0.16s ease, transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.product-features-html p:hover {
  background: var(--accent-soft);
  border-color: #c5d9ec;
  box-shadow: 0 4px 10px rgba(30, 90, 149, 0.12);
  transform: translateX(3px);
}

/* Fallback for admin HTML that uses <br> lines instead of <ul><li>. */
.feature-hover-line {
  display: inline-block;
  width: 100%;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: background-color 0.16s ease, transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.feature-hover-line:hover {
  background: var(--accent-soft);
  border-color: #c5d9ec;
  box-shadow: 0 4px 10px rgba(30, 90, 149, 0.12);
  transform: translateX(3px);
}

/* Body <p> spacing; <p> inside <li> must not stack 12px margins (felt like huge <br> gaps) */
.product-features-html p {
  margin: 0 0 12px;
}

.product-features-html li p {
  margin: 0;
}

.product-features-html li p + p {
  margin-top: 6px;
}

.product-features-html p:empty {
  display: none;
  margin: 0;
}

.product-features-html h3,
.product-features-html h4,
.product-features-html h5 {
  margin: 16px 0 8px;
  color: var(--text);
}

.product-features-html h3:first-child,
.product-features-html h4:first-child,
.product-features-html h5:first-child {
  margin-top: 0;
}

.product-features-gallery {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.product-features-gallery-item {
  margin: 0;
}

.product-features-gallery-item img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}

.billing-form fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin: 0 0 16px;
  background: var(--bg-muted);
}

.billing-form legend {
  padding: 0 10px;
  font-weight: 600;
  color: var(--text);
}

.billing-form textarea {
  min-height: 72px;
  font: inherit;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--text);
  padding: 10px 12px;
}

.rich-editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.rich-editor-toolbar button {
  background: var(--bg);
  color: var(--text);
  border-color: var(--border-strong);
  padding: 6px 10px;
  min-width: 40px;
}

.rich-editor-toolbar button:hover {
  background: var(--bg-subtle);
  border-color: var(--accent);
}

.rich-editor {
  min-height: 180px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  padding: 10px 12px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.rich-editor:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

.rich-editor--legal {
  min-height: 280px;
}

.rich-editor--legal h2,
.rich-editor--legal h3 {
  margin: 14px 0 8px;
  line-height: 1.35;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 560px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

.invoice-summary.inner {
  margin-top: 14px;
  background: var(--bg-muted);
}

.invoice-toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.invoice-sheet {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  background: #fff;
  color: #1a1a1a;
  box-shadow: var(--shadow-sm);
  font-size: 0.95rem;
  line-height: 1.5;
}

.invoice-sheet a {
  color: var(--accent);
}

.invoice-sheet p {
  margin: 0 0 6px;
}

.invoice-sheet h3 {
  margin: 0 0 10px;
  font-size: 1.05rem;
}

.invoice-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.invoice-logo-wrap {
  margin-bottom: 10px;
}

.invoice-logo {
  display: block;
  max-height: 96px;
  width: auto;
  max-width: min(280px, 100%);
  object-fit: contain;
}

.invoice-head h1 {
  margin: 0 0 8px;
  font-size: 1.3rem;
  color: #111;
  line-height: 1.25;
}

.invoice-meta {
  text-align: right;
}

.invoice-meta p {
  margin: 0 0 6px;
}

.invoice-parties {
  margin: 16px 0 12px;
}

.invoice-sheet > hr {
  margin: 16px 0;
  border: 0;
  border-top: 1px solid #d1d5db;
}

.invoice-table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0 12px;
  min-width: 0;
  font-size: 0.95rem;
}

.invoice-table th,
.invoice-table td {
  border: 1px solid #ccc;
  padding: 10px 12px;
  color: #222;
}

.invoice-table tfoot th {
  text-align: right;
}

.invoice-table .invoice-num {
  text-align: right;
  white-space: nowrap;
}

.invoice-table tr.invoice-gst-row td {
  font-size: 0.92rem;
}

.invoice-terms-block {
  margin-top: 14px;
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px dashed #d1d5db;
  border-radius: 6px;
  background: #fafafa;
}

.invoice-tax-note {
  margin-top: 14px;
}

.invoice-footnote {
  color: #555;
  margin-top: 14px;
}

@media print {
  @page {
    size: A4;
    margin: 12mm;
  }

  .topbar,
  .footer,
  .no-print,
  .flash,
  .crisp-client,
  #crisp-chatbox,
  iframe[title*="chat" i],
  #tawkchat-container,
  .widget-visible {
    display: none !important;
  }

  html,
  body {
    background: #fff !important;
    color: #111 !important;
    font-size: 11pt !important;
    line-height: 1.5 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .wrap,
  .content {
    max-width: none !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .invoice-print,
  .invoice-print.card {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    background: #fff !important;
  }

  .invoice-sheet {
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    min-height: 220mm !important;
    font-size: 11pt !important;
    line-height: 1.55 !important;
  }

  .invoice-sheet p {
    margin: 0 0 6px !important;
    font-size: 10.5pt !important;
    line-height: 1.55 !important;
  }

  .invoice-sheet h3 {
    font-size: 12pt !important;
    margin: 0 0 8px !important;
  }

  .invoice-logo-wrap {
    margin-bottom: 8px !important;
  }

  .invoice-logo {
    max-height: 96px !important;
    max-width: 260px !important;
  }

  .invoice-head {
    gap: 16px !important;
    align-items: flex-start !important;
    margin-bottom: 8px !important;
  }

  .invoice-head h1 {
    font-size: 16pt !important;
    margin: 0 0 8px !important;
  }

  .invoice-meta {
    text-align: right !important;
  }

  .invoice-meta p {
    margin: 0 0 6px !important;
  }

  .invoice-sheet > hr {
    margin: 14px 0 16px !important;
  }

  .invoice-parties {
    margin: 16px 0 20px !important;
  }

  .invoice-table {
    margin: 18px 0 16px !important;
    font-size: 10.5pt !important;
  }

  .invoice-table th,
  .invoice-table td {
    padding: 9px 11px !important;
  }

  .invoice-table tr.invoice-gst-row td {
    font-size: 9.5pt !important;
  }

  .invoice-tax-note,
  .invoice-footnote,
  .invoice-terms-block,
  .invoice-sheet .muted.small {
    font-size: 8.5pt !important;
    line-height: 1.45 !important;
  }

  .invoice-terms-block {
    margin-top: 12px !important;
    margin-bottom: 10px !important;
    padding: 8px 10px !important;
  }

  .invoice-tax-note {
    margin-top: 12px !important;
  }

  .invoice-footnote {
    margin-top: 12px !important;
  }
}

.key-copy {
  white-space: nowrap;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.card > .admin-stats {
  margin: 12px 0 0;
}

.ca-summary-card {
  padding-top: 12px;
}

.ca-summary-card h1 {
  margin: 0 0 10px;
}

.reseller-summary-card {
  padding-top: 12px;
}

.reseller-summary-card h1 {
  margin: 0 0 6px;
}

.reseller-summary-card > p {
  margin: 0 0 8px;
}

.reseller-summary-card > .admin-stats {
  margin: 8px 0 0;
}

.reseller-promo-hero {
  margin: 12px 0 18px;
  padding: 22px 20px 18px;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: 12px;
  background:
    linear-gradient(165deg, rgba(15, 118, 110, 0.08), transparent 55%),
    var(--bg-muted);
}

.reseller-promo-label {
  margin: 0 0 8px;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.reseller-promo-code {
  margin: 0 0 10px;
  font-family: ui-monospace, "Cascadia Code", "Segoe UI Mono", Consolas, monospace;
  font-size: clamp(1.85rem, 5vw, 2.75rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.15;
  color: var(--text);
  word-break: break-all;
}

.reseller-promo-discount {
  margin: 0 0 6px;
  font-size: 1.05rem;
  color: var(--text-secondary);
}

.reseller-promo-commission {
  margin: 0 0 14px;
  font-size: 1.15rem;
  color: var(--text);
}

.reseller-promo-actions {
  justify-content: center;
  margin-bottom: 8px;
}

.affiliate-hero-card .affiliate-benefits {
  margin: 12px 0 0;
  padding-left: 1.2rem;
  color: var(--text-secondary);
}

.affiliate-approve-form {
  min-width: 220px;
  max-width: 320px;
}

.affiliate-approve-form label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.85rem;
}

.affiliate-approve-form input[type="number"],
.affiliate-approve-form input[type="text"] {
  width: 100%;
}

.staff-rights-summary-card {
  padding-top: 12px;
}

.staff-rights-summary-card h1 {
  margin: 0 0 10px;
}

.admin-panel-summary-card {
  padding-top: 12px;
}

.admin-panel-summary-card h1 {
  margin: 0 0 10px;
}

.admin-company-summary-card {
  padding-top: 12px;
}

.admin-company-summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-company-summary-head h1 {
  margin: 0;
}

.admin-company-compact-card {
  padding-top: 10px;
}

.admin-company-compact-card h2 {
  margin-top: 0;
}

.admin-company-collapsible-card.is-expanded .admin-collapsible-head {
  margin-bottom: 10px;
}

.company-content-heading {
  margin-top: 0;
}

.product-gallery-upload-block {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(148, 163, 184, 0.06);
}

.product-gallery-upload-block input[type="file"] {
  margin-top: 0.25rem;
}

.product-gallery-thumb {
  display: block;
  max-height: 88px;
  max-width: 180px;
  border-radius: 6px;
  margin-top: 0.35rem;
  border: 1px solid var(--border);
}

.product-gallery-preview {
  margin: 0.15rem 0 0;
}

.product-file-delete-option {
  margin-top: 0.35rem;
  color: #b91c1c;
}

.company-hero-file-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.invoice-logo-inline-controls {
  flex-wrap: nowrap;
}

.invoice-logo-inline-controls .company-hero-file-input {
  min-width: 220px;
  max-width: 320px;
}

.invoice-logo-inline-controls .muted.small {
  white-space: nowrap;
}

.invoice-settings-grid .invoice-logo-settings-row {
  grid-column: 1 / -1;
}

.invoice-logo-settings-thumb {
  display: block;
  max-height: 34px;
  width: auto;
  max-width: 120px;
  object-fit: contain;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  padding: 2px 4px;
}

.company-hero-file-input {
  max-width: 100%;
}

.company-hero-file-input::file-selector-button {
  margin-right: 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--accent);
  background: var(--bg);
  color: var(--accent);
  padding: 8px 12px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.company-hero-file-input::file-selector-button:hover {
  background: var(--accent-soft);
  color: var(--accent-hover);
  border-color: var(--accent-hover);
}

.company-hero-file-action {
  padding: 8px 12px;
}

.company-hero-delete-btn {
  padding: 8px 12px;
  background: #dc2626;
  border-color: #b91c1c;
  color: #ffffff;
}

.company-hero-delete-btn:hover {
  background: #b91c1c;
  border-color: #991b1b;
  color: #ffffff;
}

.invoice-settings-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.invoice-settings-grid .invoice-settings-note,
.invoice-settings-grid .invoice-settings-save {
  grid-column: 1 / -1;
}

.company-content-save {
  display: block;
  width: 100%;
  margin-top: 8px;
}

@media (max-width: 960px) {
  .invoice-settings-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .invoice-settings-grid {
    grid-template-columns: 1fr;
  }
  .invoice-logo-inline-controls {
    flex-wrap: wrap;
  }
}

.admin-company-collapsible-card [hidden] {
  display: none !important;
}

.admin-manual-card {
  padding-top: 10px;
  padding-bottom: 10px;
}

.admin-collapsible-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 0;
}

.admin-manual-card.is-expanded .admin-collapsible-head {
  margin-bottom: 8px;
}

.admin-collapsible-head h2 {
  margin: 0;
}

.admin-manual-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 4px 10px;
  line-height: 1.1;
}

.admin-manual-toggle-arrow {
  display: inline-block;
  min-width: 10px;
}

.admin-licenses-card {
  padding-top: 10px;
}

.admin-licenses-card h2 {
  margin-top: 0;
}

.staff-create-form {
  gap: 10px;
}

.staff-create-card h2 {
  margin-top: 0;
}

.staff-users-card h2 {
  margin-top: 0;
}

.staff-create-form .form-row {
  gap: 16px;
}

.staff-create-form #staff-existing-user-note {
  margin: -2px 0 0;
}

.staff-create-form button[type="submit"] {
  width: 100%;
}

.admin-stat-card {
  margin-bottom: 0;
  padding: 16px;
}

.admin-stat-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent);
  margin: 0;
  line-height: 1.2;
}

.admin-stat-label {
  margin: 8px 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.admin-stat-card-danger {
  background: #dc2626;
  border-color: #b91c1c;
}

.admin-stat-card-danger .admin-stat-value,
.admin-stat-card-danger .admin-stat-label {
  color: #ffffff;
}

.admin-stat-card-success {
  background: #16a34a;
  border-color: #15803d;
}

.admin-stat-card-success .admin-stat-value,
.admin-stat-card-success .admin-stat-label {
  color: #ffffff;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.admin-search-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}

.admin-search-label {
  flex: 1;
  min-width: 220px;
  margin: 0;
  display: block;
}

.admin-search-form input[type="search"] {
  width: 100%;
  margin: 0;
}

.admin-search-hint {
  margin-top: 10px;
}

.admin-search-form .btn {
  flex-shrink: 0;
}

.admin-checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-direction: row;
  font-weight: 500;
  color: var(--text-secondary);
}

.admin-checkbox-label input[type="checkbox"] {
  width: auto;
  margin: 0;
}

.admin-rights-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 8px;
  align-items: center;
}

.admin-rights-grid label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 0.82rem;
}

.admin-rights-grid button {
  width: max-content;
}

.staff-user-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.staff-user-edit-panel {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border, #e2e8f0);
}

.staff-rights-cell,
.staff-rights-actions-cell {
  text-align: center;
  vertical-align: middle;
}

.staff-users-card table th:nth-child(n + 2):nth-child(-n + 7) {
  text-align: center;
}

.staff-users-card table td.staff-rights-cell {
  padding-left: 0;
  padding-right: 0;
}

.staff-rights-cell input[type="checkbox"] {
  display: block;
  width: auto;
  margin: 0 auto;
  padding: 0;
}

.staff-rights-actions-cell {
  white-space: nowrap;
}

.staff-rights-actions-cell button {
  margin-bottom: 4px;
  padding: 6px 12px;
  min-height: 0;
  line-height: 1.2;
}

.staff-edit-toggle {
  padding: 6px 12px;
  min-height: 0;
  line-height: 1.2;
  font-size: inherit;
}

.staff-profile-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: stretch;
  max-width: 280px;
}

.staff-profile-form label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
}

.staff-profile-form input {
  width: 100%;
  box-sizing: border-box;
}

.staff-profile-form button {
  width: max-content;
  margin-top: 4px;
}

.staff-delete-form {
  margin-top: 10px;
}

.report-filter-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  margin: 12px 0 10px;
}

.ca-filter-strip {
  margin: 0 0 10px;
}

.ca-filter-strip .report-filter-toolbar {
  margin: 0 0 8px;
}

.ca-filter-strip .muted.small {
  margin: 0 0 4px;
}

.report-period-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  align-items: center;
}

.report-period-nav .btn.btn-small {
  padding: 6px 12px;
  font-size: 0.85rem;
}

.report-period-nav .btn.is-active {
  background: linear-gradient(180deg, #38bdf8 0%, #0ea5e9 100%);
  color: #fff;
  border-color: #0284c7;
}

.report-period-nav .btn.is-active:hover {
  filter: brightness(1.05);
}

.ca-tabs-card {
  margin: 0 0 -1px;
  padding-top: 6px;
  padding-bottom: 6px;
}

.ca-tabs-card + .card {
  margin-top: 0;
}

.ca-tabs-card .ca-per-page-row {
  padding: 8px 14px 6px;
  border-top: 1px solid rgba(148, 163, 184, 0.35);
}

.ca-tabs-card .ca-per-page-row > span:first-of-type {
  margin-right: 6px;
}

.ca-invoices-card,
.ca-report-panel {
  padding-top: 10px;
}

.ca-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 12px;
}

.ca-panel-head h2 {
  margin: 0;
}

.admin-search-form.ca-inline-search {
  margin-top: 0;
  margin-bottom: 0;
  flex: 1 1 460px;
  justify-content: flex-end;
}

.admin-search-form.ca-inline-search .admin-search-label {
  flex: 0 1 560px;
  min-width: 260px;
}

.ca-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: flex-end;
  background: transparent;
  border: 0;
  padding: 0;
}

.ca-tab,
.ca-tab:visited {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: 8px 8px 0 0;
  border: 1px solid #c9ced6;
  background: linear-gradient(180deg, #f5f6f7 0%, #d9dee5 100%);
  color: #4b5563;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, filter 0.15s ease;
}

.ca-tab:hover,
.ca-tab:focus-visible {
  background: linear-gradient(180deg, #ffffff 0%, #e3e8ee 100%);
  color: #374151;
  text-decoration: none;
}

.ca-tab.is-active,
.ca-tab.is-active:visited {
  background: linear-gradient(180deg, #35c1f0 0%, #10a8e8 100%);
  color: #ffffff;
  border-color: #148fc2;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 1px 0 rgba(0, 0, 0, 0.04);
}

.ca-tab.is-active:hover {
  color: #ffffff;
  filter: brightness(1.03);
}

.report-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
}

.report-per-page-form select {
  margin-left: 6px;
  padding: 4px 8px;
}

.card-nested {
  margin-top: 20px;
  padding-top: 16px;
}

.report-download-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  margin-top: 8px;
}

.report-custom-range {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  margin: 0;
}

.report-custom-range .small {
  min-width: 0;
}

.report-custom-range .small input[type="date"] {
  width: 126px;
  min-height: 34px;
  padding: 6px 10px;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
}

.report-custom-range .btn-secondary {
  min-height: 34px;
  padding: 6px 12px;
  font-size: 0.85rem;
  white-space: nowrap;
}

@media (max-width: 960px) {
  .report-filter-toolbar {
    align-items: stretch;
    gap: 10px;
  }

  .report-period-nav {
    width: 100%;
  }

  .admin-search-form.ca-inline-search {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 620px) {
  .report-custom-range {
    width: 100%;
  }

  .report-custom-range .small {
    flex: 1 1 135px;
  }

  .report-custom-range .small input[type="date"] {
    width: 100%;
  }
}

.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.tag-success {
  background: #dcfce7;
  color: #166534;
}

.tag-warn {
  background: #fef3c7;
  color: #92400e;
}

.multiviewer-tier-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.multiviewer-tier-card {
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
  padding: 1rem 1.1rem;
  background: var(--card-bg, #fff);
}

.multiviewer-tier-card h3 {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
}

.multiviewer-tier-name {
  margin: 0 0 0.5rem;
  font-size: 0.92rem;
}

.multiviewer-tier-price {
  margin: 0 0 0.65rem;
}
