/* ============================================
   SuperAdmin - Premium Admin Dashboard Template
   ============================================ */

/* ---------- CSS Variables ---------- */
:root {
  --sa-primary: #4f46e5;
  --sa-primary-light: #818cf8;
  --sa-primary-dark: #3730a3;
  --sa-secondary: #06b6d4;
  --sa-success: #10b981;
  --sa-danger: #ef4444;
  --sa-warning: #f59e0b;
  --sa-info: #3b82f6;
  --sa-pink: #ec4899;
  --sa-purple: #8b5cf6;
  --sa-orange: #f97316;
  --sa-teal: #14b8a6;
  --sa-sidebar-bg: #0f172a;
  --sa-sidebar-hover: rgba(255, 255, 255, 0.04);
  --sa-sidebar-active: rgba(99, 102, 241, 0.15);
  --sa-sidebar-text: #94a3b8;
  --sa-sidebar-width: 260px;
  --sa-header-height: 64px;
  --sa-body-bg: #f1f5f9;
  --sa-card-bg: #ffffff;
  --sa-text-primary: #1e293b;
  --sa-text-secondary: #64748b;
  --sa-border-color: #e2e8f0;
  --sa-transition: all 0.3s ease;
}

/* ---------- Base Styles ---------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--sa-body-bg);
  color: var(--sa-text-primary);
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--sa-transition);
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

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

::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

/* ---------- Layout ---------- */
.sa-wrapper {
  min-height: 100vh;
}

.sa-content-wrapper {
  flex: 1;
  min-width: 0;
  margin-left: var(--sa-sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: var(--sa-transition);
}

.sa-main-content {
  flex: 1;
  min-width: 0;
  padding: 24px;
  margin-top: var(--sa-header-height);
}

/* ---------- Sidebar ---------- */
.sa-sidebar {
  width: var(--sa-sidebar-width);
  height: 100vh;
  background: linear-gradient(180deg, #0f172a 0%, #1e1b4b 100%);
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  overflow-y: scroll;
  overflow-x: hidden;
  transition: var(--sa-transition);
  display: flex;
  flex-direction: column;
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
  scrollbar-gutter: stable;
}

/* Always-present scrollbar gutter, hidden track by default */
.sa-sidebar::-webkit-scrollbar {
  width: 6px;
  background: transparent;
}

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

.sa-sidebar::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 10px;
  transition: background 0.3s ease;
}

/* Show scrollbar thumb only on hover */
.sa-sidebar:hover::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.55);
}

.sa-sidebar:hover::-webkit-scrollbar-thumb:hover {
  background: rgba(199, 210, 254, 0.8);
}

/* Firefox */
.sa-sidebar {
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}

.sa-sidebar:hover {
  scrollbar-color: rgba(148, 163, 184, 0.55) transparent;
}

.sa-sidebar-brand {
  padding: 22px 24px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
}

.sa-sidebar-brand::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 24px;
  right: 24px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
}

.sa-sidebar-brand .brand-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6, #ec4899);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  font-size: 18px;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1);
  position: relative;
}

.sa-sidebar-brand .brand-icon::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255,255,255,0.3), transparent);
  pointer-events: none;
}

.sa-sidebar-brand .brand-text {
  color: #ffffff;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #ffffff 0%, #c7d2fe 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Premium user card */
.sa-sidebar-user {
  margin: 18px 18px 16px;
  padding: 18px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.1) 50%, rgba(236, 72, 153, 0.12) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.sa-sidebar-user::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -30%;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(236, 72, 153, 0.25), transparent 70%);
  pointer-events: none;
}

.sa-sidebar-user::after {
  content: '';
  position: absolute;
  bottom: -40%;
  left: -20%;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.2), transparent 70%);
  pointer-events: none;
}

.sa-sidebar-user:hover {
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
  box-shadow: 0 10px 30px rgba(99, 102, 241, 0.2);
}

