/* ══════════════════════════════════════════════════════════════════
   Crystal Core Gym Management System — Main Stylesheet
   Shared across all pages. Supports dark/light theme + RTL/LTR.
   ══════════════════════════════════════════════════════════════════ */

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

/* ── 1. CSS Variables — Dark (default) ─────────────────────── */
:root {
  /* Brand */
  --primary:        #FF6B35;
  --primary-light:  rgba(255,107,53,0.12);
  --primary-dark:   #E55A22;

  /* Status */
  --success:        #00C9A7;
  --success-light:  rgba(0,201,167,0.12);
  --warning:        #F59E0B;
  --warning-light:  rgba(245,158,11,0.12);
  --danger:         #F43F5E;
  --danger-light:   rgba(244,63,94,0.12);
  --info:           #3B82F6;
  --info-light:     rgba(59,130,246,0.12);
  --purple:         #8B5CF6;
  --purple-light:   rgba(139,92,246,0.12);
  --pink:           #EC4899;
  --teal:           #14B8A6;
  --navy:           #1E3A5F;

  /* Backgrounds */
  --bg:             #0D1520;
  --bg-card:        #1A2332;
  --bg-card2:       #141D2A;
  --bg-input:       #0D1520;
  --bg-hover:       rgba(255,255,255,0.04);

  /* Borders */
  --border:         rgba(255,255,255,0.08);
  --border-light:   rgba(255,255,255,0.14);
  --border-focus:   var(--primary);

  /* Text */
  --text:           #E2E8F0;
  --text-muted:     #64748B;
  --text-light:     #94A3B8;

  /* Layout */
  --sidebar-w:      240px;
  --header-h:       60px;

  /* Misc */
  --radius:         12px;
  --radius-sm:      8px;
  --radius-lg:      18px;
  --shadow:         0 4px 24px rgba(0,0,0,0.35);
  --shadow-sm:      0 2px 8px rgba(0,0,0,0.25);
  --shadow-card:    0 1px 4px rgba(0,0,0,0.3);
  --transition:     0.2s ease;
}

/* ── 2. Light Theme ──────────────────────────────────────────── */
[data-theme="light"] {
  --bg:             #F1F5F9;
  --bg-card:        #FFFFFF;
  --bg-card2:       #F8FAFC;
  --bg-input:       #F8FAFC;
  --bg-hover:       rgba(0,0,0,0.04);

  --border:         #E2E8F0;
  --border-light:   #CBD5E1;

  --text:           #1E293B;
  --text-muted:     #64748B;
  --text-light:     #94A3B8;

  --shadow:         0 2px 16px rgba(0,0,0,0.10);
  --shadow-sm:      0 1px 4px rgba(0,0,0,0.07);
  --shadow-card:    0 1px 3px rgba(0,0,0,0.08);
}

/* ── 3. Reset ────────────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  transition: background var(--transition), color var(--transition);
  -webkit-font-smoothing: antialiased;
}
body.ar {
  font-family: 'Cairo', sans-serif;
  direction: rtl;
  text-align: right;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: 14px; }
ul { list-style: none; }
table { border-collapse: collapse; width: 100%; }

/* ── 4. App Wrapper & Layout ────────────────────────────────── */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* ── 5. Sidebar ──────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: #1a3c5e;
  border-right: none;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 200;
  overflow-y: auto;
  overflow-x: hidden;
  transition: transform var(--transition);
}
body.ar .sidebar {
  left: auto; right: 0;
  border-right: none;
  border-left: none;
}
.sidebar::-webkit-scrollbar { width: 3px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 2px; }

