/* ==========================================================================
   Base & CSS Variables (Light & Dark Theme - Green Theme Unified)
   ========================================================================== */
:root {
  --bg: #f8fafc;
  --card: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --nav: #0f172a;
  --green: #059669;
  --green-bright: #10b981;
  --green-dark: #047857;
  --green-soft: #ecfdf5;
  --green-border: #a7f3d0;
  --chip: #f1f5f9;
  --accent: #10b981;
  --font-main: 'Inter', 'Inter Fallback', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

[data-theme="dark"],
body.dark-mode {
  --bg: #0b1120;
  --card: #111827;
  --ink: #f8fafc;
  --muted: #94a3b8;
  --line: #1e293b;
  --nav: #090e1a;
  --green: #10b981;
  --green-bright: #34d399;
  --green-dark: #059669;
  --green-soft: rgba(16, 185, 129, 0.14);
  --green-border: rgba(16, 185, 129, 0.35);
  --chip: #1e293b;
  --accent: #10b981;
}

:root {
  color-scheme: light;
}

[data-theme="dark"] {
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

img {
  max-width: 100%;
  height: auto;
}

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

body {
  min-width: 320px;
  overflow-wrap: break-word;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-main) !important;
  background-color: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--green-bright);
  outline-offset: 2px;
}

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

svg.i {
  width: 20px !important;
  height: 20px !important;
  min-width: 20px;
  min-height: 20px;
  display: inline-block !important;
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

/* ==========================================================================
   Header & Navigation (Isolated from subpage Tailwind resets)
   ========================================================================== */
#site-header {
 position: relative;
 z-index: 40; /* must stay BELOW the generator pop-ups (Tailwind z-50) */
 width: 100%;
 display: block !important;
 font-family: var(--font-main) !important;
 }

header.site-topbar {
 display: block !important;
 background: var(--nav) !important;
 color: #ffffff !important;
 position: relative;
 z-index: 40;
 overflow: visible;
 border-bottom: 2px solid var(--green);
 }

header.site-topbar .bar {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  height: 76px;
  gap: 16px;
  position: relative;
}

#site-header {
  min-height: 78px;
}

header.site-topbar .logo {
  display: inline-flex !important;
  align-items: center !important;
  gap: 12px;
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  text-decoration: none !important;
  color: #ffffff !important;
  flex-shrink: 0;
}

header.site-topbar .logo-img {
  display: block;
  width: 40px;
  height: 40px;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  flex-shrink: 0;
}

header.site-topbar .logo b {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(16, 185, 129, 0.45);
  border-radius: 10px;
  background: rgba(16, 185, 129, 0.16);
  color: #10b981 !important;
}

header.site-topbar .nav-actions {
  display: flex !important;
  align-items: center !important;
  gap: 10px;
  flex-shrink: 0;
}

header.site-topbar .nav-menu {
  display: flex !important;
  align-items: center !important;
  gap: 22px;
  margin-left: auto;
  margin-right: 12px;
}

header.site-topbar .nav-menu a {
  text-decoration: none !important;
  font-weight: 600;
  font-size: 0.95rem;
  color: #e2e8f0 !important;
  padding: 6px 4px;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

header.site-topbar .nav-menu a:hover,
header.site-topbar .nav-menu a.active {
  color: #34d399 !important;
  border-bottom-color: #10b981;
}

header.site-topbar .nav-menu a.go {
  background: var(--green) !important;
  color: #ffffff !important;
  font-weight: 700;
  padding: 9px 18px !important;
  border-radius: 8px;
  border-bottom: none !important;
  transition: background-color 0.2s ease;
  white-space: nowrap;
}

header.site-topbar .nav-menu a.go:hover {
  background: var(--green-dark) !important;
  color: #ffffff !important;
}

header.site-topbar .mode,
header.site-topbar .menu-btn {
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  color: #f8fafc !important;
  cursor: pointer;
  width: 40px;
  height: 40px;
  padding: 0 !important;
  border-radius: 8px;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

header.site-topbar .mode:hover,
header.site-topbar .menu-btn:hover {
  color: #34d399 !important;
  border-color: rgba(16, 185, 129, 0.55) !important;
  background-color: rgba(16, 185, 129, 0.15) !important;
}

header.site-topbar .menu-btn {
  display: none !important;
}

/* Theme toggle icons - exactly ONE is visible at a time.
   Light theme (default) -> MOON icon  (click to go dark)
   Dark theme            -> SUN icon   (click to go light) */
header.site-topbar #theme-icon-sun {
  display: none !important;
}

header.site-topbar #theme-icon-moon {
  display: block !important;
}