.sa-sidebar-user .user-avatar {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, #f59e0b, #ec4899, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 17px;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(236, 72, 153, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.sa-sidebar-user .user-avatar::after {
  content: '';
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #10b981;
  border: 2.5px solid #1e1b4b;
  box-shadow: 0 0 0 1px #10b981;
}

.sa-sidebar-user .user-info {
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.sa-sidebar-user .user-info h6 {
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 3px;
  letter-spacing: -0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sa-sidebar-user .user-info span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #c7d2fe;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.sa-sidebar-user .user-info span::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #fbbf24;
  box-shadow: 0 0 6px #fbbf24;
}

.sa-sidebar-menu {
  padding: 8px 12px 20px;
  flex: 1;
}

.sa-menu-label {
  padding: 16px 16px 8px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #475569;
}

.sa-menu-item {
  position: relative;
  margin-bottom: 2px;
}

.sa-menu-link {
  display: flex;
  align-items: center;
  padding: 11px 14px;
  color: var(--sa-sidebar-text);
  font-size: 13.5px;
  font-weight: 500;
  transition: all 0.25s ease;
  gap: 14px;
  cursor: pointer;
  border-radius: 12px;
  position: relative;
}

.sa-menu-link:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.05);
}

.sa-menu-link:hover .menu-icon {
  color: #c7d2fe;
  transform: scale(1.1);
}

.sa-menu-link.active {
  color: #ffffff;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(139, 92, 246, 0.15));
  border: none;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.sa-menu-link.active::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 24px;
  border-radius: 0 4px 4px 0;
  background: linear-gradient(180deg, #6366f1, #ec4899);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.6);
}

.sa-menu-link.active .menu-icon {
  color: #ffffff;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.sa-menu-link .menu-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 9px;
  color: #94a3b8;
  transition: all 0.25s ease;
}

.sa-menu-link .menu-text {
  flex: 1;
}

.sa-menu-link .menu-arrow {
  font-size: 12px;
  transition: transform 0.3s ease;
}

.sa-menu-link.expanded .menu-arrow {
  transform: rotate(90deg);
}

.sa-menu-badge {
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.sa-submenu {
  display: none;
  padding-left: 20px;
}

.sa-submenu.open {
  display: block;
}

.sa-submenu a {
  display: flex;
  align-items: center;
  padding: 8px 14px 8px 58px;
  margin: 2px 0;
  color: #748399;
  font-size: 12.5px;
  font-weight: 500;
  border-radius: 10px;
  transition: all 0.2s ease;
  position: relative;
}

.sa-submenu a:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.04);
  padding-left: 62px;
}

.sa-submenu a.active {
  color: #ffffff;
  background: rgba(99, 102, 241, 0.12);
}

.sa-submenu a::before {
  content: '';
  position: absolute;
  left: 36px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #475569;
  transition: all 0.2s ease;
}

.sa-submenu a:hover::before,
.sa-submenu a.active::before {
  background: #ec4899;
  box-shadow: 0 0 8px #ec4899;
}

/* ---------- Header ---------- */
.sa-header {
  height: var(--sa-header-height);
  background: var(--sa-card-bg);
  border-bottom: 1px solid var(--sa-border-color);
  position: fixed;
  top: 0;
  left: var(--sa-sidebar-width);
  right: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  transition: var(--sa-transition);
}

.sa-header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.sa-toggle-btn {
  display: none;
  background: none;
  border: none;
  font-size: 22px;
  color: var(--sa-text-primary);
  cursor: pointer;
  padding: 4px;
}

.sa-search-box {
  position: relative;
}

.sa-search-box input {
  width: 280px;
  padding: 8px 16px 8px 40px;
  border: 1px solid var(--sa-border-color);
  border-radius: 8px;
  font-size: 14px;
  background: var(--sa-body-bg);
  color: var(--sa-text-primary);
  transition: var(--sa-transition);
}

