/* ============================================================
   ENTERPRISE ADMIN DASHBOARD - MASTER STYLESHEET
   Design System: Modern, Professional, Enterprise-Grade
   No glassmorphism. No text gradients. Pure, clean design.
   ============================================================ */

/* ---------- 1. FONTS ---------- */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* ---------- 2. THEME VARIABLES ---------- */
:root {
  /* Typography */
  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Light Theme (Default) */
  --bg-body: #F9FAFB;
  --bg-card: #FFFFFF;
  --bg-sidebar: #FFFFFF;
  --bg-navbar: #FFFFFF;
  --bg-hover: #F3F4F6;
  --bg-active: #EEF2FF;
  --bg-input: #FFFFFF;
  --bg-muted: #F3F4F6;

  /* Text */
  --text-primary: #111827;
  --text-secondary: #4B5563;
  --text-muted: #6B7280;
  --text-disabled: #9CA3AF;

  /* Borders */
  --border-color: #E5E7EB;
  --border-strong: #D1D5DB;

  /* Brand Colors */
  --primary: #6366F1;
  --primary-hover: #4F46E5;
  --primary-light: #EEF2FF;
  --secondary: #3B82F6;
  --success: #10B981;
  --success-light: #D1FAE5;
  --warning: #F59E0B;
  --warning-light: #FEF3C7;
  --danger: #EF4444;
  --danger-light: #FEE2E2;
  --info: #06B6D4;
  --info-light: #CFFAFE;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-sm: 0 1px 3px rgba(16, 24, 40, 0.06), 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(16, 24, 40, 0.06), 0 2px 4px -1px rgba(16, 24, 40, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(16, 24, 40, 0.08), 0 4px 6px -2px rgba(16, 24, 40, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(16, 24, 40, 0.1), 0 10px 10px -5px rgba(16, 24, 40, 0.04);

  /* Layout */
  --sidebar-width: 260px;
  --sidebar-collapsed-width: 80px;
  --navbar-height: 70px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- 3. DARK THEME ---------- */
[data-theme="dark"] {
  --bg-body: #1F2937;
  --bg-card: #111827;
  --bg-sidebar: #111827;
  --bg-navbar: #111827;
  --bg-hover: #374151;
  --bg-active: #1E293B;
  --bg-input: #1F2937;
  --bg-muted: #374151;

  --text-primary: #F9FAFB;
  --text-secondary: #D1D5DB;
  --text-muted: #9CA3AF;
  --text-disabled: #6B7280;

  --border-color: #374151;
  --border-strong: #4B5563;

  --primary-light: #1E1B4B;
  --success-light: #064E3B;
  --warning-light: #78350F;
  --danger-light: #7F1D1D;
  --info-light: #164E63;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6), 0 10px 10px -5px rgba(0, 0, 0, 0.3);
}

/* ---------- 4. BASE RESET ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-family);
  background-color: var(--bg-body);
  color: var(--text-primary);
  margin: 0;
  padding: 0;
  font-size: 14px;
  line-height: 1.6;
  transition: background-color var(--transition-base), color var(--transition-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--primary); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--primary-hover); }

h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: 700;
  margin: 0 0 0.5rem;
  letter-spacing: -0.01em;
}

h1 { font-size: 1.875rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }

p { color: var(--text-secondary); margin: 0 0 1rem; }

/* ---------- 5. CUSTOM SCROLLBAR ---------- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 4px;
  transition: background var(--transition-fast);
}
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ---------- 6. LAYOUT ---------- */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding-top: var(--navbar-height);
  transition: margin-left var(--transition-base);
  min-width: 0;
}

.main-content.collapsed {
  margin-left: var(--sidebar-collapsed-width);
}

.page-content {
  padding: 1.5rem;
  max-width: 1600px;
  margin: 0 auto;
}

@media (max-width: 1024px) {
  .main-content, .main-content.collapsed { margin-left: 0; }
}

/* ---------- 7. SIDEBAR ---------- */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  z-index: 1040;
  display: flex;
  flex-direction: column;
  transition: width var(--transition-base), transform var(--transition-base);
  overflow: hidden;
}

.sidebar.collapsed { width: var(--sidebar-collapsed-width); }

.sidebar-header {
  height: var(--navbar-height);
  display: flex;
  align-items: center;
  padding: 0 1.25rem;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
}

.sidebar-logo .logo-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.sidebar-logo .logo-text {
  transition: opacity var(--transition-base), transform var(--transition-base);
}

.sidebar.collapsed .logo-text { opacity: 0; width: 0; }

