
    :root {
      --bg-app: #f8fafc;
      --bg-surface: #ffffff;
      --bg-subtle: #f1f5f9;
      --bg-hover: #f8fafc;
      --border: #e2e8f0;
      --border-strong: #cbd5e1;
      --text-primary: #0f172a;
      --text-secondary: #475569;
      --text-muted: #64748b;
      --accent: #0f172a;
      --accent-blue: #2563eb;
      --green-toggle: #16a34a;
      --green-bg: #dcfce7;
      --green-text: #15803d;
      --amber-bg: #fef3c7;
      --amber-text: #b45309;
      --red-bg: #fee2e2;
      --red-text: #b91c1c;
    }

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

    body {
      font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
      background-color: var(--bg-app);
      color: var(--text-primary);
      font-size: 13px;
      line-height: 1.45;
      -webkit-font-smoothing: antialiased;
    }

    body.embed-mode .topbar,
    body.embed-mode #lookerPanel {
      display: none !important;
    }

    /* ==================== MÀN HÌNH ĐĂNG NHẬP (TRẮNG TINH TUYỆT ĐỐI - ẨN 100% TOOL DEMO) ==================== */
    body.login-locked {
      background: #ffffff !important;
      overflow: hidden !important;
    }

    body.login-locked .app-shell,
    body.login-locked .topbar,
    body.login-locked .sidebar,
    body.login-locked .app-sidebar,
    body.login-locked .main-content,
    body.login-locked .metrics-bar,
    body.login-locked #lookerPanel,
    body.login-locked .floating-action-bar,
    body.login-locked .tree-table,
    body.login-locked #appRoot,
    body.login-locked .sync-highlight-card,
    body.login-locked #dataVizPanel,
    body.login-locked .modal-backdrop:not(#loginModal) {
      display: none !important;
      visibility: hidden !important;
      opacity: 0 !important;
      pointer-events: none !important;
    }

    body.login-locked #toastContainer {
      display: flex !important;
      visibility: visible !important;
      opacity: 1 !important;
      z-index: 10000005 !important;
      pointer-events: auto !important;
    }

    body.login-locked #loginModal {
      display: flex !important;
      position: fixed !important;
      inset: 0 !important;
      background: #ffffff !important;
      backdrop-filter: none !important;
      z-index: 9999999 !important;
      align-items: center !important;
      justify-content: center !important;
    }

    body.login-locked #loginModal .modal-card {
      box-shadow: 0 20px 45px rgba(15, 23, 42, 0.08), 0 4px 12px rgba(15, 23, 42, 0.04) !important;
      border: 1px solid #e2e8f0 !important;
      background: #ffffff !important;
      max-width: 420px !important;
      width: 100% !important;
      padding: 32px 28px !important;
      border-radius: 12px !important;
    }

    body.login-locked #loginModal #loginModalCloseBtn,
    body.login-locked #loginModal #loginModalCancelBtn {
      display: none !important;
    }

    /* ==================== TOPBAR ==================== */
    .topbar {
      background: var(--bg-surface);
      border-bottom: 1px solid var(--border);
      padding: 0 20px;
      height: 52px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      position: sticky;
      top: 0;
      z-index: 100;
      gap: 16px;
    }

    .topbar-left {
      display: flex;
      align-items: center;
      gap: 24px;
    }

    .topbar-brand {
      font-weight: 700;
      font-size: 14px;
      color: var(--text-primary);
      letter-spacing: -0.02em;
      white-space: nowrap;
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .brand-indicator {
      width: 8px;
      height: 8px;
      border-radius: 2px;
      background: var(--text-primary);
    }

    .nav-tabs {
      display: flex;
      align-items: center;
      gap: 4px;
    }

    .nav-tab {
      border: none;
      background: transparent;
      color: var(--text-secondary);
      font-family: inherit;
      font-size: 12.5px;
      font-weight: 500;
      padding: 6px 12px;
      border-radius: 6px;
      cursor: pointer;
      transition: all 0.12s ease;
      white-space: nowrap;
    }

    .nav-tab:hover {
      color: var(--text-primary);
      background: var(--bg-subtle);
    }

    .nav-tab.active {
      background: var(--text-primary);
      color: #ffffff;
      font-weight: 600;
    }

    .topbar-right {
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .user-pill {
      display: inline-flex;
      align-items: center;
      padding: 4px 10px;
      border-radius: 6px;
      font-size: 12px;
      font-weight: 500;
      background: var(--bg-subtle);
      color: var(--text-secondary);
      border: 1px solid var(--border);
      cursor: pointer;
      white-space: nowrap;
    }

    .user-pill.admin {
      background: #f8fafc;
      color: var(--text-primary);
      border-color: var(--border-strong);
      font-weight: 600;
    }

    /* ==================== BUTTONS & INPUTS ==================== */
    .btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      height: 32px;
      padding: 0 12px;
      border-radius: 6px;
      font-family: inherit;
      font-size: 12px;
      font-weight: 500;
      cursor: pointer;
      border: 1px solid var(--border);
      background: var(--bg-surface);
      color: var(--text-primary);
      transition: all 0.12s ease;
      white-space: nowrap;
    }

    .btn:hover {
      background: var(--bg-subtle);
      border-color: var(--border-strong);
    }

    .btn:disabled {
      opacity: 0.55;
      cursor: not-allowed;
    }

    .btn-primary {
      background: var(--text-primary);
      color: #ffffff;
      border-color: var(--text-primary);
      font-weight: 600;
    }

    .btn-primary:hover {
      background: #1e293b;
      border-color: #1e293b;
    }

    .btn-blue {
      background: #eff6ff;
      color: #1d4ed8;
      border-color: #bfdbfe;
      font-weight: 600;
    }

    .btn-blue:hover {
      background: #dbeafe;
    }

    .control-select,
    .control-input {
      height: 32px;
      padding: 0 10px;
      border: 1px solid var(--border);
      border-radius: 6px;
      background: var(--bg-surface);
      color: var(--text-primary);
      font-family: inherit;
      font-size: 12px;
      outline: none;
      transition: border-color 0.12s;
    }

    .control-select:focus,
    .control-input:focus {
      border-color: var(--text-primary);
    }

    .auto-toggle-pill {
      font-size: 11.5px;
      font-weight: 500;
      color: var(--text-secondary);
      background: var(--bg-subtle);
      border: 1px solid var(--border);
      padding: 0 10px;
      height: 32px;
      border-radius: 6px;
      display: inline-flex;
      align-items: center;
      gap: 6px;
      cursor: pointer;
      user-select: none;
      white-space: nowrap;
    }

    /* ==================== FILTER BAR ==================== */
    .filter-bar {
      background: var(--bg-surface);
      border-bottom: 1px solid var(--border);
      padding: 8px 20px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      flex-wrap: wrap;
      gap: 10px;
    }

    .filter-group {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
    }

    .filter-label {
      font-size: 11.5px;
      font-weight: 600;
      color: var(--text-muted);
      text-transform: uppercase;
      letter-spacing: 0.03em;
    }

    

/* ==================== LOOKER STUDIO SIDEBAR + COMPACT CAMPAIGN CHARTS + CLEAN TABLE ==================== */
    html, body {
      height: 100vh;
      width: 100vw;
      overflow: hidden;
      background: #f4f6fa;
    }

    .app-shell {
      display: flex;
      flex-direction: row;
      width: 100vw;
      height: 100vh;
      overflow: hidden;
      background: #f4f6fa;
    }

    /* 1. SLEEK LEFT SIDEBAR (236px, COLLAPSIBLE) */
    .app-sidebar {
      width: 236px;
      min-width: 236px;
      height: 100vh;
      background: #ffffff;
      border-right: 1px solid #e2e8f0;
      display: flex;
      flex-direction: column;
      z-index: 120;
      box-shadow: 2px 0 8px rgba(15, 23, 42, 0.03);
      transition: margin-left 0.2s ease;
    }

    body.sidebar-collapsed .app-sidebar {
      margin-left: -236px;
    }

    .floating-sidebar-toggle {
      display: none;
      position: fixed;
      left: 12px;
      top: 10px;
      z-index: 9999;
      background: #0f172a;
      color: #ffffff;
      border: 1.5px solid rgba(255, 255, 255, 0.25);
      border-radius: 8px;
      padding: 6px 13px;
      font-size: 11.5px;
      font-weight: 700;
      cursor: pointer;
      box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
      align-items: center;
      gap: 6px;
      transition: transform 0.15s, background 0.15s;
    }
    .floating-sidebar-toggle:hover {
      background: #1e293b;
      transform: scale(1.04);
    }
    body.sidebar-collapsed .floating-sidebar-toggle {
      display: inline-flex !important;
    }

    .sidebar-brand-bar {
      height: 46px;
      padding: 0 12px;
      border-bottom: 1px solid #f1f5f9;
      display: flex;
      align-items: center;
      justify-content: space-between;
      flex-shrink: 0;
    }

    .looker-brand {
      display: flex;
      align-items: center;
      gap: 8px;
      font-weight: 700;
      font-size: 13.5px;
      color: #0f172a;
      letter-spacing: -0.02em;
    }

    .looker-brand-icon {
      width: 24px;
      height: 24px;
      border-radius: 6px;
      background: linear-gradient(135deg, #1a73e8 0%, #0d47a1 100%);
      color: #ffffff;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-size: 12.5px;
      font-weight: 800;
      box-shadow: 0 2px 4px rgba(26, 115, 232, 0.25);
    }

    .sidebar-scroll {
      flex: 1;
      overflow-y: auto;
      padding: 10px 10px;
      display: flex;
      flex-direction: column;
      gap: 10px;
    }

    /* LIVE SHEET TIME MONITOR CARD IN SIDEBAR */
    .sync-highlight-card {
      background: linear-gradient(180deg, #f0fdf4 0%, #dcfce7 100%);
      border: 1px solid #86efac;
      border-radius: 8px;
      padding: 7px 9px;
      display: flex;
      flex-direction: column;
      gap: 5px;
      transition: all 0.25s ease;
    }

    .sync-highlight-card.sync-flash {
      background: #fef9c3;
      border-color: #eab308;
      box-shadow: 0 0 0 3px rgba(234, 179, 8, 0.25);
    }

    .sync-live-dot {
      width: 7px;
      height: 7px;
      border-radius: 50%;
      background: #10b981;
      box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.22);
      animation: pulseLiveDot 1.8s infinite ease-in-out;
      flex-shrink: 0;
    }

    @keyframes pulseLiveDot {
      0%, 100% { transform: scale(1); opacity: 1; }
      50% { transform: scale(1.25); opacity: 0.65; }
    }

    .sync-time-value {
      font-family: 'JetBrains Mono', monospace;
      font-weight: 800;
      font-size: 13px;
      color: #065f46;
      background: #ffffff;
      padding: 1px 6px;
      border-radius: 4px;
      border: 1px solid #86efac;
      letter-spacing: -0.02em;
    }

    /* SIDEBAR VERTICAL NAV TABS */
    .sidebar-nav {
      display: flex;
      flex-direction: column;
      gap: 3px;
    }

    .nav-tab {
      border: 1px solid transparent;
      background: transparent;
      color: #475569;
      font-family: inherit;
      font-size: 12px;
      font-weight: 600;
      padding: 6px 10px;
      border-radius: 6px;
      cursor: pointer;
      transition: all 0.12s ease;
      display: flex;
      align-items: center;
      justify-content: space-between;
      text-align: left;
      width: 100%;
    }

    .nav-tab:hover {
      color: #0f172a;
      background: #f8fafc;
    }

    .nav-tab.active {
      background: #eff6ff;
      color: #1a73e8;
      border-color: #bfdbfe;
      font-weight: 700;
    }

    /* SIDEBAR FILTER STACK (CONSOLIDATED INTO LEFT CORNER) */
    .sidebar-filter-box {
      border-top: 1px solid #e2e8f0;
      padding: 10px 10px 12px 10px;
      display: flex;
      flex-direction: column;
      gap: 7px;
      background: #f8fafc;
    }

    .sidebar-section-title {
      font-size: 10px;
      font-weight: 800;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      color: #64748b;
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 2px;
    }

    .btn-sidebar-reset {
      font-size: 10px;
      font-weight: 600;
      color: #475569;
      background: #ffffff;
      border: 1px solid #cbd5e1;
      padding: 1px 7px;
      border-radius: 4px;
      cursor: pointer;
      transition: all 0.15s;
    }

    .btn-sidebar-reset:hover {
      background: #f1f5f9;
      color: #0f172a;
      border-color: #94a3b8;
    }

    .sidebar-search-wrap {
      position: relative;
      display: flex;
      align-items: center;
      width: 100%;
    }

    .sidebar-search-wrap input,
    #searchInput {
      width: 100% !important;
      height: 29px !important;
      padding: 0 24px 0 29px !important;
      border: 1.5px solid #cbd5e1 !important;
      border-radius: 6px !important;
      font-size: 11.5px !important;
      font-weight: 500 !important;
      background: #ffffff !important;
      color: #0f172a !important;
      outline: none !important;
      transition: border-color 0.15s !important;
      box-sizing: border-box !important;
    }

    /* Hide WebKit default search cancel/decoration to preserve custom clear button */
    input[type="search"]::-webkit-search-decoration,
    input[type="search"]::-webkit-search-cancel-button,
    input[type="search"]::-webkit-search-results-button,
    input[type="search"]::-webkit-search-results-decoration {
      -webkit-appearance: none;
      appearance: none;
      display: none;
    }

    .sidebar-search-wrap input:focus,
    #searchInput:focus {
      border-color: #2563eb !important;
      box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15) !important;
    }

    .sidebar-search-icon {
      position: absolute;
      left: 8px;
      top: 50%;
      transform: translateY(-50%);
      font-size: 11px;
      line-height: 1;
      color: #94a3b8;
      pointer-events: none;
      z-index: 2;
    }

    .sidebar-search-clear {
      position: absolute;
      right: 7px;
      top: 50%;
      transform: translateY(-50%);
      background: none;
      border: none;
      color: #94a3b8;
      font-size: 11px;
      cursor: pointer;
      padding: 2px;
      z-index: 2;
    }

    .sidebar-grid-2 {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 6px;
    }

    .sidebar-field {
      display: flex;
      flex-direction: column;
      gap: 2px;
      min-width: 0;
    }

    .sidebar-field label {
      font-size: 10px;
      font-weight: 700;
      color: #475569;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      text-transform: uppercase;
      letter-spacing: 0.02em;
    }

    .sidebar-field select,
    .sidebar-field input:not(#searchInput) {
      height: 27px;
      padding: 0 6px;
      border: 1px solid #cbd5e1;
      border-radius: 5px;
      background: #ffffff;
      font-family: inherit;
      font-size: 11px;
      font-weight: 600;
      color: #0f172a;
      outline: none;
      width: 100%;
      min-width: 0;
    }

    .sidebar-field select:focus,
    .sidebar-field input:not(#searchInput):focus {
      border-color: #2563eb;
      box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
    }

    .sidebar-roas-chips {
      display: grid;
      grid-template-columns: repeat(5, 1fr);
      gap: 2px;
      margin-top: 2px;
    }

    .sidebar-roas-chips button {
      padding: 3px 2px;
      font-size: 9px;
      font-weight: 700;
      border-radius: 4px;
      text-align: center;
      border: 1px solid transparent;
      cursor: pointer;
      white-space: nowrap;
    }

    .bi-expand-all-label {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      font-size: 10.5px;
      font-weight: 700;
      color: #1d4ed8;
      cursor: pointer;
      background: #eff6ff;
      border: 1px solid #bfdbfe;
      padding: 2px 7px;
      border-radius: 5px;
      user-select: none;
    }

    .sidebar-footer {
      border-top: 1px solid #e2e8f0;
      padding: 8px 10px;
      background: #f8fafc;
      display: flex;
      flex-direction: column;
      gap: 6px;
      flex-shrink: 0;
    }

    /* 2. MAIN WORKSPACE (RIGHT SIDE) */
    .app-main {
      flex: 1;
      min-width: 0;
      min-height: 0;
      display: flex;
      flex-direction: column;
      overflow: hidden;
      background: #f4f6fa;
    }

    