/* Gym Management System v0.4.5 - Modern Admin Theme */

:root {
  --font-family: "Inter", "Segoe UI", Roboto, system-ui, -apple-system,
    sans-serif;
  --body-bg: #f4f6fb;
  --body-gradient: radial-gradient(
      circle at top left,
      rgba(37, 99, 235, 0.08),
      transparent 35%
    ),
    radial-gradient(circle at 80% 0%, rgba(16, 185, 129, 0.08), transparent 40%),
    #f4f6fb;
  --content-bg: #ffffff;
  --card-bg: #ffffff;
  --card-border: #eaedf5;
  --text-color: #0f172a;
  --muted-color: #6b7280;
  --border-color: #e2e8f0;
  --shadow-lg: 0 30px 60px rgba(15, 23, 42, 0.12);
  --shadow-sm: 0 12px 30px rgba(15, 23, 42, 0.08);
  --primary-color: #2563eb;
  --primary-soft: rgba(37, 99, 235, 0.18);
  --success-color: #16a34a;
  --success-soft: rgba(22, 163, 74, 0.18);
  --warning-color: #f59e0b;
  --warning-soft: rgba(245, 158, 11, 0.2);
  --danger-color: #dc2626;
  --danger-soft: rgba(220, 38, 38, 0.2);
  --info-color: #0ea5e9;
  --sidebar-bg: #0f172a;
  --sidebar-hover: rgba(255, 255, 255, 0.08);
  --sidebar-text: #cbd5ff;
  --sidebar-active: rgba(37, 99, 235, 0.22);
  --sidebar-border: rgba(255, 255, 255, 0.08);
  --scrollbar-track: #cbd5f5;
  --scrollbar-thumb: #94a3b8;
}

body[data-theme="dark"] {
  --body-bg: #030712;
  --body-gradient: radial-gradient(
      circle at top left,
      rgba(37, 99, 235, 0.2),
      transparent 45%
    ),
    radial-gradient(circle at 80% 0%, rgba(45, 212, 191, 0.18), transparent 40%),
    #030712;
  --content-bg: #050b18;
  --card-bg: #091226;
  --card-border: rgba(255, 255, 255, 0.08);
  --text-color: #f1f5f9;
  --muted-color: #94a3b8;
  --border-color: rgba(148, 163, 184, 0.18);
  --shadow-lg: 0 40px 80px rgba(2, 6, 23, 0.85);
  --shadow-sm: 0 20px 45px rgba(2, 6, 23, 0.6);
  --sidebar-bg: rgba(2, 6, 23, 0.95);
  --sidebar-hover: rgba(148, 163, 184, 0.15);
  --sidebar-text: #c7d2fe;
  --sidebar-active: rgba(79, 70, 229, 0.45);
  --sidebar-border: rgba(148, 163, 184, 0.2);
  --scrollbar-track: #0f172a;
  --scrollbar-thumb: #475569;

  /* Bootstrap token overrides for dark mode to keep text readable */
  --bs-body-bg: var(--body-bg);
  --bs-body-bg-rgb: 3, 7, 18;
  --bs-body-color: var(--text-color);
  --bs-body-color-rgb: 241, 245, 249;
  --bs-heading-color: var(--text-color);
  --bs-secondary-color: var(--muted-color);
  --bs-tertiary-color: rgba(148, 163, 184, 0.75);
  --bs-border-color: var(--border-color);
  --bs-border-color-translucent: rgba(148, 163, 184, 0.35);
  --bs-link-color: #9cc4ff;
  --bs-link-hover-color: #c0dcff;
  --bs-table-color: var(--text-color);
  --bs-table-bg: var(--card-bg);
  --bs-table-border-color: var(--border-color);
  --bs-table-striped-bg: rgba(255, 255, 255, 0.03);
  --bs-table-hover-bg: rgba(255, 255, 255, 0.06);
  --bs-card-bg: var(--card-bg);
  --bs-card-color: var(--text-color);
  --bs-list-group-bg: var(--card-bg);
  --bs-list-group-color: var(--text-color);
  --bs-secondary-bg: #0b1223;
  --bs-tertiary-bg: #0c1527;
  --bs-input-bg: #0c162a;
  --bs-input-color: var(--text-color);
  --bs-input-placeholder-color: var(--muted-color);
}

