/* ========================================
   Library Club Design System v2.0
   Mobile-First | RTL | Professional
   Based on FitClub Design System
   ======================================== */

/* --- CSS Variables --- */
:root {
  --primary: #7c3aed;
  --primary-dark: #6d28d9;
  --primary-light: #f3f0ff;
  --primary-50: rgba(124,58,237,0.05);
  --primary-100: rgba(124,58,237,0.1);
  --primary-200: rgba(124,58,237,0.2);

  --secondary: #6c5ce7;
  --accent: #fd7e14;
  --danger: #dc2626;
  --danger-light: #fef2f2;
  --success: #059669;
  --success-light: #ecfdf5;
  --warning: #d97706;
  --warning-light: #fffbeb;
  --info: #2563eb;
  --info-light: #eff6ff;

  --text: #1e1b2e;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --text-inverse: #ffffff;

  --bg: #f7f7f9;
  --bg-card: #ffffff;
  --bg-sidebar: #ffffff;
  --bg-header: rgba(255,255,255,0.85);
  --bg-input: #f3f4f6;
  --bg-hover: #f3f0ff;

  --border: #e5e7eb;
  --border-light: #f3f4f6;
  --border-focus: var(--primary);

  --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -1px rgba(0,0,0,0.04);
  --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.03);
  --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.08), 0 10px 10px -5px rgba(0,0,0,0.02);
  --shadow-xl: 0 25px 50px -12px rgba(0,0,0,0.12);

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;
  --radius-full: 9999px;

  --sidebar-width: 260px;
  --header-height: 64px;
  --bottom-nav-height: 64px;

  --font: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --transition: all 0.2s ease;
  --transition-slow: all 0.3s ease;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  direction: rtl;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

img { max-width: 100%; height: auto; display: block; }

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
}

.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.text-4xl { font-size: 2.25rem; }

.text-primary { color: var(--primary) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-danger { color: var(--danger) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-white { color: #fff !important; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }

/* --- Layout: App Shell --- */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-sidebar);
  border-left: 1px solid var(--border-light);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-brand {
  padding: 20px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}

.sidebar-brand-icon {
  width: 40px;
  height: 40px;
  background: var(--primary);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.sidebar-brand-text {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  overflow-y: auto;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition);
  cursor: pointer;
  margin-bottom: 2px;
  text-decoration: none;
}

.sidebar-nav-item:hover {
  background: var(--bg-hover);
  color: var(--primary);
}

.sidebar-nav-item.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

.sidebar-nav-item i {
  width: 20px;
  text-align: center;
  font-size: 1.05rem;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-light);
  flex-shrink: 0;
}

/* Main Content */
.main-content {
  flex: 1;
  margin-right: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 900;
  height: var(--header-height);
  background: var(--bg-header);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
}

.header-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

.header-spacer { flex: 1; }

.header-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}

.header-user-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

/* Page Content */
.page-content {
  flex: 1;
  padding: 24px;
}

/* Mobile Menu Toggle */
.menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  border: none;
  background: var(--bg-input);
  color: var(--text);
  font-size: 1.2rem;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.menu-toggle:hover { background: var(--border); }

/* Sidebar Overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.active { opacity: 1; }

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

/* Card Variants */
.card-warning {
  border-color: var(--warning) !important;
}

.card-danger {
  border-color: var(--danger) !important;
}

.card-success {
  border-color: var(--success) !important;
}

/* Section Title Variants */
.section-title-warning { color: var(--warning); }
.section-title-warning i { color: var(--warning); }
.section-title-danger { color: var(--danger); }
.section-title-danger i { color: var(--danger); }
.section-title-success { color: var(--success); }
.section-title-success i { color: var(--success); }
.section-title-info { color: var(--info); }
.section-title-info i { color: var(--info); }

/* Student Row Variants */
.student-row-warning {
  background: var(--warning-light);
  border: 1px solid #fde68a;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 6px;
}

