/* ImpactGuard Panel UI Polish — loaded last; harmonizes tactical layers */

/* ── Logged-in panel base ── */
#app-view {
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

#app-view .page-content {
  padding: 1rem 1.25rem 1.75rem !important;
}

#app-view .page-header {
  margin-bottom: 1rem !important;
  gap: 0.65rem !important;
}

#app-view .page-subtitle {
  font-size: 0.8125rem !important;
}

/* ── Sidebar (sentence case, compact) ── */
#app-view .sidebar .nav-item {
  text-transform: none !important;
  font-size: 0.875rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.02em !important;
  padding: 0.45rem 0.7rem !important;
  margin-bottom: 0.08rem !important;
}

#app-view .sidebar .nav-section-title {
  font-size: 0.6875rem !important;
  padding: 0.5rem 0.7rem 0.12rem !important;
  letter-spacing: 0.08em !important;
}

#app-view .sidebar-footer {
  padding: 0.65rem 0.7rem !important;
}

/* ── Header ── */
#app-view .main-header {
  height: 52px !important;
  min-height: 52px !important;
}

#app-view #page-title,
#app-view .main-header h1 {
  font-size: 0.9375rem !important;
  letter-spacing: 0.05em !important;
}

/* ── Stat cards ── */
#app-view .stats-grid {
  gap: 0.75rem !important;
  margin-bottom: 1.15rem !important;
}

#app-view .stat-card {
  padding: 0.85rem 0.95rem !important;
  border-radius: var(--radius-md, 4px) !important;
}

#app-view .stat-card .stat-icon {
  width: 32px !important;
  height: 32px !important;
  margin-bottom: 0.45rem !important;
}

#app-view .stat-card .stat-icon svg {
  width: 16px;
  height: 16px;
}

#app-view .stat-value {
  font-size: 1.5rem !important;
  font-weight: 700 !important;
  line-height: 1.1 !important;
}

#app-view .stat-label {
  font-size: 0.6875rem !important;
  letter-spacing: 0.06em !important;
  text-transform: uppercase !important;
  margin-top: 0.12rem !important;
  min-height: auto !important;
  display: block !important;
}

/* ── Cards & grids ── */
#app-view .card {
  border-radius: var(--radius-md, 4px) !important;
}

#app-view .card-header {
  padding: 0.7rem 0.9rem !important;
}

#app-view .card-title {
  font-size: 0.8125rem !important;
  letter-spacing: 0.06em !important;
  text-transform: uppercase !important;
}

#app-view .card-body {
  padding: 0.8rem 0.95rem !important;
}

#app-view .card-body.no-padding {
  padding: 0 !important;
}

#app-view .grid-2 {
  gap: 0.85rem !important;
  margin-bottom: 0.85rem !important;
}

#app-view .grid-2 > .card .card-header {
  padding: 0.6rem 0.8rem !important;
}

#app-view .grid-2 > .card .card-title {
  font-size: 0.75rem !important;
}

#app-view .grid-2 > .card .card-body.card-body--chart,
#app-view .grid-2 > .card .card-body:has(.chart-hbar) {
  padding: 0.7rem 0.85rem 0.8rem !important;
}

/* Dashboard table card — scroll instead of stretching page */
#app-view .grid-2 > .card .card-body.no-padding {
  max-height: 360px;
  overflow: auto;
}

/* ── Tables ── */
#app-view .data-table th,
#app-view .data-table td {
  padding: 0.5rem 0.7rem !important;
  font-size: 0.8125rem !important;
  vertical-align: middle !important;
}

#app-view .data-table th {
  font-size: 0.6875rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.06em !important;
}

#app-view .grid-2 > .card .data-table th,
#app-view .grid-2 > .card .data-table td {
  padding: 0.42rem 0.55rem !important;
  font-size: 0.75rem !important;
}

#app-view .data-table .steam-id-link {
  font-size: 0.68rem !important;
}

#app-view .data-table .steam-id-sub {
  font-size: 0.6rem !important;
}

#app-view .table-empty {
  padding: 1.25rem !important;
  font-size: 0.8125rem !important;
}

/* ── Charts (panel-charts wins) ── */
#app-view .chart-bar-track {
  height: 20px !important;
  min-height: 20px !important;
}

#app-view .chart-bar-label {
  font-size: 0.75rem !important;
  width: auto !important;
  max-width: 8.5rem;
}

#app-view .chart-bar-value {
  font-size: 0.75rem !important;
}

#app-view .chart-bar-item {
  gap: 0.5rem 0.6rem !important;
}

/* ── Forms, filters, buttons ── */
#app-view .form-input,
#app-view .form-select,
#app-view .filter-select,
#app-view .search-input input {
  min-height: 36px !important;
  font-size: 0.875rem !important;
  padding: 0.4rem 0.65rem !important;
}

#app-view .form-label {
  font-size: 0.75rem !important;
  margin-bottom: 0.3rem !important;
}

#app-view .filters-bar {
  gap: 0.5rem !important;
  margin-bottom: 0.85rem !important;
}

#app-view .btn {
  letter-spacing: 0.04em !important;
}

#app-view .btn-sm {
  min-height: 30px;
  padding: 0.3rem 0.6rem;
  font-size: 0.75rem;
}

#app-view .threat-bar {
  width: 44px;
  height: 3px;
}

#app-view .badge {
  font-size: 0.6875rem !important;
  padding: 0.15rem 0.45rem !important;
}

/* ── Pagination & footers ── */
#app-view .pagination,
#app-view .card-footer {
  font-size: 0.75rem;
}

#app-view .top-players-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* ── Modals & toasts spacing ── */
#app-view .modal-header {
  padding: 0.85rem 1rem !important;
}

#app-view .modal-body {
  padding: 0.85rem 1rem !important;
}

/* ── Profile / store pages inside SPA ── */
#app-view .profile-page .card,
#app-view .store-page .card {
  height: auto !important;
}

/* ── Login / register (no empty captcha box) ── */
#login-view .captcha-container {
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  background: transparent !important;
}

#login-view .captcha-container:not(:has(iframe)) {
  display: none !important;
}

#login-view .captcha-container:has(iframe) {
  display: block !important;
  min-height: 0 !important;
  padding: 0.35rem !important;
  margin: 0.5rem 0 0.65rem !important;
  background: rgba(255, 255, 255, 0.02) !important;
  border: 1px dashed rgba(255, 255, 255, 0.1) !important;
  border-radius: 4px !important;
}

#login-view .form-group {
  margin-bottom: 0.8rem !important;
}

#login-view .auth-row {
  margin-bottom: 0.65rem !important;
}

#login-view #login-btn,
#login-view #register-btn {
  padding: 0.72rem 1rem !important;
  font-size: 0.9rem !important;
  margin-top: 0.35rem !important;
}

#login-view .login-card {
  padding: 1.35rem 1.5rem 1.25rem !important;
}

#login-view .login-logo {
  margin-bottom: 1rem !important;
}

#login-view .auth-tabs {
  margin-bottom: 1rem !important;
}

/* ── Mobile ── */
@media (max-width: 900px) {
  #app-view .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  #app-view .grid-2 {
    grid-template-columns: 1fr !important;
  }
  #app-view .grid-2 > .card .card-body.no-padding {
    max-height: 280px;
  }
}

@media (max-width: 520px) {
  #app-view .stats-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Dashboard business metrics */
#app-view .dashboard-metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem 0.85rem;
  width: 100%;
}
#app-view .dashboard-metric-label {
  font-size: 0.6875rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.2rem;
}
#app-view .dashboard-metric-value {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.2;
}