.sidebar-brand {
  padding: 16px 18px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.sidebar-logo {
  width: 36px; height: 36px;
  background: rgba(255,255,255,0.15);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.sidebar-gym-name { font-size: 0.92rem; font-weight: 700; color: #fff; line-height: 1.2; letter-spacing: 0.2px; }
.sidebar-gym-sub  { font-size: 0.65rem; color: rgba(255,255,255,0.55); }

.sidebar-nav { padding: 8px 0; flex: 1; }

.nav-section {
  font-size: 0.6rem; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: rgba(255,255,255,0.45);
  padding: 12px 18px 4px;
  margin-top: 4px;
}

.sidebar-link {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 18px;
  border-radius: 0;
  color: rgba(255,255,255,0.8);
  font-size: 0.82rem; font-weight: 400;
  transition: all var(--transition);
  cursor: pointer;
  margin: 0;
  white-space: nowrap;
  text-decoration: none;
  border-left: 3px solid transparent;
}
.sidebar-link:hover { background: rgba(255,255,255,0.08); color: #fff; border-left-color: transparent; }
.sidebar-link.active {
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-weight: 600;
  border-left-color: #5dade2;
  padding-left: 15px;
}
body.ar .sidebar-link { border-left: none; border-right: 3px solid transparent; }
body.ar .sidebar-link.active { border-right-color: #5dade2; padding-left: 18px; padding-right: 15px; }
.sidebar-link .s-icon { font-size: 0.95rem; width: 18px; text-align: center; flex-shrink: 0; }
.sidebar-link .s-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff; font-size: 0.6rem; font-weight: 700;
  padding: 1px 5px; border-radius: 20px;
}
body.ar .sidebar-link .s-badge { margin-left: 0; margin-right: auto; }

.sidebar-footer {
  padding: 12px 18px;
  border-top: 1px solid rgba(255,255,255,0.15);
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0;
}
.sf-avatar {
  width: 30px; height: 30px;
  background: rgba(255,255,255,0.15);
  border: none;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.sf-name { font-size: 0.78rem; font-weight: 600; color: #fff; }
.sf-role { font-size: 0.62rem; color: rgba(255,255,255,0.5); }

/* ── 6. Main Content ─────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
body.ar .main-content { margin-left: 0; margin-right: var(--sidebar-w); }

/* ── 7. Header ───────────────────────────────────────────────── */
.app-header {
  position: sticky; top: 0;
  height: var(--header-h);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  display: flex; align-items: center;
  padding: 0 20px;
  gap: 12px;
  z-index: 100;
}
.header-title    { font-size: 1rem; font-weight: 700; color: var(--text); }
.header-title-ar { font-size: 0.85rem; color: var(--text-muted); font-family: 'Cairo', sans-serif; margin-left: 6px; }
.header-subtitle { font-size: 0.72rem; color: var(--text-muted); }
.header-spacer   { flex: 1; }
.header-actions  { display: flex; align-items: center; gap: 8px; }

.hdr-icon-btn {
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-light);
  font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
  position: relative; cursor: pointer;
}
.hdr-icon-btn:hover { color: var(--text); border-color: var(--border-light); }

.lang-toggle-bar {
  display: flex;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden; font-size: 0.72rem; font-weight: 700;
}
.lang-toggle-bar button {
  padding: 5px 10px; color: var(--text-muted); transition: all var(--transition);
}
.lang-toggle-bar button.active { background: var(--primary); color: #fff; }

.theme-btn {
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-light); font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all var(--transition);
}
.theme-btn:hover { color: var(--primary); border-color: var(--primary); }

.profile-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 10px 4px 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer; transition: all var(--transition);
}
.profile-chip:hover { border-color: var(--border-light); }
.profile-chip-avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--primary-light);
  border: 1px solid var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.65rem; font-weight: 700; color: var(--primary);
}
.profile-chip-name { font-size: 0.78rem; font-weight: 600; color: var(--text); }

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

.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; flex-wrap: wrap; gap: 10px;
}
.page-title    { font-size: 1.3rem; font-weight: 800; color: var(--text); }
.page-subtitle { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }

.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.section-title {
  font-size: 0.9rem; font-weight: 700; color: var(--text);
  display: flex; align-items: center; gap: 6px;
}

/* ── 9. KPI Cards ────────────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  transition: all var(--transition);
  cursor: default;
}
.kpi-card:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.kpi-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; flex-shrink: 0;
}
/* KPI icon color variants */
.kpi-orange { background: rgba(255,107,53,0.14); }
.kpi-green  { background: rgba(0,201,167,0.14);  }
.kpi-red    { background: rgba(244,63,94,0.14);  }
.kpi-blue   { background: rgba(59,130,246,0.14); }
.kpi-yellow { background: rgba(245,158,11,0.14); }
.kpi-teal   { background: rgba(20,184,166,0.14); }
.kpi-purple { background: rgba(139,92,246,0.14); }
.kpi-navy   { background: rgba(30,58,95,0.4);    }
.kpi-pink   { background: rgba(236,72,153,0.14); }

.kpi-info      { flex: 1; min-width: 0; }
.kpi-value     { font-size: 1.5rem; font-weight: 900; color: var(--text); line-height: 1.1; }
.kpi-label     { font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }
.kpi-change    { font-size: 0.68rem; font-weight: 600; margin-top: 4px; }
.kpi-change.up   { color: var(--success); }
.kpi-change.down { color: var(--danger);  }

/* ── 10. Cards ───────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.card-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap;
}
.card-title    { font-size: 0.88rem; font-weight: 700; color: var(--text); }
.card-subtitle { font-size: 0.72rem; color: var(--text-muted); }
.card-body     { padding: 18px; }
.card-footer   {
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  background: var(--bg-card2);
}

/* ── 11. Tables ──────────────────────────────────────────────── */
.table-wrapper {
  overflow-x: auto;
}
.table-wrapper::-webkit-scrollbar { height: 4px; }

table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
thead th {
  background: var(--bg-card2);
  color: var(--text-muted);
  font-weight: 700; font-size: 0.7rem;
  text-transform: uppercase; letter-spacing: 0.05em;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody tr { border-bottom: 1px solid var(--border); transition: background var(--transition); }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--bg-hover); }
