/* ==========================================
   Gym 1s Management System - Main Stylesheet
   ========================================== */

/* ---------- Font Import ---------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ==========================================
   CSS CUSTOM PROPERTIES
   ========================================== */
:root {
  /* Brand Colors */
  --primary-color: #1a1d23;
  --secondary-color: #3b82f6;

  /* Semantic Colors */
  --success-color: #10b981;
  --danger-color: #ef4444;
  --warning-color: #f59e0b;
  --info-color: #6366f1;

  /* Button Variants */
  --btn-primary-bg: #3b82f6;
  --btn-primary-hover: #2563eb;
  --btn-primary-text: #ffffff;

  --btn-success-bg: #10b981;
  --btn-success-hover: #059669;
  --btn-success-text: #ffffff;

  --btn-danger-bg: #ef4444;
  --btn-danger-hover: #dc2626;
  --btn-danger-text: #ffffff;

  --btn-warning-bg: #f59e0b;
  --btn-warning-hover: #d97706;
  --btn-warning-text: #ffffff;

  --btn-info-bg: #6366f1;
  --btn-info-hover: #4f46e5;
  --btn-info-text: #ffffff;

  --btn-secondary-bg: #eff6ff;
  --btn-secondary-hover: #dbeafe;
  --btn-secondary-text: #1d4ed8;

  --btn-neutral-bg: #f1f5f9;
  --btn-neutral-hover: #e2e8f0;
  --btn-neutral-text: #475569;

  --btn-outline-border: #3b82f6;
  --btn-outline-text: #3b82f6;
  --btn-outline-hover-bg: #eff6ff;

  /* Layout */
  --light-bg: #f5f6f8;
  --dark-bg: #1a1d23;
  --sidebar-width: 240px;
  --border-color: #e2e6ed;

  /* Text */
  --text-primary: #111827;
  --text-secondary: #4b5563;
  --text-muted: #8593a8;

  /* Shadows */
  --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  --card-shadow-hover: 0 6px 16px rgba(0, 0, 0, 0.1);
  --btn-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  --btn-shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.12);

  /* Radii */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-base: 0.3s ease;
}

/* ==========================================
   RESET & BASE
   ========================================== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--light-bg);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* ==========================================
   LOGIN PAGE
   ========================================== */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a1d23 0%, #3b82f6 100%);
  padding: 20px;
}

.login-card {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  padding: 40px;
  width: 100%;
  max-width: 420px;
}

.login-header {
  text-align: center;
  margin-bottom: 32px;
}

.login-header h1 {
  color: var(--primary-color);
  font-size: 28px;
  margin-bottom: 6px;
}

.login-header p {
  color: var(--text-muted);
  font-size: 14px;
}

.login-header img {
  width: 190px;
  max-width: 62vw;
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  transition: transform var(--transition-base);
}

.login-brand {
  border-radius: 12px;
  display: inline-block;
  margin-bottom: 16px;
  text-decoration: none;
}

.login-header img:hover {
  transform: scale(1.05);
}

.login-header a {
  text-decoration: none;
  display: block;
}

.login-form .form-group {
  margin-bottom: 18px;
}

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

.login-form input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 15px;
  transition: all var(--transition-fast);
}

