/* ==========================================================================
   GYM SYSTEM — MODERN ENTERPRISE LIGHT THEME DESIGN SYSTEM
   Inspired by Reference Images 1 & 2:
   - Dark Slate Authoritative Sidebar (#0f172a)
   - Ultra-Clean Light Workspace (#f8fafc body, #ffffff cards, #e2e8f0 borders)
   - 6 Vibrant High-Impact KPI Blocks (Image 2 style)
   - High-Contrast Modern Typography (Plus Jakarta Sans)
   ========================================================================== */

:root {
  /* Layout Colors — Pure Light Workspace */
  --ff-bg-main: #f8fafc;
  --ff-bg-card: #ffffff;
  --ff-bg-card-hover: #f1f5f9;
  --ff-bg-sidebar: #0f172a;
  --ff-bg-topbar: #ffffff;
  --ff-bg-input: #ffffff;
  --ff-border: #e2e8f0;
  --ff-border-subtle: #f1f5f9;
  --ff-border-focus: #ff5722;
  
  /* Text Colors — High Contrast */
  --ff-text-main: #0f172a;
  --ff-text-sub: #334155;
  --ff-text-muted: #64748b;
  
  /* Brand Accents */
  --ff-primary: #ff5722;
  --ff-primary-hover: #ea580c;
  --ff-primary-gradient: linear-gradient(135deg, #ff6b00 0%, #ff3d00 100%);
  --ff-primary-glow: 0 4px 14px rgba(255, 87, 34, 0.25);
  
  /* Module Colors */
  --ff-accent-green: #10b981;
  --ff-accent-blue: #3b82f6;
  --ff-accent-purple: #8b5cf6;
  --ff-accent-amber: #f59e0b;
  --ff-accent-rose: #f43f5e;
  --ff-accent-cyan: #06b6d4;
  
  /* Radii & Shadows */
  --ff-radius-sm: 8px;
  --ff-radius-md: 12px;
  --ff-radius-lg: 16px;
  --ff-radius-pill: 50px;
  
  --ff-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --ff-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --ff-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.06), 0 4px 6px -4px rgba(0, 0, 0, 0.03);
  
  --ff-font-sans: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --ff-transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Body Reset */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  background-color: var(--ff-bg-main) !important;
  color: var(--ff-text-main) !important;
  font-family: var(--ff-font-sans) !important;
  font-size: 0.925rem;
  line-height: 1.55;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  min-height: 100vh;
}

/* Typography & Headings */
h1, h2, h3, h4, h5, h6 {
  color: var(--ff-text-main);
  font-weight: 700;
  letter-spacing: -0.015em;
}

.text-dark-main {
  color: #0f172a !important;
}

.text-muted {
  color: #64748b !important;
}

.text-sub {
  color: #334155 !important;
}

/* Layout Architecture */
.app-container {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* ══════════════════════════════════════════════════════════
   1. SLEEK DARK SIDEBAR (Image 1 & 2 Style)
   ══════════════════════════════════════════════════════════ */
.app-sidebar {
  width: 260px;
  background-color: var(--ff-bg-sidebar) !important;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: var(--ff-transition);
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 1020;
  padding: 1.25rem 0.85rem;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem 1.25rem;
  text-decoration: none;
}

.brand-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--ff-primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 1.15rem;
  box-shadow: var(--ff-primary-glow);
}

.brand-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: #ffffff !important;
  letter-spacing: -0.02em;
}

.brand-title span {
  color: var(--ff-primary);
}

/* User Card in Sidebar (Image 2 style) */
.sidebar-user-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem;
  margin: 0 0.25rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
}

.sidebar-user-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: #ffffff !important;
  line-height: 1.2;
}

.sidebar-user-role {
  font-size: 0.72rem;
  color: #94a3b8 !important;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 3px;
}

.online-indicator {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  display: inline-block;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25);
}

/* Navigation Menu */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  overflow-y: auto;
  flex: 1;
  padding-right: 0.25rem;
}

.nav-section-title {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b !important;
  padding: 0.85rem 0.75rem 0.35rem;
}

.nav-link-custom {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.65rem 0.95rem;
  color: #94a3b8 !important;
  font-weight: 500;
  border-radius: var(--ff-radius-pill);
  text-decoration: none;
  transition: var(--ff-transition);
  font-size: 0.9rem;
}

.nav-link-custom i {
  font-size: 1.05rem;
  width: 20px;
  text-align: center;
}

.nav-link-custom:hover {
  color: #ffffff !important;
  background-color: rgba(255, 255, 255, 0.07);
}