td { padding: 11px 14px; color: var(--text); vertical-align: middle; }
tfoot td {
  padding: 10px 14px;
  background: var(--bg-card2);
  font-weight: 700; font-size: 0.82rem;
  border-top: 2px solid var(--border-light);
}

/* ── 12. Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem; font-weight: 600;
  transition: all var(--transition);
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 2px 10px rgba(255,107,53,0.3);
}
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }

.btn-ghost {
  background: var(--bg-card2);
  color: var(--text);
  border-color: var(--border-light);
}
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }

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

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

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

.btn-info {
  background: var(--info-light);
  color: var(--info); border-color: var(--info);
}
.btn-info:hover { background: var(--info); color: #fff; }

.btn-sm { padding: 5px 12px; font-size: 0.75rem; border-radius: 6px; }
.btn-lg { padding: 12px 24px; font-size: 0.9rem; }
.btn-xl { padding: 14px 32px; font-size: 1rem; border-radius: var(--radius); }
.btn-block { width: 100%; justify-content: center; }

/* ── 13. Badges ──────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 0.68rem; font-weight: 700;
  white-space: nowrap;
  vertical-align: middle;
}
.badge::before {
  content: ''; width: 5px; height: 5px;
  border-radius: 50%; background: currentColor;
  flex-shrink: 0;
}

.badge-success, .badge.Active    { background: var(--success-light); color: var(--success); }
.badge-danger,  .badge.Expired   { background: var(--danger-light);  color: var(--danger);  }
.badge-warning, .badge.Pending   { background: var(--warning-light); color: var(--warning); }
.badge-info,    .badge.Frozen    { background: var(--info-light);    color: var(--info);    }
.badge-purple,  .badge.Suspended { background: var(--purple-light);  color: var(--purple);  }
.badge-primary                   { background: var(--primary-light); color: var(--primary); }
.badge-secondary {
  background: var(--bg-hover);
  color: var(--text-light);
  border: 1px solid var(--border-light);
}
.badge-secondary::before { display: none; }

/* ── 14. Forms ───────────────────────────────────────────────── */
.form-group { margin-bottom: 14px; }
.form-group label {
  display: block; margin-bottom: 5px;
  font-size: 0.78rem; font-weight: 600;
  color: var(--text-muted);
}
.form-control {
  width: 100%;
  padding: 8px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.82rem;
  transition: border var(--transition), box-shadow var(--transition);
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.form-control::placeholder { color: var(--text-muted); }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 80px; }

.form-grid {
  display: grid;
  gap: 12px;
}
.form-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

/* ── 15. Search Bar ──────────────────────────────────────────── */
.search-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.search-input-wrapper {
  position: relative; display: flex; align-items: center;
}
.search-icon {
  position: absolute; left: 12px;
  font-size: 0.9rem; color: var(--text-muted);
  pointer-events: none;
}
body.ar .search-icon { left: auto; right: 12px; }
.search-input {
  padding-left: 36px !important;
}
body.ar .search-input { padding-left: 12px !important; padding-right: 36px !important; }

