/* ========================================== */
/* MULTI-THEME SYSTEM (6 Themes Available)    */
/* ========================================== */

/* THEME 1: Light Mode (Default) */
:root,
[data-theme="light"] {
  --bg-primary: #f8f9fa;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f3f5;
  --bg-card: #ffffff;
  --bg-hover: #e9ecef;
  
  --border-color: #dee2e6;
  --border-light: #e9ecef;
  
  --text-primary: #212529;
  --text-secondary: #495057;
  --text-muted: #6c757d;
  
  --accent-primary: #0d6efd;
  --accent-secondary: #6610f2;
  --accent-gradient: linear-gradient(135deg, #0d6efd, #6610f2);
  
  --success: #198754;
  --warning: #ffc107;
  --danger: #dc3545;
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.12);
}

/* THEME 2: Dark Mode */
[data-theme="dark"] {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-tertiary: #1a1a24;
  --bg-card: #16161f;
  --bg-hover: #1e1e2a;
  
  --border-color: #2a2a3a;
  --border-light: #3a3a4a;
  
  --text-primary: #ffffff;
  --text-secondary: #a0a0b0;
  --text-muted: #6a6a7a;
  
  --accent-primary: #3b82f6;
  --accent-secondary: #8b5cf6;
  --accent-gradient: linear-gradient(135deg, #3b82f6, #8b5cf6);
  
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.5);
}

