*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
    
    /* -
       DESIGN TOKENS - Light Theme (default)
       Change these values to restyle the entire platform.
       - */
    :root {
      --bg: #faf5ed;
      --surface: #ffffff;
      --surface2: #f5f0e8;
      --surface-hover: #ede8df;
      --border: #e0dbd2;
      --border-hover: #cfc9be;
      --accent: #1a8b6e;
      --accent-hover: #157a5e;
      --accent-glow: rgba(26, 139, 110, 0.12);
      --accent2: #0d9488;
      --accent2-glow: rgba(13, 148, 136, 0.12);
      --danger: #dc2626;
      --warn: #d97706;
      --text: #1a1a1a;
      --text-muted: #6b7280;
      /* Aliases for token names referenced across the UI. Defined so those
         references resolve to a theme-aware color in both modes instead of
         falling back to a hardcoded dark value (which was unreadable in light
         mode, e.g. the error-code chips). */
      --warning: var(--warn);
      --text-primary: var(--text);
      --bg-elevated: var(--surface2);
      --background: var(--surface);
      color-scheme: light; /* native dropdowns, date/time pickers, scrollbars render light */
      --radius: 12px;
      --radius-sm: 8px;
      --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
      --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
      --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.1);
      --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
      --overlay-bg: rgba(0, 0, 0, 0.4);
      --code-bg: #f3efe7;
      --toast-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
      /* Syntax highlight tokens (light) */
      --tok-key: #0550ae;
      --tok-str: #0a7c42;
      --tok-num: #b45309;
      --tok-bool: #9333ea;
      --tok-punc: #6b7280;
      --tok-cmt: #9ca3af;
    }

    /* -
       DESIGN TOKENS - Dark Theme
       - */
    [data-theme="dark"] {
      --bg: #0f1117;
      --surface: #1a1d2e;
      --surface2: #222640;
      --surface-hover: #2a2e4a;
      --border: #2d3154;
      --border-hover: #3d4268;
      --accent: #4ade80;
      --accent-hover: #22c55e;
      --accent-glow: rgba(74, 222, 128, 0.15);
      --accent2: #2dd4bf;
      --accent2-glow: rgba(45, 212, 191, 0.15);
      --danger: #f87171;
      --warn: #fbbf24;
      --text: #e8eaed;
      --text-muted: #8e95a9;
      --warning: var(--warn);
      --text-primary: var(--text);
      --bg-elevated: var(--surface2);
      --background: var(--surface);
      color-scheme: dark; /* native dropdowns, date/time pickers, scrollbars render dark */
      --shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
      --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
      --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.5);
      --overlay-bg: rgba(0, 0, 0, 0.7);
      --code-bg: #161929;
      --toast-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
      /* Syntax highlight tokens (dark) */
      --tok-key: #7dd3fc;
      --tok-str: #86efac;
      --tok-num: #fbbf24;
      --tok-bool: #c4b5fd;
      --tok-punc: #8e95a9;
      --tok-cmt: #6b7280;
    }

    /* API explorer code/response blocks + syntax tokens (theme-adaptive) */
    .code-block {
      background: var(--code-bg);
      color: var(--text);
      padding: 0.75rem;
      border-radius: 6px;
      font-size: 0.75rem;
      overflow-x: auto;
      white-space: pre-wrap;
      border: 1px solid var(--border);
      font-family: 'JetBrains Mono', monospace;
      line-height: 1.5;
    }
    .tok-key { color: var(--tok-key); }
    .tok-str { color: var(--tok-str); }
    .tok-num { color: var(--tok-num); }
    .tok-bool { color: var(--tok-bool); font-weight: 600; }
    .tok-punc { color: var(--tok-punc); }
    .tok-cmt { color: var(--tok-cmt); font-style: italic; }
    .api-err-list { list-style: none; padding: 0; margin: 0.5rem 0 0 0; }
    .api-err-list li { display: flex; gap: 0.6rem; align-items: baseline; padding: 0.3rem 0; font-size: 0.82rem; border-bottom: 1px dotted var(--border); }
    .api-err-code { font-family: 'JetBrains Mono', monospace; font-weight: 700; color: var(--danger); min-width: 2.5rem; }

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

    /* Scrollbars */
    ::-webkit-scrollbar { width: 8px; height: 8px; }
    ::-webkit-scrollbar-track { background: var(--bg); }
    ::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
    ::-webkit-scrollbar-thumb:hover { background: var(--border-hover); }

    /* Clickable Cards */
    .clickable-card:hover {
      transform: translateY(-2px);
      border-color: var(--accent) !important;
      box-shadow: var(--shadow-md);
    }

    /* - Login Screen - */
    #loginScreen {
      position: fixed;
      top: 0; left: 0; right: 0; bottom: 0;
      background: var(--bg);
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 1000;
      padding: 1.5rem;
    }

    .login-card {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 16px;
      width: 100%;
      max-width: 440px;
      padding: 2.5rem;
      box-shadow: var(--shadow-lg);
      animation: fadeIn 0.4s ease-out;
    }

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

    .login-logo {
      display: flex;
      flex-direction: column;
      align-items: center;
      margin-bottom: 2rem;
    }

    .login-logo h1 {
      font-size: 1.8rem;
      font-weight: 700;
      color: var(--accent);
      letter-spacing: -0.5px;
    }

    .login-logo p {
      font-size: 0.8rem;
      color: var(--text-muted);
      margin-top: 0.25rem;
      text-transform: uppercase;
      letter-spacing: 0.1em;
    }

    .error-msg {
      background: rgba(220, 38, 38, 0.08);
      border: 1px solid var(--danger);
      color: var(--danger);
      font-size: 0.82rem;
      padding: 0.75rem;
      border-radius: var(--radius-sm);
      margin-bottom: 1.25rem;
      display: none;
    }

    #systemAlertBanner {
      background-color: var(--danger);
      color: #ffffff;
      text-align: center;
      padding: 0.75rem 2rem;
      font-size: 0.85rem;
      font-weight: 600;
      display: none;
      z-index: 1000;
    }
    #systemAlertBanner.info {
      background-color: var(--accent);
      color: #ffffff;
    }
    #systemAlertBanner.warning {
      background-color: var(--warning);
      color: #1a1a1a;
    }
    #systemAlertBanner.critical {
      background-color: var(--danger);
      color: #ffffff;
    }
    /* legacy state kept as a warning-style alias for older saved values */
    #systemAlertBanner.degraded {
      background-color: var(--warning);
      color: #1a1a1a;
    }

    /* Form controls: keep native dropdowns and date/time pickers on-theme in
       both modes. Inline-styled controls override these; unstyled ones inherit a
       correct theme-aware look instead of the browser default (white in dark). */
    select,
    input[type="date"],
    input[type="datetime-local"],
    input[type="time"],
    input[type="month"],
    input[type="week"] {
      background-color: var(--surface);
      color: var(--text);
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      padding: 0.5rem;
      font: inherit;
    }
    select:focus,
    input[type="date"]:focus,
    input[type="datetime-local"]:focus,
    input[type="time"]:focus,
    input[type="month"]:focus,
    input[type="week"]:focus {
      outline: none;
      border-color: var(--accent);
    }
    select option { background-color: var(--surface); color: var(--text); }
    /* The calendar/clock glyph is dark by default; invert it in dark mode so it
       stays visible on the dark field. */
    [data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator,
    [data-theme="dark"] input[type="datetime-local"]::-webkit-calendar-picker-indicator,
    [data-theme="dark"] input[type="time"]::-webkit-calendar-picker-indicator,
    [data-theme="dark"] input[type="month"]::-webkit-calendar-picker-indicator,
    [data-theme="dark"] input[type="week"]::-webkit-calendar-picker-indicator {
      filter: invert(1);
    }

    /* Clickable example chips (e.g. goal suggestions). Theme-aware. */
    .goal-chip {
      font-size: 0.72rem;
      padding: 0.2rem 0.6rem;
      border-radius: 999px;
      border: 1px solid var(--border);
      background: var(--background);
      color: var(--text);
      cursor: pointer;
      transition: border-color 0.15s, color 0.15s;
    }
    .goal-chip:hover { border-color: var(--accent); color: var(--accent); }

    /* - Main Dashboard Layout - */
    #appContainer {
      display: flex;
      flex-direction: column;
      min-height: 100vh;
      width: 100%;
    }

    header {
      background: var(--surface);
      border-bottom: 1px solid var(--border);
      padding: 0 2rem;
      display: flex;
      align-items: center;
      justify-content: space-between;
      height: 64px;
      position: sticky;
      top: 0;
      z-index: 100;
      box-shadow: var(--shadow);
    }

    header h1 {
      font-size: 1.25rem;
      font-weight: 700;
      color: var(--accent);
      letter-spacing: -0.5px;
      display: flex;
      align-items: center;
    }

    header .badge {
      background: var(--accent-glow);
      color: var(--accent);
      border: 1px solid var(--border);
      font-size: 0.65rem;
      padding: 2px 8px;
      border-radius: 99px;
      font-weight: 700;
      margin-left: 8px;
    }

    .user-profile-widget {
      display: flex;
      align-items: center;
      gap: 1rem;
      font-size: 0.85rem;
    }

    .user-profile-widget .role-tag {
      background: var(--surface2);
      border: 1px solid var(--border);
      font-size: 0.7rem;
      padding: 2px 8px;
      border-radius: 4px;
      color: var(--accent2);
      font-weight: 600;
    }

    /* Theme Toggle */
    .theme-toggle {
      background: var(--surface2);
      border: 1px solid var(--border);
      border-radius: 6px;
      padding: 0.3rem 0.6rem;
      cursor: pointer;
      color: var(--text-muted);
      font-size: 0.85rem;
      transition: var(--transition);
      display: inline-flex;
      align-items: center;
      gap: 0.3rem;
    }
    .theme-toggle:hover {
      border-color: var(--border-hover);
      color: var(--text);
      background: var(--surface-hover);
    }

    main {
      flex: 1;
      display: flex;
      overflow: hidden;
      height: calc(100vh - 64px);
    }

    /* - Modern Unified Sidebar Navigation - */
    .sidebar-container {
      display: flex;
      height: 100%;
      flex-shrink: 0;
      background: var(--surface);
      border-right: 1px solid var(--border);
      width: 280px;
    }

    aside.modern-sidebar {
      width: 100%;
      background: var(--surface);
      overflow-y: auto;
      display: flex;
      flex-direction: column;
    }

    .sidebar-header {
      padding: 1.5rem;
      border-bottom: 1px solid var(--border);
    }
    .sidebar-header h2 {
      font-size: 0.85rem;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      color: var(--text-muted);
      margin: 0;
    }

    .sidebar-group summary {
      font-size: 0.75rem;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      color: var(--text-muted);
      padding: 0.75rem 1.5rem;
      cursor: pointer;
      user-select: none;
      font-weight: 600;
      display: flex;
      align-items: center;
      gap: 0.5rem;
    }
    .sidebar-group summary:hover {
      color: var(--text);
    }
    .sidebar-group ul {
      margin: 0;
      padding: 0 0.75rem 0.5rem 0.75rem;
    }

    .nav-list {
      list-style: none;
      display: flex;
      flex-direction: column;
      gap: 0.25rem;
      padding: 0 0.75rem;
    }

    .nav-list li a {
      display: flex;
      align-items: center;
      gap: 0.75rem;
      padding: 0.65rem 1rem 0.65rem 2.2rem;
      font-size: 0.88rem;
      color: var(--text-muted);
      text-decoration: none;
      border-radius: var(--radius-sm);
      transition: var(--transition);
      border: 1px solid transparent;
    }

    .nav-list li a:hover {
      color: var(--text);
      background: var(--surface2);
      border-color: var(--border);
    }

    .nav-list li a.active {
      color: #fff;
      background: var(--accent);
      border-color: var(--accent);
    }

    /* - Collapsible Endpoint Accordion Sidebar - */
    .accordion-container {
      display: flex;
      flex-direction: column;
      gap: 0.5rem;
      padding: 0 0.75rem;
    }

    .accordion-category {
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      overflow: hidden;
      background: var(--bg);
    }

    .accordion-header {
      background: var(--surface2);
      padding: 0.65rem 1rem 0.65rem 2.2rem;
      display: flex;
      align-items: center;
      justify-content: space-between;
      cursor: pointer;
      font-size: 0.82rem;
      font-weight: 600;
      transition: var(--transition);
      user-select: none;
    }

    .accordion-header:hover {
      background: var(--surface-hover);
    }

    .accordion-header .chevron {
      font-size: 0.65rem;
      color: var(--text-muted);
      transition: transform 0.25s;
    }

    .accordion-header.active .chevron {
      transform: rotate(90deg);
    }

    .accordion-content {
      border-top: 1px solid var(--border);
      max-height: 0;
      overflow: hidden;
      transition: max-height 0.25s ease-out;
    }

    .accordion-endpoint-list {
      list-style: none;
      padding: 0.25rem 0;
    }

    .accordion-endpoint-list li a {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      padding: 0.45rem 1rem;
      font-size: 0.78rem;
      color: var(--text-muted);
      text-decoration: none;
      transition: var(--transition);
    }

    .accordion-endpoint-list li a:hover, .accordion-endpoint-list li a.active {
      color: var(--text);
      background: var(--surface2);
    }

    .method-badge {
      font-size: 0.6rem;
      font-weight: 700;
      padding: 2px 6px;
      border-radius: 4px;
      min-width: 52px;
      text-align: center;
      display: inline-block;
    }

    .method-badge.GET { background: rgba(13, 148, 136, 0.12); color: var(--accent2); border: 1px solid var(--accent2-glow); }
    .method-badge.POST { background: var(--accent-glow); color: var(--accent); border: 1px solid var(--accent-glow); }
    .method-badge.PATCH { background: rgba(217, 119, 6, 0.12); color: var(--warn); border: 1px solid rgba(217, 119, 6, 0.15); }
    .method-badge.DELETE { background: rgba(220, 38, 38, 0.1); color: var(--danger); border: 1px solid rgba(220, 38, 38, 0.15); }
    .method-badge.PUT { background: rgba(147, 130, 220, 0.12); color: #8b7dd8; border: 1px solid rgba(147, 130, 220, 0.15); }

    .endpoint-path-label {
      font-family: 'JetBrains Mono', monospace;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    /* - Content Area - */
    .content {
      flex: 1;
      overflow-y: auto;
      padding: 2.5rem;
    }

    .panel { display: none; }
    .panel.active { display: block; animation: fadeIn 0.3s ease-out; }

    h2.section-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.35rem; letter-spacing: -0.5px; }
    p.section-desc { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 2rem; line-height: 1.6; }

    /* - Forms & Inputs - */
    .form-row { margin-bottom: 1.25rem; }
    .form-row label { display: block; font-size: 0.8rem; font-weight: 500; color: var(--text-muted); margin-bottom: 0.4rem; }
    .form-row label[title] { cursor: help; border-bottom: 1px dotted var(--text-muted); display: inline-block; margin-bottom: 0.4rem; }
    .form-row select, .form-row input, .form-row textarea {
      width: 100%;
      background: var(--bg);
      border: 1px solid var(--border);
      color: var(--text);
      border-radius: var(--radius-sm);
      padding: 0.65rem 0.85rem;
      font-size: 0.88rem;
      outline: none;
      transition: var(--transition);
      font-family: inherit;
    }
    .form-row select:focus, .form-row input:focus, .form-row textarea:focus {
      border-color: var(--accent);
      box-shadow: 0 0 0 3px var(--accent-glow);
    }
    .form-row textarea {
      resize: vertical;
      min-height: 130px;
      font-family: 'JetBrains Mono', monospace;
      font-size: 0.8rem;
    }

    /* - Buttons - */
    .btn {
      background: var(--accent);
      color: #fff;
      border: 1px solid var(--accent);
      border-radius: var(--radius-sm);
      padding: 0.65rem 1.5rem;
      font-size: 0.88rem;
      cursor: pointer;
      font-weight: 600;
      transition: var(--transition);
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 0.5rem;
    }
    .btn:hover {
      background: var(--accent-hover);
      border-color: var(--accent-hover);
      box-shadow: var(--shadow);
    }
    .btn.secondary {
      background: var(--surface2);
      color: var(--text);
      border-color: var(--border);
    }
    .btn.secondary:hover {
      background: var(--surface-hover);
      border-color: var(--border-hover);
    }
    .btn.danger {
      background: transparent;
      color: var(--danger);
      border-color: var(--danger);
    }
    .btn.danger:hover {
      background: var(--danger);
      color: #fff;
    }
    .btn.small {
      padding: 0.35rem 0.85rem;
      font-size: 0.78rem;
    }

    /* - Cards - */
    .cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.25rem; }
    .card {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      padding: 1.5rem;
      transition: var(--transition);
      display: flex;
      flex-direction: column;
      justify-content: space-between;
    }
    .card:hover {
      border-color: var(--accent);
      transform: translateY(-2px);
      box-shadow: var(--shadow-md);
    }
    .card h3 { font-size: 1rem; font-weight: 600; margin-bottom: 0.5rem; color: var(--text); }
    .card p { font-size: 0.82rem; color: var(--text-muted); line-height: 1.55; flex-grow: 1; }
    
    .tag {
      display: inline-block;
      font-size: 0.65rem;
      padding: 2px 8px;
      border-radius: 99px;
      font-weight: 600;
      margin-top: 1rem;
      align-self: flex-start;
      text-transform: uppercase;
      letter-spacing: 0.05em;
    }
    .tag.voice { background: var(--accent-glow); color: var(--accent); }
    .tag.messaging { background: var(--accent2-glow); color: var(--accent2); }
    .tag.video { background: rgba(147, 130, 220, 0.12); color: #8b7dd8; }
    .tag.platform { background: rgba(217, 119, 6, 0.12); color: var(--warn); }
    .tag.compliance { background: rgba(220, 38, 38, 0.1); color: var(--danger); }

    /* - API Explorer Form/Result Split - */
    .explorer { display: flex; gap: 1.75rem; align-items: flex-start; }
    .explorer-form {
      flex: 5;
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      padding: 2rem;
      box-shadow: var(--shadow);
    }
    .explorer-result {
      flex: 6;
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      padding: 2rem;
      min-height: 480px;
      box-shadow: var(--shadow);
      display: flex;
      flex-direction: column;
    }

    pre.result {
      font-family: 'JetBrains Mono', monospace;
      font-size: 0.78rem;
      white-space: pre-wrap;
      word-break: break-all;
      color: var(--accent2);
      line-height: 1.6;
      background: var(--code-bg);
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      padding: 1rem;
      flex-grow: 1;
      overflow-y: auto;
      max-height: 520px;
    }
    pre.error { color: var(--danger); border-color: rgba(220, 38, 38, 0.2); }

    /* - Auth & IAM Controls - */
    .auth-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(440px, 1fr)); gap: 1.5rem; margin-bottom: 2rem; }
    .auth-box {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      padding: 2rem;
      box-shadow: var(--shadow);
    }
    .auth-box h3 { font-size: 1rem; font-weight: 600; margin-bottom: 1.25rem; border-bottom: 1px solid var(--border); padding-bottom: 0.75rem; }

    .status-dot {
      width: 8px;
      height: 8px;
      border-radius: 50%;
      background: var(--danger);
      display: inline-block;
      margin-right: 6px;
    }
    .status-dot.ok {
      background: var(--accent2);
    }

    /* - Tables - */
    .table-container {
      width: 100%;
      overflow-x: auto;
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      background: var(--bg);
    }
    table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
    th { text-align: left; color: var(--text-muted); font-weight: 600; padding: 0.85rem 1rem; border-bottom: 1px solid var(--border); background: var(--surface); }
    td { padding: 0.85rem 1rem; border-bottom: 1px solid var(--border); }
    tr:last-child td { border-bottom: none; }
    .empty { color: var(--text-muted); font-style: italic; text-align: center; padding: 2.5rem; }

    /* - Checkbox Grouped Scopes selector - */
    .scopes-selector-container {
      display: flex;
      flex-direction: column;
      gap: 0.5rem;
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      padding: 0.75rem;
      background: var(--bg);
      max-height: 260px;
      overflow-y: auto;
    }
    .scopes-cat {
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      background: var(--surface);
    }
    .scopes-cat-hdr {
      padding: 0.5rem 0.75rem;
      display: flex;
      align-items: center;
      justify-content: space-between;
      cursor: pointer;
      font-size: 0.78rem;
      font-weight: 600;
      user-select: none;
    }
    .scopes-cat-hdr .chevron { font-size: 0.55rem; color: var(--text-muted); transition: transform 0.2s; }
    .scopes-cat-hdr.active .chevron { transform: rotate(90deg); }
    .scopes-cat-body {
      padding: 0.65rem 0.85rem;
      border-top: 1px solid var(--border);
      display: flex;
      flex-direction: column;
      gap: 0.45rem;
      background: var(--bg);
    }
    .cb-label {
      display: flex !important;
      align-items: center;
      gap: 0.5rem;
      font-size: 0.75rem !important;
      color: var(--text) !important;
      cursor: pointer;
      user-select: none;
      margin-bottom: 0 !important;
    }
    .cb-label input {
      width: auto !important;
      cursor: pointer;
    }

    /* - Admin Panels - */
    .admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(480px, 1fr)); gap: 1.5rem; }
    .admin-section {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      padding: 2rem;
      box-shadow: var(--shadow);
    }
    .admin-section h3 { font-size: 1rem; font-weight: 600; margin-bottom: 1.25rem; border-bottom: 1px solid var(--border); padding-bottom: 0.75rem; }
    .admin-section h3[title] { cursor: help; }

    @media (max-width: 1024px) {
      .explorer { flex-direction: column; }
      .admin-grid { grid-template-columns: 1fr; }
      .auth-grid { grid-template-columns: 1fr; }
      aside { display: none; }
    }

    /* - Wizards - */
    .wiz-tab-link {
      display: flex;
      align-items: center;
      padding: 0.65rem 1rem 0.65rem 2.2rem;
      font-size: 0.85rem;
      color: var(--text-muted);
      text-decoration: none;
      border-radius: var(--radius-sm);
      transition: var(--transition);
      border: 1px solid transparent;
      margin-bottom: 0.25rem;
    }
    .wiz-tab-link:hover {
      color: var(--text);
      background: var(--surface2);
      border-color: var(--border);
    }
    .wiz-tab-link.active {
      color: #fff;
      background: var(--accent);
      border-color: var(--accent);
    }
    .wizard-pane { display: none; }
    .wizard-pane.active { display: block; animation: fadeIn 0.3s ease-out; }
    
    .step-indicator {
      display: flex;
      justify-content: space-between;
      margin-bottom: 2rem;
      position: relative;
      border-bottom: 1px solid var(--border);
      padding-bottom: 1.25rem;
    }
    .step-node {
      display: flex;
      flex-direction: column;
      align-items: center;
      font-size: 0.72rem;
      color: var(--text-muted);
      font-weight: 500;
      flex: 1;
      position: relative;
    }
    .step-node.active { color: var(--accent); font-weight: 700; }
    .step-node.completed { color: var(--accent2); }
    .step-circle {
      width: 30px;
      height: 30px;
      border-radius: 50%;
      border: 2px solid var(--border);
      background: var(--bg);
      display: flex;
      align-items: center;
      justify-content: center;
      font-weight: bold;
      margin-bottom: 0.4rem;
      transition: var(--transition);
      font-size: 0.8rem;
    }
    .step-node.active .step-circle { border-color: var(--accent); color: var(--accent); }
    .step-node.completed .step-circle { border-color: var(--accent2); color: var(--accent2); background: var(--accent2-glow); }
    
    .wiz-nav-btns { display: flex; justify-content: space-between; margin-top: 2rem; border-top: 1px solid var(--border); padding-top: 1.25rem; }
    
    .mobile-preview {
      background: #000;
      border: 8px solid var(--border);
      border-radius: 28px;
      width: 220px;
      height: 360px;
      position: relative;
      margin: 0 auto;
      overflow: hidden;
      box-shadow: var(--shadow-lg);
      display: flex;
      flex-direction: column;
    }
    .mobile-header {
      background: var(--surface);
      color: var(--text);
      padding: 6px 10px;
      font-size: 0.7rem;
      font-weight: bold;
      display: flex;
      align-items: center;
      gap: 6px;
      border-bottom: 1px solid var(--border);
    }
    .mobile-screen {
      flex: 1;
      background: var(--bg);
      padding: 8px;
      display: flex;
      flex-direction: column;
      justify-content: flex-end;
      overflow-y: auto;
    }
    .mobile-bubble {
      background: var(--surface2);
      color: var(--text);
      padding: 6px 10px;
      border-radius: 10px 10px 10px 0;
      font-size: 0.65rem;
      max-width: 85%;
      margin-bottom: 6px;
      align-self: flex-start;
      line-height: 1.4;
      border: 1px solid var(--border);
    }
    .mobile-bubble.outbound {
      background: var(--accent);
      color: #fff;
      border-radius: 10px 10px 0 10px;
      align-self: flex-end;
      border-color: var(--accent-hover);
    }
    
    .status-timeline { display: flex; gap: 0.5rem; margin-top: 1.5rem; width: 100%; }
    .timeline-item { flex: 1; display: flex; flex-direction: column; align-items: center; font-size: 0.68rem; color: var(--text-muted); position: relative; }
    .timeline-item::after {
      content: '';
      position: absolute;
      width: calc(100% - 12px);
      height: 2px;
      background: var(--border);
      left: calc(50% + 6px);
      top: 6px;
      z-index: 1;
    }
    .timeline-item:last-child::after { display: none; }
    .timeline-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--border); border: 2px solid var(--surface); z-index: 2; margin-bottom: 0.3rem; transition: var(--transition); }
    .timeline-item.active { color: var(--accent); font-weight: bold; }
    .timeline-item.active .timeline-dot { background: var(--accent); }
    .timeline-item.completed { color: var(--accent2); }
    .timeline-item.completed .timeline-dot { background: var(--accent2); }
    .timeline-item.completed::after { background: var(--accent2); }

    .dialer-keypad {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 0.5rem;
      max-width: 220px;
      margin: 0 auto 1.5rem auto;
    }
    .dialer-btn {
      background: var(--surface2);
      border: 1px solid var(--border);
      border-radius: 50%;
      width: 50px;
      height: 50px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      color: var(--text);
      cursor: pointer;
      transition: var(--transition);
      margin: 0 auto;
    }
    .dialer-btn:hover {
      background: var(--surface-hover);
      border-color: var(--accent);
    }
    .dialer-btn .key-num { font-size: 1.1rem; font-weight: 600; line-height: 1; }
    .dialer-btn .key-letters { font-size: 0.5rem; color: var(--text-muted); text-transform: uppercase; }

    /* - Rates Grid - */
    .rates-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
      gap: 1rem;
      margin-bottom: 1.5rem;
    }
    .rate-card {
      background: var(--surface2);
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      padding: 1rem;
      text-align: center;
      transition: var(--transition);
    }
    .rate-card:hover { border-color: var(--accent); }
    .rate-card .rate-title { font-size: 0.72rem; text-transform: uppercase; color: var(--text-muted); margin-bottom: 0.25rem; letter-spacing: 0.05em; }
    .rate-card .rate-value { font-size: 1.4rem; font-weight: 700; color: var(--accent2); font-family: 'JetBrains Mono', monospace; }
    .rate-global-hint { font-size: 0.68rem; font-weight: 400; color: var(--accent); font-family: 'JetBrains Mono', monospace; opacity: 0.7; }

    /* - API Code Tabs - */
    .code-tabs { display: flex; gap: 0.5rem; border-bottom: 1px solid var(--border); margin-bottom: 0.75rem; }
    .code-tab-btn { background: none; border: none; color: var(--text-muted); font-size: 0.8rem; font-weight: 600; padding: 0.5rem 1rem; cursor: pointer; border-bottom: 2px solid transparent; transition: var(--transition); }
    .code-tab-btn:hover { color: var(--text); }
    .code-tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
    .code-tab-content { display: none; }
    .code-tab-content.active { display: block; }

    /* - Admin Navigation Section Separator - */
    .sidebar-separator {
      padding: 0.75rem 1.5rem 0.25rem;
      font-size: 0.65rem;
      text-transform: uppercase;
      letter-spacing: 0.1em;
      color: var(--accent);
      font-weight: 700;
      border-top: 1px solid var(--border);
      margin-top: 0.5rem;
      display: flex;
      align-items: center;
      gap: 0.5rem;
    }
    .sidebar-separator::after {
      content: '';
      flex: 1;
      height: 1px;
      background: linear-gradient(90deg, var(--accent-glow), transparent);
    }

    /* - Toast Notifications - */
    .toast-container {
      position: fixed;
      top: 80px;
      right: 1.5rem;
      z-index: 10000;
      display: flex;
      flex-direction: column;
      gap: 0.5rem;
      pointer-events: none;
    }
    .toast {
      pointer-events: auto;
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      padding: 0.85rem 1.25rem;
      font-size: 0.85rem;
      color: var(--text);
      box-shadow: var(--toast-shadow);
      display: flex;
      align-items: center;
      gap: 0.75rem;
      min-width: 320px;
      max-width: 480px;
      animation: toastSlideIn 0.3s ease-out;
      transition: opacity 0.3s, transform 0.3s;
    }
    .toast.removing { opacity: 0; transform: translateX(100px); }
    .toast.success { border-left: 3px solid var(--accent2); }
    .toast.error { border-left: 3px solid var(--danger); }
    .toast.warning { border-left: 3px solid var(--warn); }
    .toast.info { border-left: 3px solid var(--accent); }
    .toast-icon { font-size: 0.9rem; flex-shrink: 0; font-weight: 700; }
    .toast-icon.success { color: var(--accent2); }
    .toast-icon.error { color: var(--danger); }
    .toast-icon.warning { color: var(--warn); }
    .toast-icon.info { color: var(--accent); }
    .toast-body { flex: 1; }
    .toast-close { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1rem; padding: 0; }
    @keyframes toastSlideIn {
      from { opacity: 0; transform: translateX(100px); }
      to { opacity: 1; transform: translateX(0); }
    }

    /* - Modal Dialog - */
    .modal-overlay {
      position: fixed;
      inset: 0;
      background: var(--overlay-bg);
      backdrop-filter: blur(4px);
      z-index: 9999;
      display: flex;
      align-items: center;
      justify-content: center;
      animation: fadeIn 0.2s ease-out;
    }
    .modal-card {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 16px;
      padding: 2rem;
      max-width: 480px;
      width: 90%;
      box-shadow: var(--shadow-lg);
    }
    .modal-card h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.75rem; }
    .modal-card p { color: var(--text-muted); font-size: 0.88rem; line-height: 1.6; margin-bottom: 1.5rem; }
    .modal-actions { display: flex; gap: 0.75rem; justify-content: flex-end; }

    /* - Breadcrumb Bar - */
    .breadcrumb-bar {
      display: none;
      padding: 0.5rem 2rem;
      font-size: 0.78rem;
      color: var(--text-muted);
      background: var(--bg);
      border-bottom: 1px solid var(--border);
    }
    .breadcrumb-bar.visible { display: flex; align-items: center; gap: 0.35rem; }
    .breadcrumb-bar a { color: var(--accent); text-decoration: none; }
    .breadcrumb-bar a:hover { text-decoration: underline; }
    .breadcrumb-bar .sep { color: var(--border-hover); }

    /* - Tenant Deep Dive Tabs - */
    .td-tabs {
      display: flex;
      gap: 0;
      border-bottom: 2px solid var(--border);
      margin-bottom: 2rem;
      overflow-x: auto;
    }
    .td-tab-btn {
      background: none;
      border: none;
      color: var(--text-muted);
      font-size: 0.82rem;
      font-weight: 600;
      padding: 0.85rem 1.25rem;
      cursor: pointer;
      border-bottom: 2px solid transparent;
      margin-bottom: -2px;
      transition: var(--transition);
      white-space: nowrap;
    }
    .td-tab-btn:hover { color: var(--text); background: var(--surface2); }
    .td-tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
    .td-tab-pane { display: none; animation: fadeIn 0.3s ease-out; }
    .td-tab-pane.active { display: block; }

    /* - Search Bar - */
    .search-container {
      position: relative;
      max-width: 480px;
      margin-bottom: 1.5rem;
    }
    .search-container input {
      width: 100%;
      background: var(--bg);
      border: 1px solid var(--border);
      color: var(--text);
      border-radius: var(--radius);
      padding: 0.75rem 1rem 0.75rem 2.75rem;
      font-size: 0.88rem;
      outline: none;
      transition: var(--transition);
    }
    .search-container input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
    .search-container .search-icon {
      position: absolute;
      left: 1rem;
      top: 50%;
      transform: translateY(-50%);
      color: var(--text-muted);
      font-size: 0.9rem;
    }

    /* - Status Badges - */
    .status-badge { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.72rem; font-weight: 700; padding: 3px 10px; border-radius: 99px; text-transform: uppercase; letter-spacing: 0.03em; }
    .status-badge.active { background: rgba(13, 148, 136, 0.1); color: var(--accent2); border: 1px solid rgba(13, 148, 136, 0.2); }
    .status-badge.suspended { background: rgba(220, 38, 38, 0.08); color: var(--danger); border: 1px solid rgba(220, 38, 38, 0.2); }
    .status-badge.read-only { background: rgba(217, 119, 6, 0.08); color: var(--warn); border: 1px solid rgba(217, 119, 6, 0.2); }

    /* - Stat Cards - */
    .stat-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
    .stat-card {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      padding: 1.25rem;
      text-align: center;
      transition: var(--transition);
    }
    .stat-card:hover { border-color: var(--accent); transform: translateY(-2px); }
    .stat-card .stat-value { font-size: 1.6rem; font-weight: 700; font-family: 'JetBrains Mono', monospace; color: var(--accent); }
    .stat-card .stat-label { font-size: 0.72rem; text-transform: uppercase; color: var(--text-muted); margin-top: 0.25rem; letter-spacing: 0.05em; }

    /* - Tenant Profile Header - */
    .tenant-profile-header {
      display: flex;
      align-items: center;
      gap: 1.5rem;
      padding: 1.5rem;
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      margin-bottom: 1.5rem;
    }
    .tenant-avatar {
      width: 56px;
      height: 56px;
      border-radius: 50%;
      background: linear-gradient(135deg, var(--accent), var(--accent2));
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 1.4rem;
      font-weight: 700;
      color: #fff;
      flex-shrink: 0;
    }
    .tenant-profile-info h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.15rem; }
    .tenant-profile-info p { font-size: 0.82rem; color: var(--text-muted); }

    /* - Form Result - */
    .form-result {
      padding: 0.75rem 1rem;
      border-radius: var(--radius-sm);
      font-size: 0.85rem;
      background: var(--accent-glow);
      color: var(--accent);
      border: 1px solid var(--accent);
    }
    .form-result.success {
      background: var(--accent2-glow);
      color: var(--accent2);
      border-color: var(--accent2);
    }
    .form-result.error {
      background: rgba(220, 38, 38, 0.08);
      color: var(--danger);
      border-color: var(--danger);
    }

    /* ── Margin Indicators (site settings & tenant rate overrides) ──────── */
    .settings-margin, .td-margin {
      font-size: 0.68rem;
      font-weight: 600;
      padding: 1px 6px;
      border-radius: 3px;
      margin-left: 4px;
      display: inline-block;
      vertical-align: middle;
    }
    .margin-positive {
      background: rgba(16, 185, 129, 0.12);
      color: #10b981;
    }
    .margin-negative {
      background: rgba(239, 68, 68, 0.12);
      color: #ef4444;
    }
    .margin-breakeven {
      background: rgba(107, 114, 128, 0.12);
      color: var(--text-muted);
    }

    /* Base rate hint shown before rate override input */
    .rate-base-hint {
      font-size: 0.68rem;
      color: var(--text-muted);
      white-space: nowrap;
      min-width: 70px;
      flex-shrink: 0;
      background: var(--surface2);
      border: 1px solid var(--border);
      border-radius: 4px;
      padding: 0.35rem 0.5rem;
      text-align: center;
      font-family: 'JetBrains Mono', monospace;
    }

    /* - Custom Tooltips - */
    [data-tooltip] {
      position: relative;
      cursor: help;
    }
    [data-tooltip]:hover::after {
      content: attr(data-tooltip);
      position: absolute;
      bottom: 100%;
      left: 50%;
      transform: translateX(-50%) translateY(-8px);
      background: var(--text);
      color: var(--surface);
      padding: 8px 12px;
      font-size: 0.8rem;
      font-weight: 500;
      white-space: nowrap;
      border-radius: var(--radius-sm, 4px);
      box-shadow: var(--shadow-md);
      z-index: 1000;
      pointer-events: none;
      opacity: 0;
      animation: fadeInTooltip 0.15s ease forwards;
    }
    [data-tooltip]:hover::before {
      content: '';
      position: absolute;
      bottom: 100%;
      left: 50%;
      transform: translateX(-50%);
      border: 5px solid transparent;
      border-top-color: var(--text);
      z-index: 1000;
      pointer-events: none;
      opacity: 0;
      animation: fadeInTooltip 0.15s ease forwards;
    }
    @keyframes fadeInTooltip {
      to { opacity: 1; }
    }
    /* Wrap tooltip for long text */
    [data-tooltip-wrap="true"]:hover::after {
      white-space: normal;
      width: max-content;
      max-width: 300px;
      line-height: 1.4;
      text-align: left;
    }
    .nav-list li a.btn.primary.active { color: #ffffff !important; }