.nav-link-custom.active {
  background: var(--ff-primary-gradient) !important;
  color: #ffffff !important;
  font-weight: 700;
  box-shadow: var(--ff-primary-glow);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* ══════════════════════════════════════════════════════════
   2. CLEAN LIGHT TOPBAR (Image 1 Style)
   ══════════════════════════════════════════════════════════ */
.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background-color: var(--ff-bg-main);
}

.app-topbar {
  height: 68px;
  background-color: var(--ff-bg-topbar) !important;
  border-bottom: 1px solid var(--ff-border) !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.75rem;
  position: sticky;
  top: 0;
  z-index: 1010;
  box-shadow: var(--ff-shadow-sm);
}

.topbar-search {
  position: relative;
  width: 360px;
  max-width: 100%;
}

.topbar-search input {
  width: 100%;
  background-color: #f8fafc !important;
  border: 1px solid var(--ff-border) !important;
  border-radius: var(--ff-radius-pill);
  padding: 0.55rem 1.25rem 0.55rem 2.65rem;
  color: var(--ff-text-main) !important;
  font-size: 0.88rem;
  outline: none;
  transition: var(--ff-transition);
}

.topbar-search input:focus {
  background-color: #ffffff !important;
  border-color: var(--ff-primary) !important;
  box-shadow: 0 0 0 3px rgba(255, 87, 34, 0.12) !important;
}

.topbar-search i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 0.95rem;
}

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

.branch-select-pill {
  background: #ffffff !important;
  border: 1px solid var(--ff-border) !important;
  border-radius: var(--ff-radius-pill);
  padding: 0.45rem 1rem;
  color: #334155 !important;
  font-size: 0.84rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: var(--ff-transition);
}

.branch-select-pill:hover {
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}

.action-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #ffffff !important;
  border: 1px solid var(--ff-border) !important;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #475569 !important;
  cursor: pointer;
  position: relative;
  transition: var(--ff-transition);
  text-decoration: none;
}

.action-btn:hover {
  background: #f8fafc !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
}

.badge-pulse {
  position: absolute;
  top: 9px;
  right: 9px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 0 2px #ffffff;
}

.user-profile-widget {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.3rem 0.65rem;
  border-radius: var(--ff-radius-pill);
  cursor: pointer;
  text-decoration: none;
  border: 1px solid var(--ff-border);
  background: #ffffff;
  transition: var(--ff-transition);
}

.user-profile-widget:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.user-name {
  font-size: 0.86rem;
  font-weight: 700;
  color: #0f172a !important;
  line-height: 1.2;
}

.user-role {
  font-size: 0.72rem;
  color: #64748b !important;
}

.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.25rem;
  color: #334155;
  cursor: pointer;
  padding: 0.35rem 0.5rem;
}

.app-content {
  padding: 1.75rem;
}

/* ══════════════════════════════════════════════════════════
   3. THE 6 HIGH-IMPACT CORE MODULE KPI BLOCKS (Image 2 Style)
   ══════════════════════════════════════════════════════════ */
a.kpi-tile-block,
.kpi-tile-block {
  border-radius: 16px;
  padding: 1.4rem 1.5rem;
  color: #ffffff !important;
  position: relative;
  overflow: hidden;
  display: flex !important;
  flex-direction: column;
  justify-content: space-between;
  min-height: 155px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  text-decoration: none !important;
}

a.kpi-tile-block:hover,
.kpi-tile-block:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px -4px rgba(0, 0, 0, 0.15);
  color: #ffffff !important;
}

/* ══════════════════════════════════════════════════════════
   PRO★FIT COLORFUL MODULE SHOWCASE (Client Reference Style)
   ══════════════════════════════════════════════════════════ */
.module-showcase-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 18px;
  padding: 1.4rem 1rem 1.25rem;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  text-align: center;
  text-decoration: none !important;
  color: #1e293b !important;
  transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.03);
  position: relative;
  overflow: hidden;
}

.module-showcase-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 16px 32px -6px rgba(15, 23, 42, 0.12), 0 4px 8px -2px rgba(15, 23, 42, 0.04);
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}