/* THEME 3: Soft Purple (Elegant & Feminine) */
[data-theme="purple"] {
  --bg-primary: #faf5ff;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f3e8ff;
  --bg-card: #ffffff;
  --bg-hover: #e9d5ff;
  
  --border-color: #d8b4fe;
  --border-light: #e9d5ff;
  
  --text-primary: #1f2937;
  --text-secondary: #4b5563;
  --text-muted: #6b7280;
  
  --accent-primary: #8b5cf6;
  --accent-secondary: #ec4899;
  --accent-gradient: linear-gradient(135deg, #8b5cf6, #ec4899);
  
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  
  --shadow-sm: 0 1px 3px rgba(139, 92, 246, 0.12);
  --shadow-md: 0 4px 6px rgba(139, 92, 246, 0.15);
  --shadow-lg: 0 10px 15px rgba(139, 92, 246, 0.2);
}

/* THEME 4: Professional Blue (Corporate) */
[data-theme="blue"] {
  --bg-primary: #f0f4f8;
  --bg-secondary: #ffffff;
  --bg-tertiary: #e1e8ed;
  --bg-card: #ffffff;
  --bg-hover: #d9e2ec;
  
  --border-color: #cbd5e0;
  --border-light: #e1e8ed;
  
  --text-primary: #1a202c;
  --text-secondary: #2d3748;
  --text-muted: #4a5568;
  
  --accent-primary: #2563eb;
  --accent-secondary: #0891b2;
  --accent-gradient: linear-gradient(135deg, #2563eb, #0891b2);
  
  --success: #059669;
  --warning: #d97706;
  --danger: #dc2626;
  
  --shadow-sm: 0 1px 3px rgba(37, 99, 235, 0.1);
  --shadow-md: 0 4px 6px rgba(37, 99, 235, 0.12);
  --shadow-lg: 0 10px 15px rgba(37, 99, 235, 0.15);
}

/* THEME 5: Warm Orange (Friendly & Energetic) */
[data-theme="orange"] {
  --bg-primary: #fffbf5;
  --bg-secondary: #ffffff;
  --bg-tertiary: #fff4e6;
  --bg-card: #ffffff;
  --bg-hover: #ffedd5;
  
  --border-color: #fed7aa;
  --border-light: #ffedd5;
  
  --text-primary: #292524;
  --text-secondary: #44403c;
  --text-muted: #78716c;
  
  --accent-primary: #ea580c;
  --accent-secondary: #f59e0b;
  --accent-gradient: linear-gradient(135deg, #ea580c, #f59e0b);
  
  --success: #16a34a;
  --warning: #eab308;
  --danger: #dc2626;
  
  --shadow-sm: 0 1px 3px rgba(234, 88, 12, 0.1);
  --shadow-md: 0 4px 6px rgba(234, 88, 12, 0.12);
  --shadow-lg: 0 10px 15px rgba(234, 88, 12, 0.15);
}

/* THEME 6: Fresh Green (Nature & Calm) */
[data-theme="green"] {
  --bg-primary: #f0fdf4;
  --bg-secondary: #ffffff;
  --bg-tertiary: #dcfce7;
  --bg-card: #ffffff;
  --bg-hover: #bbf7d0;
  
  --border-color: #86efac;
  --border-light: #bbf7d0;
  
  --text-primary: #14532d;
  --text-secondary: #166534;
  --text-muted: #4b5563;
  
  --accent-primary: #16a34a;
  --accent-secondary: #059669;
  --accent-gradient: linear-gradient(135deg, #16a34a, #059669);
  
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #dc2626;
  
  --shadow-sm: 0 1px 3px rgba(22, 163, 74, 0.1);
  --shadow-md: 0 4px 6px rgba(22, 163, 74, 0.12);
  --shadow-lg: 0 10px 15px rgba(22, 163, 74, 0.15);
}

/* ========================================== */
/* Theme Selector Dropdown                    */
/* ========================================== */

.theme-selector {
  position: relative;
  display: inline-block;
}

.theme-selector-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.theme-selector-btn:hover {
  background: var(--bg-hover);
  border-color: var(--accent-primary);
}

.theme-selector-btn i {
  font-size: 18px;
  color: var(--accent-primary);
}

.theme-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 240px;
  max-height: 400px;
  overflow-y: auto;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-dropdown.active,
.theme-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.theme-dropdown-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.theme-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}

.theme-option:hover {
  background: var(--bg-hover);
}

.theme-option.active {
  background: var(--bg-tertiary);
  border-left-color: var(--accent-primary);
}

.theme-preview {
  display: flex;
  gap: 4px;
  align-items: center;
}

.theme-color-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--bg-secondary);
  box-shadow: 0 0 0 1px var(--border-color);
}

.theme-info {
  flex: 1;
}

.theme-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.theme-desc {
  font-size: 12px;
  color: var(--text-muted);
}

.theme-check {
  color: var(--accent-primary);
  font-size: 18px;
  opacity: 0;
  transition: opacity 0.2s;
}

.theme-option.active .theme-check {
  opacity: 1;
}

/* Smooth transitions */
* {
  transition: background-color 0.3s ease, 
              color 0.3s ease, 
              border-color 0.3s ease,
              box-shadow 0.3s ease;
}

/* Prevent transition on page load */
.no-transition * {
  transition: none !important;
}

/* ========================================== */
/* REST OF YOUR EXISTING CSS...               */
/* (Keep all your existing styles below)      */
/* ========================================== */

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Login Page */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  background-image: 
    radial-gradient(ellipse at top, rgba(59, 130, 246, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse at bottom, rgba(139, 92, 246, 0.1) 0%, transparent 50%);
  padding: 20px;
}

.login-container {
  width: 100%;
  max-width: 420px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow-lg);
}

.login-header {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo {
  width: 80px;
  height: 80px;
  background: var(--accent-gradient);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 36px;
  color: white;
  box-shadow: 0 8px 32px rgba(59, 130, 246, 0.3);
}

.login-header h1 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-header p {
  color: var(--text-secondary);
  font-size: 14px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.input-icon {
  position: relative;
}

.input-icon i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 18px;
}

.input-icon input {
  width: 100%;
  padding: 14px 14px 14px 46px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  transition: all 0.2s;
}

.input-icon input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.input-icon input::placeholder {
  color: var(--text-muted);
}

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

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

.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--bg-hover);
}

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

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

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
}

.btn-block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

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

/* Dashboard Layout */
.dashboard {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 280px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  z-index: 100;
  transition: all 0.3s;
}