.student-row-danger {
  background: var(--danger-light);
  border: 1px solid #fecaca;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 6px;
}

/* Progress Fill Colors */
.progress-fill-success { background: var(--success); }
.progress-fill-warning { background: var(--warning); }
.progress-fill-danger { background: var(--danger); }
.progress-fill-info { background: var(--info); }
.progress-fill-primary { background: var(--primary); }

/* --- Cards --- */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-xs);
  transition: var(--transition);
  overflow: hidden;
}

.card:hover { box-shadow: var(--shadow-sm); }

.card-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.card-body { padding: 20px; }
.card-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-light);
  background: var(--bg);
}

/* Stat Cards */
.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
}

.stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.stat-icon.primary { background: var(--primary-light); color: var(--primary); }
.stat-icon.success { background: var(--success-light); color: var(--success); }
.stat-icon.warning { background: var(--warning-light); color: var(--warning); }
.stat-icon.danger { background: var(--danger-light); color: var(--danger); }
.stat-icon.info { background: var(--info-light); color: var(--info); }
.stat-icon.purple { background: #f3e8fd; color: #9c27b0; }
.stat-icon.green { background: #f0fdf4; color: #16a34a; }

.stat-icon-green { background: #f0fdf4; color: #16a34a; }

/* Font Size Utilities */
.fs-1-1 { font-size: 1.1rem; }
.text-sm { font-size: 0.82rem; }

/* Picture Upload */
.picture-upload {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  background: var(--bg);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
}

.picture-upload:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.picture-upload i { font-size: 1.2rem; }
.picture-upload input[type="file"] { display: none; }

/* Menu Item Icon Color Variants */
.menu-item-icon-primary { background: var(--primary-light); color: var(--primary); }
.menu-item-icon-success { background: #ecfdf5; color: var(--success); }
.menu-item-icon-info { background: #eff6ff; color: var(--info); }
.menu-item-icon-warning { background: var(--warning-light); color: var(--warning); }
.menu-item-icon-danger { background: var(--danger-light); color: var(--danger); }
.menu-item-icon-orange { background: #fff7ed; color: #ea580c; }
.menu-item-icon-pink { background: #fdf2f8; color: #db2777; }
.menu-item-icon-amber { background: #fef3c7; color: #d97706; }
.menu-item-icon-purple { background: #f3e8fd; color: #7c3aed; }

/* List Avatar Variants */
.list-avatar-success { background: var(--success); color: white; }
.list-avatar-primary { background: var(--primary); color: white; }
.list-avatar-info { background: var(--info); color: white; }
.list-avatar-warning { background: var(--warning); color: white; }
.list-avatar-danger { background: var(--danger); color: white; }

.stat-info { flex: 1; min-width: 0; }
.stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
}
.stat-label {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin-top: 2px;
}

/* Quick Action Cards */
.action-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  color: inherit;
}

.action-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  color: inherit;
}

.action-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
  color: #fff;
}

.action-info { flex: 1; min-width: 0; }
.action-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}
.action-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 0.88rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  text-decoration: none;
  line-height: 1.4;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover { background: var(--primary-dark); color: #fff; box-shadow: var(--shadow-md); }

.btn-secondary {
  background: var(--bg-input);
  color: var(--text);
}
.btn-secondary:hover { background: var(--border); }

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #047857; color: #fff; }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; color: #fff; }

.btn-warning { background: var(--warning); color: #fff; }
.btn-warning:hover { background: #b45309; color: #fff; }

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-50); }

.btn-outline-primary {
  background: transparent;
  border: 1.5px solid var(--primary);
  color: var(--primary);
}
.btn-outline-primary:hover { background: var(--primary); color: #fff; }

.btn-outline-danger {
  background: transparent;
  border: 1.5px solid var(--danger);
  color: var(--danger);
}
.btn-outline-danger:hover { background: var(--danger); color: #fff; }

.btn-sm { padding: 6px 14px; font-size: 0.8rem; border-radius: var(--radius-sm); }
.btn-lg { padding: 14px 28px; font-size: 1rem; border-radius: var(--radius-lg); }
.btn-block { width: 100%; }
.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius);
}
.btn-icon.btn-sm { width: 32px; height: 32px; font-size: 0.85rem; }

/* --- Forms --- */
.form-group { margin-bottom: 18px; }

.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  cursor: pointer;
  color: var(--text);
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 0.9rem;
  color: var(--text);
  background: var(--bg-card);
  transition: var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-100);
}

.form-control::placeholder { color: var(--text-muted); }

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 14px center;
  padding-left: 36px;
}

textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

.form-text {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Input with icon */
.input-icon-wrap {
  position: relative;
}
.input-icon-wrap .form-control {
  padding-right: 42px;
}
.input-icon-wrap i {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.95rem;
  pointer-events: none;
}

/* --- Tables --- */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  background: var(--bg-card);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.table th {
  padding: 13px 16px;
  text-align: right;
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

.table tbody tr { transition: var(--transition); }
.table tbody tr:hover { background: var(--bg-hover); }
.table tbody tr:last-child td { border-bottom: none; }

/* Mobile Card Table */
.table-mobile-card {
  display: none;
}

/* --- Badges --- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-success { background: var(--success-light); color: #065f46; }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-warning { background: var(--warning-light); color: #b45309; }
.badge-info { background: var(--info-light); color: var(--info); }
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-secondary { background: #f3f4f6; color: var(--text-secondary); }
.badge-purple { background: #f3e8fd; color: #7c3aed; }

/* --- Alerts / Messages --- */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  animation: slideDown 0.3s ease;
}

.alert-success { background: var(--success-light); color: #065f46; border: 1px solid #a7f3d0; }
.alert-danger { background: var(--danger-light); color: var(--danger); border: 1px solid #fecaca; }
.alert-warning { background: var(--warning-light); color: #b45309; border: 1px solid #fde68a; }
.alert-info { background: var(--info-light); color: #1e40af; border: 1px solid #bfdbfe; }

.alert .close-btn {
  margin-right: auto;
  background: none;
  border: none;
  color: inherit;
  opacity: 0.6;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0;
  line-height: 1;
}
.alert .close-btn:hover { opacity: 1; }

/* --- Modal --- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.modal-box {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  transform: scale(0.95) translateY(10px);
  transition: var(--transition);
}

.modal-backdrop.active .modal-box {
  transform: scale(1) translateY(0);
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title { font-size: 1.1rem; font-weight: 700; }

.modal-body { padding: 24px; }

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-light);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* --- Bottom Navigation (Mobile) --- */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  right: 0;
  left: 0;
  height: var(--bottom-nav-height);
  background: var(--bg-sidebar);
  border-top: 1px solid var(--border-light);
  z-index: 1000;
  padding: 0 8px;
  padding-bottom: env(safe-area-inset-bottom);
}

.bottom-nav-items {
  display: flex;
  align-items: center;
  justify-content: space-around;
  height: 100%;
  list-style: none;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 12px;
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 500;
  text-decoration: none;
  transition: var(--transition);
  cursor: pointer;
}

.bottom-nav-item i { font-size: 1.2rem; }
.bottom-nav-item.active { color: var(--primary); }
.bottom-nav-item:hover { color: var(--primary); }

/* --- Grid --- */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* --- Flex Utilities --- */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }

/* --- Spacing --- */
.m-0 { margin: 0; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mr-1 { margin-right: 4px; }
.mr-2 { margin-right: 8px; }
.mr-auto { margin-right: auto; }
.ml-auto { margin-left: auto; }

.p-0 { padding: 0; }
.p-2 { padding: 8px; }
.p-3 { padding: 12px; }
.p-4 { padding: 16px; }
.p-6 { padding: 24px; }
.py-2 { padding-top: 8px; padding-bottom: 8px; }
.py-3 { padding-top: 12px; padding-bottom: 12px; }
.px-2 { padding-right: 8px; padding-left: 8px; }
.px-3 { padding-right: 12px; padding-left: 12px; }

/* --- Display --- */
.d-none { display: none !important; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-inline-flex { display: inline-flex; }

/* --- Rounded --- */
.rounded { border-radius: var(--radius); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-full { border-radius: var(--radius-full); }

/* --- Background Colors --- */
.bg-white { background: var(--bg-card); }
.bg-primary { background: var(--primary); }
.bg-primary-light { background: var(--primary-light); }
.bg-success { background: var(--success-light); }
.bg-info { background: var(--info-light); }
.bg-warning { background: var(--warning-light); }
.bg-danger { background: var(--danger-light); }
.bg-purple { background: #f3e8fd; }

/* --- Misc --- */
.divider {
  height: 1px;
  background: var(--border-light);
  margin: 16px 0;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.avatar-lg { width: 56px; height: 56px; font-size: 1.2rem; }
.avatar-sm { width: 32px; height: 32px; font-size: 0.75rem; }

.empty-state {
  text-align: center;
  padding: 48px 24px;
}

.empty-state-icon {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-full);
  background: var(--bg);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin: 0 auto 16px;
}

.empty-state-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.empty-state-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Section Title */
.section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title i { color: var(--primary); }

/* Page Header */
.page-header {
  margin-bottom: 24px;
}

.page-header h1 {
  font-size: 1.4rem;
  font-weight: 800;
}

.page-header p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* --- Animations --- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.animate-fade { animation: fadeIn 0.4s ease; }
.animate-slide { animation: slideUp 0.4s ease; }
.animate-scale { animation: scaleIn 0.3s ease; }

/* --- Public Pages (Landing) --- */
.public-page {
  min-height: 100vh;
  background: var(--bg);
}

.public-header {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  height: 64px;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-light);
  z-index: 1000;
  display: flex;
  align-items: center;
  padding: 0 24px;
}

.public-header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  text-decoration: none;
}

.public-header-nav {
  margin-right: auto;
  display: flex;
  gap: 8px;
}

.public-body {
  padding-top: 64px;
}

/* Login / Signup Card */
.auth-card {
  max-width: 420px;
  margin: 0 auto;
  padding: 32px 28px;
}

.auth-card .brand-logo {
  width: 56px;
  height: 56px;
  background: var(--primary);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.5rem;
  margin: 0 auto 16px;
}

.auth-card .brand-title {
  font-size: 1.3rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 4px;
}

.auth-card .brand-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 28px;
}

.auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.auth-footer a { font-weight: 600; }

/* Login Page */
.login-bg {
  min-height: 100vh;
  background: linear-gradient(135deg, #f7f7f9 0%, #f3f0ff 50%, #ede9fe 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

/* --- Responsive: Tablet --- */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

/* --- Responsive: Mobile --- */
@media (max-width: 768px) {
  :root {
    --sidebar-width: 280px;
    --header-height: 56px;
  }

  .sidebar {
    transform: translateX(100%);
  }

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

  .sidebar-overlay.active {
    display: block;
  }

  .menu-toggle {
    display: flex;
  }

  .main-content {
    margin-right: 0;
  }

  .bottom-nav {
    display: block;
  }

  .page-content {
    padding: 16px;
    padding-bottom: calc(var(--bottom-nav-height) + 24px);
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .stat-card { padding: 16px; }
  .stat-icon { width: 44px; height: 44px; font-size: 1.1rem; }
  .stat-value { font-size: 1.4rem; }

  .card-header { padding: 14px 16px; }
  .card-body { padding: 16px; }

  .table-wrap { border-radius: var(--radius); }

  /* Hide desktop table on mobile, show card layout */
  .table-desktop { display: none; }
  .table-mobile-card { display: block; }

  .page-header h1 { font-size: 1.2rem; }

  .modal-box {
    max-width: 100%;
    margin: 0 16px;
    border-radius: var(--radius-lg);
  }

  .auth-card { padding: 24px 20px; }

  .public-header { padding: 0 16px; }

  .action-card { padding: 16px; }
  .action-icon { width: 42px; height: 42px; font-size: 1.1rem; }

  .btn-lg { padding: 12px 24px; }

  h1 { font-size: 1.3rem; }
  h2 { font-size: 1.15rem; }
  h3 { font-size: 1.05rem; }
}

@media (max-width: 480px) {
  .page-content { padding: 12px; padding-bottom: calc(var(--bottom-nav-height) + 16px); }
  .grid { gap: 10px; }
  .stat-card { gap: 12px; padding: 14px; }
  .stat-value { font-size: 1.25rem; }
  .header-user-name { display: none; }
}

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* --- Extended Stat Icon Color Variants --- */
.stat-icon-primary { background: var(--primary-light); color: var(--primary); }
.stat-icon-success { background: var(--success-light); color: var(--success); }
.stat-icon-warning { background: var(--warning-light); color: var(--warning); }
.stat-icon-danger { background: var(--danger-light); color: var(--danger); }
.stat-icon-info { background: var(--info-light); color: var(--info); }
.stat-icon-purple { background: #f3e8fd; color: #9c27b0; }

/* --- Stat Number (alias for stat-value) --- */
.stat-number {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
}

/* --- Menu Grid --- */
.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 16px 18px;
  text-decoration: none;
  color: var(--text);
  transition: var(--transition);
}

.menu-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.06);
  border-color: var(--primary);
  color: var(--text);
}

.menu-item-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.menu-item h4 {
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.menu-item p {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0;
}

/* --- Action Buttons Bar --- */
.action-btns {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

/* --- Request Item (Coach Enrollment) --- */
.request-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--warning-light);
  border-radius: 12px;
  margin-bottom: 8px;
  border: 1px solid #fde68a;
}

.request-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
}

.request-body { flex: 1; }
.request-name { font-weight: 600; font-size: 0.88rem; }
.request-meta { font-size: 0.75rem; color: var(--text-muted); }
.request-note { font-size: 0.7rem; color: var(--text-secondary); margin-top: 3px; }
.request-actions { display: flex; gap: 6px; }

/* --- Class Card --- */
.class-card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-decoration: none;
  color: var(--text);
  transition: var(--transition);
}

.class-card:hover {
  border-color: var(--primary);
  transform: translateX(-2px);
  color: var(--text);
}

.class-card-name { font-weight: 700; font-size: 0.88rem; }
.class-card-meta { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; display: flex; gap: 12px; }
.class-card-meta span { display: flex; align-items: center; gap: 4px; }

/* --- List Item (Shared) --- */
.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
}

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

.list-avatar {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.88rem;
  color: white;
  flex-shrink: 0;
}

.list-item-body { flex: 1; }
.list-item-title { font-weight: 600; font-size: 0.88rem; }
.list-item-sub { font-size: 0.75rem; color: var(--text-muted); }

/* --- Student Row (Coach's Students) --- */
.student-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
}

.student-row:last-child { border-bottom: none; }
.student-row-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.82rem;
  color: white;
  flex-shrink: 0;
}

.student-row-body { flex: 1; }
.student-row-name { font-weight: 600; font-size: 0.88rem; }
.student-row-phone { font-size: 0.75rem; color: var(--text-muted); direction: ltr; }

/* --- Progress Bar --- */
.progress-bar {
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s;
}

/* --- Sport Tag --- */
.sport-tag {
  display: inline-flex;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  background: var(--primary-light);
  color: var(--primary);
}

/* Bank Info (settlements) */
.bank-info {
  font-size: 0.82rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.bank-info .bank-name {
  font-weight: 600;
  color: var(--text);
}

.bank-info .card-number {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: monospace;
  letter-spacing: 1px;
}

/* --- Profile Card (Athlete Dashboard) --- */
.profile-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 28px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  font-weight: 800;
  color: white;
  flex-shrink: 0;
}

.profile-card-img {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  object-fit: cover;
  border: 3px solid var(--primary-light);
}

.profile-card .profile-name { font-size: 1.25rem; font-weight: 800; }
.profile-card .profile-sub { color: var(--text-muted); font-size: 0.82rem; margin-top: 4px; }
.profile-card .profile-sports { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }

/* --- Subscription Card --- */
.subscription-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
}

.subscription-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.subscription-info {
  display: flex;
  gap: 16px;
  margin-bottom: 12px;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.subscription-info span { display: flex; align-items: center; gap: 4px; }

/* --- Attendance Badge --- */
.attendance-badge {
  display: inline-flex;
  padding: 3px 10px;
  border-radius: 8px;
  font-size: 0.7rem;
  font-weight: 600;
}

.attendance-badge.present { background: var(--success-light); color: var(--success); }
.attendance-badge.absent { background: var(--danger-light); color: var(--danger); }
.attendance-badge.excused { background: var(--warning-light); color: var(--warning); }
.attendance-badge.late { background: var(--info-light); color: var(--info); }

/* --- Skill Badge --- */
.badge-skill { padding: 4px 12px; border-radius: 50px; font-weight: 500; font-size: 12px; }
.badge-skill.beginner { background: var(--warning-light); color: var(--warning); }
.badge-skill.intermediate { background: var(--primary-light); color: var(--primary); }
.badge-skill.advanced { background: var(--success-light); color: var(--success); }

/* --- Tuition Status Badge --- */
.badge-status { padding: 4px 12px; border-radius: 50px; font-weight: 600; font-size: 12px; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; transition: all 0.15s; cursor: pointer; }
.badge-status:hover { transform: scale(1.03); }
.badge-status.paid { background: var(--success-light); color: var(--success); }
.badge-status.debt { background: var(--danger-light); color: var(--danger); }
.badge-status.suspended { background: var(--warning-light); color: var(--warning); }

/* --- Amount Text --- */
.amount-text { font-weight: 700; color: var(--success); direction: ltr; display: inline-block; font-size: 13px; }

/* --- Student Name --- */
.student-name { font-weight: 600; }

/* --- Phone Text --- */
.phone-text { color: var(--text-secondary); direction: ltr; display: inline-block; }

/* --- Search Box --- */
.search-box {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: 50px;
  padding: 0 16px;
  transition: var(--transition);
}

.search-box:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-100);
  background: var(--bg-card);
}

