/* ========================================
   FitClub Design System v2.0
   Mobile-First | RTL | Professional
   ======================================== */

/* --- CSS Variables --- */
:root {
  --primary: #00b957;
  --primary-dark: #009a48;
  --primary-light: #e8f9f0;
  --primary-50: rgba(0,185,87,0.05);
  --primary-100: rgba(0,185,87,0.1);
  --primary-200: rgba(0,185,87,0.2);

  --secondary: #6c5ce7;
  --accent: #fd7e14;
  --danger: #e74c3c;
  --danger-light: #fdecea;
  --success: #00b957;
  --success-light: #e8f9f0;
  --warning: #f39c12;
  --warning-light: #fef9e7;
  --info: #17a2b8;
  --info-light: #e8f4f8;

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

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

  --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; }

/* --- 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.blue { background: #e8f4fd; color: #2196f3; }
.stat-icon.green { background: #e8f9f0; color: var(--primary); }
.stat-icon.orange { background: #fff3e0; color: #ff9800; }
.stat-icon.red { background: #fdecea; color: var(--danger); }
.stat-icon.purple { background: #f3e8fd; color: #9c27b0; }
.stat-icon.teal { background: #e0f2f1; color: #009688; }

.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: #009a48; color: #fff; }

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

.btn-warning { background: var(--warning); color: #fff; }
.btn-warning:hover { background: #e08e0b; 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-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: #15803d; }
.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: #15803d; border: 1px solid #bbf7d0; }
.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: #0e7490; border: 1px solid #a5f3fc; }

.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-green { background: var(--success-light); }
.bg-blue { background: #e8f4fd; }
.bg-orange { background: #fff3e0; }
.bg-red { 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, #f0faf4 0%, #e8f9f0 50%, #d1fae5 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); }

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