#sidebarMenu {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar.collapsed {
  width: 80px;
}

.sidebar.collapsed .logo span,
.sidebar.collapsed .user-info,
.sidebar.collapsed .nav-section-title,
.sidebar.collapsed .nav-link span,
.sidebar.collapsed .btn-logout span {
  display: none;
}

.sidebar.collapsed .sidebar-header {
  justify-content: center;
}

.sidebar.collapsed .sidebar-user {
  justify-content: center;
}

.sidebar.collapsed .nav-link {
  justify-content: center;
  padding: 14px;
}

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

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

.logo i {
  font-size: 28px;
  color: var(--accent-primary);
}

.logo span {
  font-size: 20px;
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-toggle {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.sidebar-toggle:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
}

.user-avatar {
  width: 44px;
  height: 44px;
  background: var(--accent-gradient);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 20px;
  flex-shrink: 0;
}

.user-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.user-name {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 12px;
  color: var(--accent-primary);
  text-transform: capitalize;
}

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

.nav-section {
  padding: 0 12px;
  margin-bottom: 16px;
}

.nav-section-title {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  padding: 8px 12px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-md);
  margin-bottom: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

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

.nav-link.active {
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent-primary);
}

.nav-link i {
  font-size: 20px;
  width: 24px;
  text-align: center;
}

.nav-link span {
  font-size: 14px;
  font-weight: 500;
}

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

.btn-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px;
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-logout:hover {
  background: rgba(239, 68, 68, 0.2);
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: 280px;
  min-height: 100vh;
  transition: all 0.3s;
  overflow-x: hidden;
  max-width: calc(100vw - 280px);
}

/* Mobile: paksa full width tanpa margin sidebar */
@media screen and (max-width: 1024px) {
  .main-content {
    margin-left: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
  }
}

.sidebar.collapsed ~ .main-content {
  margin-left: 80px;
  max-width: calc(100vw - 80px);
}

.top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 50;
}

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

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 24px;
  cursor: pointer;
}

.header-left h2 {
  font-size: 20px;
  font-weight: 600;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--text-secondary);
  font-size: 14px;
}

.content-wrapper {
  padding: 24px;
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Stats Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all 0.2s;
}

.stat-card:hover {
  border-color: var(--accent-primary);
  transform: translateY(-2px);
}

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

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.stat-icon.blue {
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent-primary);
}

.stat-icon.purple {
  background: rgba(139, 92, 246, 0.15);
  color: var(--accent-secondary);
}

.stat-icon.green {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
}

.stat-icon.orange {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
}

.stat-value {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 14px;
  color: var(--text-secondary);
}

/* Data Table */
.data-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 24px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

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

.card-title {
  font-size: 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-title i {
  color: var(--accent-primary);
}

.card-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
}

.search-box i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.search-box input {
  padding: 10px 12px 10px 38px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 13px;
  width: 200px;
}

.search-box input:focus {
  outline: none;
  border-color: var(--accent-primary);
}

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

.data-table th,
.data-table td {
  padding: 14px 20px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.data-table th {
  background: var(--bg-tertiary);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
}

.data-table td {
  font-size: 14px;
}

.data-table tr:hover td {
  background: var(--bg-hover);
}

.data-table .actions {
  display: flex;
  gap: 8px;
}

.btn-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-icon.edit {
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent-primary);
}

.btn-icon.delete {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

.btn-icon:hover {
  opacity: 0.8;
}

/* Status Badge */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.badge.active {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
}

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

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

.badge.info {
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent-primary);
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.9);
  transition: all 0.3s;
}

.modal-overlay.active .modal {
  transform: scale(1);
}

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

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

.modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 24px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 24px;
}

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

/* Form Styles */
.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
}

.form-group select {
  cursor: pointer;
}

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

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 24px;
}

.empty-state i {
  font-size: 64px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.empty-state h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--text-secondary);
  font-size: 14px;
}

/* Report Card */
.report-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
}

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