.sa-search-box input:focus {
  outline: none;
  border-color: var(--sa-primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.sa-search-box .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--sa-text-secondary);
  font-size: 16px;
}

.sa-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sa-header-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--sa-text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
  transition: var(--sa-transition);
  position: relative;
}

.sa-header-btn:hover {
  background: var(--sa-body-bg);
  color: var(--sa-primary);
}

.sa-header-btn .badge-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sa-danger);
  border: 2px solid white;
}

.sa-header-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 12px 4px 4px;
  border-radius: 10px;
  cursor: pointer;
  transition: var(--sa-transition);
}

.sa-header-user:hover {
  background: var(--sa-body-bg);
}

.sa-header-user .avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--sa-primary), var(--sa-secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 14px;
}

.sa-header-user .user-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--sa-text-primary);
}

/* ---------- Breadcrumb ---------- */
.sa-page-header {
  margin-bottom: 24px;
}

.sa-page-header h4 {
  font-size: 22px;
  font-weight: 700;
  color: var(--sa-text-primary);
  margin-bottom: 4px;
}

.sa-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--sa-text-secondary);
}

.sa-breadcrumb a {
  color: var(--sa-primary);
}

.sa-breadcrumb a:hover {
  text-decoration: underline;
}

/* ---------- Cards ---------- */
.sa-card {
  background: var(--sa-card-bg);
  border-radius: 12px;
  border: 1px solid var(--sa-border-color);
  margin-bottom: 24px;
  transition: var(--sa-transition);
}

.sa-card:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.sa-card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--sa-border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sa-card-header h5 {
  font-size: 16px;
  font-weight: 600;
  color: var(--sa-text-primary);
}

.sa-card-body {
  padding: 20px;
}

.sa-card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--sa-border-color);
}

/* ---------- Stat Cards ---------- */
.sa-stat-card {
  background: var(--sa-card-bg);
  border-radius: 12px;
  border: 1px solid var(--sa-border-color);
  padding: 20px;
  transition: var(--sa-transition);
}

.sa-stat-card:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.sa-stat-card .stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.sa-stat-card .stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--sa-text-primary);
  line-height: 1.2;
}

.sa-stat-card .stat-label {
  font-size: 13px;
  color: var(--sa-text-secondary);
  margin-top: 4px;
}

.sa-stat-card .stat-change {
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.stat-change.up {
  color: var(--sa-success);
}

.stat-change.down {
  color: var(--sa-danger);
}

/* ---------- Gradient Cards ---------- */
.sa-gradient-card {
  border-radius: 12px;
  padding: 24px;
  color: #ffffff;
  position: relative;
  overflow: hidden;
}

.sa-gradient-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -30%;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
}

.sa-gradient-card::after {
  content: '';
  position: absolute;
  bottom: -40%;
  left: -20%;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
}

.gradient-primary {
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
}

.gradient-success {
  background: linear-gradient(135deg, #10b981, #059669);
}

.gradient-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
}

.gradient-warning {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}