.sidebar-nav {
  flex: 1;
  padding: 1rem 0.75rem;
  overflow-y: auto;
  overflow-x: hidden;
}

.nav-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 0.75rem 1rem 0.5rem;
  white-space: nowrap;
}

.sidebar.collapsed .nav-section-title { opacity: 0; height: 0; padding: 0; margin: 0; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.7rem 1rem;
  margin-bottom: 0.25rem;
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  position: relative;
}

.nav-item i { font-size: 1.1rem; width: 20px; text-align: center; flex-shrink: 0; }
.nav-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.nav-item.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.nav-item.active i { color: var(--primary); }

.nav-label {
  flex: 1;
  transition: opacity var(--transition-base);
}

.sidebar.collapsed .nav-label { opacity: 0; width: 0; }

.nav-badge {
  background: var(--danger);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}

.sidebar.collapsed .nav-badge { display: none; }

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid var(--border-color);
  flex-shrink: 0;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
  border-radius: var(--radius-md);
  transition: background var(--transition-fast);
}

.sidebar-user:hover { background: var(--bg-hover); }

.sidebar-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}

.sidebar-user-info {
  flex: 1;
  min-width: 0;
  transition: opacity var(--transition-base);
}

.sidebar.collapsed .sidebar-user-info { opacity: 0; width: 0; }

.sidebar-user-name { font-weight: 600; font-size: 0.875rem; color: var(--text-primary); }
.sidebar-user-role { font-size: 0.75rem; color: var(--text-muted); }

/* Mobile sidebar */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1035;
  opacity: 0;
  transition: opacity var(--transition-base);
}

.sidebar-overlay.show { display: block; opacity: 1; }

@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: var(--shadow-xl);
  }
  .sidebar.mobile-open { transform: translateX(0); }
}

/* ---------- 8. NAVBAR ---------- */
.navbar {
  position: fixed;
  top: 0;
  right: 0;
  left: var(--sidebar-width);
  height: var(--navbar-height);
  background: var(--bg-navbar);
  border-bottom: 1px solid var(--border-color);
  z-index: 1030;
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1rem;
  transition: left var(--transition-base);
}

.navbar.collapsed { left: var(--sidebar-collapsed-width); }

@media (max-width: 1024px) {
  .navbar, .navbar.collapsed { left: 0; }
}

.navbar-toggle {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.navbar-toggle:hover { background: var(--bg-hover); color: var(--text-primary); }

.navbar-search {
  flex: 1;
  max-width: 400px;
  position: relative;
}

.navbar-search input {
  width: 100%;
  padding: 0.6rem 1rem 0.6rem 2.5rem;
  background: var(--bg-muted);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.875rem;
  transition: all var(--transition-fast);
}

.navbar-search input:focus {
  outline: none;
  background: var(--bg-input);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.navbar-search i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.9rem;
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

.navbar-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: transparent;
  border: none;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: all var(--transition-fast);
}

.navbar-icon-btn:hover { background: var(--bg-hover); color: var(--text-primary); }

.navbar-icon-btn .badge-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid var(--bg-navbar);
}

.navbar-divider {
  width: 1px;
  height: 28px;
  background: var(--border-color);
  margin: 0 0.5rem;
}

.navbar-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.35rem 0.75rem 0.35rem 0.35rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.navbar-profile:hover { background: var(--bg-hover); }

.navbar-profile-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
}

.navbar-profile-info { line-height: 1.2; }
.navbar-profile-name { font-weight: 600; font-size: 0.875rem; color: var(--text-primary); }
.navbar-profile-role { font-size: 0.75rem; color: var(--text-muted); }

@media (max-width: 768px) {
  .navbar-search { display: none; }
  .navbar-profile-info { display: none; }
  .navbar-divider { display: none; }
}

/* ---------- 9. DROPDOWNS ---------- */
.dropdown-menu-custom {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  min-width: 280px;
  padding: 0.5rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all var(--transition-fast);
  z-index: 1050;
}

.dropdown-menu-custom.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-header {
  padding: 0.75rem 0.75rem 0.5rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 0.5rem;
}

.dropdown-header h6 { margin: 0; font-size: 0.95rem; }
.dropdown-header p { margin: 0; font-size: 0.75rem; }

.dropdown-item-custom {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-md);
  color: var(--text-primary);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.dropdown-item-custom:hover { background: var(--bg-hover); }
.dropdown-item-custom i { color: var(--text-muted); width: 18px; }

.dropdown-divider { height: 1px; background: var(--border-color); margin: 0.5rem 0; }

/* Notification dropdown */
.notification-dropdown { min-width: 360px; max-height: 420px; overflow-y: auto; }

