/* ============================================
   STUNTING SYSTEM - MAIN CSS
   Modern UI/UX Design
   ============================================ */

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

/* ============================================
   CSS VARIABLES
   ============================================ */
:root {
  --primary: #10b981;
  --primary-dark: #059669;
  --primary-light: #d1fae5;
  --primary-hover: #047857;
  --secondary: #3b82f6;
  --secondary-dark: #2563eb;
  --accent: #f59e0b;
  --danger: #ef4444;
  --danger-dark: #dc2626;
  --warning: #f59e0b;
  --info: #06b6d4;
  --success: #10b981;
  
  --bg-main: #f0fdf4;
  --bg-card: #ffffff;
  --bg-sidebar: #0f172a;
  --bg-sidebar-hover: #1e293b;
  --bg-dark: #0f172a;
  
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --text-white: #ffffff;
  --text-sidebar: #cbd5e1;
  --text-sidebar-active: #ffffff;
  
  --border: #e2e8f0;
  --border-focus: #10b981;
  
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
  --shadow-xl: 0 20px 60px rgba(0,0,0,0.15);
  
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  
  --sidebar-width: 260px;
  --sidebar-collapsed: 72px;
  --header-height: 64px;
  
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s ease;
  --transition-slow: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  
  --font-main: 'Plus Jakarta Sans', sans-serif;
  --font-body: 'Inter', sans-serif;
}

/* ============================================
   RESET & BASE
   ============================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

img {
  max-width: 100%;
  height: auto;
}

ul, ol {
  list-style: none;
}

button {
  cursor: pointer;
  border: none;
  outline: none;
  font-family: inherit;
}

input, textarea, select {
  font-family: inherit;
  outline: none;
}

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* ============================================
   LOADING OVERLAY
   ============================================ */
#loading-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #0f172a 0%, #065f46 50%, #0f172a 100%);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

#loading-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-logo {
  margin-bottom: 32px;
  animation: loadPulse 2s ease-in-out infinite;
}

.loading-logo svg {
  width: 72px;
  height: 72px;
}

.loading-spinner-wrap {
  position: relative;
  width: 64px;
  height: 64px;
  margin-bottom: 24px;
}

.loading-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid transparent;
}

.loading-ring-1 {
  border-top-color: var(--primary);
  animation: spin 1s linear infinite;
}

.loading-ring-2 {
  border-right-color: #3b82f6;
  animation: spin 1.4s linear infinite reverse;
  inset: 6px;
}

.loading-ring-3 {
  border-bottom-color: var(--accent);
  animation: spin 1.8s linear infinite;
  inset: 12px;
}

.loading-text {
  color: #cbd5e1;
  font-family: var(--font-main);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  animation: loadFade 1.5s ease-in-out infinite alternate;
}

.loading-progress {
  width: 200px;
  height: 3px;
  background: rgba(255,255,255,0.1);
  border-radius: 999px;
  margin-top: 16px;
  overflow: hidden;
}

.loading-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #3b82f6);
  border-radius: 999px;
  animation: loadBar 2s ease-out forwards;
}

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

@keyframes loadPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.8; }
}

@keyframes loadFade {
  from { opacity: 0.5; }
  to { opacity: 1; }
}

@keyframes loadBar {
  from { width: 0%; }
  to { width: 100%; }
}

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

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transition: var(--transition-slow);
  overflow: hidden;
  box-shadow: 4px 0 24px rgba(0,0,0,0.2);
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed);
}

.sidebar-header {
  padding: 20px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  min-height: var(--header-height);
  overflow: hidden;
}

.sidebar-logo {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary), #059669);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(16,185,129,0.3);
}

.sidebar-logo svg {
  width: 22px;
  height: 22px;
  color: white;
}

.sidebar-brand {
  overflow: hidden;
  white-space: nowrap;
  transition: var(--transition);
}

.sidebar-brand h1 {
  font-family: var(--font-main);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-white);
  line-height: 1.2;
}

.sidebar-brand p {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
}

.sidebar.collapsed .sidebar-brand {
  opacity: 0;
  width: 0;
}

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

.sidebar-section {
  margin-bottom: 4px;
}

.sidebar-section-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 8px 12px 4px;
  white-space: nowrap;
  overflow: hidden;
  transition: var(--transition);
}