.search-box i { color: var(--text-muted); font-size: 1rem; }
.search-box input {
  border: none;
  background: transparent;
  padding: 10px 12px;
  font-size: 0.88rem;
  outline: none;
  color: var(--text);
  width: 100%;
  font-family: var(--font);
}

.search-box input::placeholder { color: var(--text-muted); }

.search-box button {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px;
}

/* --- Page Header (for list pages) --- */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.page-header h1 { margin: 0; }

/* --- Back Link --- */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.82rem;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  transition: var(--transition);
}

.back-link:hover { border-color: var(--primary); color: var(--primary); }

/* --- Count Badge --- */
.count-badge {
  background: var(--primary-light);
  color: var(--primary);
  padding: 4px 14px;
  border-radius: 50px;
  font-size: 0.82rem;
  font-weight: 600;
}

/* --- Filter Bar --- */
.filter-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  align-items: center;
}

.filter-bar select {
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 0.82rem;
  color: var(--text);
  background: var(--bg-card);
  font-family: var(--font);
  cursor: pointer;
}

.filter-bar select:focus { border-color: var(--primary); outline: none; }

/* --- Col Index (number column) --- */
.col-index { width: 50px; color: var(--text-muted); }
.col-actions { width: 110px; }

/* --- Alert Message (for form errors / success inline) --- */
.alert-msg {
  padding: 10px 16px;
  border-radius: var(--radius);
  font-size: 0.82rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  background: var(--success-light);
  color: var(--success);
  border: 1px solid #a7f3d0;
}

