    :root {
      --bg: #f1f5fb;
      --panel: #ffffff;
      --panel-alt: #f8faff;
      --border: #dde5f0;
      --border-strong: #b8c6db;
      --text: #0b1221;
      --muted: #526077;
      --primary: #463eee;
      --primary-hover: #3a32d6;
      --cyan: #0891b2;
      --green: #15803d;
      --orange: #b45309;
      --red: #dc2626;
    }

    * {
      box-sizing: border-box;
    }

    ::-webkit-scrollbar {
      width: 10px;
      height: 10px;
    }

    ::-webkit-scrollbar-track {
      background: #f1f5f9;
      border-radius: 999px;
    }

    ::-webkit-scrollbar-thumb {
      background: #cbd5e1;
      border-radius: 999px;
      border: 2px solid #f1f5f9;
    }

    ::-webkit-scrollbar-thumb:hover {
      background: #94a3b8;
    }

    ::-webkit-scrollbar-thumb:active {
      background: var(--primary);
    }

    html,
    body {
      height: 100%;
      overflow: hidden;
    }

    body {
      margin: 0;
      background: var(--bg);
      color: var(--text);
      font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
      font-size: 13px;
      line-height: 1.42;
      -webkit-font-smoothing: antialiased;
      text-rendering: optimizeLegibility;
    }

    .hidden {
      display: none !important;
    }

    .shell {
      height: 100vh;
      max-width: 100%;
      margin: 0 auto;
      padding: 5px 10px;
      display: flex;
      flex-direction: column;
      gap: 4px;
      overflow: hidden;
    }

    .header {
      flex-shrink: 0;
      display: flex;
      justify-content: space-between;
      align-items: center;
      flex-wrap: nowrap;
      gap: 10px;
      background: linear-gradient(135deg, #020a2a 0%, #141752 55%, #2b2498 100%);
      border: 1px solid rgba(127, 89, 255, 0.38);
      border-radius: 10px;
      padding: 6px 12px;
      min-height: 46px;
      margin-bottom: 0;
      box-shadow: 0 6px 20px rgba(7, 15, 57, 0.24);
      overflow: visible;
      position: relative;
      z-index: 40;
    }

    .header-left,
    .header-actions {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: nowrap;
    }

    .header-left {
      min-width: 0;
    }

    .brand-name {
      font-size: 14.5px;
      font-weight: 800;
      color: #ffffff;
      letter-spacing: -0.015em;
    }

    .hdr-status-pill {
      cursor: pointer;
      user-select: none;
      transition: transform 0.12s ease, opacity 0.12s ease;
    }

    .hdr-status-pill:hover {
      opacity: 0.9;
      transform: translateY(-0.5px);
    }

    .header .header-actions > button,
    .header .hdr-dd-wrap > button {
      height: 31px;
      padding: 0 12px;
      font-size: 12px;
      border-radius: 8px;
      white-space: nowrap;
    }

    .btn-neutral,
    .btn-user-pill {
      background: #ffffff;
      border: 1px solid var(--border);
      color: #334155;
      font-weight: 600;
      display: inline-flex;
      align-items: center;
      gap: 5px;
    }

    .header .btn-neutral,
    .header .btn-user-pill {
      background: rgba(255, 255, 255, 0.12);
      border-color: rgba(255, 255, 255, 0.24);
      color: #f8fafc;
    }

    .header .btn-neutral:hover:not(:disabled),
    .header .btn-user-pill:hover:not(:disabled) {
      background: rgba(255, 255, 255, 0.22);
      border-color: rgba(255, 255, 255, 0.38);
      color: #ffffff;
    }

    .btn-neutral:hover:not(:disabled),
    .btn-user-pill:hover:not(:disabled) {
      background: #f8fafc;
      border-color: var(--border-strong);
      color: var(--text);
    }

    .btn-user-pill {
      max-width: 240px;
    }

    #hdrUserLabel {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .hdr-caret {
      font-size: 10px;
      color: #cbd5e1;
    }

    .hdr-dd-wrap {
      position: relative;
    }

    .hdr-dropdown {
      position: absolute;
      top: calc(100% + 6px);
      right: 0;
      min-width: 225px;
      background: #ffffff;
      border: 1px solid var(--border);
      border-radius: 10px;
      box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
      padding: 6px;
      z-index: 9600;
      display: flex;
      flex-direction: column;
      gap: 2px;
    }

    .hdr-menu-item {
      width: 100%;
      justify-content: flex-start;
      text-align: left;
      border: 0 !important;
      background: transparent !important;
      box-shadow: none !important;
      padding: 7px 10px !important;
      height: auto !important;
      border-radius: 7px;
      font-size: 12.2px;
      font-weight: 600;
      color: #334155;
    }

    .hdr-menu-item:hover:not(:disabled) {
      background: #f1f5f9 !important;
      color: var(--text);
    }

    .hdr-menu-sep {
      height: 1px;
      background: var(--border);
      margin: 4px 2px;
    }

    .hdr-menu-meta {
      padding: 4px 6px 6px;
      border-bottom: 1px solid #f1f5f9;
      margin-bottom: 4px;
    }

    .hdr-menu-meta .badge {
      max-width: 100%;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      display: inline-block;
    }

    #xtiktokTitle,
    .brand-sub {
      display: none;
    }

    .brand-title {
      font-size: 14px;
      font-weight: 800;
      letter-spacing: -0.01em;
      display: flex;
      align-items: center;
      gap: 6px;
      color: var(--text);
      white-space: nowrap;
    }

    .brand-pill {
      background: linear-gradient(135deg, #463eee, #7f59ff);
      color: #ffffff;
      padding: 2.5px 8px;
      border-radius: 6px;
      font-size: 10.5px;
      font-weight: 900;
      letter-spacing: 0.02em;
      box-shadow: 0 2px 8px rgba(70, 62, 238, 0.32);
    }

    .brand-sub {
      color: var(--muted);
      font-size: 11.5px;
      margin-top: 2px;
    }

    .toolbar {
      display: flex;
      align-items: center;
      gap: 6px;
      flex-wrap: wrap;
    }

    button,
    select,
    input,
    textarea {
      font: inherit;
      color: var(--text);
      background: #ffffff;
      border: 1px solid var(--border-strong);
      border-radius: 7px;
      padding: 5.5px 10px;
      font-size: 12.2px;
      transition: all 0.14s cubic-bezier(0.2, 0, 0, 1);
    }

    button:focus-visible,
    select:focus-visible,
    input:focus-visible,
    textarea:focus-visible {
      outline: none;
      border-color: var(--primary);
      box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.18);
    }

    button {
      cursor: pointer;
      font-weight: 600;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 4px;
    }

    button:hover:not(:disabled) {
      background: #f8fafc;
      border-color: #94a3b8;
      box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    }

    button:active:not(:disabled) {
      transform: translateY(0.5px);
    }

    button:disabled {
      opacity: 0.55;
      cursor: not-allowed;
    }

    .btn-primary {
      background: linear-gradient(135deg, #463eee 0%, #7f59ff 100%);
      border-color: #463eee;
      color: #fff;
      box-shadow: 0 4px 14px rgba(70, 62, 238, 0.32);
    }

    .btn-primary:hover:not(:disabled) {
      background: linear-gradient(135deg, #554ef5 0%, #8d6bff 100%);
      border-color: #554ef5;
      box-shadow: 0 6px 18px rgba(127, 89, 255, 0.38);
    }

    .btn-cyan {
      background: #ecfeff;
      border-color: #a5f3fc;
      color: #0e7490;
    }

    .btn-cyan:hover:not(:disabled) {
      background: #cffafe;
      border-color: #67e8f9;
    }

    .btn-sm {
      padding: 3.5px 7.5px;
      font-size: 11.2px;
      border-radius: 6px;
      line-height: 1.25;
    }

    .act-grid {
      display: grid;
      grid-template-columns: repeat(2, max-content);
      gap: 4px;
    }

    .act-row {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      flex-wrap: nowrap;
    }

    .kpi-ribbon {
      flex-shrink: 0;
      display: grid;
      grid-template-columns: repeat(5, minmax(150px, 1fr));
      gap: 8px;
      margin-bottom: 0;
    }

    @media (max-width: 1200px) {
      .kpi-ribbon {
        grid-template-columns: repeat(3, 1fr);
      }
    }

    .kpi-card {
      background: var(--panel);
      border: 1px solid var(--border);
      border-left: 4px solid var(--kpi-accent, #463eee);
      border-radius: 9px;
      padding: 7px 11px;
      display: flex;
      flex-direction: column;
      gap: 2px;
      box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
      transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
    }

    .kpi-card:hover {
      border-color: #94a3b8;
      border-left-color: var(--kpi-accent, #463eee);
      box-shadow: 0 2px 8px rgba(70, 62, 238, 0.14);
    }

    .kpi-card .lbl {
      color: var(--muted);
      font-size: 11px;
      font-weight: 700;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .kpi-card .val {
      font-size: 16px;
      font-weight: 800;
      margin-top: 0;
      color: var(--text);
      font-variant-numeric: tabular-nums;
      letter-spacing: -0.02em;
      white-space: nowrap;
    }

    .kpi-card .sub {
      font-size: 10.5px;
      color: var(--muted);
      margin-top: 0;
      font-weight: 600;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    /* Signature Nolimit Electric Blue KPI Ribbon */
    #xtiktokKpiRibbon .kpi-card {
      background: linear-gradient(135deg, #2563eb 0%, #3b82f6 55%, #60a5fa 100%);
      border: 1px solid rgba(255, 255, 255, 0.28);
      border-left: 1px solid rgba(255, 255, 255, 0.28);
      border-radius: 12px;
      padding: 9px 13px;
      box-shadow: 0 8px 22px rgba(59, 130, 246, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.3);
      color: #ffffff;
    }

    #xtiktokKpiRibbon .kpi-card:nth-child(1) {
      background: linear-gradient(135deg, #312e81 0%, #463eee 58%, #6366f1 100%);
      box-shadow: 0 8px 22px rgba(70, 62, 238, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.28);
    }

    #xtiktokKpiRibbon .kpi-card:nth-child(5) {
      background: linear-gradient(135deg, #4338ca 0%, #6366f1 55%, #7f59ff 100%);
      box-shadow: 0 8px 22px rgba(127, 89, 255, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.28);
    }

    #xtiktokKpiRibbon .kpi-card:hover {
      transform: translateY(-1px);
      border-color: rgba(255, 255, 255, 0.55);
      box-shadow: 0 10px 26px rgba(59, 130, 246, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.4);
    }

    #xtiktokKpiRibbon .kpi-card .lbl {
      color: rgba(255, 255, 255, 0.88);
    }

    #xtiktokKpiRibbon .kpi-card .val {
      color: #ffffff;
    }

    #xtiktokKpiRibbon .kpi-card .sub {
      color: rgba(239, 246, 255, 0.86);
    }

    .nav-tabs {
      flex-shrink: 0;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      margin-bottom: 0;
      background: var(--panel);
      border: 1px solid var(--border);
      border-radius: 10px;
      padding: 5px 10px;
      box-shadow: 0 1px 4px rgba(15, 23, 42, 0.05);
      flex-wrap: nowrap;
      overflow-x: auto;
    }

    .nav-tabs-group,
    .nav-tabs-tools {
      display: flex;
      align-items: center;
      gap: 4px;
      flex-wrap: nowrap;
    }

    .nav-tab {
      padding: 6px 11px;
      border-radius: 7px;
      background: transparent;
      border: 1px solid transparent;
      color: #334155;
      font-weight: 700;
      font-size: 12.2px;
      white-space: nowrap;
    }

    .nav-tab:hover {
      background: #eef2ff;
      color: #312e81;
      border-color: #c7d2fe;
      box-shadow: none;
    }

    .nav-tab.active {
      background: linear-gradient(135deg, #463eee 0%, #7f59ff 100%);
      border-color: transparent;
      color: #ffffff;
      font-weight: 800;
      box-shadow: 0 4px 12px rgba(70, 62, 238, 0.3);
    }

    .xsec {
      flex: 1;
      min-height: 0;
      display: flex;
      flex-direction: column;
      gap: 4px;
      overflow: hidden;
    }

    .panel-card {
      background: var(--panel);
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 5px 8px;
      margin-bottom: 4px;
      box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
    }

    .xsec>.panel-card {
      flex-shrink: 0;
      margin-bottom: 0;
    }

    .xsec>.panel-card button,
    .xsec>.panel-card select,
    .xsec>.panel-card input[type="text"],
    .xsec>.panel-card input[type="date"],
    .xsec>.panel-card input[type="number"] {
      padding: 2.5px 7px;
      font-size: 11.4px;
      height: 25px;
      border-radius: 6px;
    }

    .xsec>.panel-card .ms-btn {
      min-width: 125px;
      max-width: 175px;
      padding: 2.5px 7px;
      font-size: 11.4px;
      height: 25px;
    }

    .xsec>.panel-card .toolbar {
      gap: 4px;
    }

    .xsec>.panel-card .chips-bar {
      margin-top: 4px;
      padding-top: 4px;
      gap: 4px;
    }

    .xsec>.panel-card .chip {
      padding: 2px 8px;
      font-size: 10.8px;
      height: 22px;
    }

    .xsec>.panel-card .view-btn {
      padding: 2px 7px;
      font-size: 10.8px;
      height: 20px;
    }

    .panel-card.collapsed {
      display: none !important;
    }

    .filter-bar {
      display: flex;
      gap: 4px;
      align-items: center;
      flex-wrap: wrap;
      justify-content: space-between;
    }

    .bulk-bar {
      display: flex;
      gap: 5px;
      align-items: center;
      flex-wrap: wrap;
      margin-top: 4px;
      padding-top: 4px;
      border-top: 1px dashed var(--border);
    }

    .table-scroll-bar {
      flex-shrink: 0;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      background: var(--panel-alt);
      border: 1px solid var(--border);
      border-bottom: none;
      border-radius: 8px 8px 0 0;
      padding: 2px 7px;
      height: 26px;
    }

    .tsb-scroll-group {
      flex: 1;
      min-width: 0;
      display: flex;
      align-items: center;
      gap: 6px;
      transition: opacity 0.14s ease;
    }

    .tsb-scroll-group.no-overflow {
      opacity: 0.45;
      pointer-events: none;
    }

    .tsb-col-picker-wrap {
      position: relative;
      flex-shrink: 0;
    }

    .tsb-col-btn {
      padding: 2.5px 9px;
      font-size: 11.2px;
      font-weight: 700;
      border-radius: 6px;
      background: #ffffff;
      border: 1px solid var(--border-strong);
      color: var(--text);
      height: 22px;
    }

    .tsb-col-btn:hover {
      background: #f5f3ff;
      border-color: var(--primary);
      color: var(--primary-hover);
    }

    .col-picker-menu {
      position: absolute;
      top: calc(100% + 4px);
      right: 0;
      z-index: 660;
      width: 245px;
      max-height: 320px;
      overflow-y: auto;
      background: #ffffff;
      border: 1px solid var(--border-strong);
      border-radius: 10px;
      box-shadow: 0 14px 32px -6px rgba(15, 23, 42, 0.22);
      padding: 8px;
    }

    .col-picker-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding-bottom: 6px;
      margin-bottom: 6px;
      border-bottom: 1px solid var(--border);
      font-size: 11.5px;
      font-weight: 700;
      color: var(--text);
    }

    .col-picker-item {
      display: flex;
      align-items: center;
      gap: 7px;
      padding: 4px 6px;
      border-radius: 6px;
      cursor: pointer;
      font-size: 12px;
      color: var(--text);
    }

    .col-picker-item:hover {
      background: #f5f3ff;
    }

    .col-picker-item input[type="checkbox"] {
      margin: 0;
      accent-color: var(--primary);
      cursor: pointer;
    }

    .table-scroll-bar+.table-wrap {
      border-top-left-radius: 0;
      border-top-right-radius: 0;
    }

    .tsb-btn {
      padding: 2px 8px;
      font-size: 11px;
      font-weight: 700;
      border-radius: 5px;
      background: #ffffff;
      border: 1px solid var(--border-strong);
      color: var(--text);
      height: 21px;
      line-height: 1;
    }

    .tsb-btn:hover {
      background: #f5f3ff;
      border-color: var(--primary);
      color: var(--primary-hover);
    }

    .tsb-track {
      flex: 1;
      overflow-x: auto;
      overflow-y: hidden;
      height: 14px;
      background: #e2e8f0;
      border-radius: 999px;
    }

    .tsb-track::-webkit-scrollbar {
      height: 10px;
    }

    .tsb-track::-webkit-scrollbar-track {
      background: #e2e8f0;
      border-radius: 999px;
    }

    .tsb-track::-webkit-scrollbar-thumb {
      background: #94a3b8;
      border-radius: 999px;
      border: 1px solid #e2e8f0;
    }

    .tsb-track::-webkit-scrollbar-thumb:hover {
      background: var(--primary);
    }

    .tsb-spacer {
      height: 1px;
    }

    .tsb-hint {
      font-size: 10.5px;
      font-weight: 600;
      color: var(--muted);
      white-space: nowrap;
      padding: 0 4px;
    }

    .table-wrap {
      position: relative;
      overflow: auto;
      background: var(--panel);
      border: 1px solid var(--border);
      border-radius: 10px;
      box-shadow: 0 1px 4px rgba(15, 23, 42, 0.05);
      scrollbar-gutter: stable;
    }

    .xsec>.table-wrap {
      flex: 1;
      min-height: 0;
    }

    #adgroupsPanel {
      flex-shrink: 0;
      max-height: 34vh;
      display: flex;
      flex-direction: column;
      margin-top: 0 !important;
    }

    #adgroupsPanel .table-wrap {
      flex: 1;
      min-height: 110px;
    }

    .table-wrap.can-pan {
      cursor: grab;
    }

    .table-wrap.is-panning {
      cursor: grabbing;
      user-select: none;
    }

    .modal-box .table-wrap {
      max-height: 46vh;
      min-height: 120px;
    }

    table {
      width: 100%;
      border-collapse: separate;
      border-spacing: 0;
      min-width: 960px;
    }

    #tblAccounts.view-compact {
      min-width: 1020px;
    }

    #tblAccounts.view-analytics {
      min-width: 1260px;
    }

    #tblAccounts.view-full {
      min-width: 1680px;
    }

    #tblAccounts.view-compact .col-perf,
    #tblAccounts.view-compact .col-meta {
      display: none;
    }

    #tblAccounts.view-analytics .col-meta {
      display: none;
    }

    .col-user-hidden {
      display: none !important;
    }

    th,
    td {
      padding: 7px 9px;
      text-align: left;
      border-right: 1px solid #e2e8f0;
      border-bottom: 1px solid #e2e8f0;
      white-space: nowrap;
      font-size: 12.2px;
      vertical-align: middle;
    }

    th:last-child,
    td:last-child {
      border-right: none;
    }

    th {
      position: sticky;
      top: 0;
      z-index: 5;
      background: #f8fafc;
      color: var(--muted);
      font-weight: 700;
      font-size: 10.8px;
      text-transform: uppercase;
      letter-spacing: 0.03em;
      border-bottom: 1px solid var(--border-strong);
      box-shadow: inset 0 -1px 0 var(--border-strong);
    }

    .col-resizer {
      position: absolute;
      top: 0;
      right: 0;
      width: 5px;
      height: 100%;
      cursor: col-resize;
      user-select: none;
      z-index: 8;
      transition: background 0.12s ease;
    }

    .col-resizer:hover,
    .col-resizer.resizing {
      background: var(--primary);
    }

    tbody tr:nth-child(even) td,
    tbody tr:nth-child(even) td.sticky-col,
    tbody tr:nth-child(even) td.sticky-right {
      background: #f8fafc;
    }

    tbody tr:hover td,
    tbody tr:hover td.sticky-col,
    tbody tr:hover td.sticky-right {
      background: #f3f0ff !important;
    }

    .sticky-col {
      position: sticky;
      background: #ffffff;
      z-index: 3;
    }

    th.sticky-col {
      background: #f8fafc;
      z-index: 7;
    }

    .sticky-right {
      position: sticky;
      right: 0;
      background: #ffffff;
      z-index: 3;
      border-left: 1px solid var(--border-strong);
      box-shadow: -4px 0 10px -4px rgba(15, 23, 42, 0.10);
    }

    th.sticky-right {
      background: #f8fafc;
      z-index: 7;
    }

    .sticky-1 {
      left: 0;
      width: 36px;
      min-width: 36px;
      text-align: center;
    }

    .sticky-2 {
      left: 36px;
      width: 92px;
      min-width: 92px;
    }

    .sticky-3 {
      left: 128px;
      min-width: 225px;
      max-width: 270px;
      border-right: 2px solid var(--border);
      box-shadow: 3px 0 8px -4px rgba(15, 23, 42, 0.12);
    }

    .acc-name-btn {
      display: block;
      max-width: 235px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      font-weight: 700;
      color: var(--text);
      cursor: pointer;
    }

    .acc-name-btn:hover {
      color: var(--primary-hover);
      text-decoration: underline;
    }

    .id-row {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      margin-top: 2px;
    }

    .id-link {
      display: inline-flex;
      align-items: center;
      gap: 3px;
      font-family: 'Cascadia Mono', 'Consolas', ui-monospace, SFMono-Regular, monospace;
      font-size: 11px;
      font-weight: 700;
      color: var(--primary-hover);
      background: #f5f3ff;
      border: 1px solid #ddd6fe;
      border-radius: 5px;
      padding: 1.5px 6px;
      text-decoration: none;
      transition: background 0.14s, border-color 0.14s;
    }

    .id-link:hover {
      background: #ede9fe;
      border-color: #c4b5fd;
      text-decoration: underline;
    }

    .id-link.bc {
      color: #0e7490;
      background: #ecfeff;
      border-color: #a5f3fc;
    }

    .id-link.bc:hover {
      background: #cffafe;
      border-color: #67e8f9;
    }

    .id-copy-btn {
      border: 1px solid var(--border);
      background: #fff;
      color: var(--muted);
      border-radius: 5px;
      padding: 1px 5px;
      font-size: 10.5px;
      line-height: 1.35;
      cursor: pointer;
    }

    .id-copy-btn:hover {
      background: #f1f5f9;
      color: var(--text);
    }

    .chips-bar {
      display: flex;
      justify-content: space-between;
      align-items: center;
      flex-wrap: wrap;
      gap: 6px;
      margin-top: 8px;
      padding-top: 8px;
      border-top: 1px dashed var(--border);
    }

    .chips-group {
      display: flex;
      flex-wrap: wrap;
      gap: 5px;
      align-items: center;
    }

    .chip {
      padding: 3.5px 9.5px;
      border-radius: 999px;
      border: 1px solid var(--border);
      background: var(--panel-alt);
      color: #334155;
      font-size: 11.2px;
      font-weight: 600;
      cursor: pointer;
    }

    .chip:hover {
      background: #f5f3ff;
      border-color: #c4b5fd;
      color: #5b21b6;
    }

    .chip.active {
      background: var(--primary);
      border-color: var(--primary);
      color: #fff;
    }

    .view-pills {
      display: inline-flex;
      background: #f1f5f9;
      border: 1px solid var(--border);
      border-radius: 7px;
      padding: 2px;
      gap: 2px;
    }

    .view-btn {
      border: none;
      background: transparent;
      padding: 3.5px 8.5px;
      border-radius: 5px;
      font-size: 11.2px;
      color: #475569;
    }

    .view-btn.active {
      background: #fff;
      color: var(--primary-hover);
      box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    }

    .num {
      text-align: right;
      font-variant-numeric: tabular-nums;
      font-weight: 600;
    }

    .mono {
      font-family: 'Cascadia Mono', 'Consolas', ui-monospace, SFMono-Regular, monospace;
      font-size: 11.8px;
      color: #334155;
    }

    .badge {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      padding: 2px 7.5px;
      border-radius: 999px;
      font-size: 10.5px;
      font-weight: 800;
    }

    .badge.live {
      background: #dcfce7;
      color: #15803d;
      border: 1px solid #bbf7d0;
    }

    .badge.die {
      background: #fee2e2;
      color: #b91c1c;
      border: 1px solid #fecaca;
    }

    .badge.warn {
      background: #fef3c7;
      color: #b45309;
      border: 1px solid #fde68a;
    }

    .badge.cyan {
      background: #ecfeff;
      color: #0e7490;
      border: 1px solid #a5f3fc;
    }

    .ms-wrap {
      position: relative;
      display: inline-block;
    }

    .ms-btn {
      display: inline-flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      min-width: 185px;
      max-width: 260px;
      background: #fff;
      border: 1px solid var(--border-strong);
      border-radius: 7px;
      padding: 5px 10px;
      font-size: 12.2px;
      font-weight: 600;
      color: var(--text);
      cursor: pointer;
      text-align: left;
      white-space: nowrap;
    }

    .ms-btn.has-sel {
      border-color: var(--primary);
      background: #faf5ff;
      color: #5b21b6;
    }

    .ms-btn-txt {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      flex: 1;
    }

    .ms-menu {
      position: absolute;
      top: calc(100% + 5px);
      left: 0;
      z-index: 650;
      width: 348px;
      max-width: 90vw;
      background: #fff;
      border: 1px solid var(--border-strong);
      border-radius: 12px;
      box-shadow: 0 16px 36px -8px rgba(15, 23, 42, 0.22);
      padding: 9px;
      accent-color: var(--primary);
    }

    .ms-menu.hidden {
      display: none;
    }

    .ms-search {
      width: 100%;
      margin-bottom: 6px;
      font-size: 12px;
    }

    .ms-actions {
      display: flex;
      gap: 5px;
      flex-wrap: wrap;
      padding-bottom: 6px;
      margin-bottom: 6px;
      border-bottom: 1px solid #f1f5f9;
    }

    .ms-list {
      max-height: 270px;
      overflow-y: auto;
      display: flex;
      flex-direction: column;
      gap: 2px;
    }

    .ms-item {
      display: flex;
      align-items: flex-start;
      gap: 7px;
      padding: 5px 7px;
      border-radius: 7px;
      cursor: pointer;
      font-size: 12px;
      transition: background 0.12s ease;
    }

    .ms-item:hover {
      background: #f5f3ff;
    }

    .ms-item input[type="checkbox"] {
      margin-top: 2px;
      flex-shrink: 0;
      cursor: pointer;
      accent-color: var(--primary);
    }

    .ms-item-body {
      flex: 1;
      min-width: 0;
    }

    .ms-item-top {
      display: flex;
      align-items: center;
      gap: 5px;
      flex-wrap: wrap;
    }

    .ms-item-lbl {
      font-weight: 600;
      color: var(--text);
      word-break: break-word;
    }

    .ms-sub {
      font-size: 10.5px;
      color: var(--muted);
      font-family: 'Cascadia Mono', 'Consolas', ui-monospace, monospace;
      margin-top: 1px;
    }

    .row-acc-die,
    tr.row-acc-die td,
    tr.row-acc-die td.sticky-col,
    tr.row-acc-die td.sticky-right {
      background: #fff5f5 !important;
    }

    .cmp-warn-sub {
      font-size: 10.5px;
      font-weight: 700;
      color: #b91c1c;
      margin-top: 3px;
    }

    .status-banner {
      min-height: 0;
      color: var(--green);
      font-size: 11.2px;
      font-weight: 600;
      margin: 0;
      max-width: 360px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .status-banner:empty {
      display: none;
    }

    @keyframes fadeIn {
      from {
        opacity: 0;
      }

      to {
        opacity: 1;
      }
    }

    @keyframes modalIn {
      from {
        opacity: 0;
        transform: translateY(8px) scale(0.98);
      }

      to {
        opacity: 1;
        transform: translateY(0) scale(1);
      }
    }

    .modal-backdrop {
      position: fixed;
      inset: 0;
      background: rgba(15, 23, 42, 0.48);
      backdrop-filter: blur(4px);
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 16px;
      z-index: 999;
      animation: fadeIn 0.14s ease;
    }

    .modal-box {
      width: 680px;
      max-width: 94vw;
      background: var(--panel);
      border: 1px solid var(--border);
      border-radius: 16px;
      padding: 18px 20px;
      box-shadow: 0 24px 48px -12px rgba(15, 23, 42, 0.28);
      animation: modalIn 0.16s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .modal-box.modal-lg {
      width: 980px;
      max-width: 96vw;
      max-height: 90vh;
      overflow-y: auto;
    }

    .tt-sub-box {
      background: #f8fafc;
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 8px 10px;
      margin-top: 6px;
    }

    .tt-sub-title {
      font-size: 11.5px;
      font-weight: 800;
      color: #0f172a;
      margin-bottom: 6px;
      display: flex;
      align-items: center;
      justify-content: space-between;
    }

    .tt-seg-group {
      display: inline-flex;
      flex-wrap: wrap;
      border: 1px solid var(--border);
      border-radius: 7px;
      overflow: hidden;
      background: #fff;
    }

    .tt-seg-btn {
      border: none;
      border-right: 1px solid var(--border);
      background: #fff;
      color: #334155;
      padding: 4px 10px;
      font-size: 11.5px;
      font-weight: 600;
      cursor: pointer;
      border-radius: 0;
    }

    .tt-seg-btn:last-child {
      border-right: none;
    }

    .tt-seg-btn.active {
      background: #ecfeff;
      color: #0f766e;
      box-shadow: inset 0 0 0 1px #14b8a6;
      font-weight: 800;
    }

    .tt-radio-row {
      display: flex;
      gap: 14px;
      align-items: center;
      flex-wrap: wrap;
      font-size: 11.8px;
      font-weight: 600;
      color: #1e293b;
    }

    .tt-radio-row label {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      cursor: pointer;
    }

    .ov-subtabs {
      display: flex;
      gap: 20px;
      border-bottom: 1px solid var(--border);
      margin: 10px 0 12px;
      padding: 0 4px;
    }

    .ov-subtab {
      background: transparent;
      border: none;
      border-bottom: 3px solid transparent;
      border-radius: 0;
      padding: 8px 4px;
      font-size: 13px;
      font-weight: 700;
      color: var(--muted);
      cursor: pointer;
      box-shadow: none;
    }

    .ov-subtab:hover {
      background: transparent;
      color: var(--text);
      box-shadow: none;
    }

    .ov-subtab.active {
      color: #0d9488;
      border-bottom-color: #0d9488;
    }

    .tt-place-pill {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      font-weight: 700;
      color: var(--text);
    }

    .tt-place-icon {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 26px;
      height: 26px;
      border-radius: 7px;
      background: #0f172a;
      color: #fff;
      font-size: 13px;
      font-weight: 900;
      box-shadow: -1.5px -1.5px 0 #06b6d4, 1.5px 1.5px 0 #f43f5e;
    }

    .rep-hero-head {
      display: flex;
      justify-content: space-between;
      align-items: center;
      flex-wrap: wrap;
      gap: 10px;
      padding-bottom: 8px;
      margin-bottom: 8px;
      border-bottom: 1px solid var(--border);
    }

    .rep-tab-title {
      display: inline-block;
      font-size: 14.5px;
      font-weight: 800;
      color: var(--text);
      padding-bottom: 5px;
      border-bottom: 3px solid #0d9488;
    }

    .rep-today-line {
      font-size: 13px;
      color: #334155;
      margin-top: 5px;
    }

    .rep-today-line strong {
      font-size: 14.5px;
      color: var(--text);
    }

    .modal-box h3 {
      margin: 0 0 8px;
      font-size: 15px;
      font-weight: 800;
      color: var(--text);
    }

    .modal-box textarea {
      width: 100%;
      height: 180px;
      margin: 10px 0;
      font-family: 'Cascadia Mono', 'Consolas', ui-monospace, monospace;
      font-size: 12px;
    }

    .ov-kpis {
      display: grid;
      grid-template-columns: repeat(4, minmax(140px, 1fr));
      gap: 8px;
      margin: 10px 0;
    }

    @media (max-width: 800px) {
      .ov-kpis {
        grid-template-columns: repeat(2, 1fr);
      }
    }

    .trend-box {
      background: var(--panel-alt);
      border: 1px solid var(--border);
      border-radius: 10px;
      padding: 10px 12px;
      margin: 8px 0 12px;
    }

    .trend-bars {
      display: flex;
      align-items: flex-end;
      gap: 6px;
      height: 110px;
      padding-top: 14px;
      border-bottom: 1px solid var(--border-strong);
    }

    .trend-bar-col {
      flex: 1;
      min-width: 18px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: flex-end;
      height: 100%;
      gap: 4px;
    }

    .trend-bar-fill {
      width: 100%;
      max-width: 28px;
      background: linear-gradient(180deg, #463eee 0%, #419bed 100%);
      border-radius: 4px 4px 0 0;
      min-height: 3px;
    }

    .trend-bar-lbl {
      font-size: 9.5px;
      color: var(--muted);
      font-family: 'Cascadia Mono', 'Consolas', ui-monospace, monospace;
    }

    .app-footer {
      flex-shrink: 0;
      background: var(--panel);
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 4px 10px;
      margin-top: 0;
      display: flex;
      align-items: center;
      justify-content: space-between;
      flex-wrap: wrap;
      gap: 8px;
      font-size: 11.2px;
      color: var(--muted);
      box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
    }

    .app-footer-brand {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      color: var(--text);
    }

    .app-footer-links {
      display: inline-flex;
      align-items: center;
      flex-wrap: wrap;
      gap: 10px;
    }

    .app-footer-item {
      display: inline-flex;
      align-items: center;
      gap: 6px;
    }

    .app-footer-placeholder {
      color: var(--muted);
      font-style: italic;
    }

    .cmp-subtabs {
      flex-shrink: 0;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 6px;
      flex-wrap: wrap;
      background: var(--panel);
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 4px 8px;
    }

    .cmp-subtabs-left,
    .cmp-subtabs-right {
      display: flex;
      align-items: center;
      gap: 5px;
      flex-wrap: wrap;
    }

    .cmp-subtab {
      padding: 3.5px 10px;
      border-radius: 6px;
      border: 1px solid transparent;
      background: transparent;
      color: var(--muted);
      font-size: 11.6px;
      font-weight: 700;
    }

    .cmp-subtab:hover {
      background: #f1f5f9;
      color: var(--text);
    }

    .cmp-subtab.active {
      background: #f5f3ff;
      border-color: var(--primary);
      color: var(--primary-hover);
    }

    .cmp-pane {
      flex: 1;
      min-height: 0;
      display: flex;
      flex-direction: column;
      gap: 4px;
      overflow: hidden;
    }

    .cmp-pane>.table-wrap {
      flex: 1;
      min-height: 0;
    }

    .ep-method {
      display: inline-block;
      padding: 1.5px 6px;
      border-radius: 5px;
      font-family: 'Cascadia Mono', 'Consolas', ui-monospace, monospace;
      font-size: 10.5px;
      font-weight: 800;
    }

    .ep-method.GET {
      background: #ecfeff;
      color: #0e7490;
      border: 1px solid #a5f3fc;
    }

    .ep-method.POST {
      background: #f5f3ff;
      color: #6d28d9;
      border: 1px solid #ddd6fe;
    }

    .crt-mode-tabs {
      display: flex;
      gap: 6px;
      background: #f1f5f9;
      padding: 3px;
      border-radius: 8px;
      margin-bottom: 10px;
    }

    .crt-mode-btn {
      flex: 1;
      border: none;
      background: transparent;
      padding: 6px 10px;
      border-radius: 6px;
      font-size: 12px;
      font-weight: 700;
      color: var(--muted);
    }

    .crt-mode-btn.active {
      background: #ffffff;
      color: var(--primary-hover);
      box-shadow: 0 1px 3px rgba(15, 23, 42, 0.1);
    }

    .crt-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 8px;
    }

    @media (max-width: 720px) {
      .crt-grid {
        grid-template-columns: 1fr;
      }
    }

    .crt-field {
      display: flex;
      flex-direction: column;
      gap: 3px;
    }

    .crt-field label {
      font-size: 11px;
      font-weight: 700;
      color: var(--muted);
    }

    .crt-field input:not([type="checkbox"]):not([type="radio"]),
    .crt-field select {
      width: 100%;
    }

    .crt-field input[type="checkbox"],
    .crt-field input[type="radio"],
    .tt-radio-row input[type="checkbox"],
    .tt-radio-row input[type="radio"] {
      width: auto !important;
      flex-shrink: 0;
      margin: 0;
    }

    .tt-radio-row label {
      white-space: nowrap;
    }

    /* TAB 5 STUDIO 2-COLUMN LAYOUT */
    .crt-studio-shell {
      display: flex;
      flex-direction: column;
      gap: 10px;
      max-width: 1520px;
      margin: 0 auto;
    }

    .crt-studio-head {
      position: sticky;
      top: 0;
      z-index: 12;
      background: #ffffff;
      border: 1px solid var(--border);
      border-radius: 10px;
      padding: 8px 12px;
      box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
      display: flex;
      justify-content: space-between;
      align-items: center;
      flex-wrap: wrap;
      gap: 8px;
    }

    .crt-studio-grid {
      display: grid;
      grid-template-columns: 360px minmax(0, 1fr);
      gap: 12px;
      align-items: start;
    }

    @media (max-width: 1080px) {
      .crt-studio-grid {
        grid-template-columns: 1fr;
      }
    }

    .crt-studio-sidebar {
      position: sticky;
      top: 56px;
      display: flex;
      flex-direction: column;
      gap: 10px;
    }

    .crt-studio-sidebar .crt-acc-list {
      max-height: 360px;
      grid-template-columns: 1fr;
    }

    .crt-studio-main {
      display: flex;
      flex-direction: column;
      gap: 10px;
      min-width: 0;
    }

    .crt-step-card {
      background: #ffffff;
      border: 1px solid var(--border);
      border-radius: 10px;
      padding: 12px 14px;
      box-shadow: 0 1px 4px rgba(15, 23, 42, 0.03);
    }

    .crt-action-card {
      background: linear-gradient(180deg, #ffffff 0%, #f5f3ff 100%);
      border: 1px solid #c4b5fd;
      border-radius: 10px;
      padding: 12px;
      display: flex;
      flex-direction: column;
      gap: 8px;
    }

    .crt-action-card .btn-primary {
      width: 100%;
      padding: 10px 14px;
      font-size: 13px;
      font-weight: 800;
    }

    .crt-acc-list {
      max-height: 145px;
      overflow-y: auto;
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 6px;
      background: var(--panel-alt);
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 4px;
    }


/* ============================================================================
 * UNIFIED ACCOUNT, KEY & WOLF BILLING POPUP HUB (/app/account, /app/billing)
 * ========================================================================== */
.hub-modal-bg {
  position: fixed;
  inset: 0;
  z-index: 9500;
  background: rgba(2, 6, 23, 0.76);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.hub-modal-bg.hidden { display: none !important; }
.hub-modal {
  width: 100%;
  max-width: 1040px;
  max-height: 92vh;
  background: #0b1024;
  color: #f8fafc;
  border: 1px solid rgba(127, 89, 255, 0.32);
  border-radius: 20px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.65);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
}
.hub-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 22px;
  background: #0b1024;
  border-bottom: 1px solid rgba(127, 89, 255, 0.22);
}
.hub-head-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 15px;
}
.hub-pill {
  background: linear-gradient(135deg, #463eee, #7f59ff);
  color: #fff;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 900;
}
.hub-close {
  background: #161d3a;
  color: #e2e8f0;
  border: 1px solid rgba(127, 89, 255, 0.28);
  border-radius: 8px;
  padding: 5px 11px;
  font-weight: 800;
  cursor: pointer;
}
.hub-tabs {
  display: flex;
  gap: 8px;
  padding: 12px 22px;
  background: #070b1a;
  border-bottom: 1px solid rgba(127, 89, 255, 0.16);
  flex-wrap: wrap;
}
.hub-tab {
  padding: 9px 16px;
  border-radius: 9px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: transparent;
  color: #94a3b8;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}
.hub-tab.active {
  background: linear-gradient(135deg, #463eee, #7f59ff);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(70, 62, 238, 0.35);
}
.hub-body {
  padding: 18px 22px 24px;
  overflow-y: auto;
  font-size: 13.5px;
  background: #0d1328;
}
.hub-card {
  background: #11162c;
  border: 1px solid rgba(127, 89, 255, 0.2);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 14px;
}
.hub-ext-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border-radius: 14px;
  margin-bottom: 14px;
  border: 1px solid rgba(127, 89, 255, 0.24);
  background: #11162c;
}
.hub-ext-box.ok { border-color: rgba(34, 197, 94, 0.45); background: rgba(20, 83, 45, 0.28); }
.hub-ext-box.warn { border-color: rgba(245, 158, 11, 0.45); background: rgba(120, 53, 15, 0.26); }
.hub-gate-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border-radius: 14px;
  margin-bottom: 14px;
  background: linear-gradient(135deg, rgba(70, 62, 238, 0.24), rgba(127, 89, 255, 0.2));
  border: 1px solid rgba(127, 89, 255, 0.52);
  color: #fff;
}
.hub-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
@media (max-width: 720px) { .hub-kpi-row { grid-template-columns: repeat(2, 1fr); } }
.hub-kpi {
  background: #11162c;
  border: 1px solid rgba(127, 89, 255, 0.2);
  border-radius: 12px;
  padding: 12px 14px;
}
.hub-kpi-val { font-size: 20px; font-weight: 900; margin-top: 4px; }
.hub-muted { color: #94a3b8; font-size: 12.5px; }
.hub-mono { font-family: Consolas, monospace; font-size: 12.2px; }
.hub-form { display: flex; flex-direction: column; gap: 10px; }
.hub-modal input, .hub-select {
  background: #070b1a;
  color: #fff;
  border: 1px solid rgba(127, 89, 255, 0.24);
  border-radius: 9px;
  padding: 9px 12px;
  font-size: 13px;
}
.hub-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 15px;
  border-radius: 9px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: #1a2142;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}
.hub-btn-primary { background: linear-gradient(135deg, #463eee, #7f59ff); border: none; box-shadow: 0 6px 18px rgba(70, 62, 238, 0.35); }
.hub-btn-orange { background: linear-gradient(135deg, #463eee, #7f59ff); border: none; color: #fff; box-shadow: 0 6px 18px rgba(70, 62, 238, 0.35); }
.hub-btn-danger { background: rgba(239, 68, 68, 0.18); border-color: rgba(239, 68, 68, 0.45); color: #fca5a5; }
.hub-btn-xs { padding: 4px 9px; font-size: 11.5px; border-radius: 7px; }
.hub-badge { padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; display: inline-block; white-space: nowrap; }
.hub-badge.ok { background: rgba(34, 197, 94, 0.2); color: #86efac; }
.hub-badge.warn { background: rgba(245, 158, 11, 0.2); color: #fcd34d; }
.hub-badge.err { background: rgba(239, 68, 68, 0.2); color: #fca5a5; }
.hub-msg { font-size: 12.8px; color: #fca5a5; min-height: 18px; }
.hub-lic-box {
  padding: 12px 14px;
  border-radius: 11px;
  background: #0b1024;
  border: 1px solid rgba(127, 89, 255, 0.2);
  margin-bottom: 10px;
}
.hub-dev-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 7px 10px;
  margin-top: 6px;
  background: #070b1a;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 8px;
}
.hub-dur {
  padding: 7px 12px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: #0b1024;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.hub-dur.active { background: linear-gradient(135deg, #463eee, #7f59ff); color: #fff; border-color: transparent; }

/* Spacious 4-Card Plan Grid (Zero Horizontal Clipping) */
.hub-plan-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
@media (max-width: 880px) { .hub-plan-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .hub-plan-grid { grid-template-columns: 1fr; } }
.hub-plan-card {
  display: flex;
  flex-direction: column;
  padding: 14px;
  border-radius: 14px;
  border: 1.5px solid rgba(148, 163, 184, 0.2);
  background: #0b1024;
  color: #fff;
  cursor: pointer;
  transition: all 0.16s ease;
}
.hub-plan-card:hover { border-color: rgba(127, 89, 255, 0.65); }
.hub-plan-card.selected {
  border-color: #7f59ff;
  background: linear-gradient(180deg, rgba(70, 62, 238, 0.24), #0b1024 68%);
  box-shadow: 0 0 0 1px #7f59ff;
}
.hub-plan-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.hub-plan-name { font-size: 15.5px; font-weight: 900; letter-spacing: 0.01em; }
.hub-plan-price { font-size: 22px; font-weight: 900; color: #fff; margin: 4px 0; }
.hub-plan-price small { font-size: 12px; color: #a78bfa; font-weight: 800; }
.hub-plan-meta { font-size: 11.8px; color: #cbd5e1; padding: 6px 8px; background: rgba(255,255,255,0.04); border-radius: 7px; margin-bottom: 8px; }
.hub-plan-feats { list-style: none; padding: 0; margin: 0 0 10px; flex: 1; display: flex; flex-direction: column; gap: 5px; }
.hub-plan-feats li { font-size: 11.8px; color: #94a3b8; line-height: 1.38; display: flex; gap: 6px; }
.hub-plan-feats li::before { content: "✓"; color: #22c55e; font-weight: 900; flex-shrink: 0; }
.hub-plan-select-lbl {
  text-align: center;
  padding: 6px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.06);
}
.hub-plan-card.selected .hub-plan-select-lbl { background: linear-gradient(135deg, #463eee, #7f59ff); color: #fff; }

.hub-checkout-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 8px;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
}
.hub-invoice-box {
  margin-top: 14px;
  padding: 16px;
  border-radius: 14px;
  background: #070b1a;
  border: 1px solid rgba(96, 165, 250, 0.35);
}
.hub-pay-methods { display: flex; gap: 6px; flex-wrap: wrap; }
.hub-pm-btn {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: #11162c;
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.hub-pm-btn.active { background: linear-gradient(135deg, #463eee, #7f59ff); color: #fff; border-color: transparent; }
.hub-invoice-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 18px;
  align-items: center;
}
@media (max-width: 680px) { .hub-invoice-grid { grid-template-columns: 1fr; } }
.hub-qr-col { display: flex; justify-content: center; }
.hub-qr-img {
  width: 206px;
  height: 206px;
  object-fit: contain;
  background: #fff;
  padding: 8px;
  border-radius: 12px;
}
.hub-qr-placeholder {
  width: 206px;
  height: 206px;
  border-radius: 12px;
  border: 1.5px dashed rgba(148, 163, 184, 0.35);
  background: #0f172a;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 14px;
  color: #94a3b8;
  font-size: 12.5px;
  gap: 4px;
}
.hub-pay-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 7px 0;
  border-bottom: 1px dashed rgba(148, 163, 184, 0.14);
}
.hub-copy {
  background: rgba(56, 189, 248, 0.16);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  margin-left: 6px;
}
.hub-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.hub-table th, .hub-table td { text-align: left; padding: 8px 9px; border-bottom: 1px solid rgba(148, 163, 184, 0.14); }
.hub-table th { color: #94a3b8; font-size: 11px; text-transform: uppercase; }

/* ===== PROMINENT HEADER SYNC CTA ("Đồng Bộ TKQC/ BC") ===== */
.header .header-actions > button.btn-sync-hero {
  background: linear-gradient(135deg, #06b6d4 0%, #3b82f6 50%, #7c3aed 100%);
  color: #ffffff;
  border: 1px solid rgba(165, 243, 252, 0.55);
  height: 33px;
  padding: 0 15px;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.01em;
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.3), 0 4px 16px rgba(59, 130, 246, 0.45);
  transition: transform 0.14s ease, box-shadow 0.16s ease, filter 0.16s ease;
}
.header .header-actions > button.btn-sync-hero:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.08);
  box-shadow: 0 0 0 2px rgba(103, 232, 249, 0.45), 0 6px 22px rgba(124, 58, 237, 0.55);
}
.header .header-actions > button.btn-sync-hero.is-syncing {
  animation: syncPulse 1.4s ease-in-out infinite;
}
@keyframes syncPulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.4), 0 4px 18px rgba(59, 130, 246, 0.5); }
  50% { box-shadow: 0 0 0 5px rgba(56, 189, 248, 0.25), 0 6px 24px rgba(124, 58, 237, 0.72); }
}

/* ===== FULL-SCREEN BLURRED SYNC PROGRESS MODAL ===== */
.sync-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10050;
  background: rgba(2, 6, 23, 0.68);
  backdrop-filter: blur(11px);
  -webkit-backdrop-filter: blur(11px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.16s ease;
}
.sync-modal-backdrop.hidden {
  display: none !important;
}
.sync-modal-card {
  width: 680px;
  max-width: 95vw;
  background: linear-gradient(165deg, #070d27 0%, #0f172a 60%, #13193b 100%);
  border: 1px solid rgba(99, 102, 241, 0.48);
  border-radius: 18px;
  padding: 20px 22px;
  color: #f8fafc;
  box-shadow: 0 28px 64px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(56, 189, 248, 0.18);
  animation: modalIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
.sync-modal-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.sync-modal-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, #06b6d4, #6366f1);
  color: #ffffff;
  font-size: 20px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(56, 189, 248, 0.35);
}
.sync-modal-icon.is-spinning {
  animation: syncSpin 1.1s linear infinite;
}
.sync-modal-icon.is-done {
  background: linear-gradient(135deg, #10b981, #059669);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
}
.sync-modal-icon.is-error {
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.4);
}
@keyframes syncSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.sync-modal-titles {
  flex: 1;
  min-width: 0;
}
.sync-modal-titles h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: #ffffff;
}
.sync-modal-titles p {
  margin: 3px 0 0;
  font-size: 12.2px;
  color: #94a3b8;
}
.sync-elapsed-badge {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #7dd3fc;
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.sync-progress-track {
  height: 8px;
  background: rgba(148, 163, 184, 0.16);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 14px;
}
.sync-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #06b6d4, #6366f1, #a855f7);
  transition: width 0.28s ease;
}
.sync-modal-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.sync-stat-card {
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 10px;
  padding: 9px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.sync-stat-lbl {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.sync-stat-val {
  font-size: 14px;
  font-weight: 800;
  color: #e2e8f0;
}
.sync-log-wrap {
  background: #020617;
  border: 1px solid rgba(99, 102, 241, 0.32);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 14px;
}
.sync-log-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 12px;
  background: rgba(30, 41, 59, 0.72);
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
  font-size: 11.5px;
  font-weight: 700;
  color: #38bdf8;
}
.sync-modal-log {
  height: 220px;
  overflow-y: auto;
  padding: 10px 12px;
  font-size: 11.8px;
  line-height: 1.55;
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sync-log-line {
  display: flex;
  gap: 8px;
  word-break: break-word;
}
.sync-log-ts {
  color: #64748b;
  flex-shrink: 0;
}
.sync-log-line.ok { color: #4ade80; }
.sync-log-line.warn { color: #fbbf24; }
.sync-log-line.err { color: #f87171; }
.sync-modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.sync-btn-ghost {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: #e2e8f0;
  border-radius: 9px;
  padding: 7px 14px;
  font-size: 12.2px;
  font-weight: 700;
  cursor: pointer;
}
.sync-btn-ghost:hover { background: rgba(255, 255, 255, 0.15); }
.sync-btn-done {
  background: linear-gradient(135deg, #10b981, #059669);
  border: 0;
  color: #ffffff;
  border-radius: 9px;
  padding: 8px 18px;
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}
.sync-btn-done:hover { filter: brightness(1.06); }

/* ===== SINGLE-CONTROL DATE RANGE PICKER ===== */
.drp-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.drp-trigger {
  height: 30px;
  padding: 0 11px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: #ffffff;
  color: #0f172a;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.drp-trigger:hover,
.drp-trigger.active {
  border-color: #4f46e5;
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.16);
}
.drp-popover {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 2500;
  width: 282px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 10px 11px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
  color: #0f172a;
}
.drp-popover.drp-align-right {
  left: auto;
  right: 0;
}
.drp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  margin-bottom: 8px;
}
.drp-month-title {
  font-size: 12.8px;
  font-weight: 800;
  color: #0f172a;
  flex: 1;
  text-align: center;
}
.drp-nav-btn {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #334155;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.drp-nav-btn:hover { background: #eef2ff; color: #4f46e5; border-color: #c7d2fe; }
.drp-today-btn {
  height: 26px;
  padding: 0 8px;
  border-radius: 6px;
  border: 1px solid #c7d2fe;
  background: #eef2ff;
  color: #4338ca;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.drp-today-btn:hover { background: #e0e7ff; }
.drp-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 10.8px;
  font-weight: 700;
  color: #64748b;
  margin-bottom: 4px;
}
.drp-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.drp-day {
  height: 32px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: #0f172a;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.1s ease, color 0.1s ease;
}
.drp-day:hover {
  background: #eef2ff;
  color: #4338ca;
}
.drp-day.is-outside {
  color: #94a3b8;
  font-weight: 500;
}
.drp-day.is-today {
  box-shadow: inset 0 0 0 1.5px #4f46e5;
}
.drp-day.is-in-range {
  background: #e0e7ff;
  color: #312e81;
  border-radius: 4px;
}
.drp-day.is-start,
.drp-day.is-end,
.drp-day.is-hover-end {
  background: linear-gradient(135deg, #463eee, #7c3aed);
  color: #ffffff;
  font-weight: 800;
}
.drp-hint {
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px solid #e2e8f0;
  font-size: 10.8px;
  color: #64748b;
  line-height: 1.35;
}

/* ===== TAB 5 STUDIO HEADER REDESIGN ===== */
.crt-studio-head {
  gap: 10px;
  padding: 9px 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f8faff 100%);
  border: 1px solid #cbd5e1;
}
.crt-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.btn-crt-assets-hero {
  background: linear-gradient(135deg, #0ea5e9 0%, #2563eb 55%, #4f46e5 100%);
  color: #ffffff;
  border: none;
  border-radius: 9px;
  padding: 7px 14px;
  font-size: 12.2px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.32);
  transition: transform 0.12s ease, box-shadow 0.14s ease, filter 0.14s ease;
}
.btn-crt-assets-hero:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.06);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.42);
}
.btn-crt-reset {
  background: #fff1f2;
  color: #be123c;
  border: 1px solid #fecdd3;
  border-radius: 9px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.btn-crt-reset:hover { background: #ffe4e6; border-color: #fda4af; }
.crt-studio-head .crt-mode-tabs {
  flex: 1;
  margin: 0;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  padding: 4px;
  border-radius: 10px;
  gap: 5px;
}
.crt-studio-head .crt-mode-btn {
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 12.2px;
  font-weight: 700;
  color: #475569;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.crt-studio-head .crt-mode-btn:hover:not(.active) {
  background: rgba(255, 255, 255, 0.68);
  color: #1e293b;
}
.crt-studio-head .crt-mode-btn.active {
  background: linear-gradient(135deg, #463eee 0%, #7c3aed 100%);
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(70, 62, 238, 0.3);
}
.crt-count-pill {
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 800;
  background: rgba(70, 62, 238, 0.12);
  color: #4338ca;
}
.crt-mode-btn.active .crt-count-pill {
  background: rgba(255, 255, 255, 0.24);
  color: #ffffff;
}

/* ===== AUTO RULES DATE & WEEKDAY SCHEDULE PICKER ===== */
.rule-days-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed #e2e8f0;
}
.rule-days-lbl {
  font-size: 11.8px;
  font-weight: 700;
  color: #475569;
  margin-right: 2px;
}
.rule-day-pill {
  min-width: 34px;
  height: 26px;
  padding: 0 8px;
  border-radius: 7px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #64748b;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.12s ease;
}
.rule-day-pill.active {
  background: linear-gradient(135deg, #463eee, #7c3aed);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(70, 62, 238, 0.26);
}
.rule-date-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 175px;
}
.rule-date-inline-select {
  height: 27px;
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #0f172a;
  font-size: 11.5px;
  font-weight: 600;
}
.rule-custom-dates {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.rule-custom-dates input[type="date"] {
  height: 25px;
  padding: 1px 5px;
  font-size: 11px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
}
.rule-days-sub {
  font-size: 11px;
  color: #4f46e5;
  font-weight: 700;
}
