/* ============================================================
   BERKAT Digital System - CSS Design System
   Badan Kebajikan JANM Malaysia
   ============================================================ */

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

:root {
  /* Brand Colors */
  --brand-primary:   #1B4F9C; /* Corporate Blue */
  --brand-secondary: #C8102E; /* Berkat Red */
  --brand-gold:      #D4AF37;
  --brand-dark:      #0D2240;

  /* UI Colors */
  --bg-base:      #F0F4FA;
  --bg-card:      #FFFFFF;
  --bg-sidebar:   #0D2240;
  --bg-sidebar-hover: rgba(255,255,255,0.08);
  --bg-sidebar-active: rgba(255,255,255,0.15);

  /* Text */
  --text-primary:   #111827;
  --text-secondary: #4B5563;
  --text-muted:     #9CA3AF;
  --text-inverse:   #FFFFFF;
  --text-brand:     #1B4F9C;

  /* Status */
  --status-draft:        #6B7280;
  --status-submitted:    #3B82F6;
  --status-under-review: #F59E0B;
  --status-approved:     #10B981;
  --status-rejected:     #EF4444;
  --status-paid:         #8B5CF6;

  /* Category Colors */
  --cat-pendidikan: #3B82F6;
  --cat-kesihatan:  #EF4444;
  --cat-kebajikan:  #F59E0B;
  --cat-sosial:     #10B981;
  --cat-keahlian:   #8B5CF6;

  /* Borders */
  --border:       #E5E7EB;
  --border-focus: #1B4F9C;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);

  /* Spacing */
  --sidebar-width: 260px;
  --header-height: 64px;

  /* Radius */
  --radius-sm:  8px;
  --radius-md:  12px;
  --radius-lg:  20px;
  --radius-xl:  30px;
  --radius-full: 9999px;

  /* Glassmorphism */
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.3);
  --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);

  /* Modern Gradients */
  --grad-primary: linear-gradient(135deg, #1B4F9C 0%, #3b82f6 100%);
  --grad-berkat:  linear-gradient(135deg, #1B4F9C 0%, #C8102E 100%);
  --grad-success: linear-gradient(135deg, #059669 0%, #10b981 100%);
  --grad-warning: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
  --grad-danger:  linear-gradient(135deg, #dc2626 0%, #C8102E 100%);
  --grad-wow:     linear-gradient(135deg, #1B4F9C 0%, #C8102E 100%);

  /* Transitions */
  --transition: 0.2s ease;
  --transition-slow: 0.35s ease;

  /* Typography */
  --font-body:    'Outfit', sans-serif;
  --font-display: 'Outfit', sans-serif;
}

/* ============================================================ RESET ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font-family: inherit; }
ul, ol { list-style: none; }

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

/* SIDEBAR */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  background-image: linear-gradient(165deg, rgba(27, 79, 156, 0.9) 0%, rgba(13, 34, 64, 0.6) 100%), url('../img/sidebar-bg-premium.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
  transition: transform var(--transition-slow);
  box-shadow: 4px 0 24px rgba(0,0,0,0.15);
  border-right: 2px solid rgba(200, 16, 46, 0.15);
}
.sidebar-brand {
  padding: 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 12px;
}
.sidebar-brand-logo {
  width: 42px; height: 42px;
  background: var(--brand-primary);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 18px; color: white;
  flex-shrink: 0;
  border: 2px solid var(--brand-gold);
  background-image: var(--grad-berkat);
}
.sidebar-brand-text { display: flex; flex-direction: column; }
.sidebar-brand-name {
  font-family: var(--font-display);
  font-weight: 800; font-size: 16px;
  color: #fff; letter-spacing: 0.5px;
}
.sidebar-brand-sub {
  font-size: 10px; color: rgba(255,255,255,0.5);
  text-transform: uppercase; letter-spacing: 1px;
}

.sidebar-nav { flex: 1; padding: 16px 0; }
.sidebar-section-label {
  font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 1.5px;
  color: rgba(255,255,255,0.35);
  padding: 12px 20px 6px;
}
.sidebar-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 20px;
  margin: 1px 10px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.7);
  font-size: 14px; font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  position: relative;
}
.sidebar-item:hover {
  background: var(--bg-sidebar-hover);
  color: #fff;
  text-decoration: none;
}
.sidebar-item.active {
  background: var(--bg-sidebar-active);
  color: #fff;
  font-weight: 600;
}
.sidebar-item.active::before {
  content: '';
  position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 60%; border-radius: 0 3px 3px 0;
  background: var(--brand-secondary);
  margin-left: -9px;
}
.sidebar-item i { width: 18px; text-align: center; flex-shrink: 0; }
.sidebar-badge {
  margin-left: auto;
  background: var(--brand-secondary);
  color: white;
  font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: var(--radius-full);
  min-width: 20px; text-align: center;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 10px; border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition);
}
.sidebar-user:hover { background: var(--bg-sidebar-hover); }
.sidebar-avatar {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--brand-primary), #3B82F6);
  border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; color: white;
  flex-shrink: 0;
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name {
  font-size: 13px; font-weight: 600; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-user-role {
  font-size: 11px; color: rgba(255,255,255,0.5);
  text-transform: capitalize;
}

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

/* HEADER */
.header {
  height: var(--header-height);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 28px;
  position: sticky; top: 0; z-index: 50;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  border-top: 3px solid var(--brand-secondary);
}
.header-title {
  flex: 1;
  font-family: var(--font-display);
  font-size: 18px; font-weight: 700;
  color: var(--text-primary);
}
.header-actions { display: flex; align-items: center; gap: 8px; }
.header-btn {
  width: 40px; height: 40px;
  border-radius: var(--radius-md);
  border: none;
  background: var(--bg-base);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  transition: all var(--transition);
  position: relative;
  text-decoration: none;
}
.header-btn:hover { background: var(--border); color: var(--text-primary); text-decoration: none; }
.notif-dot {
  position: absolute; top: 6px; right: 6px;
  width: 8px; height: 8px;
  background: var(--brand-secondary);
  border-radius: var(--radius-full);
  border: 2px solid var(--bg-card);
}

/* PAGE CONTENT */
.page { padding: 28px; }
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 24px; gap: 16px; flex-wrap: wrap;
}
.page-title {
  font-family: var(--font-display);
  font-size: 24px; font-weight: 800;
  color: var(--text-primary);
}
.page-subtitle {
  font-size: 14px; 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: transform var(--transition), box-shadow var(--transition);
}
.card:hover {
  box-shadow: var(--shadow-md);
}
.card-glass {
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}
.card-header {
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
}
.card-title {
  font-family: var(--font-display);
  font-size: 15px; font-weight: 700;
  color: var(--text-primary);
  display: flex; align-items: center; gap: 8px;
}
.card-body { padding: 22px; }

/* STAT CARDS */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 20px;
  display: flex; flex-direction: column;
  gap: 12px;
  transition: transform var(--transition), box-shadow var(--transition);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.stat-value {
  font-family: var(--font-display);
  font-size: 28px; font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}
.stat-label { font-size: 13px; color: var(--text-secondary); }
.stat-meta { font-size: 12px; color: var(--text-muted); }

/* ============================================================ BUTTONS ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-size: 14px; font-weight: 600;
  cursor: pointer; border: none;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-primary   { background: var(--brand-primary); color: white; box-shadow: 0 1px 3px rgba(27,79,156,0.3); }
.btn-primary:hover { background: #153e7a; box-shadow: 0 4px 12px rgba(27,79,156,0.4); }
.btn-danger    { background: #EF4444; color: white; }
.btn-danger:hover { background: #DC2626; }
.btn-success   { background: #10B981; color: white; }
.btn-success:hover { background: #059669; }
.btn-warning   { background: #F59E0B; color: white; }
.btn-warning:hover { background: #D97706; }
.btn-secondary { background: var(--bg-base); color: var(--text-secondary); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); color: var(--text-primary); }
.btn-outline   { background: transparent; color: var(--text-secondary); border: 1px solid var(--border); }
.btn-outline:hover { background: var(--bg-base); color: var(--brand-primary); border-color: var(--brand-primary); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--bg-base); }
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: var(--radius-sm); }
.btn-lg { padding: 12px 24px; font-size: 15px; border-radius: var(--radius-md); }
.btn-icon { width: 36px; height: 36px; padding: 0; border-radius: var(--radius-md); }
.btn-block { width: 100%; }

/* Pagination Styling */
.pagination-container {
  padding: 1rem 0;
  border-top: 1px solid var(--border);
  margin-top: 1.5rem;
}
.pagination-info { font-weight: 500; }
.pagination-actions .btn { min-width: 32px; }


/* ============================================================ FORMS ============================================================ */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block; margin-bottom: 6px;
  font-size: 13px; font-weight: 600;
  color: var(--text-primary);
}
.form-label .req { color: var(--brand-secondary); margin-left: 2px; }
.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-card);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-control:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(27,79,156,0.1);
}
.form-control::placeholder { color: var(--text-muted); }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 100px; }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.form-error { font-size: 12px; color: var(--brand-secondary); margin-top: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }

/* ============================================================ TABLES ============================================================ */
.table-container, .table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 500px; }
.table th {
  background: var(--bg-base);
  padding: 11px 16px;
  text-align: left;
  font-weight: 600; font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  vertical-align: middle;
}
.table tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background var(--transition); }
.table tbody tr:hover { background: rgba(27,79,156,0.02); }

/* ============================================================ BADGES ============================================================ */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.3px;
  white-space: nowrap;
}
.badge-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.badge-draft        { background: #F3F4F6; color: #6B7280; }
.badge-submitted    { background: #EFF6FF; color: #1D4ED8; }
.badge-under_review { background: #FFFBEB; color: #D97706; }
.badge-approved     { background: #ECFDF5; color: #065F46; }
.badge-rejected     { background: #FEF2F2; color: #991B1B; }
.badge-paid         { background: #F5F3FF; color: #5B21B6; }
.badge-active       { background: #ECFDF5; color: #065F46; }
.badge-inactive     { background: #F3F4F6; color: #6B7280; }
.badge-admin        { background: #FEF3C7; color: #92400E; }
.badge-jk           { background: #EDE9FE; color: #4C1D95; }
.badge-agen         { background: #DBEAFE; color: #1E40AF; }
.badge-ahli         { background: #D1FAE5; color: #064E3B; }

/* ============================================================ ALERTS ============================================================ */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: 14px;
  display: flex; align-items: flex-start; gap: 10px;
  border-left: 4px solid;
}
.alert-success { background: #ECFDF5; border-color: #10B981; color: #065F46; }
.alert-error   { background: #FEF2F2; border-color: #EF4444; color: #991B1B; }
.alert-warning { background: #FFFBEB; border-color: #F59E0B; color: #92400E; }
.alert-info    { background: #EFF6FF; border-color: #3B82F6; color: #1D4ED8; }

/* ============================================================ PROGRESS ============================================================ */
.progress-bar { width: 100%; height: 8px; background: var(--bg-base); border-radius: var(--radius-full); overflow: hidden; }
.progress-fill { height: 100%; border-radius: var(--radius-full); transition: width 0.6s ease; }

/* ============================================================ TIMELINE ============================================================ */
.timeline { position: relative; padding-left: 28px; }
.timeline::before {
  content: '';
  position: absolute; left: 10px; top: 0; bottom: 0;
  width: 2px; background: var(--border);
}
.timeline-item {
  position: relative;
  padding-bottom: 24px;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot {
  position: absolute; left: -28px; top: 2px;
  width: 20px; height: 20px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; color: white;
  z-index: 1;
}
.timeline-content { background: var(--bg-base); border-radius: var(--radius-md); padding: 12px 14px; }
.timeline-meta { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.timeline-text { font-size: 14px; color: var(--text-primary); }

/* ============================================================ MODAL ============================================================ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  opacity: 0; pointer-events: none;
  transition: opacity var(--transition);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 100%; max-width: 540px;
  transform: scale(0.95) translateY(10px);
  transition: transform var(--transition);
  overflow: hidden;
}
.modal-overlay.open .modal { transform: scale(1) translateY(0); }
.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-family: var(--font-display); font-size: 18px; font-weight: 700; }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }

/* ============================================================ TABS ============================================================ */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--border); margin-bottom: 24px; }
.tab {
  padding: 10px 20px; font-size: 14px; font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer; border-bottom: 2px solid transparent;
  margin-bottom: -2px; transition: all var(--transition);
  background: none; border-top: none; border-left: none; border-right: none;
  text-decoration: none;
}
.tab:hover { color: var(--brand-primary); }
.tab.active { color: var(--brand-primary); border-bottom-color: var(--brand-primary); }

/* ============================================================ SEARCH & FILTER ============================================================ */
.filter-bar {
  display: flex; gap: 10px; align-items: center;
  flex-wrap: wrap; margin-bottom: 20px;
}
.search-box { position: relative; flex: 1; min-width: 200px; }
.search-box i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.search-box input { padding-left: 36px; }
.filter-select { min-width: 150px; }

/* ============================================================ EMPTY STATE ============================================================ */
.empty-state {
  text-align: center; padding: 60px 20px;
  color: var(--text-muted);
}
.empty-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.4; }
.empty-title { font-size: 18px; font-weight: 600; color: var(--text-secondary); margin-bottom: 8px; }
.empty-desc { font-size: 14px; }

/* ============================================================ UTILITIES ============================================================ */
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }
.mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 16px; } .mb-4 { margin-bottom: 24px; }
.mt-2 { margin-top: 8px; } .mt-3 { margin-top: 16px; }
.text-sm { font-size: 13px; } .text-xs { font-size: 11px; }
.text-muted { color: var(--text-muted); }
.text-success { color: #059669; } .text-danger { color: #DC2626; } .text-warning { color: #D97706; }
.fw-600 { font-weight: 600; } .fw-700 { font-weight: 700; }
.w-full { width: 100%; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

/* ============================================================ LOADING ============================================================ */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--brand-primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

@keyframes pulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.1); opacity: 0.8; }
  100% { transform: scale(1); opacity: 1; }
}

/* ============================================================ TOAST ============================================================ */
#toast-container {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 999; display: flex; flex-direction: column; gap: 10px;
}
.toast {
  background: #1F2937; color: white;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 14px; display: flex; align-items: center; gap: 10px;
  min-width: 260px; max-width: 380px;
  animation: slideInRight 0.3s ease;
}
.toast.success { border-left: 4px solid #10B981; }
.toast.error { border-left: 4px solid #EF4444; }
.toast.warning { border-left: 4px solid #F59E0B; }
@keyframes slideInRight { from { opacity:0; transform:translateX(24px); } to { opacity:1; transform:translateX(0); } }

/* ============================================================ RESPONSIVE (MOBILE & TABLET) ============================================================ */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(13, 34, 64, 0.65);
  backdrop-filter: blur(4px);
  z-index: 95;
  opacity: 0;
  transition: opacity var(--transition);
}
.sidebar-overlay.active {
  display: block;
  opacity: 1;
}

/* TABLET VIEW (769px - 1024px) */
@media (max-width: 1024px) {
  .form-row { grid-template-columns: 1fr; }
  .form-row.cols-3 { grid-template-columns: 1fr 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .header { padding: 0 20px; }
  .page { padding: 20px 24px; }
  .stat-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
}

/* MOBILE & SMALL TABLET VIEW (<= 768px) */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: 280px;
    z-index: 100;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-content {
    margin-left: 0;
    min-width: 0;
    width: 100%;
  }
  .header {
    padding: 0 14px;
    gap: 10px;
  }
  .header-title {
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .wa-status-pill span {
    display: none;
  }
  .wa-status-pill {
    padding: 6px 10px !important;
  }
  .page {
    padding: 16px 14px;
  }
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .page-header .btn {
    width: 100%;
    justify-content: center;
  }
  .stat-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .card-body {
    padding: 16px;
  }
  .modal {
    width: 95%;
    max-height: 88vh;
    border-radius: var(--radius-lg);
  }
  .modal-body {
    padding: 18px 16px;
    max-height: 60vh;
    overflow-y: auto;
  }
  .modal-footer {
    padding: 14px 16px;
    flex-wrap: wrap;
  }
  .modal-footer .btn {
    flex: 1;
    min-width: 120px;
  }
  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .search-box, .filter-select {
    width: 100%;
    min-width: 100%;
  }
  .tabs {
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }
}

/* EXTRA SMALL MOBILE (<= 480px) */
@media (max-width: 480px) {
  .stat-grid {
    grid-template-columns: 1fr;
  }
  .stat-value {
    font-size: 24px;
  }
  .header-actions {
    gap: 4px;
  }
  .header-btn {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }
}

/* Progress Stepper */
.stepper {
  display: flex;
  justify-content: space-between;
  margin-bottom: 30px;
  position: relative;
  padding: 0 10px;
}
.stepper::before {
  content: '';
  position: absolute;
  top: 15px;
  left: 50px;
  right: 50px;
  height: 2px;
  background: #E5E7EB;
  z-index: 1;
}
.stepper-step {
  position: relative;
  z-index: 2;
  text-align: center;
  flex: 1;
}
.step-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #F3F4F6;
  border: 2px solid #E5E7EB;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 8px;
  font-weight: 700;
  font-size: 14px;
  color: #9CA3AF;
  transition: all 0.3s ease;
}
.step-label {
  font-size: 11px;
  font-weight: 600;
  color: #6B7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.stepper-step.active .step-dot {
  background: white;
  border-color: var(--brand-primary);
  color: var(--brand-primary);
  box-shadow: 0 0 0 4px rgba(27, 79, 156, 0.1);
}
.stepper-step.active .step-label {
  color: var(--brand-primary);
}
.stepper-step.completed .step-dot {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: white;
}
.stepper-step.completed .step-label {
  color: var(--brand-primary);
}
.stepper-step.rejected .step-dot {
  background: #EF4444;
  border-color: #EF4444;
  color: white;
}
.stepper-step.rejected .step-label {
  color: #EF4444;
}