.report-title {
  font-size: 16px;
  font-weight: 600;
}

.progress-bar {
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 8px;
}

.progress-fill {
  height: 100%;
  background: var(--accent-gradient);
  border-radius: 4px;
  transition: width 0.3s;
}

.progress-fill.success {
  background: var(--success);
}

.progress-fill.warning {
  background: var(--warning);
}

.progress-fill.danger {
  background: var(--danger);
}

/* Recommendation Card */
.recommendation-card {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
}

.recommendation-card h4 {
  color: var(--warning);
  font-size: 14px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.recommendation-card p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Chart Container */
.chart-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
}

.chart-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 20px;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-tertiary);
  padding: 4px;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
}

.tab {
  flex: 1;
  padding: 12px 16px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

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

.tab.active {
  background: var(--accent-primary);
  color: white;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 16px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 2000;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.success {
  border-left: 4px solid var(--success);
}

.toast.error {
  border-left: 4px solid var(--danger);
}

.toast i {
  font-size: 20px;
}

.toast.success i {
  color: var(--success);
}

.toast.error i {
  color: var(--danger);
}

/* Loading */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

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

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-light);
}

/* Responsive */
@media (max-width: 1024px) {
  /* Sidebar di mobile: fixed overlay, tidak mempengaruhi flex layout */
  .sidebar {
    position: fixed !important;
    left: 0;
    top: 0;
    height: 100vh;
    width: 280px !important;
    transform: translateX(-100%);
    z-index: 999;
    transition: transform 0.3s ease;
    /* Tidak mengambil ruang di flex layout */
    flex: 0 0 0 !important;
    min-width: 0 !important;
  }

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

  /* Main content ambil seluruh lebar */
  .main-content {
    margin-left: 0 !important;
    max-width: 100vw !important;
    width: 100vw !important;
    min-width: 0 !important;
  }

  .sidebar.collapsed ~ .main-content,
  .sidebar ~ .main-content {
    margin-left: 0 !important;
    max-width: 100vw !important;
    width: 100vw !important;
  }

  /* Dashboard tidak pakai flex di mobile */
  .dashboard {
    display: block !important;
  }

  .mobile-menu-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
  }

  .sidebar-toggle {
    display: none !important;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  /* Theme dropdown di mobile - biarkan JS yang atur posisi */
  .theme-selector-btn span {
    display: none;
  }
}

@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .data-table {
    display: block;
    overflow-x: auto;
  }
  
  .card-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .card-actions {
    width: 100%;
  }
  
  .search-box input {
    width: 100%;
  }
}

/* Select Styling */
select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* Detail View */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.info-item {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
}

.info-label {
  color: var(--text-secondary);
  font-size: 14px;
}

.info-value {
  font-weight: 500;
  font-size: 14px;
}

/* Grade Display */
.grade-display {
  text-align: center;
  padding: 24px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-lg);
}