body[data-theme="dark"] .card,
body[data-theme="dark"] .chart-card,
body[data-theme="dark"] .filters-panel,
body[data-theme="dark"] .modal-content,
body[data-theme="dark"] .app-topbar,
body[data-theme="dark"] .app-footer,
body[data-theme="dark"] .list-group-item {
  background: var(--card-bg);
  border-color: var(--card-border);
  box-shadow: var(--shadow-sm);
  color: var(--text-color);
}

body[data-theme="dark"] .bg-white,
body[data-theme="dark"] .bg-light,
body[data-theme="dark"] .table .table-light,
body[data-theme="dark"] .table .bg-white {
  background-color: rgba(15, 23, 42, 0.85) !important;
  color: var(--text-color) !important;
}

body[data-theme="dark"] .btn-light {
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.2);
  color: var(--text-color);
}

body[data-theme="dark"] .btn-outline-secondary,
body[data-theme="dark"] .btn-outline-light {
  color: var(--text-color);
  border-color: rgba(148, 163, 184, 0.4);
}

body[data-theme="dark"] .btn-outline-secondary:hover,
body[data-theme="dark"] .btn-outline-light:hover {
  background: rgba(148, 163, 184, 0.2);
  color: var(--text-color);
}

body[data-theme="dark"] .badge.bg-light {
  background: rgba(148, 163, 184, 0.25) !important;
  color: var(--text-color);
}

/* Normalize text colors in dark mode so "dark" utilities stay readable */
body[data-theme="dark"] .text-dark,
body[data-theme="dark"] .text-body,
body[data-theme="dark"] .text-black,
body[data-theme="dark"] .text-reset,
body[data-theme="dark"] .link-dark {
  color: var(--text-color) !important;
}

body[data-theme="dark"] .text-muted,
body[data-theme="dark"] .text-secondary,
body[data-theme="dark"] .text-body-secondary,
body[data-theme="dark"] .text-body-tertiary {
  color: var(--muted-color) !important;
}

body[data-theme="dark"] .table {
  color: var(--text-color);
}

body[data-theme="dark"] .list-group-item,
body[data-theme="dark"] .badge.text-dark {
  color: var(--text-color);
}

body[data-theme="dark"] a,
body[data-theme="dark"] .nav-link,
body[data-theme="dark"] .dropdown-item {
  color: var(--bs-link-color);
}

body[data-theme="dark"] a:hover,
body[data-theme="dark"] .nav-link:hover,
body[data-theme="dark"] .dropdown-item:hover {
  color: var(--bs-link-hover-color);
}

body[data-theme="dark"] .dropdown-menu {
  background: var(--card-bg);
  color: var(--text-color);
  border-color: var(--border-color);
}

.language-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 2px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: var(--content-bg);
}

.language-toggle-btn {
  border: none;
  background: transparent;
  color: var(--muted-color);
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.language-toggle-btn.is-active {
  background: var(--primary-color);
  color: #fff;
}

.language-toggle--inline {
  margin-left: 0.5rem;
}

.language-toggle--menu {
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
  border: none;
  box-shadow: none;
  background: transparent;
}

.language-toggle--menu .language-toggle-btn {
  width: 100%;
  justify-content: center;
  background: rgba(15, 23, 42, 0.04);
}

.language-toggle--menu .language-toggle-btn.is-active {
  background: var(--primary-color);
  color: #fff;
}

.language-toggle--ghost {
  border-color: transparent;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.15);
}

.language-toggle--ghost .language-toggle-btn {
  color: #0f172a;
}

.language-toggle--ghost .language-toggle-btn.is-active {
  background: #0f172a;
  color: #fff;
}

.language-toggle--ghost-inverted {
  border-color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.15);
}

.language-toggle--ghost-inverted .language-toggle-btn {
  color: #fff;
}

.language-toggle--ghost-inverted .language-toggle-btn.is-active {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

body[data-theme="dark"] .language-toggle {
  background: rgba(9, 18, 38, 0.85);
  border-color: rgba(148, 163, 184, 0.35);
}

body[data-theme="dark"] .language-toggle-btn {
  color: var(--text-color);
}

body[data-theme="dark"] .language-toggle-btn.is-active {
  background: rgba(37, 99, 235, 0.85);
}

body[data-theme="dark"] .language-toggle--menu .language-toggle-btn {
  background: rgba(148, 163, 184, 0.1);
}

body[data-theme="dark"] .language-toggle--menu .language-toggle-btn.is-active {
  background: rgba(59, 130, 246, 0.8);
}

body[data-theme="dark"] .table-hover tbody tr:hover,
body[data-theme="dark"] .list-group-item-action:hover {
  background: rgba(148, 163, 184, 0.12);
}

body[data-theme="dark"] .modal-header,
body[data-theme="dark"] .modal-footer,
body[data-theme="dark"] .table thead,
body[data-theme="dark"] .table tfoot {
  border-color: var(--border-color);
}

body {
  font-family: var(--font-family);
  background: var(--body-gradient);
  color: var(--text-color);
  margin: 0;
  min-height: 100vh;
  transition: background 0.3s ease, color 0.3s ease;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.08),
    transparent 40%
  );
  pointer-events: none;
  z-index: 0;
}

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

