/* ============================================================
       SIPEDAL — Design System
       Modern · Colorful · Soft · Mobile-first
       ============================================================ */
    
    /* ---------- CSS Variables ---------- */
    :root {
      /* Brand gradient */
      --grad-primary:   linear-gradient(135deg, #667eea 0%, #764ba2 100%);
      --grad-success:   linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
      --grad-warning:   linear-gradient(135deg, #f7971e 0%, #ffd200 100%);
      --grad-danger:    linear-gradient(135deg, #f953c6 0%, #b91d73 100%);
      --grad-info:      linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
      --grad-orange:    linear-gradient(135deg, #fa709a 0%, #fee140 100%);
      --grad-teal:      linear-gradient(135deg, #0acffe 0%, #495aff 100%);
      --grad-sidebar:   linear-gradient(180deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
      --grad-bg:        linear-gradient(135deg, #f5f7fa 0%, #e8ecf3 100%);
    
      /* Colours */
      --color-primary:  #667eea;
      --color-success:  #43e97b;
      --color-warning:  #f7971e;
      --color-danger:   #f953c6;
      --color-info:     #4facfe;
    
      /* Surface */
      --surface:        #ffffff;
      --surface-2:      #f8f9fe;
      --border:         rgba(102, 126, 234, 0.12);
      --shadow-sm:      0 2px 8px rgba(102, 126, 234, 0.08);
      --shadow-md:      0 8px 24px rgba(102, 126, 234, 0.14);
      --shadow-lg:      0 16px 48px rgba(102, 126, 234, 0.18);
      --shadow-card:    0 4px 20px rgba(0,0,0,0.08);
    
      /* Text */
      --text-primary:   #1a1d2e;
      --text-secondary: #6b7280;
      --text-muted:     #9ca3af;
    
      /* Layout */
      --sidebar-w:      268px;
      --navbar-h:       64px;
      --radius-sm:      8px;
      --radius-md:      14px;
      --radius-lg:      20px;
      --radius-xl:      28px;
    
      /* Transition */
      --ease:           cubic-bezier(0.4, 0, 0.2, 1);
      --dur:            0.22s;
    }
    
    /* Dark mode overrides */
    body.dark-mode {
      --surface:        #1e2235;
      --surface-2:      #252840;
      --border:         rgba(255,255,255,0.08);
      --shadow-sm:      0 2px 8px rgba(0,0,0,0.3);
      --shadow-md:      0 8px 24px rgba(0,0,0,0.4);
      --shadow-card:    0 4px 20px rgba(0,0,0,0.3);
      --text-primary:   #f1f5f9;
      --text-secondary: #94a3b8;
      --text-muted:     #64748b;
      --grad-bg:        linear-gradient(135deg, #0f0f1a 0%, #1a1a2e 100%);
    }
    
    /* ---------- Base ---------- */
    *, *::before, *::after { box-sizing: border-box; }
    
    html { scroll-behavior: smooth; }
    
    body {
      font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
      font-size: 14px;
      background: var(--grad-bg);
      color: var(--text-primary);
      min-height: 100vh;
      line-height: 1.6;
      transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
    }
    
    /* ---------- Layout Shell ---------- */
    #app {
      display: flex;
      min-height: 100vh;
    }
    
    /* ---------- Sidebar ---------- */
    .sidebar {
      width: var(--sidebar-w);
      min-height: 100vh;
      background: var(--grad-sidebar);
      color: #fff;
      display: flex;
      flex-direction: column;
      flex-shrink: 0;
      position: fixed;
      top: 0;
      left: 0;
      bottom: 0;
      z-index: 1040;
      transform: translateX(0);
      transition: transform var(--dur) var(--ease), width var(--dur) var(--ease);
      overflow-y: auto;
      overflow-x: hidden;
    }
    
    .sidebar.hidden,
    .sidebar.sidebar-closed {
      transform: translateX(calc(-1 * var(--sidebar-w)));
    }
    
    /* Scrollbar sidebar */
    .sidebar::-webkit-scrollbar { width: 4px; }
    .sidebar::-webkit-scrollbar-track { background: transparent; }
    .sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 4px; }
    
    /* ---------- Main content area ---------- */
    #main-wrapper {
      flex: 1;
      margin-left: var(--sidebar-w);
      display: flex;
      flex-direction: column;
      min-height: 100vh;
      transition: margin-left var(--dur) var(--ease);
    }
    
    #main-wrapper.sidebar-closed {
      margin-left: 0;
    }
    
    /* ---------- Navbar ---------- */
    .navbar {
      position: sticky;
      top: 0;
      z-index: 1030;
      height: var(--navbar-h);
      background: rgba(255,255,255,0.8) !important;
      backdrop-filter: blur(16px) saturate(180%);
      -webkit-backdrop-filter: blur(16px) saturate(180%);
      border-bottom: 1px solid var(--border);
      box-shadow: var(--shadow-sm);
      transition: background var(--dur) var(--ease);
    }
    
    body.dark-mode .navbar {
      background: rgba(30, 34, 53, 0.85) !important;
    }
    
    .navbar-brand {
      font-weight: 800;
      font-size: 18px;
      background: var(--grad-primary);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      background-clip: text;
    }
    
    /* ---------- Content ---------- */
    #content {
      flex: 1;
      padding: 24px;
    }
    
    /* ---------- Cards ---------- */
    .card {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      box-shadow: var(--shadow-card);
      transition: box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease);
    }
    
    .card:hover {
      box-shadow: var(--shadow-md);
    }
    
    /* Stat cards */
    .stat-card {
      border-radius: var(--radius-lg);
      padding: 22px 24px;
      color: #fff;
      position: relative;
      overflow: hidden;
      box-shadow: var(--shadow-md);
      transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
    }
    
    .stat-card:hover {
      transform: translateY(-4px);
      box-shadow: var(--shadow-lg);
    }
    
    .stat-card::after {
      content: '';
      position: absolute;
      top: -24px;
      right: -24px;
      width: 100px;
      height: 100px;
      background: rgba(255,255,255,0.12);
      border-radius: 50%;
    }
    
    .stat-card::before {
      content: '';
      position: absolute;
      bottom: -32px;
      right: 20px;
      width: 140px;
      height: 140px;
      background: rgba(255,255,255,0.07);
      border-radius: 50%;
    }
    
    .stat-card .stat-icon {
      width: 48px;
      height: 48px;
      background: rgba(255,255,255,0.22);
      border-radius: var(--radius-md);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 20px;
      margin-bottom: 14px;
    }
    
    .stat-card .stat-value {
      font-size: 32px;
      font-weight: 800;
      line-height: 1;
      margin-bottom: 4px;
    }
    
    .stat-card .stat-label {
      font-size: 13px;
      opacity: 0.85;
      font-weight: 500;
    }
    
    .stat-card .stat-trend {
      font-size: 12px;
      opacity: 0.8;
      margin-top: 8px;
    }
    
    /* ---------- Glass card (dark areas) ---------- */
    .card-glass {
      background: rgba(255,255,255,0.07);
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
      border: 1px solid rgba(255,255,255,0.14);
      border-radius: var(--radius-lg);
      box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    }
    
    /* ---------- Section page cards ---------- */
    .page-card {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius-xl);
      box-shadow: var(--shadow-card);
      padding: 24px;
    }
    
    .page-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      flex-wrap: wrap;
      gap: 12px;
      margin-bottom: 20px;
      padding-bottom: 16px;
      border-bottom: 2px solid var(--border);
    }
    
    .page-title {
      font-size: 20px;
      font-weight: 700;
      color: var(--text-primary);
      display: flex;
      align-items: center;
      gap: 10px;
    }
    
    .page-title .title-icon {
      width: 38px;
      height: 38px;
      border-radius: var(--radius-sm);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 16px;
      color: #fff;
    }
    
    /* ---------- Buttons ---------- */
    .btn {
      font-weight: 600;
      font-size: 13px;
      border-radius: var(--radius-md);
      padding: 8px 18px;
      transition: all var(--dur) var(--ease);
      border: none;
    }
    
    .btn:active { transform: scale(0.96); }
    
    .btn-primary {
      background: var(--grad-primary);
      color: #fff;
      box-shadow: 0 4px 14px rgba(102, 126, 234, 0.4);
    }
    .btn-primary:hover {
      box-shadow: 0 6px 20px rgba(102, 126, 234, 0.55);
      filter: brightness(1.05);
      color: #fff;
    }
    
    .btn-success {
      background: var(--grad-success);
      color: #1a1d2e;
      box-shadow: 0 4px 14px rgba(67, 233, 123, 0.35);
    }
    .btn-success:hover {
      box-shadow: 0 6px 20px rgba(67, 233, 123, 0.5);
      filter: brightness(1.05);
      color: #1a1d2e;
    }
    
    .btn-danger {
      background: var(--grad-danger);
      color: #fff;
      box-shadow: 0 4px 14px rgba(249, 83, 198, 0.35);
    }
    .btn-danger:hover {
      box-shadow: 0 6px 20px rgba(249, 83, 198, 0.5);
      filter: brightness(1.05);
      color: #fff;
    }
    
    .btn-warning {
      background: var(--grad-warning);
      color: #1a1d2e;
      box-shadow: 0 4px 14px rgba(247, 151, 30, 0.35);
    }
    .btn-warning:hover { filter: brightness(1.05); color: #1a1d2e; }
    
    .btn-info {
      background: var(--grad-info);
      color: #fff;
      box-shadow: 0 4px 14px rgba(79, 172, 254, 0.35);
    }
    .btn-info:hover { filter: brightness(1.05); color: #fff; }
    
    .btn-outline-light {
      border: 1.5px solid rgba(255,255,255,0.35) !important;
      color: rgba(255,255,255,0.85);
      background: transparent;
    }
    .btn-outline-light:hover {
      background: rgba(255,255,255,0.15);
      color: #fff;
    }
    
    .btn-outline-secondary {
      border: 1.5px solid var(--border) !important;
      color: var(--text-secondary);
      background: transparent;
    }
    .btn-outline-secondary:hover {
      background: var(--surface-2);
      color: var(--text-primary);
    }
    
    .btn-sm { padding: 5px 12px; font-size: 12px; border-radius: var(--radius-sm); }
    .btn-lg { padding: 12px 28px; font-size: 15px; }
    
    /* ---------- Forms ---------- */
    .form-control, .form-select {
      background: var(--surface-2);
      border: 1.5px solid var(--border);
      border-radius: var(--radius-md);
      color: var(--text-primary);
      font-size: 13.5px;
      padding: 9px 14px;
      transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
    }
    
    .form-control:focus, .form-select:focus {
      border-color: var(--color-primary);
      box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
      background: var(--surface);
      color: var(--text-primary);
      outline: none;
    }
    
    .form-control::placeholder { color: var(--text-muted); }
    
    .form-label {
      font-size: 13px;
      font-weight: 600;
      color: var(--text-secondary);
      margin-bottom: 5px;
    }
    
    body.dark-mode .form-control,
    body.dark-mode .form-select {
      background: rgba(255,255,255,0.06);
      border-color: rgba(255,255,255,0.12);
      color: var(--text-primary);
    }
    
    body.dark-mode .form-control:focus,
    body.dark-mode .form-select:focus {
      background: rgba(255,255,255,0.1);
    }
    
    /* ---------- Tables ---------- */
    .table {
      --bs-table-bg: transparent;
      --bs-table-striped-bg: rgba(102, 126, 234, 0.03);
      --bs-table-hover-bg: rgba(102, 126, 234, 0.06);
      color: var(--text-primary);
      font-size: 13px;
    }
    
    .table thead th {
      font-weight: 700;
      font-size: 11.5px;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      color: var(--text-muted);
      border-bottom: 2px solid var(--border);
      padding: 10px 14px;
      background: var(--surface-2);
    }
    
    .table thead th:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
    .table thead th:last-child  { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
    
    .table tbody td {
      padding: 11px 14px;
      border-bottom: 1px solid var(--border);
      vertical-align: middle;
    }
    
    .table tbody tr:last-child td { border-bottom: none; }
    
    .table tbody tr:hover td {
      background: rgba(102, 126, 234, 0.04);
    }
    
    body.dark-mode .table thead th {
      background: rgba(255,255,255,0.05);
      color: var(--text-muted);
    }
    
    /* ---------- Badges ---------- */
    .badge {
      font-size: 11px;
      font-weight: 600;
      padding: 4px 10px;
      border-radius: 100px;
    }
    
    /* ---------- Sidebar Nav Links ---------- */
    .sidebar .nav-link {
      color: rgba(255,255,255,0.65);
      font-size: 13.5px;
      font-weight: 500;
      padding: 9px 14px;
      border-radius: var(--radius-md);
      margin-bottom: 2px;
      display: flex;
      align-items: center;
      gap: 10px;
      transition: all var(--dur) var(--ease);
      position: relative;
    }
    
    .sidebar .nav-link i {
      width: 20px;
      text-align: center;
      font-size: 14px;
    }
    
    .sidebar .nav-link:hover {
      color: #fff;
      background: rgba(255,255,255,0.1);
      transform: translateX(3px);
    }
    
    .sidebar .nav-link.active {
      color: #fff;
      background: var(--grad-primary);
      box-shadow: 0 4px 14px rgba(102, 126, 234, 0.45);
    }
    
    /* ---------- Section divider in sidebar ---------- */
    .sidebar .nav-section-label {
      font-size: 10px;
      font-weight: 700;
      letter-spacing: 1px;
      text-transform: uppercase;
      color: rgba(255,255,255,0.3);
      padding: 12px 14px 4px;
    }
    
    /* ---------- Form sections ---------- */
    .form-section {
      background: var(--surface-2);
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      padding: 20px;
      margin-bottom: 20px;
    }
    
    .form-section-title {
      font-size: 14px;
      font-weight: 700;
      color: var(--text-primary);
      margin-bottom: 14px;
      display: flex;
      align-items: center;
      gap: 8px;
    }
    
    /* ---------- Pagination ---------- */
    .page-btn, .page-nav {
      border-radius: var(--radius-sm) !important;
      font-size: 12px;
      font-weight: 600;
      padding: 5px 11px;
    }
    
    /* ---------- Search bar ---------- */
    .search-bar {
      position: relative;
    }
    
    .search-bar .form-control {
      padding-left: 36px;
    }
    
    .search-bar .search-icon {
      position: absolute;
      left: 12px;
      top: 50%;
      transform: translateY(-50%);
      color: var(--text-muted);
      font-size: 13px;
      pointer-events: none;
    }
    
    /* ---------- Utility ---------- */
    .hidden { display: none !important; }
    
    .gradient-text {
      background: var(--grad-primary);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      background-clip: text;
    }
    
    .text-primary-color { color: var(--color-primary) !important; }
    
    .rounded-xl { border-radius: var(--radius-xl) !important; }
    .rounded-lg  { border-radius: var(--radius-lg) !important; }
    
    .shadow-soft { box-shadow: var(--shadow-card) !important; }
    .shadow-md   { box-shadow: var(--shadow-md) !important; }
    
    /* ---------- Scrollbar global ---------- */
    ::-webkit-scrollbar { width: 6px; height: 6px; }
    ::-webkit-scrollbar-track { background: transparent; }
    ::-webkit-scrollbar-thumb { background: rgba(102, 126, 234, 0.25); border-radius: 6px; }
    ::-webkit-scrollbar-thumb:hover { background: rgba(102, 126, 234, 0.45); }
    
    /* ---------- Sidebar overlay (mobile) ---------- */
    #sidebarOverlay {
      display: none;
      position: fixed;
      inset: 0;
      background: rgba(0,0,0,0.45);
      z-index: 1039;
      backdrop-filter: blur(2px);
    }
    
    /* ---------- Tabs ---------- */
    .nav-tabs {
      border-bottom: 2px solid var(--border);
      gap: 4px;
    }
    
    .nav-tabs .nav-link {
      border: none;
      border-radius: var(--radius-sm) var(--radius-sm) 0 0;
      color: var(--text-secondary);
      font-weight: 600;
      font-size: 13px;
      padding: 8px 16px;
      background: transparent;
      transition: all var(--dur) var(--ease);
    }
    
    .nav-tabs .nav-link:hover {
      color: var(--color-primary);
      background: rgba(102, 126, 234, 0.06);
    }
    
    .nav-tabs .nav-link.active {
      color: var(--color-primary);
      background: rgba(102, 126, 234, 0.1);
      border-bottom: 2px solid var(--color-primary);
    }
    
    /* ---------- Mobile ---------- */
    @media (max-width: 768px) {
      :root {
        --sidebar-w: 260px;
      }
    
      .sidebar {
        transform: translateX(calc(-1 * var(--sidebar-w)));
        box-shadow: none;
      }
    
      .sidebar.mobile-open {
        transform: translateX(0);
        box-shadow: 4px 0 32px rgba(0,0,0,0.25);
      }
    
      #sidebarOverlay.active { display: block; }
    
      #main-wrapper {
        margin-left: 0 !important;
      }
    
      #content {
        padding: 16px;
      }
    
      .stat-card .stat-value { font-size: 26px; }
    
      .page-card { padding: 16px; }
    
      .page-header { flex-direction: column; align-items: flex-start; }
    
      .table-responsive-stack td,
      .table-responsive-stack th {
        display: block;
        width: 100%;
      }
    }
    
    @media (max-width: 480px) {
      #content { padding: 12px; }
      .stat-card { padding: 16px 18px; }
    }
    
    /* ---------- Animations ---------- */
    @keyframes fadeInUp {
      from { opacity: 0; transform: translateY(18px); }
      to   { opacity: 1; transform: translateY(0); }
    }
    
    @keyframes fadeIn {
      from { opacity: 0; }
      to   { opacity: 1; }
    }
    
    @keyframes pulse-glow {
      0%, 100% { box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.4); }
      50%       { box-shadow: 0 0 0 8px rgba(102, 126, 234, 0); }
    }
    
    .animate-in {
      animation: fadeInUp 0.35s var(--ease) both;
    }
    
    .animate-fade {
      animation: fadeIn 0.25s var(--ease) both;
    }
    
    /* Stagger for stat cards */
    .stat-card:nth-child(1) { animation-delay: 0.05s; }
    .stat-card:nth-child(2) { animation-delay: 0.10s; }
    .stat-card:nth-child(3) { animation-delay: 0.15s; }
    .stat-card:nth-child(4) { animation-delay: 0.20s; }
    
    /* ---------- Chart container ---------- */
    .chart-card {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      padding: 20px;
      box-shadow: var(--shadow-card);
    }
    
    .chart-card .chart-title {
      font-size: 15px;
      font-weight: 700;
      color: var(--text-primary);
      margin-bottom: 4px;
    }
    
    .chart-card .chart-subtitle {
      font-size: 12px;
      color: var(--text-muted);
      margin-bottom: 16px;
    }
    
    /* ---------- Welcome banner ---------- */
    .welcome-banner {
      border-radius: var(--radius-xl);
      padding: 28px 32px;
      background: var(--grad-primary);
      color: #fff;
      position: relative;
      overflow: hidden;
      box-shadow: var(--shadow-md);
    }
    
    .welcome-banner::before {
      content: '';
      position: absolute;
      top: -40px;
      right: -40px;
      width: 180px;
      height: 180px;
      border-radius: 50%;
      background: rgba(255,255,255,0.1);
    }
    
    .welcome-banner::after {
      content: '';
      position: absolute;
      bottom: -60px;
      right: 60px;
      width: 220px;
      height: 220px;
      border-radius: 50%;
      background: rgba(255,255,255,0.07);
    }
    
    /* ---------- Activity / Recent items ---------- */
    .activity-item {
      display: flex;
      align-items: flex-start;
      gap: 12px;
      padding: 12px 0;
      border-bottom: 1px solid var(--border);
    }
    
    .activity-item:last-child { border-bottom: none; }
    
    .activity-dot {
      width: 36px;
      height: 36px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 14px;
      color: #fff;
      flex-shrink: 0;
      margin-top: 2px;
    }
    
    /* ---------- Progress bars ---------- */
    .progress {
      border-radius: 100px;
      background: var(--border);
      overflow: visible;
    }
    
    .progress-bar {
      border-radius: 100px;
      position: relative;
    }
    
    /* ---------- Empty state ---------- */
    .empty-state {
      text-align: center;
      padding: 40px 20px;
      color: var(--text-muted);
    }
    
    .empty-state i {
      font-size: 40px;
      margin-bottom: 12px;
      opacity: 0.4;
    }
    
    .empty-state p {
      font-size: 14px;
      margin: 0;
    }
    
    /* ---------- Sidebar user card ---------- */
    .sidebar-user-card {
      background: rgba(255,255,255,0.08);
      border: 1px solid rgba(255,255,255,0.12);
      border-radius: var(--radius-lg);
      padding: 12px 14px;
      margin-bottom: 16px;
      display: flex;
      align-items: center;
      gap: 10px;
    }
    
    .sidebar-avatar {
      width: 38px;
      height: 38px;
      border-radius: 50%;
      background: var(--grad-primary);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 16px;
      color: #fff;
      flex-shrink: 0;
    }
    
    /* ---------- Navbar avatar ---------- */
    .nav-avatar {
      width: 34px;
      height: 34px;
      border-radius: 50%;
      background: var(--grad-primary);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 14px;
      color: #fff;
      flex-shrink: 0;
    }