.grade-value {
  font-size: 64px;
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.grade-label {
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: 8px;
}

/* Nested Table */
.nested-table {
  margin-left: 40px;
  margin-top: 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.nested-table th {
  background: var(--bg-secondary);
}

/* ========================================== */
/* FIX: Tabel Input Nilai - Horizontal Scroll */
/* ========================================== */

/* Wrapper untuk tabel yang bisa scroll */
.table-scroll-wrapper {
  width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  margin: 0;
  border: none;
}

/* Tabel input nilai khusus */
.table-scroll-wrapper .data-table {
  width: max-content;
  min-width: 100%;
  margin-bottom: 0;
}

/* Kolom yang di-freeze (sticky) */
.col-freeze-nim {
  position: sticky !important;
  left: 0;
  background: var(--bg-card) !important;
  z-index: 10 !important;
  box-shadow: 2px 0 5px rgba(0,0,0,0.1);
}

.col-freeze-nama {
  position: sticky !important;
  left: 100px;
  background: var(--bg-card) !important;
  z-index: 10 !important;
  box-shadow: 2px 0 5px rgba(0,0,0,0.1);
}

.col-freeze-aksi {
  position: sticky !important;
  right: 0;
  background: var(--bg-card) !important;
  z-index: 10 !important;
  box-shadow: -2px 0 5px rgba(0,0,0,0.1);
  min-width: 100px;
}

/* Header juga sticky */
.table-scroll-wrapper thead th.col-freeze-nim,
.table-scroll-wrapper thead th.col-freeze-nama,
.table-scroll-wrapper thead th.col-freeze-aksi {
  z-index: 11 !important;
}

/* Input cell untuk nilai */
.nilai-cell {
  min-width: 120px;
  max-width: 150px;
  padding: 12px 8px;
  white-space: nowrap;
}

/* Input nilai */
.nilai-input {
  width: 90px;
  padding: 10px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-primary);
  text-align: center;
  font-size: 14px;
  transition: all 0.2s;
}

.nilai-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  background: var(--bg-hover);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.nilai-input::-webkit-inner-spin-button,
.nilai-input::-webkit-outer-spin-button {
  opacity: 1;
}

/* Scroll hint */
.scroll-hint {
  background: linear-gradient(90deg, transparent, var(--accent-primary));
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 60px;
  pointer-events: none;
  opacity: 0.3;
  z-index: 5;
  animation: scrollHint 2s ease-in-out infinite;
}

@keyframes scrollHint {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.6; }
}

/* Responsive scroll behavior */
@media (max-width: 1200px) {
  .col-freeze-nama {
    position: relative !important;
    left: auto;
    box-shadow: none;
  }
}

/* ========================================== */
/* Nilai Input: Status Visual Feedback        */
/* ========================================== */
.nilai-input {
  transition: border-color 0.3s, background 0.3s, box-shadow 0.3s;
}

/* Sudah tersimpan → border hijau */
.nilai-input.nilai-saved {
  border-color: var(--success) !important;
  background: rgba(34, 197, 94, 0.08) !important;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.15) !important;
}

/* Sedang menyimpan → border kuning, opacity */
.nilai-input.nilai-saving {
  border-color: var(--warning) !important;
  background: rgba(245, 158, 11, 0.08) !important;
  opacity: 0.7;
  cursor: not-allowed;
}

/* Ketika user mengedit ulang → kembali normal */
.nilai-input.nilai-edited {
  border-color: var(--accent-primary) !important;
  background: rgba(59, 130, 246, 0.08) !important;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2) !important;
}

/* ==========================================
   STICKY TABLE HEADER & HORIZONTAL SCROLL
   ========================================== */

/* Wrapper scrollable table */
.data-card > div[style*="overflow-x"] {
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* Sticky header */
.data-table thead {
  position: sticky;
  top: 0;
  z-index: 10;
}

.data-table thead th {
  background: var(--bg-card) !important;
  border-bottom: 2px solid var(--border-color);
  white-space: nowrap;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
  padding: 12px 16px;
}

/* ✅ FREEZE KOLOM KIRI: KODE & NAMA MK */
.data-table th:nth-child(1),
.data-table td:nth-child(1) {
  position: sticky;
  left: 0;
  background: var(--bg-card);
  z-index: 8;
  box-shadow: 2px 0 4px rgba(0, 0, 0, 0.05);
}

.data-table th:nth-child(2),
.data-table td:nth-child(2) {
  position: sticky;
  left: 100px; /* Sesuaikan dengan lebar kolom KODE */
  background: var(--bg-card);
  z-index: 8;
  box-shadow: 2px 0 4px rgba(0, 0, 0, 0.05);
}

/* Header freeze kolom kiri lebih tinggi z-index */
.data-table thead th:nth-child(1),
.data-table thead th:nth-child(2) {
  z-index: 12; /* Lebih tinggi dari sticky header biasa (10) */
}

/* Sticky action column (kolom terakhir) */
.data-table td.actions,
.data-table th:last-child {
  position: sticky;
  right: 0;
  background: var(--bg-card);
  box-shadow: -2px 0 4px rgba(0, 0, 0, 0.05);
  z-index: 5;
}

.data-table thead th:last-child {
  z-index: 11; /* Lebih tinggi dari sticky rows tapi lebih rendah dari freeze kiri */
}

/* Scrollbar styling */
.data-card > div[style*="overflow-x"]::-webkit-scrollbar {
  height: 10px;
  width: 10px;
}

.data-card > div[style*="overflow-x"]::-webkit-scrollbar-track {
  background: var(--bg-tertiary);
  border-radius: 5px;
}

.data-card > div[style*="overflow-x"]::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 5px;
  transition: background 0.2s ease;
}

