/* =====================================================================
   2-Host — WHMCS child theme (parent: twenty-one)
   A left-rail SaaS app shell in the 2-Host brand (lime, Geist + Space
   Grotesk, airy). The shell is rebuilt in header.tpl/footer.tpl; this
   styles it + every component. Ported from src/styles/tokens.css.
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600&family=Space+Grotesk:wght@500;600;700&display=swap');

:root {
  --th-accent: #c6f24e;
  --th-accent-hover: #bcec3c;
  --th-accent-fg: #0a0f02;
  --th-accent-ink: #4f6b07;
  --th-accent-ink-hover: #3a4f05;
  --th-bg: #f6f6f3;
  --th-surface: #ffffff;
  --th-fg: #11120e;
  --th-muted: #56565e;
  --th-border: #e7e7e0;
  --th-ring: rgba(198, 242, 78, 0.45);
  --th-radius: 16px;
  --th-radius-sm: 10px;
  --th-shadow: 0 1px 2px rgba(17,18,14,.04), 0 10px 30px -14px rgba(17,18,14,.12);
  --th-font: 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --th-display: 'Space Grotesk', var(--th-font);
  --th-rail-w: 256px;
}

/* ---- Base ---------------------------------------------------------- */
body.th-body, body.primary-bg-color {
  background: var(--th-bg) !important;
  color: var(--th-fg);
  font-family: var(--th-font);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}
h1,h2,h3,h4,h5,h6,.h1,.h2,.h3,.h4,.h5,.h6,.card-title,.pricing-card-title {
  font-family: var(--th-display); letter-spacing: -0.02em; color: var(--th-fg);
}
a { color: var(--th-accent-ink); }
a:hover, a:focus { color: var(--th-accent-ink-hover); }
.text-muted { color: var(--th-muted) !important; }
::selection { background: var(--th-accent); color: var(--th-accent-fg); }

/* ===================================================================
   APP SHELL
   =================================================================== */
.th-shell { display: flex; min-height: 100vh; }

/* ---- Left rail ----------------------------------------------------- */
.th-rail {
  flex: 0 0 var(--th-rail-w);
  width: var(--th-rail-w);
  background: var(--th-surface);
  border-right: 1px solid var(--th-border);
  position: sticky; top: 0;
  height: 100vh;
  display: flex; flex-direction: column;
  padding: 1.25rem 0.75rem;
  z-index: 1040;
}
.th-rail-brand { display: block; padding: 0.5rem 0.85rem 1.5rem; }
.th-rail-brand img { max-height: 30px; width: auto; }
.th-rail-brand-text { font-family: var(--th-display); font-weight: 700; font-size: 1.3rem; color: var(--th-fg); }

.th-rail-nav { flex: 1 1 auto; overflow-y: auto; }
.th-rail-nav .navbar-nav,
.th-rail-foot .navbar-nav { flex-direction: column; width: 100%; }

/* nav items (from navbar.tpl) become vertical rows */
.th-rail .navbar-nav > li > a,
.th-rail .navbar-nav .nav-link {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.62rem 0.85rem; margin: 1px 0;
  border-radius: var(--th-radius-sm);
  color: var(--th-fg); font-weight: 500; white-space: nowrap;
}
.th-rail .navbar-nav > li > a:hover { background: rgba(198,242,78,.14); color: var(--th-fg); }
.th-rail .navbar-nav > li.active > a,
.th-rail .navbar-nav > li.current > a { background: var(--th-accent); color: var(--th-accent-fg); font-weight: 600; }
.th-rail .navbar-nav > li > a i { width: 1.1rem; text-align: center; color: var(--th-muted); }
.th-rail .navbar-nav > li.active > a i { color: var(--th-accent-fg); }