.login-form input:focus {
  outline: none;
  border-color: var(--secondary-color);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.login-btn {
  width: 100%;
  padding: 12px;
  background: var(--secondary-color);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.login-btn:hover {
  background: #2563eb;
}

.login-footer {
  margin-top: 20px;
  text-align: center;
  color: #8593a8;
  font-size: 13px;
}

.login-footer p {
  margin: 0;
}

/* ==========================================
   MOBILE MENU TOGGLE & OVERLAY
   ========================================== */
.mobile-menu-toggle {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--dark-bg);
  color: #fff;
  border: none;
  font-size: 20px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99;
}

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

/* ==========================================
   LAYOUT
   ========================================== */
.wrapper {
  display: flex;
  min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, #1e293b 0%, #1a2332 100%);
  color: #fff;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  transition: transform var(--transition-base);
  display: flex;
  flex-direction: column;
}

.sidebar::-webkit-scrollbar {
  width: 4px;
}

.sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.sidebar-header {
  padding: 28px 18px 18px;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.sidebar-header a {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  justify-content: center;
  width: 100%;
}

.sidebar-header img {
  width: 190px;
  max-width: calc(100% - 8px);
  height: auto;
  object-fit: contain;
  object-position: center;
  display: block;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.sidebar-brand-name {
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  text-align: center;
}

.sidebar-header img:hover {
  transform: scale(1.06);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.sidebar-header .sidebar-logo-text {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.45);
  margin: 0;
}

.sidebar-header .sidebar-brand-text {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  margin: 0 0 2px;
}

/* ---------- Sidebar Navigation ---------- */
.sidebar-nav {
  padding: 12px 0;
  flex: 1;
}

.nav-item {
  list-style: none;
}

.nav-link {
  display: flex;
  align-items: center;
  padding: 11px 22px;
  margin: 2px 10px;
  color: rgba(255, 255, 255, 0.5);
  text-decoration: none;
  transition: all var(--transition-fast);
  font-weight: 500;
  font-size: 13px;
  border-radius: 8px;
  position: relative;
}

.nav-link i {
  margin-right: 12px;
  width: 20px;
  text-align: center;
  font-size: 15px;
  opacity: 0.65;
  transition: opacity var(--transition-fast);
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
}

.nav-link:hover i {
  opacity: 1;
}

.nav-link.active {
  background: rgba(59, 130, 246, 0.12);
  color: #fff;
  font-weight: 600;
  box-shadow: inset 3px 0 0 #3b82f6;
}

.nav-link.active i {
  opacity: 1;
  color: #60a5fa;
}

.sidebar-footer {
  padding: 12px 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

/* ---------- Main Content ---------- */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 24px;
  min-width: 0;
}

/* ---------- Top Header ---------- */
.top-header {
  background: #fff;
  padding: 16px 24px;
  border-radius: var(--radius-md);
  box-shadow: var(--card-shadow);
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.header-title h1 {
  font-size: 22px;
  color: var(--primary-color);
  font-weight: 800;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 14px;
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--secondary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}

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

.stats-grid.portal-stats-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stat-card {
  background: #fff;
  border-radius: var(--radius-md);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--border-color);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

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

.stat-card-link {
  text-decoration: none;
  display: block;
}

.stat-card.active-filter {
  border: 2px solid var(--btn-primary-bg);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

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

.stat-icon.primary { background: var(--btn-primary-bg); }
.stat-icon.success { background: var(--btn-success-bg); }
.stat-icon.warning { background: var(--btn-warning-bg); }
.stat-icon.danger  { background: var(--btn-danger-bg); }
.stat-icon.info    { background: var(--btn-info-bg); }

.stat-info h3 {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0 0 2px;
  line-height: 1;
}

.stat-info p {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-info .stat-money {
  font-size: clamp(18px, 2vw, 26px);
  line-height: 1.1;
}

/* Subscription stats specific */
.subscription-stats-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* ==========================================
   TABLES
   ========================================== */
.table-container {
  background: #fff;
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--card-shadow);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
}

.data-table thead {
  background: #f8f9fb;
}

.data-table th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 700;
  color: var(--text-secondary);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--border-color);
  white-space: nowrap;
}

.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #f0f2f5;
  font-size: 14px;
}

.data-table tbody tr:hover {
  background: #f8f9fb;
  cursor: pointer;
}

/* ---------- Members Table ---------- */
.members-table {
  table-layout: fixed;
  min-width: 880px;
}

.members-table th,
.members-table td {
  vertical-align: middle;
  white-space: nowrap;
}

/* Column width distribution */
.members-table th:nth-child(1),
.members-table td:nth-child(1) { width: 15%; }  /* Name */

.members-table th:nth-child(2),
.members-table td:nth-child(2) { width: 13%; }  /* Phone */

.members-table th:nth-child(3),
.members-table td:nth-child(3) {
  width: 18%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.members-table th:nth-child(4),
.members-table td:nth-child(4) { width: 9%; }   /* Join Date */

.members-table th:nth-child(5),
.members-table td:nth-child(5) { width: 7%; }   /* Status */

.members-table th:nth-child(6),
.members-table td:nth-child(6) { width: 13%; }  /* Subscription */

.members-table .members-actions-column {
  width: 200px;
  min-width: 200px;
}

.members-actions {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 6px;
}

.clickable-member-row:focus {
  outline: 2px solid var(--secondary-color);
  outline-offset: -2px;
}

.members-actions .btn-sm {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  justify-content: center;
  padding: 0;
  font-size: 12px;
}

.members-delete-form {
  display: flex;
  flex: 0 0 28px;
  margin: 0;
}

/* ---------- Subscription Tracking Table ---------- */
.subscription-tracking-table td:first-child a {
  color: var(--text-primary);
  text-decoration: none;
}

.subscription-tracking-table td:first-child a:hover {
  color: var(--secondary-color);
}

/* ==========================================
   BADGES
   ========================================== */
.badge {
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.badge-success  { background: #d1fae5; color: #065f46; }
.badge-warning  { background: #fef3c7; color: #92400e; }
.badge-danger   { background: #fee2e2; color: #991b1b; }
.badge-info     { background: #e0e7ff; color: #3730a3; }
.badge-primary  { background: #dbeafe; color: #1e40af; }

/* ==========================================
   BUTTONS
   ========================================== */
.btn {
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 13px;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  box-shadow: var(--btn-shadow);
  line-height: 1.4;
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--btn-shadow-hover);
}

.btn:active {
  transform: translateY(0);
}

/* Button Sizes */
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 6px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }

/* Button Variants */
.btn-primary {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
}
.btn-primary:hover { background: var(--btn-primary-hover); }

.btn-success {
  background: var(--btn-success-bg);
  color: var(--btn-success-text);
}
.btn-success:hover { background: var(--btn-success-hover); }

.btn-danger {
  background: var(--btn-danger-bg);
  color: var(--btn-danger-text);
}
.btn-danger:hover { background: var(--btn-danger-hover); }

.btn-warning {
  background: var(--btn-warning-bg);
  color: var(--btn-warning-text);
}
.btn-warning:hover { background: var(--btn-warning-hover); }

.btn-info {
  background: var(--btn-info-bg);
  color: var(--btn-info-text);
}
.btn-info:hover { background: var(--btn-info-hover); }

.btn-secondary {
  background: var(--btn-secondary-bg);
  color: var(--btn-secondary-text);
  box-shadow: none;
}
.btn-secondary:hover {
  background: var(--btn-secondary-hover);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.12);
}

.btn-neutral {
  background: var(--btn-neutral-bg);
  color: var(--btn-neutral-text);
  box-shadow: none;
}
.btn-neutral:hover {
  background: var(--btn-neutral-hover);
  box-shadow: 0 2px 8px rgba(100, 116, 139, 0.12);
}

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

.btn-outline-danger {
  background: transparent;
  color: var(--btn-danger-bg);
  border: 1.5px solid var(--btn-danger-bg);
  box-shadow: none;
}
.btn-outline-danger:hover { background: #fef2f2; }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  box-shadow: none;
}
.btn-ghost:hover { background: var(--btn-neutral-bg); }

.btn-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ==========================================
   MEMBER VIEW - ACTION BUTTONS
   ========================================== */
.member-actions {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 28px;
}

.btn-action {
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  text-decoration: none;
  border: none;
  box-shadow: var(--btn-shadow);
  justify-content: center;
  min-height: 42px;
  text-align: center;
  width: 100%;
}

.btn-action:hover {
  transform: translateY(-1px);
  box-shadow: var(--btn-shadow-hover);
}

.btn-action-form { display: contents; }

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

.btn-action-secondary {
  background: var(--btn-secondary-bg);
  color: var(--btn-secondary-text);
  box-shadow: none;
}
.btn-action-secondary:hover {
  background: var(--btn-secondary-hover);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.12);
}

.btn-action-neutral {
  background: var(--btn-neutral-bg);
  color: var(--btn-neutral-text);
  box-shadow: none;
}
.btn-action-neutral:hover {
  background: var(--btn-neutral-hover);
  box-shadow: 0 2px 8px rgba(100, 116, 139, 0.12);
}

.btn-action-destructive {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fca5a5;
  box-shadow: none;
}
.btn-action-destructive:hover {
  background: #fee2e2;
  border-color: #f87171;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.12);
}

/* ==========================================
   FORMS
   ========================================== */
.form-container {
  background: #fff;
  border-radius: var(--radius-md);
  padding: 28px;
  box-shadow: var(--card-shadow);
  max-width: 640px;
  margin: 0 auto;
}

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

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

.form-control {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 14px;
  transition: all var(--transition-fast);
}

.form-control:focus {
  outline: none;
  border-color: var(--secondary-color);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.field-required { color: #e74c3c; }

.form-hint {
  color: #666;
  font-size: 13px;
}

.form-hint i { margin-right: 4px; }

/* ==========================================
   SEARCH & FILTER
   ========================================== */
.search-input {
  flex: 1;
  padding: 10px 14px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 14px;
  transition: all var(--transition-fast);
  min-width: 0;
}

.search-input:focus {
  outline: none;
  border-color: var(--secondary-color);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.filter-section {
  background: #fff;
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 20px;
  box-shadow: var(--card-shadow);
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.filter-select {
  padding: 10px 14px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 14px;
  background: #fff;
  min-width: 150px;
  cursor: pointer;
  transition: border-color var(--transition-fast);
}

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

/* ==========================================
   ALERTS
   ========================================== */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 500;
  flex-wrap: wrap;
  gap: 8px;
}

.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-danger  { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.alert-info    { background: #e0e7ff; color: #3730a3; border: 1px solid #c7d2fe; }

.alert-close {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  opacity: 0.5;
  color: inherit;
}

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

/* ==========================================
   MEMBER PROFILE
   ========================================== */
.member-profile {
  background: #fff;
  border-radius: var(--radius-md);
  max-width: 100%;
  min-width: 0;
  padding: 28px;
  box-shadow: var(--card-shadow);
}

.profile-status { margin-left: auto; }

.profile-header {
  display: flex;
  align-items: center;
  margin-bottom: 24px;
  padding: 18px;
  border: 1px solid #e5e7eb;
  border-radius: var(--radius-md);
  background: #f8fafc;
  flex-wrap: wrap;
  gap: 16px;
}

.profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--secondary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 20px;
  flex-shrink: 0;
}

.profile-avatar i { font-size: 34px; color: #fff; }

.profile-info h2 {
  font-size: 26px;
  color: var(--primary-color);
  font-weight: 800;
}

.profile-info p { color: var(--text-muted); }

.info-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.info-item {
  padding: 16px;
  background: #f8f9fb;
  border-radius: var(--radius-sm);
  grid-column: span 2;
  min-width: 0;
}

.info-label {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.info-value {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  overflow-wrap: anywhere;
}

.account-credit-item,
.quick-sale-item {
  grid-column: span 3;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
}

.payment-card-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.account-credit-balance {
  color: #047857;
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 4px;
}

.payment-mini-summary {
  min-width: 170px;
  padding: 12px;
  background: #fff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-sm);
  text-align: right;
}

.payment-mini-summary span {
  display: block;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.payment-mini-summary strong {
  color: #1d4ed8;
  font-size: 18px;
}

.credit-adjustment-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.credit-adjustment-form {
  background: #fff;
  border: 1px solid #dbeafe;
  border-radius: var(--radius-sm);
  padding: 12px;
}

.credit-apply-form {
  border-color: #86efac;
  grid-column: 1 / -1;
}

.credit-apply-copy {
  color: var(--text-secondary);
  font-size: 13px;
  margin-bottom: 10px;
}

.credit-adjustment-form label {
  display: block;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 8px;
}

.credit-adjustment-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.credit-adjustment-row .form-control {
  min-width: 0;
}

.credit-adjustment-row .btn {
  flex-shrink: 0;
}

.quick-sale-title {
  color: #047857;
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 12px;
}

.quick-sale-form {
  background: #fff;
  border: 1px solid #dbeafe;
  border-radius: var(--radius-sm);
  padding: 12px;
}

.quick-sale-grid {
  display: grid;
  grid-template-columns: 1.4fr 0.7fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.quick-sale-field label {
  display: block;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
}

.quick-sale-payment {
  display: flex;
  gap: 14px;
  margin-bottom: 12px;
}

.quick-sale-payment label {
  align-items: center;
  color: var(--text-secondary);
  display: inline-flex;
  font-size: 13px;
  font-weight: 700;
  gap: 6px;
}

.recent-sales {
  margin-top: 14px;
}

.recent-sales-heading {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.recent-sales ul {
  display: grid;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.recent-sales li {
  align-items: center;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: var(--radius-sm);
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr auto auto auto;
  padding: 10px 12px;
}

.recent-sales span {
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 700;
}

.recent-sales small {
  color: var(--text-muted);
  display: block;
  font-size: 11px;
  font-weight: 500;
  margin-top: 2px;
}

.recent-sales strong {
  color: #047857;
  font-size: 13px;
}

.recent-sales em {
  background: #eef2ff;
  border-radius: 999px;
  color: #3730a3;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  padding: 3px 8px;
}

.recent-sales form {
  margin: 0;
}

.btn-icon-danger {
  align-items: center;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  color: #dc2626;
  cursor: pointer;
  display: inline-flex;
  height: 30px;
  justify-content: center;
  width: 30px;
}

.btn-icon-danger:hover {
  background: #fee2e2;
  border-color: #fca5a5;
}

.recent-sales p {
  color: var(--text-muted);
  font-size: 13px;
  margin: 0;
}

/* ==========================================
   TABS
   ========================================== */
.tabs {
  display: flex;
  border-bottom: 2px solid var(--border-color);
  margin-bottom: 20px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tab {
  padding: 10px 20px;
  background: none;
  border: none;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
}

.tab:hover { color: var(--secondary-color); }

.tab.active {
  color: var(--secondary-color);
  border-bottom-color: var(--secondary-color);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

.tab-content {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ---------- Compact pagination ---------- */
.pagination {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin: 14px 0 24px;
}

.pagination-link {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--secondary-color);
  font-size: 13px;
  font-weight: 700;
  padding: 8px 12px;
  text-decoration: none;
}

.pagination-link:hover { background: #eff6ff; }
.pagination-link.disabled {
  color: #9ca3af;
  opacity: 0.65;
  pointer-events: none;
}

.pagination-summary {
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
}

/* ---------- Subscription View Tabs ---------- */
.subscription-view-tabs {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--card-shadow);
  gap: 6px;
  margin-bottom: 4px;
  padding: 6px;
}

.subscription-view-tabs .tab {
  border-bottom: 0;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0;
  padding: 10px 14px;
  text-decoration: none;
}

.subscription-view-tabs .tab:hover { background: #f8fafc; }

.subscription-view-tabs .tab.active {
  background: #eff6ff;
  color: #1d4ed8;
}

/* ==========================================
   EXPIRING MEMBERS ALERT
   ========================================== */
.expiring-alert {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: #fff;
  padding: 20px;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
}

.expiring-alert h3 {
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.expiring-list { list-style: none; }

.expiring-item {
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

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

.expiring-days {
  background: rgba(255, 255, 255, 0.2);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  white-space: nowrap;
}

/* ==========================================
   SUBSCRIPTION BOARD
   ========================================== */
.subscriptions-page {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.subscription-filter-panel { margin-bottom: 0; }

.subscription-table-card,
.subscription-command-card {
  border: 1px solid var(--border-color);
  margin-bottom: 0;
}

.subscription-command-card { overflow: visible; }

.section-heading {
  align-items: flex-start;
  display: flex;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-heading h3 {
  align-items: center;
  color: var(--text-primary);
  display: flex;
  font-size: 17px;
  gap: 9px;
  line-height: 1.3;
  margin-bottom: 4px;
}

.section-heading p {
  color: var(--text-muted);
  font-size: 13px;
  margin: 0;
}

.result-summary {
  align-items: center;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 13px;
  gap: 6px;
  margin-bottom: 0;
}

.amount-positive,
.amount-negative,
.amount-neutral {
  font-weight: 800;
  white-space: nowrap;
}

.amount-positive,
.amount-neutral { color: #059669; }

.amount-negative { color: #dc2626; }

.subscription-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 18px;
}

.subscription-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
  flex: 1;
}

.subscription-filters .search-input { min-width: 220px; }

.subscription-board {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.subscription-row {
  background: #fff;
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--btn-primary-bg);
  border-radius: var(--radius-md);
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(220px, 1.3fr) repeat(3, minmax(140px, 0.8fr)) auto;
  align-items: center;
  padding: 18px 20px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  transition: box-shadow var(--transition-fast), transform var(--transition-fast);
}

.subscription-row:hover {
  box-shadow: var(--card-shadow);
  transform: translateY(-1px);
}

.subscription-row.cancelled { border-left-color: var(--btn-warning-bg); }
.subscription-row.expired   { border-left-color: var(--btn-danger-bg); }

.member-line {
  align-items: center;
  display: grid;
  gap: 4px 12px;
  grid-template-columns: 42px 1fr;
  min-width: 170px;
}

.member-avatar {
  align-items: center;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: 50%;
  color: #3730a3;
  display: flex;
  font-size: 15px;
  font-weight: 800;
  grid-row: span 2;
  height: 42px;
  justify-content: center;
  width: 42px;
}

.member-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.member-line a {
  color: var(--text-primary);
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
}

.member-line a:hover { color: var(--secondary-color); }

.subtle {
  color: var(--text-muted);
  font-size: 13px;
}

.badge-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  grid-column: 2;
  margin-top: 4px;
}

.metric-block {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 130px;
}

.metric-label {
  align-items: center;
  color: var(--text-muted);
  display: inline-flex;
  font-size: 11px;
  gap: 5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.metric-value {
  color: var(--text-primary);
  font-weight: 700;
  font-size: 14px;
}

.row-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
  flex-shrink: 0;
}

.row-actions .btn-sm {
  height: 34px;
  justify-content: center;
  padding: 0;
  width: 34px;
}

.summary-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: end;
}

.summary-actions form {
  display: flex;
  gap: 8px;
  align-items: center;
}

.summary-actions select {
  min-width: 190px;
  padding: 10px 14px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 14px;
}

/* ==========================================
   MEMBER VIEW - CARDS
   ========================================== */
.active-subscription-card {
  background: #d1fae5;
  padding: 18px;
  border-radius: 10px;
  margin-bottom: 20px;
  border: 1px solid #a7f3d0;
}

.active-subscription-body {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 15px;
  flex-wrap: wrap;
}

.active-subscription-info h4 { color: #065f46; margin-bottom: 12px; }
.active-subscription-info p { margin-bottom: 5px; }

.no-subscription-card {
  background: #fee2e2;
  padding: 15px;
  border-radius: 10px;
  margin-bottom: 20px;
  border: 1px solid #fecaca;
}

.no-subscription-card p { color: #991b1b; margin: 0; }

.payment-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: end;
  margin: 15px 0;
}

.payment-form label {
  display: block;
  font-weight: 600;
  margin-bottom: 5px;
  font-size: 13px;
}

.current-goal-card {
  margin-top: 20px;
  padding: 16px;
  background: #d1fae5;
  border-radius: 10px;
  border: 1px solid #a7f3d0;
}

.current-goal-card h4 { color: #065f46; margin-bottom: 8px; }
.current-goal-card p { margin-bottom: 4px; }
.current-goal-card small { color: #666; }

/* ==========================================
   EMPTY STATE
   ========================================== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  background: #fff;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.empty-state i {
  font-size: 48px;
  color: #d0d5dd;
  margin-bottom: 16px;
  display: block;
}

.empty-state h3 { color: var(--text-primary); margin-bottom: 8px; }
.empty-state p { color: var(--text-muted); margin-bottom: 20px; }

.empty-state-compact { padding: 30px; }

/* ==========================================
   MODAL & SPINNER
   ========================================== */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.modal-content {
  background: #fff;
  margin: 60px auto;
  padding: 28px;
  border-radius: var(--radius-md);
  max-width: 500px;
  width: 90%;
  position: relative;
}

.modal-header h3 {
  color: var(--text-primary);
  font-weight: 800;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 22px;
  cursor: pointer;
  opacity: 0.4;
}

.modal-close:hover { opacity: 1; }

.spinner {
  border: 3px solid rgba(0, 0, 0, 0.08);
  border-radius: 50%;
  border-top: 3px solid var(--secondary-color);
  width: 40px;
  height: 40px;
  animation: spin 0.7s linear infinite;
  margin: 24px auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ==========================================
   CONFIRMATION MODAL
   ========================================== */
.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.15s ease;
}

.confirm-dialog {
  background: #fff;
  border-radius: 16px;
  padding: 28px 32px;
  max-width: 440px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  text-align: center;
  animation: slideUp 0.2s ease;
}

.confirm-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 24px;
}

.confirm-icon.warning { background: #fef3c7; color: #d97706; }
.confirm-icon.danger  { background: #fee2e2; color: #dc2626; }

.confirm-title {
  font-size: 18px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 8px;
}

.confirm-message {
  font-size: 14px;
  color: #6b7280;
  margin-bottom: 24px;
  line-height: 1.6;
}

.confirm-message ul {
  list-style: none;
  padding: 0;
  margin: 12px 0;
  text-align: left;
}

.confirm-message ul li {
  padding: 4px 0;
  color: #4b5563;
}

.confirm-message ul li::before {
  content: '•';
  color: #dc2626;
  font-weight: bold;
  margin-right: 8px;
}

.confirm-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.confirm-actions .btn { min-width: 100px; }

.confirm-btn-cancel {
  background: #f1f5f9;
  color: #475569;
  border: none;
}
.confirm-btn-cancel:hover { background: #e2e8f0; }

.confirm-btn-danger {
  background: #dc2626;
  color: #fff;
  border: none;
}
.confirm-btn-danger:hover { background: #b91c1c; }

.confirm-btn-warning {
  background: #d97706;
  color: #fff;
  border: none;
}
.confirm-btn-warning:hover { background: #b45309; }

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

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

/* ==========================================
   WORKOUT LOG PAGE
   ========================================== */
.workout-log-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  align-items: start;
}

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

.workout-log-header h3 { margin: 0; }

.workout-type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
}

.workout-type-label {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 0;
  cursor: pointer;
}

.today-session-card {
  border: 1px solid #e1e8ed;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 12px;
}

.today-session-card h4 { margin-bottom: 8px; }
.today-session-card p { margin-bottom: 4px; }

.workout-log-right { display: grid; gap: 20px; }

#duration-auto-badge { display: none; }

.session-card-body {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

/* ==========================================
   UTILITY
   ========================================== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ==========================================
   RESPONSIVE STYLES
   ========================================== */

/* ---------- Tablet & Below (max-width: 1024px) ---------- */
@media (max-width: 1024px) {
  .mobile-menu-toggle {
    display: flex;
  }

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

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

  .main-content {
    margin-left: 0;
    padding: 16px;
    padding-top: 60px;
  }

  .top-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .subscription-stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .filter-section {
    flex-direction: column;
    align-items: stretch;
    padding: 20px;
    gap: 14px;
  }

  .search-input,
  .filter-select {
    width: 100%;
    min-width: 0;
    padding: 14px 16px;
    font-size: 16px;
    border-radius: 10px;
  }

  /* Hide status column & filter on tablet */
  .status-column,
  .data-table th.status-column,
  .data-table td.status-column {
    display: none !important;
  }

  .filter-section .filter-select.status-filter {
    display: none !important;
  }

  /* Members table - hide email & join date */
  .members-table th:nth-child(3),
  .members-table td:nth-child(3),
  .members-table th:nth-child(4),
  .members-table td:nth-child(4) {
    display: none;
  }

  .members-table .members-actions-column {
    min-width: 200px;
    width: 200px;
  }

  .members-actions .btn-sm {
    width: 28px;
    height: 28px;
    min-width: 28px;
  }

  .member-profile { padding: 20px; }

  .info-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .info-item,
  .account-credit-item,
  .quick-sale-item { grid-column: span 1; }
}

/* ---------- Mobile (max-width: 768px) ---------- */
@media (max-width: 768px) {
  .stats-grid,
  .subscription-stats-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid.portal-stats-grid { grid-template-columns: 1fr; }

  .stat-card {
    padding: 16px 20px;
  }

  .stat-icon {
    width: 44px;
    height: 44px;
    font-size: 18px;
  }

  .stat-info h3 {
    font-size: 24px;
  }

  /* Table */
  .table-container {
    padding: 8px;
    margin: 0 -8px;
    border-radius: 0;
  }

  .members-table {
    min-width: 480px;
  }

  .members-table th,
  .members-table td {
    padding: 8px 8px;
    font-size: 12px;
  }

  .members-table th:nth-child(5),
  .members-table td:nth-child(5),
  .members-table th:nth-child(6),
  .members-table td:nth-child(6) {
    display: none;
  }

  /* Mobile table column priorities */
  .portal-status-table th:nth-child(2),
  .portal-status-table td:nth-child(2),
  .portal-status-table th:nth-child(4),
  .portal-status-table td:nth-child(4) {
    display: none;
  }

  .portal-logins-table th:nth-child(4),
  .portal-logins-table td:nth-child(4),
  .portal-logins-table th:nth-child(5),
  .portal-logins-table td:nth-child(5) {
    display: none;
  }

  .today-workouts-table th:nth-child(1),
  .today-workouts-table td:nth-child(1),
  .today-workouts-table th:nth-child(5),
  .today-workouts-table td:nth-child(5),
  .today-workouts-table th:nth-child(6),
  .today-workouts-table td:nth-child(6),
  .today-workouts-table th:nth-child(7),
  .today-workouts-table td:nth-child(7) {
    display: none;
  }

  .portal-status-table { min-width: 560px; }
  .portal-logins-table { min-width: 460px; }
  .today-workouts-table { min-width: 520px; }

  .portal-table-scroll,
  .table-container,
  .tab-content {
    overscroll-behavior-x: contain;
    touch-action: pan-x pan-y;
  }

  .members-table .members-actions-column {
    min-width: 175px;
    width: 175px;
  }

  .members-table th:nth-child(1),
  .members-table td:nth-child(1) { width: 155px; }

  .members-table th:nth-child(2),
  .members-table td:nth-child(2) { width: 125px; }

  .members-actions {
    gap: 3px;
  }

  .members-actions .btn-sm {
    width: 26px;
    height: 26px;
    min-width: 26px;
    font-size: 10px;
  }

  .members-actions .btn {
    flex: 0 0 26px;
    width: 26px;
  }

  .members-delete-form { flex-basis: 26px; }

  /* Filter & Form */
  .filter-section {
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
    gap: 12px;
  }

  .filter-section form {
    flex-direction: column;
    width: 100%;
    gap: 8px;
  }

  .search-input,
  .filter-select {
    width: 100%;
    min-width: 0;
    padding: 14px 16px;
    font-size: 16px;
  }

  .filter-section .btn {
    width: 100%;
    justify-content: center;
  }

  .form-container {
    padding: 20px;
    max-width: none;
  }

  .form-control {
    width: 100%;
    padding: 12px;
    font-size: 16px;
  }

  /* Profile */
  .profile-header {
    flex-direction: column;
    text-align: center;
  }

  .profile-status { margin-left: 0; }

  .profile-avatar {
    margin-right: 0;
  }

  .info-grid {
    grid-template-columns: 1fr;
  }

  .member-profile {
    border-radius: var(--radius-sm);
    padding: 14px;
  }

  .pagination {
    justify-content: space-between;
    gap: 8px;
  }

  .pagination-summary { font-size: 11px; }

  .account-credit-item {
    grid-column: auto;
  }

  .quick-sale-item {
    grid-column: auto;
  }

  .payment-card-header {
    flex-direction: column;
  }

  .payment-mini-summary {
    text-align: left;
    width: 100%;
  }

  .credit-adjustment-panel {
    grid-template-columns: 1fr;
  }

  .credit-adjustment-row {
    align-items: stretch;
    flex-direction: column;
  }

  .credit-adjustment-row .btn {
    justify-content: center;
    width: 100%;
  }

  .quick-sale-grid,
  .recent-sales li {
    grid-template-columns: 1fr;
  }

  .recent-sales li {
    align-items: stretch;
  }

  .recent-sales form,
  .btn-icon-danger {
    width: 100%;
  }

  /* Actions */
  .member-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .btn-action {
    width: 100%;
    justify-content: center;
  }

  .row-actions {
    justify-content: flex-start;
  }

  .btn-group {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .btn-group .btn {
    width: 100%;
    justify-content: center;
  }

  .members-actions.btn-group .btn {
    flex: 0 0 26px;
    width: 26px;
  }

  /* Subscription */
  .subscription-row {
    align-items: stretch;
    grid-template-columns: 1fr 1fr;
  }

  .subscription-row .member-line,
  .subscription-row .row-actions {
    grid-column: 1 / -1;
  }

  .subscription-toolbar,
  .section-heading,
  .summary-actions,
  .summary-actions form {
    flex-direction: column;
    width: 100%;
  }

  .subscription-filters {
    flex-direction: column;
    width: 100%;
  }

  .subscription-filters .search-input,
  .subscription-filters .filter-select,
  .summary-actions select {
    width: 100%;
    min-width: 0;
  }

  .row-actions .btn-sm {
    flex: 1;
    max-width: 76px;
  }

  /* Payment */
  .payment-form {
    flex-direction: column;
    gap: 12px;
  }

  .payment-form input,
  .payment-form select {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    border-radius: 10px;
    border: 2px solid #d1d5db;
  }

  /* Login */
  .login-card {
    padding: 24px;
    margin: 16px;
  }

  .confirm-dialog {
    padding: 20px 24px;
  }

  /* Form inputs */
  .modal-content .form-control {
    width: 100%;
  }

  .form-container .btn,
  .modal-content .btn {
    width: 100%;
    justify-content: center;
    padding: 14px;
    font-size: 15px;
  }

  /* Enhanced mobile inputs */
  .search-input {
    padding: 16px 18px;
    font-size: 17px;
    border: 2.5px solid #d1d5db;
    border-radius: 14px;
    background: #f9fafb;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  }

  .search-input:focus {
    border-color: var(--secondary-color);
    background: #fff;
    box-shadow: 0 0 0 5px rgba(59, 130, 246, 0.15);
  }

  .search-input::placeholder {
    color: #a0aec0;
    font-size: 16px;
  }

  .filter-select {
    padding: 16px 44px 16px 18px;
    font-size: 16px;
    border: 2px solid #d1d5db;
    border-radius: 12px;
    background-color: #f9fafb;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236b7280' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 18px center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
  }

  .filter-select:focus {
    border-color: var(--secondary-color);
    background-color: #fff;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
  }

  .subscription-filters .search-input {
    padding: 16px 18px;
    font-size: 17px;
    border: 2.5px solid #d1d5db;
    border-radius: 14px;
    background: #f9fafb;
  }

  .subscription-filters .search-input:focus {
    border-color: var(--secondary-color);
    background: #fff;
    box-shadow: 0 0 0 5px rgba(59, 130, 246, 0.15);
  }

  .subscription-filters .filter-select,
  .summary-actions select {
    padding: 16px 44px 16px 18px;
    font-size: 16px;
    border: 2px solid #d1d5db;
    border-radius: 12px;
    background: #f9fafb;
  }

  .form-group {
    margin-bottom: 20px;
  }

  .form-group label {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-primary);
  }

  .form-control {
    padding: 14px 16px;
    font-size: 16px;
    border-radius: 10px;
    border: 2px solid #d1d5db;
  }

  /* Subscription row mobile */
  .subscription-row {
    gap: 14px;
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .subscription-row .metric-block,
  .subscription-row .member-line,
  .subscription-row .row-actions {
    grid-column: 1;
  }

  .member-line {
    grid-template-columns: 38px 1fr;
  }

  .member-avatar {
    height: 38px;
    width: 38px;
  }

  .metric-block {
    background: #f8fafc;
    border: 1px solid #eef2f7;
    border-radius: var(--radius-sm);
    padding: 10px 12px;
  }

  .row-actions .btn-sm {
    max-width: none;
  }
}

/* ---------- Small Mobile (max-width: 480px) ---------- */
@media (max-width: 480px) {
  .main-content {
    padding: 8px;
    padding-top: 52px;
  }

  .top-header {
    padding: 10px 14px;
    gap: 6px;
  }

  .login-header img { width: 160px; }

  .header-title h1 {
    font-size: 16px;
  }

  .btn {
    padding: 8px 12px;
    font-size: 11px;
  }

  .btn-sm {
    padding: 4px 8px;
    font-size: 10px;
  }

  .stats-grid {
    gap: 8px;
  }

  .stat-card {
    padding: 12px 14px;
  }

  .stat-icon {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }

  .stat-info h3 {
    font-size: 20px;
  }

  .stat-info p {
    font-size: 10px;
  }

  /* Minimal table */
  .members-table {
    min-width: 480px;
  }

  .members-table th,
  .members-table td {
    padding: 6px 6px;
    font-size: 11px;
  }

  .members-table .members-actions-column {
    min-width: 155px;
    width: 155px;
  }

  .members-actions .btn-sm {
    width: 24px;
    height: 24px;
    min-width: 24px;
    font-size: 9px;
  }

  .members-actions {
    gap: 2px;
  }

  .members-table th:nth-child(6),
  .members-table td:nth-child(6) {
    max-width: 100px;
    font-size: 10px;
  }

  /* Tabs */
  .tabs {
    gap: 0;
  }

  .tab {
    padding: 8px 12px;
    font-size: 12px;
  }

  .subscription-view-tabs .tab {
    flex: 1;
    justify-content: center;
    padding: 10px;
  }

  /* Workout log */
  .workout-log-grid {
    grid-template-columns: 1fr;
  }

  .workout-type-grid {
    grid-template-columns: 1fr 1fr;
  }

  /* Filter */
  .filter-section {
    padding: 10px;
    gap: 8px;
  }

  .search-input {
    padding: 12px 14px;
    font-size: 14px;
  }

  .filter-select {
    padding: 12px 14px;
    font-size: 14px;
  }
}

/* ==========================================
   NOTES TAB (Member View)
   ========================================== */
.notes-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.note-card {
    background: #f8f9fb;
    border-radius: 8px;
    padding: 12px 16px;
    border-left: 4px solid #10b981;  /* default workout */
}

.note-card-goal {
    border-left-color: #6366f1;       /* purple for goals */
}

.note-card-workout {
    border-left-color: #10b981;       /* green for workouts */
}

.note-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.note-card-title {
    color: var(--text-primary);
    font-weight: 700;
}

.note-card-date {
    color: var(--text-muted);
    font-size: 13px;
}

.note-card-content {
    color: var(--text-secondary);
    margin: 0;
    font-size: 14px;
}

.note-card-meta {
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

/* ==========================================
   GOALS TAB (Member View)
   ========================================== */
.goals-tab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.current-goal-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

/* ==========================================
   SUBSCRIPTION TAB (Member View)
   ========================================== */
.no-subscription-link {
    margin-left: 10px;
}
