:root {
  --primary: #064e3b;
  --primary-dark: #043d2e;
  --primary-light: #e8f5ee;
  --accent: #f0a500;
  --danger: #c0392b;
  --text: #1a1a1a;
  --muted: #6b7280;
  --border: #e5e7eb;
  --bg: #f8faf9;
  --card: #ffffff;
  --sidebar: #0d3b24;
  --sidebar-text: #d1e7dd;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --font: 'Inter', system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  /* overflow-x on html/body breaks position:sticky in Chromium */
  max-width: 100%;
}
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  min-height: 100vh;
  max-width: 100%;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Navbar */
.navbar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}
.navbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: .75rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.logo {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: .5rem;
  text-decoration: none;
}
.logo-icon {
  width: 32px; height: 32px;
  background: var(--primary);
  color: #fff;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: .85rem;
}
.nav-links { display: flex; gap: 1.25rem; flex: 1; }
.nav-links a { color: var(--text); font-weight: 500; font-size: .925rem; text-decoration: none; }
.nav-links a:hover, .nav-links a.active { color: var(--primary); }
/* Nested header dropdown */
.nav-links {
  position: relative;
  z-index: 40;
}
.nav-item {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.nav-item.has-dropdown { z-index: 41; }
.nav-item.has-dropdown.open { z-index: 450; }
.nav-item .nav-parent {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  cursor: pointer;
  user-select: none;
}
.nav-caret {
  font-size: .65rem;
  opacity: .75;
  transition: transform .15s ease;
  display: inline-block;
}
.nav-item.open .nav-caret { transform: rotate(180deg); }
.nav-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 0px);
  left: 0;
  min-width: 13.5rem;
  padding: .35rem 0;
  margin: 0;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.14);
  z-index: 500;
}
/* Hover bridge without clipping page */
.nav-dropdown::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -10px;
  height: 10px;
}
.nav-item.has-dropdown:hover > .nav-dropdown,
.nav-item.has-dropdown:focus-within > .nav-dropdown,
.nav-item.has-dropdown.open > .nav-dropdown {
  display: block;
}
.nav-dropdown a {
  display: block;
  padding: .6rem 1rem;
  color: #111827 !important;
  font-weight: 500;
  font-size: .9rem;
  text-decoration: none !important;
  white-space: nowrap;
  background: transparent;
}
.nav-dropdown a:hover,
.nav-dropdown a:focus {
  background: #f3f4f6;
  color: var(--primary, #064e3b) !important;
}
@media (max-width: 900px) {
  .nav-item.has-dropdown {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }
  .nav-item.has-dropdown:hover > .nav-dropdown {
    display: none;
  }
  .nav-item.has-dropdown.open > .nav-dropdown {
    display: block;
    position: static;
    box-shadow: none;
    border: 0;
    border-radius: 0;
    padding: .2rem 0 .35rem .9rem;
    background: transparent;
  }
  .nav-dropdown::before { display: none; }
}

.nav-auth { display: flex; gap: .75rem; align-items: center; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .55rem 1.1rem; border-radius: var(--radius); font-weight: 600;
  font-size: .9rem; border: none; cursor: pointer; text-decoration: none;
  transition: background .15s, transform .1s;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); text-decoration: none; color: #fff; }
.btn-outline { background: transparent; border: 1.5px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary-light); text-decoration: none; }
.btn-accent { background: var(--accent); color: #1a1a1a; }
.btn-sm { padding: .35rem .75rem; font-size: .8rem; }
.btn-block { width: 100%; }

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, #0a4d2e 100%);
  color: #fff;
  padding: 3.5rem 1.25rem 4rem;
  text-align: center;
}
.hero h1 { font-size: 2.25rem; font-weight: 800; margin-bottom: .5rem; letter-spacing: -.02em; }
.hero p { opacity: .9; font-size: 1.1rem; margin-bottom: 2rem; }

/* Search box */
.search-box {
  background: var(--card);
  border-radius: 12px;
  padding: 1.5rem;
  max-width: 900px;
  margin: -2.5rem auto 2rem;
  box-shadow: 0 8px 30px rgba(0,0,0,.12);
  position: relative;
  z-index: 10;
}
.search-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr 1fr auto;
  gap: .75rem;
  align-items: end;
}
@media (max-width: 900px) {
  .search-grid { grid-template-columns: 1fr 1fr; }
  .search-grid .span-2 { grid-column: span 2; }
}
.form-group { display: flex; flex-direction: column; gap: .3rem; }
.form-group label { font-size: .75rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.form-control {
  padding: .6rem .85rem; border: 1.5px solid var(--border); border-radius: var(--radius);
  font-size: .925rem; background: #fff; width: 100%;
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(13,110,63,.15); }

/* Stats */
.stats-row-6 {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}
@media (max-width: 1000px) {
  .stats-row-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .stats-row-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.stats-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem;
  max-width: 900px; margin: 0 auto 2.5rem; padding: 0 1.25rem;
}
@media (max-width: 600px) { .stats-row { grid-template-columns: 1fr 1fr; } }
.stat-card {
  background: var(--card); border-radius: var(--radius); padding: 1.25rem; text-align: center;
  box-shadow: var(--shadow);
}
.stat-card .num { font-size: 1.75rem; font-weight: 800; color: var(--primary); }
.stat-card .label { font-size: .8rem; color: var(--muted); text-transform: uppercase; }

/* Container */
.container { max-width: 1200px; margin: 0 auto; padding: 1.5rem 1.25rem; }
.page-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 1.25rem; }

