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

  body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #141414;
    color: #D1CFBF;
    min-height: 100vh;
    overflow: auto;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
  }

  [x-cloak] { display: none !important; }

  /* Platform-specific layout overrides are in desktop.css / mobile.css */

  /* ---- Titlebar / drag region ---- */
  .titlebar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 38px;
    z-index: 200;
    background: #1a1a1a;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    padding-left: 78px;
  }

  .titlebar-title {
    font-size: 0.72rem;
    font-weight: 600;
    color: rgba(255,255,255,0.35);
    letter-spacing: 0.02em;
  }

  /* ===== LOGIN SCREEN ===== */
  .login-layout {
    display: flex;
    height: 100vh;
    padding-top: 0;
  }

  .hero-panel {
    flex: 0 0 400px;
    background: #1d1d21;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 2.5rem 2.5rem 2rem;
    position: relative;
    overflow: hidden;
    border-right: 1px solid rgba(255,255,255,0.08);
  }

  .hero-panel::before {
    content: '';
    position: absolute;
    top: -150px; left: -150px;
    width: 450px; height: 450px;
    background: radial-gradient(circle, rgba(201,169,110,0.08) 0%, transparent 70%);
    pointer-events: none;
  }

  .hero-brand { position: relative; z-index: 1; }
  .hero-brand-logo { width: 160px; height: auto; }
  .hero-brand p {
    color: rgba(209,207,191,0.4);
    font-size: 0.78rem;
    margin-top: 0.4rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
  }

  .hero-features { position: relative; z-index: 1; }

  .hero-feature {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
  }
  .hero-feature:last-child { margin-bottom: 0; }

  .hero-feature-icon {
    width: 36px; height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(201,169,110,0.1);
    color: #c9a96e;
    border: 1px solid rgba(201,169,110,0.15);
  }

  .hero-feature h3 {
    font-family: 'Poppins', sans-serif;
    font-size: 0.88rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 0.15rem;
  }

  .hero-feature p {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.4);
    line-height: 1.5;
  }

  .hero-footer {
    position: relative; z-index: 1;
    font-size: 0.72rem;
    color: rgba(255,255,255,0.2);
  }

  .login-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #141414;
    position: relative;
  }

  .login-card { width: 360px; }

  .login-header { margin-bottom: 1.75rem; }
  .login-header h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(113deg, #fff 13%, rgba(216,216,216,0.55));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.4rem;
  }
  .login-header p { color: rgba(255,255,255,0.4); font-size: 0.88rem; }

  .form-group { margin-bottom: 1rem; }
  .form-group label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    color: rgba(255,255,255,0.45);
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
  }
  .form-group input, .form-input {
    width: 100%;
    padding: 0.75rem 0.875rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    color: #fff;
    font-size: 0.9rem;
    font-family: inherit;
    transition: all 0.2s ease;
  }
  .form-group input:focus, .form-input:focus {
    outline: none;
    border-color: #c9a96e;
    background: rgba(255,255,255,0.05);
    box-shadow: 0 0 0 3px rgba(201,169,110,0.1);
  }
  .form-group input::placeholder, .form-input::placeholder { color: rgba(255,255,255,0.2); }

  .btn-primary {
    width: 100%;
    padding: 0.8rem 1.25rem;
    background: linear-gradient(135deg, #c9a96e 0%, #b89355 100%);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 0.85rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.25s ease;
    margin-top: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }
  .btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    filter: saturate(1.3);
    box-shadow: 0 8px 24px rgba(201,169,110,0.2);
  }
  .btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

  .error-msg {
    background: rgba(239,68,68,0.06);
    border: 1px solid rgba(239,68,68,0.15);
    color: #fca5a5;
    padding: 0.6rem 0.875rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.82rem;
  }

  .spinner-sm {
    display: inline-block;
    width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 0.4rem;
  }

  @keyframes spin { to { transform: rotate(360deg); } }

  .version-tag {
    position: absolute;
    bottom: 1rem; right: 1.25rem;
    font-size: 0.68rem;
    color: rgba(255,255,255,0.15);
  }

  /* ===== APP SHELL ===== */
  .app-layout {
    display: flex;
    height: 100vh;
    padding-top: 0;
  }

  /* Sidebar */
  .sidebar {
    width: 220px;
    background: #1a1a1a;
    border-right: 1px solid rgba(255,255,255,0.06);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow-y: auto;
  }

  .sidebar-brand {
    padding: 1.25rem 1.25rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }
  .sidebar-brand img { width: 120px; height: auto; }

  .sidebar-nav {
    padding: 0.75rem 0;
    flex: 1;
  }

  .nav-section-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: rgba(255,255,255,0.25);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0.75rem 1.25rem 0.35rem;
  }

  .nav-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 1.25rem;
    cursor: pointer;
    color: rgba(255,255,255,0.5);
    font-size: 0.82rem;
    font-weight: 500;
    transition: all 0.15s ease;
    border-left: 3px solid transparent;
    user-select: none;
  }
  .nav-item:hover { color: rgba(255,255,255,0.8); background: rgba(255,255,255,0.02); }
  .nav-item.active {
    color: #c9a96e;
    background: rgba(201,169,110,0.06);
    border-left-color: #c9a96e;
  }
  .nav-item svg { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.7; }
  .nav-item.active svg { opacity: 1; }

  .sidebar-footer {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid rgba(255,255,255,0.06);
  }

  .sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.4rem 0;
  }

  .sidebar-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: rgba(201,169,110,0.15);
    color: #c9a96e;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
  }

  .sidebar-user-info { flex: 1; min-width: 0; }
  .sidebar-user-name {
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(255,255,255,0.8);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .sidebar-user-role {
    font-size: 0.68rem;
    color: rgba(255,255,255,0.3);
    text-transform: capitalize;
  }

  .btn-logout {
    background: none;
    border: 1px solid rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.4);
    padding: 0.35rem 0.6rem;
    border-radius: 6px;
    font-size: 0.72rem;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
  }
  .btn-logout:hover { border-color: rgba(239,68,68,0.3); color: #fca5a5; }

  /* Main content */
  .main-content {
    flex: 1;
    overflow-y: auto;
    background: #141414;
  }

  .page-header {
    padding: 1.5rem 2rem 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .page-header h1 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
  }

  .page-body { padding: 0.75rem 2rem 2rem; }

  /* Cards & stats */
  .stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
  }

  .stat-card {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    padding: 1.25rem;
    transition: border-color 0.2s ease;
  }
  .stat-card:hover { border-color: rgba(255,255,255,0.1); }

  .stat-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: rgba(255,255,255,0.35);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.5rem;
  }

  .stat-value {
    font-family: 'Poppins', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: #fff;
  }

  .stat-sub {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.3);
    margin-top: 0.25rem;
  }

  /* Dashboard filter bar */
  .dash-filter-bar {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .dash-period-selector {
    display: flex;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 6px;
    overflow: hidden;
  }

  .dash-period-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-right: 1px solid rgba(255,255,255,0.06);
    background: transparent;
    color: rgba(255,255,255,0.5);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.02em;
  }
  .dash-period-btn:last-child { border-right: none; }
  .dash-period-btn:hover:not(.active) { background: rgba(255,255,255,0.05); }
  .dash-period-btn.active { background: rgba(201,169,110,0.15); color: #c9a96e; }

  /* Dashboard metric cards */
  .dash-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
  }

  .dash-metric-card {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    padding: 1.25rem;
    transition: border-color 0.2s ease;
  }
  .dash-metric-card:hover { border-color: rgba(255,255,255,0.1); }

  .dash-metric-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
  }

  .dash-metric-icon {
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.5);
  }

  .dash-metric-change {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.45rem;
    border: 2px solid;
    font-weight: 700;
    font-size: 0.7rem;
  }
  .dash-metric-change.positive { color: #22c55e; border-color: #22c55e; background: rgba(34,197,94,0.1); }
  .dash-metric-change.negative { color: #ef4444; border-color: #ef4444; background: rgba(239,68,68,0.1); }

  .dash-metric-title {
    font-size: 0.72rem;
    font-weight: 600;
    color: rgba(255,255,255,0.35);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.35rem;
  }

  .dash-metric-value {
    font-family: 'Poppins', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.35rem;
  }

  .dash-metric-subtitle {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.3);
  }

  /* Dashboard charts */
  .dash-charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
  }

  .dash-chart-card {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    padding: 1.25rem;
  }

  .dash-chart-title {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.15rem;
  }

  .dash-chart-subtitle {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.35);
    margin-bottom: 1rem;
  }

  .dash-chart-container {
    position: relative;
    height: 260px;
  }

  /* Top Campaigns list */
  .dash-campaigns-list { display: flex; flex-direction: column; }
  .dash-campaign-row { display: flex; align-items: center; gap: 0.75rem; padding: 0.7rem 0; border-bottom: 1px solid rgba(255,255,255,0.04); }
  .dash-campaign-row:last-child { border-bottom: none; }
  .dash-campaign-rank { width: 24px; height: 24px; border-radius: 6px; background: rgba(255,255,255,0.06); display: flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: 700; color: rgba(255,255,255,0.4); flex-shrink: 0; }
  .dash-campaign-info { flex: 1; min-width: 0; }
  .dash-campaign-id { font-size: 0.85rem; font-weight: 600; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .dash-campaign-meta { font-size: 0.75rem; color: rgba(255,255,255,0.35); display: flex; gap: 0.3rem; }
  .dash-campaign-revenue { font-size: 0.85rem; font-weight: 700; color: #c9a96e; flex-shrink: 0; }

  /* Dashboard spinner */
  .dash-spinner {
    border: 3px solid rgba(201,169,110,0.15);
    border-top-color: #c9a96e;
    border-radius: 50%;
    width: 2rem;
    height: 2rem;
    animation: dashspin 1s linear infinite;
    margin: 3rem auto;
  }
  @keyframes dashspin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

  /* Tables */
  .data-table-wrap {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    overflow: hidden;
  }

  .table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    gap: 0.75rem;
  }

  .table-search {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 6px;
    padding: 0.4rem 0.75rem;
    color: #fff;
    font-size: 0.82rem;
    font-family: inherit;
    width: 220px;
    transition: border-color 0.2s ease;
  }
  .table-search:focus { outline: none; border-color: #c9a96e; }
  .table-search::placeholder { color: rgba(255,255,255,0.2); }

  .btn-sm {
    padding: 0.4rem 0.875rem;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
  }
  .btn-gold {
    background: linear-gradient(135deg, #c9a96e 0%, #b89355 100%);
    color: white;
  }
  .btn-gold:hover { filter: saturate(1.3); transform: translateY(-1px); }
  .btn-ghost {
    background: rgba(255,255,255,0.04);
    color: rgba(255,255,255,0.6);
    border: 1px solid rgba(255,255,255,0.08);
  }
  .btn-ghost:hover { border-color: rgba(255,255,255,0.15); color: rgba(255,255,255,0.8); }
  .btn-danger-ghost {
    background: rgba(239,68,68,0.04);
    color: rgba(239,68,68,0.6);
    border: 1px solid rgba(239,68,68,0.1);
  }
  .btn-danger-ghost:hover { border-color: rgba(239,68,68,0.3); color: #fca5a5; }

  table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
  }
  thead th {
    text-align: left;
    font-size: 0.68rem;
    font-weight: 700;
    color: rgba(255,255,255,0.35);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.5rem 0.4rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    white-space: nowrap;
    background: rgba(255,255,255,0.02);
  }
  tbody td {
    padding: 0.45rem 0.4rem;
    font-size: 0.75rem;
    color: rgba(255,255,255,0.5);
    border-bottom: 1px solid rgba(255,255,255,0.03);
    vertical-align: middle;
  }
  tbody tr { height: 40px; transition: background 0.15s; }
  tbody tr:hover { background: rgba(201,169,110,0.04); }
  tbody tr:last-child td { border-bottom: none; }

  /* Lead checkbox styling */
  .lead-checkbox {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 14px !important;
    height: 14px !important;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 3px;
    background: rgba(255,255,255,0.03);
    cursor: pointer;
    position: relative;
    transition: all 0.15s ease;
    vertical-align: middle;
  }
  .lead-checkbox:hover {
    border-color: rgba(201,169,110,0.4);
    background: rgba(201,169,110,0.06);
  }
  .lead-checkbox:checked {
    background: #c9a96e;
    border-color: #c9a96e;
  }
  .lead-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 4px;
    height: 8px;
    border: solid #fff;
    border-width: 0 1.5px 1.5px 0;
    transform: rotate(45deg);
  }

  /* Column manager */
  .col-mgr-btn {
    padding: 0.2rem 0.45rem;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 5px;
    background: rgba(255,255,255,0.04);
    color: rgba(255,255,255,0.5);
    font-weight: 600;
    font-size: 0.65rem;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.05em;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.2rem;
  }
  .col-mgr-btn:hover {
    background: rgba(201,169,110,0.15);
    color: #c9a96e;
    border-color: rgba(201,169,110,0.3);
  }
  .col-mgr-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.4rem;
    background: #1e1e22;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 0.75rem;
    min-width: 240px;
    max-height: 350px;
    overflow-y: auto;
    z-index: 10000;
    box-shadow: 0 10px 25px rgba(0,0,0,0.4);
  }
  .col-mgr-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.4rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.15s;
    margin-bottom: 0.35rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
  }
  .col-mgr-item:hover {
    background: rgba(201,169,110,0.06);
    border-color: rgba(201,169,110,0.3);
  }
  .col-mgr-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #c9a96e;
  }
  .col-mgr-badge {
    font-size: 0.6rem;
    padding: 0.1rem 0.3rem;
    border-radius: 8px;
    font-weight: 700;
    text-transform: uppercase;
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.4);
  }

  /* Status pill for leads table */
  .status-pill {
    padding: 0.2rem 0.4rem;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-radius: 2px;
    white-space: nowrap;
  }

  .badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 600;
  }
  .badge-green { background: rgba(34,197,94,0.1); color: #4ade80; }
  .badge-red { background: rgba(239,68,68,0.1); color: #f87171; }
  .badge-blue { background: rgba(59,130,246,0.1); color: #60a5fa; }
  .badge-yellow { background: rgba(234,179,8,0.1); color: #fbbf24; }
  .badge-gray { background: rgba(255,255,255,0.05); color: rgba(255,255,255,0.4); }

  .empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: rgba(255,255,255,0.3);
  }
  .empty-state svg { margin-bottom: 0.75rem; opacity: 0.3; }
  .empty-state p { font-size: 0.88rem; }

  /* Modals */
  .modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 300;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    backdrop-filter: blur(2px);
  }

  .modal {
    background: #1e1e22;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px 16px 0 0;
    width: 100%;
    max-width: 100vw;
    max-height: 92vh;
    overflow-y: auto;
    box-shadow: 0 -8px 32px rgba(0,0,0,0.4);
    -webkit-overflow-scrolling: touch;
  }

  .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    position: sticky;
    top: 0;
    background: #1e1e22;
    z-index: 1;
  }
  .modal-header::before {
    content: '';
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 4px;
    background: rgba(255,255,255,0.15);
    border-radius: 2px;
  }
  .modal-header h3 {
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    padding-top: 0.25rem;
  }
  .modal-close {
    background: rgba(255,255,255,0.06);
    border: none;
    color: rgba(255,255,255,0.5);
    cursor: pointer;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 1.1rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .modal-body { padding: 1rem; }

  .modal-body .form-group { margin-bottom: 0.85rem; }
  .modal-body .form-group:last-child { margin-bottom: 0; }

  .modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
    border-top: 1px solid rgba(255,255,255,0.06);
    position: sticky;
    bottom: 0;
    background: #1e1e22;
  }

  .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
  }

  .form-toggle {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
  }
  .form-toggle input[type="checkbox"] {
    width: 36px; height: 20px;
    appearance: none;
    background: rgba(255,255,255,0.08);
    border-radius: 10px;
    position: relative;
    cursor: pointer;
    transition: background 0.2s ease;
  }
  .form-toggle input[type="checkbox"]::after {
    content: '';
    position: absolute;
    width: 16px; height: 16px;
    background: #fff;
    border-radius: 50%;
    top: 2px; left: 2px;
    transition: transform 0.2s ease;
  }
  .form-toggle input[type="checkbox"]:checked {
    background: #c9a96e;
  }
  .form-toggle input[type="checkbox"]:checked::after {
    transform: translateX(16px);
  }
  .form-toggle span {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.6);
  }

  select.form-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23666' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2rem;
  }
  select.form-input option { background: #1e1e22; color: #fff; }

  /* Loading overlay */
  .loading-overlay {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
  }
  .loader {
    width: 32px; height: 32px;
    border: 3px solid rgba(201,169,110,0.15);
    border-top-color: #c9a96e;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
  }

  /* Route groups / destinations nested */
  .nested-section {
    background: rgba(255,255,255,0.01);
    border: 1px solid rgba(255,255,255,0.04);
    border-radius: 8px;
    margin-top: 1rem;
    padding: 1rem;
  }
  .nested-section h4 {
    font-size: 0.82rem;
    font-weight: 600;
    color: rgba(255,255,255,0.5);
    margin-bottom: 0.75rem;
  }

  .text-truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
  }

  .action-btns { display: flex; gap: 0.35rem; }

  /* ===== Enhanced Lead Filters ===== */
  .filters-card {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    margin-bottom: 0.5rem;
    overflow: visible;
  }

  .filters-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.45rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    gap: 0.5rem;
  }

  .filters-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    padding: 0.5rem 0.75rem;
  }

  .filters-row + .filters-row {
    border-top: 1px solid rgba(255,255,255,0.04);
  }

  /* Multiselect dropdown */
  .ms-wrap {
    position: relative;
    min-width: 150px;
    flex: 1;
  }

  .ms-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.45rem 0.7rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 6px;
    color: rgba(255,255,255,0.7);
    font-size: 0.8rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: border-color 0.2s;
    white-space: nowrap;
  }
  .ms-btn:hover, .ms-btn.open { border-color: #c9a96e; }

  .ms-btn svg { flex-shrink: 0; transition: transform 0.2s; }

  .ms-drop {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    min-width: 200px;
    max-height: 260px;
    overflow-y: auto;
    background: #1e1e22;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.5);
    z-index: 500;
    padding: 0.25rem 0;
  }

  .ms-drop-search {
    padding: 0.4rem 0.6rem;
    margin: 0.25rem 0.5rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 5px;
    color: #fff;
    font-size: 0.78rem;
    font-family: inherit;
    width: calc(100% - 1rem);
  }
  .ms-drop-search:focus { outline: none; border-color: #c9a96e; }
  .ms-drop-search::placeholder { color: rgba(255,255,255,0.25); }

  .ms-opt {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    cursor: pointer;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.7);
    transition: background 0.12s;
  }
  .ms-opt:hover { background: rgba(255,255,255,0.05); }
  .ms-opt.selected { color: #c9a96e; font-weight: 600; }

  .ms-opt input[type="checkbox"] {
    width: 15px; height: 15px;
    accent-color: #c9a96e;
    cursor: pointer;
    flex-shrink: 0;
  }

  .ms-empty {
    padding: 0.75rem;
    text-align: center;
    color: rgba(255,255,255,0.25);
    font-size: 0.78rem;
  }

  /* Date presets */
  .date-presets {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 180px;
    background: #1e1e22;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.5);
    z-index: 500;
    padding: 0.25rem 0;
  }

  .date-preset-item {
    padding: 0.45rem 0.85rem;
    cursor: pointer;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.65);
    transition: background 0.12s;
  }
  .date-preset-item:hover { background: rgba(255,255,255,0.05); }
  .date-preset-item.active { color: #c9a96e; font-weight: 600; }

  /* Filter action buttons */
  .filter-actions {
    display: flex;
    gap: 0.4rem;
    align-items: center;
    margin-left: auto;
  }

  .filter-count {
    background: #c9a96e;
    color: #1a1a1a;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.1rem 0.4rem;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
  }

  /* Advanced filters toggle */
  .adv-toggle {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.7rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 6px;
    color: rgba(255,255,255,0.55);
    font-size: 0.78rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s;
  }
  .adv-toggle:hover { border-color: rgba(255,255,255,0.15); color: rgba(255,255,255,0.8); }

  .adv-section {
    padding: 0.5rem 0.75rem;
    border-top: 1px solid rgba(255,255,255,0.04);
  }

  .adv-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.6rem;
  }

  .adv-field label {
    display: block;
    font-size: 0.65rem;
    font-weight: 600;
    color: rgba(255,255,255,0.35);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.3rem;
  }

  .adv-field input,
  .adv-field select {
    width: 100%;
    padding: 0.4rem 0.6rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 6px;
    color: #fff;
    font-size: 0.8rem;
    font-family: inherit;
  }
  .adv-field input:focus,
  .adv-field select:focus { outline: none; border-color: #c9a96e; }
  .adv-field select option { background: #1e1e22; color: #fff; }

  /* ===== Filter Tabs ===== */
  .filter-tabs-inline {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-wrap: wrap;
  }

  .filter-tab-inline {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.65rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 500;
    color: rgba(255,255,255,0.5);
    transition: all 0.15s;
    position: relative;
    white-space: nowrap;
  }
  .filter-tab-inline:hover { border-color: rgba(255,255,255,0.15); color: rgba(255,255,255,0.7); }
  .filter-tab-inline.active {
    background: rgba(201,169,110,0.12);
    border-color: #c9a96e;
    color: #c9a96e;
    font-weight: 600;
  }

  .filter-tab-indicator {
    width: 6px; height: 6px;
    background: #c9a96e;
    border-radius: 50%;
    flex-shrink: 0;
  }

  .filter-tab-name-input {
    background: transparent;
    border: 1px solid #c9a96e;
    border-radius: 3px;
    color: inherit;
    font-size: inherit;
    font-family: inherit;
    font-weight: inherit;
    padding: 0.1rem 0.3rem;
    width: 80px;
    outline: none;
  }

  .filter-tab-close {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: rgba(255,255,255,0.3);
    cursor: pointer;
    padding: 0.1rem;
    border-radius: 3px;
    transition: all 0.15s;
  }
  .filter-tab-close:hover { color: #ef4444; background: rgba(239,68,68,0.1); }

  .filter-tab-add-inline {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px; height: 26px;
    background: rgba(255,255,255,0.03);
    border: 1px dashed rgba(255,255,255,0.12);
    border-radius: 6px;
    color: rgba(255,255,255,0.3);
    cursor: pointer;
    transition: all 0.15s;
  }
  .filter-tab-add-inline:hover { border-color: #c9a96e; color: #c9a96e; }

  /* ===== Field Filter Rows ===== */
  .field-filter-rows {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    flex: 1;
    min-width: 0;
  }

  .field-filter-row {
    display: flex;
    gap: 0.4rem;
    align-items: center;
  }

  .field-filter-row .ms-wrap { min-width: 140px; flex: 1; }
  .field-filter-row .ms-wrap:first-child { flex: 1.5; }

  .field-filter-row input.ff-value {
    flex: 1;
    min-width: 100px;
    padding: 0.45rem 0.7rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 6px;
    color: #fff;
    font-size: 0.8rem;
    font-family: inherit;
  }
  .field-filter-row input.ff-value:focus { outline: none; border-color: #c9a96e; }
  .field-filter-row input.ff-value:disabled { opacity: 0.35; cursor: not-allowed; }
  .field-filter-row input.ff-value::placeholder { color: rgba(255,255,255,0.25); }

  .ff-remove-btn {
    padding: 0.4rem 0.6rem;
    background: #ef4444;
    color: white;
    border: none;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: opacity 0.15s;
  }
  .ff-remove-btn:hover { opacity: 0.85; }

  .ff-add-btn {
    padding: 0.4rem 0.6rem;
    background: #c9a96e;
    color: white;
    border: 1px solid rgba(255,255,255,0.06);
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
    transition: all 0.2s;
  }
  .ff-add-btn:hover { background: #e55a2b; transform: translateY(-1px); }

  .filters-row-2 {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
    padding: 0.5rem 0.75rem;
    border-top: 1px solid rgba(255,255,255,0.04);
  }

  /* Stats bar (compact, inside table) */
  .leads-table-stats {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.3rem 0.75rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }

  .leads-stat {
    display: flex;
    gap: 0.25rem;
    align-items: baseline;
  }

  .leads-stat-value {
    font-size: 0.82rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.02em;
  }

  .leads-stat-label {
    font-size: 0.68rem;
    font-weight: 600;
    color: rgba(255,255,255,0.3);
  }

  .leads-stat-divider {
    width: 1px;
    height: 14px;
    background: rgba(255,255,255,0.08);
  }

  /* ===== REPORTS ===== */
  .report-tabs {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    padding-bottom: 0;
  }
  .report-tab {
    padding: 0.6rem 1rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(255,255,255,0.4);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
  }
  .report-tab:hover { color: rgba(255,255,255,0.7); }
  .report-tab.active {
    color: #c9a96e;
    border-bottom-color: #c9a96e;
  }

  .report-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
  }
  .metric-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 1.25rem;
    transition: all 0.2s ease;
  }
  .metric-card:hover {
    border-color: rgba(201,169,110,0.3);
    transform: translateY(-2px);
  }
  .metric-card.report-highlight {
    background: rgba(201,169,110,0.08);
    border-color: rgba(201,169,110,0.2);
  }
  .metric-card.report-highlight .metric-label { color: #c9a96e; }
  .metric-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    color: rgba(255,255,255,0.4);
    letter-spacing: 0.5px;
    margin-bottom: 0.4rem;
  }
  .metric-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: #fff;
    line-height: 1;
  }

  .report-charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1rem;
  }
  .chart-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 1.25rem;
  }
  .chart-card h3 {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #fff;
    margin: 0 0 1rem 0;
    letter-spacing: 0.3px;
  }
  .chart-card .apexcharts-canvas {
    max-height: 280px;
  }
  .chart-card > div:last-child {
    height: 280px;
  }

  @media (max-width: 768px) {
    .report-charts-grid { grid-template-columns: 1fr; }
    .report-metrics { grid-template-columns: 1fr; }
    .report-tabs { overflow-x: auto; }
  }

  /* Revenue Insights Modal */
  .revenue-modal {
    background: #1e1e22;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    width: 100%;
    max-width: 1000px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: revModalSlideIn 0.3s ease;
  }
  @keyframes revModalSlideIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
  }
  .revenue-modal-header {
    background: #1a1a1a;
    color: #ffffff;
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
  }
  .revenue-modal-header .header-content { flex: 1; min-width: 0; }
  .revenue-modal-header h2 { font-size: 1.25rem; font-weight: 700; margin: 0 0 0.625rem 0; letter-spacing: -0.02em; }
  .header-summary { display: flex; gap: 0.875rem; align-items: center; flex-wrap: wrap; }
  .summary-item { display: flex; flex-direction: column; gap: 0.125rem; }
  .summary-label { font-size: 0.625rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: rgba(255,255,255,0.3); }
  .summary-value { font-size: 0.875rem; font-weight: 700; color: #ffffff; }
  .summary-divider { width: 1px; height: 32px; background: #444444; }
  .btn-icon-close {
    width: 36px; height: 36px; padding: 0;
    background: transparent; border: 2px solid #ffffff; color: #ffffff;
    cursor: pointer; transition: all 0.2s ease;
    display: flex; align-items: center; justify-content: center;
  }
  .btn-icon-close:hover { background: rgba(255,255,255,0.1); }
  .revenue-modal-tabs {
    display: flex; background: rgba(255,255,255,0.02);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    overflow-x: auto; flex-shrink: 0;
  }
  .revenue-modal-tabs .rev-tab-btn {
    padding: 0.625rem 1.25rem; background: transparent; border: none;
    border-right: 1px solid rgba(255,255,255,0.06);
    font-weight: 600; font-size: 0.75rem; color: rgba(255,255,255,0.5);
    cursor: pointer; transition: all 0.2s ease;
    text-transform: uppercase; letter-spacing: 0.5px; white-space: nowrap;
  }
  .revenue-modal-tabs .rev-tab-btn:hover { background: rgba(255,255,255,0.03); color: rgba(255,255,255,0.7); }
  .revenue-modal-tabs .rev-tab-btn.active { background: rgba(201,169,110,0.1); color: #c9a96e; }
  .revenue-modal-body {
    flex: 1; overflow-y: auto; padding: 1.25rem;
    background: rgba(255,255,255,0.01); min-height: 0;
  }
  .rev-tab-panel { display: flex; flex-direction: column; gap: 1.5rem; }
  .rev-chart-section {
    background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px; padding: 1.25rem;
  }
  .rev-chart-section h3 {
    font-size: 0.875rem; font-weight: 700; color: #fff;
    margin: 0 0 1rem 0; letter-spacing: -0.02em; text-transform: uppercase;
  }
  .rev-chart-container { position: relative; height: 260px; }
  .rev-chart-large { height: 320px; }
  .rev-table-section {
    background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px; padding: 1rem; overflow-x: auto;
  }
  .insights-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
  .insights-table thead { background: rgba(255,255,255,0.02); border-bottom: 1px solid rgba(255,255,255,0.06); }
  .insights-table th { padding: 0.625rem 0.75rem; text-align: left; font-weight: 700; font-size: 0.7rem; color: rgba(255,255,255,0.35); text-transform: uppercase; letter-spacing: 0.5px; }
  .insights-table td { padding: 0.625rem 0.75rem; border-bottom: 1px solid rgba(255,255,255,0.03); font-size: 0.8rem; color: rgba(255,255,255,0.7); }
  .insights-table tbody tr:hover { background: rgba(255,255,255,0.02); }
  .rev-loading-state, .rev-error-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 4rem 2rem; gap: 1rem; text-align: center; }
  .rev-error-state svg { color: #ef4444; }
  .rev-error-state h3 { font-size: 1.25rem; font-weight: 700; color: #fff; margin: 0; }
  .rev-error-state p { font-size: 0.9rem; color: rgba(255,255,255,0.35); max-width: 400px; }
  .rev-btn-retry { padding: 0.75rem 1.5rem; background: #1a1a1a; color: #ffffff; border: 1px solid rgba(255,255,255,0.06); font-weight: 600; cursor: pointer; transition: all 0.2s ease; margin-top: 0.5rem; }
  .rev-btn-retry:hover { background: #333333; }
  .rev-spinner { display: inline-block; width: 32px; height: 32px; border: 3px solid rgba(255,255,255,0.2); border-top-color: #c9a96e; border-radius: 50%; animation: spin 0.6s linear infinite; }
  .multi-controls { display: flex; flex-direction: column; gap: 1rem; margin-top: 1rem; }
  .rev-control-group { display: flex; flex-direction: column; gap: 0.5rem; }
  .rev-control-label { font-size: 0.7rem; font-weight: 700; color: rgba(255,255,255,0.35); text-transform: uppercase; letter-spacing: 0.5px; }
  .dimension-select { padding: 0.625rem 0.75rem; border: 1px solid rgba(255,255,255,0.08); border-radius: 6px; background: rgba(255,255,255,0.03); font-weight: 600; font-size: 0.875rem; color: #fff; cursor: pointer; transition: all 0.2s ease; }
  .dimension-select:hover { border-color: rgba(255,255,255,0.15); }
  .dimension-select:focus { outline: none; border-color: #c9a96e; background: rgba(255,255,255,0.05); box-shadow: 0 0 0 3px rgba(201,169,110,0.1); }
  .view-mode-buttons { display: flex; border: 1px solid rgba(255,255,255,0.08); border-radius: 6px; overflow: hidden; }
  .view-mode-btn { flex: 1; padding: 0.625rem 1rem; border: none; border-right: 1px solid rgba(255,255,255,0.06); background: transparent; color: rgba(255,255,255,0.5); font-weight: 600; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.5px; cursor: pointer; transition: all 0.2s ease; }
  .view-mode-btn:last-child { border-right: none; }
  .view-mode-btn:hover { background: rgba(255,255,255,0.05); color: rgba(255,255,255,0.7); }
  .view-mode-btn.active { background: rgba(201,169,110,0.15); color: #c9a96e; }
  .rev-btn-apply { padding: 0.875rem 1.5rem; background: linear-gradient(135deg, #c9a96e 0%, #b89355 100%); color: #fff; border: 1px solid transparent; border-radius: 8px; font-weight: 700; font-size: 0.875rem; text-transform: uppercase; letter-spacing: 0.5px; cursor: pointer; transition: all 0.2s ease; margin-top: 0.5rem; }
  .rev-btn-apply:hover { filter: saturate(1.3); transform: translateY(-1px); box-shadow: 0 8px 24px rgba(201,169,110,0.2); }
  .nested-container { max-height: 500px; overflow-y: auto; border: 1px solid rgba(255,255,255,0.06); border-radius: 8px; background: rgba(255,255,255,0.02); }
  .nested-item { border-bottom: 1px solid rgba(255,255,255,0.03); }
  .nested-item:last-child { border-bottom: none; }
  .nested-level-1 { display: flex; justify-content: space-between; align-items: center; padding: 0.75rem 1rem; cursor: pointer; background: rgba(255,255,255,0.03); font-weight: 600; transition: background 0.2s ease; }
  .nested-level-1:hover { background: rgba(255,255,255,0.05); }
  .nested-level-2 { display: flex; justify-content: space-between; align-items: center; padding: 0.625rem 0.75rem; cursor: pointer; border-bottom: 1px solid rgba(255,255,255,0.03); transition: background 0.2s ease; font-size: 0.875rem; }
  .nested-level-2:hover { background: rgba(255,255,255,0.02); }
  .nested-level-3 { display: flex; justify-content: space-between; align-items: center; padding: 0.5rem 0.75rem; border-bottom: 1px solid rgba(255,255,255,0.02); font-size: 0.8rem; color: rgba(255,255,255,0.35); }
  .nested-children { padding-left: 2rem; }
  .nested-grandchildren { padding-left: 2rem; }
  .nested-label { display: flex; align-items: center; gap: 0.5rem; }
  .nested-values { display: flex; align-items: center; gap: 1rem; }
  .nested-count { color: rgba(255,255,255,0.35); font-size: 0.875rem; }
  .nested-revenue { font-weight: 700; color: #fff; }
  .rev-empty-state { text-align: center; padding: 3rem 1.5rem; color: rgba(255,255,255,0.3); }
  .rev-empty-state svg { margin: 0 auto 1rem; display: block; }
  .rev-empty-state p { font-size: 0.9rem; font-weight: 600; max-width: 400px; margin: 0 auto; line-height: 1.5; }

  /* ===== Settings Page ===== */
  .settings-tabs {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    padding-bottom: 0;
  }
  .settings-tab {
    padding: 0.5rem 1rem;
    font-size: 0.82rem;
    font-weight: 500;
    color: rgba(255,255,255,0.4);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.15s;
    margin-bottom: -1px;
  }
  .settings-tab:hover { color: rgba(255,255,255,0.7); }
  .settings-tab.active {
    color: #c9a96e;
    border-bottom-color: #c9a96e;
  }
  .settings-msg {
    font-size: 0.8rem;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    margin-bottom: 0.75rem;
  }
  .settings-msg-error {
    background: rgba(239,68,68,0.1);
    color: #f87171;
    border: 1px solid rgba(239,68,68,0.15);
  }
  .settings-msg-success {
    background: rgba(34,197,94,0.1);
    color: #4ade80;
    border: 1px solid rgba(34,197,94,0.15);
  }
  .settings-select {
    padding: 0.25rem 0.4rem;
    font-size: 0.75rem;
    background: #1a1a1a;
    color: rgba(255,255,255,0.6);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 4px;
    cursor: pointer;
  }
  .settings-select:focus {
    outline: none;
    border-color: rgba(201,169,110,0.4);
  }
  .settings-select:disabled {
    opacity: 0.4;
    cursor: not-allowed;
  }
  .config-card {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 8px;
    padding: 0.65rem 0.75rem;
    transition: border-color 0.15s;
  }
  .config-card:hover {
    border-color: rgba(255,255,255,0.12);
  }
  .config-active {
    border-color: rgba(34,197,94,0.2);
    background: rgba(34,197,94,0.02);
  }
  .config-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: rgba(255,255,255,0.04);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.35);
    flex-shrink: 0;
  }
  .config-icon-active {
    background: rgba(34,197,94,0.1);
    color: #4ade80;
  }
  .ch-table-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-family: monospace;
  }
  .ch-pill-ok {
    background: rgba(34,197,94,0.08);
    color: #4ade80;
    border: 1px solid rgba(34,197,94,0.15);
  }
  .ch-pill-missing {
    background: rgba(239,68,68,0.08);
    color: #f87171;
    border: 1px solid rgba(239,68,68,0.15);
  }
  .ch-pill-optional {
    background: rgba(250,204,21,0.06);
    color: #fbbf24;
    border: 1px solid rgba(250,204,21,0.12);
  }

  /* ===== DISTRIBUTION MODAL ===== */
  .dist-redist-banner {
    background: linear-gradient(135deg, rgba(139,92,246,0.25) 0%, rgba(99,102,241,0.25) 100%);
    border: 1px solid rgba(139,92,246,0.3);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
  }
  .dist-group {
    margin-bottom: 1rem;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 0.5rem;
    overflow: hidden;
  }
  .dist-group-header {
    padding: 0.75rem 1rem;
    background: rgba(255,255,255,0.04);
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }
  .dist-group-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }
  .dist-group-stats .dgs-label {
    font-size: 0.6rem;
    font-weight: 700;
    color: rgba(255,255,255,0.35);
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }
  .dist-group-stats .dgs-value {
    font-size: 0.85rem;
    color: #fff;
    font-weight: 600;
    margin-top: 0.15rem;
  }
  .dist-filters {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }
  .dist-filter-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.4rem 0.5rem;
    background: rgba(255,255,255,0.02);
    border-radius: 4px;
    margin-bottom: 0.3rem;
  }
  .dist-dest-header {
    display: grid;
    grid-template-columns: 28px 1.5fr 1fr 80px 80px 1.5fr 80px 60px;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.65rem;
    font-weight: 700;
    color: rgba(255,255,255,0.35);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.02);
  }
  .dist-dest-row {
    display: grid;
    grid-template-columns: 28px 1.5fr 1fr 80px 80px 1.5fr 80px 60px;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    align-items: center;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid rgba(255,255,255,0.04);
  }
  .dist-dest-row:hover {
    background: rgba(255,255,255,0.04);
  }
  .dist-dest-row.not-expandable {
    cursor: default;
  }
  .dist-dest-row.previous-attempt {
    opacity: 0.5;
  }
  .dist-method-badge {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    font-size: 0.65rem;
    font-weight: 600;
    border-radius: 3px;
    text-transform: uppercase;
    white-space: nowrap;
  }
  .dist-method-badge.m-direct {
    background: rgba(59,130,246,0.15);
    color: #60a5fa;
    border: 1px solid rgba(59,130,246,0.2);
  }
  .dist-method-badge.m-pingpost {
    background: rgba(168,85,247,0.15);
    color: #c084fc;
    border: 1px solid rgba(168,85,247,0.2);
  }
  .dist-method-badge.m-skipped {
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.4);
    border: 1px solid rgba(255,255,255,0.1);
  }
  .dist-method-badge.m-manual {
    background: rgba(139,92,246,0.15);
    color: #a78bfa;
    border: 1px solid rgba(139,92,246,0.2);
  }
  .dist-status-badge {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    font-size: 0.65rem;
    font-weight: 600;
    border-radius: 3px;
    text-transform: capitalize;
  }
  .dist-status-badge.s-accepted {
    background: rgba(34,197,94,0.12);
    color: #4ade80;
  }
  .dist-status-badge.s-rejected {
    background: rgba(239,68,68,0.12);
    color: #f87171;
  }
  .dist-status-badge.s-skipped {
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.45);
  }
  .dist-status-badge.s-suppressed {
    background: rgba(251,191,36,0.12);
    color: #fbbf24;
  }
  .dist-status-badge.s-duplicate {
    background: rgba(251,191,36,0.12);
    color: #fbbf24;
  }
  .dist-expanded-content {
    padding: 1rem;
    background: rgba(255,255,255,0.02);
    border-top: 1px solid rgba(255,255,255,0.06);
  }
  .dist-expanded-content .dist-section {
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 6px;
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
    background: rgba(0,0,0,0.2);
  }
  .dist-expanded-content .dist-section:last-child {
    margin-bottom: 0;
  }
  .dist-expanded-content .dist-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.6rem;
  }
  .dist-expanded-content .dist-section-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: rgba(255,255,255,0.5);
  }
  .dist-copy-btn {
    padding: 0.2rem 0.5rem;
    font-size: 0.65rem;
    font-weight: 600;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    color: #fff;
    transition: opacity 0.15s;
  }
  .dist-copy-btn:hover { opacity: 0.8; }
  .dist-copy-btn.sent { background: #3b82f6; }
  .dist-copy-btn.response { background: rgba(255,255,255,0.15); }
  .dist-pre {
    margin: 0;
    padding: 0.6rem;
    border-radius: 4px;
    font-size: 0.68rem;
    font-family: 'Courier New', monospace;
    white-space: pre-wrap;
    word-break: break-all;
    line-height: 1.45;
    max-height: 250px;
    overflow-y: auto;
  }
  .dist-pre.sent {
    background: rgba(59,130,246,0.08);
    border: 1px solid rgba(59,130,246,0.15);
    color: #a5b4fc;
  }
  .dist-pre.response {
    background: rgba(34,197,94,0.08);
    border: 1px solid rgba(34,197,94,0.15);
    color: #86efac;
  }
  .dist-warning-box {
    border-radius: 6px;
    padding: 1rem;
    margin-top: 0.5rem;
  }
  .dist-warning-box.filtered {
    background: rgba(245,158,11,0.1);
    border: 1px solid rgba(245,158,11,0.25);
  }
  .dist-warning-box.no-routes {
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.25);
  }
  .dist-redist-badge {
    display: inline-block;
    padding: 0.1rem 0.3rem;
    font-size: 0.55rem;
    font-weight: 600;
    background: rgba(139,92,246,0.3);
    color: #c084fc;
    text-transform: uppercase;
    margin-left: 0.25rem;
    border-radius: 2px;
  }
  .dist-prev-badge {
    display: inline-block;
    padding: 0.1rem 0.3rem;
    font-size: 0.55rem;
    font-weight: 600;
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
    margin-left: 0.25rem;
    border-radius: 2px;
  }
  .dist-redist-info {
    background: rgba(139,92,246,0.1);
    border: 1px solid rgba(139,92,246,0.25);
    border-radius: 6px;
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
  }

  /* ===== Campaign Detail ===== */
  /* ====== CAMPAIGN DETAIL - MOBILE NATIVE ====== */

  /* Header */
  .cd-header {
    padding: 0.75rem 1rem 0;
  }
  .cd-header-top {
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }
  .cd-back-btn {
    background: none;
    border: none;
    color: #c9a96e;
    padding: 0.3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    flex-shrink: 0;
  }
  .cd-header-title-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex: 1;
    min-width: 0;
  }
  .cd-header-title-row h1 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .cd-header-desc {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.35);
    padding: 0.15rem 0 0 2.3rem;
  }
  .cd-api-key-box {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 6px;
    padding: 0.2rem 0.45rem;
    flex-shrink: 0;
  }
  .cd-api-key-box code {
    font-size: 0.65rem;
    color: rgba(255,255,255,0.4);
    font-family: 'SF Mono', Monaco, monospace;
  }
  .cd-api-key-box button {
    background: none;
    border: none;
    color: rgba(255,255,255,0.35);
    cursor: pointer;
    padding: 0.1rem;
    display: flex;
  }

  /* Segmented Tab Control */
  .cd-tabs {
    display: flex;
    margin: 0.75rem 1rem 0;
    background: rgba(255,255,255,0.04);
    border-radius: 8px;
    padding: 3px;
    gap: 0;
    border: none;
  }
  .cd-tab {
    flex: 1;
    padding: 0.45rem 0.25rem;
    background: none;
    border: none;
    color: rgba(255,255,255,0.45);
    font-size: 0.75rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    text-align: center;
  }
  .cd-tab:hover { color: rgba(255,255,255,0.7); }
  .cd-tab.active {
    background: rgba(201,169,110,0.15);
    color: #c9a96e;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  }
  .cd-tab-badge {
    background: rgba(201,169,110,0.3);
    color: #c9a96e;
    padding: 0.05rem 0.35rem;
    font-size: 0.6rem;
    border-radius: 3px;
    font-weight: 700;
  }

  .cd-tab-content { padding: 1rem 1rem 2rem; }

  /* Messages */
  .cd-message {
    padding: 0.6rem 1rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    margin: 0 1rem 0.5rem;
  }
  .cd-message.success { background: rgba(34,197,94,0.1); color: #4ade80; border: 1px solid rgba(34,197,94,0.2); }
  .cd-message.error { background: rgba(239,68,68,0.1); color: #f87171; border: 1px solid rgba(239,68,68,0.2); }

  /* Delivery header */
  .cd-delivery-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
  }
  .cd-section-title {
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
  }
  .cd-delivery-actions {
    display: flex;
    gap: 0.4rem;
  }

  /* Compact native buttons */
  .cd-compact-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.35rem 0.65rem;
    border-radius: 8px;
    font-size: 0.72rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.6);
    white-space: nowrap;
  }
  .cd-compact-btn:hover { border-color: rgba(255,255,255,0.15); }
  .cd-compact-btn:disabled { opacity: 0.4; cursor: default; }
  .cd-compact-btn-primary {
    background: linear-gradient(135deg, #c9a96e 0%, #b89355 100%);
    border-color: transparent;
    color: #fff;
  }
  .cd-compact-btn-primary:hover { filter: saturate(1.2); }
  .cd-compact-btn-danger {
    background: rgba(239,68,68,0.1);
    border-color: rgba(239,68,68,0.2);
    color: #f87171;
  }

  /* Full-width button */
  .cd-full-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.7rem;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border: none;
    transition: all 0.15s;
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.6);
  }
  .cd-full-btn:disabled { opacity: 0.5; }
  .cd-full-btn-primary {
    background: linear-gradient(135deg, #c9a96e 0%, #b89355 100%);
    color: #fff;
  }

  /* Group cards */
  .cd-group-card {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    margin-bottom: 0.75rem;
    overflow: hidden;
  }
  .cd-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    gap: 0.5rem;
  }
  .cd-group-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
  }
  .cd-priority-badge {
    background: rgba(201,169,110,0.15);
    color: #c9a96e;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.2rem 0.4rem;
    border-radius: 5px;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .cd-group-details {
    min-width: 0;
    flex: 1;
  }
  .cd-group-details h3 {
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 0.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .cd-meta-tags {
    display: flex;
    gap: 0.3rem;
    flex-wrap: wrap;
  }
  .cd-meta-tag {
    font-size: 0.6rem;
    font-weight: 600;
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    background: rgba(255,255,255,0.04);
    color: rgba(255,255,255,0.35);
    text-transform: capitalize;
  }
  .cd-group-actions {
    display: flex;
    gap: 0.2rem;
    flex-shrink: 0;
  }
  .cd-icon-btn {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.4);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
  }
  .cd-icon-btn:hover { border-color: rgba(255,255,255,0.15); color: rgba(255,255,255,0.8); }
  .cd-icon-btn:disabled { opacity: 0.25; cursor: default; }
  .cd-icon-btn.danger:hover { border-color: rgba(239,68,68,0.3); color: #f87171; }

  /* Group body & routes */
  .cd-group-body {
    padding: 0 0.75rem 0.75rem;
  }
  .cd-empty-routes {
    text-align: center;
    color: rgba(255,255,255,0.25);
    font-size: 0.75rem;
    padding: 0.75rem !important;
  }
  .cd-route-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0.65rem;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.04);
    border-radius: 8px;
    margin-bottom: 0.35rem;
    cursor: pointer;
    transition: background 0.15s;
  }
  .cd-route-row:last-child { margin-bottom: 0; }
  .cd-route-row:active { background: rgba(255,255,255,0.05); }
  .cd-route-left {
    flex: 1;
    min-width: 0;
  }
  .cd-route-name {
    font-weight: 600;
    color: #fff;
    font-size: 0.8rem;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .cd-route-meta {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.15rem;
  }
  .cd-route-meta span {
    font-size: 0.65rem;
    color: rgba(255,255,255,0.3);
    font-weight: 600;
  }
  .cd-route-right {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
  }
  .cd-route-status {
    width: 7px;
    height: 7px;
    border-radius: 50%;
  }
  .cd-route-status.active { background: #4ade80; }
  .cd-route-status.inactive { background: #f87171; }

  /* Empty state */
  .cd-empty-state {
    text-align: center;
    padding: 2rem 1rem;
    color: rgba(255,255,255,0.25);
    border: 1px dashed rgba(255,255,255,0.08);
    border-radius: 12px;
  }
  .cd-empty-state p {
    font-size: 0.82rem;
    margin-top: 0.5rem;
  }

  /* Settings cards */
  .cd-settings-card {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 0.75rem;
  }
  .cd-settings-card h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }
  .cd-settings-card h2 svg { color: rgba(255,255,255,0.4); }
  .cd-settings-card.danger {
    border-color: rgba(239,68,68,0.15);
  }
  .cd-danger-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
  }
  .cd-danger-item:last-child { border-bottom: none; }
  .cd-danger-item h4 {
    font-size: 0.82rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 0.1rem;
  }
  .cd-danger-item p {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.3);
  }
  .cd-btn-danger {
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.2);
    color: #f87171;
    padding: 0.35rem 0.65rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
  }

  /* Field cards */
  .cd-field-card {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    padding: 0.65rem;
    overflow: hidden;
  }
  .cd-field-card-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
  }
  .cd-field-req {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    cursor: pointer;
    flex-shrink: 0;
  }
  .cd-field-req input { accent-color: #c9a96e; width: 15px; height: 15px; }
  .cd-field-req span { font-size: 0.6rem; font-weight: 600; color: rgba(255,255,255,0.35); text-transform: uppercase; }
  .cd-field-card-body {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
  }
  .cd-field-label {
    font-size: 0.6rem;
    font-weight: 600;
    color: rgba(255,255,255,0.3);
    text-transform: uppercase;
    display: block;
    margin-bottom: 0.15rem;
  }

  /* Code block */
  .cd-code-block {
    background: #0f172a;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 8px;
    padding: 0.65rem 0.75rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .cd-code-block code, .cd-code-block pre {
    font-family: 'SF Mono', Monaco, 'Fira Code', monospace;
    font-size: 0.7rem;
    color: #38bdf8;
    white-space: pre-wrap;
    word-break: break-all;
    margin: 0;
  }

  /* Response grid */
  .cd-response-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }

  /* Flow visualizer */
  .cd-flow {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
  }
  .cd-flow-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.75rem;
    text-align: center;
  }
  .cd-flow-entry {
    text-align: center;
    margin-bottom: 0.6rem;
  }
  .cd-flow-badge {
    display: inline-block;
    background: rgba(201,169,110,0.15);
    color: #c9a96e;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.3rem 0.85rem;
    border-radius: 20px;
  }
  .cd-flow-arrow {
    text-align: center;
    color: rgba(255,255,255,0.2);
    font-size: 0.7rem;
    padding: 0.35rem 0;
  }
  .cd-flow-level {
    margin-bottom: 0.4rem;
  }
  .cd-flow-priority-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.4rem;
  }
  .cd-flow-groups {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding-left: 0.5rem;
  }
  .cd-flow-group-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    padding: 0.5rem 0.65rem;
    min-width: 100px;
    flex: 1;
  }
  .cd-flow-group-card h4 {
    font-size: 0.72rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 0.15rem;
  }
  .cd-flow-group-card span {
    font-size: 0.62rem;
    color: rgba(255,255,255,0.3);
  }
  .cd-flow-end {
    text-align: center;
    margin-top: 0.4rem;
  }
  .cd-flow-end-badge {
    display: inline-block;
    background: rgba(239,68,68,0.1);
    color: #f87171;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.25rem 0.7rem;
    border-radius: 20px;
  }

  /* Modals - native sheet style */
  .modal-wide { width: 680px; max-width: 100vw; }
  .modal-xlg { width: 880px; max-width: 100vw; }

  /* Filter sections */
  .cd-filter-section {
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 0.65rem;
    margin-bottom: 0.6rem;
  }
  .cd-filter-section.and-section { border-color: rgba(34,197,94,0.25); background: rgba(34,197,94,0.03); }
  .cd-filter-section.or-section { border-color: rgba(234,179,8,0.25); background: rgba(234,179,8,0.03); }
  .cd-filter-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
  }
  .cd-filter-section-title {
    font-size: 0.72rem;
    font-weight: 700;
  }
  .cd-filter-section.and-section .cd-filter-section-title { color: #4ade80; }
  .cd-filter-section.or-section .cd-filter-section-title { color: #fbbf24; }
  .cd-filter-row {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    align-items: flex-end;
    padding: 0.45rem;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.04);
    border-radius: 8px;
    margin-bottom: 0.35rem;
  }
  .cd-filter-row:last-child { margin-bottom: 0; }

  /* Suppression */
  .cd-suppression-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    cursor: pointer;
  }
  .cd-suppression-item:last-child { border-bottom: none; }
  .cd-suppression-item input[type="checkbox"] { accent-color: #c9a96e; width: 18px; height: 18px; }

  /* Info box */
  .cd-info-box {
    background: rgba(59,130,246,0.06);
    border: 1px solid rgba(59,130,246,0.15);
    border-radius: 10px;
    padding: 0.65rem 0.85rem;
    margin-bottom: 0.75rem;
  }
  .cd-info-box p {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.5);
    margin: 0;
  }
  .cd-info-box strong { color: rgba(255,255,255,0.7); }

  /* Lang tabs */
  .cd-lang-tabs {
    display: flex;
    gap: 0;
    margin-bottom: -1px;
  }
  .cd-lang-tab {
    flex: 1;
    padding: 0.4rem 0.5rem;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06);
    border-bottom: none;
    color: rgba(255,255,255,0.4);
    font-size: 0.68rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-align: center;
  }
  .cd-lang-tab:first-child { border-radius: 8px 0 0 0; }
  .cd-lang-tab:last-child { border-radius: 0 8px 0 0; }
  .cd-lang-tab.active { background: #0f172a; color: #38bdf8; border-color: rgba(255,255,255,0.08); }

  /* ===== ONBOARDING GUIDE ===== */
  .onboarding-panel {
    position: fixed;
    left: 0;                /* overridden by desktop.css to flush with sidebar */
    right: 0;
    bottom: 0;
    background: rgb(26, 26, 26);
    border-top: 1px solid rgba(201,169,110,0.2);
    z-index: 500;
    display: flex;
    flex-direction: column;
  }

  .onboarding-progress {
    height: 3px;
    background: rgba(255,255,255,0.06);
    overflow: hidden;
    flex-shrink: 0;
  }

  .onboarding-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #c9a96e, #e0c48a);
    transition: width 0.35s ease;
  }

  .onboarding-panel-body {
    display: flex;
    gap: 1.5rem;
    padding: 1.25rem 2rem 0.75rem;
    overflow-y: auto;
    flex: 1;
  }

  /* Left: text content */
  .ob-text {
    flex: 1;
    min-width: 0;
  }

  /* Right: diagram (when present) */
  .ob-diagram-area {
    flex: 1.2;
    min-width: 0;
    display: flex;
    align-items: center;
  }

  .onboarding-step-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: #c9a96e;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.35rem;
  }

  .onboarding-title {
    font-family: 'Poppins', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.4rem;
    line-height: 1.3;
  }

  .onboarding-desc {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.5);
    line-height: 1.55;
    margin-bottom: 0.75rem;
  }

  .onboarding-tips {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
  }

  .onboarding-tips li {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.76rem;
    color: rgba(255,255,255,0.6);
    line-height: 1.45;
  }

  .onboarding-tips li::before {
    content: '';
    flex-shrink: 0;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #c9a96e;
    margin-top: 0.35rem;
  }

  .onboarding-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 2rem 0.75rem;
    border-top: 1px solid rgba(255,255,255,0.05);
    flex-shrink: 0;
  }

  .onboarding-dismiss {
    background: none;
    border: none;
    color: rgba(255,255,255,0.25);
    font-size: 0.72rem;
    cursor: pointer;
    padding: 0.4rem 0;
    font-family: inherit;
    transition: color 0.15s;
  }

  .onboarding-dismiss:hover {
    color: rgba(255,255,255,0.5);
  }

  .onboarding-bar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
  }

  .onboarding-dots {
    display: flex;
    gap: 5px;
  }

  .onboarding-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    transition: all 0.25s ease;
    cursor: pointer;
    border: none;
    padding: 0;
  }

  .onboarding-dot.active {
    background: #c9a96e;
    transform: scale(1.3);
  }

  .onboarding-dot.completed {
    background: rgba(201,169,110,0.4);
  }

  .onboarding-nav {
    display: flex;
    gap: 0.4rem;
  }

  .onboarding-btn {
    padding: 0.4rem 1rem;
    border-radius: 7px;
    font-size: 0.78rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s ease;
  }

  .onboarding-btn-back {
    background: none;
    border: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.5);
  }

  .onboarding-btn-back:hover {
    border-color: rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.8);
  }

  .onboarding-btn-next {
    background: linear-gradient(135deg, #c9a96e, #b8944f);
    border: none;
    color: #1a1a1a;
  }

  .onboarding-btn-next:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
  }

  /* SVG Diagrams */
  .ob-diagram {
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    width: 100%;
  }

  .ob-diagram svg {
    width: 100%;
    height: auto;
    display: block;
  }

  /* Element highlight — pulsing gold ring */
  .onboarding-highlighted {
    position: relative;
    z-index: 10;
    outline: 2px solid rgba(201,169,110,0.6) !important;
    outline-offset: 4px;
    border-radius: 10px;
    animation: ob-pulse 2s ease-in-out infinite;
  }

  @keyframes ob-pulse {
    0%, 100% { outline-color: rgba(201,169,110,0.6); }
    50% { outline-color: rgba(201,169,110,0.2); }
  }