.data-card > div[style*="overflow-x"]::-webkit-scrollbar-thumb:hover {
  background: var(--accent-primary);
}

/* Scrollbar corner */
.data-card > div[style*="overflow-x"]::-webkit-scrollbar-corner {
  background: var(--bg-tertiary);
}

/* Ensure text wrap for long content */
.data-table td {
  vertical-align: middle;
}

.data-table td[style*="white-space: normal"] {
  line-height: 1.6;
  padding: 12px 16px;
}

/* Responsiveness untuk mobile */
@media (max-width: 768px) {
  .data-card > div[style*="overflow-x"] {
    max-height: calc(100vh - 180px);
  }
  
  .data-table thead th {
    font-size: 10px;
    padding: 10px 12px;
  }
  
  .data-table td {
    font-size: 13px;
    padding: 10px 12px;
  }
  
  /* Adjust freeze column di mobile */
  .data-table th:nth-child(2),
  .data-table td:nth-child(2) {
    left: 80px; /* Lebih kecil untuk mobile */
  }
}

/* Hover effect untuk rows */
.data-table tbody tr:hover {
  background: var(--bg-tertiary);
  transition: background 0.2s ease;
}

.data-table tbody tr:hover td:nth-child(1),
.data-table tbody tr:hover td:nth-child(2) {
  background: var(--bg-tertiary); /* Freeze kolom ikut hover */
}

/* Badge styling di dalam tabel */
.data-table .badge {
  display: inline-block;
  min-width: 70px;
  text-align: center;
}

/* ==========================================
   BULK ENROLLMENT CHECKBOX LIST
   ========================================== */

.mhs-enroll-option {
  transition: all 0.2s ease;
}

.mhs-enroll-option:last-child {
  border-bottom: none !important;
}

.mhs-enroll-option:hover {
  background: var(--bg-tertiary) !important;
}

.mhs-enroll-option input[type="checkbox"]:checked + div {
  color: var(--accent-primary);
}

.mhs-enroll-option input[type="checkbox"]:checked {
  transform: scale(1.1);
}

/* Scrollbar untuk checkbox container */
#mhsCheckboxContainer::-webkit-scrollbar {
  width: 8px;
}

#mhsCheckboxContainer::-webkit-scrollbar-track {
  background: var(--bg-secondary);
  border-radius: 4px;
}

#mhsCheckboxContainer::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

#mhsCheckboxContainer::-webkit-scrollbar-thumb:hover {
  background: var(--accent-primary);
}

/* Search box highlight */
.search-box input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

// ==========================================
// CSS UNTUK NILAI-EDITED (Tambahkan di Styles.html)
// ==========================================

/*
.nilai-edited {
  border: 2px solid var(--warning) !important;
  background: rgba(245, 158, 11, 0.1) !important;
}

.nilai-edited:focus {
  border-color: var(--warning) !important;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2) !important;
}
*/

