// ── Scrollbar utility ─────────────────────────────────────────────────────────
.scrollbar {
  scrollbar-width: thin;
  scrollbar-color: #693ea6 transparent;

  &::-webkit-scrollbar {
    width: 4px;
    height: 4px;
  }

  &::-webkit-scrollbar-track {
    background: #cebaf1;
  }

  &::-webkit-scrollbar-thumb {
    background-color: #693ea6;
    border-radius: 4px;
  }
}

.btn-bordered {
  border: 1px solid var(--button-primary-bg-default);
  border-radius: 3px;
  background: var(--button-primary-bg-default);
  padding: 6px 14px;
  cursor: pointer;
  color: #fff;
}

// ── Form overview wrapper ─────────────────────────────────────────────────────
.FormOverView {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 110px);
  padding: 10px 12px 0;
  overflow: hidden;
}

// ── Tree + Grid container ─────────────────────────────────────────────────────
.tree-grid-container {
  display: flex;
  flex: 1;
  overflow: hidden;
  border: 1px solid #ddd;
  border-radius: 4px;
}

// ── Left tree panel ───────────────────────────────────────────────────────────
.tree-panel {
  width: 240px;
  min-width: 200px;
  flex-shrink: 0;
  border-right: 1px solid #ddd;
  overflow-y: auto;
  padding: 6px 4px;
  background: #fafafa;
  scrollbar-width: thin;
  scrollbar-color: #693ea6 transparent;

  &::-webkit-scrollbar {
    width: 4px;
  }

  &::-webkit-scrollbar-track {
    background: #cebaf1;
  }

  &::-webkit-scrollbar-thumb {
    background-color: #693ea6;
    border-radius: 4px;
  }

  .tree-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #444;
    padding: 4px 8px 8px;
    border-bottom: 1px solid #eee;
    margin-bottom: 4px;
  }

  .folderview {
    display: block;
    width: 100%;
  }
}

// ── Right grid panel ──────────────────────────────────────────────────────────
.grid-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

// ── Global actions bar ────────────────────────────────────────────────────────
.global-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: #f5f5f5;
  border-bottom: 1px solid #e0e0e0;
  flex-shrink: 0;
  justify-content: space-between;

  .global-label {
    font-size: 12px;
    font-weight: 600;
    color: #555;
    margin-right: 4px;
  }
}

// ── Table wrapper (scrollable) ────────────────────────────────────────────────
.table-wrapper {
  flex: 1;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: #693ea6 transparent;

  &::-webkit-scrollbar {
    width: 6px;
    height: 6px;
  }

  &::-webkit-scrollbar-track {
    background: #f0f0f0;
  }

  &::-webkit-scrollbar-thumb {
    background-color: #693ea6;
    border-radius: 4px;
  }
}

// ── Rights table ──────────────────────────────────────────────────────────────
.rights-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  white-space: nowrap;
  table-layout: auto;

  thead tr th {
    background: var(--bg-focus, #e8eaf6);
    border: 1px solid #ccc;
    padding: 5px 8px;
    text-align: center;
    font-weight: 600;
    font-size: 12px;
    color: #333;
    position: sticky;
    top: 0;
    z-index: 2;
  }

  .th-group {
    background: var(--bg-focus, #e8eaf6);
    color: #1a56db;
    font-size: 13px;
    font-weight: 700;
  }

  // ── Column widths ─────────────────────────────────────────────────────────
  .th-sno {
    min-width: 48px;
    width: 48px;
  }

  .th-action {
    min-width: 76px;
    width: 76px;
  }

  // ← NEW: row action column
  .th-base {
    min-width: 64px;
  }

  .th-op {
    min-width: 90px;
    padding: 4px 6px;
  }

  tbody td {
    border: 1px solid var(--bg-focus, #e8eaf6);
    padding: 4px 8px;
    color: #222;
    vertical-align: middle;
  }

  .td-center {
    text-align: center;
    vertical-align: middle;
  }

  tbody tr:nth-child(even) td {
    background: #fafafa;
  }

  tbody tr:hover td {
    background: #eef4ff;
  }
}


.row-actions {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: bold;
  cursor: pointer;
  user-select: none;
  line-height: 1;
  flex-shrink: 0;
  transition: opacity 0.15s ease, transform 0.1s ease;

  &.check {
    background-color: #22c55e;
    color: #fff;
  }

  &.cross {
    background-color: #ef4444;
    color: #fff;
  }

  &:hover {
    opacity: 0.80;
    transform: scale(1.1);
  }

  &:active {
    transform: scale(0.95);
  }
}

// ── Checkboxes (Insert / Update / Delete / View / Print / Export) ─────────────
.op-checkbox {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--button-primary-bg-default, #1a56db);
  vertical-align: middle;
}


.allow-icons {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.allow-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: bold;
  cursor: pointer;
  user-select: none;
  line-height: 1;
  transition: opacity 0.15s ease, transform 0.1s ease;

  // ── Green icon (Allow = true) ──────────────────────────────────────────────
  &.allow-yes {
    background-color: transparent;
    color: #22c55e;
    border: 2px solid #22c55e;
    opacity: 0.45;

    &.active {
      background-color: #22c55e;
      color: #fff;
      border-color: #22c55e;
      opacity: 1;
    }
  }

  // ── Red icon (Allow = false) ───────────────────────────────────────────────
  &.allow-no {
    background-color: transparent;
    color: #ef4444;
    border: 2px solid #ef4444;
    opacity: 0.45;

    &.active {
      background-color: #ef4444;
      color: #fff;
      border-color: #ef4444;
      opacity: 1;
    }
  }

  &:hover {
    opacity: 0.85 !important;
    transform: scale(1.12);
  }

  &:active {
    transform: scale(0.95);
  }
}

// ── Operation column header layout ────────────────────────────────────────────
.op-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;

  .op-label {
    font-size: 12px;
    font-weight: 600;
    color: #333;
  }

  .header-actions {
    display: flex;
    gap: 5px;
    align-items: center;
  }
}

// ── Numeric inputs ────────────────────────────────────────────────────────────
.num-input {
  width: 62px;
  border: 1px solid #ccc;
  border-radius: 3px;
  padding: 2px 4px;
  text-align: center;
  font-size: 12px;
  color: #333;

  &:focus {
    outline: none;
    border-color: var(--button-primary-bg-default, #1a56db);
    box-shadow: 0 0 0 2px rgba(26, 86, 219, 0.15);
  }

  &::-webkit-outer-spin-button,
  &::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
  }
}

// ── No data placeholder ───────────────────────────────────────────────────────
.no-data {
  text-align: center;
  color: #aaa;
  padding: 48px 0;
  font-size: 14px;
  font-style: italic;
}