.notification-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.notification-item:hover { background: var(--bg-hover); }
.notification-item.unread { background: var(--bg-active); }

.notification-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.9rem;
}

.notification-icon.primary { background: var(--primary-light); color: var(--primary); }
.notification-icon.success { background: var(--success-light); color: var(--success); }
.notification-icon.warning { background: var(--warning-light); color: var(--warning); }
.notification-icon.danger { background: var(--danger-light); color: var(--danger); }

.notification-content { flex: 1; min-width: 0; }
.notification-title { font-weight: 600; font-size: 0.875rem; margin: 0 0 0.2rem; }
.notification-text { font-size: 0.8rem; color: var(--text-muted); margin: 0; }
.notification-time { font-size: 0.7rem; color: var(--text-disabled); margin-top: 0.25rem; }

/* ---------- 10. PAGE HEADER ---------- */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.page-header-content h1 { margin-bottom: 0.25rem; }
.page-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}
.page-breadcrumb a { color: var(--text-muted); }
.page-breadcrumb a:hover { color: var(--primary); }
.page-breadcrumb .separator { color: var(--border-strong); }

.page-header-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* ---------- 11. CARDS ---------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  transition: all var(--transition-base);
}

.card:hover { box-shadow: var(--shadow-sm); }

.card-body { padding: 1.5rem; }
.card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.card-header h3 { margin: 0; font-size: 1.05rem; }
.card-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  background: var(--bg-muted);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ---------- 12. STAT CARDS ---------- */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.stat-card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.stat-card-icon.primary { background: var(--primary-light); color: var(--primary); }
.stat-card-icon.success { background: var(--success-light); color: var(--success); }
.stat-card-icon.warning { background: var(--warning-light); color: var(--warning); }
.stat-card-icon.danger { background: var(--danger-light); color: var(--danger); }
.stat-card-icon.info { background: var(--info-light); color: var(--info); }

.stat-card-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
  margin: 0;
}

.stat-card-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0.25rem 0;
  letter-spacing: -0.02em;
}

.stat-card-change {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 20px;
}

.stat-card-change.positive { background: var(--success-light); color: var(--success); }
.stat-card-change.negative { background: var(--danger-light); color: var(--danger); }

/* ---------- 13. BUTTONS ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.1rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: inherit;
  white-space: nowrap;
}

.btn:focus { outline: none; box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15); }

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); color: white; transform: translateY(-1px); box-shadow: var(--shadow-md); }

.btn-secondary { background: var(--bg-muted); color: var(--text-primary); border-color: var(--border-color); }
.btn-secondary:hover { background: var(--bg-hover); }

.btn-outline { background: transparent; color: var(--text-primary); border-color: var(--border-color); }
.btn-outline:hover { background: var(--bg-hover); border-color: var(--border-strong); }

.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #059669; color: white; }

.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #DC2626; color: white; }

.btn-warning { background: var(--warning); color: white; }
.btn-warning:hover { background: #D97706; color: white; }

.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); }

.btn-sm { padding: 0.4rem 0.75rem; font-size: 0.8rem; }
.btn-lg { padding: 0.8rem 1.5rem; font-size: 0.95rem; }
.btn-icon { width: 38px; height: 38px; padding: 0; }

/* ---------- 14. FORMS ---------- */
.form-group { margin-bottom: 1.25rem; }

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.form-control, .form-select {
  width: 100%;
  padding: 0.65rem 0.9rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: inherit;
  transition: all var(--transition-fast);
}

.form-control:focus, .form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-control::placeholder { color: var(--text-disabled); }

textarea.form-control { min-height: 100px; resize: vertical; }

.form-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.form-check-input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

.form-check-label { cursor: pointer; font-size: 0.9rem; }

/* Toggle switch */
.form-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-color);
}

.form-switch:last-child { border-bottom: none; }

.form-switch-label { font-weight: 500; }
.form-switch-desc { font-size: 0.8rem; color: var(--text-muted); margin: 0.25rem 0 0; }

.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.switch input { opacity: 0; width: 0; height: 0; }

.switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--border-strong);
  border-radius: 24px;
  transition: var(--transition-fast);
}

.switch-slider::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: var(--transition-fast);
}

.switch input:checked + .switch-slider { background: var(--primary); }
.switch input:checked + .switch-slider::before { transform: translateX(20px); }

/* ---------- 15. TABLES ---------- */
.table-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.table-responsive { overflow-x: auto; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.data-table thead {
  background: var(--bg-muted);
  border-bottom: 1px solid var(--border-color);
}

.data-table th {
  padding: 0.9rem 1.25rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  white-space: nowrap;
}

.data-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  vertical-align: middle;
}

