/* =========================================
   MUZ MEMBERSHIP SYSTEM - STYLES
   ========================================= */

:root {
  --primary: #1a56db;
  --primary-light: #3b82f6;
  --primary-dark: #1e3a8a;
  --secondary: #7c3aed;
  --accent: #f59e0b;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #06b6d4;

  --bg-dark: #0f172a;
  --bg-card: rgba(255,255,255,0.06);
  --bg-card-hover: rgba(255,255,255,0.1);
  --border: rgba(255,255,255,0.1);
  --border-light: rgba(255,255,255,0.05);

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --sidebar-w: 260px;
  --sidebar-w-collapsed: 72px;
  --topbar-h: 64px;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 8px 32px rgba(0,0,0,0.4);
  --shadow-sm: 0 4px 16px rgba(0,0,0,0.2);

  --transition: all 0.25s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* SCROLLBAR */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }

/* =========================================
   GLASS EFFECT
   ========================================= */
.glass {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
}

/* =========================================
   UTILITIES
   ========================================= */
.hidden { display: none !important; }

/* =========================================
   LOGIN PAGE
   ========================================= */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 40%, #0f172a 100%);
  overflow: hidden;
}

.login-bg-shapes .shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.15;
  animation: float 8s ease-in-out infinite;
}
.shape-1 { width: 500px; height: 500px; background: var(--primary); top: -100px; left: -100px; animation-delay: 0s; }
.shape-2 { width: 400px; height: 400px; background: var(--secondary); bottom: -80px; right: -80px; animation-delay: 3s; }
.shape-3 { width: 300px; height: 300px; background: var(--info); top: 50%; left: 50%; transform: translate(-50%,-50%); animation-delay: 1.5s; }

@keyframes float {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-30px) scale(1.05); }
}

.login-card {
  width: 420px;
  max-width: 95vw;
  border-radius: 24px;
  padding: 48px 40px;
  position: relative;
  z-index: 10;
  animation: slideUp 0.6s ease;
}

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

.login-logo {
  text-align: center;
  margin-bottom: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.logo-circle {
  width: 80px; height: 80px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
  font-size: 32px;
  color: white;
  box-shadow: 0 8px 24px rgba(26,86,219,0.4);
  animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 8px 24px rgba(26,86,219,0.4); }
  50% { box-shadow: 0 8px 40px rgba(26,86,219,0.7); }
}

.logo-circle.small {
  width: 40px; height: 40px;
  font-size: 16px;
  margin: 0;
  box-shadow: none;
  animation: none;
  flex-shrink: 0;
}

.login-logo h1 {
  font-size: 36px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary-light), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 4px;
}

.login-logo p {
  color: var(--text-secondary);
  font-size: 13px;
  margin-top: 4px;
}

.login-subtitle {
  display: inline-block;
  background: rgba(26,86,219,0.2);
  color: var(--primary-light);
  border: 1px solid rgba(26,86,219,0.3);
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-top: 8px;
}

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

.login-form label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.login-form label i { margin-right: 6px; }

.login-form input {
  width: 100%;
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  transition: var(--transition);
  outline: none;
}

.login-form input:focus {
  border-color: var(--primary-light);
  background: rgba(59,130,246,0.08);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}

.password-wrap { position: relative; }
.password-wrap input { padding-right: 44px; }
.toggle-pw {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--text-muted); cursor: pointer;
  padding: 4px;
}
.toggle-pw:hover { color: var(--text-primary); }

.login-options {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px; font-size: 13px;
}

.remember-me {
  display: flex; align-items: center; gap: 8px;
  color: var(--text-secondary); cursor: pointer;
}

.remember-me input { width: auto; }
.forgot-link { color: var(--primary-light); text-decoration: none; }
.forgot-link:hover { text-decoration: underline; }

.btn-login {
  width: 100%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white; border: none;
  border-radius: var(--radius-sm);
  padding: 14px;
  font-size: 15px; font-weight: 600;
  cursor: pointer; transition: var(--transition);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-family: 'Inter', sans-serif;
}

.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(26,86,219,0.4);
}

.divider {
  text-align: center; margin: 20px 0;
  position: relative;
  color: var(--text-muted); font-size: 12px;
}
.divider::before {
  content: '';
  position: absolute; top: 50%; left: 0; right: 0;
  height: 1px; background: var(--border);
}
.divider span {
  background: transparent;
  padding: 0 12px;
  position: relative;
}

.btn-google {
  width: 100%;
  background: rgba(255,255,255,0.06);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 13px;
  font-size: 14px; font-weight: 500;
  cursor: pointer; transition: var(--transition);
  display: flex; align-items: center; justify-content: center; gap: 10px;
  font-family: 'Inter', sans-serif;
}
.btn-google:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.2); }

.login-footer {
  text-align: center;
  margin-top: 32px;
  font-size: 12px;
  color: var(--text-muted);
}

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

/* SIDEBAR */
.sidebar {
  width: var(--sidebar-w);
  background: rgba(15,23,42,0.95);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: width 0.3s ease;
  overflow: hidden;
}

.sidebar.collapsed { width: var(--sidebar-w-collapsed); }
.sidebar.collapsed .sidebar-title,
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .nav-section-label,
.sidebar.collapsed .nav-badge,
.sidebar.collapsed .user-info { display: none; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 12px; }
.sidebar.collapsed .sidebar-header { justify-content: center; }

.sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  min-height: var(--topbar-h);
  gap: 8px;
}

.sidebar-logo {
  display: flex; align-items: center; gap: 10px; overflow: hidden; flex: 1; min-width: 0;
}

.sidebar-title { overflow: hidden; }
.brand-name {
  display: block;
  font-size: 18px; font-weight: 800;
  background: linear-gradient(135deg, var(--primary-light), var(--secondary));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; letter-spacing: 2px;
  white-space: nowrap;
}
.brand-sub {
  display: block;
  font-size: 10px; color: var(--text-muted);
  white-space: nowrap; margin-top: 1px;
}

.sidebar-toggle {
  background: none; border: none; color: var(--text-secondary);
  cursor: pointer; padding: 6px; border-radius: 6px;
  transition: var(--transition); flex-shrink: 0;
}
.sidebar-toggle:hover { background: var(--bg-card); color: var(--text-primary); }

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

.nav-section-label {
  font-size: 10px; font-weight: 700;
  color: var(--text-muted); letter-spacing: 1.5px;
  padding: 12px 10px 6px;
  white-space: nowrap;
}

