/* ============================================
   Groepen page — power-table + drawer + std-policy strip
   ============================================ */

/* ---- Members cell (button navigates to Users page, filtered by group) ---- */
.members-cell { white-space: nowrap; }
.members-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  font-size: 0.82rem;
  color: var(--text-primary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.members-btn:hover { background: var(--bg-card-hover); border-color: var(--border-default); }
.members-btn .member-count-num {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 600;
  color: var(--text-primary);
}
.members-btn .cb-arrow {
  color: var(--text-tertiary);
  margin-left: 2px;
}

/* ---- Column widths ----
   Columns: (1) checkbox · (2) Groep · (3) Leden · (4) Gevoeligheid · (5) Toegestane acties · (6) Chatbots · (7) menu
   Fixed-option columns (4, 5) shrink to content; Chatbots (6) flexes. */
.groepen-table th:nth-child(4),
.groepen-table td.sensitivity-cell,
.groepen-table th:nth-child(5),
.groepen-table td.actions-cell {
  width: 1%;
  white-space: nowrap;
}
.groepen-table th:nth-child(6),
.groepen-table td.cb-cell {
  width: auto;
}
.actions-cell {
  white-space: nowrap;
}
.actions-text {
  color: var(--text-primary);
  font-size: 0.85rem;
  margin-right: 4px;
}
.actions-edit { cursor: pointer; }

/* Actions popover */
.actions-popover {
  position: absolute;
  z-index: 200;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  padding: var(--space-md);
  min-width: 220px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.actions-popover-title {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-tertiary);
  margin-bottom: 2px;
}
.actions-popover-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 4px 0;
}
.actions-popover-check input { accent-color: var(--brand-primary); }
.actions-popover-hint {
  font-size: 0.72rem;
  color: var(--text-tertiary);
  margin-top: 4px;
  line-height: 1.4;
}

/* ---- Group name cell ---- */
.groepen-table .member-count {
  color: var(--text-tertiary);
  font-weight: 400;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.8rem;
}
.groepen-table tr.group-row-default td {
  background: rgba(21, 94, 239, 0.025);
}

/* ---- Power table ---- */
/* Allow tooltips to escape the table container */
#page-groepen .table-container { overflow: visible; }
#page-groepen .table-wrapper   { overflow: visible; }

.groepen-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
}
.groepen-table thead th {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-tertiary);
  text-align: left;
  padding: 10px var(--space-md);
  border-bottom: 1px solid var(--border-card);
  background: var(--bg-card-hover);
  position: relative;
}

/* Info tooltip on column header */
.th-info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-left: 6px;
  border-radius: 50%;
  background: var(--bg-input);
  color: var(--text-tertiary);
  font-size: 0.68rem;
  font-weight: 700;
  font-style: italic;
  text-transform: none;
  letter-spacing: 0;
  cursor: help;
  position: relative;
  outline: none;
  transition: all 120ms ease;
}
.th-info:hover, .th-info:focus { background: var(--brand-primary); color: white; }
.th-tip {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  background: #1F2937;
  color: white;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.74rem;
  font-weight: 400;
  font-style: normal;
  letter-spacing: 0;
  line-height: 1.5;
  text-transform: none;
  text-align: left;
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;
  box-sizing: border-box;
  width: 260px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease, visibility 180ms ease;
  z-index: 50;
}
.th-tip strong { color: white; font-weight: 600; }
.th-tip em     { color: #CBD5E1; font-style: normal; font-weight: 600; }
.th-tip::before {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-bottom-color: #1F2937;
}
.th-info:hover .th-tip, .th-info:focus .th-tip, .th-info:focus-within .th-tip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}
.groepen-table tbody tr {
  border-bottom: 1px solid var(--border-subtle);
  transition: background 120ms ease;
  cursor: pointer;
  position: relative;
}
.groepen-table tbody tr:hover { background: var(--bg-card-hover); }
.groepen-table td {
  padding: 10px var(--space-md);
  font-size: 0.85rem;
  vertical-align: middle;
}
.groepen-table td input[type="checkbox"] {
  accent-color: var(--brand-primary);
  cursor: pointer;
}
.groepen-table td input[type="checkbox"]:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
/* ---- Sensitivity cell: text + popover trigger (matches actions-cell) ---- */
.sensitivity-cell { white-space: nowrap; }
.sensitivity-text {
  color: var(--text-primary);
  font-size: 0.85rem;
  margin-right: 4px;
}

/* ---- Chatbot category cell: plain category names + popover trigger ---- */
.cb-cell { white-space: nowrap; font-size: 0.85rem; }
.cb-names {
  color: var(--text-primary);
  margin-right: 4px;
}
.cb-name-none {
  color: var(--text-tertiary);
  font-style: italic;
}
.cb-detail-btn {
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}
.cb-detail-btn:hover { background: var(--bg-card-hover); color: var(--text-primary); }

/* ---- Sidebar collapse ---- */
.sidebar { transition: width 220ms ease, min-width 220ms ease, opacity 150ms ease; }
#app-layout.sidebar-hidden .sidebar,
.app-layout.sidebar-hidden .sidebar {
  width: 0 !important;
  min-width: 0 !important;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  border-right: none;
}
.sidebar-toggle {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  cursor: pointer;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  margin-right: var(--space-md);
}
.sidebar-toggle:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

/* ---- Users power-table (deelt patterns met groepen-table) ---- */
.users-table { width: 100%; border-collapse: collapse; background: var(--bg-card); }
.users-table thead th {
  font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text-tertiary); text-align: left; padding: 10px var(--space-md);
  border-bottom: 1px solid var(--border-card); background: var(--bg-card-hover);
}
.users-table tbody tr { border-bottom: 1px solid var(--border-subtle); transition: background 120ms ease; }
.users-table tbody tr:hover { background: var(--bg-card-hover); }
.users-table td { padding: 10px var(--space-md); font-size: 0.85rem; vertical-align: middle; }
.users-table .row-menu { cursor: pointer; color: var(--text-tertiary); font-size: 1rem; padding: 2px 6px; border-radius: var(--radius-sm); }
.users-table .row-menu:hover { background: var(--bg-card-hover); color: var(--text-primary); }

/* Allow popover to escape users-table container */
#page-gebruikers .table-container { overflow: visible; }
#page-gebruikers .table-wrapper   { overflow: visible; }

/* Popover action-link (bijv. "+ Nieuwe groep aanmaken...") */
.actions-popover-link {
  background: transparent; border: none; color: var(--brand-primary); font-size: 0.82rem;
  font-weight: 600; cursor: pointer; padding: 4px 0; text-align: left; width: 100%;
}
.actions-popover-link:hover { text-decoration: underline; }
.actions-popover-body { max-height: 240px; overflow-y: auto; }