.data-table tbody tr { transition: background var(--transition-fast); }
.data-table tbody tr:hover { background: var(--bg-hover); }
.data-table tbody tr:last-child td { border-bottom: none; }

.table-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.table-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.table-user-info { line-height: 1.3; }
.table-user-name { font-weight: 600; color: var(--text-primary); }
.table-user-email { font-size: 0.8rem; color: var(--text-muted); }

.table-actions {
  display: flex;
  gap: 0.25rem;
}

.table-action-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.table-action-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.table-action-btn.danger:hover { background: var(--danger-light); color: var(--danger); }

/* ---------- 16. BADGES ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 20px;
  white-space: nowrap;
}

.badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-success { background: var(--success-light); color: var(--success); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-info { background: var(--info-light); color: var(--info); }
.badge-muted { background: var(--bg-muted); color: var(--text-muted); }

.badge-solid { color: white; }
.badge-solid::before { background: white; }
.badge-solid.primary { background: var(--primary); }
.badge-solid.success { background: var(--success); }
.badge-solid.warning { background: var(--warning); }
.badge-solid.danger { background: var(--danger); }

/* ---------- 17. PAGINATION ---------- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border-color);
  background: var(--bg-card);
}

.pagination-info { font-size: 0.85rem; color: var(--text-muted); }

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.page-btn {
  min-width: 36px;
  height: 36px;
  padding: 0 0.5rem;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.page-btn:hover:not(:disabled) { background: var(--bg-hover); color: var(--text-primary); }
.page-btn.active { background: var(--primary); color: white; border-color: var(--primary); }
.page-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- 18. MODALS ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1060;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}

.modal-overlay.show { opacity: 1; visibility: visible; }

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  max-width: 540px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: scale(0.95);
  transition: transform var(--transition-base);
}

.modal-overlay.show .modal { transform: scale(1); }

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 { margin: 0; }

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.modal-close:hover { background: var(--bg-hover); color: var(--text-primary); }

.modal-body { padding: 1.5rem; overflow-y: auto; flex: 1; }

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* ---------- 19. TABS ---------- */
.tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
  overflow-x: auto;
}

.tab {
  padding: 0.75rem 1.25rem;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
  font-family: inherit;
  font-size: 0.9rem;
}

.tab:hover { color: var(--text-primary); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.3s ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- 20. CHARTS ---------- */
.chart-container {
  position: relative;
  width: 100%;
  height: 320px;
}

.chart-container.sm { height: 240px; }
.chart-container.lg { height: 400px; }

/* ---------- 21. ACTIVITY FEED ---------- */
.activity-feed { display: flex; flex-direction: column; gap: 1rem; }

.activity-item {
  display: flex;
  gap: 0.875rem;
  padding: 0.75rem 0;
}

.activity-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.85rem;
}

.activity-content { flex: 1; }
.activity-text { margin: 0 0 0.25rem; font-size: 0.9rem; color: var(--text-primary); }
.activity-text strong { font-weight: 600; }
.activity-time { font-size: 0.75rem; color: var(--text-muted); margin: 0; }

/* ---------- 22. CALENDAR ---------- */
.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.calendar-nav { display: flex; gap: 0.5rem; }

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.5rem;
}

.calendar-day-header {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.5rem;
}

.calendar-day {
  aspect-ratio: 1;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.5rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
  min-height: 80px;
}

.calendar-day:hover { border-color: var(--primary); }
.calendar-day.other-month { opacity: 0.4; }
.calendar-day.today { border-color: var(--primary); background: var(--primary-light); }

.calendar-day-num {
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
}

.calendar-event {
  font-size: 0.7rem;
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  margin-bottom: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: white;
  font-weight: 500;
}

.calendar-event.primary { background: var(--primary); }
.calendar-event.success { background: var(--success); }
.calendar-event.warning { background: var(--warning); }
.calendar-event.danger { background: var(--danger); }

@media (max-width: 768px) {
  .calendar-day { min-height: 60px; padding: 0.25rem; }
  .calendar-event { display: none; }
  .calendar-day.has-event::after {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary);
    margin: 0.25rem auto 0;
  }
}

/* ---------- 23. FILE MANAGER ---------- */
.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}

.file-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.file-item:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.file-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 0.75rem;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.file-icon.folder { background: var(--warning-light); color: var(--warning); }
.file-icon.image { background: var(--success-light); color: var(--success); }
.file-icon.document { background: var(--primary-light); color: var(--primary); }
.file-icon.video { background: var(--danger-light); color: var(--danger); }
.file-icon.audio { background: var(--info-light); color: var(--info); }