.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  font-size: 14px; font-weight: 500;
  position: relative;
  margin-bottom: 2px;
  white-space: nowrap;
}

.nav-item i { width: 18px; text-align: center; flex-shrink: 0; font-size: 15px; }

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

.nav-item.active {
  background: linear-gradient(135deg, rgba(26,86,219,0.3), rgba(124,58,237,0.2));
  color: var(--primary-light);
  border: 1px solid rgba(26,86,219,0.2);
}

.nav-badge {
  margin-left: auto;
  background: rgba(26,86,219,0.3);
  color: var(--primary-light);
  border-radius: 10px;
  padding: 2px 7px;
  font-size: 11px; font-weight: 700;
  flex-shrink: 0;
}
.nav-badge.pulse { background: rgba(245,158,11,0.25); color: var(--warning); animation: badge-pulse 2s infinite; }
.nav-badge.success { background: rgba(16,185,129,0.2); color: var(--success); }

@keyframes badge-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
}

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

.user-avatar {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  flex-shrink: 0;
}

.user-info { flex: 1; overflow: hidden; }
.user-name { display: block; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { display: block; font-size: 11px; color: var(--text-muted); }

.logout-btn {
  background: none; border: none;
  color: var(--text-muted); cursor: pointer;
  padding: 6px; border-radius: 6px;
  transition: var(--transition);
}
.logout-btn:hover { color: var(--danger); background: rgba(239,68,68,0.1); }

/* MAIN CONTENT */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left 0.3s ease;
}

.sidebar.collapsed ~ .main-content { margin-left: var(--sidebar-w-collapsed); }

