/* Panel visibility + sidebar contrast + scrollbar (loads absolute last) */

#app-view #page-content,
#app-view .page-content {
  color: var(--text-primary, #f2f2f2) !important;
  min-height: 120px;
}

#app-view .stats-grid,
#app-view .grid-2,
#app-view .stat-card,
#app-view .card {
  visibility: visible !important;
  opacity: 1 !important;
}

#app-view .stat-value {
  color: #fafafa !important;
}

#app-view .stat-label,
#app-view .card-title {
  color: var(--text-secondary, #9a9a9a) !important;
}

/* Sidebar readability */
#app-view .sidebar .nav-section-title {
  color: #8b8b96 !important;
  font-weight: 600 !important;
}

#app-view .sidebar .nav-item {
  color: #d1d1d6 !important;
}

#app-view .sidebar .nav-item:hover {
  color: #fff !important;
}

#app-view .sidebar .nav-item.active {
  color: #ff8a42 !important;
  background: rgba(255, 92, 26, 0.12) !important;
  border-color: rgba(255, 92, 26, 0.35) !important;
}

#app-view .sidebar .ig-tactical-sidebar__sub,
#app-view .sidebar-footer,
#app-view .user-name {
  color: var(--text-secondary, #9a9a9a) !important;
}

/* Viewport scrollbar — full track, not a lone orange stripe */
html {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 92, 26, 0.55) #0a0a0a;
}

html::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

html::-webkit-scrollbar-track {
  background: #0a0a0a;
}

html::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #ff5c1a, #c44714);
  border-radius: 5px;
  border: 2px solid #0a0a0a;
  min-height: 48px;
}

/* Landing trust row — single slash from CSS only */
.hero-trust-row span::before {
  content: '// ';
  color: var(--accent, #ff5c1a);
}

/* Loading / error states always visible on panel */
#app-view .loading-page {
  color: var(--text-secondary) !important;
}

#app-view .error-page-card {
  color: var(--text-primary) !important;
  padding: 2rem;
}

/* === ImpactGuard emergency UI hardening start === */
/* Final panel layout guard. Earlier CSS may redefine these to invalid vars. */
#app-view {
  --ig-panel-sidebar-w: 260px;
  --ig-panel-header-h: 58px;
  --sidebar-width: 260px;
  --header-height: 58px;
}

#app-view .app-layout {
  display: block !important;
  min-height: 100vh !important;
  width: 100% !important;
}

#app-view .sidebar {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  bottom: 0 !important;
  width: 260px !important;
  min-width: 260px !important;
  max-width: 260px !important;
  height: 100vh !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  z-index: 1000 !important;
}

#app-view .main-content {
  margin-left: 260px !important;
  width: calc(100% - 260px) !important;
  max-width: none !important;
  min-height: 100vh !important;
  box-sizing: border-box !important;
}

#app-view .main-header,
#app-view .ig-tactical-header {
  width: 100% !important;
  min-height: 58px !important;
  box-sizing: border-box !important;
}

#app-view .page-content,
#app-view #page-content {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 1rem 1.25rem 1.5rem !important;
  box-sizing: border-box !important;
}

#app-view .stats-grid {
  margin-bottom: 0.9rem !important;
}

#app-view .grid-2 {
  align-items: start !important;
  gap: 0.9rem !important;
}

#app-view .grid-2 > .card {
  height: auto !important;
  min-height: 0 !important;
}

#app-view .table-scroll,
#app-view .card-body.no-padding {
  max-height: min(330px, 48vh) !important;
  overflow: auto !important;
}

@media (max-width: 768px) {
  #app-view .sidebar {
    transform: translateX(-100%);
  }

  #app-view .main-content {
    margin-left: 0 !important;
    width: 100% !important;
  }
}

/* Landing: remove the tall hero/section air and keep decorative slashes single. */
.hero-premium {
  min-height: 0 !important;
  padding-top: clamp(2rem, 5vh, 4rem) !important;
  padding-bottom: 0 !important;
  margin-bottom: 0 !important;
}

.hero-inner.hero-split,
.hero-inner {
  min-height: 0 !important;
  flex: none !important;
  gap: clamp(1.5rem, 3vw, 2.25rem) !important;
  margin-bottom: 1rem !important;
}

.hero-stats {
  margin-top: 0.75rem !important;
  margin-bottom: 0 !important;
}

.ops-brief,
.section,
main > section {
  scroll-margin-top: 80px;
}

.hero-premium + section,
.hero-premium + .section,
.hero-stats + section,
.hero-stats + .section {
  padding-top: 1.5rem !important;
}
/* === ImpactGuard emergency UI hardening end === */

/* === ImpactGuard emergency spacing pass start === */
/* Extra landing compaction for 768px laptop screenshots. */
.hero-premium {
  padding-top: clamp(1.25rem, 3vh, 2.25rem) !important;
}

.hero-inner.hero-split,
.hero-inner {
  margin-bottom: 0.65rem !important;
}

.hero-trust-row {
  margin-top: 0.65rem !important;
}

.hero-stats {
  margin-top: 0.5rem !important;
}