.gradient-info {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.gradient-pink {
  background: linear-gradient(135deg, #ec4899, #db2777);
}

.gradient-purple {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.gradient-teal {
  background: linear-gradient(135deg, #14b8a6, #0d9488);
}

.gradient-orange {
  background: linear-gradient(135deg, #f97316, #ea580c);
}

.gradient-cyan {
  background: linear-gradient(135deg, #06b6d4, #0891b2);
}

/* ---------- Tables ---------- */
.sa-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.sa-table thead th {
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--sa-text-secondary);
  background: var(--sa-body-bg);
  border-bottom: 1px solid var(--sa-border-color);
  text-align: left;
}

.sa-table tbody td {
  padding: 12px 16px;
  font-size: 14px;
  color: var(--sa-text-primary);
  border-bottom: 1px solid var(--sa-border-color);
  vertical-align: middle;
}

.sa-table tbody tr:hover {
  background: rgba(79, 70, 229, 0.02);
}

.sa-table tbody tr:last-child td {
  border-bottom: none;
}

/* ---------- Badges ---------- */
.sa-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}

.sa-badge-primary {
  background: rgba(79, 70, 229, 0.1);
  color: var(--sa-primary);
}

.sa-badge-success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--sa-success);
}

.sa-badge-danger {
  background: rgba(239, 68, 68, 0.1);
  color: var(--sa-danger);
}

.sa-badge-warning {
  background: rgba(245, 158, 11, 0.1);
  color: var(--sa-warning);
}

.sa-badge-info {
  background: rgba(59, 130, 246, 0.1);
  color: var(--sa-info);
}

.sa-badge-pink {
  background: rgba(236, 72, 153, 0.1);
  color: var(--sa-pink);
}

.sa-badge-purple {
  background: rgba(139, 92, 246, 0.1);
  color: var(--sa-purple);
}

/* ---------- Buttons ---------- */
.sa-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: var(--sa-transition);
}

.sa-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.sa-btn-primary {
  background: var(--sa-primary);
  color: white;
}

.sa-btn-secondary {
  background: var(--sa-secondary);
  color: white;
}

.sa-btn-success {
  background: var(--sa-success);
  color: white;
}

.sa-btn-danger {
  background: var(--sa-danger);
  color: white;
}

.sa-btn-warning {
  background: var(--sa-warning);
  color: white;
}

.sa-btn-info {
  background: var(--sa-info);
  color: white;
}

.sa-btn-pink {
  background: var(--sa-pink);
  color: white;
}

.sa-btn-purple {
  background: var(--sa-purple);
  color: white;
}

.sa-btn-outline-primary {
  background: transparent;
  border: 1px solid var(--sa-primary);
  color: var(--sa-primary);
}

.sa-btn-outline-primary:hover {
  background: var(--sa-primary);
  color: white;
}

.sa-btn-sm {
  padding: 5px 14px;
  font-size: 13px;
}

.sa-btn-lg {
  padding: 12px 28px;
  font-size: 16px;
}

/* ---------- Forms ---------- */
.sa-form-group {
  margin-bottom: 16px;
}

.sa-form-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--sa-text-primary);
  margin-bottom: 6px;
}

.sa-form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--sa-border-color);
  border-radius: 8px;
  font-size: 14px;
  color: var(--sa-text-primary);
  background: var(--sa-card-bg);
  transition: var(--sa-transition);
}

.sa-form-control:focus {
  outline: none;
  border-color: var(--sa-primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.sa-form-select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--sa-border-color);
  border-radius: 8px;
  font-size: 14px;
  color: var(--sa-text-primary);
  background: var(--sa-card-bg);
  cursor: pointer;
  transition: var(--sa-transition);
}

.sa-form-select:focus {
  outline: none;
  border-color: var(--sa-primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* ---------- Alerts ---------- */
.sa-alert {
  padding: 14px 20px;
  border-radius: 10px;
  font-size: 14px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.sa-alert-primary {
  background: rgba(79, 70, 229, 0.08);
  border-left: 4px solid var(--sa-primary);
  color: var(--sa-primary-dark);
}

.sa-alert-success {
  background: rgba(16, 185, 129, 0.08);
  border-left: 4px solid var(--sa-success);
  color: #065f46;
}

.sa-alert-danger {
  background: rgba(239, 68, 68, 0.08);
  border-left: 4px solid var(--sa-danger);
  color: #991b1b;
}

.sa-alert-warning {
  background: rgba(245, 158, 11, 0.08);
  border-left: 4px solid var(--sa-warning);
  color: #92400e;
}

.sa-alert-info {
  background: rgba(59, 130, 246, 0.08);
  border-left: 4px solid var(--sa-info);
  color: #1e40af;
}

/* ---------- Progress ---------- */
.sa-progress {
  height: 8px;
  background: var(--sa-body-bg);
  border-radius: 4px;
  overflow: hidden;
}

.sa-progress-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
}

/* ---------- Avatar ---------- */
.sa-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: 600;
  color: white;
  overflow: hidden;
}

.sa-avatar-xs {
  width: 24px;
  height: 24px;
  font-size: 10px;
}

.sa-avatar-sm {
  width: 32px;
  height: 32px;
  font-size: 13px;
}

.sa-avatar-md {
  width: 40px;
  height: 40px;
  font-size: 15px;
}

.sa-avatar-lg {
  width: 56px;
  height: 56px;
  font-size: 20px;
}

.sa-avatar-xl {
  width: 80px;
  height: 80px;
  font-size: 28px;
}

.sa-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- Timeline ---------- */
.sa-timeline {
  position: relative;
  padding-left: 30px;
}

.sa-timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--sa-border-color);
}