.alert-msg .close-btn {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 1rem;
  margin-right: auto;
  opacity: 0.6;
}

.alert-msg .close-btn:hover { opacity: 1; }

.alert-msg.info { background: var(--primary-light); color: var(--primary); border-color: #c4b5fd; }

/* --- Checkbox Group --- */
.checkbox-group {
  max-height: 180px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  background: #f9fafb;
}

.checkbox-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 0.88rem;
  cursor: pointer;
}

.checkbox-group label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

/* --- Row 2 (form grid) --- */
.row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 768px) {
  .row-2 { grid-template-columns: 1fr; }
}

/* --- Section Divider --- */
.section-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 24px 0 20px;
}

/* --- Form Section Title --- */
.form-section-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

/* --- Auth Login Card --- */
.auth-card .card-header {
  border-bottom: none;
}

/* --- Form Card (standalone form page) --- */
.form-card {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  background: var(--bg-card);
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
  overflow: hidden;
  width: 100%;
}

.form-card .form-header {
  padding: 24px 28px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 10px;
}

.form-card .form-header i { font-size: 1.35rem; color: var(--primary); }
.form-card .form-header h1 { font-size: 1.1rem; font-weight: 700; margin: 0; }
.form-card .form-body { padding: 28px; }

/* --- Legacy Button Aliases --- */
.btn-submit {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius);
  padding: 12px 24px;
  font-weight: 600;
  font-size: 0.95rem;
  width: 100%;
  transition: var(--transition);
  cursor: pointer;
  font-family: var(--font);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-submit:hover { background: var(--primary-dark); box-shadow: 0 4px 12px var(--primary-200); }