.sidebar.collapsed .sidebar-section-label {
  opacity: 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-sidebar);
  font-size: 13.5px;
  font-weight: 500;
  transition: var(--transition-fast);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  margin-bottom: 2px;
  position: relative;
}

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

.nav-item.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  box-shadow: 0 4px 12px rgba(16,185,129,0.3);
}

.nav-item.active .nav-icon {
  color: white;
}

.nav-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  transition: var(--transition-fast);
}

.nav-label {
  transition: var(--transition);
  flex: 1;
}

.sidebar.collapsed .nav-label {
  opacity: 0;
  width: 0;
}

.nav-badge {
  background: var(--danger);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 999px;
  transition: var(--transition);
}

.sidebar.collapsed .nav-badge {
  opacity: 0;
}

/* Tooltip for collapsed sidebar */
.nav-item .tooltip {
  display: none;
  position: absolute;
  left: calc(var(--sidebar-collapsed) - 4px);
  top: 50%;
  transform: translateY(-50%);
  background: #1e293b;
  color: white;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 9999;
  box-shadow: var(--shadow);
}

.sidebar.collapsed .nav-item:hover .tooltip {
  display: block;
}

.sidebar-footer {
  padding: 12px 8px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

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

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

/* ============================================
   TOPBAR / HEADER
   ============================================ */
.topbar {
  height: var(--header-height);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.topbar-toggle {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
  color: var(--text-secondary);
}

.topbar-toggle:hover {
  background: var(--bg-main);
  color: var(--primary);
}

.topbar-toggle svg {
  width: 20px;
  height: 20px;
}

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

.topbar-breadcrumb .separator {
  color: var(--text-muted);
}

.topbar-breadcrumb .current {
  color: var(--text-primary);
  font-weight: 600;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
  color: var(--text-secondary);
  position: relative;
}

.topbar-btn:hover {
  background: var(--bg-main);
  color: var(--primary);
}

.topbar-btn svg {
  width: 18px;
  height: 18px;
}

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

.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
  border: 1px solid transparent;
}

.topbar-user:hover {
  background: var(--bg-main);
  border-color: var(--border);
}

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

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

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

.user-info .user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}

.user-info .user-role {
  font-size: 11px;
  color: var(--text-muted);
}

/* ============================================
   PAGE CONTENT
   ============================================ */
.page-content {
  flex: 1;
  padding: 24px;
}

.page-header {
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: between;
  gap: 16px;
}

.page-title {
  font-family: var(--font-main);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}

.page-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ============================================
   CARDS
   ============================================ */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: var(--transition);
}

.card:hover {
  box-shadow: var(--shadow);
}

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

.card-title {
  font-family: var(--font-main);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.card-body {
  padding: 24px;
}

.card-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: #fafafa;
}

/* Stat Cards */
.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--card-color, var(--primary));
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.stat-card .stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  background: var(--card-bg, var(--primary-light));
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.stat-card .stat-icon svg {
  width: 24px;
  height: 24px;
  color: var(--card-color, var(--primary));
}

.stat-card .stat-value {
  font-family: var(--font-main);
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-card .stat-label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.stat-card .stat-change {
  font-size: 12px;
  font-weight: 600;
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}

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

/* ============================================
   GRID
   ============================================ */
.grid {
  display: grid;
  gap: 20px;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  font-family: var(--font-main);
  transition: var(--transition);
  cursor: pointer;
  border: 1.5px solid transparent;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.15);
  opacity: 0;
  transition: opacity 0.15s;
}

.btn:hover::after { opacity: 1; }
.btn:active { transform: scale(0.97); }

.btn svg { width: 15px; height: 15px; flex-shrink: 0; }

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-lg {
  padding: 12px 24px;
  font-size: 15px;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-sm);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  box-shadow: 0 4px 12px rgba(16,185,129,0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary-hover));
  box-shadow: 0 6px 18px rgba(16,185,129,0.4);
  transform: translateY(-1px);
}

.btn-secondary {
  background: linear-gradient(135deg, var(--secondary), var(--secondary-dark));
  color: white;
  box-shadow: 0 4px 12px rgba(59,130,246,0.3);
}

.btn-secondary:hover {
  box-shadow: 0 6px 18px rgba(59,130,246,0.4);
  transform: translateY(-1px);
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger), var(--danger-dark));
  color: white;
  box-shadow: 0 4px 12px rgba(239,68,68,0.3);
}

.btn-danger:hover {
  box-shadow: 0 6px 18px rgba(239,68,68,0.4);
  transform: translateY(-1px);
}

