:root {
      --primary: #1a56db;
      --primary-dark: #1240a8;
      --primary-light: #ebf0ff;
      --success: #0d9488;
      --warning: #d97706;
      --danger: #dc2626;
      --surface: #ffffff;
      --bg: #f1f5f9;
      --text: #0f172a;
      --text-muted: #64748b;
      --border: #e2e8f0;
      --sidebar-w: 250px;
      --topbar-h: 60px;
      --radius: 12px;
      --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
      --shadow-md: 0 4px 16px rgba(0,0,0,0.10);
    }

    * { box-sizing: border-box; }

    body {
      background: var(--bg);
      font-family: 'Plus Jakarta Sans', sans-serif;
      color: var(--text);
      font-size: 14px;
      margin: 0;
      -webkit-font-smoothing: antialiased;
    }

    /* ===== LAYOUT ===== */
    .app-wrapper {
      display: flex;
      min-height: 100vh;
    }

    /* ===== SIDEBAR ===== */
    .sidebar {
      width: var(--sidebar-w);
      background: var(--text);
      color: #fff;
      display: flex;
      flex-direction: column;
      flex-shrink: 0;
      position: fixed;
      top: 0;
      left: 0;
      bottom: 0;
      z-index: 1040;
      transition: transform 0.28s cubic-bezier(0.4,0,0.2,1);
      overflow-y: auto;
      overflow-x: hidden;
    }

    .sidebar-brand {
      padding: 20px 18px 16px;
      border-bottom: 1px solid rgba(255,255,255,0.08);
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .sidebar-brand-icon {
      width: 36px;
      height: 36px;
      background: var(--primary);
      border-radius: 8px;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
    }

    .sidebar-brand-text h1 {
      font-size: 13px;
      font-weight: 700;
      margin: 0;
      line-height: 1.3;
      letter-spacing: 0.3px;
    }

    .sidebar-brand-text p {
      font-size: 10px;
      margin: 0;
      color: rgba(255,255,255,0.45);
      font-weight: 400;
    }

    .sidebar-nav {
      padding: 12px 10px;
      flex: 1;
    }

    .nav-label {
      font-size: 9px;
      font-weight: 600;
      letter-spacing: 1.2px;
      text-transform: uppercase;
      color: rgba(255,255,255,0.35);
      padding: 10px 8px 6px;
      display: block;
    }

    .menu-item {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 9px 10px;
      border-radius: 8px;
      color: rgba(255,255,255,0.65) !important;
      text-decoration: none !important;
      font-size: 13px;
      font-weight: 500;
      transition: all 0.18s;
      margin-bottom: 2px;
      cursor: pointer;
      border: none;
      background: none;
      width: 100%;
    }

    .menu-item i {
      width: 18px;
      text-align: center;
      font-size: 13px;
      flex-shrink: 0;
      opacity: 0.8;
    }

    .menu-item:hover {
      background: rgba(255,255,255,0.08);
      color: #fff !important;
    }

    .menu-item.active {
      background: var(--primary);
      color: #fff !important;
    }

    .menu-item.active i { opacity: 1; }

    .sidebar-overlay {
      display: none;
      position: fixed;
      inset: 0;
      background: rgba(0,0,0,0.45);
      z-index: 1039;
    }

    /* ===== TOPBAR (mobile) ===== */
    .topbar {
      display: none;
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      height: var(--topbar-h);
      background: var(--surface);
      border-bottom: 1px solid var(--border);
      align-items: center;
      padding: 0 16px;
      z-index: 1030;
      gap: 12px;
      box-shadow: var(--shadow);
    }

    .topbar-toggle {
      width: 36px;
      height: 36px;
      border: none;
      background: var(--bg);
      border-radius: 8px;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      flex-shrink: 0;
    }

    .topbar-title {
      font-size: 14px;
      font-weight: 700;
      color: var(--text);
      flex: 1;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    /* ===== MAIN ===== */
    .main-content {
      margin-left: var(--sidebar-w);
      flex: 1;
      min-width: 0;
      padding: 24px;
      display: flex;
      flex-direction: column;
    }

    .content-section { display: none; }
    .content-section.active { display: block; }

    /* ===== PAGE HEADER ===== */
    .page-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      flex-wrap: wrap;
      gap: 12px;
      margin-bottom: 20px;
    }

    .page-title {
      font-size: 20px;
      font-weight: 700;
      margin: 0;
      color: var(--text);
    }

    .page-subtitle {
      font-size: 12px;
      color: var(--text-muted);
      margin: 2px 0 0;
    }

    /* ===== CARDS ===== */
    .card {
      background: var(--surface);
      border-radius: var(--radius);
      border: 1px solid var(--border);
      box-shadow: var(--shadow);
      padding: 20px;
      margin-bottom: 16px;
    }

    .card-title {
      font-size: 13px;
      font-weight: 600;
      color: var(--text-muted);
      text-transform: uppercase;
      letter-spacing: 0.4px;
      margin-bottom: 4px;
    }

    /* ===== QUICK ACTIONS ===== */
    .quick-actions {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 12px;
      margin-bottom: 24px;
    }

    .quick-btn {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 18px 12px;
      cursor: pointer;
      text-align: center;
      transition: box-shadow 0.18s, transform 0.18s, border-color 0.18s;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 10px;
      text-decoration: none;
      color: var(--text);
      box-shadow: var(--shadow);
    }

    .quick-btn:hover {
      box-shadow: 0 4px 18px rgba(26,86,219,0.13);
      transform: translateY(-2px);
      border-color: var(--primary);
      color: var(--primary);
    }

    .quick-btn-icon {
      width: 46px;
      height: 46px;
      border-radius: 12px;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      font-size: 18px;
      color: #fff;
    }

    .qbi-blue   { background: #1a56db; }
    .qbi-green  { background: #059669; }
    .qbi-orange { background: #d97706; }
    .qbi-red    { background: #dc2626; }

    .quick-btn-text {
      font-size: 12px;
      font-weight: 600;
      line-height: 1.3;
    }

    /* ===== FOLLOW UP ===== */
    .followup-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 16px;
      margin-bottom: 24px;
    }

    .followup-card {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 12px;
      overflow: hidden;
      box-shadow: var(--shadow);
    }

    .followup-card.urgent { border-color: #fca5a5; }

    .followup-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 12px 16px;
      border-bottom: 1px solid var(--border);
    }

    .followup-title {
      display: flex;
      align-items: center;
      gap: 8px;
      font-size: 13px;
      font-weight: 700;
      color: var(--text);
    }

    .followup-badge {
      font-size: 11px;
      font-weight: 700;
      padding: 2px 8px;
      border-radius: 20px;
      line-height: 1.6;
    }

    .followup-badge.badge-red    { background: #fee2e2; color: #dc2626; }
    .followup-badge.badge-yellow { background: #fef3c7; color: #d97706; }
    .followup-badge.badge-blue   { background: #dbeafe; color: #1a56db; }

    .followup-dot-red {
      width: 8px; height: 8px;
      border-radius: 50%;
      background: #dc2626;
      animation: pulse-red 1.4s infinite;
      flex-shrink: 0;
    }

    .followup-dot-yellow {
      width: 8px; height: 8px;
      border-radius: 50%;
      background: #d97706;
      flex-shrink: 0;
    }

    .followup-dot-blue {
      width: 8px; height: 8px;
      border-radius: 50%;
      background: #1a56db;
      flex-shrink: 0;
    }

    @keyframes pulse-red {
      0%, 100% { opacity: 1; transform: scale(1); }
      50%       { opacity: .5; transform: scale(1.3); }
    }

    .followup-urgent-full { margin-bottom: 16px; }

    .fu-table {
      width: 100%;
      border-collapse: collapse;
      font-size: 12px;
    }

    .fu-table thead th {
      background: var(--bg);
      font-size: 10px;
      font-weight: 700;
      letter-spacing: .5px;
      text-transform: uppercase;
      color: var(--text-muted);
      padding: 7px 12px;
      text-align: left;
      border-bottom: 1px solid var(--border);
    }

    .fu-table tbody td {
      padding: 8px 12px;
      border-bottom: 1px solid #f3f4f6;
      vertical-align: middle;
      color: var(--text);
    }

    .fu-table tbody tr:last-child td   { border-bottom: none; }
    .fu-table tbody tr:hover td        { background: var(--bg); }
    .fu-table tbody tr.row-urgent td   { background: #fff7f7; }
    .fu-table tbody tr.row-urgent:hover td { background: #fee2e2; }

    .fu-name  { font-weight: 600; font-size: 12px; }
    .fu-code  { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
    .fu-total { font-weight: 700; font-size: 12px; }
    .fu-sisa  { font-size: 11px; color: #dc2626; font-weight: 600; }
    .fu-date  { font-size: 11px; font-weight: 600; }
    .fu-date.overdue  { color: #dc2626; }
    .fu-date.today    { color: #d97706; }
    .fu-date.upcoming { color: #059669; }

    .fu-actions { display: flex; gap: 6px; }

    .btn-fu {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 28px;
      height: 28px;
      border-radius: 6px;
      border: none;
      cursor: pointer;
      font-size: 12px;
      text-decoration: none;
      transition: background .15s, transform .1s;
    }

    .btn-fu:hover     { transform: scale(1.1); }
    .btn-fu-wa        { background: #dcfce7; color: #16a34a; }
    .btn-fu-wa:hover  { background: #bbf7d0; }
    .btn-fu-inv       { background: #dbeafe; color: #1a56db; }
    .btn-fu-inv:hover { background: #bfdbfe; }

    .fu-empty {
      text-align: center;
      padding: 24px 16px;
      color: var(--text-muted);
      font-size: 12px;
    }

    .fu-empty i { font-size: 22px; display: block; margin-bottom: 6px; opacity: .4; }

    /* ===== TABLE ===== */
    .table-card {
      background: var(--surface);
      border-radius: var(--radius);
      border: 1px solid var(--border);
      box-shadow: var(--shadow);
      overflow: hidden;
    }

    .table-card-header {
      padding: 14px 16px;
      border-bottom: 1px solid var(--border);
      display: flex;
      align-items: center;
      justify-content: space-between;
      flex-wrap: wrap;
      gap: 8px;
    }

    .table-card-title {
      font-size: 13px;
      font-weight: 600;
      color: var(--text);
      margin: 0;
    }

    .table-responsive {
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
    }

    table.data-table {
      width: 100%;
      border-collapse: collapse;
      font-size: 13px;
    }

    table.data-table thead th {
      background: #f8fafc;
      padding: 10px 12px;
      font-weight: 600;
      font-size: 11px;
      text-transform: uppercase;
      letter-spacing: 0.4px;
      color: var(--text-muted);
      border-bottom: 1px solid var(--border);
      white-space: nowrap;
    }

    table.data-table tbody td {
      padding: 11px 12px;
      border-bottom: 1px solid #f1f5f9;
      vertical-align: middle;
    }

    table.data-table tbody tr:last-child td {
      border-bottom: none;
    }

    table.data-table tbody tr:hover {
      background: #f8fafc;
    }

    /* ===== BUTTONS ===== */
    .btn {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 8px 14px;
      border-radius: 8px;
      font-size: 13px;
      font-weight: 600;
      cursor: pointer;
      border: none;
      transition: all 0.18s;
      text-decoration: none;
      white-space: nowrap;
    }

    .btn-primary {
      background: var(--primary);
      color: #fff;
    }
    .btn-primary:hover { background: var(--primary-dark); color: #fff; }

    .btn-success {
      background: var(--success);
      color: #fff;
    }
    .btn-success:hover { background: #0b7a70; color: #fff; }

    .btn-warning {
      background: #fef3c7;
      color: #92400e;
      border: 1px solid #fde68a;
    }
    .btn-warning:hover { background: #fde68a; color: #78350f; }

    .btn-danger {
      background: #fee2e2;
      color: #991b1b;
      border: 1px solid #fecaca;
    }
    .btn-danger:hover { background: #fecaca; color: #7f1d1d; }

    .btn-outline {
      background: transparent;
      color: var(--text-muted);
      border: 1px solid var(--border);
    }
    .btn-outline:hover { background: var(--bg); color: var(--text); }

    .btn-sm {
      padding: 5px 10px;
      font-size: 12px;
      border-radius: 6px;
    }

    .btn:disabled {
      opacity: 0.6;
      cursor: not-allowed;
    }

    /* ===== FORMS ===== */
    .form-label {
      font-size: 12px;
      font-weight: 600;
      color: var(--text-muted);
      margin-bottom: 5px;
      display: block;
      text-transform: uppercase;
      letter-spacing: 0.3px;
    }

    .form-control, .form-select {
      width: 100%;
      padding: 9px 12px;
      border: 1px solid var(--border);
      border-radius: 8px;
      font-size: 13px;
      font-family: inherit;
      color: var(--text);
      background: var(--surface);
      transition: border-color 0.18s, box-shadow 0.18s;
      outline: none;
    }

    .form-control:focus, .form-select:focus {
      border-color: var(--primary);
      box-shadow: 0 0 0 3px rgba(26,86,219,0.1);
    }

    .form-control[readonly] {
      background: #f8fafc;
      color: var(--text-muted);
    }

    .input-group {
      display: flex;
    }

    .input-group .form-control {
      border-radius: 8px 0 0 8px;
      flex: 1;
      min-width: 0;
    }

    .input-group .btn {
      border-radius: 0 8px 8px 0;
      flex-shrink: 0;
    }

    .form-row {
      display: grid;
      gap: 12px;
      margin-bottom: 12px;
    }

    .form-row-2 { grid-template-columns: 1fr 1fr; }
    .form-row-3 { grid-template-columns: 1fr 1fr 1fr; }

    /* ===== ALERTS ===== */
    .alert {
      padding: 10px 14px;
      border-radius: 8px;
      margin-bottom: 12px;
      display: flex;
      align-items: flex-start;
      gap: 8px;
      font-size: 13px;
    }

    .alert-success { background: #d1faf4; color: #065f46; border-left: 3px solid var(--success); }
    .alert-error { 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: var(--primary-light); color: #1e40af; border-left: 3px solid var(--primary); }

    /* ===== BADGE ===== */
    .badge {
      display: inline-flex;
      align-items: center;
      padding: 3px 8px;
      border-radius: 20px;
      font-size: 11px;
      font-weight: 600;
      white-space: nowrap;
    }

    .badge-green { background: #d1faf4; color: #065f46; }
    .badge-blue { background: var(--primary-light); color: #1e40af; }
    .badge-orange { background: #fef3c7; color: #92400e; }
    .badge-red { background: #fee2e2; color: #991b1b; }
    .badge-gray { background: #f1f5f9; color: var(--text-muted); }

    /* ===== MODALS ===== */
    .modal {
      display: none;
      position: fixed;
      inset: 0;
      z-index: 2000;
      background: rgba(15,23,42,0.5);
      overflow-y: auto;
      padding: 16px;
    }

    .modal-box {
      background: var(--surface);
      border-radius: var(--radius);
      width: 100%;
      max-width: 560px;
      margin: auto;
      box-shadow: 0 20px 60px rgba(0,0,0,0.2);
      display: flex;
      flex-direction: column;
    }

    .modal-box-lg { max-width: 800px; }
    .modal-box-xl { max-width: 1100px; }
    .modal-box-sm { max-width: 400px; }

    .modal-header {
      padding: 16px 18px;
      border-bottom: 1px solid var(--border);
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
    }

    .modal-header-title {
      font-size: 15px;
      font-weight: 700;
      color: var(--text);
      margin: 0;
    }

    .modal-close {
      width: 28px;
      height: 28px;
      border: none;
      background: var(--bg);
      border-radius: 6px;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      color: var(--text-muted);
      flex-shrink: 0;
      font-size: 16px;
      line-height: 1;
      transition: all 0.15s;
    }

    .modal-close:hover { background: #fee2e2; color: var(--danger); }

    .modal-body {
      padding: 18px;
      overflow-y: auto;
      flex: 1;
    }

    .modal-footer {
      padding: 14px 18px;
      border-top: 1px solid var(--border);
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 8px;
    }

    /* ===== SECTION DIVIDER ===== */
    .section-label {
      font-size: 11px;
      font-weight: 700;
      color: var(--primary);
      text-transform: uppercase;
      letter-spacing: 0.8px;
      margin: 20px 0 12px;
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .section-label::after {
      content: '';
      flex: 1;
      height: 1px;
      background: var(--primary-light);
    }

    /* ===== FILTER BOX ===== */
    .filter-box {
      background: #f8fafc;
      border: 1px solid var(--border);
      border-radius: var(--radius);
      padding: 16px;
      margin-bottom: 16px;
    }

    /* ===== INVOICE SUMMARY ===== */
    .summary-box {
      background: var(--primary-light);
      border: 1px solid #bfdbfe;
      border-radius: var(--radius);
      padding: 14px 16px;
      margin-top: 12px;
    }

    .summary-row {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 4px 0;
      font-size: 13px;
    }

    .summary-row.total {
      border-top: 1px solid #bfdbfe;
      margin-top: 6px;
      padding-top: 10px;
      font-weight: 700;
      font-size: 15px;
      color: var(--primary);
    }

    /* ===== FOOTER ===== */
    .app-footer {
      margin-top: auto;
      padding-top: 24px;
      text-align: center;
      color: var(--text-muted);
      font-size: 11px;
    }

    /* ===== RESPONSIVE ===== */
    @media (max-width: 767px) {
      .sidebar {
        transform: translateX(-100%);
      }

      .sidebar.show {
        transform: translateX(0);
      }

      .sidebar-overlay.show {
        display: block;
      }

      .topbar {
        display: flex;
      }

      .main-content {
        margin-left: 0;
        padding: 76px 14px 20px;
      }

      .quick-actions {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
      }

      .quick-btn {
        padding: 14px 8px;
        font-size: 11px;
        gap: 8px;
      }

      .quick-btn-icon { width: 38px; height: 38px; font-size: 15px; }

      .followup-grid {
        grid-template-columns: 1fr;
      }

      .form-row-2 { grid-template-columns: 1fr; }
      .form-row-3 { grid-template-columns: 1fr; }

      .modal {
        padding: 10px;
        align-items: flex-end;
      }

      .modal-box {
        border-radius: 16px 16px 12px 12px;
        max-width: 100%;
        max-height: 90vh;
      }

      .modal-body {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
      }

      table.data-table { font-size: 12px; }
      table.data-table thead th { padding: 8px 10px; font-size: 10px; }
      table.data-table tbody td { padding: 9px 10px; }

      .page-title { font-size: 17px; }

      .btn { font-size: 13px; }

      .btn-sm { padding: 5px 8px; font-size: 11px; }
    }

    @media (min-width: 1200px) {
      .quick-actions { grid-template-columns: repeat(4, 1fr); }
    }

    @media (min-width: 768px) and (max-width: 1199px) {
      .quick-actions { grid-template-columns: repeat(4, 1fr); }
    }

    /* Loading state */
    .loading-row td { text-align: center; padding: 40px; color: var(--text-muted); }

    .spinner {
      display: inline-block;
      width: 16px;
      height: 16px;
      border: 2px solid rgba(26,86,219,0.2);
      border-top-color: var(--primary);
      border-radius: 50%;
      animation: spin 0.7s linear infinite;
    }

    @keyframes spin { to { transform: rotate(360deg); } }
    
/* ===== DARK MODE ===== */
body.dark-mode {
  --primary: #4f8ef7;
  --primary-dark: #3b7de8;
  --primary-light: #1e2d4a;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #f87171;
  --surface: #1e2535;
  --bg: #131929;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --border: #2d3a50;
  --shadow: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
}

/* Elemen yang perlu override tambahan di dark mode */
body.dark-mode .sidebar {
  background: #0f1623;
  border-right: 1px solid #2d3a50;
}

body.dark-mode .topbar {
  background: var(--surface);
}

body.dark-mode table.data-table thead th {
  background: #252f42;
}

body.dark-mode table.data-table tbody tr:hover {
  background: #252f42;
}

body.dark-mode table.data-table tbody td {
  border-bottom-color: #2d3a50;
}

body.dark-mode .filter-box {
  background: #252f42;
}

body.dark-mode .form-control[readonly] {
  background: #252f42;
  color: var(--text-muted);
}

body.dark-mode .fu-table thead th {
  background: #252f42;
}

body.dark-mode .fu-table tbody td {
  border-bottom-color: #2d3a50;
}

body.dark-mode .fu-table tbody tr:hover td {
  background: #252f42;
}

body.dark-mode .fu-table tbody tr.row-urgent td {
  background: #2d1f1f;
}

body.dark-mode .fu-table tbody tr.row-urgent:hover td {
  background: #3d2020;
}

body.dark-mode .modal {
  background: rgba(0,0,0,0.7);
}

body.dark-mode .modal-close:hover {
  background: #3d2020;
}

body.dark-mode .badge-green { background: #064e3b; color: #6ee7b7; }
body.dark-mode .badge-blue  { background: #1e2d4a; color: #93c5fd; }
body.dark-mode .badge-red   { background: #3d1515; color: #fca5a5; }
body.dark-mode .badge-gray  { background: #252f42; color: var(--text-muted); }
body.dark-mode .badge-orange{ background: #3d2a0a; color: #fcd34d; }

body.dark-mode .alert-success { background: #064e3b; color: #6ee7b7; }
body.dark-mode .alert-error   { background: #3d1515; color: #fca5a5; }
body.dark-mode .alert-warning { background: #3d2a0a; color: #fcd34d; }
body.dark-mode .alert-info    { background: #1e2d4a; color: #93c5fd; }

body.dark-mode .summary-box {
  background: #1e2d4a;
  border-color: #2d3a50;
}

body.dark-mode .summary-row.total {
  border-top-color: #2d3a50;
}

body.dark-mode .btn-warning {
  background: #3d2a0a;
  color: #fcd34d;
  border-color: #78450a;
}

body.dark-mode .btn-warning:hover {
  background: #78450a;
  color: #fef3c7;
}

body.dark-mode .btn-danger {
  background: #3d1515;
  color: #fca5a5;
  border-color: #7f1d1d;
}

body.dark-mode .btn-danger:hover {
  background: #7f1d1d;
  color: #fee2e2;
}

body.dark-mode .btn-outline {
  border-color: var(--border);
  color: var(--text-muted);
}

body.dark-mode .btn-outline:hover {
  background: #252f42;
  color: var(--text);
}

body.dark-mode .topbar-toggle {
  background: #252f42;
  color: var(--text);
}

body.dark-mode .followup-card.urgent {
  border-color: #7f1d1d;
}

/* Tombol dark mode toggle */
.dark-toggle {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  transition: all 0.2s;
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.7);
  margin-top: auto;
  margin-bottom: 16px;
  align-self: center;
}

.dark-toggle:hover {
  background: rgba(255,255,255,0.18);
  color: #fff;
}    


/* ===== DARK MODE TOGGLE SWITCH ===== */
.dark-toggle-wrap {
  cursor: pointer;
  flex-shrink: 0;
  margin-left: auto;
}

.dark-toggle-switch {
  width: 44px;
  height: 24px;
  background: rgba(255,255,255,0.15);
  border-radius: 12px;
  position: relative;
  transition: background 0.3s;
  border: 1px solid rgba(255,255,255,0.2);
}

.dark-toggle-switch.on {
  background: var(--primary);
  border-color: var(--primary);
}

.dark-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s, background 0.3s;
  font-size: 9px;
  color: #d97706;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.dark-toggle-switch.on .dark-toggle-thumb {
  transform: translateX(20px);
  color: #1a56db;
}