/*
 * NocoDB CE interface cleanup for hr.o-rekruter.com.
 * Reviewed against nocodb/nocodb 2026.07.0.
 *
 * Presentation only: this file neither enables nor bypasses licensed features.
 * Instance administration, license, billing, system information and white-label
 * screens are intentionally not targeted. Re-audit selectors after each update.
 */

/* Upgrade marketing shown in the normal workspace sidebar. */
.nc-upgrade-sidebar-banner-wrapper {
  display: none !important;
}

/* Enterprise navigation exposed in the normal workspace UI. */
.nc-rail-item[data-panel="workflows"],
.nc-dock-item[data-panel="workflows"],
[data-testid="nc-rail-bookmarks"],
[data-testid="mini-sidebar--workflow-create"],
[data-testid="mini-sidebar--script-create"],
[data-testid="mini-sidebar--dashboard-create"],
[data-testid="mini-sidebar--document-create"] {
  display: none !important;
}

/* Paid view types. Free grid, form, gallery, kanban and calendar remain visible. */
[data-testid="mini-sidebar-view-create-map"],
[data-testid="mini-sidebar-view-create-list"],
[data-testid="mini-sidebar-view-create-timeline"],
[data-testid="mini-sidebar-view-create-gantt"],
[data-testid="mini-sidebar-view-create-ai"],
[data-testid="sidebar-view-create-map"],
[data-testid="sidebar-view-create-list"],
[data-testid="sidebar-view-create-timeline"],
[data-testid="sidebar-view-create-gantt"],
[data-testid="sidebar-view-create-ai"],
[data-testid="topbar-view-create-map"],
[data-testid="topbar-view-create-list"],
[data-testid="topbar-view-create-timeline"],
[data-testid="topbar-view-create-gantt"] {
  display: none !important;
}

/* Workspace/base settings that require an Enterprise license. */
[data-testid="ws-teams"],
[data-testid="ws-audits"],
[data-testid="ws-sso"],
[data-testid="base-permissions"],
[data-testid="base-docs-permissions"],
[data-testid="base-syncs"],
[data-testid="base-audit"],
[data-testid="base-workflows"],
[data-testid="base-record-trash"],
[data-testid="base-variables"],
[data-testid="base-snapshots"] {
  display: none !important;
}

/* The self-hosted CE workspace header does not need the FREE PLAN pill. */
[data-testid="nc-ws-home-topbar-title"] + div {
  display: none !important;
}

/* Table and field permission tools exposed from table/details menus. */
.nc-table-permissions,
.nc-table-rls,
.nc-table-date-dependency,
[data-testid="nc-multi-field-permissions"] {
  display: none !important;
}

@supports selector(.ant-tabs-tab:has(*)) {
  .ant-tabs-tab:has([data-testid="nc-permissions-tab"]) {
    display: none !important;
  }
}

/* The same settings rendered as horizontal tabs. */
@supports selector(.ant-tabs-tab:has(*)) {
  .ant-tabs-tab:has([data-testid="proj-view-tab__workflows"]),
  .ant-tabs-tab:has([data-testid="proj-view-tab__permissions"]),
  .ant-tabs-tab:has([data-testid="proj-view-tab__docs-permissions"]),
  .ant-tabs-tab:has([data-testid="proj-view-tab__syncs"]),
  .ant-tabs-tab:has([data-testid="proj-view-tab__variables"]),
  .ant-tabs-tab:has([data-testid="proj-view-tab__record-trash"]),
  .ant-tabs-tab:has([data-testid="proj-view-tab__snapshots"]),
  .ant-tabs-tab:has([data-testid="nc-workspace-settings-tab-audits"]) {
    display: none !important;
  }
}

/* Paid record history actions; Undo/Redo remain available. */
[data-testid="nc-topbar-history-menu-snapshots"],
[data-testid="nc-topbar-history-menu-trash"] {
  display: none !important;
}

/* Paid controls without an upgrade badge in the current 2026.07.0 DOM. */
[class*="nc-column-list-option-"][data-testid="Colour"],
[data-testid="nc-topbar-extension-btn"],
[data-testid="nc-sidebar-base-create-sandbox"] {
  display: none !important;
}

/* Personal/private views are licensed separately. */
[data-testid*="nc-create-view-lock-type-personal" i],
[data-testid="nc-view-action-lock-subaction-Personal"] {
  display: none !important;
}

/*
 * Audited upgrade controls in NocoDB 2026.07.0. The exact SVG path belongs to
 * nc-icons-v2-upgrade-sparkle, not to the general AI/wand icon. NocoDB renders
 * the badge at different nesting levels, so target only known control shells
 * that contain either the normal badge or this version-specific icon.
 */
@supports selector(:has(*)) {
  /* Custom URL sharing is Business-only, but its outer card is unmarked. */
  .flex.flex-col.justify-between:has(
      [data-testid="share-custom-url-toggle"]
    ),

  /* Remove the whole Cloud promo/help strip, not just its link. */
  .flex.flex-row.w-full.justify-between:has(
      a[href^="https://app.nocodb.com/signin"]
    ),

  /* Buttons, radio options, tabs, menu rows and paid submenus. */
  :where(
      button,
      label,
      .ant-tabs-tab,
      .ant-menu-item,
      .ant-dropdown-menu-item,
      .ant-dropdown-menu-submenu,
      .ant-select-item-option,
      .nc-menu-item,
      .nc-list-item,
      .nc-sub-menu
    ):has(
      :where(
          .nc-upgrade-badge,
          .nc-upgrade-badge-sparkle,
          path[d="M8 0 C8.6 5 11 7.4 16 8 C11 8.6 8.6 11 8 16 C7.4 11 5 8.6 0 8 C5 7.4 7.4 5 8 0 Z"]
        )
    ),

  /* Sidebar settings and workspace setting cards such as forced 2FA. */
  :where(.nc-sidebar-menu-item, .nc-settings-item-card-wrapper):has(
      :where(
          .nc-upgrade-badge,
          .nc-upgrade-badge-sparkle,
          path[d="M8 0 C8.6 5 11 7.4 16 8 C11 8.6 8.6 11 8 16 C7.4 11 5 8.6 0 8 C5 7.4 7.4 5 8 0 Z"]
        )
    ),

  /* Paid project overview cards such as Dashboard and Sync. */
  .nc-overview-actions > :has(
      :where(
          .nc-upgrade-badge,
          .nc-upgrade-badge-sparkle,
          path[d="M8 0 C8.6 5 11 7.4 16 8 C11 8.6 8.6 11 8 16 C7.4 11 5 8.6 0 8 C5 7.4 7.4 5 8 0 Z"]
        )
    ),

  /* Paid field rows such as Unique values only. */
  .nc-column-options-wrapper > :has(
      :where(
          .nc-upgrade-badge,
          .nc-upgrade-badge-sparkle,
          path[d="M8 0 C8.6 5 11 7.4 16 8 C11 8.6 8.6 11 8 16 C7.4 11 5 8.6 0 8 C5 7.4 7.4 5 8 0 Z"]
        )
    ),

  /* Paid share-mode cards; ordinary public-share settings stay visible. */
  :where(.share-view, #nc-share-base-sub-modal)
    .flex.flex-col.justify-between:has(
      :where(
          .nc-upgrade-badge,
          .nc-upgrade-badge-sparkle,
          path[d="M8 0 C8.6 5 11 7.4 16 8 C11 8.6 8.6 11 8 16 C7.4 11 5 8.6 0 8 C5 7.4 7.4 5 8 0 Z"]
        )
    ) {
    display: none !important;
  }
}