.sa-timeline-item {
  position: relative;
  padding-bottom: 24px;
}

.sa-timeline-item::before {
  content: '';
  position: absolute;
  left: -26px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--sa-primary);
  background: white;
}

/* ---------- Accordion ---------- */
.sa-accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  opacity: 0;
}

.sa-accordion-item.open > .sa-accordion-body {
  max-height: 600px;
  padding-top: 0 !important;
  padding-bottom: 16px !important;
  opacity: 1;
}

.sa-accordion-header .accordion-toggle-icon::after {
  content: '+';
}

.sa-accordion-item.open > .sa-accordion-header .accordion-toggle-icon::after {
  content: '\2212';
}

/* ---------- Tabs ---------- */
.sa-tabs {
  display: flex;
  border-bottom: 2px solid var(--sa-border-color);
  gap: 0;
}

.sa-tab {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--sa-text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: var(--sa-transition);
}

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

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

.sa-tab-content {
  padding: 20px 0;
}

.sa-tab-pane {
  display: none;
}

.sa-tab-pane.active {
  display: block;
}

/* ---------- Modal ---------- */
.sa-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sa-modal-overlay.show {
  display: flex;
  opacity: 1;
}

/* .sa-modal used as fixed full-screen wrapper on modals.html */
/* .sa-modal-dialog is the actual centered card */
.sa-modal-dialog {
  animation: modalFadeIn 0.25s ease;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Legacy .sa-modal inside .sa-modal-overlay (old pattern) */
.sa-modal-overlay .sa-modal-inner {
  background: var(--sa-card-bg);
  border-radius: 16px;
  width: 90%;
  max-width: 560px;
  max-height: 80vh;
  overflow-y: auto;
}

.sa-modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--sa-border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sa-modal-header h5 {
  font-size: 18px;
  font-weight: 600;
}

.sa-modal-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--sa-text-secondary);
}

.sa-modal-body {
  padding: 24px;
}

.sa-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--sa-border-color);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ---------- Dropdown ---------- */
.sa-dropdown {
  position: relative;
  display: inline-block;
}

.sa-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--sa-card-bg);
  border: 1px solid var(--sa-border-color);
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  min-width: 180px;
  padding: 8px 0;
  z-index: 1100;
}

.sa-dropdown-menu.hidden {
  display: none !important;
}

.sa-dropdown-menu.show {
  display: block !important;
  opacity: 1;
  transform: translateY(0);
}

.sa-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  font-size: 14px;
  color: var(--sa-text-primary);
  transition: var(--sa-transition);
  cursor: pointer;
}

.sa-dropdown-item:hover {
  background: var(--sa-body-bg);
  color: var(--sa-primary);
}

.sa-dropdown-divider {
  height: 1px;
  background: var(--sa-border-color);
  margin: 4px 0;
}

/* ---------- Pagination ---------- */
.sa-pagination {
  display: flex;
  gap: 4px;
}

.sa-page-link {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--sa-border-color);
  border-radius: 8px;
  font-size: 14px;
  color: var(--sa-text-secondary);
  transition: var(--sa-transition);
  cursor: pointer;
}