.module-showcase-card .icon-wrap {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.85rem;
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.module-showcase-card:hover .icon-wrap {
  transform: scale(1.1);
}

.module-showcase-card .module-title {
  font-size: 1.08rem;
  font-weight: 800;
  color: #1e293b;
  letter-spacing: -0.01em;
  margin-bottom: 0.4rem;
  line-height: 1.2;
}

.module-showcase-card .module-pill {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s ease;
}

.kpi-tile-block .tile-content {
  position: relative;
  z-index: 2;
}

.kpi-tile-block .tile-label {
  font-size: 0.88rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.92;
  margin-bottom: 0.35rem;
}

.kpi-tile-block .tile-number {
  font-size: 2.15rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 0.4rem;
}

.kpi-tile-block .tile-sub {
  font-size: 0.78rem;
  opacity: 0.9;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.kpi-tile-block .tile-icon-circle {
  position: absolute;
  right: 1.4rem;
  top: 1.4rem;
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: #ffffff;
  z-index: 2;
  transition: all 0.25s ease;
  backdrop-filter: blur(4px);
}

.kpi-tile-block:hover .tile-icon-circle {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.08);
}

.kpi-tile-block .tile-footer-bar {
  position: relative;
  z-index: 2;
  padding-top: 0.75rem;
  margin-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 700;
}

/* 6 Distinct Vibrant Color Themes (Inspired by Image 2) */
/* 1. Member Management — Emerald Green */
a.kpi-tile-block.kpi-bg-emerald,
.kpi-bg-emerald {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%) !important;
  color: #ffffff !important;
}