/* dropdown children expand inline within the rail */
.th-rail .dropdown-menu {
  position: static !important; float: none; transform: none !important;
  border: 0; box-shadow: none; background: transparent;
  padding: 0 0 0 1.4rem; margin: 0;
}
.th-rail .dropdown-menu .dropdown-item { padding: 0.45rem 0.6rem; border-radius: 8px; color: var(--th-muted); white-space: normal; }
.th-rail .dropdown-menu .dropdown-item:hover { background: rgba(198,242,78,.12); color: var(--th-fg); }
.th-rail .collapsable-dropdown { display: none !important; }   /* hide the "More" overflow item */

.th-rail-foot { border-top: 1px solid var(--th-border); padding-top: 0.6rem; margin-top: 0.6rem; }

/* ---- Workspace ----------------------------------------------------- */
.th-workspace { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; background: var(--th-bg); }

.th-topbar {
  display: flex; align-items: center; gap: 1rem;
  padding: 0.9rem 1.75rem;
  border-bottom: 1px solid var(--th-border);
  background: var(--th-bg);
  position: sticky; top: 0; z-index: 1030;
}
.th-topbar-title { font-family: var(--th-display); font-weight: 600; font-size: 1.1rem; }
.th-topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 1rem; }
.th-cart { position: relative; color: var(--th-fg); font-size: 1.05rem; }
.th-cart-badge { background: var(--th-accent); color: var(--th-accent-fg); border-radius: 999px; font-size: .68rem; font-weight: 600; padding: 0 .4rem; margin-left: .15rem; vertical-align: top; }
.th-rail-toggle { display: none; background: transparent; border: 0; font-size: 1.3rem; color: var(--th-fg); }

.th-main { flex: 1 1 auto; padding: 1.75rem; }
.th-container { max-width: 1240px; padding-left: 0; padding-right: 0; }

/* ---- Responsive: rail becomes off-canvas under 992px --------------- */
.th-rail-backdrop { display: none; }
@media (max-width: 991.98px) {
  .th-rail {
    position: fixed; top: 0; left: 0;
    transform: translateX(-100%);
    transition: transform .25s ease;
    box-shadow: var(--th-shadow);
  }
  body.th-rail-open .th-rail { transform: translateX(0); }
  body.th-rail-open .th-rail-backdrop {
    display: block; position: fixed; inset: 0; z-index: 1035;
    background: rgba(17,18,14,.4);
  }
  .th-rail-toggle { display: inline-flex; }
  .th-main { padding: 1.1rem; }
}

/* ===================================================================
   COMPONENTS (inside the workspace)
   =================================================================== */
.card, .panel, .card-sidebar {
  background: var(--th-surface); border: 1px solid var(--th-border);
  border-radius: var(--th-radius); box-shadow: var(--th-shadow);
}
.card-header, .panel-heading { background: transparent; border-bottom: 1px solid var(--th-border); padding: 1.1rem 1.4rem; font-family: var(--th-display); }
.card-body { padding: 1.4rem; }

/* per-page WHMCS sidebar (inside content) */
.card-sidebar .list-group-item { border: 0; border-radius: var(--th-radius-sm); margin: 2px 8px; padding: .6rem .85rem; color: var(--th-fg); }
.card-sidebar .list-group-item:hover { background: rgba(198,242,78,.12); color: var(--th-fg); }
.card-sidebar .list-group-item.active { background: var(--th-accent); color: var(--th-accent-fg); font-weight: 600; }

/* neutralize rainbow accent cards (portal home) */
[class*="card-accent-"] { background: var(--th-surface) !important; border: 1px solid var(--th-border) !important; border-radius: var(--th-radius) !important; color: var(--th-fg) !important; box-shadow: var(--th-shadow); transition: border-color .15s ease, transform .15s ease; }
[class*="card-accent-"]:hover { border-color: rgba(198,242,78,.7) !important; transform: translateY(-2px); }
[class*="card-accent-"] i { color: var(--th-accent-ink) !important; }