/* Tables */
.table-wrap { overflow-x: auto; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { padding: .85rem 1rem; text-align: left; border-bottom: 1px solid var(--border); }
th { background: #f3f4f6; font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
tr:hover td { background: #f9fafb; }
.badge {
  display: inline-block; padding: .2rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 600;
}
.badge-public { background: #dbeafe; color: #1e40af; }
.badge-private { background: #fce7f3; color: #9d174d; }
.badge-mission { background: #fef3c7; color: #92400e; }
.badge-primary { background: var(--primary-light); color: var(--primary-dark); }
.badge-secondary { background: #e0e7ff; color: #3730a3; }

/* Alerts */
.alert {
  padding: .85rem 1.1rem; border-radius: var(--radius); margin-bottom: 1rem; font-size: .9rem;
}
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.alert-info { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }

/* Cards */
.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1.5rem; margin-bottom: 1.25rem;
}
.card-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 1rem; }

/* Plan limits banner */
.plan-banner {
  background: linear-gradient(90deg, #fef3c7, #fde68a);
  border: 1px solid #f59e0b;
  border-radius: var(--radius);
  padding: .85rem 1.25rem;
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 1.25rem; font-size: .9rem;
}

/* Pricing cards */
.pricing-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.25rem;
}
.pricing-card {
  background: var(--card); border-radius: 12px; padding: 1.75rem; box-shadow: var(--shadow);
  border: 2px solid transparent; position: relative;
}
.pricing-card.featured { border-color: var(--primary); }
.pricing-card h3 { font-size: 1.15rem; margin-bottom: .25rem; }
.pricing-card .price { font-size: 2rem; font-weight: 800; color: var(--primary); margin: .5rem 0 1rem; }
.pricing-card .price span { font-size: .9rem; font-weight: 500; color: var(--muted); }
.pricing-card ul { list-style: none; margin-bottom: 1.5rem; }
.pricing-card ul li { padding: .35rem 0; font-size: .9rem; display: flex; gap: .5rem; }
.pricing-card ul li::before { content: '✓'; color: var(--primary); font-weight: 700; }

/* Auth layout */
.auth-page {
  min-height: 100vh; display: grid; place-items: center;
  background: linear-gradient(135deg, #064e3b 0%, #0a3d24 100%);
  padding: 2rem;
}
.auth-card {
  background: #fff; border-radius: 12px; padding: 2.25rem; width: 100%; max-width: 420px;
  box-shadow: 0 20px 50px rgba(0,0,0,.25);
}
.auth-card h1 { font-size: 1.5rem; margin-bottom: .25rem; }
.auth-card .sub { color: var(--muted); margin-bottom: 1.5rem; font-size: .9rem; }
.auth-card .form-group { margin-bottom: 1rem; }
.auth-footer { text-align: center; margin-top: 1.25rem; font-size: .9rem; color: var(--muted); }

/* Customer / Admin layout */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px; background: var(--sidebar); color: var(--sidebar-text);
  flex-shrink: 0; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.sidebar-brand {
  padding: 1.25rem; font-weight: 700; font-size: 1rem; color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.1); display: flex; align-items: center; gap: .5rem;
}
.sidebar-nav { flex: 1; padding: 1rem 0; overflow-y: auto; }
.sidebar-nav a {
  display: flex; align-items: center; gap: .65rem; padding: .6rem 1.25rem;
  color: var(--sidebar-text); font-size: .875rem; text-decoration: none; transition: background .1s;
}
.sidebar-nav a:hover, .sidebar-nav a.active { background: rgba(255,255,255,.1); color: #fff; }
.sidebar-nav .section-label {
  padding: .75rem 1.25rem .35rem; font-size: .7rem; text-transform: uppercase;
  letter-spacing: .06em; color: rgba(255,255,255,.4); font-weight: 600;
}
.main-content { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  background: var(--card); border-bottom: 1px solid var(--border);
  padding: .75rem 1.5rem; display: flex; justify-content: space-between; align-items: center;
}
.topbar-user { font-size: .9rem; color: var(--muted); }
.content-area { padding: 1.5rem; flex: 1; }

/* Footer */
.footer {
  background: #0a3d24; color: rgba(255,255,255,.7); padding: 2rem 1.25rem; margin-top: 3rem;
  text-align: center; font-size: .85rem;
}
.footer a { color: #fff; }

/* Pagination */
.pagination { display: flex; gap: .4rem; margin-top: 1.25rem; justify-content: center; }
.pagination a, .pagination span {
  padding: .4rem .75rem; border-radius: var(--radius); border: 1px solid var(--border);
  font-size: .85rem; background: var(--card); color: var(--text); text-decoration: none;
}
.pagination a:hover { background: var(--primary-light); }
.pagination .current { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Empty state */
.empty { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.empty svg { opacity: .4; margin-bottom: 1rem; }

@media (max-width: 768px) {
  .sidebar { display: none; }
  .nav-links { display: none; }

}
/* ── Advanced UI ─────────────────────────────────────────── */
.logo-img { height: 36px; width: auto; display: block; }
.logo-text { font-weight: 700; }
.nav-toggle { display: none; background: none; border: none; font-size: 1.4rem; cursor: pointer; }

.hero-advanced {
  padding: 4rem 1.25rem 5rem;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(255,255,255,.12), transparent 50%),
    linear-gradient(135deg, #064e3b 0%, #0a4d2e 55%, #063820 100%);
}
.hero-inner { max-width: 720px; margin: 0 auto; text-align: center; }
.hero-badge {
  display: inline-block; background: rgba(255,255,255,.15); color: #fff;
  padding: .3rem .75rem; border-radius: 999px; font-size: .8rem; font-weight: 600;
  margin-bottom: 1rem; letter-spacing: .02em;
}
.hero-sub { opacity: .92; font-size: 1.1rem; margin: .75rem 0 1.5rem; line-height: 1.55; }
.hero-actions { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; }
.btn-ghost {
  background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.35);
}
.btn-ghost:hover { background: rgba(255,255,255,.22); color: #fff; text-decoration: none; }
.btn-lg { padding: .7rem 1.35rem; font-size: 1rem; }
.form-control-lg { padding: .85rem 1rem; font-size: 1.05rem; }

.search-box-lg { max-width: 960px; padding: 1.75rem; }
.search-box-header { margin-bottom: 1.15rem; }
.search-box-header h2 { font-size: 1.2rem; margin-bottom: .2rem; }
.search-box-header p { color: var(--muted); font-size: .9rem; }
.search-grid-advanced {
  grid-template-columns: repeat(3, 1fr);
}
.search-grid-advanced .span-full { grid-column: 1 / -1; }
@media (max-width: 800px) {
  .search-grid-advanced { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  .search-grid-advanced { grid-template-columns: 1fr; }
}

.feature-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.15rem;
  margin-bottom: 2rem;
}
.feature-card {
  background: var(--card); border-radius: 12px; padding: 1.35rem; box-shadow: var(--shadow);
  text-decoration: none; color: inherit; transition: transform .15s, box-shadow .15s;
  border: 1px solid transparent;
}
.feature-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.1); border-color: var(--primary-light); text-decoration: none; }
.feature-icon { font-size: 1.75rem; margin-bottom: .5rem; }
.feature-card h3 { font-size: 1.05rem; margin-bottom: .35rem; }
.feature-card p { color: var(--muted); font-size: .88rem; line-height: 1.45; }

.footer-grid {
  max-width: 1200px; margin: 0 auto 1.25rem; display: grid;
  grid-template-columns: 2fr 1fr; gap: 1.5rem; text-align: left; padding: 0 1.25rem;
}
.footer-grid a { display: block; color: #fff; margin: .35rem 0; opacity: .85; }
.footer-copy { opacity: .6; }

/* Downloads */
.downloads-layout {
  display: grid; grid-template-columns: 240px 1fr; gap: 1.25rem; align-items: start;
}
@media (max-width: 800px) {
  .downloads-layout { grid-template-columns: 1fr; }
}
.folder-tree .tree { list-style: none; }
.folder-tree .tree a {
  display: block; padding: .4rem .5rem; border-radius: 6px; color: var(--text);
  text-decoration: none; font-size: .9rem;
}
.folder-tree .tree a:hover, .folder-tree .tree a.active {
  background: var(--primary-light); color: var(--primary-dark);
}
.folder-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .85rem;
  margin-bottom: 1.5rem;
}
.folder-card {
  display: flex; align-items: center; gap: .75rem; padding: 1rem;
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  text-decoration: none; color: inherit; border: 1px solid var(--border);
}
.folder-card:hover { border-color: var(--primary); text-decoration: none; }
.folder-card-admin { justify-content: space-between; }
.folder-icon { font-size: 1.5rem; }
.file-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .85rem;
}
.file-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem; display: flex; flex-direction: column; gap: .65rem; box-shadow: var(--shadow);
}
.file-icon { font-size: 1.75rem; }
.file-actions { display: flex; gap: .4rem; margin-top: auto; }
.section-label {
  font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted);
  font-weight: 700; margin: 1.25rem 0 .65rem;
}
.breadcrumbs { font-size: .85rem; color: var(--muted); margin-bottom: .5rem; }
.breadcrumbs a { color: var(--primary); }
.muted { color: var(--muted); }
.small { font-size: .8rem; }
.page-header-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; }

.preview-header { margin-bottom: 1rem; }
.preview-title-row { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.file-icon-lg { font-size: 2.5rem; }
.preview-frame {
  width: 100%; height: 70vh; border: 1px solid var(--border); border-radius: 8px; background: #f9fafb;
}
.preview-image-wrap { text-align: center; }
.preview-image-wrap img { max-width: 100%; max-height: 75vh; border-radius: 8px; }
.preview-text {
  background: #1e1e1e; color: #d4d4d4; padding: 1rem; border-radius: 8px;
  overflow: auto; max-height: 70vh; font-size: .85rem; white-space: pre-wrap;
}

.admin-media-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1.5rem;
}
@media (max-width: 700px) {
  .admin-media-grid { grid-template-columns: 1fr; }
}
.check { display: flex; align-items: center; gap: .4rem; font-size: .9rem; cursor: pointer; }

@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .nav-links { display: none; width: 100%; flex-direction: column; }
  .nav-links.open { display: flex; }
  .navbar-inner { flex-wrap: wrap; }

}
/* Navbar responsive polish */
.navbar-inner {
  max-width: 1280px;
  flex-wrap: nowrap;
  gap: 1rem;
}
.logo-text {
  max-width: 160px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: .95rem;
}
.nav-links {
  flex-wrap: wrap;
  gap: .65rem 1rem;
  justify-content: center;
}
.nav-links a {
  font-size: .875rem;
  white-space: nowrap;
}
.nav-auth { flex-shrink: 0; }

@media (max-width: 1100px) {
  .nav-links { gap: .5rem .75rem; }
  .logo-text { max-width: 120px; }
}
@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; margin-left: auto; }
  .nav-links {
    display: none;
    width: 100%;
    order: 4;
    flex-direction: column;
    padding: .5rem 0 1rem;
    border-top: 1px solid var(--border);
    margin-top: .5rem;
  }
  .nav-links.open { display: flex; }
  .nav-auth { order: 3; }
  .navbar-inner { flex-wrap: wrap; }

}
/* Sidebar scroll + width */
.sidebar {
  width: 250px;
  overflow-y: auto;
}
.sidebar-admin { background: #111827 !important; }
.sidebar-nav a {
  border-radius: 6px;
  margin: 0 .5rem;
  padding: .55rem 0.85rem;
}
.sidebar-nav a.active {
  background: rgba(255,255,255,.12);
  color: #fff;
}

/* Downloads missing-table banner */
.migrate-hint {
  background: #fff7ed;
  border: 1px solid #fdba74;
  color: #9a3412;
  padding: 1rem 1.25rem;
  border-radius: 8px;
  margin-bottom: 1.25rem;
  font-size: .92rem;
  line-height: 1.5;
}
.migrate-hint code {
  background: #ffedd5;
  padding: .1rem .35rem;
  border-radius: 4px;
  font-size: .85em;
}

/* Search form tighter on home */
.search-grid-advanced {
  align-items: end;
}
.form-group-btn .btn { width: 100%; }

/* Hero CTA ghost on green */
.btn-ghost {
  background: rgba(255,255,255,.12);
  color: #fff !important;
  border: 1px solid rgba(255,255,255,.4);
}
.btn-ghost:hover {
  background: rgba(255,255,255,.22);
  text-decoration: none;
}

/* Auth split layout */
.auth-body { min-height: 100vh; margin: 0; background: #f0f4f1; }
.auth-split {
  display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh;
}
.auth-panel-brand {
  background: linear-gradient(160deg, #064e3b, #0a3d24);
  color: #fff; padding: 3rem 2.5rem; display: flex; flex-direction: column; justify-content: center;
}
.auth-panel-brand h2 { font-size: 1.75rem; margin: 2rem 0 1rem; line-height: 1.3; }
.auth-panel-brand ul { list-style: none; line-height: 1.9; opacity: .92; font-size: .95rem; }
.auth-panel-brand ul li::before { content: '✓ '; font-weight: 700; }
.auth-panel-form {
  padding: 2.5rem; max-width: 460px; margin: auto; width: 100%;
}
.auth-panel-form h1 { font-size: 1.5rem; margin-bottom: .25rem; }
.auth-panel-form .sub { color: var(--muted); margin-bottom: 1.25rem; font-size: .9rem; }
.reg-steps {
  display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1.25rem; font-size: .78rem; font-weight: 600;
}
.reg-steps span {
  padding: .35rem .65rem; border-radius: 999px; background: #e5e7eb; color: #6b7280;
}
.reg-steps span.on { background: var(--primary-light); color: var(--primary-dark); }
.portal-hero { margin-bottom: 1.25rem; background: linear-gradient(90deg, #e8f5ee, #fff); }
@media (max-width: 800px) {
  .auth-split { grid-template-columns: 1fr; }
  .auth-panel-brand { padding: 1.75rem; min-height: auto; }
  .auth-panel-brand h2 { font-size: 1.25rem; margin: 1rem 0 .5rem; }
}

.navbar { position: sticky; top: 0; z-index: 200; }
/* Overridden to relative when nested under .site-top-sticky */
.topbar-sticky { position: sticky; top: 0; z-index: 50; background: var(--card); }
/* wa-float position defined at end — left side */

.pay-methods { display: grid; gap: 1rem; }
.pay-card {
  border: 1px solid var(--border); border-radius: 12px; padding: 1.15rem;
  background: #fafafa;
}
.pay-card h3 { margin: 0 0 .35rem; font-size: 1.05rem; }

/* Live search */
.live-results {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px);
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 12px 30px rgba(0,0,0,.12); z-index: 50; max-height: 320px; overflow: auto;
}
.form-group { position: relative; }
.live-item {
  display: block; padding: .65rem .9rem; border-bottom: 1px solid var(--border);
  text-decoration: none; color: inherit;
}
.live-item:hover { background: var(--primary-light); }
.live-item span { display: block; font-size: .8rem; color: var(--muted); }
.live-empty, .live-more { padding: .75rem; font-size: .85rem; color: var(--muted); }

/* Pagination First/Prev/Next/Last */
.pagination { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; margin: 1.25rem 0; }
.pagination a, .pagination span {
  min-width: 2.25rem; height: 2.25rem; padding: 0 .55rem;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px; border: 1px solid var(--border); font-size: .875rem; text-decoration: none; color: var(--text);
}
.pagination a:hover { background: var(--primary-light); border-color: var(--primary); color: var(--primary-dark); }
.pagination .current { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 600; }
.pagination .disabled { opacity: .4; cursor: not-allowed; }
.pagination .ellipsis { border: none; min-width: auto; }

/* Ads */
.ad-slot { margin: 1rem 0; text-align: center; min-height: 0; }
.ad-slot-header, .ad-slot-footer { padding: .5rem 0; }

/* Download lock */
.download-lock { background: #fff7ed; border: 1px solid #fdba74; margin-bottom: 1rem; }
.preview-fade {
  position: absolute; left: 0; right: 0; bottom: 0; height: 120px;
  background: linear-gradient(transparent, #fff); pointer-events: none;
}

/* Responsive polish */
@media (max-width: 768px) {
  .hero h1 { font-size: 1.75rem; }
  .search-grid, .search-grid-advanced { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .downloads-layout { grid-template-columns: 1fr; }
  .folder-tree { position: static; max-height: none; }
  .app-shell { flex-direction: column; }
  .sidebar { width: 100%; position: relative; height: auto; max-height: none; }
  .pay-methods { grid-template-columns: 1fr; }
  .admin-media-grid { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .stats-row { grid-template-columns: 1fr; }
  .navbar-inner { padding: .65rem 0; }
  .btn { width: auto; }
}

.hero-portal {
  background: linear-gradient(145deg, #064e2d 0%, #064e3b 45%, #0a4d2e 100%);
  padding: 3.5rem 1rem 4.5rem;
}
.hero-portal .hero-inner { max-width: 820px; margin: 0 auto; text-align: center; }
.hero-portal h1 { font-size: clamp(1.75rem, 4vw, 2.75rem); line-height: 1.15; margin: .75rem 0; }
.section-heading { font-size: 1.35rem; margin: 0 0 1rem; font-weight: 700; }
.portal-about { margin: 2rem auto; }
.about-grid {
  display: grid; grid-template-columns: 1.2fr 1fr; gap: 2rem; align-items: start;
  background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 1.75rem;
}
.about-list { list-style: none; line-height: 1.85; }
.about-list li { padding: .35rem 0; border-bottom: 1px solid var(--border); }
.about-list li:last-child { border-bottom: none; }
.cta-band { margin: 2.5rem auto 3rem; }
.cta-band-inner {
  display: flex; flex-wrap: wrap; gap: 1.25rem; align-items: center; justify-content: space-between;
  background: linear-gradient(90deg, #064e3b, #0a4d2e); color: #fff;
  border-radius: 16px; padding: 1.75rem 1.5rem;
}
.cta-band-inner h2 { margin: 0 0 .35rem; font-size: 1.35rem; }
.cta-band-inner p { margin: 0; opacity: .9; }
.live-badge {
  display: inline-block; font-style: normal; font-size: .65rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em; padding: .15rem .4rem; border-radius: 4px;
  margin-right: .4rem; vertical-align: middle;
}
.live-badge.school { background: #e8f5ee; color: #064e3b; }
.live-badge.file { background: #fff7ed; color: #9a3412; }
@media (max-width: 768px) {
  .about-grid { grid-template-columns: 1fr; }
  .hero-portal { padding: 2.5rem 1rem 3.25rem; }

}
/* Decorative landing */
.hero-portal {
  position: relative;
  overflow: hidden;
}
.hero-portal::before,
.hero-portal::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: .35;
  pointer-events: none;
}
.hero-portal::before {
  width: 280px; height: 280px; background: #f0a500;
  top: -80px; right: 10%;
}
.hero-portal::after {
  width: 220px; height: 220px; background: #34d399;
  bottom: -60px; left: 5%;
}
.hero-portal .hero-inner { position: relative; z-index: 1; }
.hero-badge {
  display: inline-block;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.25);
  padding: .35rem .85rem;
  border-radius: 999px;
  font-size: .8rem;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.search-box-lg {
  margin-top: -2.25rem;
  position: relative;
  z-index: 2;
  box-shadow: 0 20px 50px rgba(13,110,63,.15);
  border-radius: 16px;
}
.portal-about .about-grid {
  box-shadow: 0 8px 30px rgba(0,0,0,.04);
}
.feature-card {
  transition: transform .15s ease, box-shadow .15s ease;
}
.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(0,0,0,.08);
  text-decoration: none;
}

/* Bar charts */
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: .5rem;
  height: 160px;
  padding: .5rem .25rem 0;
}
.bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
}
.bar {
  width: 100%;
  max-width: 36px;
  background: linear-gradient(180deg, var(--primary), #0a4d2e);
  border-radius: 6px 6px 2px 2px;
  min-height: 4px;
}
.bar-chart-alt .bar { background: linear-gradient(180deg, var(--accent), #c47f00); }
.bar-val { font-size: .7rem; color: var(--muted); margin-bottom: .25rem; }
.bar-lab { font-size: .7rem; color: var(--muted); margin-top: .35rem; text-align: center; }

/* Profile */
.profile-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 1.25rem;
}
.profile-side { text-align: center; }
.avatar-fallback {
  width: 88px; height: 88px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: grid; place-items: center; font-size: 2rem; font-weight: 700;
  margin: 0 auto .75rem;
}
.profile-avatar img {
  width: 88px; height: 88px; border-radius: 50%; object-fit: cover; margin-bottom: .75rem;
}
.badge {
  display: inline-block; background: var(--primary-light); color: var(--primary-dark);
  padding: .25rem .55rem; border-radius: 6px; font-size: .8rem; font-weight: 600;
}
.admin-data-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1.25rem;
  align-items: start;
}
@media (max-width: 900px) {
  .profile-layout, .admin-data-layout { grid-template-columns: 1fr; }
}
.announcement-bar {
  background: var(--accent); color: #111; text-align: center;
  padding: .5rem 1rem; font-size: .875rem; font-weight: 500;
}
.preview-lock-msg {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: rgba(15,23,42,.88); color: #fff;
  text-align: center; padding: .75rem; font-size: .9rem; z-index: 2;
}
.preview-lock-msg a { color: #fbbf24; }

/* Payment waiting */
.payment-wait { padding: 2rem 1.5rem; }
.wait-ring {
  width: 96px; height: 96px; margin: 0 auto;
  border-radius: 50%;
  border: 6px solid #e5e7eb;
  border-top-color: var(--primary);
  display: grid; place-items: center;
  font-size: 1.5rem; font-weight: 700; color: var(--primary);
  animation: spin 1s linear infinite;
}
.wait-ring.ok { animation: none; border-color: #16a34a; color: #16a34a; }
.wait-ring.fail { animation: none; border-color: #dc2626; color: #dc2626; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Preview protect */
.preview-frame.no-print-save {
  user-select: none;
  -webkit-user-select: none;
}
.preview-shield {
  position: absolute; inset: 48px 0 40px 0;
  z-index: 1; background: transparent;
}
.preview-lock-msg.soft {
  background: rgba(15,23,42,.72);
  font-size: .82rem;
}
@media print {
  .preview-page, .preview-frame, .preview-iframe, .navbar, .footer { display: none !important; }
  body::after { content: 'Printing preview is disabled. Please upgrade to download.'; }

}
/* UI polish */
.content-area h1.page-title { letter-spacing: -0.02em; }
.card { transition: box-shadow .15s ease; }
.card:hover { box-shadow: 0 8px 24px rgba(0,0,0,.05); }
.btn { transition: transform .1s ease, box-shadow .1s ease; }
.btn:active { transform: translateY(1px); }
.sidebar-nav a { transition: background .12s ease; }
.table-wrap table tr:hover td { background: rgba(13,110,63,.04); }
.folder-card-admin { display: flex; align-items: center; gap: .5rem; }
.stat-card .num { background: linear-gradient(135deg, var(--primary), #0a4d2e); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.topbar-sticky { backdrop-filter: blur(8px); background: rgba(255,255,255,.92); }

.folder-list {
  display: flex; flex-direction: column; gap: .5rem;
}
.folder-list .folder-card-admin {
  border: 1px solid var(--border); border-radius: 10px; padding: .65rem .85rem;
  background: var(--card);
}
.view-toggle { display: inline-flex; gap: .35rem; }

/* Soft UI elevation */
.portal-hero {
  background: linear-gradient(135deg, #e8f5ee, #fff);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
}
.btn-primary {
  box-shadow: 0 4px 14px rgba(13,110,63,.25);
}
.navbar {
  box-shadow: 0 1px 0 rgba(0,0,0,.04);
}
.nav-ajax-search {
  position: relative;
  flex: 0 1 220px;
  min-width: 140px;
  margin-right: .5rem;
}
.nav-ajax-search .live-results {
  position: absolute;
  left: 0; right: 0; top: 100%;
  z-index: 100;
  background: var(--card, #fff);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  max-height: 320px;
  overflow: auto;
}
.navbar-inner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
}

/* Public downloads two-column layout */
.downloads-split {
  display: grid;
  grid-template-columns: minmax(220px, 280px) 1fr;
  gap: 1.25rem;
  align-items: start;
}
.downloads-sidebar {
  position: sticky;
  top: 4.5rem;
  max-height: calc(100vh - 6rem);
  overflow: auto;
  padding: 1rem;
}
.folder-nav { list-style: none; margin: 0; padding: 0; }
.folder-nav li { margin: 0 0 .35rem; }
.folder-nav-item {
  display: flex; gap: .6rem; align-items: flex-start;
  padding: .55rem .65rem; border-radius: 10px;
  text-decoration: none; color: inherit;
  border: 1px solid transparent;
}
.folder-nav-item:hover { background: var(--primary-light, #e8f5ee); }
.folder-nav-item.active {
  background: var(--primary-light, #e8f5ee);
  border-color: var(--primary);
  font-weight: 600;
}
.folder-nav-icon { font-size: 1.15rem; line-height: 1.2; }
.folder-nav-item strong { display: block; font-size: .92rem; }
@media (max-width: 800px) {
  .downloads-split { grid-template-columns: 1fr; }
  .downloads-sidebar { position: static; max-height: none; }

}
/* Portal / admin mobile menu */
.mobile-bar {
  display: none;
  align-items: center;
  gap: .75rem;
  padding: .65rem 1rem;
  background: var(--card, #fff);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
}
.mobile-bar-title { flex: 1; font-size: .95rem; }
.sidebar-close {
  display: none;
  margin-left: auto;
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
}
.sidebar-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 50;
}
@media (max-width: 768px) {
  .mobile-bar { display: flex; }
  .desktop-topbar { display: none !important; }
  .sidebar {
    display: flex !important;
    position: fixed !important;
    left: 0; top: 0; bottom: 0;
    width: min(300px, 88vw) !important;
    z-index: 60;
    transform: translateX(-105%);
    transition: transform .2s ease;
    height: 100% !important;
    max-height: 100vh !important;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close { display: inline-block; }
  .app-shell { display: block; }
  .main-content { width: 100%; margin: 0; }
  body.sidebar-open { overflow: hidden; }
}
@media (min-width: 769px) {
  .sidebar-overlay { display: none !important; }
}

/* Dashboard UX */
.dash-welcome {
  display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: flex-end;
  margin-bottom: 1.25rem;
}
.dash-kicker {
  text-transform: uppercase; letter-spacing: .06em; font-size: .72rem; color: var(--muted); margin: 0 0 .25rem;
}
.dash-hello { margin: 0 0 .35rem; font-size: clamp(1.35rem, 3vw, 1.85rem); }
.dash-welcome-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.dash-kpi {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: .75rem; margin-bottom: 1.25rem;
}
.dash-kpi-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 1rem 1.1rem;
}
.dash-kpi-label { display: block; font-size: .75rem; color: var(--muted); margin-bottom: .35rem; }
.dash-kpi-value { font-size: 1.45rem; font-weight: 700; color: var(--primary); }
.dash-grid-2 { display: grid; grid-template-columns: 1.2fr 1fr; gap: 1rem; }
.dash-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.dash-action {
  display: flex; align-items: center; gap: .55rem; padding: .7rem .85rem;
  border: 1px solid var(--border); border-radius: 10px; text-decoration: none; color: inherit;
  background: var(--card); font-size: .9rem; font-weight: 500;
}
.dash-action:hover { border-color: var(--primary); background: var(--primary-light, #e8f5ee); }
.preview-locked { user-select: none; }
@media (max-width: 900px) {
  .dash-kpi { grid-template-columns: 1fr 1fr; }
  .dash-grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .dash-kpi { grid-template-columns: 1fr; }
  .dash-actions { grid-template-columns: 1fr; }

}
/* Fixed dashboard layout */
.dash-page { max-width: 1100px; }
.dash-header {
  display: flex; flex-wrap: wrap; gap: 1rem;
  justify-content: space-between; align-items: flex-end;
  margin-bottom: 1.5rem;
}
.dash-title { margin: 0 0 .35rem; font-size: clamp(1.5rem, 3vw, 1.9rem); line-height: 1.2; }
.dash-sub { margin: 0; color: var(--muted); font-size: .92rem; }
.dash-header-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.kpi-tile {
  background: #fff;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 14px;
  padding: 1.1rem 1.25rem;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.kpi-label {
  display: block;
  font-size: .78rem;
  font-weight: 500;
  color: #6b7280;
  margin-bottom: .4rem;
  letter-spacing: .02em;
}
.kpi-num {
  display: block;
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--primary, #064e3b);
  line-height: 1.15;
}
.chart-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.chart-card { margin: 0; }
.settings-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 1.25rem;
  align-items: start;
}
.settings-nav {
  position: sticky; top: 4.5rem;
  background: #fff; border: 1px solid var(--border);
  border-radius: 12px; padding: .5rem; max-height: calc(100vh - 6rem); overflow: auto;
}
.settings-nav button {
  display: block; width: 100%; text-align: left;
  border: 0; background: transparent; padding: .55rem .75rem;
  border-radius: 8px; cursor: pointer; font-size: .875rem; color: #374151;
}
.settings-nav button:hover { background: #f3f4f6; }
.settings-nav button.active { background: var(--primary-light, #e8f5ee); color: var(--primary); font-weight: 600; }
.settings-panel .settings-section { display: none; }
.settings-panel .settings-section.active { display: block; }
@media (max-width: 900px) {
  .kpi-row { grid-template-columns: 1fr 1fr; }
  .chart-row { grid-template-columns: 1fr; }
  .settings-shell { grid-template-columns: 1fr; }
  .settings-nav { position: static; max-height: none; display: flex; flex-wrap: wrap; gap: .25rem; }
  .settings-nav button { width: auto; }
}
@media (max-width: 520px) {
  .kpi-row { grid-template-columns: 1fr; }

}
/* Admin content compatibility under Tailwind shell */
.admin-content .card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 1.25rem;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
  margin-bottom: 1rem;
}
.admin-content .card-title { font-size: 0.95rem; font-weight: 600; margin: 0 0 1rem; }
.admin-content .btn { display: inline-flex; align-items: center; justify-content: center; }
.admin-content .table-wrap { overflow-x: auto; border-radius: 0.75rem; border: 1px solid #e5e7eb; background: #fff; }
.admin-content table { width: 100%; border-collapse: collapse; }
.admin-content th { background: #f9fafb; font-size: 0.75rem; text-transform: uppercase; letter-spacing: .03em; color: #6b7280; }
.admin-content .settings-shell { background: transparent; }
.admin-content .settings-nav { background: #fff; }

/* Card text auto-fit / no overflow */
.file-card, .folder-card, .feature-card, .pricing-card {
  min-width: 0;
  overflow: hidden;
}
.file-meta, .folder-card strong, .file-card strong, .feature-card h3 {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-card .file-meta strong {
  font-size: clamp(0.75rem, 2.2vw, 0.92rem);
  line-height: 1.3;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}
.file-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}
.file-price { display: block; width: 100%; }
.inline-buy { display: inline; margin: 0; }
.auth-home, .auth-home-link {
  display: inline-block;
  margin: 0.75rem 1rem;
  font-size: 0.9rem;
  color: var(--primary, #064e3b);
  text-decoration: none;
}
.auth-home-link:hover { text-decoration: underline; }


/* WhatsApp widget — left side, official green */
.wa-float {
  position: fixed;
  left: 1.1rem;
  bottom: 1.25rem;
  z-index: 9995;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background: #25D366;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.45);
  text-decoration: none;
  transition: transform .15s, box-shadow .15s;
}
.wa-float:hover {
  transform: scale(1.08);
  box-shadow: 0 8px 28px rgba(37, 211, 102, 0.55);
  color: #fff;
}
.wa-float svg { display: block; }
.float-cart { right: 1.1rem; left: auto; } /* keep cart on right */
@media (max-width: 600px) {
  .wa-float { left: .85rem; bottom: 1rem; width: 3.15rem; height: 3.15rem; }
}


/* WA + chat placement owned by Help cluster rules above */


/* ===== Downloads mobile-first layout ===== */
.downloads-page { padding-bottom: 2rem; }
.downloads-header {
  display: flex; flex-wrap: wrap; gap: .75rem; align-items: center;
  justify-content: space-between; margin-bottom: 1rem;
}
.downloads-search { display: flex; gap: .5rem; flex: 1; min-width: 200px; max-width: 420px; }
.downloads-search .form-control { flex: 1; }
.dl-mobile-bar {
  display: none;
  align-items: center; gap: .5rem;
  margin-bottom: .75rem;
  padding: .5rem .65rem;
  background: var(--card, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
  position: sticky; top: 3.25rem; z-index: 30;
}
.dl-mobile-title {
  flex: 1; font-weight: 600; font-size: .95rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dl-breadcrumb { font-size: .85rem; margin-bottom: .75rem; color: var(--muted, #64748b); }
.dl-breadcrumb a { color: inherit; }
.dl-breadcrumb .sep { margin: 0 .25rem; opacity: .5; }
.dl-folder-title-row {
  display: flex; align-items: center; gap: .65rem; margin-bottom: 1rem;
}
.dl-folder-title-row h2 { margin: 0; font-size: 1.25rem; }
.dl-back-icon {
  display: inline-grid; place-items: center;
  width: 2.25rem; height: 2.25rem; border-radius: 999px;
  border: 1px solid var(--border, #e5e7eb);
  text-decoration: none; color: inherit; font-weight: 700;
  background: #fff;
}
.dl-files-block { margin-bottom: 1.5rem; }
.dl-subfolders-block { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--border, #e5e7eb); }
.folder-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  width: 100%;
  min-width: 0;
}
.folder-row {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr);
  gap: 0.65rem;
  align-items: center;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--border, #e5e7eb);
  background: var(--card, #fff);
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}
.folder-row:hover {
  background: #f8fafc;
  border-color: var(--primary, #064e3b);
  text-decoration: none;
  color: inherit;
}
.folder-row .folder-icon {
  font-size: 1.25rem;
  line-height: 1;
  text-align: center;
  flex-shrink: 0;
}
.folder-row .folder-text {
  display: flex;
  flex-direction: column;
  min-width: 0; /* critical for ellipsis in grid */
  overflow: hidden;
}
.folder-row strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.92rem;
  line-height: 1.35;
  max-width: 100%;
}
.folder-row .muted {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.75rem;
}

@media (max-width: 768px) {
  .dl-mobile-bar { display: flex; }
  .dl-breadcrumb { display: none; } /* bar replaces breadcrumb on small screens */
  .downloads-layout {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: 1fr !important;
  }
  /* When inside a folder: hide sidebar folders on mobile (shown after files as subfolders) */
  .downloads-page.has-folder .downloads-sidebar { display: none; }
  .downloads-page.has-folder .dl-subfolders-block { display: block; }
  /* Root: show folder grid only */
  .downloads-page.at-root .downloads-sidebar { display: none; }
  .downloads-page.at-root .dl-root-panel { display: block; }
  .downloads-header .page-title { font-size: 1.25rem; }
  .file-grid {
    grid-template-columns: 1fr !important;
  }
  .file-card {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    gap: .5rem .75rem;
    align-items: center;
  }
  .file-card .file-icon { grid-row: 1 / span 2; }
  .file-card .file-actions {
    grid-column: 1 / -1;
    display: flex; flex-wrap: wrap; gap: .35rem;
  }
  .folder-grid {
    grid-template-columns: 1fr 1fr !important;
  }
}

@media (min-width: 769px) {
  .dl-mobile-bar { display: none; }
  /* Desktop: files first still, subfolders below; sidebar shows folder tree */
  .downloads-page.has-folder .dl-subfolders-block .folder-grid {
    /* optional compact */
  }
}

.live-search-wrap { position: relative; }
.live-search-results {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px);
  z-index: 60; background: #fff; border: 1px solid #e2e8f0;
  border-radius: 10px; box-shadow: 0 12px 28px rgba(0,0,0,.12);
  max-height: 280px; overflow: auto;
}
.live-search-results .lsr-item {
  display: grid; grid-template-columns: 52px 1fr; gap: .15rem .5rem;
  padding: .55rem .75rem; text-decoration: none; color: inherit;
  border-bottom: 1px solid #f1f5f9; font-size: .88rem;
}
.live-search-results .lsr-item:hover { background: #f0fdf4; }
.lsr-type { grid-row: span 2; font-size: .65rem; text-transform: uppercase;
  color: #064e3b; font-weight: 700; align-self: center; }
.lsr-name { font-weight: 600; }
.lsr-meta { font-size: .75rem; color: #64748b; grid-column: 2; }
.lsr-empty { padding: .75rem; color: #64748b; font-size: .85rem; }


/* Persistent legal notice — sticky + soft pulse */
.site-legal-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem 0.75rem;
  padding: 0.45rem 1rem;
  background: #0a3d24;
  color: rgba(255,255,255,0.92);
  font-size: 0.8rem;
  text-align: center;
}
/* Stacked sticky top: legal strip + navbar — solid colours (no text/bg conflict) */
.site-top-sticky {
  position: sticky;
  top: 0;
  z-index: 1100;
  background: #ffffff;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.1);
}
.site-top-sticky .site-legal-strip {
  position: relative;
  z-index: 2;
  background: #0a3d24;
  color: #ffffff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.site-top-sticky .site-legal-strip a {
  color: #ffffff;
}
.site-top-sticky .site-legal-strip .legal-strip-label,
.site-top-sticky .site-legal-strip strong {
  color: #ffffff;
}
.site-top-sticky .navbar {
  position: relative !important;
  top: auto !important;
  z-index: 1;
  background: #ffffff !important;
  color: var(--text, #1a1a1a);
  border-bottom: 1px solid var(--border, #e5e7eb);
  box-shadow: none;
}
.site-top-sticky .navbar .nav-links a {
  color: var(--text, #1a1a1a);
}
.site-top-sticky .navbar .nav-links a:hover,
.site-top-sticky .navbar .nav-links a.active {
  color: var(--primary, #064e3b);
}
.site-top-sticky .navbar .logo {
  color: var(--primary, #064e3b);
}
.site-legal-strip-sticky {
  position: relative;
  top: auto;
  z-index: auto;
}
.site-legal-strip-pulse {
  animation: legalStripPulse 4.5s ease-in-out infinite;
}
@keyframes legalStripPulse {
  0%, 100% { background: #0a3d24; box-shadow: 0 0 0 rgba(13,110,63,0); }
  50% { background: #0f5c38; box-shadow: 0 2px 14px rgba(13,110,63,0.35); }
}
.site-legal-strip a {
  color: #fff;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.site-legal-strip strong,
.site-legal-strip .legal-strip-label {
  font-weight: 700;
  opacity: 1;
  letter-spacing: 0.01em;
  animation: legalLabelShimmer 3.2s ease-in-out infinite;
}
@keyframes legalLabelShimmer {
  0%, 100% { opacity: 0.88; text-shadow: none; }
  50% { opacity: 1; text-shadow: 0 0 10px rgba(255,255,255,0.35); }
}
@media (prefers-reduced-motion: reduce) {
  .site-legal-strip-pulse,
  .site-legal-strip .legal-strip-label { animation: none; }
}


/* GDPR */
.gdpr-consent-block { margin: 1rem 0; }
.gdpr-check {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  font-size: 0.88rem;
  line-height: 1.45;
  color: #455a64;
  margin-bottom: 0.75rem;
  text-transform: none !important;
  letter-spacing: normal !important;
  font-weight: 400 !important;
  cursor: pointer;
}
.gdpr-check input { margin-top: 0.2rem; width: 1.05rem; height: 1.05rem; flex-shrink: 0; }
.gdpr-check a { color: #064e3b; font-weight: 600; }
.gdpr-optional { opacity: 0.95; }
.gdpr-cookie-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 10050; /* above WhatsApp, cart, typical chat widgets */
  background: #0a3d24;
  color: #fff;
  padding: 0.9rem 1rem calc(0.9rem + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -6px 24px rgba(0,0,0,.28);
  pointer-events: auto;
}
.gdpr-cookie-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.gdpr-cookie-inner p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.45;
  flex: 1 1 100%;
  max-width: 40rem;
  color: #fff;
}
.gdpr-cookie-inner a { color: #fff; font-weight: 600; text-decoration: underline; }
.gdpr-cookie-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
}
.gdpr-cookie-actions .btn {
  min-width: 7.5rem;
  min-height: 2.5rem;
  pointer-events: auto;
  position: relative;
  z-index: 1;
}
.gdpr-cookie-actions .btn-outline { border-color: #fff; color: #fff; background: transparent; }
.gdpr-cookie-actions .btn-primary {
  background: #f5c518;
  color: #1a1a1a;
  border: none;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(245, 197, 24, 0.45);
}
.gdpr-cookie-actions .btn-primary:hover {
  background: #e6b800;
  color: #111;
}
@media (max-width: 768px) {
  .gdpr-cookie-banner {
    padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom, 0px));
  }
  .gdpr-cookie-inner p { font-size: 0.88rem; }
  .gdpr-cookie-actions .btn {
    flex: 1 1 auto;
    max-width: 12rem;
  }
}
/* When banner visible, keep chat widgets above it on the right only */
body.gdpr-banner-open iframe[title*="chat"],
body.gdpr-banner-open div[class*="tawk"],
body.gdpr-banner-open #tidio-chat {
  bottom: var(--gdpr-banner-h, 8rem) !important;
}


/* Home dual tickers + particle net */
.page-with-particles {
  position: relative;
  isolation: isolate;
}
.page-with-particles.has-particles {
  background: transparent;
}
.particle-network-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}
.page-particle-content {
  position: relative;
  z-index: 1;
}

.home-tickers {
  margin: 1.25rem auto 1.75rem;
}
.home-tickers-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  align-items: stretch;
}
.home-ticker-card {
  --ticker-card-bg: #064e3b;
  background: var(--ticker-card-bg);
  color: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0,0,0,.1);
  display: flex;
  flex-direction: column;
  /* Landscape: fill available horizontal space, flexible height */
  min-height: 120px;
  max-height: min(220px, 28vh);
  min-width: 0;
  height: clamp(120px, 18vw, 200px);
  aspect-ratio: auto;
  width: 100%;
}
.home-ticker-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.85rem;
  border-bottom: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.12);
  flex-shrink: 0;
}
.home-ticker-head h2 {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.home-ticker-badge {
  font-size: 0.68rem;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  opacity: 0.88;
  white-space: nowrap;
}
.home-ticker-viewport {
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
  overflow: hidden;
  position: relative;
  mask-image: linear-gradient(to bottom, transparent, #000 12%, #000 88%, transparent);
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 12%, #000 88%, transparent);
}
.home-ticker-track {
  list-style: none;
  margin: 0;
  padding: 0.15rem 0;
}
.home-ticker-track li a {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.28rem 0.85rem;
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.home-ticker-track li a:hover {
  background: rgba(255,255,255,.1);
}
.ht-title {
  font-weight: 600;
  font-size: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1 1 auto;
  min-width: 0;
}
.ht-meta {
  font-size: 0.68rem;
  opacity: 0.75;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 0 1 38%;
  max-width: 42%;
  text-align: right;
}
.home-ticker-empty {
  padding: 0.65rem 0.85rem;
  margin: 0;
  opacity: 0.9;
  font-size: 0.8rem;
  line-height: 1.35;
}
.home-ticker-track-down {
  animation: homeTickerDown 28s linear infinite;
}
.home-ticker-track-up {
  animation: homeTickerUp 28s linear infinite;
}
.home-ticker-viewport:hover .home-ticker-track {
  animation-play-state: paused;
}
@keyframes homeTickerDown {
  0% { transform: translateY(-50%); }
  100% { transform: translateY(0); }
}
@keyframes homeTickerUp {
  0% { transform: translateY(0); }
  100% { transform: translateY(-50%); }
}

@media (max-width: 800px) {
  .home-tickers-grid {
    grid-template-columns: 1fr;
  }
  .home-ticker-card {
    aspect-ratio: auto;
    height: clamp(110px, 32vw, 160px);
    max-height: 180px;
  }
  .ht-meta {
    display: none;
  }
}

.pricing-page {
  position: relative;
}


/* Site-wide particle host — always behind page content */
.site-particle-host {
  position: fixed !important;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0 !important;
  pointer-events: none !important;
  background: transparent !important;
}
.site-particle-host .particle-network-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none !important;
  background: transparent !important;
}
body.has-site-particles {
  /* no isolation — it can interfere with sticky header stacking */
}
/* Keep stacking without killing position:sticky on the header */
body.has-site-particles > *:not(.site-particle-host):not(.site-top-sticky):not(.announcement-bar) {
  position: relative;
  z-index: 1;
}
body.has-site-particles > .site-top-sticky {
  position: sticky;
  top: 0;
  z-index: 1100;
}
body.has-site-particles > .announcement-bar {
  position: relative;
  z-index: 1101;
}
/* Keep modals above */
.license-modal, .gdpr-cookie-banner, .float-cart, .wa-float {
  z-index: 9990;
}

/* Modern 3-column footer */
.site-footer-modern {
  margin-top: 3rem;
  background: linear-gradient(160deg, #0a3d24 0%, #064e3b 45%, #0f2942 100%);
  color: #e8f5e9;
  padding: 2.75rem 0 1.25rem;
  border-top: 1px solid rgba(255,255,255,.08);
}
.site-footer-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.25rem;
}
.site-footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 2rem 2rem;
  align-items: start;
}
.site-footer-col {
  min-width: 0;
}
.site-footer-about .site-footer-apps {
  margin-top: 1.15rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.site-footer-heading {
  margin: 0 0 0.85rem;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  opacity: 0.85;
  color: #fff;
}
.site-footer-brand {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
}
.site-footer-tagline {
  margin: 0 0 0.75rem;
  opacity: 0.85;
  font-size: 0.92rem;
  line-height: 1.5;
}
.site-footer-body {
  font-size: 0.9rem;
  opacity: 0.9;
  line-height: 1.55;
}
.site-footer-body a { color: #fff; text-decoration: underline; }
.site-footer-body p { margin: 0 0 0.5rem; }
.site-footer-link-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}
.site-footer-link-list a {
  color: #e8f5e9;
  text-decoration: none;
  font-size: 0.95rem;
  opacity: 0.9;
  display: inline-block;
  padding: 0.15rem 0;
  transition: opacity .15s, transform .15s;
}
.site-footer-link-list a:hover {
  opacity: 1;
  transform: translateX(3px);
  text-decoration: underline;
}
.site-footer-cards {
  display: grid;
  gap: 0.65rem;
}
.site-footer-card {
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  backdrop-filter: blur(6px);
}
.site-footer-card strong {
  display: block;
  color: #fff;
  font-size: 0.92rem;
  margin-bottom: 0.25rem;
}
.site-footer-card p {
  margin: 0;
  font-size: 0.82rem;
  opacity: 0.88;
  line-height: 1.4;
}
.site-footer-card-link {
  display: inline-block;
  margin-top: 0.45rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
}
.site-footer-card-link:hover { text-decoration: underline; }
.site-footer-bottom {
  margin-top: 2rem;
  padding-top: 1.15rem;
  border-top: 1px solid rgba(255,255,255,.12);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: center;
  justify-content: space-between;
}
.site-footer-legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
}
.site-footer-legal-links a {
  color: #fff;
  font-size: 0.85rem;
  opacity: 0.85;
  text-decoration: none;
}
.site-footer-legal-links a:hover { opacity: 1; text-decoration: underline; }
.site-footer-copy {
  margin: 0;
  font-size: 0.82rem;
  opacity: 0.7;
}
@media (max-width: 960px) {
  .site-footer-grid {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 1.75rem 1.5rem;
  }
  .site-footer-support {
    grid-column: 1 / -1;
  }
}
@media (max-width: 640px) {
  .site-footer-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .site-footer-support {
    grid-column: auto;
  }
  .site-footer-bottom {
    flex-direction: column;
    align-items: center;
  }
}


/* Portal universal search + branding logos */
.sidebar-logo-img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
  flex-shrink: 0;
}
.sidebar-search.portal-universal-search {
  position: relative;
  padding: 0.5rem 0.85rem 0.75rem;
}
.sidebar-search .form-control {
  width: 100%;
  font-size: 0.85rem;
}
.sidebar-search .live-results {
  position: absolute;
  left: 0.85rem;
  right: 0.85rem;
  top: 100%;
  z-index: 50;
  max-height: 280px;
  overflow: auto;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,.12);
}
.mobile-bar-search {
  position: relative;
  flex: 1;
  max-width: 160px;
  margin: 0 0.35rem;
}
.mobile-bar-search .form-control {
  font-size: 0.8rem;
  padding: 0.35rem 0.5rem;
}
.logo-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 8px;
}
.auth-logo {
  max-height: 56px;
  max-width: 180px;
  object-fit: contain;
}


/* Modern plan cards (public + customer portals) */
.pricing-hero {
  text-align: center;
  margin: 0 auto 2rem;
  max-width: 40rem;
}
.pricing-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary, #064e3b);
}
.pricing-lead { margin: 0.5rem 0 0; line-height: 1.5; }
.pricing-grid-modern {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  align-items: stretch;
}
.pricing-card-modern {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 1.35rem 1.25rem 1.25rem;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  min-height: 100%;
}
.pricing-card-modern:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.1);
}
.pricing-card-modern.featured {
  border-color: var(--primary, #064e3b);
  box-shadow: 0 12px 36px rgba(13, 110, 63, 0.18);
  background: linear-gradient(180deg, #f3faf6 0%, #fff 42%);
}
.pricing-card-modern.is-free {
  background: #fafbfc;
}
.pricing-badge {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  background: var(--primary, #064e3b);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
}
.pricing-card-modern h3 {
  margin: 0 0 0.35rem;
  font-size: 1.2rem;
  font-weight: 800;
}
.pricing-card-modern .price {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--primary, #064e3b);
  margin: 0.25rem 0 0.15rem;
  line-height: 1.15;
}
.pricing-card-modern .price span {
  font-size: 0.85rem;
  font-weight: 600;
  color: #64748b;
  margin-left: 0.15rem;
}
.pricing-period-tag {
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #64748b;
  text-transform: capitalize;
}
.pricing-desc {
  margin: 0 0 0.75rem;
  font-size: 0.88rem;
  color: #64748b;
  line-height: 1.45;
}
.pricing-features {
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
  flex: 1;
}
.pricing-features li {
  padding: 0.4rem 0;
  font-size: 0.9rem;
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  border-bottom: 1px solid #f1f5f9;
}
.pricing-features li:last-child { border-bottom: 0; }
.pricing-features li::before {
  content: '✓';
  color: var(--primary, #064e3b);
  font-weight: 700;
  flex-shrink: 0;
}
.pricing-card-cta { margin-top: auto; }
.pricing-single-file {
  border-radius: 14px;
}



.site-footer-prefs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 0.5rem;
}
.pref-select {
  font-size: 0.8rem;
  padding: 0.25rem 0.45rem;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.2);
  background: transparent;
  color: inherit;
}
.site-footer-version { opacity: 0.75; font-size: 0.85em; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0;
}
.app-version-badge {
  display: inline-block;
  margin-top: 1rem;
  font-size: 0.78rem;
  color: #64748b;
}
.app-version-badge--center,
.preview-page .app-version-badge {
  display: block;
  text-align: center;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}


/* Contrast / light-mode lock — prevent text/bg conflicts */
body {
  color: var(--text, #1a1a1a);
  background: var(--bg, #f8faf9);
}
.card,
.search-box,
.stat-card,
.table-wrap,
.file-card,
.folder-card,
.feature-card,
.pricing-card,
.pricing-card-modern {
  background: var(--card, #ffffff);
  color: var(--text, #1a1a1a);
}
.pricing-card-modern.is-free {
  background: #fafbfc;
  color: var(--text, #1a1a1a);
}
.pricing-card-modern.featured {
  background: linear-gradient(180deg, #f3faf6 0%, #ffffff 42%);
  color: var(--text, #1a1a1a);
}
.pricing-desc,
.pricing-period-tag,
.muted,
.ht-meta {
  color: var(--muted, #6b7280);
}
.form-control,
input.form-control,
select.form-control,
textarea.form-control,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
select,
textarea {
  background: #ffffff;
  color: var(--text, #1a1a1a);
  border-color: var(--border, #e5e7eb);
}
.form-control::placeholder,
input::placeholder,
textarea::placeholder {
  color: #94a3b8;
  opacity: 1;
}
.navbar {
  background: var(--card, #ffffff);
  color: var(--text, #1a1a1a);
}
.nav-links a {
  color: var(--text, #1a1a1a);
}
.btn-outline {
  background: #ffffff;
  color: var(--primary, #064e3b);
  border: 1px solid var(--primary, #064e3b);
}
.btn-primary {
  color: #ffffff;
}
.btn-primary:hover {
  color: #ffffff;
}
/* Footer is dark — keep light text */
.site-footer-modern,
.site-footer-modern a,
.site-footer-modern .site-footer-copy,
.site-footer-modern .pref-select {
  color: #e8f0ec;
}
.site-footer-modern .pref-select {
  background: rgba(0, 0, 0, 0.25);
  border-color: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}
.site-footer-modern .pref-select option {
  background: #0a3d24;
  color: #ffffff;
}
/* Home ticker cards: light text on green */
.home-ticker-card {
  color: #ffffff;
}
.home-ticker-card a {
  color: #ffffff;
}
/* Tables */
th {
  background: #f1f5f9;
  color: #475569;
}
td {
  color: var(--text, #1a1a1a);
  background: #ffffff;
}
tr:nth-child(even) td {
  background: #f8fafc;
}
/* Auth cards */
.auth-card,
.auth-panel,
.login-card {
  background: #ffffff;
  color: var(--text, #1a1a1a);
}


/* Action buttons — distinct colours */
.btn-buy {
  background: #ea580c;
  color: #fff !important;
  border: none;
  font-weight: 700;
  padding: 0.55rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.btn-buy:hover { background: #c2410c; color: #fff !important; }
.btn-cart {
  background: #0369a1;
  color: #fff !important;
  border: none;
  font-weight: 600;
  padding: 0.55rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.btn-cart:hover { background: #075985; color: #fff !important; }
.btn-download {
  background: #064e3b;
  color: #fff !important;
  border: none;
  font-weight: 600;
  padding: 0.55rem 1rem;
  border-radius: 8px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.btn-download:hover { background: #0a5530; color: #fff !important; }
.btn-download:disabled,
.btn-download[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}
.btn-request {
  background: #7c3aed;
  color: #fff !important;
  border: none;
  font-weight: 600;
  padding: 0.55rem 1rem;
  border-radius: 8px;
  cursor: pointer;
}
.btn-request:hover { background: #6d28d9; color: #fff !important; }
.btn-accent {
  background: #f0a500;
  color: #1a1a1a !important;
  border: none;
  font-weight: 700;
}
.btn-accent:hover { background: #d97706; color: #1a1a1a !important; }

/* 404 latest files — 4 columns, responsive */
.latest-files-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
}
.latest-file-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.9rem 1rem;
  background: var(--card, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  min-width: 0;
  box-shadow: 0 2px 8px rgba(15,23,42,.04);
  transition: transform .12s, box-shadow .12s;
}
.latest-file-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(15,23,42,.08);
  text-decoration: none;
  color: inherit;
}
.lfc-ext {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--primary, #064e3b);
}
.lfc-title {
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
@media (max-width: 900px) {
  .latest-files-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  .latest-files-grid-4 { grid-template-columns: 1fr; }
}

.home-tickers-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  width: 100%;
  max-width: 100%;
}
.home-tickers {
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 1rem;
}
.support-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 1rem;
}
@media (max-width: 800px) {
  .support-grid { grid-template-columns: 1fr; }
}
.premium-ticket-fields {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
}


/* ===== Responsive system (Lighthouse-friendly breakpoints) =====
   xs: 0–479  · sm: 480–767  · md: 768–1023  · lg: 1024–1279  · xl: 1280+
*/
:root {
  --bp-sm: 480px;
  --bp-md: 768px;
  --bp-lg: 1024px;
  --bp-xl: 1280px;
  --page-pad: clamp(0.75rem, 2.5vw, 1.25rem);
  --content-max: 1200px;
}

.container,
.site-footer-inner,
.home-tickers {
  width: 100%;
  max-width: var(--content-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--page-pad);
  padding-right: var(--page-pad);
  box-sizing: border-box;
}

img, video, iframe, svg {
  max-width: 100%;
  height: auto;
}
iframe { max-width: 100%; }

/* Downloads: even folder / file browsing on all devices */
.downloads-page,
.downloads-layout,
.downloads-split,
.dl-root-panel,
.dl-files-block,
.dl-subfolders-block {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 160px), 1fr));
  gap: 0.65rem;
  width: 100%;
  min-width: 0;
}
.folder-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.85rem 0.9rem;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
  background: var(--card, #fff);
  text-decoration: none;
  color: inherit;
  min-width: 0;
  min-height: 4.5rem;
  box-sizing: border-box;
  overflow: hidden;
}
.folder-card strong,
.folder-card .folder-name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.9rem;
  line-height: 1.3;
  max-width: 100%;
}
.folder-card .muted {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.75rem;
}

.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
  gap: 0.75rem;
  width: 100%;
  min-width: 0;
}
.file-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.85rem;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
  background: var(--card, #fff);
  min-width: 0;
  overflow: hidden;
  box-sizing: border-box;
}
.file-card .file-meta {
  min-width: 0;
  flex: 1 1 auto;
}
.file-card .file-meta strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.file-card .file-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.file-card .file-actions .btn {
  flex: 1 1 auto;
  min-width: 0;
  text-align: center;
  justify-content: center;
}

.dl-folder-title-row {
  min-width: 0;
}
.dl-folder-title-row h2 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1 1 auto;
  font-size: clamp(1.05rem, 3.5vw, 1.35rem);
}
.dl-mobile-title {
  min-width: 0;
}

.folder-nav-item {
  min-width: 0;
  overflow: hidden;
}
.folder-nav-item strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---- sm and below (phones) ---- */
@media (max-width: 767.98px) {
  .downloads-page {
    padding-left: 0;
    padding-right: 0;
  }
  .downloads-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
  }
  .downloads-search {
    max-width: none;
    width: 100%;
    min-width: 0;
  }
  .dl-mobile-bar {
    display: flex;
    top: env(safe-area-inset-top, 0);
    margin-left: var(--page-pad);
    margin-right: var(--page-pad);
  }
  .folder-grid {
    grid-template-columns: 1fr !important; /* one column — even rows */
    gap: 0.5rem;
  }
  .folder-list {
    gap: 0.5rem;
  }
  .folder-row {
    padding: 0.75rem 0.85rem;
    min-height: 3.25rem;
  }
  .folder-row strong {
    font-size: 0.95rem;
  }
  .file-grid {
    grid-template-columns: 1fr !important;
  }
  .file-card {
    display: grid;
    grid-template-columns: 2.5rem minmax(0, 1fr);
    grid-template-rows: auto auto;
    gap: 0.4rem 0.65rem;
    align-items: start;
  }
  .file-card .file-icon {
    grid-row: 1 / span 1;
    font-size: 1.5rem;
  }
  .file-card .file-meta {
    grid-column: 2;
    grid-row: 1;
  }
  .file-card .file-actions {
    grid-column: 1 / -1;
    grid-row: 2;
  }
  .file-card .file-actions .btn {
    flex: 1 1 calc(50% - 0.25rem);
    font-size: 0.8rem;
    padding: 0.45rem 0.5rem;
  }
  .downloads-page.has-folder .downloads-sidebar,
  .downloads-page.at-root .downloads-sidebar {
    display: none !important;
  }
  .downloads-layout,
  .downloads-split {
    display: block !important;
  }
  .preview-page .page-header-row {
    flex-direction: column;
    align-items: stretch !important;
  }
  .preview-page .page-header-row > div:last-child {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
  }
  .preview-page .page-header-row .btn,
  .preview-page .page-header-row button {
    flex: 1 1 auto;
    min-width: calc(50% - 0.25rem);
    text-align: center;
    justify-content: center;
  }
  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  table {
    min-width: 520px;
  }

}
/* ---- xs phones ---- */
@media (max-width: 479.98px) {
  .folder-grid {
    grid-template-columns: 1fr !important;
  }
  .stats-row {
    grid-template-columns: 1fr 1fr !important;
  }
  .home-tickers-grid {
    grid-template-columns: 1fr !important;
  }
  .pricing-grid,
  .pricing-grid-modern {
    grid-template-columns: 1fr !important;
  }

}
/* ---- tablet ---- */
@media (min-width: 768px) and (max-width: 1023.98px) {
  .folder-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .file-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .downloads-split {
    grid-template-columns: minmax(180px, 220px) minmax(0, 1fr);
  }

}
/* ---- desktop ---- */
@media (min-width: 1024px) {
  .folder-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }
  .file-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  }
  .downloads-split {
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  }

}
/* Reduce layout shift / Lighthouse CLS helpers */
.site-top-sticky {
  min-height: 0;
}
.navbar-inner {
  min-height: 3rem;
}
.file-icon, .folder-icon {
  flex-shrink: 0;
}

/* Prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  .home-ticker-track-down,
  .home-ticker-track-up,
  .site-legal-strip-pulse {
    animation: none !important;
  }
}


/* ===== CSS Container Queries (component-level responsive) =====
   Media queries = viewport (page chrome).
   Container queries = parent width (sidebar vs main vs mobile stack).
   Size queries: Baseline widely available (Chrome 105+, Safari 16+, Firefox 110+).
*/
.downloads-page,
.dl-files-block,
.dl-subfolders-block,
.dl-root-panel,
.file-grid,
.folder-grid,
.folder-list {
  container-type: inline-size;
  container-name: dl-panel;
}

/* Named containers for clearer queries */
.file-grid {
  container-name: file-grid;
}
.folder-grid,
.folder-list {
  container-name: folder-grid;
}

/* Narrow panel (e.g. sidebar column or phone): single column, dense */
@container file-grid (max-width: 420px) {
  .file-card {
    display: grid;
    grid-template-columns: 2.25rem minmax(0, 1fr);
    gap: 0.4rem 0.65rem;
  }
  .file-card .file-actions {
    grid-column: 1 / -1;
  }
  .file-card .file-meta strong {
    font-size: 0.88rem;
  }
}

@container file-grid (min-width: 421px) and (max-width: 700px) {
  .file-grid {
    /* self is the container — children only */
  }

}
/* When the grid container is wide enough, prefer multi-column via auto-fill already set;
   tighten card internals for medium widths */
@container file-grid (min-width: 560px) {
  .file-card {
    flex-direction: column;
  }
  .file-card .file-actions .btn {
    flex: 0 1 auto;
  }
}

@container folder-grid (max-width: 360px) {
  .folder-row {
    padding: 0.7rem 0.75rem;
  }
  .folder-row strong,
  .folder-card strong,
  .folder-card .folder-name {
    font-size: 0.88rem;
  }
  .folder-card {
    min-height: 3.75rem;
    padding: 0.7rem 0.8rem;
  }
}

@container folder-grid (min-width: 480px) {
  .folder-row strong {
    font-size: 0.95rem;
  }

}
/* Card as its own container — title scale with card width */
.file-card,
.folder-card,
.folder-row {
  container-type: inline-size;
  container-name: card;
}

@container card (max-width: 200px) {
  .file-meta strong,
  .folder-name,
  strong {
    font-size: 0.8rem;
  }

}
/* Home tickers: respond to column width, not only viewport */
.home-ticker-card {
  container-type: inline-size;
  container-name: ticker;
}
@container ticker (max-width: 320px) {
  .ht-meta { display: none; }
  .ht-title { font-size: 0.75rem; }
  .home-ticker-head h2 { font-size: 0.75rem; }

}
/* Pricing cards in a narrow column */
.pricing-card-modern,
.pricing-card {
  container-type: inline-size;
  container-name: plan-card;
}
@container plan-card (max-width: 280px) {
  .pricing-card-modern .price,
  .pricing-card .price {
    font-size: 1.35rem;
  }

}
/* Container query units (cqi = 1% of container inline size) */
@supports (width: 1cqi) {
  .file-card .file-meta strong {
    font-size: clamp(0.8rem, 4.2cqi, 1rem);
  }
  .folder-row strong {
    font-size: clamp(0.82rem, 4cqi, 1rem);
  }

}
/* Fallback: browsers without @container still use @media rules above */


/* Admin media split: tree + content */
.admin-media-shell {
  display: grid;
  grid-template-columns: minmax(200px, 260px) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
  min-width: 0;
}
.admin-media-tree {
  position: sticky;
  top: 4.5rem;
  max-height: calc(100vh - 6rem);
  overflow: auto;
  padding: 0.75rem;
}
.admin-media-tree-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}
.media-tree, .media-tree ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.media-tree-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  text-decoration: none;
  color: inherit;
  font-size: 0.88rem;
  min-width: 0;
}
.media-tree-item:hover { background: #f1f5f9; }
.media-tree-item.active {
  background: var(--primary-light, #e8f5ee);
  color: var(--primary, #064e3b);
  font-weight: 600;
}
.media-tree-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.admin-media-main { min-width: 0; }
.admin-media-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 0.75rem;
  padding: 0.85rem 1rem;
}
.media-ops-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  margin-bottom: 0.65rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border, #e5e7eb);
}

/* Admin users split */
.admin-users-split {
  display: grid;
  grid-template-columns: minmax(200px, 280px) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}
.admin-users-list {
  padding: 0.75rem;
  max-height: calc(100vh - 8rem);
  overflow: auto;
  position: sticky;
  top: 4.5rem;
}
.user-account-list { list-style: none; margin: 0; padding: 0; }
.user-account-item {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  border: 1px solid transparent;
  margin-bottom: 0.25rem;
}
.user-account-item:hover { background: #f8fafc; }
.user-account-item.active {
  background: #ecfdf5;
  border-color: #bbf7d0;
}
.ua-num { font-size: 0.82rem; font-weight: 700; color: var(--primary, #064e3b); }
.ua-name { font-size: 0.9rem; font-weight: 600; }
.user-detail-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 0.75rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--border, #e5e7eb);
}
.user-detail-footer {
  border-bottom: none;
  border-top: 1px solid var(--border, #e5e7eb);
  margin-top: 1rem;
  padding-top: 0.75rem;
  flex-direction: column;
  align-items: stretch;
}
.user-toolbar-actions { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.user-dl {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem 1rem;
  margin: 0;
}
.user-dl dt { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin: 0 0 0.15rem; }
.user-dl dd { margin: 0; font-weight: 600; }

@media (max-width: 900px) {
  .admin-media-shell,
  .admin-users-split {
    grid-template-columns: 1fr;
  }
  .admin-media-tree,
  .admin-users-list {
    position: static;
    max-height: 240px;
  }
}


/* Admin right-column folders — same rhythm as public folder list */
.admin-folder-list,
.folder-list.admin-folder-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
  min-width: 0;
}
.admin-folder-row {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.5rem;
  align-items: center;
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
  width: 100%;
}
.admin-folder-check {
  display: flex;
  align-items: center;
  padding-left: 0.15rem;
  margin: 0;
}
.admin-folder-row .folder-row-main {
  display: grid;
  grid-template-columns: 1.75rem minmax(0, 1fr);
  gap: 0.65rem;
  align-items: center;
  padding: 0.7rem 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--border, #e5e7eb);
  background: var(--card, #fff);
  text-decoration: none;
  color: inherit;
  min-width: 0;
  transition: border-color .15s, box-shadow .15s;
}
.admin-folder-row .folder-row-main:hover {
  border-color: var(--primary, #064e3b);
  box-shadow: 0 0 0 1px rgba(13,110,63,.15);
  text-decoration: none;
  color: inherit;
}
.admin-folder-row .folder-icon {
  font-size: 1.35rem;
  line-height: 1;
}
.admin-folder-row .folder-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.admin-folder-row .folder-name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.admin-media-main .folder-list {
  max-width: 100%;
}
@media (max-width: 900px) {
  .admin-folder-row .folder-row-main {
    padding: 0.75rem 0.85rem;
  }
}


/* Homepage extra stats */
.stats-row-search {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 0.75rem;
}

/* Footer metrics + centered version */
.site-footer-bottom-stack,
.site-footer-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.45rem;
}
.site-footer-metrics,
.app-meta-metrics {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem 0.55rem;
  font-size: 0.82rem;
  color: var(--muted, #64748b);
}
.site-footer-metrics strong,
.app-meta-metrics strong {
  color: var(--text, #0f172a);
  font-weight: 700;
}
.site-footer-version-center,
.app-meta-version {
  text-align: center;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--muted, #64748b);
  margin: 0;
}
.app-meta-bar {
  margin-top: auto;
  padding: 0.85rem 1rem 1.1rem;
  border-top: 1px solid var(--border, #e5e7eb);
  background: #f8fafc;
  text-align: center;
}
.site-footer-prefs {
  display: flex;
  justify-content: center;
}


/* ===== Hover tooltips (data-tooltip) ===== */
.has-tip {
  position: relative;
  cursor: help;
}
.has-tip[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%) translateY(4px);
  padding: 0.4rem 0.65rem;
  background: #0f172a;
  color: #f8fafc;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.25);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
  z-index: 80;
  max-width: min(90vw, 280px);
  white-space: normal;
  text-align: center;
}
.has-tip[data-tooltip]::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: calc(100% + 4px);
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #0f172a;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s;
  z-index: 81;
  pointer-events: none;
}
.has-tip:hover[data-tooltip]::after,
.has-tip:focus-visible[data-tooltip]::after,
.has-tip:hover[data-tooltip]::before,
.has-tip:focus-visible[data-tooltip]::before {
  opacity: 1;
  visibility: visible;
}
.has-tip:hover[data-tooltip]::after,
.has-tip:focus-visible[data-tooltip]::after {
  transform: translateX(-50%) translateY(0);
}

/* Prefer tip below when near top of viewport (stats ok above) */
.has-tip.tip-below[data-tooltip]::after {
  bottom: auto;
  top: calc(100% + 10px);
  transform: translateX(-50%) translateY(-4px);
}
.has-tip.tip-below[data-tooltip]::before {
  bottom: auto;
  top: calc(100% + 4px);
  border-top-color: transparent;
  border-bottom-color: #0f172a;
}
.has-tip.tip-below:hover[data-tooltip]::after,
.has-tip.tip-below:focus-visible[data-tooltip]::after {
  transform: translateX(-50%) translateY(0);
}

/* Stat cards: ensure tooltip not clipped */
.stats-row,
.stats-row-search,
.stats-row-6 {
  overflow: visible;
}
.stat-card.has-tip {
  overflow: visible;
}
.site-footer-metrics .has-tip,
.app-meta-metrics .has-tip {
  display: inline-flex;
  align-items: baseline;
  gap: 0.2rem;
}

@media (prefers-reduced-motion: reduce) {
  .has-tip[data-tooltip]::after,
  .has-tip[data-tooltip]::before {
    transition: none;
  }
}


/* HTML5 dropzone selection summary */
.html5-dropzone.has-files {
  border-color: var(--primary, #064e3b);
  background: #f0fdf4;
}
.dz-selection {
  margin-top: 0.65rem;
  padding: 0.45rem 0.75rem;
  background: #fff;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #14532d;
  pointer-events: none;
  position: relative;
  z-index: 1;
}
.upload-progress-list .upload-summary {
  padding: 0.4rem 0;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
  border-bottom: 1px solid #e5e7eb;
}


/* ===== Reseller hub (Material-inspired) ===== */
.rhub { display: flex; flex-direction: column; gap: 1.25rem; }
.material-card {
  background: #fff;
  border-radius: 16px;
  padding: 1.25rem 1.35rem;
  box-shadow: 0 1px 2px rgba(15,23,42,.06), 0 8px 24px rgba(15,23,42,.06);
  border: 1px solid rgba(15,23,42,.06);
}
.rhub-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  background: linear-gradient(135deg, #ecfdf5 0%, #fff 55%);
}
.rhub-hero h1 { margin: 0.15rem 0 0.35rem; font-size: 1.55rem; font-weight: 800; letter-spacing: -0.02em; }
.rhub-kicker { margin: 0; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: #064e3b; }
.rhub-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
}
.rhub-stats .stat { display: flex; flex-direction: column; gap: 0.25rem; }
.rhub-stats .stat-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: #64748b; font-weight: 600; }
.rhub-stats .stat-value { font-size: 1.35rem; font-weight: 800; color: #0f172a; }
.rhub-stats .stat-value.small { font-size: 1rem; }
.rhub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}
.rhub-card-title { margin: 0 0 0.75rem; font-size: 1.05rem; font-weight: 700; }
.rhub-dl { margin: 0; display: grid; gap: 0.65rem; }
.rhub-dl > div { display: grid; grid-template-columns: 8.5rem 1fr; gap: 0.5rem; }
.rhub-dl dt { margin: 0; color: #64748b; font-size: 0.85rem; }
.rhub-dl dd { margin: 0; font-weight: 600; }
.rhub-list { margin: 0; padding-left: 1.1rem; color: #334155; line-height: 1.55; }
.rhub-list li { margin-bottom: 0.45rem; }
.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  background: #f1f5f9;
  color: #334155;
}
.chip-success { background: #dcfce7; color: #166534; }
.chip-warning { background: #fef3c7; color: #92400e; }
.chip-danger { background: #fee2e2; color: #991b1b; }
.chip-info { background: #e0f2fe; color: #075985; }
.chip-active { background: #064e3b; color: #fff; }
.rhub-filters { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.rhub-pay-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-top: 0.75rem;
}
.rhub-pay-block {
  padding: 1rem;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}
.rhub-pay-block h3 { margin: 0 0 0.75rem; font-size: 0.95rem; }
.rhub-form { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 0.75rem; }
.rhub-form label { font-size: 0.8rem; font-weight: 600; color: #475569; }
.rhub-upload .rhub-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
@media (max-width: 640px) {
  .rhub-upload .rhub-form-row { grid-template-columns: 1fr; }
  .rhub-dl > div { grid-template-columns: 1fr; }
}
.rhub-table { width: 100%; border-collapse: collapse; }
.rhub-table th, .rhub-table td {
  padding: 0.65rem 0.5rem;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
  vertical-align: top;
  font-size: 0.9rem;
}
.rhub-table th { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: #64748b; }
.rhub-admin-actions { display: flex; flex-direction: column; gap: 0.4rem; min-width: 200px; }
.rhub-action-btns, .rhub-file-actions { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.chip-banner { font-weight: 600; }
.chip-banner.chip-warning { background: #fffbeb; border-color: #fde68a; }
.chip-banner.chip-danger { background: #fef2f2; border-color: #fecaca; }
.rhub-empty { text-align: center; padding: 2rem; }

.rhub-tos { margin: 0.5rem 0 0.75rem; border: 1px solid #e2e8f0; border-radius: 12px; padding: 0.5rem 0.75rem; background: #f8fafc; }
.rhub-tos summary { cursor: pointer; font-weight: 600; color: #0f172a; }
.rhub-tos-body { margin-top: 0.5rem; font-size: 0.9rem; line-height: 1.5; max-height: 200px; overflow: auto; }
.rhub-dz { margin: 0.75rem 0; }

.rhub-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.65rem 0.85rem !important;
  position: sticky;
  top: 0.5rem;
  z-index: 20;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(8px);
}
.rhub-nav-link {
  display: inline-flex;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #334155;
  text-decoration: none;
  background: #f1f5f9;
}
.rhub-nav-link:hover { background: #dcfce7; color: #166534; }

.search-source-chips { display:flex; flex-wrap:wrap; gap:.35rem; margin-bottom:.65rem; }
.search-source-chips .chip { font-size:.75rem; }
.notif-bell { position: relative; display: inline-block; }
.notif-count { display:inline-block; min-width:1.1rem; padding:0 .25rem; border-radius:999px; background:#dc2626; color:#fff; font-size:.7rem; margin-left:.15rem; }
.notif-panel { position:absolute; right:0; top:110%; width:min(340px,90vw); background:#fff; border:1px solid #e2e8f0; border-radius:12px; box-shadow:0 12px 40px rgba(0,0,0,.12); z-index:80; max-height:360px; overflow:auto; }
.notif-panel-head { display:flex; justify-content:space-between; align-items:center; padding:.65rem .75rem; border-bottom:1px solid #e2e8f0; }
.notif-item { display:block; padding:.65rem .75rem; border-bottom:1px solid #f1f5f9; text-decoration:none; color:inherit; }
.notif-item.is-unread { background:#f0fdf4; }
.notif-item strong { display:block; font-size:.9rem; }
.site-popup-backdrop { position:fixed; inset:0; background:rgba(15,23,42,.45); z-index:200; display:flex; align-items:center; justify-content:center; padding:1rem; }
.site-popup { max-width:440px; width:100%; position:relative; }
.site-popup-close { position:absolute; right:.65rem; top:.5rem; border:0; background:transparent; font-size:1.45rem; cursor:pointer; padding:.4rem .55rem; line-height:1; min-width:2.25rem; min-height:2.25rem; border-radius:8px; }
.newsletter-box { margin:1.5rem 0; }

.site-footer-newsletter { margin-top: 1rem; padding-top: .75rem; border-top: 1px solid rgba(255,255,255,.12); }
.site-footer-subheading { font-size: .95rem; margin: 0 0 .35rem; }
.footer-newsletter-form { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-top: .4rem; }
.footer-newsletter-form .form-control { flex: 1; min-width: 140px; }
.customer-topbar .notif-bell { margin-right: .5rem; }

/* === KSD UI refine 2.0.82 === */
:root {
  --radius: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 14px rgba(15, 23, 42, 0.06);
  --focus-ring: 0 0 0 3px rgba(13, 110, 63, 0.25);
}
html { scroll-behavior: smooth; }
img, video, iframe { max-width: 100%; height: auto; }
.container {
  width: 100%;
  max-width: 1120px;
  margin-left: auto;
  margin-right: auto;
  padding-left: clamp(0.75rem, 2.5vw, 1.25rem);
  padding-right: clamp(0.75rem, 2.5vw, 1.25rem);
}
.material-card,
.card {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border, #e5e7eb);
  background: var(--card, #fff);
  min-width: 0;
  max-width: 100%;
}
.btn {
  border-radius: 10px;
  font-weight: 600;
  transition: background .15s ease, box-shadow .15s ease, transform .1s ease;
}
.btn:focus-visible,
.form-control:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}
.form-control {
  border-radius: 10px;
  border: 1px solid var(--border, #e5e7eb);
  max-width: 100%;
}
.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.page-header-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.checkout-2col {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
  max-width: 100%;
}
@media (max-width: 768px) {
  .checkout-2col { grid-template-columns: 1fr; }
}
.rhub-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.65rem;
}
.dash-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.65rem;
}
.dash-action {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--border, #e5e7eb);
  background: #fff;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}
.dash-action:hover {
  border-color: rgba(13, 110, 63, 0.35);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
}
/* Preview page containment */
.preview-page {
  max-width: 960px;
}
.preview-frame {
  max-width: 100%;
  overflow: hidden;
}
.preview-frame iframe {
  width: 100%;
  min-height: 420px;
  border: 0;
}
/* Soft alerts */
.alert {
  border-radius: 12px;
  padding: 0.75rem 1rem;
  border: 1px solid transparent;
}
.alert-success { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.alert-error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert-warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.alert-info { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
@media (max-width: 640px) {
  .btn-block { width: 100%; }
  .page-header-row { flex-direction: column; }
}


/* ===== Container queries: shared shells (2.0.83) ===== */
.checkout-2col {
  container-type: inline-size;
  container-name: checkout-2col;
}
@container checkout-2col (max-width: 640px) {
  .checkout-2col {
    grid-template-columns: 1fr;
  }
}

.admin-media-shell {
  container-type: inline-size;
  container-name: admin-media;
}
@container admin-media (max-width: 700px) {
  .admin-media-shell {
    grid-template-columns: 1fr;
  }
  .admin-media-tree {
    position: static;
    max-height: none;
  }
}

.page-header-row {
  container-type: inline-size;
  container-name: page-header;
}
@container page-header (max-width: 420px) {
  .page-header-row {
    flex-direction: column;
    align-items: stretch;
  }

}
/* Stats / dashlets: scale with parent, not only viewport */
.rhub-stats,
.dash-actions {
  container-type: inline-size;
  container-name: dash-grid;
}
@container dash-grid (max-width: 360px) {
  .rhub-stats,
  .dash-actions {
    grid-template-columns: 1fr;
  }
}
@container dash-grid (min-width: 361px) and (max-width: 560px) {
  .rhub-stats,
  .dash-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@supports (width: 1cqi) {
  .admin-rhub .stat-value {
    font-size: clamp(0.95rem, 5cqi, 1.35rem);
  }

}
/* === Feature badge (shared, mobile-safe) === */
.feature-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  font-size: 0.625rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
  line-height: 1.15;
}


/* Media file New / Hot badges */
.media-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-left: 0.25rem;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  font-size: 0.625rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.15;
  white-space: nowrap;
  vertical-align: middle;
}
.media-badge-new,
.media-badge.media-badge-new {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
}
.media-badge-hot {
  background: linear-gradient(180deg, #fb7185 0%, #e11d48 100%);
  color: #fff;
  border: none;
  box-shadow: 0 1px 2px rgba(0,0,0,.15);
}
.file-card strong .media-badge,
.file-row strong .media-badge {
  margin-left: 0.35rem;
}

/* Legacy nav-badge → same look as feature-badge */
.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-left: 0.35rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-size: 0.625rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: linear-gradient(180deg, #fcd34d 0%, #f59e0b 100%);
  color: #422006;
  border: none;
  box-shadow: 0 1px 2px rgba(0,0,0,.12);
  line-height: 1.15;
  white-space: nowrap;
}

/* App-wide nav readability */
.navbar .nav-links a {
  white-space: nowrap;
}
.navbar-inner {
  flex-wrap: wrap;
  row-gap: 0.35rem;
}
@media (min-width: 901px) {
  .navbar-inner {
    flex-wrap: nowrap;
  }
  .nav-links {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .nav-links::-webkit-scrollbar { display: none; }
}


/* === Sticky header lock (legal strip + navbar) === */
.site-top-sticky {
  position: -webkit-sticky !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 1100 !important;
  background: #ffffff !important;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.12);
  width: 100%;
  /* Avoid transform/filter here — they break sticky for descendants */
}
.site-top-sticky .navbar {
  position: relative !important;
  top: auto !important;
  background: #ffffff !important;
  z-index: 1;
}
.site-top-sticky .site-legal-strip {
  position: relative !important;
  z-index: 2;
  display: flex !important;
}




/* ===== Float widgets: spacing via flex gap tokens =====
   Right stack = cart / AI / back-to-top (column flex + gap).
   Left help = WhatsApp + chat launcher (horizontal gap via left offset).
   Only nudge launcher bubbles — never expanded chat panels. */
:root {
  --float-size: 3.25rem;
  --float-gap: 1rem;
  --float-edge: 0.85rem;
  --float-bottom: 1rem;
  --float-help-size: 3rem;
  --float-help-gap: 0.85rem;
}

.float-stack {
  position: fixed !important;
  right: var(--float-edge) !important;
  bottom: var(--float-bottom) !important;
  left: auto !important;
  z-index: 9980 !important;
  display: flex !important;
  flex-direction: column-reverse !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: var(--float-gap) !important;
  row-gap: var(--float-gap) !important;
  column-gap: 0 !important;
  pointer-events: none !important;
  /* Avoid accidental grid/margin collapse from global rules */
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-sizing: border-box !important;
}
.float-stack > * {
  pointer-events: auto !important;
  position: relative !important;
  right: auto !important;
  left: auto !important;
  bottom: auto !important;
  top: auto !important;
  margin: 0 !important;
  flex: 0 0 auto !important;
  box-sizing: border-box !important;
}
.float-stack .float-cart,
.float-stack .float-ai,
.float-stack .float-top {
  position: relative !important;
  width: var(--float-size) !important;
  height: var(--float-size) !important;
  min-width: var(--float-size) !important;
  min-height: var(--float-size) !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.16) !important;
}

/* Help cluster: WhatsApp (1st) + chat (2nd) — spaced by size + gap */
a.wa-float,
.wa-float {
  position: fixed !important;
  left: var(--float-edge) !important;
  right: auto !important;
  bottom: var(--float-bottom) !important;
  z-index: 9970 !important;
  width: var(--float-help-size) !important;
  height: var(--float-help-size) !important;
  border-radius: 50% !important;
  background: #25D366 !important;
  color: #fff !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.4) !important;
  text-decoration: none !important;
  opacity: 0.95 !important;
  margin: 0 !important;
  box-sizing: border-box !important;
}
a.wa-float:hover,
.wa-float:hover { opacity: 1 !important; }
a.wa-float svg { width: 24px !important; height: 24px !important; fill: #fff !important; }

/* Chat launcher: edge + help size + gap */
.woot-widget-bubble,
#tawkchat-minified-wrapper,
#tidio-chat,
.woot--bubble-holder {
  left: calc(var(--float-edge) + var(--float-help-size) + var(--float-help-gap)) !important;
  right: auto !important;
  bottom: var(--float-bottom) !important;
  z-index: 9968 !important;
}

/* When chat panel is open, dim WA slightly so it does not compete */
body.woot-widget-open a.wa-float,
body.chat-open a.wa-float {
  opacity: 0.35 !important;
  pointer-events: none !important;
}

/* Mobile: hide chat cluster; keep right stack with slightly tighter tokens */
@media (max-width: 768px) {
  :root {
    --float-edge: 0.65rem;
    --float-bottom: 0.75rem;
    --float-gap: 0.85rem;
    --float-size: 3rem;
  }
  a.wa-float, .wa-float,
  .woot-widget-bubble,
  #tawkchat-minified-wrapper,
  #tidio-chat,
  .woot--bubble-holder {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }
}


/* Support contacts (footer + file preview) */
.support-contacts {
  margin: 0.75rem 0 0;
  font-size: 0.9rem;
  line-height: 1.45;
}
.support-contacts-title {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.95rem;
}
.support-contacts-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.support-contacts-list a { font-weight: 600; }
.support-contacts .sc-label {
  display: inline-block;
  min-width: 4.5rem;
  color: rgba(255,255,255,0.75);
  font-size: 0.8rem;
  font-weight: 600;
}
.site-footer-modern .support-contacts .sc-label { color: rgba(255,255,255,0.7); }
.site-footer-modern .support-contacts a { color: #fff; text-decoration: underline; text-underline-offset: 2px; }
.support-contacts--preview {
  margin: 1rem 0 1.25rem;
  padding: 0.85rem 1rem;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  color: #14532d;
}
.support-contacts--preview .sc-label { color: #166534; min-width: 4.25rem; }
.support-contacts--preview a { color: #064e3b; }
.support-contacts--footer { margin-top: 0.5rem; margin-bottom: 0.85rem; }

/* CUE accreditation badges */
.cue-badge{font-weight:600;font-size:.72rem;letter-spacing:.02em}
.cue-public-chartered{background:#d1fae5;color:#065f46}
.cue-private-chartered{background:#e0e7ff;color:#3730a3}
.cue-specialized{background:#fef3c7;color:#92400e}
.cue-public-cc{background:#cffafe;color:#155e75}
.cue-private-cc{background:#fce7f3;color:#9d174d}
.cue-lia{background:#fee2e2;color:#991b1b}
.cue-unknown{background:#f3f4f6;color:#4b5563}


/* —— Insights hub & dashlets —— */
.insights-hub-intro { margin-bottom: 1rem; }
.insights-kpi { margin-top: .75rem; }
.insight-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: .75rem;
}
.insight-tool-card {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  padding: .9rem 1rem;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.insight-tool-card:hover {
  border-color: var(--primary, #064e3b);
  box-shadow: 0 4px 14px rgba(13,110,63,.08);
}
.insight-tool-icon { font-size: 1.25rem; }
.insight-tool-label { font-weight: 600; font-size: .92rem; }
.insight-tool-blurb { line-height: 1.35; }
.insight-dashlets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr));
  gap: 1rem;
}
.insight-dashlet {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: .65rem;
  min-height: 220px;
}
.insight-dashlet-head { display: flex; justify-content: space-between; align-items: flex-start; }
.insight-dashlet-title { margin: 0; font-size: 1rem; }
.insight-dashlet-filters {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  align-items: center;
}
.insight-dashlet-filters .form-control { font-size: .85rem; padding: .35rem .5rem; }
.insight-dashlet-table { flex: 1; max-height: 320px; overflow: auto; }
.insight-dashlet-table table { width: 100%; font-size: .85rem; }
.insight-dashlet-table th { position: sticky; top: 0; background: var(--card-bg, #fff); z-index: 1; }
.insight-dashlet-pager { margin-top: .25rem; }
.insight-simple-list { list-style: none; margin: 0; padding: 0; }
.insight-simple-list li { display: flex; justify-content: space-between; gap: .5rem; padding: .35rem 0; border-bottom: 1px solid var(--border, #f3f4f6); }
.insight-filter-bar { padding: 1rem; }
@media (max-width: 640px) {
  .insight-dashlets-grid { grid-template-columns: 1fr; }
}


/* ===== Nav dropdown fix (v2.10.1) — sticky header must not clip ===== */
.site-top-sticky {
  overflow: visible !important;
}
.site-top-sticky .navbar,
.site-top-sticky .navbar-inner,
.site-top-sticky .nav-links {
  overflow: visible !important;
}
.site-top-sticky .navbar {
  z-index: 5 !important;
}
.nav-item.has-dropdown {
  position: relative;
  z-index: 6;
}
.nav-item.has-dropdown.open,
.nav-item.has-dropdown:hover {
  z-index: 1200 !important;
}
.nav-dropdown {
  display: none;
  position: absolute !important;
  top: 100% !important;
  left: 0 !important;
  min-width: 14rem;
  padding: 0.4rem 0 !important;
  margin: 0 !important;
  list-style: none !important;
  background: #fff !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 10px !important;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.16) !important;
  z-index: 1300 !important;
}
.nav-item.has-dropdown:hover > .nav-dropdown,
.nav-item.has-dropdown:focus-within > .nav-dropdown,
.nav-item.has-dropdown.open > .nav-dropdown {
  display: block !important;
}
.nav-dropdown li {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}
.nav-dropdown a,
.nav-dropdown .nav-sublink {
  display: block !important;
  padding: 0.65rem 1.1rem !important;
  color: #111827 !important;
  text-decoration: none !important;
  white-space: nowrap !important;
  background: transparent !important;
  pointer-events: auto !important;
}
.nav-dropdown a:hover,
.nav-dropdown .nav-sublink:hover {
  background: #ecfdf5 !important;
  color: #064e3b !important;
}
@media (max-width: 900px) {
  .nav-item.has-dropdown:hover > .nav-dropdown {
    display: none !important;
  }
  .nav-item.has-dropdown.open > .nav-dropdown {
    display: block !important;
    position: static !important;
    box-shadow: none !important;
    border: 0 !important;
    background: transparent !important;
  }
}


/* Customer dashboard — 3-card new features ticker (not dismissible) */
.feature-news-ticker {
  margin: 0 0 1.25rem;
  padding: 1rem 1.1rem 1.15rem;
  background: linear-gradient(135deg, #ecfdf5 0%, #f0f9ff 100%);
  border: 1px solid #a7f3d0;
  border-radius: 14px;
}
.feature-news-ticker-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .5rem;
  margin-bottom: .85rem;
}
.feature-news-ticker-head h3 {
  margin: 0;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: .4rem;
}
.feature-news-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  position: relative;
}
.feature-news-ticker.is-sliding .feature-news-cards {
  display: flex;
  flex-wrap: nowrap;
  overflow: hidden;
  gap: 0.75rem;
}
.feature-news-ticker.is-sliding .feature-news-track {
  display: flex;
  gap: 0.75rem;
  animation: featureNewsSlide 24s linear infinite;
  will-change: transform;
}
.feature-news-ticker.is-sliding .feature-news-track:hover {
  animation-play-state: paused;
}
@keyframes featureNewsSlide {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.feature-news-ticker.is-sliding .feature-news-card {
  flex: 0 0 calc(33.333% - 0.5rem);
  min-width: 220px;
  max-width: 360px;
}
@media (max-width: 900px) {
  .feature-news-ticker.is-sliding .feature-news-card {
    flex: 0 0 min(85vw, 320px);
  }
}
@media (max-width: 900px) {
  .feature-news-cards { grid-template-columns: 1fr; }
}
.feature-news-card {
  display: flex;
  gap: .65rem;
  align-items: flex-start;
  padding: .85rem .9rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: border-color .15s, box-shadow .15s;
  min-height: 88px;
}
.feature-news-card:hover {
  border-color: var(--primary, #064e3b);
  box-shadow: 0 4px 14px rgba(13, 110, 63, .08);
}
.feature-news-icon {
  font-size: 1.35rem;
  line-height: 1;
  flex-shrink: 0;
}
.feature-news-body {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  min-width: 0;
}
.feature-news-body strong {
  font-size: .9rem;
}
.feature-news-blurb {
  font-size: .78rem;
  color: #64748b;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}



/* ===== KSD SweetAlert2 theme (branded, minimal, centred) ===== */
body.swal2-shown:not(.swal2-toast-shown) {
  overflow-y: hidden !important;
}
.swal2-container:not(.swal2-top):not(.swal2-top-start):not(.swal2-top-end):not(.swal2-top-left):not(.swal2-top-right) {
  position: fixed !important;
  inset: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: .75rem !important;
  z-index: 200000 !important;
}
.swal2-container.swal2-center,
.ksd-swal-center.swal2-container {
  position: fixed !important;
  inset: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: .5rem !important;
  z-index: 200000 !important;
  transform: none !important;
  background: rgba(15, 23, 42, 0.42) !important;
}
.ksd-swal-popup.swal2-popup,
.swal2-popup.ksd-swal-popup {
  position: relative !important;
  inset: auto !important;
  margin: 0 auto !important;
  top: auto !important;
  left: auto !important;
  transform: none !important;
  width: min(17.5rem, 88vw) !important;
  max-width: min(17.5rem, 88vw) !important;
  padding: .85rem 1rem .8rem !important;
  border-radius: 12px !important;
  border: 1px solid rgba(13, 110, 63, 0.12) !important;
  font-family: inherit !important;
  font-size: .875rem !important;
  color: #0f172a !important;
  background: #fff !important;
  box-shadow:
    0 4px 6px -1px rgba(15, 23, 42, 0.08),
    0 16px 40px -8px rgba(15, 23, 42, 0.2) !important;
}
/* Icon: scale only — keep SWAL geometry */
.ksd-swal-popup .swal2-icon {
  margin: .15rem auto .5rem !important;
  transform: scale(0.72);
  transform-origin: center center;
}
.ksd-swal-popup .swal2-icon.swal2-success {
  border-color: var(--primary, #064e3b) !important;
  color: var(--primary, #064e3b) !important;
}
.ksd-swal-popup .swal2-icon.swal2-success .swal2-success-ring {
  border-color: rgba(13, 110, 63, 0.25) !important;
}
.ksd-swal-popup .swal2-icon.swal2-success [class^=swal2-success-line] {
  background-color: var(--primary, #064e3b) !important;
}
.ksd-swal-popup .swal2-icon.swal2-error {
  border-color: #dc2626 !important;
  color: #dc2626 !important;
}
.ksd-swal-popup .swal2-icon.swal2-warning {
  border-color: #d97706 !important;
  color: #d97706 !important;
}
.ksd-swal-popup .swal2-icon.swal2-info {
  border-color: #0284c7 !important;
  color: #0284c7 !important;
}
.ksd-swal-popup .swal2-icon.swal2-question {
  border-color: var(--primary, #064e3b) !important;
  color: var(--primary, #064e3b) !important;
}
.ksd-swal-popup .swal2-title {
  font-size: .95rem !important;
  font-weight: 650 !important;
  padding: 0 .15rem !important;
  margin: 0 0 .3rem !important;
  line-height: 1.35 !important;
  color: #0f172a !important;
}
.ksd-swal-popup .swal2-html-container,
.ksd-swal-popup .swal2-content {
  font-size: .82rem !important;
  margin: 0 0 .4rem !important;
  padding: 0 !important;
  line-height: 1.45 !important;
  color: #475569 !important;
}
.ksd-swal-popup .swal2-actions {
  margin: .55rem auto 0 !important;
  gap: .4rem !important;
}
.ksd-swal-ok.swal2-confirm,
.ksd-swal-popup .swal2-confirm,
.swal2-styled.swal2-confirm {
  min-width: 3.75rem !important;
  padding: .4rem .95rem !important;
  font-size: .82rem !important;
  font-weight: 600 !important;
  border-radius: 8px !important;
  border: none !important;
  background: var(--primary, #064e3b) !important;
  color: #fff !important;
  box-shadow: 0 1px 2px rgba(13, 110, 63, 0.25) !important;
}
.ksd-swal-ok.swal2-confirm:hover,
.ksd-swal-popup .swal2-confirm:hover,
.swal2-styled.swal2-confirm:hover {
  background: var(--primary-dark, #0a5530) !important;
}
.ksd-swal-popup .swal2-cancel,
.swal2-styled.swal2-cancel {
  padding: .4rem .95rem !important;
  font-size: .82rem !important;
  font-weight: 600 !important;
  border-radius: 8px !important;
  border: 1.5px solid var(--primary, #064e3b) !important;
  background: transparent !important;
  color: var(--primary, #064e3b) !important;
  box-shadow: none !important;
}
.ksd-swal-popup .swal2-cancel:hover,
.swal2-styled.swal2-cancel:hover {
  background: var(--primary-light, #e8f5ee) !important;
}
.ksd-swal-popup .swal2-timer-progress-bar {
  background: var(--primary, #064e3b) !important;
}
/* Toasts */
.swal2-container.swal2-top-end > .swal2-popup,
.swal2-container.swal2-top > .swal2-popup {
  width: min(16rem, 92vw) !important;
  padding: .5rem .7rem !important;
  font-size: .82rem !important;
  border-radius: 10px !important;
  border: 1px solid rgba(13, 110, 63, 0.1) !important;
}
.swal2-toast .swal2-title {
  font-size: .82rem !important;
  margin: 0 !important;
  line-height: 1.3 !important;
}
.swal2-toast .swal2-icon {
  margin: 0 .35rem 0 0 !important;
  transform: scale(0.65);
  transform-origin: center center;
}

/* Shared scrollable containers */
.ksd-scroll,
.cbc-scroll-container {
  overflow: auto;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  min-height: 0;
}
.ksd-scroll-y { overflow-x: hidden; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-y: contain; min-height: 0; }
.ksd-scroll-x { overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.ksd-scroll-thin { scrollbar-width: thin; scrollbar-color: #cbd5e1 transparent; }
.ksd-scroll-thin::-webkit-scrollbar { width: 6px; height: 6px; }
.ksd-scroll-thin::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 99px; }
.ksd-scroll-thin::-webkit-scrollbar-track { background: transparent; }


/* ============================================================
   UI/UX design system refresh (v2.12.82)
   ============================================================ */
:root {
  --primary: #064e3b;
  --primary-dark: #043d2e;
  --primary-light: #e8f5ee;
  --accent: #f59e0b;
  --danger: #dc2626;
  --success: #059669;
  --warning: #d97706;
  --info: #2563eb;
  --text: #0f172a;
  --text-secondary: #334155;
  --muted: #64748b;
  --border: #e2e8f0;
  --bg: #f1f5f9;
  --card: #ffffff;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 4px 12px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 10px 40px rgba(15, 23, 42, 0.08);
  --focus-ring: 0 0 0 3px rgba(13, 110, 63, 0.18);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Focus visible for keyboard users */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
button:focus:not(:focus-visible),
a:focus:not(:focus-visible) {
  outline: none;
}

/* Buttons — consistent touch targets & hierarchy */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.5rem;
  padding: 0.55rem 1.1rem;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.2;
  border-radius: var(--radius-sm);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:disabled,
.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}
.btn-primary {
  background: var(--primary);
  color: #fff !important;
  border-color: var(--primary);
  box-shadow: 0 1px 2px rgba(13, 110, 63, 0.2);
}
.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: #fff !important;
}
.btn-outline {
  background: #fff;
  border-color: var(--border);
  color: var(--text-secondary);
}
.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}
.btn-sm {
  min-height: 2rem;
  padding: 0.3rem 0.75rem;
  font-size: 0.8rem;
}
.btn-lg {
  min-height: 2.85rem;
  padding: 0.7rem 1.35rem;
  font-size: 1rem;
}
.btn-block {
  width: 100%;
  display: flex;
}

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-group label,
label.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}
.form-control {
  width: 100%;
  min-height: 2.5rem;
  padding: 0.55rem 0.85rem;
  font-size: 0.925rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--focus-ring);
}
.form-control::placeholder { color: #94a3b8; }
.form-control.is-invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}
.form-hint,
.form-text {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.3rem;
}

/* Cards */
.card,
.material-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.15rem 1.25rem;
}
.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 0.85rem;
  color: var(--text);
}
.card-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

/* Tables */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
thead th {
  text-align: left;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: #f8fafc;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody td {
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  color: var(--text-secondary);
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #f8fafc; }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 99px;
  background: var(--primary-light);
  color: var(--primary-dark);
  letter-spacing: 0.02em;
}
.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-info { background: #dbeafe; color: #1e40af; }
.badge-muted { background: #f1f5f9; color: #64748b; }

/* Empty states */
.empty,
.card.empty,
td.empty {
  text-align: center;
  padding: 2rem 1.25rem !important;
  color: var(--muted);
  font-size: 0.925rem;
}
.empty a { font-weight: 600; }

/* Page titles */
.page-title {
  font-size: clamp(1.25rem, 2.2vw, 1.65rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text);
  margin: 0 0 0.35rem;
  line-height: 1.25;
}
.page-subtitle,
.muted.lead {
  color: var(--muted);
  font-size: 0.925rem;
  margin: 0 0 1.25rem;
}

/* Navbar polish */
.navbar {
  backdrop-filter: saturate(1.2) blur(8px);
  background: rgba(255, 255, 255, 0.92);
}
.nav-links a {
  padding: 0.35rem 0.15rem;
  border-radius: 4px;
  transition: color 0.15s;
}

/* Sidebar active indicator */
.sidebar a.active,
.customer-nav a.active,
.admin-nav a.active {
  font-weight: 600;
  position: relative;
}

/* Alerts */
.alert {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}
.alert-success { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.alert-error,
.alert-danger { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert-warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.alert-info { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }

/* KPI / stat chips */
.stat-grid,
.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.stat-card,
.kpi-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow);
}
.stat-card .stat-value,
.kpi-card .kpi-value {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.stat-card .stat-label,
.kpi-card .kpi-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-top: 0.25rem;
  font-weight: 600;
}

/* Container spacing */
.container {
  width: 100%;
  max-width: 1120px;
  margin-left: auto;
  margin-right: auto;
  padding-left: clamp(0.85rem, 3vw, 1.5rem);
  padding-right: clamp(0.85rem, 3vw, 1.5rem);
}
.main-content {
  padding-top: 1.25rem;
  padding-bottom: 2.5rem;
}

/* Skip link a11y */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--primary);
  color: #fff;
  padding: 0.5rem 1rem;
  z-index: 9999;
  border-radius: 0 0 8px 0;
}
.skip-link:focus {
  left: 0;
}

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

/* Mobile comfort */
@media (max-width: 640px) {
  .btn { min-height: 2.65rem; }
  .form-control { min-height: 2.65rem; font-size: 16px; /* avoid iOS zoom */ }
  .card, .material-card { padding: 1rem; border-radius: 10px; }
  thead th, tbody td { padding: 0.65rem 0.7rem; }
}


/* ============================================================
   Mobile responsiveness & usability (v2.12.83)
   Search, checkout, floats, tables, portals
   ============================================================ */

/* School search: never force 7 columns via inline styles */
.search-grid.search-grid-schools {
  display: grid;
  grid-template-columns: minmax(0, 2fr) repeat(5, minmax(0, 1fr)) auto;
  gap: 0.65rem;
  align-items: end;
}
.search-grid .span-full,
.search-grid .search-q-field {
  min-width: 0;
}
.search-grid .form-group,
.search-grid select,
.search-grid input {
  min-width: 0;
  max-width: 100%;
}
.search-grid .btn {
  white-space: nowrap;
}

@media (max-width: 1100px) {
  .search-grid.search-grid-schools {
    grid-template-columns: 1fr 1fr 1fr;
  }
  .search-grid.search-grid-schools .search-q-field,
  .search-grid.search-grid-schools .span-full {
    grid-column: 1 / -1;
  }
}
@media (max-width: 700px) {
  .search-grid,
  .search-grid.search-grid-schools,
  .search-grid-advanced {
    grid-template-columns: 1fr !important;
    gap: 0.65rem;
  }
  .search-grid .span-2,
  .search-grid .span-full,
  .search-grid .search-q-field,
  .search-grid-advanced .span-full {
    grid-column: 1 / -1 !important;
  }
  .search-grid .btn,
  .search-grid button[type="submit"] {
    width: 100%;
    min-height: 2.75rem;
  }
}

/* Live search dropdown containment */
.live-search-wrap,
.form-group.live-search-wrap,
.form-group:has([data-live-search]) {
  position: relative;
  z-index: 5;
}
.live-results,
.live-search-results {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 80;
  max-height: min(50vh, 280px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #fff;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
}

/* Cart / checkout order page — equal cards, no overlap */
.cart-order-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 1rem 5.5rem; /* room for float buttons */
}
.cart-order-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.15rem;
  align-items: start;
}
.cart-order-card {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}
.cart-order-card .pay-methods {
  display: grid;
  gap: 0.75rem;
}
.cart-order-card .pay-card {
  min-width: 0;
}
.checkout-2col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.15rem;
  align-items: start;
}
.checkout-2col > * {
  min-width: 0;
  max-width: 100%;
}

@media (max-width: 800px) {
  .cart-order-grid,
  .checkout-2col {
    grid-template-columns: 1fr !important;
  }
  .cart-order-summary { order: 1; }
  .cart-order-pay { order: 2; }
}

/* Plan checkout card */
.customer-shell .card[style*="max-width:640px"],
.main-content .card[style*="max-width:640px"] {
  max-width: 100% !important;
  width: 100%;
}

/* Tables on small screens */
@media (max-width: 768px) {
  .table-wrap {
    margin-left: -0.25rem;
    margin-right: -0.25rem;
    border-radius: 10px;
  }
  .table-wrap table {
    min-width: 520px;
  }
  /* Prefer card list feel for result tables when possible */
  .schools-results-table td {
    font-size: 0.85rem;
  }
}

/* Navbar / hamburger */
@media (max-width: 900px) {
  .navbar-inner {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .nav-links {
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
    width: 100%;
  }
  .nav-dropdown {
    position: static !important;
    box-shadow: none;
    border: none;
    padding-left: 0.75rem;
  }
}

/* Floating chat / WhatsApp — horizontal stack, no overlap with content */
a.wa-float,
.wa-float,
.float-cart,
.ksd-float-stack {
  bottom: max(1rem, env(safe-area-inset-bottom, 0px)) !important;
}
/* Leave space so floats don't cover primary actions */
body {
  padding-bottom: 0;
}
@media (max-width: 768px) {
  .main-content,
  .container.cart-order-page,
  .auth-right {
    padding-bottom: 5rem !important;
  }
  /* Hide Chatwoot bubble on very small screens if stacked poorly — keep WA */
  .woot-widget-bubble {
    transform: scale(0.9);
    transform-origin: bottom right;
  }
  /* Stack floats: WhatsApp leftish, Chatwoot right (when both present) */
  a.wa-float,
  .wa-float {
    right: auto !important;
    left: max(0.85rem, env(safe-area-inset-left)) !important;
    bottom: max(1rem, env(safe-area-inset-bottom)) !important;
    z-index: 9990 !important;
  }
}

/* Portal sidebar + content overflow */
@media (max-width: 768px) {
  .app-shell,
  .customer-shell {
    overflow-x: hidden;
  }
  .main-content {
    max-width: 100vw;
    overflow-x: hidden;
  }
  .card {
    overflow-x: auto;
  }
}

/* Filter forms: stack labels + full width selects */
@media (max-width: 600px) {
  .form-row {
    flex-direction: column !important;
    align-items: stretch !important;
  }
  .form-row .form-group,
  .form-row .btn {
    width: 100%;
  }
  .pay-methods {
    grid-template-columns: 1fr !important;
  }
}

/* Prevent sticky header covering focused inputs */
@media (max-width: 768px) {
  input:focus,
  select:focus,
  textarea:focus {
    scroll-margin-top: 5rem;
  }
}

/* Hero search on home */
@media (max-width: 700px) {
  .hero-search-card,
  .search-card {
    margin-left: 0.5rem;
    margin-right: 0.5rem;
    padding: 1rem !important;
  }
}


/* ============================================================
   Dark mode (data-theme="dark") — contrast-safe tokens
   Target ~4.5:1 text/background for body copy
   ============================================================ */
html[data-theme="dark"] {
  color-scheme: dark;
  --primary: #34d399;
  --primary-dark: #6ee7b7;
  --primary-light: #064e3b;
  --accent: #fbbf24;
  --danger: #f87171;
  --success: #34d399;
  --warning: #fbbf24;
  --info: #60a5fa;
  --text: #f1f5f9;
  --text-secondary: #e2e8f0;
  --muted: #94a3b8;
  --border: #334155;
  --bg: #0b1220;
  --card: #111827;
  --sidebar: #020617;
  --sidebar-text: #e2e8f0;
  --shadow: 0 1px 2px rgba(0,0,0,.45), 0 8px 24px rgba(0,0,0,.35);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.5);
  --focus-ring: 0 0 0 3px rgba(52, 211, 153, 0.35);
}

html[data-theme="dark"] body,
html[data-theme="dark"] .customer-body,
html[data-theme="dark"] .admin-body,
html[data-theme="dark"] .auth-material {
  background: var(--bg);
  color: var(--text);
}

html[data-theme="dark"] a {
  color: #6ee7b7;
}
html[data-theme="dark"] a:hover {
  color: #a7f3d0;
}

/* Surfaces */
html[data-theme="dark"] .card,
html[data-theme="dark"] .material-card,
html[data-theme="dark"] .navbar,
html[data-theme="dark"] .site-top-sticky,
html[data-theme="dark"] .site-top-sticky .navbar,
html[data-theme="dark"] .auth-form-shell,
html[data-theme="dark"] .table-wrap,
html[data-theme="dark"] .pay-card,
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .kpi-card,
html[data-theme="dark"] .ban-kpi,
html[data-theme="dark"] .dash-module-card,
html[data-theme="dark"] .dash-action,
html[data-theme="dark"] .login-method-cards .material-card {
  background: var(--card) !important;
  border-color: var(--border) !important;
  color: var(--text);
  box-shadow: var(--shadow);
}

html[data-theme="dark"] .site-top-sticky {
  background: #0f172a !important;
  box-shadow: 0 2px 12px rgba(0,0,0,.4);
}
html[data-theme="dark"] .site-top-sticky .navbar {
  background: #0f172a !important;
  color: var(--text);
  border-bottom-color: var(--border) !important;
}
html[data-theme="dark"] .site-top-sticky .navbar .nav-links a,
html[data-theme="dark"] .navbar .nav-links a {
  color: #e2e8f0 !important;
}
html[data-theme="dark"] .site-top-sticky .navbar .nav-links a:hover,
html[data-theme="dark"] .site-top-sticky .navbar .nav-links a.active,
html[data-theme="dark"] .navbar .nav-links a:hover,
html[data-theme="dark"] .navbar .nav-links a.active {
  color: #6ee7b7 !important;
}
html[data-theme="dark"] .logo,
html[data-theme="dark"] .site-top-sticky .navbar .logo {
  color: #6ee7b7 !important;
}

html[data-theme="dark"] .nav-dropdown {
  background: #1e293b !important;
  border-color: #334155 !important;
  box-shadow: var(--shadow-lg);
}
html[data-theme="dark"] .nav-dropdown a {
  color: #e2e8f0 !important;
}
html[data-theme="dark"] .nav-dropdown a:hover {
  background: #064e3b;
  color: #a7f3d0 !important;
}

/* Forms */
html[data-theme="dark"] .form-control,
html[data-theme="dark"] input.form-control,
html[data-theme="dark"] select.form-control,
html[data-theme="dark"] textarea.form-control,
html[data-theme="dark"] input[type="text"],
html[data-theme="dark"] input[type="email"],
html[data-theme="dark"] input[type="password"],
html[data-theme="dark"] input[type="number"],
html[data-theme="dark"] input[type="search"],
html[data-theme="dark"] input[type="tel"],
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
  background: #0f172a !important;
  border-color: #475569 !important;
  color: #f1f5f9 !important;
}
html[data-theme="dark"] .form-control::placeholder,
html[data-theme="dark"] input::placeholder {
  color: #94a3b8 !important;
}
html[data-theme="dark"] .form-control:focus {
  border-color: #34d399 !important;
  box-shadow: var(--focus-ring) !important;
}
html[data-theme="dark"] label,
html[data-theme="dark"] .form-group label {
  color: #cbd5e1 !important;
}

/* Buttons */
html[data-theme="dark"] .btn-primary {
  background: #059669 !important;
  border-color: #059669 !important;
  color: #ecfdf5 !important;
}
html[data-theme="dark"] .btn-primary:hover {
  background: #047857 !important;
  border-color: #047857 !important;
  color: #fff !important;
}
html[data-theme="dark"] .btn-outline {
  background: transparent !important;
  border-color: #475569 !important;
  color: #e2e8f0 !important;
}
html[data-theme="dark"] .btn-outline:hover {
  border-color: #34d399 !important;
  color: #6ee7b7 !important;
  background: #064e3b !important;
}
html[data-theme="dark"] .btn-ghost {
  color: #e2e8f0 !important;
}
html[data-theme="dark"] .btn-ghost:hover {
  background: rgba(255,255,255,0.08) !important;
}

/* Tables */
html[data-theme="dark"] thead th {
  background: #1e293b !important;
  color: #94a3b8 !important;
  border-bottom-color: #334155 !important;
}
html[data-theme="dark"] tbody td {
  border-bottom-color: #1e293b !important;
  color: #e2e8f0 !important;
}
html[data-theme="dark"] tbody tr:hover td {
  background: #1e293b !important;
}

/* Muted / secondary text */
html[data-theme="dark"] .muted,
html[data-theme="dark"] .page-subtitle,
html[data-theme="dark"] .sub {
  color: #94a3b8 !important;
}
html[data-theme="dark"] .page-title,
html[data-theme="dark"] h1, html[data-theme="dark"] h2, html[data-theme="dark"] h3 {
  color: #f8fafc !important;
}

/* Badges */
html[data-theme="dark"] .badge {
  background: #064e3b;
  color: #a7f3d0;
}
html[data-theme="dark"] .badge-success { background: #064e3b; color: #6ee7b7; }
html[data-theme="dark"] .badge-warning { background: #78350f; color: #fde68a; }
html[data-theme="dark"] .badge-danger { background: #7f1d1d; color: #fecaca; }
html[data-theme="dark"] .badge-info { background: #1e3a8a; color: #bfdbfe; }
html[data-theme="dark"] .badge-muted { background: #1e293b; color: #94a3b8; }

/* Alerts — readable on dark */
html[data-theme="dark"] .alert-success { background: #064e3b; border-color: #047857; color: #a7f3d0; }
html[data-theme="dark"] .alert-error,
html[data-theme="dark"] .alert-danger { background: #7f1d1d; border-color: #991b1b; color: #fecaca; }
html[data-theme="dark"] .alert-warning { background: #78350f; border-color: #92400e; color: #fde68a; }
html[data-theme="dark"] .alert-info { background: #1e3a8a; border-color: #1e40af; color: #bfdbfe; }

/* Auth right panel */
html[data-theme="dark"] .auth-right {
  background: #0b1220 !important;
}
html[data-theme="dark"] .auth-form-shell {
  background: #111827 !important;
  border-color: #334155 !important;
}
html[data-theme="dark"] .auth-legal-strip {
  background: #022c22;
}
html[data-theme="dark"] .sso-divider::before,
html[data-theme="dark"] .sso-divider::after {
  background: #334155;
}

/* Customer / admin shells */
html[data-theme="dark"] .customer-body {
  background: #0b1220;
}
html[data-theme="dark"] .sidebar-customer {
  background: linear-gradient(180deg, #022c22 0%, #0b1220 100%) !important;
}
html[data-theme="dark"] .topbar,
html[data-theme="dark"] .desktop-topbar,
html[data-theme="dark"] .customer-topbar {
  background: #111827 !important;
  border-color: #334155 !important;
  color: #f1f5f9;
}
html[data-theme="dark"] .admin-body {
  background: #0b1220;
}
html[data-theme="dark"] .admin-body .card,
html[data-theme="dark"] .admin-body .material-card {
  background: #111827 !important;
  border-color: #334155 !important;
}
html[data-theme="dark"] .admin-body .table-wrap {
  background: #111827;
  border-color: #334155;
}

/* Live search / dropdowns */
html[data-theme="dark"] .live-results,
html[data-theme="dark"] .live-search-results {
  background: #1e293b !important;
  border-color: #475569 !important;
}
html[data-theme="dark"] .live-results a,
html[data-theme="dark"] .live-item,
html[data-theme="dark"] .lsr-item {
  color: #e2e8f0 !important;
  border-bottom-color: #334155 !important;
}
html[data-theme="dark"] .live-results a:hover,
html[data-theme="dark"] .lsr-item:hover {
  background: #064e3b !important;
}

/* Code / mono */
html[data-theme="dark"] code {
  background: #1e293b;
  color: #a7f3d0;
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

/* Theme toggle control */
.theme-toggle {
  min-width: 2.5rem;
  min-height: 2.5rem;
  padding: 0.35rem 0.55rem !important;
  border-radius: 999px !important;
  border: 1px solid var(--border, #e2e8f0);
  background: var(--card, #fff);
  line-height: 1;
  font-size: 1.05rem;
  cursor: pointer;
}
html[data-theme="dark"] .theme-toggle {
  background: #1e293b;
  border-color: #475569;
  color: #fde68a;
}
.theme-toggle:hover {
  border-color: var(--primary);
}

/* SweetAlert dark-ish when theme dark */
html[data-theme="dark"] .swal2-popup {
  background: #1e293b !important;
  color: #f1f5f9 !important;
}
html[data-theme="dark"] .swal2-title,
html[data-theme="dark"] .swal2-html-container {
  color: #f1f5f9 !important;
}
html[data-theme="dark"] .swal2-confirm {
  background: #059669 !important;
}

/* Ban centre / misc light surfaces forced white */
html[data-theme="dark"] .ban-kpi {
  background: #111827 !important;
  border-color: #334155 !important;
}
html[data-theme="dark"] .ban-kpi-n { color: #34d399 !important; }
html[data-theme="dark"] .ban-tab.on { color: #6ee7b7 !important; border-bottom-color: #34d399 !important; }

/* Charts / empty states */
html[data-theme="dark"] .empty {
  color: #94a3b8 !important;
}

/* Ensure hero / gradient sections still readable */
html[data-theme="dark"] .portal-hero {
  background: linear-gradient(90deg, #064e3b, #111827) !important;
}

/* Scrollbars (webkit) */
html[data-theme="dark"] .ksd-scroll-thin::-webkit-scrollbar-thumb {
  background: #475569;
}


/* ===== Portal mobile fixes (customer + admin) ===== */
@media (max-width: 768px) {
  .app-shell { flex-direction: column; }
  .sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    z-index: 1000;
    transform: translateX(-105%);
    transition: transform .2s ease;
    width: min(280px, 88vw);
    height: 100vh;
    height: 100dvh;
  }
  .sidebar.open, body.sidebar-open .sidebar {
    transform: translateX(0);
    box-shadow: 8px 0 24px rgba(0,0,0,.25);
  }
  .sidebar-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(15,23,42,.45);
    z-index: 999;
  }
  body.sidebar-open .sidebar-overlay { display: block; }
  .main-content {
    width: 100%;
    min-width: 0;
    padding-bottom: 2rem;
  }
  .topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    padding: .55rem .75rem !important;
    gap: .5rem;
    flex-wrap: wrap;
  }
  .container, .admin-body, .main-content > .container {
    padding-left: .75rem !important;
    padding-right: .75rem !important;
    max-width: 100% !important;
  }
  .card {
    max-width: 100%;
    overflow-x: auto;
  }
  .table-wrap {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .table-wrap table {
    min-width: 520px;
  }
  .grid-2, .settings-shell,
  [style*="grid-template-columns:minmax(280px"],
  [style*="grid-template-columns:1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
  .btn-row, .form-actions {
    flex-wrap: wrap;
  }
  .btn, button.btn {
    max-width: 100%;
  }
  iframe, object {
    max-width: 100%;
  }
  .page-title { font-size: 1.15rem !important; }
  .stats-row, .rhub-stats {
    grid-template-columns: 1fr 1fr !important;
  }
}
@media (max-width: 480px) {
  .stats-row, .rhub-stats {
    grid-template-columns: 1fr !important;
  }
  .table-wrap table { min-width: 460px; font-size: .8rem; }
}


/* ============================================================
   Mobile / responsive overhaul (v2.13.17)
   - Prevent horizontal overflow & overlapping cards
   - Auth form usability on small screens
   - Dashboard card auto-fit
   - Dark mode text contrast on cards / muted / inputs
   ============================================================ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  overflow-x: hidden;
  max-width: 100vw;
}

img, video, canvas, svg {
  max-width: 100%;
  height: auto;
}

/* Soft-kill fixed min-widths that cause overflow on phones */
@media (max-width: 768px) {
  .container,
  .main-content,
  .customer-shell,
  .admin-shell,
  .app-shell,
  .rhub,
  .inv-split,
  .settings-shell {
    max-width: 100% !important;
    min-width: 0 !important;
  }

  .card,
  .material-card,
  .stat-card,
  .kpi-card,
  .pay-card,
  .dash-module-card,
  .dash-action,
  .pricing-card,
  .ban-kpi,
  .rhub .material-card {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  /* Force multi-column layouts to single column */
  .grid-2,
  .grid-3,
  .grid-4,
  .inv-split,
  .settings-shell,
  .rhub-split,
  .print-dash > div[style*="grid"],
  div[style*="grid-template-columns:minmax"],
  div[style*="grid-template-columns:1fr 1fr"],
  div[style*="grid-template-columns: repeat(2"],
  div[style*="grid-template-columns:repeat(2"],
  div[style*="grid-template-columns: 1fr 1.1fr"],
  div[style*="grid-template-columns:minmax(280px"] {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 0.85rem !important;
  }

  /* Auto-fit card grids */
  .stats-row,
  .rhub-stats,
  .dash-modules,
  .kpi-row,
  .ban-kpis,
  .admin-stats {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr)) !important;
    gap: 0.65rem !important;
  }

  .table-wrap {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .btn-row,
  .form-actions,
  .rhub-btn-row,
  .toolbar {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0.5rem !important;
  }

  .btn,
  button.btn,
  a.btn {
    min-height: 44px;
    padding: 0.55rem 0.9rem;
  }

  input.form-control,
  select.form-control,
  textarea.form-control,
  .form-control {
    font-size: 16px !important; /* prevent iOS zoom */
    max-width: 100%;
    width: 100%;
  }

  /* Sticky topbar safe area */
  .topbar,
  .customer-topbar {
    padding-left: max(0.75rem, env(safe-area-inset-left)) !important;
    padding-right: max(0.75rem, env(safe-area-inset-right)) !important;
  }

  .main-content {
    padding-bottom: max(2rem, env(safe-area-inset-bottom)) !important;
  }

  /* Nested menus / dropdowns */
  .nav-dropdown,
  .dropdown-menu,
  .edu-submenu {
    max-width: min(100vw - 1rem, 320px);
    left: auto !important;
    right: 0.5rem;
  }

  /* SweetAlert / toasts visibility */
  .swal2-container {
    padding: 0.5rem !important;
  }
  .swal2-popup {
    width: min(92vw, 28rem) !important;
    font-size: 0.95rem !important;
  }
}

@media (max-width: 480px) {
  .stats-row,
  .rhub-stats,
  .dash-modules {
    grid-template-columns: 1fr !important;
  }

  h1, .page-title { font-size: 1.25rem !important; }
  h2 { font-size: 1.1rem !important; }

  .login-method-cards .btn,
  .login-method-cards button {
    width: 100%;
  }
}

/* ---- Dark mode: kill light-on-light / blurry muted text ---- */
html[data-theme="dark"] .card,
html[data-theme="dark"] .material-card,
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .kpi-card,
html[data-theme="dark"] .dash-module-card,
html[data-theme="dark"] .pay-card,
html[data-theme="dark"] .auth-form-shell,
html[data-theme="dark"] .login-method-cards .material-card,
html[data-theme="dark"] .rhub .material-card,
html[data-theme="dark"] .table-wrap {
  background: #111827 !important;
  color: #f1f5f9 !important;
  border-color: #334155 !important;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

html[data-theme="dark"] .card *,
html[data-theme="dark"] .material-card *,
html[data-theme="dark"] .dash-module-card *,
html[data-theme="dark"] .stat-card * {
  /* avoid inheriting light theme forced colors from inline styles */
}

html[data-theme="dark"] .card h1,
html[data-theme="dark"] .card h2,
html[data-theme="dark"] .card h3,
html[data-theme="dark"] .card strong,
html[data-theme="dark"] .material-card h1,
html[data-theme="dark"] .material-card h2,
html[data-theme="dark"] .material-card h3,
html[data-theme="dark"] .material-card strong,
html[data-theme="dark"] .dash-module-card strong {
  color: #f8fafc !important;
}

html[data-theme="dark"] .muted,
html[data-theme="dark"] .card .muted,
html[data-theme="dark"] .material-card .muted,
html[data-theme="dark"] .dash-module-card span,
html[data-theme="dark"] .stat-card .label,
html[data-theme="dark"] .sub {
  color: #cbd5e1 !important; /* brighter than #94a3b8 for mobile clarity */
  opacity: 1 !important;
  text-shadow: none !important;
  filter: none !important;
}

html[data-theme="dark"] .form-control,
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
  background: #0f172a !important;
  color: #f1f5f9 !important;
  border-color: #475569 !important;
}

html[data-theme="dark"] .form-control::placeholder {
  color: #94a3b8 !important;
  opacity: 1;
}

html[data-theme="dark"] label {
  color: #e2e8f0 !important;
}

/* Inline light backgrounds that break dark mode */
html[data-theme="dark"] [style*="background:#fff"],
html[data-theme="dark"] [style*="background: #fff"],
html[data-theme="dark"] [style*="background:#ffffff"],
html[data-theme="dark"] [style*="background: #ffffff"],
html[data-theme="dark"] [style*="background:white"] {
  background: #111827 !important;
  color: #f1f5f9 !important;
}

html[data-theme="dark"] [style*="color:#0f172a"],
html[data-theme="dark"] [style*="color: #0f172a"],
html[data-theme="dark"] [style*="color:#111"],
html[data-theme="dark"] [style*="color:#1a1a1a"] {
  color: #f1f5f9 !important;
}

html[data-theme="dark"] [style*="color:#64748b"],
html[data-theme="dark"] [style*="color: #64748b"] {
  color: #cbd5e1 !important;
}


/* ============================================================
   CSS Container Queries (v2.13.18)
   Layout responds to parent width, not only viewport — so cards
   in side columns / split panes adapt correctly on desktop too.
   ============================================================ */

/* --- Establish containment contexts --- */
.main-content,
.customer-shell .main-content,
.admin-shell .main-content,
.container.page-content {
  container-type: inline-size;
  container-name: main-content;
}

.card,
.material-card,
.pay-card,
.stat-card,
.kpi-card {
  container-type: inline-size;
  container-name: card;
}

.stats-row,
.rhub-stats,
.dash-modules,
.admin-stats,
.kpi-row,
.ban-kpis {
  container-type: inline-size;
  container-name: stats-grid;
}

.table-wrap,
.materials-table-wrap {
  container-type: inline-size;
  container-name: table-pane;
}

.inv-split,
.rhub-split,
.settings-shell,
.print-dash,
.cbc-ms-row {
  container-type: inline-size;
  container-name: split-pane;
}

.auth-right,
.auth-form-shell {
  container-type: inline-size;
  container-name: auth-form;
}

.login-method-cards {
  container-type: inline-size;
  container-name: login-methods;
}

/* --- Main content column --- */
@container main-content (max-width: 720px) {
  .grid-2,
  .grid-3,
  .settings-shell,
  .inv-split {
    grid-template-columns: 1fr !important;
  }
  .page-title {
    font-size: 1.2rem;
  }
}

@container main-content (max-width: 480px) {
  .stats-row,
  .rhub-stats,
  .dash-modules {
    grid-template-columns: 1fr !important;
  }
  .btn-row .btn {
    flex: 1 1 100%;
  }
}

@container main-content (min-width: 721px) and (max-width: 960px) {
  .stats-row,
  .rhub-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .dash-modules {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)) !important;
  }
}

@container main-content (min-width: 961px) {
  .stats-row,
  .rhub-stats {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }
}

/* --- Stats / module grids (self-contained) --- */
@container stats-grid (max-width: 360px) {
  .stat-card,
  .kpi-card,
  .dash-module-card,
  .ban-kpi {
    padding: 0.75rem;
  }
  .stat-card .value,
  .kpi-card .value {
    font-size: 1.15rem;
  }
}

@container stats-grid (min-width: 361px) and (max-width: 560px) {
  /* 2-up when the grid itself is mid-width */
}

/* --- Individual cards --- */
@container card (max-width: 280px) {
  .card h2,
  .material-card h2,
  .card h3,
  .material-card h3 {
    font-size: 0.95rem;
  }
  .btn-row {
    flex-direction: column;
  }
  .btn-row .btn {
    width: 100%;
  }
}

@container card (max-width: 400px) {
  .form-group label {
    font-size: 0.7rem;
  }
}

/* --- Split panes (billing | preview, tools | detail) --- */
@container split-pane (max-width: 640px) {
  .inv-split,
  .rhub-split,
  .settings-shell,
  .print-dash > div[style*="grid"],
  .cbc-ms-row {
    display: grid !important;
    grid-template-columns: 1fr !important;
  }
}

@container split-pane (min-width: 641px) {
  .inv-split,
  .rhub-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    gap: 1rem;
    align-items: start;
  }
}

/* --- Tables: denser when pane is narrow --- */
@container table-pane (max-width: 520px) {
  table {
    font-size: 0.8rem;
  }
  th, td {
    padding: 0.4rem 0.5rem;
  }
  .btn-sm {
    padding: 0.25rem 0.4rem;
    font-size: 0.75rem;
  }
}

/* --- Auth form container --- */
@container auth-form (max-width: 420px) {
  .auth-form-shell h1 {
    font-size: 1.25rem;
    text-align: center;
  }
  .auth-form-shell .grid2 {
    grid-template-columns: 1fr !important;
  }
  .auth-form-shell .btn-primary,
  .auth-form-shell button[type="submit"] {
    width: 100%;
    min-height: 48px;
  }
  .auth-form-shell .form-control {
    font-size: 16px;
    min-height: 46px;
  }
}

@container auth-form (min-width: 421px) {
  .auth-form-shell {
    max-width: 420px;
  }
}

@container login-methods (max-width: 360px) {
  .login-method-cards .btn,
  .login-method-cards button {
    width: 100%;
    display: block;
  }
}

/* --- Feature detection fallback note: older browsers ignore @container --- */
@supports not (container-type: inline-size) {
  /* Viewport media queries already cover mobile; no extra required */
}


/* sticky header restore 2.13.28 */
.site-top-sticky {
  position: sticky !important;
  top: 0 !important;
  z-index: 1100 !important;
}
html, body {
  overflow-x: visible;
  max-width: 100%;
}

/* —— Portal colour themes (customer preference) —— */
html[data-color-theme="orange"] {
  --primary: #c2410c;
  --primary-dark: #9a3412;
  --primary-light: #ffedd5;
  --accent: #ea580c;
  --sidebar: #7c2d12;
  --bg: #fffaf5;
}
html[data-color-theme="blue"] {
  --primary: #1d4ed8;
  --primary-dark: #1e40af;
  --primary-light: #dbeafe;
  --accent: #3b82f6;
  --sidebar: #1e3a8a;
  --bg: #f8fafc;
}
html[data-color-theme="cyan"] {
  --primary: #0891b2;
  --primary-dark: #0e7490;
  --primary-light: #cffafe;
  --accent: #06b6d4;
  --sidebar: #155e75;
  --bg: #f0fdfa;
}
html[data-color-theme="oceanic"] {
  --primary: #0f766e;
  --primary-dark: #115e59;
  --primary-light: #ccfbf1;
  --accent: #14b8a6;
  --sidebar: #134e4a;
  --bg: #f0fdfa;
}
html[data-color-theme="green"],
html:not([data-color-theme]),
html[data-color-theme=""] {
  /* default forest green — already on :root */
}
.theme-swatches { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.theme-swatch {
  width: 1.35rem; height: 1.35rem; border-radius: 999px; border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0,0,0,.15); cursor: pointer; padding: 0;
}
.theme-swatch[data-theme-key="green"] { background: #064e3b; }
.theme-swatch[data-theme-key="orange"] { background: #c2410c; }
.theme-swatch[data-theme-key="blue"] { background: #1d4ed8; }
.theme-swatch[data-theme-key="cyan"] { background: #0891b2; }
.theme-swatch[data-theme-key="oceanic"] { background: #0f766e; }
.theme-swatch[data-theme-key="custom"] { background: linear-gradient(135deg,#064e3b,#f0a500); }
.theme-swatch.is-active { box-shadow: 0 0 0 2px var(--primary, #064e3b); }


/* Auto-fit files to available folder width (minimize blank grid space) */
.file-grid.file-grid-autofit,
.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  gap: 0.75rem;
  width: 100%;
  align-content: start;
}
.folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr));
  gap: 0.75rem;
  width: 100%;
  align-content: start;
}
@media (min-width: 900px) {
  .file-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  }
}
@media (min-width: 1200px) {
  .file-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  }
}

/* —— Compact action menus (popup submenus) —— */
.ksd-menu {
  position: relative;
  display: inline-block;
  vertical-align: middle;
  z-index: 40;
}
.ksd-menu-open {
  z-index: 6000;
}
.ksd-menu-toggle {
  white-space: nowrap;
}
.ksd-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 6001 !important;
  min-width: 11.5rem;
  max-width: min(18rem, 92vw);
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
  padding: 0.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.ksd-menu-panel[hidden] {
  display: none !important;
}
.ksd-menu-panel a,
.ksd-menu-panel button.ksd-menu-item,
.ksd-menu-panel .ksd-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.45rem 0.65rem;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #0f172a;
  font: inherit;
  font-size: 0.84rem;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.ksd-menu-panel a:hover,
.ksd-menu-panel a:focus,
.ksd-menu-panel button.ksd-menu-item:hover,
.ksd-menu-panel button.ksd-menu-item:focus,
.ksd-menu-panel .ksd-menu-item:hover,
.ksd-menu-panel .ksd-menu-item:focus {
  background: #064e3b !important;
  color: #ffffff !important;
  outline: none;
}
.ksd-menu-panel a:active,
.ksd-menu-panel .ksd-menu-item:active {
  background: #065f46 !important;
  color: #ffffff !important;
}
.ksd-menu-panel .ksd-menu-sep {
  height: 1px;
  margin: 0.25rem 0.35rem;
  background: #e2e8f0;
  border: 0;
}
.ksd-menu-panel .ksd-menu-danger {
  color: #b91c1c;
}
.ksd-menu-panel .ksd-menu-danger:hover,
.ksd-menu-panel .ksd-menu-danger:focus {
  background: #b91c1c !important;
  color: #ffffff !important;
}
.ksd-menu-open > .ksd-menu-toggle {
  border-color: #064e3b !important;
  background: #064e3b !important;
  color: #ffffff !important;
}
.ksd-menu-panel a,
.ksd-menu-panel .ksd-menu-item {
  color: #0f172a !important;
  font-weight: 500;
}
/* Keep table action columns narrow */
td .ksd-menu,
.file-actions .ksd-menu {
  max-width: 100%;
}


/* Downloads: fill horizontal space; prefer complete rows */
.file-grid.file-grid-fit,
.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr));
  gap: 0.75rem;
  width: 100%;
  align-items: stretch;
}
.file-grid .file-card {
  min-width: 0;
  height: 100%;
}
@media (min-width: 1100px) {
  .file-grid.file-grid-fit {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (min-width: 800px) and (max-width: 1099px) {
  .file-grid.file-grid-fit {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (min-width: 520px) and (max-width: 799px) {
  .file-grid.file-grid-fit {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}




/* Footer store badges — App Store / Google Play style */
.site-footer-apps {
  margin-top: 1.1rem;
}
.site-footer-apps-label {
  margin: 0 0 0.55rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}
.site-footer-apps-soon {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: #fbbf24;
  color: #1c1917;
}
.site-footer-app-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}
.site-footer-store-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 48px;
  padding: 0.4rem 0.95rem 0.4rem 0.7rem;
  border-radius: 10px;
  background: #000;
  color: #fff !important;
  text-decoration: none !important;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
  cursor: default;
  opacity: 0.95;
}
.site-footer-store-badge:hover,
.site-footer-store-badge:focus {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  opacity: 1;
  outline: none;
}
.site-footer-store-android {
  background: #000;
}
.site-footer-store-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
}
.site-footer-store-logo svg {
  display: block;
  width: 28px;
  height: 28px;
}
.site-footer-store-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1.1;
  text-align: left;
}
.site-footer-store-eyebrow {
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.85;
}
.site-footer-store-name {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
@media (max-width: 640px) {
  .site-footer-app-badges {
    flex-direction: column;
    align-items: stretch;
  }
  .site-footer-store-badge {
    width: 100%;
    max-width: 220px;
  }
}

.site-footer-modern .site-footer-metrics,
.site-footer-modern .site-footer-metrics strong,
.site-footer-modern .site-footer-version-center,
.site-footer-modern .site-footer-copy {
  color: rgba(255, 255, 255, 0.88);
}
.site-footer-modern .site-footer-metrics strong {
  color: #fff;
}
.site-footer-modern .site-footer-legal-links {
  justify-content: center;
}


/* ===== Insights module (unified admin tools) ===== */
.insights-nav {
  margin: 0 0 1.15rem;
  padding: 0.35rem 0;
}
.insights-nav-scroll {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.insights-nav-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text, #0f172a);
  background: var(--card, #fff);
  border: 1px solid var(--border, #e2e8f0);
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.insights-nav-chip:hover {
  border-color: var(--primary, #064e3b);
  color: var(--primary, #064e3b);
}
.insights-nav-chip.is-active {
  background: var(--primary, #064e3b);
  border-color: var(--primary, #064e3b);
  color: #fff;
}
.insights-page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 1rem;
}
.insights-page-head h1,
.insights-page-head .page-title {
  margin: 0;
  font-size: 1.35rem;
}
.insights-page-head p {
  margin: 0.25rem 0 0;
  color: var(--muted, #64748b);
  font-size: 0.9rem;
  max-width: 40rem;
}
.insights-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: end;
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  background: var(--card, #fff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 12px;
}
.insights-filter-bar .form-group {
  margin: 0;
  min-width: 140px;
}
.insights-filter-bar .form-group.grow {
  flex: 1 1 180px;
}
.insights-hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.85rem;
}
.insights-hub-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1rem 1.1rem;
  border-radius: 12px;
  border: 1px solid var(--border, #e2e8f0);
  background: var(--card, #fff);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.insights-hub-card:hover {
  border-color: var(--primary, #064e3b);
  box-shadow: 0 4px 14px rgba(13, 110, 63, 0.12);
  text-decoration: none;
}
.insights-hub-card strong {
  font-size: 0.95rem;
}
.insights-hub-card span {
  font-size: 0.8rem;
  color: var(--muted, #64748b);
  line-height: 1.35;
}
.insights-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.55);
}
.insights-modal[hidden] { display: none !important; }
.insights-modal-dialog {
  width: min(720px, 100%);
  max-height: min(85vh, 900px);
  overflow: auto;
  background: var(--card, #fff);
  border-radius: 14px;
  padding: 1.15rem 1.25rem 1.25rem;
  box-shadow: 0 20px 50px rgba(0,0,0,0.25);
}
.insights-modal-dialog h2 {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
}
.insights-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1rem;
}
.insights-table-actions {
  white-space: nowrap;
  text-align: right;
}
@media (max-width: 640px) {
  .insights-nav-scroll {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.25rem;
  }
}

.live-search-results .lsr-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  border-top: 1px solid var(--border, #e2e8f0);
  background: #f8fafc;
  position: sticky;
  bottom: 0;
}
.live-search-results .lsr-view-all {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary, #064e3b);
  text-decoration: none;
  white-space: nowrap;
}
.live-search-results .lsr-view-all:hover { text-decoration: underline; }
.live-search-results {
  max-height: min(360px, 55vh);
  overflow-y: auto;
}
html[data-theme="dark"] .live-search-results .lsr-footer {
  background: #0f172a;
  border-top-color: #1e293b;
}


/* === ksd mobile first-load hardening v21473 === */
/* Prevent FOUC-ish broken shells before full CSS settles on mobile */
html, body {
  max-width: 100%;
  overflow-x: clip;
}
img, svg, video, canvas, iframe {
  max-width: 100%;
}
.main-content, .admin-main, .customer-content {
  min-width: 0;
  max-width: 100%;
}
@media (max-width: 768px) {
  .sidebar { display: none !important; }
  .mobile-bar {
    display: flex !important;
    align-items: center;
    gap: .5rem;
    padding: .65rem .85rem;
    position: sticky;
    top: 0;
    z-index: 100;
  }
  .app-shell, .sidebar-layout {
    display: block;
  }
  .main-content {
    padding: .75rem !important;
    width: 100%;
  }
  .mod-shell,
  .inv-split,
  .sub-grid,
  .sub-admin,
  .pricing-grid,
  .plan-grid {
    grid-template-columns: 1fr !important;
  }
  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }
  .btn, .btn-sm {
    min-height: 40px;
  }
  input.form-control, select.form-control, textarea.form-control {
    font-size: 16px !important; /* avoid iOS zoom on focus */
  }
}
@media (max-width: 480px) {
  .hero-actions { flex-direction: column; }
  .stats-row { grid-template-columns: 1fr 1fr; }
}


/* === Documents / receipts readability (v2.15.79) === */
.slip, .receipt-slip, .invoice-slip, .doc-slip {
  background: #ffffff !important;
  color: #0f172a !important;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
  font-size: 14px;
  line-height: 1.5;
  padding: 1.25rem 1.5rem;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  max-width: 800px;
  margin: 0 auto;
}
.slip h1, .receipt-slip h1, .invoice-slip h1,
.slip h2, .receipt-slip h2 {
  color: #0f172a !important;
  font-weight: 800;
  margin: 0 0 .35rem;
}
.slip .muted, .receipt-slip .muted, .invoice-slip .muted {
  color: #64748b !important;
}
.slip strong, .receipt-slip strong {
  color: #0f172a !important;
}
.slip table, .receipt-slip table, .invoice-slip table {
  width: 100%;
  border-collapse: collapse;
  color: #0f172a !important;
  background: #fff !important;
}
.slip th, .receipt-slip th {
  background: #f8fafc !important;
  color: #475569 !important;
  font-weight: 700;
  text-align: left;
  padding: .55rem .65rem;
  border-bottom: 1px solid #e2e8f0;
}
.slip td, .receipt-slip td {
  padding: .55rem .65rem;
  border-bottom: 1px solid #f1f5f9;
  color: #0f172a !important;
  background: #fff !important;
}
.slip .badge, .receipt-slip .badge {
  display: inline-block;
  padding: .2rem .55rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  background: #e2e8f0;
  color: #0f172a !important;
}
.slip .badge-paid, .receipt-slip .badge-paid {
  background: #dcfce7 !important;
  color: #166534 !important;
}
.slip-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #064e3b;
}
.slip-total {
  font-size: 1.25rem;
  font-weight: 800;
  color: #064e3b !important;
}
@media print {
  body { background: #fff !important; color: #000 !important; }
  .slip, .receipt-slip, .invoice-slip {
    border: none !important;
    box-shadow: none !important;
    color: #000 !important;
    background: #fff !important;
  }
  .main-sidebar, .main-header, .ksd-footer-bar, .btn, .no-print { display: none !important; }
  .content-wrapper { margin: 0 !important; }
}


/* ===== 2.91.37 Home + portal treeview + auth polish ===== */

/* AdminLTE treeview visibility (accordion) */
.nav-sidebar .nav-item.has-treeview > .nav-treeview {
  display: none;
  padding-left: 0.35rem;
}
.nav-sidebar .nav-item.has-treeview.menu-open > .nav-treeview {
  display: block !important;
}
.nav-sidebar .nav-item.has-treeview > .nav-link .right {
  transition: transform 0.15s ease;
}
.nav-sidebar .nav-item.has-treeview.menu-open > .nav-link .right {
  transform: rotate(-90deg);
}
.nav-sidebar .nav-link {
  cursor: pointer;
}

/* Homepage hero + spider-net */
.page-with-particles {
  position: relative;
  overflow: hidden;
}
.particle-network-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}
.page-particle-content {
  position: relative;
  z-index: 1;
}
.hm-hero {
  position: relative;
  padding: 2.75rem 1.25rem 2.25rem;
  background: linear-gradient(165deg, #ecfdf5 0%, #e8f5ef 35%, #f0f9ff 70%, #f8faf9 100%);
  overflow: hidden;
}
.hm-hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 15% 25%, rgba(13, 110, 63, 0.14), transparent 52%),
    radial-gradient(ellipse at 85% 15%, rgba(30, 58, 95, 0.12), transparent 48%),
    radial-gradient(ellipse at 50% 100%, rgba(0, 128, 128, 0.08), transparent 55%);
  pointer-events: none;
}
.hm-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 1120px;
  margin: 0 auto;
}
.hm-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #fff;
  border: 1px solid #a7f3d0;
  color: #064e3b;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(13, 110, 63, 0.08);
}
.hm-hero h1 {
  font-size: clamp(1.75rem, 4.2vw, 2.55rem);
  margin: 0.85rem 0 0.55rem;
  color: #0f172a;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.hm-sub {
  color: #475569;
  max-width: 38rem;
  font-size: 1.05rem;
  line-height: 1.55;
  margin: 0;
}
.hm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1.25rem;
}
.hm-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.15rem;
  border-radius: 11px;
  font-weight: 700;
  text-decoration: none;
  font-size: 0.92rem;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.hm-btn:hover { transform: translateY(-1px); }
.hm-btn-primary {
  background: #1e3a8a;
  color: #fff !important;
  box-shadow: 0 4px 14px rgba(30, 58, 138, 0.28);
}
.hm-btn-primary:hover { background: #1e40af; color: #fff !important; }
.hm-btn-ghost {
  background: #fff;
  color: #0f172a !important;
  border: 1px solid #e2e8f0;
}
.hm-btn-ghost:hover {
  border-color: #064e3b;
  color: #064e3b !important;
}

/* Stats row */
.hm-stats-classic.stats-row,
.stats-row.hm-stats-classic {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.75rem;
  max-width: 1120px;
  margin: 1.25rem auto;
  padding: 0 1.25rem;
}
.stat-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 1rem 1.1rem;
  text-align: center;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}
.stat-card .stat-num,
.stat-card .num {
  font-size: 1.45rem;
  font-weight: 800;
  color: #064e3b;
  display: block;
}
.stat-card .stat-label,
.stat-card .lbl {
  font-size: 0.78rem;
  color: #64748b;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Module cards grid */
.hm-modules,
.home-modules {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  max-width: 1120px;
  margin: 1.5rem auto 2rem;
  padding: 0 1.25rem;
}
.hm-module,
.home-mod-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 1.15rem 1.2rem;
  text-decoration: none;
  color: #0f172a;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  display: block;
}
.hm-module:hover,
.home-mod-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.1);
  border-color: #a7f3d0;
  color: #0f172a;
}
.hm-module .hm-mod-ico,
.home-mod-card .ico {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ecfdf5;
  color: #064e3b;
  font-size: 1.15rem;
  margin-bottom: 0.65rem;
}
.hm-module.tone-navy .hm-mod-ico { background: #eff6ff; color: #1e3a8a; }
.hm-module.tone-teal .hm-mod-ico { background: #f0fdfa; color: #0f766e; }
.hm-module.tone-amber .hm-mod-ico { background: #fffbeb; color: #b45309; }
.hm-module h3,
.home-mod-card strong {
  font-size: 1.05rem;
  margin: 0 0 0.3rem;
  font-weight: 700;
}
.hm-module p,
.home-mod-card span.desc {
  margin: 0;
  color: #64748b;
  font-size: 0.88rem;
  line-height: 1.45;
}

/* CTA strip */
.hm-cta {
  max-width: 1120px;
  margin: 0 auto 2.5rem;
  padding: 1.5rem 1.5rem;
  border-radius: 18px;
  background: linear-gradient(120deg, #1e3a8a 0%, #064e3b 100%);
  color: #fff;
  text-align: center;
}
.hm-cta h2 { margin: 0 0 0.4rem; font-size: 1.35rem; }
.hm-cta p { margin: 0 0 1rem; opacity: 0.9; }
.hm-cta .hm-btn-primary {
  background: #fff;
  color: #1e3a8a !important;
  box-shadow: none;
}
.hm-cta .hm-btn-primary:hover { background: #f8fafc; }

/* Mobile sidebar portal */
@media (max-width: 991.98px) {
  body.customer-body .main-sidebar,
  body.admin-body .main-sidebar {
    position: fixed !important;
    top: 0; left: 0; bottom: 0;
    width: min(280px, 86vw) !important;
    z-index: 1040;
    transform: translateX(-105%);
    transition: transform 0.22s ease;
    overflow-y: auto;
  }
  body.sidebar-open .main-sidebar {
    transform: translateX(0) !important;
  }
  .ksd-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 1035;
  }
  body.sidebar-open .ksd-sidebar-backdrop { display: block; }
  .content-wrapper { margin-left: 0 !important; }
}


/* 2.91.41 treeview accordion — force open state */
.nav-sidebar .nav-item.has-treeview > .nav-treeview {
  display: none !important;
}
.nav-sidebar .nav-item.has-treeview.menu-open > .nav-treeview {
  display: block !important;
}
.nav-sidebar .nav-item.has-treeview > .nav-link {
  cursor: pointer;
}
.nav-sidebar .nav-item.has-treeview > .nav-link p {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin: 0;
}
.sidebar-mini .main-sidebar .nav-sidebar .nav-item > .nav-link {
  width: auto;
}


/* 2.91.41 home polish */
.hm-hero { isolation: isolate; }
.hm-modules, .home-modules {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  max-width: 1120px;
  margin: 1.75rem auto 2rem;
  padding: 0 1.25rem;
}
.navbar-inner { gap: .5rem; }
.nav-links a { white-space: nowrap; }
@media (max-width: 900px) {
  .hm-hero { padding: 1.75rem 1rem 1.5rem; }
  .hm-actions { flex-direction: column; align-items: stretch; }
  .hm-btn { justify-content: center; }
}

/* ===== Logged-in user menu (public header) — mobile + desktop ===== */
.user-menu-dropdown { position: relative; }
.user-menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.65rem;
  max-width: 12rem;
}
.user-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: var(--primary, #064e3b);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}
.user-menu-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 7rem; }
.user-menu-panel {
  min-width: 14rem;
  right: 0;
  left: auto;
  padding: 0.35rem 0;
}
.user-menu-header {
  display: flex;
  flex-direction: column;
  padding: 0.65rem 1rem 0.5rem;
  border-bottom: 1px solid rgba(0,0,0,.08);
  margin-bottom: 0.25rem;
}
.user-menu-name { font-weight: 600; font-size: 0.9rem; }
.user-menu-email { font-size: 0.75rem; opacity: 0.75; }
.user-menu-divider { height: 1px; background: rgba(0,0,0,.08); margin: 0.25rem 0; list-style: none; }
.user-menu-panel .nav-sublink {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1rem;
}
.user-menu-panel .nav-sublink i { width: 1.1rem; text-align: center; opacity: 0.7; }
.user-menu-panel .text-danger { color: #c0392b !important; }
@media (max-width: 768px) {
  .user-menu-toggle { max-width: none; }
  .user-menu-panel {
    position: absolute;
    right: 0;
    left: auto;
    min-width: 12rem;
  }
}

/* ===== 2.91.47 Enterprise homepage ===== */
.hm-hero {
  position: relative;
  padding: clamp(2.5rem, 6vw, 4.5rem) 1.25rem 3rem;
  background: #064e3b;
  color: #fff;
  overflow: hidden;
}
.hm-hero-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 10% 20%, rgba(255,255,255,.12), transparent 55%),
    radial-gradient(ellipse 60% 50% at 90% 80%, rgba(0,0,0,.15), transparent 50%);
  pointer-events: none;
}
.hm-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  text-align: center;
}
.hm-badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: #083d28;
  color: #fff;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: .4rem .85rem;
  border-radius: 999px;
  margin: 0 0 1rem;
}
.hm-hero h1 {
  font-size: clamp(1.75rem, 4.5vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.15;
  margin: 0 0 .75rem;
  color: #fff;
}
.hm-sub {
  font-size: clamp(.95rem, 2vw, 1.1rem);
  line-height: 1.55;
  max-width: 40rem;
  margin: 0 auto 1.5rem;
  color: rgba(255,255,255,.92);
}
.hm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  justify-content: center;
}
.hm-btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .7rem 1.25rem;
  border-radius: 10px;
  font-weight: 700;
  font-size: .92rem;
  text-decoration: none;
  border: 2px solid transparent;
  transition: transform .15s ease, background .15s ease;
}
.hm-btn:hover { transform: translateY(-1px); text-decoration: none; }
.hm-btn-primary {
  background: #f5c518;
  color: #1a1a1a !important;
  border-color: #f5c518;
}
.hm-btn-primary:hover { background: #e6b800; }
.hm-btn-ghost {
  background: transparent;
  color: #fff !important;
  border-color: rgba(255,255,255,.55);
}
.hm-btn-ghost:hover { background: rgba(255,255,255,.12); }

.hm-stats-classic,
.stats-row-search {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: .65rem;
  max-width: 1100px;
  margin: -1.75rem auto 1.5rem;
  padding: 0 1rem;
  position: relative;
  z-index: 3;
}
.hm-stats-classic .stat-card,
.stats-row-search .stat-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: .85rem .65rem;
  text-align: center;
  box-shadow: 0 8px 24px rgba(15,23,42,.08);
}
.hm-stats-classic .stat-card .num,
.stats-row-search .stat-card .num {
  font-size: 1.25rem;
  font-weight: 800;
  color: #064e3b;
  letter-spacing: -.02em;
}
.hm-stats-classic .stat-card .label,
.stats-row-search .stat-card .label {
  font-size: .7rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-top: .2rem;
}

.hm-search-wrap {
  max-width: 900px;
  margin: 0 auto 2rem;
  padding: 0 1rem;
}
.hm-search {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  padding: 1.25rem 1.35rem;
  box-shadow: 0 12px 40px rgba(15,23,42,.08);
}
.hm-search-title {
  font-weight: 800;
  font-size: 1rem;
  color: #0f172a;
  margin-bottom: .85rem;
  display: flex;
  align-items: center;
  gap: .45rem;
}
.hm-search-title i { color: #064e3b; }
.hm-search-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr auto;
  gap: .65rem;
  align-items: end;
}
@media (max-width: 768px) {
  .hm-search-grid { grid-template-columns: 1fr; }
}
.hm-field label {
  display: block;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #64748b;
  margin-bottom: .3rem;
}
.hm-field input,
.hm-field select {
  width: 100%;
  border: 2px solid #cbd5e1;
  border-radius: 10px;
  padding: .65rem .75rem;
  font-size: .95rem;
  background: #fff;
  color: #0f172a;
}
.hm-field input:focus,
.hm-field select:focus {
  border-color: #064e3b;
  outline: none;
}
.hm-btn-block { width: 100%; justify-content: center; }

.hm-modules {
  max-width: 1100px;
  margin: 0 auto 2.5rem;
  padding: 0 1rem;
}
.hm-section-head {
  margin-bottom: 1rem;
}
.hm-section-head h2 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -.02em;
}
.hm-section-head p {
  margin: .35rem 0 0;
  color: #64748b;
  font-size: .95rem;
}
.hm-module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: .85rem;
}
.hm-module {
  display: flex;
  flex-direction: column;
  gap: .45rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 1.15rem 1.2rem;
  text-decoration: none !important;
  color: #0f172a;
  transition: border-color .15s, box-shadow .15s, transform .15s;
  border-top: 4px solid #064e3b;
}
.hm-module:hover {
  border-color: #064e3b;
  box-shadow: 0 10px 28px rgba(13,110,63,.12);
  transform: translateY(-2px);
}
.hm-module-ico {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 12px;
  background: #064e3b;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
}
.hm-module.tone-blue .hm-module-ico { background: #1e3a5f; }
.hm-module.tone-amber .hm-module-ico { background: #b45309; }
.hm-module.tone-cyan .hm-module-ico { background: #0e7490; }
.hm-module.tone-rose .hm-module-ico { background: #be123c; }
.hm-module.tone-purple .hm-module-ico { background: #6d28d9; }
.hm-module strong {
  font-size: 1rem;
  font-weight: 800;
}
.hm-module span:last-child {
  font-size: .85rem;
  color: #64748b;
  line-height: 1.4;
}

/* Sidebar FA icons size consistency */
.nav-sidebar .nav-treeview .nav-icon {
  font-size: 0.85rem !important;
  width: 1.4rem !important;
  text-align: center;
}
.nav-sidebar .nav-treeview .nav-link p {
  font-weight: 500;
}

/* ===== 2.91.48 Enterprise homepage (ent-*) — bold solid branding ===== */
.ent-hero {
  background: #064e3b;
  color: #fff;
  padding: clamp(2.25rem, 5vw, 3.75rem) 1.25rem 2.75rem;
  text-align: center;
}
.ent-hero-inner { max-width: 920px; margin: 0 auto; }
.ent-badge {
  display: inline-flex; align-items: center; gap: .4rem;
  background: #083d28; color: #fff; font-size: .75rem; font-weight: 800;
  letter-spacing: .05em; text-transform: uppercase;
  padding: .4rem .9rem; border-radius: 999px; margin-bottom: 1rem;
}
.ent-hero h1 {
  margin: 0 0 .75rem; font-size: clamp(1.6rem, 4vw, 2.5rem);
  font-weight: 900; letter-spacing: -.03em; line-height: 1.15; color: #fff;
}
.ent-sub {
  margin: 0 auto 1.35rem; max-width: 38rem;
  font-size: 1.02rem; line-height: 1.55; color: rgba(255,255,255,.94);
}
.ent-actions { display: flex; flex-wrap: wrap; gap: .55rem; justify-content: center; }
.ent-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .7rem 1.2rem; border-radius: 10px; font-weight: 800; font-size: .9rem;
  text-decoration: none !important; border: 2px solid transparent; cursor: pointer;
}
.ent-btn-accent { background: #f5c518; color: #111 !important; border-color: #f5c518; }
.ent-btn-accent:hover { background: #e6b800; }
.ent-btn-solid { background: #083d28; color: #fff !important; border-color: #083d28; }
.ent-btn-outline { background: transparent; color: #fff !important; border-color: #fff; }
.ent-btn-outline:hover { background: rgba(255,255,255,.12); }
.ent-btn-block { width: 100%; }

.ent-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: .55rem;
  max-width: 1100px;
  margin: -1.5rem auto 1.5rem;
  padding: 0 1rem;
  position: relative;
  z-index: 4;
}
.ent-stat {
  background: #fff;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: .7rem .4rem;
  text-align: center;
  box-shadow: 0 6px 18px rgba(15,23,42,.07);
}
.ent-stat-num { font-size: 1.15rem; font-weight: 900; color: #064e3b; }
.ent-stat-label {
  font-size: .65rem; font-weight: 700; color: #64748b;
  text-transform: uppercase; letter-spacing: .04em; margin-top: .15rem;
}

.ent-search-wrap {
  max-width: 920px;
  margin: 0 auto 1.75rem;
  padding: 0 1rem;
}
.ent-search-card {
  background: #fff;
  border: 2px solid #064e3b;
  border-radius: 16px;
  padding: 1.2rem 1.3rem;
  box-shadow: 0 12px 36px rgba(13,110,63,.12);
}
.ent-search-title {
  font-weight: 900; font-size: 1.05rem; color: #0f172a;
  margin-bottom: .85rem; display: flex; align-items: center; gap: .45rem;
}
.ent-search-title i { color: #064e3b; }
.ent-search-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr auto;
  gap: .65rem;
  align-items: end;
}
@media (max-width: 720px) {
  .ent-search-grid { grid-template-columns: 1fr; }
}
.ent-field label {
  display: block; font-size: .7rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .04em; color: #64748b; margin-bottom: .3rem;
}
.ent-input {
  width: 100%;
  border: 2px solid #cbd5e1;
  border-radius: 10px;
  padding: .65rem .75rem;
  font-size: .95rem;
  background: #fff;
  color: #0f172a;
}
.ent-input:focus { border-color: #064e3b; outline: none; }

.ent-two-col {
  max-width: 1100px;
  margin: 0 auto 2rem;
  padding: 0 1rem;
}
.ent-tickers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .85rem;
  margin-bottom: 1.5rem;
}
@media (max-width: 700px) {
  .ent-tickers { grid-template-columns: 1fr; }
}
.ent-ticker {
  background: var(--tick-bg, #064e3b);
  color: #fff;
  border-radius: 14px;
  border: 2px solid rgba(0,0,0,.08);
  overflow: hidden;
  min-height: 200px;
  display: flex;
  flex-direction: column;
}
.ent-ticker header {
  display: flex; justify-content: space-between; align-items: center;
  padding: .75rem 1rem; border-bottom: 1px solid rgba(255,255,255,.15);
}
.ent-ticker header h2 { margin: 0; font-size: .95rem; font-weight: 900; }
.ent-pill {
  background: rgba(0,0,0,.25); color: #fff; font-size: .7rem; font-weight: 800;
  padding: .2rem .55rem; border-radius: 999px; text-decoration: none !important;
}
.ent-ticker-body { padding: .65rem 1rem 1rem; flex: 1; overflow: auto; }
.ent-ticker-body ul { list-style: none; margin: 0; padding: 0; }
.ent-ticker-body li { border-bottom: 1px solid rgba(255,255,255,.12); }
.ent-ticker-body a {
  display: block; padding: .45rem 0; color: #fff !important;
  font-size: .85rem; font-weight: 600; text-decoration: none !important;
}
.ent-ticker-body a:hover { text-decoration: underline !important; }
.ent-muted { color: rgba(255,255,255,.75); font-size: .85rem; margin: 0; }

.ent-section-head { margin-bottom: 1rem; }
.ent-section-head h2 {
  margin: 0; font-size: 1.35rem; font-weight: 900; color: #0f172a; letter-spacing: -.02em;
}
.ent-section-head p { margin: .35rem 0 0; color: #64748b; }

.ent-module-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: .85rem !important;
}
@media (max-width: 900px) {
  .ent-module-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}
@media (max-width: 560px) {
  .ent-module-grid { grid-template-columns: 1fr !important; }
}
.ent-module {
  display: flex; flex-direction: column; gap: .4rem;
  background: #fff;
  border: 2px solid #e2e8f0;
  border-top: 4px solid #064e3b;
  border-radius: 14px;
  padding: 1.1rem 1.15rem;
  text-decoration: none !important;
  color: #0f172a;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.ent-module:hover {
  border-color: #064e3b;
  box-shadow: 0 10px 28px rgba(13,110,63,.12);
  transform: translateY(-2px);
}
.ent-module-ico {
  width: 2.4rem; height: 2.4rem; border-radius: 10px;
  background: #064e3b; color: #fff;
  display: grid; place-items: center; font-size: 1.05rem;
}
.ent-module.tone-blue .ent-module-ico { background: #1e3a5f; }
.ent-module.tone-amber .ent-module-ico { background: #b45309; }
.ent-module.tone-cyan .ent-module-ico { background: #0e7490; }
.ent-module.tone-rose .ent-module-ico { background: #be123c; }
.ent-module.tone-purple .ent-module-ico { background: #6d28d9; }
.ent-module strong { font-size: 1rem; font-weight: 900; }
.ent-module > span:last-child { font-size: .85rem; color: #64748b; line-height: 1.4; }

.ent-cta {
  background: #1e3a5f;
  color: #fff;
  padding: 2.5rem 1.25rem;
  text-align: center;
  margin-top: 1rem;
}
.ent-cta-inner { max-width: 560px; margin: 0 auto; }
.ent-cta h2 { margin: 0 0 .5rem; font-weight: 900; font-size: 1.5rem; color: #fff; }
.ent-cta p { margin: 0 0 1.1rem; color: rgba(255,255,255,.9); }

/* Mobile nav accordion for dropdown menus */
@media (max-width: 900px) {
  .nav-links.open {
    display: flex !important;
    flex-direction: column;
    gap: 0;
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: .5rem;
    margin-top: .5rem;
    max-height: 70vh;
    overflow: auto;
    width: 100%;
  }
  .nav-links .nav-item.has-dropdown {
    display: block;
    width: 100%;
    border-bottom: 1px solid #f1f5f9;
  }
  .nav-links .nav-item.has-dropdown > .nav-parent {
    display: flex;
    width: 100%;
    justify-content: space-between;
    padding: .65rem .75rem;
    font-weight: 700;
  }
  .nav-links .nav-dropdown {
    display: none !important;
    position: static !important;
    box-shadow: none !important;
    border: none !important;
    background: #f8fafc !important;
    padding: 0 0 .35rem .5rem !important;
    min-width: 0 !important;
  }
  .nav-links .nav-item.has-dropdown.open > .nav-dropdown,
  .nav-links .nav-item.has-dropdown.mobile-open > .nav-dropdown {
    display: block !important;
  }
  .nav-links .nav-dropdown a {
    display: block;
    padding: .5rem .75rem;
    font-weight: 600;
  }
  .nav-links .user-menu-dropdown .user-menu-panel {
    position: static !important;
    display: none;
  }
  .nav-links .user-menu-dropdown.open .user-menu-panel,
  .nav-links .user-menu-dropdown.mobile-open .user-menu-panel {
    display: block !important;
  }
}

/* Downloads folder browser */
.downloads-page .folder-list { display: flex; flex-direction: column; gap: .35rem; }
.downloads-page .folder-row {
  display: flex; align-items: center; gap: .55rem;
  padding: .55rem .7rem;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  text-decoration: none !important;
  color: #0f172a;
  font-weight: 600;
}
.downloads-page .folder-row:hover,
.downloads-page .folder-row.is-active {
  border-color: #064e3b;
  background: #f0fdf4;
}
.downloads-page .folder-row.is-active { font-weight: 800; }
.downloads-page .folder-icon {
  width: 1.75rem; height: 1.75rem; border-radius: 8px;
  background: #064e3b; color: #fff;
  display: grid; place-items: center; font-size: .85rem; flex-shrink: 0;
}
.downloads-page .dl-layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) 1fr;
  gap: 1rem;
  align-items: start;
}
@media (max-width: 800px) {
  .downloads-page .dl-layout { grid-template-columns: 1fr; }
}
.downloads-page .dl-side {
  background: #fff;
  border: 2px solid #e2e8f0;
  border-radius: 14px;
  padding: .85rem;
}
.downloads-page .dl-side h3 {
  margin: 0 0 .65rem;
  font-size: .8rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #64748b;
}
.downloads-page .dl-main {
  background: #fff;
  border: 2px solid #e2e8f0;
  border-radius: 14px;
  padding: 1rem;
}
.downloads-page .fallback-banner {
  background: #fffbeb;
  border: 2px solid #fde68a;
  color: #78350f;
  border-radius: 10px;
  padding: .65rem .85rem;
  font-size: .85rem;
  font-weight: 600;
  margin-bottom: .85rem;
}





/* 2.91.51 — account links: never show in desktop navbar strip */
.nav-mobile-account {
  display: none !important;
}
@media (max-width: 900px) {
  .nav-links.open .nav-mobile-account {
    display: flex !important;
    flex-direction: column;
    gap: 0.1rem;
    width: 100%;
    padding: 0.5rem 0 0.35rem;
    margin-top: 0.35rem;
    border-top: 1px solid var(--border, #e2e8f0);
  }
  .nav-links.open .nav-mobile-account .nav-mobile-label {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    padding: 0.35rem 0.75rem 0.15rem;
  }
  .nav-links.open .nav-mobile-account a {
    display: block;
    padding: 0.55rem 0.75rem;
    font-weight: 700;
    color: var(--text, #0f172a);
    text-decoration: none;
  }
  .nav-links.open .nav-mobile-account a:hover { color: #064e3b; }
  .nav-links.open .nav-mobile-account a.text-danger { color: #c0392b !important; }

  /* User dropdown in nav-auth: full list when opened on mobile */
  .nav-auth .user-menu-panel {
    position: absolute;
    right: 0;
    z-index: 50;
  }
}

/* RSS / ticker cards autofit — no empty hanging space */
.ent-ticker {
  min-height: 0 !important;
  height: auto !important;
}
.ent-ticker-body {
  flex: 0 1 auto !important;
}
.ent-tickers {
  align-items: start !important;
}
.home-ticker-card,
.home-ticker-viewport {
  min-height: 0 !important;
}
.home-ticker-viewport {
  max-height: none !important;
  height: auto !important;
}

/* ULTRA hide nav-mobile-account desktop */
@media (min-width: 901px) {
  .navbar .nav-mobile-account,
  .nav-links .nav-mobile-account,
  div.nav-mobile-account { display: none !important; height: 0 !important; overflow: hidden !important; margin: 0 !important; padding: 0 !important; border: 0 !important; }
}


/* ksd-menu overflow fix */
.table-responsive:has(.ksd-menu-open),
.card-body:has(.ksd-menu-open),
.card:has(.ksd-menu-open),
.content-wrapper:has(.ksd-menu-open) {
  overflow: visible !important;
}
.ksd-menu-panel {
  max-height: min(70vh, 28rem);
  overflow-y: auto;
}


/* 2.91.66 mobile nav fix */
@media (max-width: 900px) {
  .nav-toggle, .ksd-hamburger {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    min-height: 2.5rem;
    z-index: 60;
  }
  .nav-links {
    display: none !important;
  }
  .nav-links.open {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    order: 5;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: .5rem;
    max-height: min(75vh, 32rem);
    overflow: auto;
    box-shadow: 0 12px 28px rgba(15,23,42,.12);
  }
  .nav-mobile-account {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    padding: .65rem .5rem;
    margin-top: .35rem;
    border-top: 1px solid #e2e8f0;
  }
  .nav-mobile-account .nav-mobile-label {
    font-size: .7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #64748b;
    margin-bottom: .25rem;
  }
  .nav-mobile-account a {
    display: block;
    padding: .55rem .65rem;
    font-weight: 700;
    color: #0f172a;
    text-decoration: none;
    border-radius: 8px;
  }
  .nav-mobile-account a:hover { background: #f1f5f9; }
  .nav-auth .user-menu-panel {
    z-index: 7000 !important;
    max-height: min(70vh, 24rem);
    overflow-y: auto;
  }
}
.user-menu-panel {
  z-index: 7000 !important;
  min-width: 12.5rem;
}
.user-menu-panel .nav-sublink {
  display: block;
  padding: .45rem .75rem;
  white-space: nowrap;
}