.btn-back {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  font-weight: 500;
  font-size: 0.88rem;
  color: var(--text-secondary);
  background: var(--bg-card);
  text-decoration: none;
  width: 100%;
  transition: var(--transition);
}
.btn-back:hover { border-color: var(--primary); color: var(--primary); }

.btn-save {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius);
  padding: 10px 20px;
  font-weight: 600;
  font-size: 0.88rem;
  transition: var(--transition);
  cursor: pointer;
  font-family: var(--font);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn-save:hover { background: var(--primary-dark); box-shadow: 0 4px 12px var(--primary-200); }

.btn-danger-sm {
  background: transparent;
  border: 1.5px solid var(--danger);
  color: var(--danger);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: var(--transition);
}
.btn-danger-sm:hover { background: var(--danger); color: #fff; }

.btn-primary-custom {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 50px;
  padding: 10px 24px;
  font-weight: 600;
  font-size: 0.88rem;
  transition: var(--transition);
  text-decoration: none;
  box-shadow: 0 2px 8px var(--primary-200);
}
.btn-primary-custom:hover { background: var(--primary-dark); color: white; transform: translateY(-1px); }

/* --- Action Button Links --- */
.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: var(--radius);
  padding: 10px 18px;
  font-weight: 600;
  font-size: 0.82rem;
  text-decoration: none;
  transition: var(--transition);
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--border);
}
.action-btn:hover { background: var(--bg-hover); color: var(--primary); border-color: var(--primary); }

