@media (prefers-color-scheme: dark) {

  /* Body */
  body {
    background-color: #121212 !important;
    color: #e0e0e0 !important;
  }

  /* Container */
  .container, .content, .card, .box, .modal, .dialog {
    background-color: #1e1e1e !important;
    color: #e0e0e0 !important;
    border: 1px solid #333 !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.5) !important;
  }

  /* Navbar */
  .navbar, .header, .topbar {
    background-color: #1a1a1a !important;
    color: #ffffff !important;
  }

  /* Sidebar */
  .sidebar, .menu, .aside {
    background-color: #1a1a1a !important;
    color: #e0e0e0 !important;
  }

  /* Footer */
  footer, .footer {
    background-color: #181818 !important;
    color: #e0e0e0 !important;
  }

  /* Link */
  a {
    color: #4dabf7 !important;
  }

  a:hover {
    color: #74c0fc !important;
  }

  /* Text (jangan terlalu dipaksa putih semua) */
  p, span, li, label {
    color: #e0e0e0 !important;
  }

  h1, h2, h3, h4, h5, h6 {
    color: #ffffff !important;
  }

  /* Form */
  input, textarea, select {
    background-color: #2a2a2a !important;
    color: #ffffff !important;
    border: 1px solid #444 !important;
  }

  input:focus, textarea:focus, select:focus {
    border-color: #4dabf7 !important;
    outline: none !important;
    box-shadow: 0 0 0 2px rgba(77, 171, 247, 0.5) !important;
  }

  /* Button */
  button, .btn {
    background-color: #333 !important;
    color: #ffffff !important;
    border: 1px solid #444 !important;
  }

  button:hover, .btn:hover {
    background-color: #444 !important;
  }

  /* ===== FIX UTAMA: TABLE ===== */
  table {
    background-color: #1e1e1e !important;
    color: #e0e0e0 !important;
    border-collapse: collapse;
  }

  table th {
    background-color: #2a2a2a !important;
    color: #ffffff !important;
    border: 1px solid #444 !important;
  }

  table td {
    color: #e0e0e0 !important;
    border: 1px solid #444 !important;
    opacity: 1 !important; /* cegah pudar */
  }

  table tr:nth-child(even) {
    background-color: #242424 !important;
  }

  table tr:nth-child(odd) {
    background-color: #1e1e1e !important;
  }

  /* Alert */
  .alert, .notification, .badge {
    background-color: #2a2a2a !important;
    color: #ffffff !important;
  }

  /* Dropdown */
  .dropdown, .dropdown-menu {
    background-color: #2a2a2a !important;
    color: #ffffff !important;
  }

  /* Scrollbar */
  ::-webkit-scrollbar {
    width: 10px;
    height: 10px;
  }

  ::-webkit-scrollbar-track {
    background: #1e1e1e !important;
  }

  ::-webkit-scrollbar-thumb {
    background-color: #333 !important;
    border-radius: 5px;
  }

  ::-webkit-scrollbar-thumb:hover {
    background-color: #4dabf7 !important;
  }

  /* ❌ DIHAPUS: terlalu agresif dan bikin bug */
  /*
  [style*="color:"] {
    color: #ffffff !important;
  }

  [style*="background"] {
    background-color: #1e1e1e !important;
  }
  */
}