a:hover {
  color: #1745c7;
}

.text-muted,
.text-body-secondary {
  color: var(--muted-color) !important;
}

.app-shell {
  display: flex;
  min-height: 100vh;
  position: relative;
}

.app-sidebar {
  width: 270px;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  padding: 2rem 1.75rem;
  position: sticky;
  top: 0;
  height: 100vh;
  box-sizing: border-box;
  overflow-y: auto;
  box-shadow: var(--shadow-sm);
  z-index: 1030;
  backdrop-filter: blur(16px);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  border-bottom: 1px solid var(--sidebar-border);
  padding-bottom: 1.25rem;
}

.sidebar-logo {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.bg-success-soft {
  background: var(--success-soft) !important;
}

.sidebar-menu {
  flex: 1;
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sidebar-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 0.5rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.65rem 0.75rem;
  border-radius: 0.85rem;
  color: var(--sidebar-text);
  font-weight: 500;
  position: relative;
  transition: background 0.2s ease, color 0.2s ease;
}

.sidebar-link i {
  font-size: 1.1rem;
}

.sidebar-link-meta {
  margin-left: auto;
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: var(--sidebar-text);
}

.sidebar-link:hover {
  background: var(--sidebar-hover);
  color: #ffffff;
}

.sidebar-link.is-active {
  background: var(--sidebar-active);
  color: #ffffff;
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.25);
}

.sidebar-footer {
  padding-top: 1.25rem;
  border-top: 1px solid var(--sidebar-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.status-pill {
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  color: #fff;
}

.app-workspace {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: transparent;
}

.app-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2.5rem;
  background: linear-gradient(
    120deg,
    rgba(255, 255, 255, 0.9),
    rgba(255, 255, 255, 0.75)
  );
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1020;
  backdrop-filter: blur(20px);
}

body[data-theme="dark"] .app-topbar {
  background: linear-gradient(
    120deg,
    rgba(9, 18, 38, 0.9),
    rgba(5, 11, 23, 0.85)
  );
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  position: relative;
  z-index: 1050;
}

.topbar-kicker {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--muted-color);
}

.topbar-title {
  font-size: 1.5rem;
  font-weight: 700;
}

.topbar-breadcrumb {
  font-size: 0.85rem;
  color: var(--muted-color);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.topbar-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  padding: 0.4rem 1rem;
  min-width: 280px;
  background: var(--content-bg);
  box-shadow: inset 0 1px 1px rgba(15, 23, 42, 0.04);
}

body[data-theme="dark"] .topbar-search {
  background: rgba(9, 18, 38, 0.75);
  border-color: rgba(148, 163, 184, 0.2);
}

.topbar-search input {
  border: none;
  outline: none;
  width: 100%;
  background: transparent;
  color: var(--text-color);
}

.btn-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.avatar-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary-color);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  position: absolute;
  top: 6px;
  right: 6px;
  border: 2px solid var(--content-bg);
}

body[data-theme="dark"] .status-dot {
  border-color: rgba(5, 11, 24, 0.95);
}

.app-content {
  flex: 1;
  padding: 2.5rem;
  background: transparent;
  position: relative;
  z-index: 1;
}

.guest-content {
  min-height: 100vh;
}

.app-alert {
  max-width: 1200px;
  margin: 0 auto 1rem;
}