.sa-page-link:hover,
.sa-page-link.active {
  background: var(--sa-primary);
  border-color: var(--sa-primary);
  color: white;
}

/* ---------- Toast ---------- */
.sa-toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sa-toast {
  background: var(--sa-card-bg);
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  padding: 16px 20px;
  min-width: 300px;
  display: flex;
  align-items: center;
  gap: 12px;
  transform: translateX(120%);
  transition: transform 0.4s ease;
}

.sa-toast.show {
  transform: translateX(0);
}

/* ---------- Ribbon ---------- */
.sa-ribbon {
  position: absolute;
  top: 12px;
  right: -8px;
  padding: 4px 16px;
  font-size: 12px;
  font-weight: 600;
  color: white;
  border-radius: 4px 0 0 4px;
}

.sa-ribbon::after {
  content: '';
  position: absolute;
  right: 0;
  bottom: -8px;
  border: 4px solid transparent;
}

/* ---------- Rating ---------- */
.sa-rating {
  display: flex;
  gap: 4px;
}

.sa-rating .star {
  font-size: 18px;
  cursor: pointer;
  color: #d1d5db;
  transition: var(--sa-transition);
}

.sa-rating .star.filled {
  color: #f59e0b;
}

/* ---------- Switch ---------- */
.sa-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.sa-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.sa-switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #d1d5db;
  border-radius: 24px;
  transition: var(--sa-transition);
}

.sa-switch-slider::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: var(--sa-transition);
}

.sa-switch input:checked + .sa-switch-slider {
  background: var(--sa-primary);
}

.sa-switch input:checked + .sa-switch-slider::before {
  transform: translateX(20px);
}

/* ---------- Chart Container ---------- */
.sa-chart-container {
  position: relative;
  width: 100%;
}

/* ---------- Footer ---------- */
.sa-footer {
  padding: 16px 24px;
  text-align: center;
  font-size: 13px;
  color: var(--sa-text-secondary);
  border-top: 1px solid var(--sa-border-color);
  background: var(--sa-card-bg);
}

/* ---------- Auth Pages ---------- */
.sa-auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a2332, #2a3a52);
  padding: 24px;
}

.sa-auth-card {
  background: var(--sa-card-bg);
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.sa-auth-card h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
}

.sa-auth-card p {
  color: var(--sa-text-secondary);
  font-size: 14px;
  margin-bottom: 24px;
}

/* ---------- Error Pages ---------- */
.sa-error-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  background: var(--sa-body-bg);
}

.sa-error-code {
  font-size: 120px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--sa-primary), var(--sa-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

/* ---------- Chat ---------- */
.sa-chat-message {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.sa-chat-message.sent {
  flex-direction: row-reverse;
}

.sa-chat-bubble {
  max-width: 60%;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
}

.sa-chat-message:not(.sent) .sa-chat-bubble {
  background: var(--sa-body-bg);
  border-bottom-left-radius: 4px;
}

.sa-chat-message.sent .sa-chat-bubble {
  background: var(--sa-primary);
  color: white;
  border-bottom-right-radius: 4px;
}

/* ---------- Kanban ---------- */
.sa-kanban-column {
  min-width: 300px;
  background: var(--sa-body-bg);
  border-radius: 12px;
  padding: 16px;
}

.sa-kanban-card {
  background: var(--sa-card-bg);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid var(--sa-border-color);
  cursor: grab;
  transition: var(--sa-transition);
}

.sa-kanban-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* ---------- Pricing ---------- */
.sa-pricing-card {
  background: var(--sa-card-bg);
  border-radius: 16px;
  border: 2px solid var(--sa-border-color);
  padding: 32px;
  text-align: center;
  transition: var(--sa-transition);
}

.sa-pricing-card.popular {
  border-color: var(--sa-primary);
  transform: scale(1.05);
}

.sa-pricing-card:hover {
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.sa-pricing-price {
  font-size: 48px;
  font-weight: 800;
  color: var(--sa-primary);
}

/* ---------- Invoice ---------- */
.sa-invoice-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 40px;
}

/* ---------- Profile ---------- */
.sa-profile-banner {
  height: 200px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--sa-primary), var(--sa-secondary));
  position: relative;
  margin-bottom: 60px;
}