.btn-warning {
  background: linear-gradient(135deg, var(--warning), #d97706);
  color: white;
  box-shadow: 0 4px 12px rgba(245,158,11,0.3);
}

.btn-success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  box-shadow: 0 4px 12px rgba(16,185,129,0.3);
}

.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--text-secondary);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: var(--bg-main);
  color: var(--primary);
}

/* ============================================
   FORMS
   ============================================ */
.form-group {
  margin-bottom: 20px;
}

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

.form-label .required {
  color: var(--danger);
  margin-left: 2px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-family: var(--font-body);
  color: var(--text-primary);
  background: var(--bg-card);
  transition: var(--transition-fast);
  appearance: none;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(16,185,129,0.12);
}

.form-control::placeholder {
  color: var(--text-muted);
}

.form-control:disabled {
  background: #f1f5f9;
  color: var(--text-muted);
  cursor: not-allowed;
}

.input-group {
  display: flex;
  align-items: stretch;
}

.input-prefix, .input-suffix {
  padding: 10px 14px;
  background: #f8fafc;
  border: 1.5px solid var(--border);
  color: var(--text-muted);
  font-size: 13px;
  display: flex;
  align-items: center;
  white-space: nowrap;
}

.input-prefix {
  border-right: none;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.input-suffix {
  border-left: none;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.input-group .form-control {
  border-radius: 0;
}

.input-group .form-control:first-child {
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.input-group .form-control:last-child {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.form-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.form-error {
  font-size: 11px;
  color: var(--danger);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Select custom arrow */
select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
}

/* ============================================
   TABLE
   ============================================ */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

thead tr {
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
}

thead th {
  padding: 12px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

tbody tr:last-child {
  border-bottom: none;
}

tbody tr:hover {
  background: #f8fffe;
}

tbody td {
  padding: 14px 16px;
  color: var(--text-primary);
  vertical-align: middle;
}

/* ============================================
   BADGES
   ============================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-success { background: #dcfce7; color: #166534; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-info { background: #e0f2fe; color: #0c4a6e; }
.badge-secondary { background: #f1f5f9; color: #475569; }
.badge-primary { background: var(--primary-light); color: var(--primary-dark); }

/* ============================================
   ALERTS
   ============================================ */
.alert {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
}

.alert svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}

.alert-success { background: #dcfce7; color: #166534; border-left: 3px solid #16a34a; }
.alert-danger { background: #fee2e2; color: #991b1b; border-left: 3px solid var(--danger); }
.alert-warning { background: #fef3c7; color: #92400e; border-left: 3px solid var(--warning); }
.alert-info { background: #e0f2fe; color: #0c4a6e; border-left: 3px solid var(--info); }

/* ============================================
   PAGINATION
   ============================================ */
.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
}

.page-btn {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition-fast);
}

.page-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.page-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  box-shadow: 0 2px 8px rgba(16,185,129,0.3);
}

/* ============================================
   SEARCH BAR
   ============================================ */
.search-bar {
  position: relative;
  display: flex;
  align-items: center;
}

.search-bar svg {
  position: absolute;
  left: 12px;
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-bar input {
  padding-left: 38px;
  width: 260px;
}

/* ============================================
   MODAL (Custom SweetAlert2 Override)
   ============================================ */
.swal2-popup {
  font-family: var(--font-main) !important;
  border-radius: var(--radius-lg) !important;
  padding: 32px !important;
  box-shadow: var(--shadow-xl) !important;
}

.swal2-title {
  font-size: 18px !important;
  font-weight: 700 !important;
  color: var(--text-primary) !important;
}

.swal2-html-container {
  font-size: 13.5px !important;
  color: var(--text-secondary) !important;
}

.swal2-confirm {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark)) !important;
  border-radius: var(--radius-sm) !important;
  font-family: var(--font-main) !important;
  font-weight: 600 !important;
  padding: 10px 24px !important;
  box-shadow: 0 4px 12px rgba(16,185,129,0.3) !important;
  font-size: 13.5px !important;
}

.swal2-cancel {
  border-radius: var(--radius-sm) !important;
  font-family: var(--font-main) !important;
  font-weight: 600 !important;
  padding: 10px 24px !important;
  font-size: 13.5px !important;
}

.swal2-icon {
  border-width: 2px !important;
}

/* ============================================
   PROGRESS BAR (CF)
   ============================================ */
.cf-bar {
  height: 8px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 6px;
}

.cf-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), #3b82f6);
  transition: width 1s cubic-bezier(0.4,0,0.2,1);
}

/* ============================================
   SLIDER CF INPUT
   ============================================ */
.cf-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: #e2e8f0;
  outline: none;
  cursor: pointer;
}

.cf-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: 3px solid white;
  box-shadow: 0 2px 8px rgba(16,185,129,0.4);
  transition: var(--transition-fast);
}