.card {
  border: 1px solid var(--card-border);
  border-radius: 18px;
  background: var(--card-bg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
  backdrop-filter: blur(8px);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.card-header {
  border-bottom: 1px solid var(--border-color);
  background: transparent;
  padding: 1.25rem;
}

.card-body {
  padding: 1.5rem;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.member-hero {
  border-radius: 28px;
  padding: 2rem;
  background: linear-gradient(
    120deg,
    rgba(37, 99, 235, 0.95),
    rgba(13, 148, 136, 0.9)
  );
  color: #fff;
  position: relative;
  overflow: hidden;
}

body[data-theme="dark"] .member-hero {
  background: linear-gradient(
    120deg,
    rgba(37, 99, 235, 0.85),
    rgba(6, 182, 212, 0.8)
  );
}

.member-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at top right,
    rgba(255, 255, 255, 0.25),
    transparent 50%
  );
  opacity: 0.6;
  pointer-events: none;
}

.member-hero > * {
  position: relative;
}

.member-hero .hero-avatar {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 600;
}

.member-hero .hero-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.member-hero .badge {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.member-hero .btn,
.member-hero .btn:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.5);
}

.member-hero .btn-primary,
.member-hero .btn-success {
  background: rgba(255, 255, 255, 0.2);
  border: none;
}

.member-hero-metrics {
  margin-top: 1.5rem;
}

.hero-metric {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  padding: 1rem;
  color: #fff;
}

.hero-metric h4 {
  margin-bottom: 0.2rem;
  font-weight: 700;
}

.surface-card {
  border-radius: 20px;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  box-shadow: var(--shadow-sm);
}

.surface-card .card-header {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.75rem;
}

.detail-list dt {
  font-size: 0.85rem;
  color: var(--muted-color);
  margin-bottom: 0.25rem;
}

.detail-list dd {
  font-weight: 600;
  margin-bottom: 1rem;
}

.data-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.data-list li {
  display: flex;
  justify-content: space-between;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border-color);
}

.data-list li:last-child {
  border-bottom: none;
}

.member-financial-summary {
  border-radius: 18px;
  background: linear-gradient(
    135deg,
    rgba(15, 23, 42, 0.95),
    rgba(30, 64, 175, 0.95)
  );
  color: #fff;
}

.member-financial-summary .progress {
  background: rgba(255, 255, 255, 0.25);
}

.member-financial-summary .progress-bar {
  background: #38bdf8;
}

.kpi-card {
  padding: 1.5rem;
  border-radius: 18px;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  box-shadow: var(--shadow-sm);
}

.kpi-card .kpi-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--primary-soft);
  color: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.kpi-card.success .kpi-icon {
  background: var(--success-soft);
  color: var(--success-color);
}

.kpi-card.warning .kpi-icon {
  background: var(--warning-soft);
  color: var(--warning-color);
}

.kpi-card.danger .kpi-icon {
  background: var(--danger-soft);
  color: var(--danger-color);
}

.kpi-label {
  font-size: 0.85rem;
  text-transform: uppercase;
  color: var(--muted-color);
  letter-spacing: 0.08em;
  margin-bottom: 0.35rem;
}

.kpi-value {
  font-size: 2rem;
  font-weight: 700;
}

.kpi-trend {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9rem;
}

.metric-small {
  font-size: 0.85rem;
  color: var(--muted-color);
}

.chart-card {
  padding: 1.5rem;
  border-radius: 18px;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  box-shadow: var(--shadow-sm);
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--muted-color);
}

.table-modern table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.table-modern thead th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted-color);
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem;
}

.table-modern tbody td {
  padding: 1rem 0.75rem;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.table-modern tbody tr:hover {
  background: rgba(37, 99, 235, 0.03);
}

.data-table-actions {
  display: flex;
  gap: 0.35rem;
}

.status-badge {
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
}

.status-badge.paid {
  background: var(--success-soft);
  color: var(--success-color);
}
.status-badge.pending {
  background: var(--primary-soft);
  color: var(--primary-color);
}
.status-badge.late {
  background: var(--danger-soft);
  color: var(--danger-color);
}
.status-badge.partial {
  background: var(--warning-soft);
  color: var(--warning-color);
}

.filters-panel {
  border-radius: 18px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 2rem;
}

.filters-panel__mobile-header {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.25rem;
}

.filters-panel__body {
  width: 100%;
}

.filters-panel__desktop-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.25rem;
}

.filters-panel .form-label {
  font-weight: 600;
  color: var(--muted-color);
}

.badge-pill {
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  font-size: 0.85rem;
}

.app-footer {
  margin-top: 2.5rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--muted-color);
}

body[data-theme="dark"] .app-footer {
  background: rgba(9, 18, 38, 0.85);
  border-top-color: rgba(148, 163, 184, 0.2);
  color: var(--muted-color);
}

/* Form & table refinements */
.form-control,
.form-select,
textarea,
input,
select {
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.9);
  color: var(--text-color);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