.action-btn.active {
  background: var(--primary-light) !important;
  color: var(--primary) !important;
  border-color: var(--primary) !important;
}

.action-btn-primary { background: var(--primary); color: white; border: none; }
.action-btn-primary:hover { background: var(--primary-dark); color: white; }

.action-btn-success { background: var(--success); color: white; border: none; }
.action-btn-success:hover { background: #047857; color: white; }

.action-btn-warning { background: var(--warning); color: white; border: none; }
.action-btn-warning:hover { background: #b45309; color: white; }

.action-btn-amber { background: #d97706; color: white; border: none; }
.action-btn-amber:hover { background: #b45309; color: white; }

.action-btn-danger { background: var(--danger); color: white; border: none; }
.action-btn-danger:hover { background: #b91c1c; color: white; }

.action-btn-info { background: var(--info); color: white; border: none; }
.action-btn-info:hover { background: #1d4ed8; color: white; }

/* --- Send Button --- */
.send-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 50px;
  padding: 10px 20px;
  font-weight: 600;
  font-size: 0.88rem;
  text-decoration: none;
  transition: var(--transition);
}
.send-btn:hover { background: var(--primary-dark); color: white; transform: translateY(-1px); box-shadow: 0 4px 12px var(--primary-200); }

/* --- Unread Badge (for headers) --- */
.unread-badge {
  background: var(--danger);
  color: white;
  padding: 1px 6px;
  border-radius: 50px;
  font-size: 0.65rem;
  font-weight: 700;
  vertical-align: middle;
}

/* --- Message Item --- */
.msg-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: var(--transition);
  margin-bottom: 4px;
}
.msg-item:hover { background: var(--bg-hover); }
.msg-item.unread { background: var(--primary-50); font-weight: 600; }
.msg-item .avatar,
.msg-item-avatar {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-full);
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}
.msg-item .content,
.msg-item-content { flex: 1; min-width: 0; }
.msg-item .sender,
.msg-item-sender { font-size: 0.88rem; }
.msg-item .preview,
.msg-item-preview { font-size: 0.78rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-item .date,
.msg-item-time { font-size: 0.72rem; color: var(--text-muted); white-space: nowrap; }

.msg-item .meta,
.msg-item-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

/* --- Sport Grid --- */
.sport-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.sport-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  transition: var(--transition);
}

.sport-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.sport-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin: 0 auto 12px;
}

.sport-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 6px; }
.sport-card .count { font-size: 0.82rem; color: var(--text-muted); }

.sport-actions { margin-top: 14px; display: flex; gap: 8px; justify-content: center; }

/* --- Profile Info List --- */
.profile-info-list {
  max-width: 400px;
  margin: 16px auto 0;
  text-align: right;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.88rem;
}

.info-row:last-child { border-bottom: none; }

.info-label {
  color: var(--text-secondary);
  font-weight: 500;
}

.info-value {
  font-weight: 600;
  color: var(--text);
}

.profile-role {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.profile-avatar-lg {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  background: var(--primary-light);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.8rem;
  margin: 0 auto;
}

img.profile-avatar-lg {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  object-fit: cover;
  margin: 0 auto;
}

/* --- Class Chip (Athlete Dashboard) --- */
.class-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: var(--radius);
  margin-bottom: 6px;
  font-size: 0.88rem;
}

.class-chip strong {
  font-weight: 600;
}

.class-chip .text-muted {
  margin-right: auto;
  font-size: 0.78rem;
}

.class-chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  display: inline-block;
  flex-shrink: 0;
}

/* --- Subscription Extras --- */
.subscription-title {
  font-weight: 700;
  font-size: 0.95rem;
}

.subscription-status {
  display: inline-flex;
  padding: 3px 12px;
  border-radius: 50px;
  font-size: 0.72rem;
  font-weight: 600;
}

.subscription-status.status-active { background: var(--success-light); color: var(--success); }
.subscription-status.status-warning { background: var(--warning-light); color: var(--warning); }
.subscription-status.status-expired { background: var(--danger-light); color: var(--danger); }

.subscription-meta {
  display: flex;
  gap: 16px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.subscription-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.subscription-progress {
  display: flex;
  align-items: center;
  gap: 12px;
}

.progress-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  font-weight: 500;
}

.flex-1 { flex: 1; }

/* --- Profile Tags (sports list) --- */
.profile-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

/* --- Print --- */
@media print {
  .sidebar, .app-header, .bottom-nav, .menu-toggle { display: none !important; }
  .main-content { margin: 0; }
  .page-content { padding: 0; }
}