/* ── 16. Modals ──────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(4px);
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  width: 100%; max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
  animation: modalIn 0.2s ease;
}
.modal-sm { max-width: 420px; }
.modal-lg { max-width: 760px; }
.modal-xl { max-width: 960px; }

@keyframes modalIn {
  from { opacity: 0; transform: translateY(-16px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-size: 0.95rem; font-weight: 800; color: var(--text); }
.modal-close {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--bg-hover); color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; cursor: pointer; transition: all var(--transition);
}
.modal-close:hover { background: var(--danger-light); color: var(--danger); }

.modal-body   { padding: 20px 22px; }
.modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 8px;
  flex-wrap: wrap;
}

/* ── 17. Toast Notifications ─────────────────────────────────── */
#toastContainer {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 999;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
body.ar #toastContainer { right: auto; left: 24px; }

.toast {
  min-width: 260px; max-width: 360px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem; font-weight: 600;
  box-shadow: var(--shadow);
  pointer-events: all;
  animation: toastIn 0.3s ease;
  display: flex; align-items: center; gap: 10px;
}
.toast-success { background: var(--success); color: #fff; }
.toast-danger  { background: var(--danger);  color: #fff; }
.toast-warning { background: var(--warning); color: #fff; }
.toast-info    { background: var(--info);    color: #fff; }
@keyframes toastIn { from { opacity:0; transform:translateX(20px); } to { opacity:1; transform:translateX(0); } }

/* ── 18. Alerts ──────────────────────────────────────────────── */
.alert {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  margin-bottom: 10px;
  border: 1px solid;
  display: flex; align-items: flex-start; gap: 8px;
}
.alert-warning { background: var(--warning-light); color: var(--warning); border-color: rgba(245,158,11,0.25); }
.alert-danger  { background: var(--danger-light);  color: var(--danger);  border-color: rgba(244,63,94,0.25); }
.alert-success { background: var(--success-light); color: var(--success); border-color: rgba(0,201,167,0.25); }
.alert-info    { background: var(--info-light);    color: var(--info);    border-color: rgba(59,130,246,0.25); }

/* ── 19. Member Cell ─────────────────────────────────────────── */
.member-cell { display: flex; align-items: center; gap: 10px; }
.member-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--primary-light);
  border: 2px solid var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.78rem; font-weight: 700; color: var(--primary);
  flex-shrink: 0;
}
.member-avatar.female {
  background: rgba(236,72,153,0.12);
  border-color: var(--pink);
  color: var(--pink);
}
.member-name { font-size: 0.83rem; font-weight: 600; color: var(--text); }
.member-id   { font-size: 0.7rem; color: var(--text-muted); }

/* Member Cards */
.member-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  transition: all var(--transition);
}
.member-card:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); }
.member-card-avatar {
  width: 60px; height: 60px;
  border-radius: 50%;
  background: var(--primary-light);
  border: 3px solid var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; font-weight: 800; color: var(--primary);
  margin: 0 auto 10px;
}
.member-card .member-name { margin-bottom: 6px; }

/* ── 20. Coach Avatar ────────────────────────────────────────── */
.coach-avatar {
  width: 64px; height: 64px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; font-weight: 800;
  margin: 0 auto 8px;
}

/* ── 21. Stat Row ────────────────────────────────────────────── */
.stat-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
}
.stat-row:last-child { border-bottom: none; }
.stat-label { color: var(--text-muted); }

/* ── 22. Progress Bar ────────────────────────────────────────── */
.progress-bar {
  height: 5px;
  background: var(--border);
  border-radius: 20px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 20px;
  transition: width 0.5s ease;
}
.capacity-label {
  display: flex; justify-content: space-between;
  font-size: 0.78rem; color: var(--text); margin-bottom: 4px;
}

/* ── 23. Timeline ────────────────────────────────────────────── */
.timeline-list { list-style: none; }
.timeline-item {
  display: flex; gap: 12px; padding-bottom: 16px;
  position: relative;
}
.timeline-item::before {
  content: '';
  position: absolute; left: 16px; top: 32px;
  width: 2px; bottom: 0;
  background: var(--border);
}
.timeline-item:last-child::before { display: none; }
body.ar .timeline-item::before { left: auto; right: 16px; }

.timeline-dot {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--bg-card2);
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem; flex-shrink: 0;
}
.timeline-content { flex: 1; }
.timeline-text { font-size: 0.82rem; color: var(--text); }
.timeline-time { font-size: 0.7rem; color: var(--text-muted); margin-top: 2px; }