body[data-theme="dark"] .form-control,
body[data-theme="dark"] .form-select,
body[data-theme="dark"] textarea,
body[data-theme="dark"] input,
body[data-theme="dark"] select {
  background: rgba(15, 23, 42, 0.85);
  color: var(--text-color);
}

.form-control:focus,
.form-select:focus,
textarea:focus,
input:focus,
select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.2);
}

.table {
  background: transparent;
  color: var(--text-color);
}

.table thead th {
  color: var(--muted-color);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

body[data-theme="dark"] .table thead th {
  color: #e2e8f0;
  background: rgba(15, 23, 42, 0.85);
}

.table tbody tr {
  border-bottom: 1px solid var(--border-color);
}

body[data-theme="dark"] .table tbody tr {
  border-color: rgba(148, 163, 184, 0.2);
}

.table-hover tbody tr:hover {
  background: rgba(37, 99, 235, 0.05);
}

body[data-theme="dark"] .table-hover tbody tr:hover {
  background: rgba(59, 130, 246, 0.15);
}

.badge {
  border-radius: 999px;
  font-weight: 600;
  padding: 0.4rem 0.9rem;
}

body[data-theme="dark"] .badge.bg-primary-subtle {
  background: rgba(96, 165, 250, 0.25) !important;
  color: #bfdbfe !important;
}

body[data-theme="dark"] .badge.bg-secondary,
body[data-theme="dark"] .badge.bg-secondary-subtle {
  background: rgba(148, 163, 184, 0.35) !important;
  color: var(--text-color) !important;
}

body[data-theme="dark"] .badge.bg-info {
  background: rgba(14, 165, 233, 0.22) !important;
  color: #bae6fd !important;
}

body[data-theme="dark"] .badge.bg-success {
  background: rgba(34, 197, 94, 0.22) !important;
  color: #bbf7d0 !important;
}

body[data-theme="dark"] .badge.bg-danger,
body[data-theme="dark"] .badge.bg-danger-subtle {
  background: rgba(248, 113, 113, 0.25) !important;
  color: #fecaca !important;
}

body[data-theme="dark"] .badge.bg-warning {
  background: rgba(245, 158, 11, 0.25) !important;
  color: #fde68a !important;
}

.alert {
  border: none;
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
}

body[data-theme="dark"] .alert {
  background: rgba(15, 23, 42, 0.75);
  color: var(--text-color);
}

body[data-theme="dark"] .alert.alert-info {
  background: rgba(14, 165, 233, 0.18);
  color: #e0f2fe;
}

body[data-theme="dark"] .alert.alert-warning {
  background: rgba(245, 158, 11, 0.22);
  color: #fde68a;
}

body[data-theme="dark"] .alert.alert-success {
  background: rgba(34, 197, 94, 0.18);
  color: #bbf7d0;
}

body[data-theme="dark"] .alert.alert-danger {
  background: rgba(248, 113, 113, 0.25);
  color: #fecaca;
}

.modal-content {
  border-radius: 20px;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  box-shadow: var(--shadow-lg);
}

.btn {
  border-radius: 12px;
  font-weight: 600;
  padding: 0.45rem 1.25rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: linear-gradient(120deg, #2563eb, #1d4ed8);
  border: none;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(120deg, #1d4ed8, #1e40af);
}

.btn-outline-primary {
  border-color: rgba(37, 99, 235, 0.4);
  color: var(--primary-color);
}

body[data-theme="dark"] .btn-outline-primary {
  color: #93c5fd;
  border-color: rgba(147, 197, 253, 0.4);
}

.btn-outline-primary:hover {
  background: var(--primary-color);
  color: #fff;
}

.btn-light {
  background: linear-gradient(
    135deg,
    rgba(248, 250, 252, 0.95),
    rgba(248, 250, 252, 0.75)
  );
  border: 1px solid rgba(148, 163, 184, 0.3);
}

body[data-theme="dark"] .btn-light {
  background: rgba(148, 163, 184, 0.2);
  color: var(--text-color);
}

/* Timeline / list refinements */
.list-group-item {
  background: transparent;
  border-color: var(--border-color);
}

.list-group-item-action:hover {
  background: rgba(37, 99, 235, 0.05);
}

body[data-theme="dark"] .list-group-item-action:hover {
  background: rgba(59, 130, 246, 0.18);
}

/* Calendar styles preserved */
.calendar-day {
  min-height: 120px;
  border: 1px solid var(--border-color);
  padding: 0.75rem;
  background: var(--card-bg);
  border-radius: 12px;
}

.calendar-day.other-month {
  opacity: 0.5;
}

.calendar-class {
  font-size: 0.8rem;
  padding: 0.3rem 0.5rem;
  border-radius: 8px;
  margin-bottom: 0.35rem;
  display: inline-block;
  background: var(--primary-soft);
  color: var(--primary-color);
}

/* Guest / auth screens */
.guest-content {
  background: var(--body-bg);
  padding: 2rem 1rem;
}

.guest-language-switcher {
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
  z-index: 1050;
}

.modal-content {
  border-radius: 18px;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  color: var(--text-color);
}

.modal-header {
  border-bottom: 1px solid var(--border-color);
}

/* Keep action modals above fixed elements (calendars, banners) */
.modal {
  z-index: 2050 !important;
  pointer-events: auto !important;
}

.modal-backdrop {
  z-index: 2040 !important;
}

.modal-dialog,
.modal-content,
.modal-header,
.modal-body,
.modal-footer {
  pointer-events: auto !important;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}

::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

/* Responsive adjustments */
@media (max-width: 1199px) {
  .app-content {
    padding: 2rem;
  }
}

@media (max-width: 991px) {
  .app-shell {
    flex-direction: column;
  }

  .app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    width: 260px;
    z-index: 1050;
  }

  body.sidebar-open .app-sidebar {
    transform: translateX(0);
  }

  body.sidebar-open {
    overflow: hidden;
  }

  body.sidebar-open::after {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.55);
    z-index: 1040;
    pointer-events: auto;
  }

  .app-topbar {
    padding: 1.25rem;
    position: static;
  }

  .topbar-search {
    display: none;
  }

  .app-content {
    padding: 1.5rem 1rem 2rem;
  }

  .topbar-title {
    font-size: 1.25rem;
  }
}

@media (max-width: 767.98px) {
  .filters-panel {
    padding: 1.25rem;
  }

  .filters-panel__mobile-header {
    display: flex;
  }

  .filters-panel__body {
    border-top: 1px solid var(--border-color);
    padding-top: 0.75rem;
    margin-top: 0.25rem;
  }

  .filters-panel form .row > [class*="col-"] {
    width: 100%;
  }
}

@media (max-width: 576px) {
  .app-footer {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }

  .kpi-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }

  /* Better mobile layout for topbar */
  .app-topbar {
    padding: 0.75rem 1rem;
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .topbar-left {
    flex: 1;
    min-width: 0;
    width: 100%;
  }

  .topbar-left h1 {
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .topbar-title {
    font-size: 1rem !important;
  }

  .topbar-kicker {
    font-size: 0.7rem;
  }

  .topbar-breadcrumb {
    font-size: 0.75rem;
  }

  .topbar-actions {
    gap: 0.5rem;
    flex-shrink: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
    width: 100%;
  }

  /* Compact button styling for mobile */
  .topbar-actions .btn-icon {
    width: 32px;
    height: 32px;
    font-size: 0.9rem;
  }

  .topbar-actions .avatar-circle {
    width: 32px;
    height: 32px;
    font-size: 0.9rem;
  }

  .topbar-user-btn {
    padding: 0.35rem !important;
    min-width: auto !important;
  }

  .topbar-user-btn .dropdown-toggle::after {
    display: none;
  }

  /* Make language toggle more compact on mobile */
  .language-toggle-btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
  }

  .language-toggle--inline {
    margin-left: 0;
  }

  /* Ensure buttons don't wrap awkwardly */
  .btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
  }
}

.progress {
  border-radius: 999px;
  background: var(--border-color);
  height: 8px;
}

.progress-bar {
  border-radius: 999px;
  background: var(--primary-color);
}

.spinner-border-sm {
  width: 1rem;
  height: 1rem;
  border-width: 0.2rem;
}

.trainer-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.8rem;
  color: #fff;
}

.text-white-50 {
  color: rgba(255, 255, 255, 0.5) !important;
}

.cursor-pointer {
  cursor: pointer;
}

.min-width-100 {
  min-width: 100px;
}

/* Print styles */
@media print {
  .app-sidebar,
  .app-topbar,
  .app-footer,
  .btn,
  .alert,
  .no-print {
    display: none !important;
  }

  .app-content {
    padding: 0;
    background: #fff;
  }
}

.fc-list-table {
  background: black;
}