/* TOPBAR */
.topbar {
  height: var(--topbar-h);
  background: rgba(15,23,42,0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 24px;
  position: sticky; top: 0; z-index: 50;
  gap: 16px;
}

.topbar-left {
  display: flex; align-items: center; gap: 16px;
  flex: 1;
}

.mobile-menu-btn {
  display: none;
  background: none; border: none; color: var(--text-secondary);
  cursor: pointer; padding: 6px; font-size: 18px;
}

.breadcrumb {
  font-size: 18px; font-weight: 700;
  color: var(--text-primary);
}

.topbar-right {
  display: flex; align-items: center; gap: 12px;
}

.search-global {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px 6px 6px 14px;
  width: 280px;
  transition: var(--transition);
}
.search-global:focus-within {
  border-color: var(--primary-light);
  background: rgba(59,130,246,0.08);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}
.search-global-icon { color: var(--text-muted); font-size: 13px; flex-shrink: 0; }
.search-global input {
  background: none; border: none;
  color: var(--text-primary); font-size: 13px;
  outline: none; flex: 1; min-width: 0; width: 100%;
  font-family: 'Inter', sans-serif;
}
.search-global input::placeholder { color: var(--text-muted); }
.search-global-btn {
  background: var(--primary);
  border: none; border-radius: 7px;
  color: white; cursor: pointer;
  padding: 5px 14px; font-size: 12px; font-weight: 600;
  font-family: 'Inter', sans-serif;
  white-space: nowrap; flex-shrink: 0;
  transition: var(--transition);
}
.search-global-btn:hover { background: var(--primary-light); }

.icon-btn {
  width: 36px; height: 36px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text-secondary);
  cursor: pointer; transition: var(--transition);
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.icon-btn:hover { background: var(--bg-card-hover); color: var(--text-primary); }

.notif-dot {
  position: absolute; top: 6px; right: 6px;
  width: 7px; height: 7px;
  background: var(--danger); border-radius: 50%;
}

.topbar-avatar {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; cursor: pointer;
}

/* PAGE AREA */
.page-area {
  flex: 1;
  padding: 28px 28px 40px;
  overflow-y: auto;
}

.page { display: none; animation: fadeIn 0.3s ease; }
.page.active { display: block; }

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

.page-header {
  margin-bottom: 28px;
}
.page-header h2 {
  font-size: 26px; font-weight: 800;
  background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.page-header p {
  color: var(--text-muted); font-size: 14px; margin-top: 4px;
}

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

.stat-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  transition: var(--transition);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 3px;
}
.stat-card.blue::before { background: linear-gradient(90deg, var(--primary), var(--primary-light)); }
.stat-card.green::before { background: linear-gradient(90deg, var(--success), #34d399); }
.stat-card.orange::before { background: linear-gradient(90deg, var(--warning), #fbbf24); }
.stat-card.purple::before { background: linear-gradient(90deg, var(--secondary), #a78bfa); }
.stat-card.red::before { background: linear-gradient(90deg, var(--danger), #f87171); }
.stat-card.cyan::before { background: linear-gradient(90deg, var(--info), #67e8f9); }

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

.stat-top {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}

.stat-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.stat-card.blue .stat-icon { background: rgba(26,86,219,0.2); color: var(--primary-light); }
.stat-card.green .stat-icon { background: rgba(16,185,129,0.2); color: var(--success); }
.stat-card.orange .stat-icon { background: rgba(245,158,11,0.2); color: var(--warning); }
.stat-card.purple .stat-icon { background: rgba(124,58,237,0.2); color: var(--secondary); }
.stat-card.red .stat-icon { background: rgba(239,68,68,0.2); color: var(--danger); }
.stat-card.cyan .stat-icon { background: rgba(6,182,212,0.2); color: var(--info); }

.stat-trend {
  font-size: 11px; font-weight: 600;
  padding: 3px 7px; border-radius: 6px;
}
.stat-trend.up { background: rgba(16,185,129,0.15); color: var(--success); }
.stat-trend.down { background: rgba(239,68,68,0.15); color: var(--danger); }

.stat-value {
  font-size: 32px; font-weight: 800;
  line-height: 1;
  margin-bottom: 4px;
}
.stat-label {
  font-size: 13px; color: var(--text-muted); font-weight: 500;
}

/* =========================================
   DASHBOARD GRID
   ========================================= */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.card {
  border-radius: var(--radius);
  padding: 22px;
  transition: var(--transition);
}

.card.full-width { grid-column: 1 / -1; }

.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px;
}
.card-header h3 {
  font-size: 15px; font-weight: 700;
  display: flex; align-items: center; gap: 8px;
}
.card-header h3 i { color: var(--primary-light); }

.card-link {
  font-size: 12px; color: var(--primary-light);
  cursor: pointer; text-decoration: none;
  font-weight: 600;
}
.card-link:hover { text-decoration: underline; }

/* =========================================
   MINI LIST
   ========================================= */
.mini-list { display: flex; flex-direction: column; gap: 8px; }

.mini-item {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex; align-items: center; gap: 12px;
  transition: var(--transition);
}
.mini-item:hover { background: rgba(255,255,255,0.07); }

.mini-avatar {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; flex-shrink: 0;
}

.mini-info { flex: 1; }
.mini-name { font-size: 13px; font-weight: 600; }
.mini-sub { font-size: 11px; color: var(--text-muted); margin-top: 1px; }

.mini-prog { flex-shrink: 0; text-align: right; }
.mini-pct { font-size: 12px; font-weight: 700; }
.mini-bar {
  width: 80px; height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px; margin-top: 4px; overflow: hidden;
}
.mini-bar-fill {
  height: 100%; border-radius: 2px;
  transition: width 0.8s ease;
}

/* =========================================
   UNION CHART
   ========================================= */
.union-chart { display: flex; flex-direction: column; gap: 10px; }
.union-bar-row { display: flex; align-items: center; gap: 12px; }
.union-bar-label { font-size: 12px; color: var(--text-secondary); width: 160px; flex-shrink: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.union-bar-track { flex: 1; background: rgba(255,255,255,0.08); border-radius: 4px; height: 8px; overflow: hidden; }
.union-bar-fill { height: 100%; border-radius: 4px; transition: width 1s ease; }
.union-bar-count { font-size: 12px; font-weight: 700; color: var(--text-secondary); width: 30px; text-align: right; flex-shrink: 0; }

/* =========================================
   FORMS
   ========================================= */
.form-card { padding: 28px 32px; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.form-group { display: flex; flex-direction: column; gap: 8px; }
.form-group label {
  font-size: 12px; font-weight: 600;
  color: var(--text-secondary); letter-spacing: 0.5px;
  display: flex; align-items: center; gap: 6px;
}
.form-group.full-span { grid-column: 1 / -1; }

.form-group input,
.form-group select,
.form-group textarea {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  transition: var(--transition);
  outline: none;
  width: 100%;
}

.form-group select option { background: #1e293b; color: var(--text-primary); }

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary-light);
  background: rgba(59,130,246,0.08);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
}

.form-group textarea { resize: vertical; min-height: 80px; }

.form-type-banner {
  margin: 20px 0;
  padding: 16px 20px;
  border-radius: 12px;
  font-size: 14px; font-weight: 600;
  display: flex; align-items: center; gap: 10px;
}
.form-type-banner.joining {
  background: rgba(16,185,129,0.12);
  border: 1px solid rgba(16,185,129,0.25);
  color: var(--success);
}
.form-type-banner.withdraw {
  background: rgba(245,158,11,0.12);
  border: 1px solid rgba(245,158,11,0.25);
  color: var(--warning);
}

.form-actions {
  display: flex; justify-content: flex-end; gap: 12px;
  margin-top: 28px; padding-top: 20px;
  border-top: 1px solid var(--border);
}

/* =========================================
   BUTTONS
   ========================================= */
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white; border: none;
  border-radius: var(--radius-sm);
  padding: 11px 22px;
  font-size: 14px; font-weight: 600;
  cursor: pointer; transition: var(--transition);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-family: 'Inter', sans-serif;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(26,86,219,0.35); }
.btn-primary.small { padding: 8px 16px; font-size: 13px; }

.btn-secondary {
  background: rgba(255,255,255,0.07);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 22px;
  font-size: 14px; font-weight: 600;
  cursor: pointer; transition: var(--transition);
  display: flex; align-items: center; gap: 8px;
  font-family: 'Inter', sans-serif;
}
.btn-secondary:hover { background: rgba(255,255,255,0.12); }

.btn-ghost {
  background: none; color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  font-size: 13px; font-weight: 500;
  cursor: pointer; transition: var(--transition);
  display: flex; align-items: center; gap: 6px;
  font-family: 'Inter', sans-serif;
}
.btn-ghost:hover { background: var(--bg-card); color: var(--text-primary); }

.btn-icon {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: 8px;
  padding: 7px 10px;
  cursor: pointer; transition: var(--transition);
  font-size: 13px;
}
.btn-icon:hover { background: var(--bg-card-hover); color: var(--text-primary); }
.btn-icon.danger:hover { background: rgba(239,68,68,0.15); color: var(--danger); border-color: rgba(239,68,68,0.3); }
.btn-icon.info:hover { background: rgba(59,130,246,0.15); color: var(--primary-light); border-color: rgba(59,130,246,0.3); }

/* =========================================
   FILTER BAR
   ========================================= */
.filter-card { padding: 16px 20px; margin-bottom: 16px; }

.filter-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}

.filter-group {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 8px 12px;
  flex: 1; min-width: 150px;
}
.filter-group i { color: var(--text-muted); font-size: 13px; }
.filter-group input,
.filter-group select {
  background: none; border: none;
  color: var(--text-primary); font-size: 13px;
  outline: none; width: 100%;
  font-family: 'Inter', sans-serif;
}
.filter-group select option { background: #1e293b; }

/* =========================================
   DATA TABLE
   ========================================= */
.table-card { padding: 0; overflow: hidden; }
.table-meta {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  gap: 12px; flex-wrap: wrap;
}
.table-meta span { font-size: 13px; color: var(--text-muted); font-weight: 500; }

.table-wrap { overflow-x: auto; }

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

.data-table th {
  background: rgba(255,255,255,0.04);
  padding: 12px 16px;
  text-align: left;
  font-size: 11px; font-weight: 700;
  color: var(--text-muted); letter-spacing: 0.8px;
  text-transform: uppercase;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 13px 16px;
  font-size: 13px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-secondary);
  vertical-align: middle;
}

.data-table tbody tr { transition: var(--transition); cursor: pointer; }
.data-table tbody tr:hover { background: rgba(255,255,255,0.04); }
.data-table tbody tr:last-child td { border-bottom: none; }

.td-name { font-weight: 600; color: var(--text-primary); }
.td-emp { font-family: monospace; font-size: 12px; }

.type-badge, .status-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.3px;
  white-space: nowrap;
}
.type-badge.joining { background: rgba(16,185,129,0.15); color: var(--success); border: 1px solid rgba(16,185,129,0.25); }
.type-badge.withdraw { background: rgba(245,158,11,0.15); color: var(--warning); border: 1px solid rgba(245,158,11,0.25); }

.status-badge.transit { background: rgba(245,158,11,0.15); color: var(--warning); }
.status-badge.active { background: rgba(16,185,129,0.15); color: var(--success); }
.status-badge.pending { background: rgba(6,182,212,0.15); color: var(--info); }

.action-group { display: flex; gap: 6px; }

/* =========================================
   STATUS / PROGRESS CARDS
   ========================================= */
.status-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 18px;
}

.progress-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.progress-card:hover { background: var(--bg-card-hover); transform: translateY(-3px); box-shadow: var(--shadow); }

.progress-card::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 4px;
}
.progress-card.joining::before { background: linear-gradient(180deg, var(--success), #34d399); }
.progress-card.withdraw::before { background: linear-gradient(180deg, var(--warning), #fbbf24); }
.progress-card.completed::before { background: linear-gradient(180deg, var(--primary-light), var(--secondary)); }

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

.pc-info {}
.pc-name { font-size: 15px; font-weight: 700; margin-bottom: 3px; }
.pc-sub { font-size: 12px; color: var(--text-muted); }
.pc-union {
  font-size: 11px; font-weight: 600;
  margin-top: 6px;
  padding: 4px 10px; border-radius: 20px;
  display: inline-flex; align-items: center; gap: 5px;
}
.pc-union.from { background: rgba(6,182,212,0.15); color: var(--info); border: 1px solid rgba(6,182,212,0.2); }
.pc-union.to { background: rgba(245,158,11,0.15); color: var(--warning); border: 1px solid rgba(245,158,11,0.2); }

.pc-actions { display: flex; gap: 6px; }

.pc-progress { margin-bottom: 12px; }

.pc-progress-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.pc-pct-label { font-size: 24px; font-weight: 800; }
.pc-pct-label.joining { color: var(--success); }
.pc-pct-label.withdraw { color: var(--warning); }
.pc-pct-label.completed { color: var(--primary-light); }

.pc-days-label {
  font-size: 12px; color: var(--text-muted);
  text-align: right;
}
.pc-days-big { display: block; font-size: 18px; font-weight: 700; color: var(--text-secondary); }

.progress-track {
  height: 10px;
  background: rgba(255,255,255,0.08);
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 6px;
  position: relative;
}
.progress-fill {
  height: 100%; border-radius: 5px;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}
.progress-fill.joining { background: linear-gradient(90deg, #059669, var(--success), #34d399); }
.progress-fill.withdraw { background: linear-gradient(90deg, #d97706, var(--warning), #fbbf24); }
.progress-fill.completed { background: linear-gradient(90deg, var(--primary), var(--secondary)); }

.progress-fill::after {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.pc-dates {
  display: flex; justify-content: space-between;
  font-size: 11px; color: var(--text-muted);
}

.pc-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
  font-size: 12px; color: var(--text-muted);
}

.pc-footer .type-badge { font-size: 10px; }

.completed-badge {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(16,185,129,0.15);
  color: var(--success); border: 1px solid rgba(16,185,129,0.3);
  padding: 4px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 700;
}

/* =========================================
   PROFILE PAGE
   ========================================= */
.profile-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 20px;
}

.profile-card {
  display: flex; flex-direction: column; align-items: center;
  text-align: center; padding: 32px 24px; gap: 12px;
}

.profile-avatar-lg {
  width: 80px; height: 80px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 800;
  box-shadow: 0 8px 24px rgba(26,86,219,0.35);
}

.profile-card h3 { font-size: 20px; font-weight: 700; }

.role-badge {
  background: linear-gradient(135deg, rgba(26,86,219,0.3), rgba(124,58,237,0.3));
  border: 1px solid rgba(26,86,219,0.3);
  color: var(--primary-light);
  padding: 5px 14px; border-radius: 20px;
  font-size: 12px; font-weight: 700;
}

.profile-details { width: 100%; margin-top: 8px; }
.profile-detail-row {
  display: flex; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid var(--border-light);
  font-size: 13px;
}
.profile-detail-row:last-child { border-bottom: none; }
.profile-detail-row .label { color: var(--text-muted); }
.profile-detail-row .value { font-weight: 600; }

.profile-stats-card { padding: 24px; }
.profile-stats-card h3 { font-size: 16px; font-weight: 700; margin-bottom: 18px; }
.profile-stat-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px; border-radius: 10px;
  background: rgba(255,255,255,0.04);
  margin-bottom: 10px;
  border: 1px solid var(--border-light);
}
.profile-stat-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
}
.profile-stat-val { font-size: 22px; font-weight: 800; }
.profile-stat-lab { font-size: 12px; color: var(--text-muted); }

/* =========================================
   SETTINGS
   ========================================= */
.settings-tabs {
  display: flex; gap: 4px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px;
  margin-bottom: 20px;
  width: fit-content;
}

.tab-btn {
  background: none; border: none;
  color: var(--text-secondary);
  padding: 9px 20px;
  border-radius: 8px;
  font-size: 13px; font-weight: 600;
  cursor: pointer; transition: var(--transition);
  font-family: 'Inter', sans-serif;
}
.tab-btn.active {
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.tab-btn:hover:not(.active) { color: var(--text-primary); }

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

.roles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 8px;
}

.role-card {
  border-radius: 12px;
  padding: 20px;
  position: relative;
}
.role-card.branch-official { background: rgba(6,182,212,0.08); border: 1px solid rgba(6,182,212,0.2); }
.role-card.staff { background: rgba(124,58,237,0.08); border: 1px solid rgba(124,58,237,0.2); }
.role-card.super-admin { background: rgba(26,86,219,0.08); border: 1px solid rgba(26,86,219,0.2); }

.role-icon {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; margin-bottom: 12px;
}
.branch-official .role-icon { background: rgba(6,182,212,0.2); color: var(--info); }
.staff .role-icon { background: rgba(124,58,237,0.2); color: var(--secondary); }
.super-admin .role-icon { background: rgba(26,86,219,0.2); color: var(--primary-light); }

.role-card h4 { font-size: 15px; font-weight: 700; margin-bottom: 12px; }

.role-card ul { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.role-card ul li {
  font-size: 12px; color: var(--text-secondary);
  display: flex; align-items: center; gap: 8px;
}
.role-card ul li i.fa-check { color: var(--success); }
.role-card ul li i.fa-times { color: var(--danger); }

.general-settings { display: flex; flex-direction: column; gap: 4px; }
.setting-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 0; border-bottom: 1px solid var(--border-light);
}
.setting-row:last-child { border-bottom: none; }
.setting-row p { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.setting-value {
  background: rgba(26,86,219,0.15);
  color: var(--primary-light);
  border: 1px solid rgba(26,86,219,0.25);
  padding: 6px 14px; border-radius: 20px;
  font-size: 13px; font-weight: 700; white-space: nowrap;
}

/* Companies settings */
.companies-list { display: flex; flex-direction: column; gap: 12px; }
.company-setting-item {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 14px 16px;
}
.company-setting-name { font-size: 14px; font-weight: 700; margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.branches-list-inline { display: flex; flex-wrap: wrap; gap: 6px; }
.branch-chip {
  background: rgba(26,86,219,0.1);
  border: 1px solid rgba(26,86,219,0.2);
  color: var(--primary-light);
  padding: 3px 10px; border-radius: 12px;
  font-size: 11px; font-weight: 600;
}

.unions-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.union-setting-item {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex; align-items: center; gap: 10px;
}
.union-num {
  width: 28px; height: 28px;
  background: rgba(124,58,237,0.2);
  color: var(--secondary);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.union-name-text { font-size: 13px; font-weight: 600; }
.union-abbr { font-size: 11px; color: var(--text-muted); }

/* Bar chart */
.bar-chart-wrap { display: flex; flex-direction: column; gap: 8px; }
.bar-chart-row { display: flex; align-items: center; gap: 10px; }
.bar-chart-label { font-size: 11px; color: var(--text-secondary); width: 120px; flex-shrink: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-chart-track { flex: 1; background: rgba(255,255,255,0.07); border-radius: 4px; height: 16px; overflow: hidden; position: relative; }
.bar-chart-fill { height: 100%; border-radius: 4px; display: flex; align-items: center; padding-left: 8px; transition: width 1s ease; }
.bar-chart-val { font-size: 10px; font-weight: 700; color: rgba(255,255,255,0.9); }

/* Donut */
.donut-wrap {
  display: flex; align-items: center; justify-content: center;
  gap: 20px; padding: 10px 0;
}
.donut-svg { flex-shrink: 0; }
.donut-legend { display: flex; flex-direction: column; gap: 10px; }
.donut-legend-item { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.donut-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* =========================================
   MODALS
   ========================================= */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: none;
}
.modal-overlay.open { display: block; }

.modal {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  z-index: 201;
  border-radius: 20px;
  width: 600px;
  max-width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
  display: none;
  opacity: 0;
  transition: var(--transition);
}
.modal.open {
  display: block;
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0;
  background: rgba(15,23,42,0.95);
  border-radius: 20px 20px 0 0;
}
.modal-header h3 { font-size: 17px; font-weight: 700; }
.modal-close {
  background: rgba(255,255,255,0.07); border: 1px solid var(--border);
  color: var(--text-secondary); cursor: pointer;
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.modal-close:hover { background: rgba(239,68,68,0.15); color: var(--danger); border-color: rgba(239,68,68,0.3); }

.modal-body { padding: 24px; }

.emp-detail-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 0;
}
.emp-detail-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
}
.emp-detail-item:nth-last-child(-n+2) { border-bottom: none; }
.emp-detail-label { font-size: 11px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 3px; }
.emp-detail-value { font-size: 14px; font-weight: 600; }

.modal-profile-header {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.modal-avatar {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700; flex-shrink: 0;
}
.modal-name { font-size: 18px; font-weight: 700; }
.modal-sub { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

/* =========================================
   TOAST
   ========================================= */
.toast {
  position: fixed; bottom: 28px; right: 28px;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 20px;
  font-size: 14px; font-weight: 500;
  z-index: 999;
  display: flex; align-items: center; gap: 10px;
  min-width: 260px; max-width: 380px;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow);
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { border-color: rgba(16,185,129,0.4); }
.toast.error { border-color: rgba(239,68,68,0.4); }
.toast.info { border-color: rgba(26,86,219,0.4); }
.toast-icon { font-size: 16px; }
.toast.success .toast-icon { color: var(--success); }
.toast.error .toast-icon { color: var(--danger); }
.toast.info .toast-icon { color: var(--primary-light); }

/* =========================================
   EMPTY STATES
   ========================================= */
.empty-state {
  text-align: center; padding: 48px 20px;
  color: var(--text-muted);
}
.empty-state i { font-size: 48px; margin-bottom: 16px; opacity: 0.3; }
.empty-state p { font-size: 14px; }

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-w) !important;
    transition: transform 0.3s ease;
  }
  .sidebar.mobile-open { transform: translateX(0); }
  .main-content { margin-left: 0 !important; }
  .mobile-menu-btn { display: flex; }
  .search-global { display: none; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .roles-grid { grid-template-columns: 1fr; }
  .profile-layout { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .page-area { padding: 16px; }
  .status-cards-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}

/* =========================================
   PAGE HEADER ROW (with action buttons)
   ========================================= */
.page-header-row {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 20px; gap: 16px; flex-wrap: wrap;
}
.page-header-row .page-header { margin-bottom: 0; }
.page-header-actions {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  flex-shrink: 0;
}

/* =========================================
   IMPORT / EXPORT BUTTONS
   ========================================= */
.btn-import, .btn-export {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600;
  cursor: pointer; transition: var(--transition);
  font-family: 'Inter', sans-serif;
  white-space: nowrap;
}
.btn-export {
  background: rgba(16,185,129,0.12);
  color: var(--success);
  border: 1px solid rgba(16,185,129,0.3);
}
.btn-export:hover { background: rgba(16,185,129,0.2); transform: translateY(-1px); }

.btn-import {
  background: rgba(59,130,246,0.12);
  color: var(--primary-light);
  border: 1px solid rgba(59,130,246,0.3);
}
.btn-import:hover { background: rgba(59,130,246,0.2); transform: translateY(-1px); }

/* =========================================
   FILE DROP ZONE & ATTACHMENTS
   ========================================= */
.attachment-section {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px dashed var(--border);
}
.attachment-header {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px;
  font-size: 14px; font-weight: 700;
  color: var(--text-secondary);
}
.attachment-header i { color: var(--primary-light); font-size: 16px; }
.attachment-hint {
  font-size: 11px; font-weight: 400;
  color: var(--text-muted);
  margin-left: 4px;
}

.file-drop-zone {
  border: 2px dashed rgba(59,130,246,0.35);
  border-radius: var(--radius);
  padding: 36px 20px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: rgba(59,130,246,0.04);
}
.file-drop-zone:hover, .file-drop-zone.drag-over {
  border-color: var(--primary-light);
  background: rgba(59,130,246,0.1);
}
.file-drop-zone i { font-size: 36px; color: var(--primary-light); margin-bottom: 12px; display: block; opacity: 0.7; }
.file-drop-zone p { font-size: 14px; color: var(--text-secondary); margin-bottom: 4px; }
.drop-link { color: var(--primary-light); font-weight: 600; }
.drop-sub { font-size: 11px; color: var(--text-muted); }

.attached-files-list {
  display: flex; flex-direction: column; gap: 8px;
  margin-top: 12px;
}
.attached-file-item {
  display: flex; align-items: center; gap: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 10px 14px;
  transition: var(--transition);
}
.attached-file-item:hover { background: rgba(255,255,255,0.07); }
.file-type-icon {
  width: 36px; height: 36px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}
.file-type-icon.pdf  { background: rgba(239,68,68,0.15); color: var(--danger); }
.file-type-icon.word { background: rgba(59,130,246,0.15); color: var(--primary-light); }
.file-type-icon.img  { background: rgba(16,185,129,0.15); color: var(--success); }
.file-type-icon.other{ background: rgba(156,163,175,0.15); color: #9ca3af; }

.file-item-info { flex: 1; min-width: 0; }
.file-item-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-item-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.file-item-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* =========================================
   UNION DIRECTION BADGE
   ========================================= */
.union-direction-wrap { display: flex; flex-direction: column; gap: 8px; }
.union-dir-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 10px;
  font-size: 13px; font-weight: 700;
  width: fit-content;
}
.union-dir-badge.from-muz {
  background: rgba(16,185,129,0.12);
  border: 1px solid rgba(16,185,129,0.3);
  color: var(--success);
}
.union-dir-badge.to-muz {
  background: rgba(245,158,11,0.12);
  border: 1px solid rgba(245,158,11,0.3);
  color: var(--warning);
}

/* =========================================
   ALERTS PANEL
   ========================================= */
.alerts-list { display: flex; flex-direction: column; gap: 8px; }
.alert-item {
  display: flex; align-items: center; gap: 14px;
  background: rgba(245,158,11,0.07);
  border: 1px solid rgba(245,158,11,0.2);
  border-radius: 10px;
  padding: 12px 16px;
  transition: var(--transition);
  cursor: pointer;
}
.alert-item:hover { background: rgba(245,158,11,0.12); }
.alert-item.urgent {
  background: rgba(239,68,68,0.07);
  border-color: rgba(239,68,68,0.2);
}
.alert-icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; flex-shrink: 0;
  background: rgba(245,158,11,0.15); color: var(--warning);
}
.alert-item.urgent .alert-icon { background: rgba(239,68,68,0.15); color: var(--danger); }
.alert-info { flex: 1; }
.alert-title { font-size: 13px; font-weight: 700; }
.alert-sub   { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.alert-days {
  font-size: 13px; font-weight: 800;
  color: var(--warning); flex-shrink: 0;
}
.alert-item.urgent .alert-days { color: var(--danger); }

/* =========================================
   ADD COMPANY FORM
   ========================================= */
.add-company-form {
  display: grid; grid-template-columns: 1fr 1fr auto;
  gap: 14px; align-items: end;
  padding: 4px 0 8px;
}
.add-company-form .btn-primary { height: 42px; white-space: nowrap; }

.company-setting-item {
  position: relative;
}
.company-setting-actions {
  position: absolute; top: 12px; right: 12px;
  display: flex; gap: 6px;
}
.branch-chip-wrap { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.branch-chip {
  display: inline-flex; align-items: center; gap: 5px;
}
.branch-chip-del {
  width: 16px; height: 16px;
  background: rgba(239,68,68,0.2);
  color: var(--danger);
  border: none; border-radius: 50%;
  cursor: pointer; font-size: 9px;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.branch-chip-del:hover { background: rgba(239,68,68,0.4); }

.add-branch-btn {
  background: rgba(59,130,246,0.1);
  color: var(--primary-light);
  border: 1px dashed rgba(59,130,246,0.3);
  border-radius: 12px;
  padding: 3px 10px;
  font-size: 11px; font-weight: 600;
  cursor: pointer; transition: var(--transition);
}
.add-branch-btn:hover { background: rgba(59,130,246,0.2); }

/* =========================================
   PRINT CARD
   ========================================= */
.print-card {
  background: white; color: #1a1a1a;
  padding: 32px; border-radius: 12px;
  font-family: 'Inter', sans-serif;
}
.print-card-header {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 20px; padding-bottom: 16px;
  border-bottom: 2px solid #1a56db;
}
.print-logo {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, #1a56db, #7c3aed);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 20px; flex-shrink: 0;
}
.print-org { }
.print-org h2 { font-size: 20px; font-weight: 800; color: #1a56db; }
.print-org p { font-size: 11px; color: #64748b; }
.print-card-name { font-size: 22px; font-weight: 800; margin-bottom: 4px; }
.print-card-sub { font-size: 13px; color: #64748b; }
.print-progress-bar {
  height: 12px; background: #e2e8f0; border-radius: 6px;
  overflow: hidden; margin: 16px 0 6px;
}
.print-progress-fill { height: 100%; border-radius: 6px; }
.print-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 0; margin-top: 16px;
}
.print-field {
  padding: 8px 0;
  border-bottom: 1px solid #f1f5f9;
}
.print-field-label { font-size: 10px; font-weight: 700; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.5px; }
.print-field-value { font-size: 13px; font-weight: 600; margin-top: 2px; }
.print-footer {
  margin-top: 20px; padding-top: 12px;
  border-top: 1px solid #e2e8f0;
  font-size: 11px; color: #94a3b8;
  display: flex; justify-content: space-between;
}

@media (max-width: 640px) {
  .add-company-form { grid-template-columns: 1fr; }
  .page-header-row { flex-direction: column; }
  .page-header-actions { width: 100%; }
}

@media print {
  body * { visibility: hidden; }
  #printContent, #printContent * { visibility: visible; }
  #printContent { position: fixed; top: 0; left: 0; width: 100%; }
}

/* =========================================
   VIEW TOGGLE (Card / List)
   ========================================= */
.view-toggle-group {
  display: flex; gap: 4px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 10px; padding: 4px;
  flex-shrink: 0;
}
.view-toggle-btn {
  background: none; border: none;
  color: var(--text-muted);
  padding: 8px 16px; border-radius: 7px;
  font-size: 13px; font-weight: 600;
  cursor: pointer; transition: var(--transition);
  display: flex; align-items: center; gap: 6px;
  font-family: 'Inter', sans-serif;
}
.view-toggle-btn.active {
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.view-toggle-btn:hover:not(.active) { color: var(--text-primary); }

/* =========================================
   INLINE PROGRESS BAR (table cell)
   ========================================= */
.inline-prog-wrap { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.inline-prog-track {
  flex: 1; height: 6px;
  background: rgba(255,255,255,0.1); border-radius: 3px; overflow: hidden;
}
.inline-prog-fill { height: 100%; border-radius: 3px; }
.inline-prog-pct { font-size: 11px; font-weight: 700; flex-shrink: 0; width: 30px; text-align: right; }

/* =========================================
   PERMISSION MATRIX
   ========================================= */
.permission-matrix { overflow-x: auto; }
.perm-table {
  width: 100%; border-collapse: collapse;
  font-size: 13px;
}
.perm-table th {
  padding: 12px 16px; font-size: 11px; font-weight: 700;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.8px;
  border-bottom: 1px solid var(--border); text-align: center;
  white-space: nowrap;
}
.perm-table th:first-child { text-align: left; width: 220px; }
.perm-table td {
  padding: 12px 16px; border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}
.perm-table td:first-child { font-weight: 600; font-size: 13px; }
.perm-table tr:last-child td { border-bottom: none; }
.perm-table tr:hover td { background: rgba(255,255,255,0.03); }
.perm-table td:not(:first-child) { text-align: center; }

/* Role header cells */
.perm-role-header {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 4px 0;
}
.perm-role-icon {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; margin-bottom: 2px;
}
.perm-branch .perm-role-icon { background: rgba(6,182,212,0.2); color: var(--info); }
.perm-staff .perm-role-icon  { background: rgba(124,58,237,0.2); color: var(--secondary); }
.perm-admin .perm-role-icon  { background: rgba(26,86,219,0.2); color: var(--primary-light); }

/* Toggle switch */
.perm-toggle {
  position: relative; display: inline-block;
  width: 44px; height: 24px;
}
.perm-toggle input { opacity: 0; width: 0; height: 0; }
.perm-slider {
  position: absolute; cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(255,255,255,0.12);
  border-radius: 24px;
  transition: var(--transition);
  border: 1px solid var(--border);
}
.perm-slider:before {
  position: absolute; content: '';
  height: 16px; width: 16px;
  left: 3px; bottom: 3px;
  background: var(--text-muted);
  border-radius: 50%; transition: var(--transition);
}
.perm-toggle input:checked + .perm-slider { background: rgba(16,185,129,0.3); border-color: var(--success); }
.perm-toggle input:checked + .perm-slider:before { transform: translateX(20px); background: var(--success); }
.perm-toggle input:disabled + .perm-slider { opacity: 0.5; cursor: not-allowed; }
.perm-toggle input:checked:disabled + .perm-slider { background: rgba(26,86,219,0.3); border-color: var(--primary-light); }
.perm-toggle input:checked:disabled + .perm-slider:before { background: var(--primary-light); }

.perm-category {
  background: rgba(255,255,255,0.03);
  font-size: 11px; font-weight: 800;
  color: var(--text-muted); letter-spacing: 1px;
  text-transform: uppercase; padding: 8px 16px !important;
  border-bottom: 1px solid var(--border) !important;
}

/* =========================================
   UNION DISTRIBUTION DETAILED
   ========================================= */
.union-detail-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 16px; margin-bottom: 20px;
}
.union-detail-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-light);
  border-radius: 12px; padding: 16px;
}
.union-detail-card h4 {
  font-size: 13px; font-weight: 700;
  margin-bottom: 12px; display: flex; align-items: center; gap: 8px;
}
.union-member-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid var(--border-light);
  font-size: 12px; cursor: pointer; transition: var(--transition);
}
.union-member-row:hover { background: rgba(255,255,255,0.04); border-radius: 6px; padding: 8px 6px; }
.union-member-row:last-child { border-bottom: none; }
.union-member-avatar {
  width: 28px; height: 28px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; flex-shrink: 0;
}
.union-member-name { font-weight: 600; flex: 1; }
.union-member-company { color: var(--text-muted); font-size: 11px; }

/* =========================================
   NOTIFICATIONS SETTINGS
   ========================================= */
.notif-settings-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 20px; padding: 4px 0 8px;
}
.notif-preview-box {
  margin-top: 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 12px; padding: 20px;
  font-size: 13px; line-height: 1.7;
  white-space: pre-wrap;
}
.notif-preview-box h4 { font-size: 15px; margin-bottom: 8px; color: var(--primary-light); }
.notif-preview-box .preview-subject { font-weight: 700; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }

.notif-log { display: flex; flex-direction: column; gap: 8px; padding: 4px 0; }
.notif-log-item {
  display: flex; align-items: center; gap: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-light);
  border-radius: 10px; padding: 12px 14px;
}
.notif-log-item i { font-size: 14px; flex-shrink: 0; }
.notif-log-item.success i { color: var(--success); }
.notif-log-item.info i    { color: var(--primary-light); }
.notif-log-time { font-size: 11px; color: var(--text-muted); margin-left: auto; flex-shrink: 0; }

@media (max-width: 700px) {
  .notif-settings-grid { grid-template-columns: 1fr; }
  .union-detail-grid   { grid-template-columns: 1fr; }
  .perm-table th, .perm-table td { padding: 10px 10px; }
  .filter-row { flex-direction: column; align-items: stretch; }
  .filter-group { width: 100%; height: auto; min-height: 38px; flex-wrap: nowrap; }
  .search-filter-group { width: 100%; }
  .date-range-group { flex-wrap: wrap; }
  .date-range-group .date-input { width: 120px; }
}

/* =========================================
   FILTER CARD & FILTER ROW
   ========================================= */
.filter-card { padding: 14px 18px; margin-bottom: 16px; }
.filter-row  { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.filter-group {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 7px 12px;
  height: 38px;
}
.filter-group i { color: var(--text-muted); font-size: 12px; flex-shrink: 0; }
.filter-group input:not(.date-input), .filter-group select {
  background: none; border: none;
  color: var(--text-primary); font-size: 13px;
  outline: none; font-family: 'Inter', sans-serif; min-width: 110px;
  height: 100%;
}
.filter-group select option { background: #1e293b; }
.search-filter-group { padding: 0 0 0 12px; gap: 0; overflow: hidden; }
.search-filter-group input { padding: 0 8px; flex: 1; min-width: 160px; height: 100%; }
.filter-search-btn {
  background: var(--primary); border: none;
  color: white; cursor: pointer; height: 100%;
  padding: 0 14px; font-size: 12px; font-weight: 600;
  font-family: 'Inter', sans-serif;
  white-space: nowrap; flex-shrink: 0;
  display: flex; align-items: center; gap: 5px;
  transition: var(--transition); border-radius: 0 7px 7px 0;
}
.filter-search-btn:hover { background: var(--primary-light); }
.btn-ghost {
  background: rgba(255,255,255,0.05); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text-secondary); cursor: pointer;
  padding: 0 14px; height: 38px; font-size: 13px; font-family: 'Inter',sans-serif;
  display: flex; align-items: center; gap: 6px; transition: var(--transition);
  white-space: nowrap; flex-shrink: 0;
}
.btn-ghost:hover { background: rgba(255,255,255,0.1); color: var(--text-primary); }

/* =========================================
   EXPORT BUTTON
   ========================================= */
.btn-export {
  background: linear-gradient(135deg, var(--success), #34d399);
  color: white; border: none; border-radius: var(--radius-sm);
  padding: 9px 18px; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: var(--transition);
  display: flex; align-items: center; gap: 7px;
  font-family: 'Inter', sans-serif;
}
.btn-export:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(16,185,129,0.35); }

/* =========================================
   ENHANCED UNION SETTING ITEMS
   ========================================= */
.union-setting-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; border-bottom: 1px solid var(--border-light);
  transition: var(--transition);
}
.union-setting-item:last-child { border-bottom: none; }
.union-setting-item:hover { background: rgba(255,255,255,0.03); }
.union-num {
  width: 28px; height: 28px;
  background: rgba(26,86,219,0.15); color: var(--primary-light);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.union-name-text { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.union-abbr { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

@media (max-width: 700px) {
  .filter-row { flex-direction: column; align-items: stretch; }
  .filter-group { width: 100%; }
}

/* =========================================
   LOGO IMAGES
   ========================================= */
.login-logo-img {
  width: 120px;
  height: auto;
  object-fit: contain;
  display: block;
  margin: 0 auto 12px;
  filter: drop-shadow(0 4px 16px rgba(26,86,219,0.5));
}
.sidebar-logo-img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 6px;
}

/* =========================================
   STICKY TABLE HEADER & SCROLLABLE BODY
   ========================================= */
.sticky-table-wrap {
  max-height: 480px;
  overflow-y: auto;
}
.sticky-thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #1a2540;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* =========================================
   PAGINATION
   ========================================= */
.pagination-wrap {
  display: flex; align-items: center; justify-content: center;
  gap: 6px; padding: 14px 16px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.page-btn {
  min-width: 34px; height: 34px; padding: 0 10px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: 8px; color: var(--text-secondary);
  cursor: pointer; font-size: 13px; font-family: 'Inter', sans-serif;
  transition: var(--transition); display: flex; align-items: center; justify-content: center;
}
.page-btn:hover { background: rgba(255,255,255,0.12); color: var(--text-primary); }
.page-btn.active { background: var(--primary); color: white; border-color: var(--primary); font-weight: 700; }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.page-info { font-size: 12px; color: var(--text-muted); padding: 0 8px; }

/* .btn-search-inline removed — replaced by .search-global-btn and .filter-search-btn */

/* Date range filter group */
.date-range-group {
  gap: 6px;
  height: auto !important;
  padding: 5px 12px !important;
  align-items: center;
}
.date-range-group .date-input {
  min-width: 0 !important;
  width: 140px;
  height: 26px;
  padding: 2px 6px;
  color-scheme: dark;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 12px;
  font-family: 'Inter', sans-serif;
}
.date-range-group .date-input:focus {
  outline: none;
  border-color: var(--primary-light);
}
.date-sep {
  color: var(--text-muted);
  font-size: 13px;
  flex-shrink: 0;
  line-height: 1;
}

/* =========================================
   NOTIFICATION BELL PANEL
   ========================================= */
.notif-bell-panel {
  position: fixed; top: 68px; right: 16px;
  width: 360px; max-width: 95vw;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 2000;
  max-height: 480px; overflow: hidden;
  display: flex; flex-direction: column;
}
.notif-bell-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.notif-bell-header h4 { font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.notif-bell-list {
  overflow-y: auto; flex: 1;
  display: flex; flex-direction: column;
}
.notif-bell-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 12px; transition: var(--transition);
}
.notif-bell-item:hover { background: rgba(255,255,255,0.04); }
.notif-bell-item i { font-size: 14px; margin-top: 1px; flex-shrink: 0; }
.notif-bell-item .nb-action { font-weight: 600; color: var(--text-primary); }
.notif-bell-item .nb-detail { color: var(--text-muted); margin-top: 2px; }
.notif-bell-item .nb-time { font-size: 10px; color: var(--text-muted); margin-left: auto; flex-shrink: 0; white-space: nowrap; }
.notif-bell-empty { text-align: center; padding: 32px; color: var(--text-muted); font-size: 13px; }

/* =========================================
   UNION SUMMARY GRID (System Status)
   ========================================= */
.union-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px; padding: 8px 0;
}
.union-summary-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 12px; padding: 14px 16px;
  cursor: pointer; transition: var(--transition);
}
.union-summary-card:hover {
  background: rgba(26,86,219,0.12);
  border-color: var(--primary-light);
  transform: translateY(-2px);
}
.union-summary-abbr {
  font-size: 18px; font-weight: 800;
  color: var(--primary-light); margin-bottom: 4px;
}
.union-summary-count {
  font-size: 28px; font-weight: 800; margin-bottom: 4px;
}
.union-summary-sub {
  font-size: 11px; color: var(--text-muted); display: flex; gap: 8px;
}

/* =========================================
   ALERT ICON FOR MISSING ATTACHMENTS
   ========================================= */
.att-required-icon {
  color: var(--warning);
  font-size: 11px;
  margin-left: 4px;
  cursor: help;
  animation: pulse-warn 2s infinite;
}
@keyframes pulse-warn {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* =========================================
   OTHER-UNION RED BADGE
   ========================================= */
.union-other {
  color: var(--danger);
  font-weight: 700;
}
.type-badge.other-union {
  background: rgba(239,68,68,0.18);
  color: var(--danger);
  border: 1px solid rgba(239,68,68,0.3);
}
