    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

    :root {
      color-scheme: dark;
      --bg: #0d0f14;
      --surface: rgba(255, 255, 255, 0.03);
      --surface-hover: rgba(255, 255, 255, 0.06);
      --border: rgba(255, 255, 255, 0.08);
      --accent: #ffd700;
      --accent-dim: rgba(255, 215, 0, 0.15);
      --accent-glow: rgba(255, 215, 0, 0.06);
      --text: #e8eaf0;
      --text-muted: #7b8094;
      --success: #2ecc71;
      --error: #e74c3c;
      --info: #3498db;
      --radius: 16px;
      --radius-sm: 8px;
      --transition: 0.2s ease;
    }

    body {
      font-family: 'Inter', sans-serif;
      background: var(--bg);
      color: var(--text);
      min-height: 100vh;
      display: flex;
      overflow: hidden;
    }

    /* ── Layout ── */
    .app-layout {
      display: flex;
      width: 100%;
      height: 100vh;
    }

    /* ── Sidebar ── */
    .sidebar {
      width: 260px;
      background: rgba(13, 15, 20, 0.95);
      border-right: 1px solid var(--border);
      display: flex;
      flex-direction: column;
      padding: 24px 16px;
      z-index: 10;
    }

    .logo {
      display: flex;
      align-items: center;
      gap: 12px;
      margin-bottom: 40px;
      padding-left: 8px;
    }

    .logo-icon {
      width: 36px;
      height: 36px;
      background: var(--accent);
      border-radius: 10px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 18px;
      box-shadow: 0 0 20px var(--accent-dim);
    }

    .logo-text { font-size: 18px; font-weight: 800; letter-spacing: -0.5px; }
    .logo-text span { color: var(--accent); font-style: italic; }

    .nav-list { list-style: none; display: flex; flex-direction: column; gap: 8px; flex: 1; }
    
    .nav-item {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 12px 16px;
      border-radius: var(--radius-sm);
      color: var(--text-muted);
      font-weight: 500;
      font-size: 14px;
      cursor: pointer;
      transition: var(--transition);
    }

    .nav-item:hover { background: var(--surface); color: var(--text); }
    .nav-item.active { background: var(--accent-glow); color: var(--accent); border-left: 3px solid var(--accent); }

    /* ── Main Content ── */
    .main-content {
      flex: 1;
      overflow-y: auto;
      padding: 40px;
      position: relative;
    }

    .main-content::before {
      content: '';
      position: absolute;
      top: -150px; left: 50%;
      transform: translateX(-50%);
      width: 600px; height: 600px;
      background: radial-gradient(circle, rgba(255, 215, 0, 0.04) 0%, transparent 70%);
      pointer-events: none; z-index: 0;
    }

    .tab-content { display: none; position: relative; z-index: 1; animation: fadeIn 0.3s; }
    .tab-content.active { display: block; }

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

    .page-header { margin-bottom: 32px; }
    .page-title { font-size: 24px; font-weight: 700; margin-bottom: 8px; }
    .page-desc { color: var(--text-muted); font-size: 14px; }

    /* ── Cards ── */
    .grid-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; margin-bottom: 32px; }
    
    .card {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      padding: 24px;
      backdrop-filter: blur(12px);
    }

    .stat-card { display: flex; flex-direction: column; gap: 8px; }
    .stat-title { font-size: 12px; font-weight: 600; text-transform: uppercase; color: var(--text-muted); letter-spacing: 0.5px; }
    .stat-value { font-size: 32px; font-weight: 800; color: var(--text); }
    .stat-accent { color: var(--accent); }

    /* ── Input & Form ── */
    .form-group { margin-bottom: 16px; }
    .form-group label { display: block; font-size: 12px; font-weight: 600; text-transform: uppercase; color: var(--text-muted); margin-bottom: 8px; letter-spacing: 0.5px; }
    .input {
      width: 100%;
      background: rgba(0,0,0,0.2);
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      color: var(--text);
      font-family: 'Inter', sans-serif;
      font-size: 14px;
      padding: 12px 16px;
      outline: none;
      transition: var(--transition);
    }
    .input:focus { border-color: var(--accent); background: var(--accent-glow); }
    textarea.input { resize: vertical; min-height: 80px; }
    
    select.input {
      appearance: none;
      -webkit-appearance: none;
      -moz-appearance: none;
      padding-right: 44px;
      /* Custom Dropdown Arrow */
      background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237b8094' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
      background-repeat: no-repeat;
      background-position: right 16px center;
      background-size: 16px;
    }
    select.input:focus {
      background-color: var(--accent-glow);
    }
    select.input option { background: #151821; color: #ffffff; padding: 12px; }

    /* ── Buttons ── */
    .btn {
      padding: 12px 20px;
      border: none;
      border-radius: var(--radius-sm);
      font-family: 'Inter', sans-serif;
      font-size: 14px;
      font-weight: 600;
      cursor: pointer;
      transition: var(--transition);
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
    }
    .btn-primary { background: var(--accent); color: #111; }
    .btn-primary:hover:not(:disabled) { filter: brightness(1.1); transform: translateY(-1px); }
    .btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
    
    .btn-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
    .btn-secondary:hover { background: var(--surface-hover); }

    .btn-danger { background: rgba(231, 76, 60, 0.1); color: var(--error); border: 1px solid rgba(231, 76, 60, 0.2); }
    .btn-danger:hover { background: rgba(231, 76, 60, 0.2); }

    /* ── Tables ── */
    .table-container { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
    .table-toolbar { padding: 16px; border-bottom: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; }
    .table-filters { display: flex; flex-wrap: wrap; gap: 12px; }
    
    table { width: 100%; border-collapse: collapse; text-align: left; }
    th { padding: 14px 16px; font-size: 11px; text-transform: uppercase; color: var(--text-muted); font-weight: 600; border-bottom: 1px solid var(--border); background: rgba(0,0,0,0.2); }
    td { padding: 14px 16px; font-size: 13px; border-bottom: 1px solid var(--border); color: var(--text); }
    tr:last-child td { border-bottom: none; }
    tr:hover td { background: var(--surface-hover); }

    .badge { padding: 4px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; text-transform: uppercase; }
    .badge.ml { background: rgba(255, 230, 0, 0.15); color: #FFD700; border: 1px solid rgba(255, 230, 0, 0.3); }
    .badge.shopee { background: rgba(238, 77, 45, 0.15); color: #EE4D2D; border: 1px solid rgba(238, 77, 45, 0.3); }

    .cookie-badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; border: 1px solid transparent; margin-left: auto; cursor: help; }
    .cookie-badge__dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 6px currentColor; }
    .cookie-badge--ok { background: rgba(46, 204, 113, 0.12); color: var(--success); border-color: rgba(46, 204, 113, 0.35); }
    .cookie-badge--expired { background: rgba(231, 76, 60, 0.12); color: var(--error); border-color: rgba(231, 76, 60, 0.4); }
    .cookie-badge--unknown { background: rgba(255, 215, 0, 0.1); color: var(--accent); border-color: rgba(255, 215, 0, 0.3); }
    .cookie-badge--not_configured { background: var(--surface); color: var(--text-muted); border-color: var(--border); }
    .cookie-badge--expired .cookie-badge__dot { animation: cookie-pulse 1.4s ease-in-out infinite; }
    @keyframes cookie-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

    .prod-title { max-width: 250px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .prod-link { color: var(--info); text-decoration: none; }
    .prod-link:hover { text-decoration: underline; }

    /* ── Modals ── */
    .modal-overlay {
      position: fixed; top: 0; left: 0; width: 100%; height: 100%;
      background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
      display: none; align-items: center; justify-content: center; z-index: 100;
    }
    .modal-overlay.active { display: flex; }
    .modal-content {
      background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
      width: 100%; max-width: 500px; padding: 24px; position: relative;
    }
    .modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
    .modal-title { font-size: 18px; font-weight: 700; }
    .modal-close { background: none; border: none; color: var(--text-muted); font-size: 20px; cursor: pointer; }
    
    /* ── Result Alert ── */
    .alert { padding: 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 14px; display: none; }
    .alert.success { background: rgba(46, 204, 113, 0.1); border: 1px solid var(--success); color: var(--success); display: block; }
    .alert.error { background: rgba(231, 76, 60, 0.1); border: 1px solid var(--error); color: var(--error); display: block; }

    /* ── Helper ── */
    .flex-row { display: flex; gap: 12px; }
    .flex-1 { flex: 1; }

    /* Spinner */
    .spinner {
      width: 16px; height: 16px; border: 2px solid rgba(0,0,0,0.2); border-top-color: #111;
      border-radius: 50%; animation: spin 0.6s linear infinite; display: none;
    }
    .btn-primary.loading .spinner { display: inline-block; }
    @keyframes spin { to { transform: rotate(360deg); } }

    /* Switch Component */
    .switch {
      position: relative; display: inline-block; width: 36px; height: 20px;
    }
    .switch input { opacity: 0; width: 0; height: 0; }
    .slider {
      position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
      background-color: rgba(255,255,255,0.1); border: 1px solid var(--border);
      transition: .3s; border-radius: 20px;
    }
    .slider:before {
      position: absolute; content: ""; height: 14px; width: 14px; left: 2px; bottom: 2px;
      background-color: var(--text-muted); transition: .3s; border-radius: 50%;
    }
    input:checked + .slider { background-color: rgba(46, 204, 113, 0.2); border-color: var(--success); }
    input:checked + .slider:before { transform: translateX(16px); background-color: var(--success); }
    input:disabled + .slider { opacity: 0.5; cursor: not-allowed; }
    
    /* Loading state for switches */
    .switch.saving { opacity: 0.5; pointer-events: none; }

    /* Lamp Animation */
    .lamp-container {
      width: 32px;
      height: 32px;
      background: rgba(255, 255, 255, 0.05);
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: var(--transition);
      border: 1px solid transparent;
    }
    .lamp-icon {
      width: 20px;
      height: 20px;
      stroke: var(--text-muted);
      fill: none;
      transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .breaker-on .lamp-container {
      background: rgba(255, 215, 0, 0.1);
      border-color: rgba(255, 215, 0, 0.2);
      box-shadow: 0 0 15px rgba(255, 215, 0, 0.1);
    }
    .breaker-on .lamp-icon {
      stroke: #ffd700;
      fill: rgba(255, 215, 0, 0.2);
      filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.6));
      animation: bulbGlow 2s infinite alternate ease-in-out;
    }
    
    @keyframes bulbGlow {
      from { filter: drop-shadow(0 0 3px rgba(255, 215, 0, 0.4)); opacity: 0.8; }
      to { filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.8)); opacity: 1; }
    }

    /* Search Dropdown */
    .search-dropdown {
      position: absolute; top: 100%; left: 0; right: 0; background: var(--bg);
      border: 1px solid var(--border); border-radius: var(--radius-sm);
      max-height: 250px; overflow-y: auto; z-index: 100;
      box-shadow: 0 8px 24px rgba(0,0,0,0.5); display: none; margin-top: 4px;
    }
    .dropdown-item {
      padding: 12px 14px; cursor: pointer; border-bottom: 1px solid var(--border); transition: var(--transition);
    }
    .dropdown-item:last-child { border-bottom: none; }
    .dropdown-item:hover { background: var(--surface-hover); }


/* ── Toast notifications ── */
.toast-container {
  position: fixed; top: 24px; right: 24px; z-index: 1000;
  display: flex; flex-direction: column; gap: 10px; max-width: 360px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  padding: 12px 16px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  font-size: 13px; line-height: 1.4;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  opacity: 0; transform: translateX(20px);
  transition: opacity .2s, transform .2s;
  backdrop-filter: blur(8px);
}
.toast-show { opacity: 1; transform: translateX(0); }
.toast-success { border-color: var(--success); color: var(--success); background: rgba(46,204,113,0.08); }
.toast-error   { border-color: var(--error);   color: var(--error);   background: rgba(231,76,60,0.08); }
.toast-warn    { border-color: var(--accent);  color: var(--accent);  background: rgba(255,215,0,0.08); }