.sa-profile-avatar {
  position: absolute;
  bottom: -40px;
  left: 24px;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 4px solid white;
  background: linear-gradient(135deg, var(--sa-primary), var(--sa-pink));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 32px;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ---------- File Manager ---------- */
.sa-file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  transition: var(--sa-transition);
  cursor: pointer;
}

.sa-file-item:hover {
  background: var(--sa-body-bg);
}

.sa-file-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .sa-sidebar {
    transform: translateX(-100%);
  }

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

  .sa-content-wrapper {
    margin-left: 0;
  }

  .sa-header {
    left: 0;
  }

  .sa-toggle-btn {
    display: block;
  }
}

@media (max-width: 768px) {
  .sa-main-content {
    padding: 16px;
  }

  .sa-search-box input {
    width: 180px;
  }

  .sa-pricing-card.popular {
    transform: scale(1);
  }
}

@media (max-width: 480px) {
  .sa-search-box {
    display: none;
  }

  .sa-header-user .user-name {
    display: none;
  }
}

/* ---------- Utility Classes ---------- */
.text-primary { color: var(--sa-primary) !important; }
.text-success { color: var(--sa-success) !important; }
.text-danger { color: var(--sa-danger) !important; }
.text-warning { color: var(--sa-warning) !important; }
.text-info { color: var(--sa-info) !important; }
.text-pink { color: var(--sa-pink) !important; }
.text-purple { color: var(--sa-purple) !important; }
.text-muted { color: var(--sa-text-secondary) !important; }

.bg-primary-subtle { background: rgba(79, 70, 229, 0.1) !important; }
.bg-success-subtle { background: rgba(16, 185, 129, 0.1) !important; }
.bg-danger-subtle { background: rgba(239, 68, 68, 0.1) !important; }
.bg-warning-subtle { background: rgba(245, 158, 11, 0.1) !important; }
.bg-info-subtle { background: rgba(59, 130, 246, 0.1) !important; }
.bg-pink-subtle { background: rgba(236, 72, 153, 0.1) !important; }
.bg-purple-subtle { background: rgba(139, 92, 246, 0.1) !important; }
.bg-teal-subtle { background: rgba(20, 184, 166, 0.1) !important; }
.bg-orange-subtle { background: rgba(249, 115, 22, 0.1) !important; }

/* Overlay for mobile sidebar */
.sa-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
}

.sa-sidebar-overlay.show {
  display: block;
}

/* Notification dropdown */
.sa-notification-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  width: 340px;
  background: var(--sa-card-bg);
  border: 1px solid var(--sa-border-color);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
  display: none;
  z-index: 1100;
}

.sa-notification-dropdown.show {
  display: block;
}

/* ---------- Marquee animation ---------- */
@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.animate-marquee {
  animation: marquee 30s linear infinite;
}

.animate-marquee:hover {
  animation-play-state: paused;
}

/* ---------- Header hover dropdowns ---------- */
.sa-hover-dropdown {
  position: relative;
}

.sa-hover-dropdown .sa-dropdown-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 340px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.18), 0 4px 12px rgba(15, 23, 42, 0.08);
  border: 1px solid rgba(226, 232, 240, 0.8);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
  z-index: 1100;
  overflow: hidden;
}

.sa-hover-dropdown::before {
  content: '';
  position: absolute;
  top: 100%;
  right: 0;
  width: 100%;
  height: 14px;
}

.sa-hover-dropdown:hover .sa-dropdown-panel,
.sa-hover-dropdown:focus-within .sa-dropdown-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.sa-dropdown-panel.dropdown-sm {
  min-width: 260px;
}