/* tables */
.table { color: var(--th-fg); }
.table thead th { border-bottom: 1px solid var(--th-border); font-size: .76rem; letter-spacing: .05em; text-transform: uppercase; color: var(--th-muted); font-weight: 600; }
.table td, .table th { border-top: 1px solid var(--th-border); padding: .95rem .8rem; }
.table-hover tbody tr:hover { background: rgba(198,242,78,.06); }

/* buttons */
.btn { border-radius: var(--th-radius-sm); font-weight: 600; padding: .6rem 1.2rem; }
.btn-primary, .btn-success, .btn-order-now { background: var(--th-accent) !important; border-color: var(--th-accent) !important; color: var(--th-accent-fg) !important; }
.btn-primary:hover,.btn-primary:focus,.btn-primary:active,
.btn-success:hover,.btn-success:focus,.btn-order-now:hover { background: var(--th-accent-hover) !important; border-color: var(--th-accent-hover) !important; color: var(--th-accent-fg) !important; }
.btn-primary:focus { box-shadow: 0 0 0 .2rem var(--th-ring) !important; }
.btn-outline-primary { color: var(--th-accent-ink) !important; border-color: var(--th-accent-ink) !important; }
.btn-outline-primary:hover { background: var(--th-accent) !important; border-color: var(--th-accent) !important; color: var(--th-accent-fg) !important; }
.btn-secondary, .btn-default { background: var(--th-surface); border-color: var(--th-border); color: var(--th-fg); }
.btn-secondary:hover, .btn-default:hover { background: var(--th-bg); border-color: var(--th-muted); color: var(--th-fg); }
.btn-info, .btn-warning { background: var(--th-fg) !important; border-color: var(--th-fg) !important; color: #fff !important; }

/* state colors */
.text-primary { color: var(--th-accent-ink) !important; }
.bg-primary { background: var(--th-accent) !important; color: var(--th-accent-fg) !important; }
.badge-primary { background: var(--th-accent); color: var(--th-accent-fg); }
.alert { border-radius: var(--th-radius-sm); border: 1px solid var(--th-border); background: var(--th-surface); color: var(--th-fg); }
.alert-primary { background: #f3fbdc; border-color: var(--th-accent); color: #2f3f08; }
.list-group-item.active { background: var(--th-accent); border-color: var(--th-accent); color: var(--th-accent-fg); }
.page-item.active .page-link { background: var(--th-accent); border-color: var(--th-accent); color: var(--th-accent-fg); }
.page-link { color: var(--th-accent-ink); }
.nav-pills .nav-link.active { background: var(--th-accent); color: var(--th-accent-fg); }
.progress-bar { background: var(--th-accent); }
.custom-control-input:checked~.custom-control-label::before { background: var(--th-accent) !important; border-color: var(--th-accent) !important; }

/* forms */
.form-control, .custom-select { border-radius: var(--th-radius-sm); border-color: var(--th-border); padding: .65rem .9rem; height: auto; }
.form-control:focus, .custom-select:focus { border-color: var(--th-accent) !important; box-shadow: 0 0 0 .2rem var(--th-ring) !important; }

/* checkout / order form */
.products .product { background: var(--th-surface); border: 1px solid var(--th-border) !important; border-radius: var(--th-radius); box-shadow: var(--th-shadow); padding: 1.6rem 1.8rem !important; margin-bottom: 1.25rem; transition: border-color .15s ease, transform .15s ease; }
.products .product:hover { border-color: rgba(198,242,78,.7) !important; transform: translateY(-2px); }
.product-pricing .price, .price, .font-size-36 { font-family: var(--th-display); font-weight: 700; color: var(--th-fg) !important; }
.cart-sidebar, .cart-body, .order-summary { background: var(--th-surface); border: 1px solid var(--th-border); border-radius: var(--th-radius); box-shadow: var(--th-shadow); }

/* Cap oversized order-form / content graphics (the giant server+globe SVGs).
   WHMCS uses Font Awesome webfont icons (<i>), not <svg>, so this is safe. */
.th-content svg { max-width: 100%; max-height: 80px; height: auto; }
.th-content img { max-width: 100%; height: auto; }
/* order-form category icons are oversized SVGs — make them a tidy icon row */
#order-standard_cart svg { max-width: 40px !important; max-height: 40px !important; }
#order-standard_cart img { max-width: 100%; height: auto; }

/* footer */
.th-footer { border-top: 1px solid var(--th-border); padding: 1.5rem 1.75rem; }
.th-footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.th-copyright { color: var(--th-muted); font-size: .85rem; margin: 0; }
.th-footer-links a, .th-locale-btn { color: var(--th-muted); font-size: .85rem; padding: 0 .55rem; background: transparent; border: 0; }
.th-footer-links a:hover, .th-locale-btn:hover { color: var(--th-fg); }

/* ===================================================================
   DASHBOARD (clientareahome)
   =================================================================== */
.th-dash { display: flex; flex-direction: column; gap: 1.5rem; }
.th-eyebrow { font-family: var(--th-display); text-transform: uppercase; letter-spacing: .09em; font-size: .72rem; color: var(--th-accent-ink); font-weight: 600; }
.th-dash-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.th-dash-title { font-size: 2rem; margin: .35rem 0 0; }
.th-dash-sub { color: var(--th-muted); margin: .4rem 0 0; }
.th-dash-actions { display: flex; gap: .6rem; flex-wrap: wrap; }

.th-stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.th-stat {
  display: flex; flex-direction: column; gap: .3rem;
  padding: 1.25rem 1.35rem;
  background: var(--th-surface); border: 1px solid var(--th-border);
  border-radius: var(--th-radius); box-shadow: var(--th-shadow);
  color: var(--th-fg); transition: border-color .15s ease, transform .15s ease;
}
.th-stat:hover { border-color: rgba(198,242,78,.7); transform: translateY(-2px); color: var(--th-fg); }
.th-stat-label { font-size: .8rem; color: var(--th-muted); }
.th-stat-value { font-family: var(--th-display); font-size: 2rem; font-weight: 700; line-height: 1; }
.th-stat-meta { font-size: .78rem; color: var(--th-muted); }

.th-dash-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.th-panel { background: var(--th-surface); border: 1px solid var(--th-border); border-radius: var(--th-radius); box-shadow: var(--th-shadow); padding: 1.4rem; }
.th-panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.th-panel-head h2 { font-size: 1.05rem; margin: 0; }
.th-panel-head a { font-size: .85rem; }
.th-dash-list { list-style: none; margin: 0; padding: 0; }
.th-dash-list li { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .85rem 0; border-bottom: 1px solid var(--th-border); }
.th-dash-list li:last-child { border-bottom: 0; }
.th-dash-list-title { display: block; font-weight: 600; }
.th-dash-list-meta { display: block; font-size: .82rem; color: var(--th-muted); }
.th-pill { font-size: .72rem; font-weight: 600; padding: .2rem .65rem; border-radius: 999px; text-transform: capitalize; white-space: nowrap; }
.th-pill-active { background: #e4f7d0; color: #2f5d00; }
.th-pill-pending { background: #fff3cd; color: #7a5b00; }
.th-pill-suspended, .th-pill-terminated, .th-pill-cancelled, .th-pill-fraud { background: #f1e0e0; color: #7a2e2e; }
.th-balance { text-align: center; padding: 1rem 0; }
.th-balance-label { display: block; color: var(--th-muted); font-size: .85rem; }
.th-balance-value { display: block; font-family: var(--th-display); font-size: 2rem; font-weight: 700; margin: .3rem 0 1rem; }
.th-empty { color: var(--th-muted); padding: 1.5rem 0; text-align: center; }

@media (max-width: 991.98px) {
  .th-stat-grid { grid-template-columns: repeat(2, 1fr); }
  .th-dash-cols { grid-template-columns: 1fr; }
  .th-dash-title { font-size: 1.6rem; }
}