/*
.nilai-input {
  / * Default putih * /
}

.nilai-input.nilai-saved {
  background: rgba(34, 197, 94, 0.15) !important;  / * ← HIJAU terang * /
  border: 2px solid rgba(34, 197, 94, 0.5) !important;
  color: var(--success) !important;
}

.nilai-input.nilai-edited {
  background: rgba(59, 130, 246, 0.15) !important;  / * ← BIRU terang * /
  border: 2px solid rgba(59, 130, 246, 0.5) !important;
  color: var(--accent-primary) !important;
  font-weight: 600;
}

.nilai-input.nilai-saving {
  background: rgba(245, 158, 11, 0.15) !important;  / * ← KUNING (sedang save) * /
  border: 2px solid rgba(245, 158, 11, 0.5) !important;
  opacity: 0.6;
}
*/
</style>

<script>
// ==========================================
// MULTI-THEME SELECTOR LOGIC
// ==========================================

// Available themes with metadata
const themes = [
  {
    id: 'light',
    name: 'Light Mode',
    desc: 'Terang & Modern',
    colors: ['#0d6efd', '#6610f2', '#ffffff']
  },
  {
    id: 'dark',
    name: 'Dark Mode',
    desc: 'Gelap & Elegan',
    colors: ['#3b82f6', '#8b5cf6', '#12121a']
  },
  {
    id: 'purple',
    name: 'Soft Purple',
    desc: 'Ungu Lembut & Feminin',
    colors: ['#8b5cf6', '#ec4899', '#faf5ff']
  },
  {
    id: 'blue',
    name: 'Professional Blue',
    desc: 'Biru Profesional',
    colors: ['#2563eb', '#0891b2', '#f0f4f8']
  },
  {
    id: 'orange',
    name: 'Warm Orange',
    desc: 'Oranye Hangat & Ramah',
    colors: ['#ea580c', '#f59e0b', '#fffbf5']
  },
  {
    id: 'green',
    name: 'Fresh Green',
    desc: 'Hijau Segar & Tenang',
    colors: ['#16a34a', '#059669', '#f0fdf4']
  }
];

// Initialize theme from localStorage
function initTheme() {
  // Prevent transition flash on load
  document.body.classList.add('no-transition');
  
  const savedTheme = localStorage.getItem('theme') || 'light';
  document.documentElement.setAttribute('data-theme', savedTheme);
  
  // Remove no-transition class after a brief delay
  setTimeout(() => {
    document.body.classList.remove('no-transition');
  }, 100);
  
  console.log('Theme initialized:', savedTheme);
}

// Change theme
function changeTheme(themeId) {
  document.documentElement.setAttribute('data-theme', themeId);
  localStorage.setItem('theme', themeId);
  
  // Update active state in dropdown
  updateThemeDropdown();
  
  // Close dropdown
  closeThemeDropdown();
  
  // Show toast
  const themeName = themes.find(t => t.id === themeId)?.name || themeId;
  showToast(`🎨 Tema diubah ke: ${themeName}`, 'success');
  
  console.log('Theme changed to:', themeId);
}

// Toggle theme dropdown
function toggleThemeDropdown() {
  const dropdown = document.getElementById('themeDropdown');
  if (dropdown) {
    dropdown.classList.toggle('active');
    
    // Close if click outside
    if (dropdown.classList.contains('active')) {
      setTimeout(() => {
        document.addEventListener('click', closeOnClickOutside);
      }, 100);
    }
  }
}

// Close dropdown
function closeThemeDropdown() {
  const dropdown = document.getElementById('themeDropdown');
  if (dropdown) {
    dropdown.classList.remove('active');
    document.removeEventListener('click', closeOnClickOutside);
  }
}

// Close dropdown when click outside
function closeOnClickOutside(event) {
  const dropdown = document.getElementById('themeDropdown');
  const selector = document.querySelector('.theme-selector');
  
  if (dropdown && selector && !selector.contains(event.target)) {
    closeThemeDropdown();
  }
}

// Update dropdown active state
function updateThemeDropdown() {
  const currentTheme = document.documentElement.getAttribute('data-theme') || 'light';
  const options = document.querySelectorAll('.theme-option');
  
  options.forEach(option => {
    if (option.dataset.theme === currentTheme) {
      option.classList.add('active');
    } else {
      option.classList.remove('active');
    }
  });
  
  // Update button text
  const btn = document.querySelector('.theme-selector-btn span');
  const themeName = themes.find(t => t.id === currentTheme)?.name || 'Light Mode';
  if (btn) {
    btn.textContent = themeName;
  }
}