.file-name {
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-meta { font-size: 0.75rem; color: var(--text-muted); }

/* Storage bar */
.storage-bar {
  height: 8px;
  background: var(--bg-muted);
  border-radius: 4px;
  overflow: hidden;
  margin: 0.5rem 0;
}

.storage-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 4px;
  transition: width var(--transition-base);
}

/* ---------- 24. MESSAGES ---------- */
.messages-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 1.5rem;
  height: calc(100vh - var(--navbar-height) - 140px);
  min-height: 500px;
}

.messages-list {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.messages-list-header {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.messages-list-body { overflow-y: auto; flex: 1; }

.message-item {
  display: flex;
  gap: 0.75rem;
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.message-item:hover { background: var(--bg-hover); }
.message-item.active { background: var(--bg-active); }
.message-item.unread .message-sender { font-weight: 700; }
.message-item.unread::before {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--primary);
  border-radius: 50%;
  position: absolute;
  left: 0.5rem;
  top: 1.25rem;
}

.message-item { position: relative; }

.message-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}

.message-content { flex: 1; min-width: 0; }
.message-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.25rem;
}

.message-sender { font-weight: 600; font-size: 0.9rem; color: var(--text-primary); }
.message-time { font-size: 0.75rem; color: var(--text-muted); }
.message-subject { font-size: 0.85rem; font-weight: 500; margin-bottom: 0.25rem; color: var(--text-primary); }
.message-preview { font-size: 0.8rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.message-detail {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.message-detail-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.message-detail-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.message-detail-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  background: var(--bg-muted);
}

@media (max-width: 1024px) {
  .messages-layout { grid-template-columns: 1fr; }
  .message-detail { display: none; }
  .message-detail.active-mobile { display: flex; }
}

/* ---------- 25. PRODUCT CARDS ---------- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition-base);
}

.product-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.product-image {
  height: 180px;
  background: var(--bg-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: var(--text-muted);
  position: relative;
}

.product-badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
}

.product-body { padding: 1.25rem; }
.product-category { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.product-name { font-weight: 600; font-size: 1rem; margin: 0.25rem 0 0.5rem; color: var(--text-primary); }

.product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
  margin-top: 0.75rem;
}

.product-price { font-weight: 700; font-size: 1.1rem; color: var(--text-primary); }
.product-stock { font-size: 0.8rem; color: var(--text-muted); }

/* ---------- 26. FAQ ACCORDION ---------- */
.accordion-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 0.75rem;
  overflow: hidden;
}

.accordion-header {
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  font-weight: 600;
  transition: background var(--transition-fast);
}

.accordion-header:hover { background: var(--bg-hover); }
.accordion-header i { transition: transform var(--transition-fast); color: var(--text-muted); }
.accordion-item.open .accordion-header i { transform: rotate(180deg); }

.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-base);
  padding: 0 1.25rem;
}

.accordion-item.open .accordion-body {
  max-height: 500px;
  padding: 0 1.25rem 1.25rem;
}

/* ---------- 27. FOOTER ---------- */
.app-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--border-color);
  background: var(--bg-card);
  margin-top: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-links { display: flex; gap: 1.5rem; }
.footer-links a { color: var(--text-muted); }
.footer-links a:hover { color: var(--primary); }

/* ---------- 28. UTILITIES ---------- */
.text-primary-c { color: var(--primary) !important; }
.text-success-c { color: var(--success) !important; }
.text-danger-c { color: var(--danger) !important; }
.text-warning-c { color: var(--warning) !important; }
.text-muted-c { color: var(--text-muted) !important; }

.bg-primary-c { background: var(--primary-light); }
.bg-success-c { background: var(--success-light); }
.bg-warning-c { background: var(--warning-light); }
.bg-danger-c { background: var(--danger-light); }

.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }

/* ---------- 29. PRINT STYLES ---------- */
@media print {
  .sidebar, .navbar, .app-footer, .page-header-actions { display: none !important; }
  .main-content { margin-left: 0 !important; padding-top: 0 !important; }
  .card, .stat-card, .table-wrapper { box-shadow: none !important; border: 1px solid #ccc !important; }
  body { background: white !important; color: black !important; }
}

/* ---------- 30. RESPONSIVE ---------- */
@media (max-width: 768px) {
  .page-content { padding: 1rem; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .stat-card-value { font-size: 1.5rem; }
  .card-body { padding: 1rem; }
  .data-table th, .data-table td { padding: 0.75rem; }
}