/* ============================================================
   Authorization Admin UI Styles
   barqmcp/static/authAdmin/authAdmin.css
   v2 — Tile navigation, resizable panes, tooltips, icons
   ============================================================ */

/* ─── Tile Navigation Grid ─────────────────────────────────── */
.authTileGrid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.authTile {
  background: var(--bg-secondary, #1e1e2e);
  border: 1px solid var(--border-color, #333);
  border-radius: 10px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-top: 3px solid var(--border-color, #333);
  position: relative;
}

.authTile:hover {
  border-color: var(--accent, #3b82f6);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.authTile.active {
  border-color: var(--accent);
  background: var(--active);
  box-shadow: 0 0 0 1px var(--accent), 0 4px 16px rgba(59, 130, 246, 0.15);
}

/* Per-tile accent colors */
.authTile--roles        { border-top-color: #3b82f6; }
.authTile--assignments  { border-top-color: #8b5cf6; }
.authTile--groups       { border-top-color: #10b981; }
.authTile--acls         { border-top-color: #f59e0b; }
.authTile--audit        { border-top-color: #ec4899; }
.authTile--access       { border-top-color: #6366f1; }

.authTileTop {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.authTileIcon {
  font-size: 1.6rem;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.authTile:hover .authTileIcon {
  transform: scale(1.12);
}

.authTileTitle {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-primary);
  flex: 1;
}

.authTileDesc {
  font-size: 0.85rem;
  color: var(--text-secondary, #bbb);
  line-height: 1.45;
  margin-bottom: 8px;
}

.authTileStat {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid rgba(148, 163, 184, 0.1);
}

.authTileStat strong {
  color: var(--text-primary);
  font-weight: 600;
}

.authTileAdminOnly {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  opacity: 0.6;
  padding: 1px 6px;
  border-radius: 3px;
  border: 1px solid var(--border-color);
}

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

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

.light-theme .authTile {
  background: var(--bg-secondary);
}

.light-theme .authTile:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

/* ─── Recent Activity Feed ─────────────────────────────────── */
.authActivityFeed {
  border: 1px solid var(--border-color);
  border-radius: 10px;
  overflow: hidden;
}

.authActivityHeader {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-primary);
}

.authActivityHeader .authTileIcon {
  font-size: 1.1rem;
}

.authActivityTitle {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
  flex: 1;
}

.authActivityItem {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.06);
  font-size: 0.84rem;
  transition: background 0.15s;
}

.authActivityItem:last-child {
  border-bottom: none;
}

.authActivityItem:hover {
  background: var(--hover);
}

.authActivityDot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  margin-top: 5px;
  flex-shrink: 0;
}

.authActivityDot--create { background: #4ade80; }
.authActivityDot--update { background: #60a5fa; }
.authActivityDot--delete { background: #f87171; }
.authActivityDot--assign { background: #c084fc; }

.authActivityText {
  flex: 1;
  color: var(--text-primary);
  line-height: 1.4;
}

.authActivityText strong {
  font-weight: 600;
}

.authActivityTime {
  font-size: 0.76rem;
  color: var(--text-secondary);
  white-space: nowrap;
  flex-shrink: 0;
}

.authActivityEmpty {
  padding: 24px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* ─── Back Button (from tile detail back to grid) ──────────── */
.authBackBtn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.15s;
  margin-bottom: 16px;
}

.authBackBtn:hover {
  background: var(--hover);
  color: var(--text-primary);
  border-color: var(--accent);
}

.authBackBtn .authBackIcon {
  font-size: 1rem;
}

/* ─── Tab Bar (retained for in-detail sub-tabs) ────────────── */
.authTabBar {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 24px;
  padding-bottom: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.authTab {
  padding: 10px 18px;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  white-space: nowrap;
  user-select: none;
  border-radius: 6px 6px 0 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.authTab:hover {
  color: var(--text-primary);
  background: var(--hover);
}

.authTab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

.authTabIcon {
  font-size: 1rem;
}

.light-theme .authTab {
  color: var(--text-secondary);
}

.light-theme .authTab.active {
  color: var(--accent);
}

/* ─── Toolbar ──────────────────────────────────────────────── */
.authToolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.authSearchInput {
  flex: 1;
  min-width: 200px;
  max-width: 400px;
  padding: 10px 14px;
  background: var(--bg-primary);
  border: 1.5px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.authSearchInput:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.authSearchInput::placeholder {
  color: var(--text-secondary);
  opacity: 0.7;
}

.authFilterSelect {
  padding: 10px 14px;
  background: var(--bg-primary);
  border: 1.5px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.9rem;
  cursor: pointer;
  transition: border-color 0.2s;
}

.authFilterSelect:focus {
  outline: none;
  border-color: var(--accent);
}

/* ─── Data Tables ──────────────────────────────────────────── */
.authTable {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.9rem;
}

.authTable th {
  text-align: left;
  padding: 12px 14px;
  font-weight: 600;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-primary);
  position: sticky;
  top: 0;
  z-index: 1;
}

.authTable td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
  color: var(--text-primary);
  vertical-align: middle;
  line-height: 1.5;
}

.authTable tr:hover td {
  background: var(--hover);
}

.authTable td.actions {
  white-space: nowrap;
  text-align: right;
}

.light-theme .authTable th {
  background: var(--bg-secondary);
}

.light-theme .authTable td {
  border-bottom-color: rgba(0, 0, 0, 0.06);
}

/* ─── Role Badges ──────────────────────────────────────────── */
.authRoleBadge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
}

.authRoleBadge--system {
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.25);
}

.authRoleBadge--custom {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.authRoleBadge--inherited {
  background: rgba(148, 163, 184, 0.12);
  color: var(--text-secondary);
  border: 1px solid rgba(148, 163, 184, 0.2);
  font-style: italic;
}

.light-theme .authRoleBadge--system {
  background: rgba(99, 102, 241, 0.1);
  color: #6366f1;
}

.light-theme .authRoleBadge--custom {
  background: rgba(34, 197, 94, 0.1);
  color: #16a34a;
}

.light-theme .authRoleBadge--inherited {
  color: var(--text-secondary);
}

/* ─── Governance Badge ─────────────────────────────────────── */
.authGovBadge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.authGovBadge--ADMIN {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.authGovBadge--DATA_GOVERNANCE {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.authGovBadge--USER {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.light-theme .authGovBadge--ADMIN { color: #dc2626; }
.light-theme .authGovBadge--DATA_GOVERNANCE { color: #d97706; }
.light-theme .authGovBadge--USER { color: #2563eb; }

/* ─── Operation Pills ──────────────────────────────────────── */
.authOpPill {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 500;
  background: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.2);
  margin: 2px;
}

.light-theme .authOpPill { color: #2563eb; }

/* ─── Permission Matrix ────────────────────────────────────── */
.authPermMatrix {
  max-height: 500px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

.authPermRow {
  display: flex;
  align-items: flex-start;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
  gap: 12px;
}

.authPermRow:last-child { border-bottom: none; }
.authPermRow:hover { background: var(--hover); }

.authPermArea {
  min-width: 140px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
  padding-top: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.authPermAreaIcon {
  font-size: 1.1rem;
}

.authPermAreaToggle {
  display: inline-flex;
  gap: 4px;
}

.authPermAreaToggle button {
  padding: 3px 8px;
  font-size: 0.7rem;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}

.authPermAreaToggle button:hover {
  background: var(--hover);
  color: var(--text-primary);
}

.authPermActions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
}

.authPermAction {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 6px;
  font-size: 0.84rem;
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-secondary);
  user-select: none;
}

.authPermAction:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

.authPermAction.selected {
  background: rgba(59, 130, 246, 0.2);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 500;
}

.authPermAction input[type="checkbox"] { display: none; }

.authPermAction .authPermCheck {
  width: 15px;
  height: 15px;
  border: 1.5px solid var(--border-color);
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  flex-shrink: 0;
}

.authPermAction.selected .authPermCheck {
  background: var(--accent);
  border-color: var(--accent);
}

.authPermAction.selected .authPermCheck::after {
  content: '\2713';
  color: #fff;
  font-size: 10px;
  font-weight: bold;
}

/* ─── Group Tree ───────────────────────────────────────────── */
.authGroupTree {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
}

.authGroupNode {
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
}

.authGroupNode:last-child { border-bottom: none; }

.authGroupNodeHeader {
  display: flex;
  align-items: center;
  padding: 12px 14px;
  cursor: pointer;
  transition: background 0.15s;
  gap: 8px;
}

.authGroupNodeHeader:hover { background: var(--hover); }

.authGroupNodeHeader.active { background: var(--active); }

.authGroupToggle {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--text-secondary);
  transition: transform 0.2s;
  flex-shrink: 0;
}

.authGroupToggle.expanded { transform: rotate(90deg); }
.authGroupToggle.empty { visibility: hidden; }

.authGroupName {
  font-weight: 500;
  color: var(--text-primary);
  flex: 1;
  font-size: 0.9rem;
}

.authGroupMeta {
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: flex;
  gap: 12px;
  align-items: center;
}

.authGroupChildren {
  padding-left: 24px;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.authGroupChildren.collapsed {
  max-height: 0 !important;
  overflow: hidden;
}

/* ─── Group Detail Panel ───────────────────────────────────── */
.authGroupDetail {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 20px;
  background: var(--bg-primary);
}

.authGroupDetailTitle {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.authGroupDetailSection { margin-bottom: 20px; }

.authGroupDetailSection h4 {
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  margin: 0 0 10px 0;
}

/* ─── Effective Access Matrix ──────────────────────────────── */
.authAccessMatrix {
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

.authAccessMatrix table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.authAccessMatrix th {
  padding: 10px 10px;
  font-weight: 600;
  text-align: center;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-primary);
  position: sticky;
  top: 0;
}

.authAccessMatrix th:first-child {
  text-align: left;
  min-width: 130px;
}

.authAccessMatrix td {
  padding: 8px 8px;
  text-align: center;
  border-bottom: 1px solid rgba(148, 163, 184, 0.06);
}

.authAccessMatrix td:first-child {
  text-align: left;
  font-weight: 500;
  color: var(--text-primary);
}

.authAccessCell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: default;
}

.authAccessCell--granted {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
}

.authAccessCell--denied,
.authAccessCell--override-deny {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

.authAccessCell--none {
  background: rgba(148, 163, 184, 0.08);
  color: var(--text-secondary);
  opacity: 0.4;
}

.light-theme .authAccessCell--granted { color: #16a34a; }
.light-theme .authAccessCell--denied,
.light-theme .authAccessCell--override-deny { color: #dc2626; }

/* ─── Custom Tooltips ──────────────────────────────────────── */
[data-auth-tip] {
  position: relative;
}

[data-auth-tip]::after {
  content: attr(data-auth-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 12px;
  background: rgba(15, 23, 42, 0.95);
  color: #e2e8f0;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 400;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 200;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  max-width: 260px;
  white-space: normal;
  text-align: center;
  line-height: 1.35;
}

[data-auth-tip]:hover::after {
  opacity: 1;
}

.light-theme [data-auth-tip]::after {
  background: rgba(15, 23, 42, 0.9);
}

/* ─── Source Tooltip ───────────────────────────────────────── */
.authSourceTooltip {
  position: absolute;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.84rem;
  color: var(--text-primary);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  z-index: 100;
  max-width: 300px;
  pointer-events: none;
}

.authSourceTooltip .source-line {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 4px 0;
  font-size: 0.82rem;
}

/* ─── Empty States ─────────────────────────────────────────── */
.authEmptyState {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  color: var(--text-secondary);
}

.authEmptyState .emptyIcon {
  font-size: 2.8rem;
  margin-bottom: 14px;
  opacity: 0.5;
}

.authEmptyState .emptyTitle {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.authEmptyState .emptyDesc {
  font-size: 0.9rem;
  max-width: 420px;
  line-height: 1.55;
}

/* ─── Loading Spinner ──────────────────────────────────────── */
.authSpinner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.authSpinner::after {
  content: '';
  width: 28px;
  height: 28px;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: authSpin 0.7s linear infinite;
}

@keyframes authSpin { to { transform: rotate(360deg); } }

/* ─── Panels ───────────────────────────────────────────────── */
.authPanel { display: none; }
.authPanel.active { display: block; }

/* ─── Inline Forms ─────────────────────────────────────────── */
.authInlineForm {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  padding: 10px 0;
}

.authInlineForm select,
.authInlineForm input {
  padding: 8px 12px;
  background: var(--bg-primary);
  border: 1.5px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 0.88rem;
}

.authInlineForm select:focus,
.authInlineForm input:focus {
  outline: none;
  border-color: var(--accent);
}

/* ─── Expandable Rows ──────────────────────────────────────── */
.authExpandRow { cursor: pointer; }

.authExpandContent {
  display: none;
  padding: 14px 14px 14px 40px;
  background: rgba(0, 0, 0, 0.15);
  border-bottom: 1px solid var(--border-color);
}

.authExpandContent.expanded { display: block; }
.light-theme .authExpandContent { background: rgba(0, 0, 0, 0.03); }

.authExpandSection { margin-bottom: 14px; }
.authExpandSection:last-child { margin-bottom: 0; }

.authExpandSection h5 {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  margin: 0 0 8px 0;
}

/* ─── Badge pills list ─────────────────────────────────────── */
.authBadgeList {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

/* ─── Batch Action Bar ─────────────────────────────────────── */
.authBatchBar {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--active);
  border-radius: 8px;
  margin-bottom: 12px;
  font-size: 0.9rem;
}

.authBatchBar.visible { display: flex; }

.authBatchBar .batchCount {
  font-weight: 600;
  color: var(--accent);
}

/* ─── Override badge ───────────────────────────────────────── */
.authOverrideBadge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.76rem;
  font-weight: 600;
  text-transform: uppercase;
}

.authOverrideBadge--grant { background: rgba(34, 197, 94, 0.15); color: #4ade80; }
.authOverrideBadge--deny  { background: rgba(239, 68, 68, 0.15); color: #f87171; }
.light-theme .authOverrideBadge--grant { color: #16a34a; }
.light-theme .authOverrideBadge--deny  { color: #dc2626; }

/* ─── Audit Log ────────────────────────────────────────────── */
.authAuditDetails {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.authAuditDetails.expanded { max-height: 500px; }

.authAuditJson {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 12px 14px;
  font-family: 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
  font-size: 0.82rem;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-all;
  margin: 8px 14px;
}

/* ─── Compare Mode ─────────────────────────────────────────── */
.authCompareContainer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.authComparePanel {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
}

.authComparePanelHeader {
  padding: 12px 16px;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.authCompareDiff--added  { background: rgba(34, 197, 94, 0.08); }
.authCompareDiff--removed { background: rgba(239, 68, 68, 0.08); }

/* ─── ACL Editor ───────────────────────────────────────────── */
.authAclEditor {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
}

.authAclEditorHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
}

.authAclRow {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
  gap: 12px;
}

.authAclRow:last-child { border-bottom: none; }

.authAclOps {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  flex: 1;
}

/* ─── Date Range Inputs ────────────────────────────────────── */
.authDateInput {
  padding: 8px 12px;
  background: var(--bg-primary);
  border: 1.5px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 0.88rem;
}

.authDateInput:focus {
  outline: none;
  border-color: var(--accent);
}

/* ─── Relative Timestamps ──────────────────────────────────── */
.authTimestamp {
  font-size: 0.84rem;
  color: var(--text-secondary);
  cursor: help;
}

/* ─── Resolution Summary ──────────────────────────────────── */
.authResolutionSummary {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.authResolutionCard {
  padding: 16px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

.authResolutionCard h5 {
  font-size: 0.76rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  margin: 0 0 10px 0;
}

/* ─── Inline action links ──────────────────────────────────── */
.authActionLink {
  color: var(--accent);
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 500;
  transition: opacity 0.15s;
  border: none;
  background: none;
  padding: 0;
}

.authActionLink:hover { opacity: 0.8; text-decoration: underline; }
.authActionLink--danger { color: #f87171; }
.light-theme .authActionLink--danger { color: #dc2626; }

/* ─── Icon Buttons ─────────────────────────────────────────── */
.authIconBtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  font-size: 0.9rem;
}

.authIconBtn:hover {
  background: var(--hover);
  color: var(--text-primary);
  border-color: var(--accent);
}

.authIconBtn--danger:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.3);
}

/* ─── User Chip ────────────────────────────────────────────── */
.authUserChip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.authUserAvatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
}

.authUserName {
  font-weight: 500;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.authUserEmail {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

/* ─── Section Header ───────────────────────────────────────── */
.authSectionHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.authSectionTitle {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* ─── Modal Extensions ─────────────────────────────────────── */
.modalDialog--wide    { max-width: 800px; }
.modalDialog--extraWide { max-width: 1000px; }

/* ─── Checkbox in tables ───────────────────────────────────── */
.authCheckbox {
  width: 17px;
  height: 17px;
  cursor: pointer;
  accent-color: var(--accent);
}

/* ─── Pagination ───────────────────────────────────────────── */
.authPagination {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

/* ─── Resizable Split View ─────────────────────────────────── */
.authSplitView {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  position: relative;
}

.authSplitPane {
  overflow-y: auto;
  max-height: 640px;
  min-width: 0;
}

.authSplitPane--left {
  border-right: 1px solid var(--border-color);
  padding-right: 12px;
}

.authSplitPane--right {
  padding-left: 12px;
}

.authResizeHandle {
  position: absolute;
  top: 0;
  width: 6px;
  height: 100%;
  cursor: col-resize;
  z-index: 10;
  background: transparent;
  transition: background 0.15s;
  /* Centered on the border between panes */
  left: calc(50% - 3px);
}

.authResizeHandle:hover,
.authResizeHandle.dragging {
  background: var(--accent);
  opacity: 0.6;
  border-radius: 3px;
}

/* Resizable scrollable areas */
.authScrollable {
  max-height: 600px;
  overflow-y: auto;
  resize: vertical;
  min-height: 150px;
  padding-bottom: 4px;
}

.authScrollable::-webkit-resizer {
  background: var(--border-color);
  border-radius: 2px;
}

/* ─── Responsive ───────────────────────────────────────────── */
@media (max-width: 900px) {
  .authSplitView {
    grid-template-columns: 1fr;
  }

  .authSplitPane--left {
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    padding-right: 0;
    padding-bottom: 12px;
    max-height: 300px;
  }

  .authSplitPane--right {
    padding-left: 0;
    padding-top: 12px;
  }

  .authResizeHandle { display: none; }

  .authCompareContainer { grid-template-columns: 1fr; }

  .authPermRow { flex-direction: column; }
  .authPermArea { min-width: auto; }
}

/* ─── Light theme table hover ──────────────────────────────── */
.light-theme .authTable tr:hover td {
  background: rgba(37, 99, 235, 0.04);
}