.landing-main .section,
.site-main .section,
main .section {
  padding-top: clamp(1rem, 2.5vw, 2rem) !important;
}
/* === ImpactGuard emergency spacing pass end === */

/* === ImpactGuard no-gap landing override start === */
.hero-premium { padding-top: calc(var(--nav-h) + 0.6rem) !important; padding-bottom: 0 !important; }
.hero-copy { padding-bottom: 0 !important; }
.hero-title { margin-bottom: 0.75rem !important; }
.hero-subtitle { margin-bottom: 0.9rem !important; }
.hero-actions { margin-bottom: 0.55rem !important; }
.hero-trust-row { margin-top: 0 !important; margin-bottom: 0 !important; }
.hero-stats { margin-top: 0.6rem !important; margin-bottom: 0 !important; }
.hero-stat { padding-top: 1rem !important; padding-bottom: 1rem !important; }
.hero-premium + section,
.hero-premium + .section,
.hero-premium + .ops-brief,
.hero-stats + section,
.hero-stats + .section,
.hero-stats + .ops-brief { margin-top: 0 !important; padding-top: 0.65rem !important; }
/* === ImpactGuard no-gap landing override end === */

/* === ImpactGuard navbar gap last override start === */
body.tactical.ig-public-site {
  padding-top: 0 !important;
}

body.tactical.ig-public-site .hero-premium {
  padding-top: calc(var(--nav-h, 72px) + 0.35rem) !important;
}
/* === ImpactGuard navbar gap last override end */

/* === ImpactGuard global public nav offset start === */
/* One navbar clearance per page ? body never padded. */
body.tactical,
body.appeal-tactical,
body.docs-tactical,
body.status-tactical,
body.legal-page,
body.ml-public-tactical {
  padding-top: 0 !important;
}

body.ml-public-tactical .ml-shell {
  padding-top: calc(var(--ig-nav-h, 60px) + 0.75rem) !important;
}

body.appeal-tactical main.appeal-page {
  padding-top: calc(var(--ig-nav-h, 60px) + 0.75rem) !important;
}

body.docs-tactical main,
body.status-tactical main {
  padding-top: calc(var(--ig-nav-h, 60px) + 0.75rem) !important;
}

body.legal-page .legal-main,
body.legal-page main.legal-main {
  padding-top: calc(var(--ig-nav-h, 60px) + 0.75rem) !important;
}

body.tactical.ig-public-site .hero-premium {
  padding-top: calc(var(--ig-nav-h, 60px) + 0.35rem) !important;
}

.nav.ig-tactical-nav {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 1000 !important;
}
/* === ImpactGuard global public nav offset end === */


body.ml-public-tactical .stats-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
}

/* === ImpactGuard license server cell polish start === */
.license-server-cell {
  min-width: 260px;
}

.license-server-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.45rem;
}

.license-server-count {
  color: var(--text-primary, #f2f2f2);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.license-game-pill {
  display: inline-flex;
  align-items: center;
  min-height: 1.25rem;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary, #9a9a9a);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.license-game-pill--cs2 {
  border-color: rgba(255, 92, 26, 0.45);
  background: rgba(255, 92, 26, 0.12);
  color: #ff8a42;
}

.license-game-pill--cs16 {
  border-color: rgba(61, 214, 140, 0.35);
  background: rgba(61, 214, 140, 0.1);
  color: #62e4a7;
}

.license-game-pill--empty {
  border-style: dashed;
  color: var(--text-muted, #6b6b6b);
}

.license-server-list {
  display: grid;
  gap: 0.28rem;
}

.license-server-mini {
  display: grid;
  grid-template-columns: auto auto minmax(120px, 1fr) auto;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.45rem;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.22);
  color: var(--text-secondary, #9a9a9a);
}

.license-server-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 999px;
  background: #6b6b6b;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.04);
}

.license-server-dot.is-online {
  background: #3dd68c;
  box-shadow: 0 0 10px rgba(61, 214, 140, 0.55);
}

.license-server-dot.is-offline {
  background: #ff4d5a;
  box-shadow: 0 0 10px rgba(255, 77, 90, 0.4);
}

.license-server-game {
  color: var(--accent, #ff5c1a);
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.license-server-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-primary, #f2f2f2);
  font-weight: 700;
}

.license-server-endpoint,
.license-server-more {
  color: var(--text-muted, #6b6b6b);
  font-family: var(--font-mono, Consolas, monospace);
  font-size: 0.72rem;
}
/* === ImpactGuard license server cell polish end === */

/* === ImpactGuard server card game badge polish start === */
.server-card-title-block {
  min-width: 0;
}

.server-name-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.server-name-row .server-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.server-game-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 1.25rem;
  padding: 0.08rem 0.42rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary, #9a9a9a);
  font-size: 0.64rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.server-game-badge--cs2 {
  border-color: rgba(255, 92, 26, 0.5);
  background: rgba(255, 92, 26, 0.13);
  color: #ff8a42;
}

.server-game-badge--cs16 {
  border-color: rgba(61, 214, 140, 0.4);
  background: rgba(61, 214, 140, 0.11);
  color: #62e4a7;
}
/* === ImpactGuard server card game badge polish end === */