/* 2. Membership — Royal Blue */
a.kpi-tile-block.kpi-bg-blue,
.kpi-bg-blue {
  background: linear-gradient(135deg, #1d4ed8 0%, #3b82f6 100%) !important;
  color: #ffffff !important;
}

/* 3. Staff Management — Vibrant Purple */
a.kpi-tile-block.kpi-bg-purple,
.kpi-bg-purple {
  background: linear-gradient(135deg, #6d28d9 0%, #8b5cf6 100%) !important;
  color: #ffffff !important;
}

/* 4. Attendance — Warm Amber */
a.kpi-tile-block.kpi-bg-amber,
.kpi-bg-amber {
  background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%) !important;
  color: #ffffff !important;
}

/* 5. Store & POS — Crimson Rose */
a.kpi-tile-block.kpi-bg-rose,
.kpi-bg-rose {
  background: linear-gradient(135deg, #be123c 0%, #f43f5e 100%) !important;
  color: #ffffff !important;
}

/* 6. Asset Management — Ocean Teal / Cyan */
a.kpi-tile-block.kpi-bg-cyan,
.kpi-bg-cyan {
  background: linear-gradient(135deg, #0e7490 0%, #06b6d4 100%) !important;
  color: #ffffff !important;
}

/* ══════════════════════════════════════════════════════════
   4. CLEAN WHITE OPERATIONAL CARDS (Image 1 Style)
   ══════════════════════════════════════════════════════════ */
.ff-card {
  background-color: var(--ff-bg-card) !important;
  border: 1px solid var(--ff-border) !important;
  border-radius: var(--ff-radius-lg);
  padding: 1.5rem;
  transition: var(--ff-transition);
  box-shadow: var(--ff-shadow-sm);
}

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

.ff-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.ff-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ff-text-main) !important;
  margin-bottom: 0;
}

/* Custom Buttons */
.btn-primary-ff {
  background: var(--ff-primary-gradient) !important;
  color: #ffffff !important;
  border: none !important;
  font-weight: 600;
  border-radius: var(--ff-radius-pill);
  padding: 0.55rem 1.35rem;
  box-shadow: var(--ff-primary-glow);
  transition: var(--ff-transition);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-primary-ff:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(255, 87, 34, 0.35);
  color: #ffffff !important;
}

.btn-secondary-ff {
  background: #f1f5f9 !important;
  color: #1e293b !important;
  border: 1px solid var(--ff-border) !important;
  font-weight: 600;
  border-radius: var(--ff-radius-pill);
  padding: 0.55rem 1.25rem;
  transition: var(--ff-transition);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-secondary-ff:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
}

/* ══════════════════════════════════════════════════════════
   5. TABLES, BADGES & AVATARS
   ══════════════════════════════════════════════════════════ */
.ff-table-wrap {
  overflow-x: auto;
  border-radius: var(--ff-radius-md);
  border: 1px solid var(--ff-border) !important;
  background-color: #ffffff;
}

.ff-table {
  width: 100%;
  margin-bottom: 0;
  color: #1e293b !important;
  border-collapse: collapse;
}

.ff-table th {
  background-color: #f8fafc !important;
  color: #64748b !important;
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.85rem 1.15rem;
  border-bottom: 1px solid var(--ff-border) !important;
}

.ff-table td {
  padding: 0.95rem 1.15rem;
  border-bottom: 1px solid #f1f5f9 !important;
  font-size: 0.9rem;
  vertical-align: middle;
  color: #1e293b !important;
}

.ff-table tbody tr:hover {
  background-color: #f8fafc !important;
}

/* Status Badges */
.badge-status {
  padding: 0.35rem 0.75rem;
  border-radius: var(--ff-radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.badge-status.active, .badge-status.paid, .badge-status.completed, .badge-status.present {
  background: #ecfdf5 !important;
  color: #059669 !important;
  border: 1px solid #a7f3d0 !important;
}

.badge-status.expiring_soon, .badge-status.partial, .badge-status.scheduled {
  background: #fffbeb !important;
  color: #d97706 !important;
  border: 1px solid #fde68a !important;
}

.badge-status.expired, .badge-status.unpaid, .badge-status.cancelled, .badge-status.absent {
  background: #fff1f2 !important;
  color: #e11d48 !important;
  border: 1px solid #fecdd3 !important;
}

/* Avatar Circle */
.avatar-circle {
  display: flex !important;
  align-items: center;
  justify-content: center;
  border-radius: 50% !important;
  font-weight: 700;
  color: #ffffff !important;
  text-transform: uppercase;
  flex-shrink: 0 !important;
  aspect-ratio: 1 / 1;
  min-width: 40px;
  max-width: 40px;
  width: 40px;
  height: 40px;
  min-height: 40px;
  max-height: 40px;
  font-size: 0.85rem;
  overflow: hidden;
  line-height: 1;
  padding: 0;
  margin: 0;
}

.avatar-circle.sm {
  min-width: 34px;
  max-width: 34px;
  width: 34px;
  height: 34px;
  min-height: 34px;
  max-height: 34px;
  font-size: 0.75rem;
}

.user-avatar-initials {
  width: 38px;
  max-width: 38px;
  height: 38px;
  max-height: 38px;
  border-radius: 50% !important;
  background: linear-gradient(135deg, #ff5722 0%, #ff8a65 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff !important;
  font-weight: 800;
  font-size: 0.88rem;
  flex-shrink: 0;
  overflow: hidden;
  object-fit: cover;
}

img.avatar-circle, img.user-avatar-initials {
  object-fit: cover !important;
}

.avatar-gradient-blue   { background: linear-gradient(135deg, #2563eb, #60a5fa) !important; }
.avatar-gradient-green  { background: linear-gradient(135deg, #059669, #34d399) !important; }
.avatar-gradient-gold   { background: linear-gradient(135deg, #d97706, #fbbf24) !important; }
.avatar-gradient-orange { background: linear-gradient(135deg, #ea580c, #fb923c) !important; }
.avatar-gradient-purple { background: linear-gradient(135deg, #7c3aed, #a78bfa) !important; }
.avatar-gradient-cyan   { background: linear-gradient(135deg, #0891b2, #22d3ee) !important; }

/* Forms & Modals */
.form-control-ff, .form-select-ff {
  background-color: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: var(--ff-radius-sm);
  color: var(--ff-text-main) !important;
  padding: 0.6rem 0.9rem;
  font-size: 0.9rem;
  outline: none;
  width: 100%;
  transition: var(--ff-transition);
}

.form-control-ff:focus, .form-select-ff:focus {
  border-color: var(--ff-primary) !important;
  box-shadow: 0 0 0 3px rgba(255, 87, 34, 0.12) !important;
}

.dropdown-menu {
  background-color: #ffffff !important;
  border: 1px solid var(--ff-border) !important;
  color: var(--ff-text-main) !important;
  box-shadow: var(--ff-shadow-lg) !important;
}

.dropdown-item {
  color: #334155 !important;
}

.dropdown-item:hover {
  background-color: #f1f5f9 !important;
  color: #0f172a !important;
}

/* ══════════════════════════════════════════════════════════
   6. RESPONSIVE MEDIA QUERIES
   ══════════════════════════════════════════════════════════ */
@media (max-width: 991px) {
  .app-sidebar {
    position: fixed;
    left: -280px;
    top: 0;
    bottom: 0;
    z-index: 1050;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  .app-sidebar.show {
    left: 0;
  }
  
  .sidebar-toggle {
    display: inline-block;
  }
  
  .sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.5);
    z-index: 1040;
    backdrop-filter: blur(2px);
  }
  
  .sidebar-overlay.show {
    display: block;
  }
  
  .topbar-search {
    display: none;
  }
}

@media (max-width: 768px) {
  .app-topbar {
    padding: 0 1rem;
    height: 60px;
  }
  
  .app-content {
    padding: 1rem;
  }
  
  .kpi-tile-block .tile-number {
    font-size: 1.75rem;
  }
}