.sa-dropdown-panel.dropdown-lg {
  min-width: 360px;
}

.sa-dropdown-header {
  padding: 16px 20px;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sa-dropdown-header h6 {
  font-size: 14px;
  font-weight: 700;
  margin: 0;
}

.sa-dropdown-header .count-badge {
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  font-size: 11px;
  font-weight: 600;
}

.sa-dropdown-list {
  max-height: 320px;
  overflow-y: auto;
}

.sa-dropdown-list-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  transition: background 0.2s;
}

.sa-dropdown-list-item:last-child {
  border-bottom: none;
}

.sa-dropdown-list-item:hover {
  background: #f8fafc;
}

.sa-dropdown-list-item .item-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 16px;
  flex-shrink: 0;
}

.sa-dropdown-list-item .item-content {
  flex: 1;
  min-width: 0;
}

.sa-dropdown-list-item .item-title {
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.3;
}

.sa-dropdown-list-item .item-text {
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sa-dropdown-list-item .item-time {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 4px;
}

.sa-dropdown-footer {
  padding: 12px 20px;
  text-align: center;
  background: #f8fafc;
  border-top: 1px solid #f1f5f9;
}

.sa-dropdown-footer a {
  font-size: 13px;
  font-weight: 600;
  color: #4f46e5;
}

.sa-dropdown-footer a:hover {
  text-decoration: underline;
}

/* User profile dropdown */
.sa-dropdown-user-header {
  padding: 24px 20px;
  background: linear-gradient(135deg, #4f46e5, #ec4899);
  color: #ffffff;
  text-align: center;
}

.sa-dropdown-user-header .avatar-lg {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  border: 3px solid rgba(255, 255, 255, 0.3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
}

.sa-dropdown-user-header h6 {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
}

.sa-dropdown-user-header .role {
  font-size: 12px;
  opacity: 0.85;
  margin-top: 2px;
}

.sa-dropdown-menu-items {
  padding: 8px 0;
}

.sa-dropdown-menu-items a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  font-size: 13px;
  color: #475569;
  transition: all 0.2s;
}

.sa-dropdown-menu-items a:hover {
  background: #f8fafc;
  color: #4f46e5;
  padding-left: 24px;
}

.sa-dropdown-menu-items a i {
  font-size: 15px;
  width: 20px;
}

.sa-dropdown-menu-items .divider {
  height: 1px;
  background: #f1f5f9;
  margin: 4px 0;
}

.sa-dropdown-menu-items .logout {
  color: #ef4444;
}

.sa-dropdown-menu-items .logout:hover {
  background: rgba(239, 68, 68, 0.06);
  color: #dc2626;
}

/* ---------- App tile (used in quick apps dropdown) ---------- */
.sa-app-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 8px;
  border-radius: 10px;
  text-align: center;
  transition: background 0.2s ease;
}

.sa-app-tile:hover {
  background: #f1f5f9;
}

.sa-app-tile .tile-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.sa-app-tile .tile-label {
  font-size: 11px;
  color: #64748b;
  font-weight: 600;
}

/* Reusable gradient backgrounds */
.bg-grad-indigo-purple { background: linear-gradient(135deg, #4f46e5, #7c3aed); }
.bg-grad-cyan-blue { background: linear-gradient(135deg, #06b6d4, #3b82f6); }
.bg-grad-emerald-green { background: linear-gradient(135deg, #10b981, #059669); }
.bg-grad-amber-orange { background: linear-gradient(135deg, #f59e0b, #f97316); }
.bg-grad-pink-rose { background: linear-gradient(135deg, #ec4899, #f43f5e); }
.bg-grad-purple-pink { background: linear-gradient(135deg, #8b5cf6, #a855f7); }

/* Notification badge - red dot count */
.sa-count-pill {
  margin-left: auto;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 700;
}