[data-theme="dark"] header.site-topbar #theme-icon-sun {
  display: block !important;
}

[data-theme="dark"] header.site-topbar #theme-icon-moon {
  display: none !important;
}

/* ==========================================================================
   Hero Section (Green & Deep Slate Theme)
   ========================================================================== */
.hero {
  text-align: center;
  padding: 60px 0 46px;
}

.hero-enhanced {
  padding: 68px 0 52px;
  position: relative;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--green-soft);
  border: 1px solid var(--green-border);
  color: var(--green);
  font-size: 0.86rem;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: 999px;
  margin-bottom: 20px;
  cursor: default;
}

.badge-dot {
  width: 8px;
  height: 8px;
  background-color: var(--green-bright);
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
}

.hero-title {
  font-size: clamp(2.1rem, 4.5vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.18;
  max-width: 22em;
  margin: 0 auto 18px;
  color: var(--ink);
}

.hero-title .green-highlight {
  color: var(--green);
  display: inline-block;
}

.hero .hero-lead {
  font-size: 1.22rem;
  color: var(--ink);
  font-weight: 600;
  max-width: 44em;
  margin: 0 auto 14px;
  line-height: 1.5;
}

.hero .hero-lead .lead-highlight {
  color: var(--green);
  font-weight: 700;
  border-bottom: 2px solid rgba(16, 185, 129, 0.4);
}

.hero .hero-sub {
  font-size: 1rem;
  color: var(--muted);
  max-width: 50em;
  margin: 0 auto 28px;
  line-height: 1.65;
}

.hero .hero-sub strong {
  color: var(--ink);
}

.cta {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 26px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 26px;
  border-radius: 10px;
  font-weight: 700;
  text-decoration: none;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.hero-btn-primary {
  background: var(--green) !important;
  border: 2px solid var(--green) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.28);
}

.hero-btn-primary:hover {
  background: var(--green-dark) !important;
  border-color: var(--green-dark) !important;
  box-shadow: 0 6px 20px rgba(5, 150, 105, 0.4);
  transform: translateY(-2px);
}

.hero-btn-secondary {
  background: var(--card) !important;
  color: var(--ink) !important;
  border: 2px solid var(--line) !important;
}

.hero-btn-secondary:hover {
  background: var(--green) !important;
  color: #ffffff !important;
  border-color: var(--green) !important;
  transform: translateY(-2px);
}

/* ==========================================================================
   Cards & Grids (Main Content)
   ========================================================================== */
section {
  padding: 36px 0;
}

h2 {
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
  color: var(--ink);
}

.section-header-flex {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}

.section-header-flex h2 {
  margin-bottom: 6px;
}

.section-desc {
  color: var(--muted);
  font-size: 1rem;
  max-width: 48em;
  margin: 0;
}

.view-all-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--green);
  text-decoration: none;
  padding: 7px 14px;
  border-radius: 8px;
  background: var(--green-soft);
  border: 1px solid var(--green-border);
  transition: all 0.2s ease;
}

.view-all-link:hover {
  background: var(--green);
  color: #ffffff;
}

.grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(min(310px, 100%), 1fr));
}

.grid.two {
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 3px solid var(--c, var(--green));
  border-radius: 14px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-3px);
  border-color: var(--c, var(--green));
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.head {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.ic {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex: none;
  background: var(--chip);
  color: var(--c, var(--green));
}

.t {
  flex: 1;
  min-width: 0;
}

.t div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
}

.t h3 {
  margin: 0;
  font-size: 1.06rem;
  font-weight: 700;
  color: var(--ink);
}

.t h3 a {
  text-decoration: none;
}

.t h3 a:hover {
  color: var(--c, var(--green));
  text-decoration: underline;
}

.t p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.tag {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--chip);
  color: var(--c, var(--green));
  white-space: nowrap;
}

.card-btn {
  margin-top: auto;
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
  background: var(--c, var(--green));
  color: #ffffff;
  font-weight: 700;
  font-size: 0.92rem;
  text-decoration: none;
  padding: 11px;
  border-radius: 8px;
  transition: filter 0.2s ease;
}