// Initialize on page load
document.addEventListener('DOMContentLoaded', function() {
  initTheme();
  updateThemeDropdown();
});




/* ==========================================
   MOBILE SIDEBAR OVERLAY
   ========================================== */
#sidebarOverlay {
  display: none;
}
#sidebarOverlay.show {
  display: block !important;
}

/* ==========================================
   MOBILE IMPROVEMENTS
   ========================================== */
@media (max-width: 768px) {
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .page-header h2 {
    font-size: 18px;
  }
  .card-actions {
    flex-wrap: wrap;
    gap: 6px;
  }
  .card-actions .btn {
    font-size: 12px;
    padding: 6px 10px;
  }
  .modal {
    margin: 12px;
    max-height: 90vh;
    overflow-y: auto;
  }
  .modal-body {
    max-height: 60vh;
    overflow-y: auto;
  }
  .form-row {
    grid-template-columns: 1fr !important;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .stat-value {
    font-size: 24px !important;
  }
  .header-actions {
    gap: 6px;
  }
  .header-actions .btn {
    display: none;
  }
  /* Tabel scroll horizontal di mobile */
  .data-card {
    overflow-x: auto;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr !important;
  }
  .modal {
    margin: 8px;
  }
}

/* ==========================================
   MOBILE FINE-TUNING TAMBAHAN
   ========================================== */
@media (max-width: 1024px) {
  /* Pastikan konten tidak overflow */
  .content-wrapper, #contentWrapper {
    max-width: 100% !important;
    overflow-x: hidden;
  }

  /* Top header full width */
  .top-header {
    padding: 12px 16px;
  }

  /* Page padding lebih kecil */
  .page-content {
    padding: 16px;
  }

  /* Stat cards 2 kolom */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px;
  }

  /* Data cards full width */
  .data-card {
    border-radius: 10px;
  }

  /* Info items label dan value stack */
  .info-item {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 2px;
  }
  .info-label {
    min-width: unset !important;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr !important;
  }
  .top-header {
    padding: 10px 12px;
  }
  h2 {
    font-size: 16px !important;
  }
}

/* ==========================================
   FIX KHUSUS MOBILE BROWSER
   ========================================== */

/* Pastikan tidak ada elemen yang overflow horizontal */
* {
  box-sizing: border-box;
}

/* Info item di profil - prevent overflow */
.info-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
  gap: 12px;
  flex-wrap: wrap;
  word-break: break-word;
  overflow-wrap: break-word;
}

.info-label {
  font-weight: 500;
  color: var(--text-secondary);
  min-width: 120px;
  flex-shrink: 0;
}

.info-value {
  color: var(--text-primary);
  text-align: right;
  word-break: break-word;
  overflow-wrap: break-word;
  flex: 1;
}

/* Paksa semua konten tidak overflow */
@media screen and (max-width: 1024px) {
  html, body {
    overflow-x: hidden !important;
    width: 100% !important;
  }

  .dashboard {
    display: flex;
    flex-direction: column;
  }

  aside.sidebar {
    position: fixed !important;
    width: 280px !important;
    height: 100vh !important;
    top: 0 !important;
    left: 0 !important;
    transform: translateX(-100%);
    z-index: 9999 !important;
    transition: transform 0.3s ease !important;
    /* Tidak mempengaruhi flow document */
    flex: none !important;
    align-self: auto !important;
  }

  aside.sidebar.mobile-open {
    transform: translateX(0) !important;
  }

  main.main-content {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    flex: 1 !important;
    overflow-x: hidden !important;
  }

  /* Header tidak overflow */
  .top-header {
    width: 100% !important;
    overflow: hidden;
  }

  /* Konten wrapper */
  #contentWrapper {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
    padding: 12px !important;
  }
}