.cf-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 4px 12px rgba(16,185,129,0.5);
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
  text-align: center;
  padding: 60px 24px;
}

.empty-state svg {
  width: 80px;
  height: 80px;
  color: var(--text-muted);
  margin: 0 auto 16px;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

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

/* ============================================
   TABS
   ============================================ */
.tabs {
  display: flex;
  gap: 2px;
  background: #f1f5f9;
  padding: 4px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
}

.tab-btn {
  flex: 1;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  transition: var(--transition-fast);
  border: none;
  cursor: pointer;
  font-family: var(--font-main);
}

.tab-btn.active {
  background: white;
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

/* ============================================
   UTILITIES
   ============================================ */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-5 { gap: 20px; }
.gap-6 { gap: 24px; }

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-sm { font-size: 12px; }
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-primary-color { color: var(--primary); }

.fw-700 { font-weight: 700; }
.fw-600 { font-weight: 600; }

.w-full { width: 100%; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }

.rounded { border-radius: var(--radius-sm); }
.rounded-full { border-radius: var(--radius-full); }

.shadow { box-shadow: var(--shadow); }

/* ============================================
   MOBILE OVERLAY
   ============================================ */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 999;
  backdrop-filter: blur(2px);
}

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

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-width) !important;
  }
  
  .sidebar.mobile-open {
    transform: translateX(0);
  }
  
  .main-content {
    margin-left: 0 !important;
  }
  
  .page-content {
    padding: 16px;
  }
  
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
  
  .topbar {
    padding: 0 16px;
  }
  
  .topbar-breadcrumb {
    display: none;
  }
  
  .search-bar input {
    width: 180px;
  }
  
  .card-header {
    flex-wrap: wrap;
  }
  
  .table-wrap {
    font-size: 12px;
  }
  
  thead th, tbody td {
    padding: 10px 12px;
  }
  
  .page-header {
    flex-wrap: wrap;
  }
}

@media (max-width: 480px) {
  .page-title {
    font-size: 18px;
  }
  
  .stat-card .stat-value {
    font-size: 22px;
  }
  
  .btn {
    padding: 8px 14px;
    font-size: 13px;
  }
  
  .search-bar input {
    width: 140px;
  }
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

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

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.animate-fadeIn { animation: fadeIn 0.4s ease forwards; }
.animate-slideInLeft { animation: slideInLeft 0.4s ease forwards; }
.animate-scaleIn { animation: scaleIn 0.3s ease forwards; }

/* Skeleton loader */
.skeleton {
  background: linear-gradient(90deg, #f0f4f8 25%, #e2e8f0 50%, #f0f4f8 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}

/* ============================================
   ROLE BADGE
   ============================================ */
.role-admin {
  background: #fef3c7;
  color: #92400e;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}

.role-pengguna {
  background: var(--primary-light);
  color: var(--primary-dark);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}

/* ============================================
   CF RESULT CARD
   ============================================ */
.cf-result-card {
  border-radius: var(--radius-lg);
  padding: 20px;
  border: 1px solid var(--border);
  margin-bottom: 12px;
  background: var(--bg-card);
  transition: var(--transition);
}

.cf-result-card:hover {
  box-shadow: var(--shadow);
}

.cf-result-card.berat {
  border-left: 4px solid var(--danger);
  background: #fff5f5;
}

.cf-result-card.sedang {
  border-left: 4px solid var(--warning);
  background: #fffbf0;
}

.cf-result-card.ringan {
  border-left: 4px solid var(--info);
  background: #f0faff;
}

/* ============================================
   PRINT / PDF
   ============================================ */
@media print {
  .sidebar, .topbar, .btn, .pagination, .topbar-actions {
    display: none !important;
  }
  .main-content {
    margin-left: 0 !important;
  }
  .page-content {
    padding: 0 !important;
  }
  .card {
    box-shadow: none !important;
    border: 1px solid #e2e8f0 !important;
  }
}