.card-btn:hover {
  filter: brightness(0.92);
}

/* ==========================================================================
   ERP Calculators Section
   ========================================================================== */
.calc-section {
  padding: 48px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section-pill {
  display: inline-block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--green);
  background: var(--green-soft);
  border: 1px solid var(--green-border);
  padding: 4px 10px;
  border-radius: 6px;
  margin-bottom: 8px;
}

.calc-card {
  position: relative;
  border: 1px solid var(--line);
  border-top: 3px solid var(--c, var(--green));
  background: var(--card);
  padding: 24px;
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.calc-card:hover {
  transform: translateY(-3px);
  border-color: var(--c, var(--green));
  box-shadow: 0 10px 28px rgba(16, 185, 129, 0.12);
}

.calc-ic {
  background: rgba(var(--c-rgb, 5, 150, 105), 0.12);
  color: var(--c, var(--green));
  border: 1px solid rgba(var(--c-rgb, 5, 150, 105), 0.22);
  width: 50px;
  height: 50px;
  border-radius: 12px;
}

.calc-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.calc-meta h3 a {
  color: var(--ink);
  font-size: 1.12rem;
  font-weight: 700;
}

.calc-tag {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 6px;
  color: var(--c, var(--green));
  background: rgba(var(--c-rgb, 5, 150, 105), 0.12);
  border: 1px solid rgba(var(--c-rgb, 5, 150, 105), 0.22);
}

.calc-btn {
  background: rgba(var(--c-rgb, 5, 150, 105), 0.1) !important;
  color: var(--c, var(--green)) !important;
  border: 1px solid rgba(var(--c-rgb, 5, 150, 105), 0.28) !important;
  font-size: 0.92rem;
  font-weight: 700;
  transition: all 0.2s ease;
}

.calc-btn:hover {
  background: var(--c, var(--green)) !important;
  color: #ffffff !important;
  border-color: var(--c, var(--green)) !important;
}

/* Features Strip */
.feat {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  gap: 24px;
  padding: 20px 0 10px;
}

.feat > div {
  display: flex;
  gap: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  padding: 18px;
  border-radius: 12px;
}

.feat h3 {
  margin: 0 0 4px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
}

.feat p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.feat .ic {
  border-radius: 10px;
  width: 42px;
  height: 42px;
  background: var(--green-soft);
  color: var(--green);
}

/* ==========================================================================
   Footer (Isolated from subpage Tailwind resets)
   ========================================================================== */
#site-footer {
  width: 100%;
  display: block !important;
  font-family: var(--font-main) !important;
}

footer.site-bottombar {
  display: block !important;
  background: var(--nav) !important;
  color: #cbd5e1 !important;
  margin-top: 60px;
  padding: 50px 0 26px;
  font-size: 0.92rem;
  border-top: 2px solid var(--green);
}

footer.site-bottombar .fg {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr));
  gap: 28px;
}

footer.site-bottombar h4 {
  color: #ffffff !important;
  margin: 0 0 14px;
  font-size: 1rem;
  font-weight: 700;
}