/* ── 24. Quick Actions Grid ──────────────────────────────────── */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
}
.quick-btn {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 14px 10px;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
  text-decoration: none;
}
.quick-btn:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: translateY(-2px);
}
.qicon { font-size: 1.5rem; }
.qlabel {
  font-size: 0.68rem; font-weight: 600;
  color: var(--text-muted); line-height: 1.3;
}
.quick-btn:hover .qlabel { color: var(--primary); }

/* ── 25. Offer Cards ─────────────────────────────────────────── */
.offer-card {
  border-radius: var(--radius);
  padding: 16px 20px;
  color: #fff;
  position: relative; overflow: hidden;
  margin-bottom: 10px;
}
.offer-card::after {
  content: '◉';
  position: absolute; right: -16px; bottom: -24px;
  font-size: 100px; opacity: 0.08; color: #fff;
}
.offer-title    { font-size: 0.88rem; font-weight: 700; }
.offer-discount { font-size: 2rem; font-weight: 900; line-height: 1.1; margin-top: 6px; }
.offer-valid    { font-size: 0.7rem; opacity: 0.75; }

/* ── 26. Chart Wrapper ───────────────────────────────────────── */
.chart-wrapper {
  position: relative;
  height: 220px;
  width: 100%;
}

/* ── 27. Check-in Panel ──────────────────────────────────────── */
.checkin-result-card {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  margin-top: 12px;
  transition: all var(--transition);
}
.checkin-result-card.ok   { border-color: var(--success); background: var(--success-light); }
.checkin-result-card.warn { border-color: var(--warning); background: var(--warning-light); }
.checkin-result-card.err  { border-color: var(--danger);  background: var(--danger-light);  }

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

/* ── 29. Utility Classes ─────────────────────────────────────── */
.text-muted    { color: var(--text-muted) !important; }
.text-light    { color: var(--text-light) !important; }
.text-success  { color: var(--success) !important; }
.text-danger   { color: var(--danger) !important; }
.text-primary  { color: var(--primary) !important; }
.text-warning  { color: var(--warning) !important; }
.text-small    { font-size: 0.72rem; }
.text-center   { text-align: center; }
.fw-bold       { font-weight: 700; }
.fw-black      { font-weight: 900; }
.mb-4  { margin-bottom: 4px; }
.mb-8  { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mb-24 { margin-bottom: 24px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.flex  { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.d-none { display: none; }

/* ── 30. Salary Slip ─────────────────────────────────────────── */
.salary-slip {
  background: #fff;
  color: #1E293B;
  padding: 28px;
  border-radius: var(--radius);
}
[data-theme="dark"] .salary-slip { background: var(--bg-card2); color: var(--text); }
.slip-header { text-align: center; margin-bottom: 20px; padding-bottom: 16px; border-bottom: 2px solid var(--border); }
.slip-logo   { font-size: 1.3rem; font-weight: 900; color: var(--primary); }
.slip-table  { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.slip-table td { padding: 8px 12px; border-bottom: 1px solid var(--border); }
.slip-table tr:nth-child(even) td { background: var(--bg-hover); }
.slip-total-row td { background: var(--primary) !important; color: #fff !important; font-weight: 800; }

/* ── 31. Responsive ──────────────────────────────────────────── */
@media (max-width: 1024px) {
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
  .form-grid-3 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  .sidebar { transform: translateX(-100%); }
  body.ar .sidebar { transform: translateX(100%); }
  .sidebar.mobile-open { transform: none; width: 240px; }
  .main-content { margin-left: 0 !important; margin-right: 0 !important; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .form-grid-3 { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .search-bar  { flex-direction: column; align-items: stretch; }
  .charts-row  { grid-template-columns: 1fr !important; }
  .charts-row-2 { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .modal-xl, .modal-lg { max-width: 100%; }
  .page-content { padding: 12px; }
}

/* ── 32. Print ───────────────────────────────────────────────── */
@media print {
  .sidebar, .app-header, .no-print { display: none !important; }
  .main-content { margin: 0; }
  .page-content { padding: 0; }
  body { background: #fff; color: #000; }
  .card { border: 1px solid #ddd; box-shadow: none; break-inside: avoid; }
  thead th { background: #f0f0f0; }
}

/* ── 33. Scrollbar ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }

/* ── 34. Animations ──────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp 0.3s ease; }