footer.site-bottombar ul {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

footer.site-bottombar li {
  margin: 8px 0;
}

footer.site-bottombar a {
  text-decoration: none !important;
  color: #cbd5e1 !important;
  transition: color 0.15s ease;
}

footer.site-bottombar a:hover {
  color: #34d399 !important;
  text-decoration: underline !important;
}

footer.site-bottombar .fb {
  border-top: 1px solid #1e293b;
  margin-top: 34px;
  padding-top: 20px;
  display: flex !important;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  color: #94a3b8;
  font-size: 0.85rem;
}

/* ==========================================================================
   Responsive Breakpoints & Mobile Navigation
   ========================================================================== */
/* Inside @media (max-width: 820px) around line 552 */
@media (max-width: 820px) {
  header.site-topbar .bar {
    height: 66px;
    position: static;
    gap: 10px;
  }

  header.site-topbar .logo {
    font-size: clamp(0.95rem, 4.2vw, 1.18rem);
    gap: 8px;
  }

  header.site-topbar .logo span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
#site-header {
  min-height: 68px;
}

header.site-topbar .logo-img {
  display: block;
  width: 34px;
  height: 34px;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  flex-shrink: 0;
}

  header.site-topbar .menu-btn {
    display: inline-flex !important;
    cursor: pointer;
  }

  header.site-topbar .nav-menu {
    display: none !important;
    position: absolute;
    top: 66px;
    left: 0;
    right: 0;
    width: 100%;
    margin: 0;
    background-color: var(--nav) !important;
    flex-direction: column;
    align-items: stretch !important;
    padding: 16px 20px 24px;
    gap: 8px;
    border-top: 1px solid #1e293b;
    box-shadow: 0 20px 30px rgba(0, 0, 0, 0.45);
    z-index: 40;
  }

  header.site-topbar .nav-menu.open {
    display: flex !important;
  }

  header.site-topbar .nav-menu a {
    display: block !important;
    padding: 12px 14px;
    font-size: 1rem;
    font-weight: 600;
    color: #e2e8f0 !important;
    border-radius: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
  }

  header.site-topbar .nav-menu a:hover,
  header.site-topbar .nav-menu a.active {
    background: rgba(16, 185, 129, 0.14);
    color: #34d399 !important;
  }

  header.site-topbar .nav-menu a.go {
    text-align: center;
    margin-top: 10px;
    padding: 12px !important;
    background: var(--green) !important;
    color: #ffffff !important;
    border-bottom: none !important;
  }
}

/* Small screens: let flex/grid children shrink instead of forcing sideways scroll.
   :where() keeps specificity at zero, so any explicit min-width in a page still wins. */
@media (max-width: 820px) {
  :where(main, #site-footer) :where(div, section, article, form, fieldset, p, h1, h2, h3, h4, label, span, li, a, input, select, textarea) {
    min-width: 0;
  }

  :where(main) :where(table) {
    max-width: 100%;
  }
  header.site-topbar .logo-img {
 height: 34px;
 }
}

/* Tablet (821px - 1024px): keep the desktop nav but tighten spacing */
@media (min-width: 821px) and (max-width: 1024px) {
  header.site-topbar .nav-menu {
    gap: 14px;
  }

  header.site-topbar .nav-menu a {
    font-size: 0.9rem;
  }

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

/* Mobile (<= 640px) */
@media (max-width: 640px) {
  .wrap {
    padding: 0 16px;
  }

  .hero,
  .hero-enhanced {
    padding: 40px 0 32px;
  }

  .hero .hero-lead {
    font-size: 1.05rem;
  }

  .cta .btn {
    width: 100%;
  }

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

  h2 {
    font-size: 1.4rem;
  }

  section {
    padding: 28px 0;
  }

  footer.site-bottombar {
    margin-top: 40px;
    padding: 36px 0 22px;
  }

  footer.site-bottombar .fg {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px 16px;
  }

  footer.site-bottombar .fb {
    flex-direction: column;
  }
}

@media (max-width: 400px) {
  footer.site-bottombar .fg {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  #site-header,
  #site-footer,
  header.site-topbar,
  footer.site-bottombar {
    display: none !important;
  }
}

/* ---- Breadcrumb (below header) ---- */
.breadcrumb {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  font-family: var(--font-main);
  font-size: 0.875rem;
}
.breadcrumb ol {
  list-style: none;
  margin: 0;
  padding: 10px 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.breadcrumb li { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.breadcrumb li + li::before { content: "\203A"; color: var(--muted); }
.breadcrumb a { color: var(--green-dark); text-decoration: none; font-weight: 500; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb [aria-current="page"] { color: var(--ink); font-weight: 600; }
[data-theme="dark"] .breadcrumb a { color: var(--green-bright); }
@media print { .breadcrumb { display: none !important; } }

@font-face {
  font-family: 'Inter Fallback';
  src: local('Segoe UI'), local('Roboto'), local('Helvetica Neue'), local('Arial'), local('Liberation Sans'), local('DejaVu Sans');
  size-adjust: 101%;
  ascent-override: 97%;
  descent-override: 24%;
  line-gap-override: 0%;
}

@media (min-width: 821px) {
  .hero-enhanced {
    min-height: 520px;
  }
}

@media (max-width: 820px) {
  .hero-enhanced {
    min-height: 560px;
  }
  .hero .hero-sub {
    min-height: 155px;
  }
}