/* ==========================================================================
   亚马逊大健优化 — 管理后台样式
   简洁 / 专业 / ERP 风格。深灰导航 + 浅灰内容 + 蓝色主操作。
   ========================================================================== */

:root {
  --sidebar-w: 248px;
  --sb-bg: linear-gradient(180deg, #061a32 0%, #071c37 42%, #081a31 100%);
  --sb-text: rgba(235, 245, 255, 0.92);
  --sb-muted: rgba(145, 175, 205, 0.72);
  --sb-sub: rgba(194, 220, 240, 0.82);
  --sb-icon: rgba(120, 200, 240, 0.85);
  --sb-accent: #22e9f0;
  --sb-border: rgba(50, 140, 255, 0.20);
  --sb-active-grad: linear-gradient(95deg, #1759df 0%, #147ef2 55%, #08b7ee 100%);

  --topbar-h: 0px;

  --content-bg: #f5f7fa;
  --card-border: #e5e7eb;
  --card-bg: #ffffff;

  --text-main: #111827;
  --text-strong: #111827;
  --text-muted: #6b7280;
  --text-faint: #9ca3af;

  --table-head-bg: #f9fafb;
  --table-row-border: #f1f5f9;

  --primary: #0d6efd;
  --success: #16a34a;
  --danger: #dc2626;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--content-bg);
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei",
    "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  font-size: 0.9375rem;
}

/* ------------------------------------------------------------------------ */
/* 布局外壳：左侧固定导航 + 右侧主区                                        */
/* ------------------------------------------------------------------------ */
.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: var(--sb-bg);
  color: var(--sb-text);
  display: flex;
  flex-direction: column;
  z-index: 100;
  border-right: 1px solid var(--sb-border);
  box-shadow: inset -1px 0 0 rgba(57, 168, 255, 0.18);
  overflow: hidden;
}

/* 底部科技装饰：CSS-only 低透明蓝弧光晕（最底层，不拦截交互、不影响滚动） */
.sidebar::before {
  content: "";
  position: absolute;
  left: -20%;
  right: -20%;
  bottom: -70px;
  height: 230px;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(60% 85% at 50% 100%, rgba(24, 118, 226, 0.22) 0%, rgba(24, 118, 226, 0) 72%),
    radial-gradient(42% 62% at 80% 100%, rgba(24, 234, 240, 0.16) 0%, rgba(24, 234, 240, 0) 70%);
  opacity: 0.6;
}

.main {
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ------------------------------------------------------------------------ */
/* 左侧导航                                                                  */
/* ------------------------------------------------------------------------ */
.sidebar-brand {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 22px 16px 18px;
}

.sidebar-brand .brand-logo {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(42, 111, 175, 0.16);
  border: 1px solid rgba(68, 158, 222, 0.22);
  box-shadow: 0 0 16px rgba(25, 125, 255, 0.14), inset 0 0 10px rgba(24, 234, 240, 0.06);
}

.sidebar-brand .brand-logo svg {
  width: 30px;
  height: 30px;
}

.sidebar-brand .brand-name {
  color: #ffffff;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.2px;
  text-align: center;
  line-height: 1.3;
  white-space: nowrap;
}

.sidebar-brand .brand-sub {
  color: rgba(150, 200, 235, 0.72);
  font-size: 10.5px;
  letter-spacing: 1px;
  text-align: center;
}

.sidebar-brand .brand-divider {
  width: 64px;
  height: 2px;
  margin-top: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg,
    rgba(24, 234, 240, 0) 0%,
    rgba(24, 234, 240, 0.95) 35%,
    rgba(50, 140, 255, 0.65) 65%,
    rgba(24, 234, 240, 0) 100%);
  box-shadow: 0 0 8px rgba(24, 234, 240, 0.32);
}

.sidebar-nav {
  position: relative;
  z-index: 1;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 14px 14px 16px;
}

.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(82, 160, 220, 0.18); border-radius: 4px; }
.sidebar-nav:hover::-webkit-scrollbar-thumb { background: rgba(82, 160, 220, 0.32); }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }

.nav-group {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 6px;
  padding: 18px 4px 7px;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--sb-muted);
}

/* 分组标题左侧科技小条（3px 高亮竖条，纯 CSS，不影响 HTML 文本） */
.nav-group:not(.nav-group-toggle)::before {
  content: "";
  flex: 0 0 auto;
  width: 3px;
  height: 12px;
  border-radius: 2px;
  background: linear-gradient(180deg, #22e9f0 0%, #1483e8 100%);
  box-shadow: 0 0 6px rgba(34, 233, 240, 0.5);
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  margin: 0 2px 4px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 14px;
  color: var(--sb-text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.nav-item:hover {
  background: linear-gradient(90deg, rgba(35, 112, 255, 0.10), rgba(21, 181, 255, 0.06));
  border-color: rgba(56, 164, 255, 0.16);
  box-shadow: 0 0 14px rgba(25, 125, 255, 0.07);
  color: #ffffff;
  text-decoration: none;
}

.nav-item.active {
  background: var(--sb-active-grad);
  color: #ffffff;
  font-weight: 650;
  border-color: transparent;
  border-radius: 15px;
  box-shadow: 0 8px 24px rgba(17, 102, 230, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

/* Active 左侧青色发光竖条（仅一级菜单，不作用于子项） */
.sidebar-nav > .nav-item.active::before {
  content: "";
  position: absolute;
  left: -9px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 28px;
  border-radius: 3px;
  background: var(--sb-accent);
  box-shadow: 0 0 10px rgba(34, 233, 240, 0.72);
}

/* 图标小容器：统一线框科技图标 */
.nav-icon {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(42, 111, 175, 0.10);
  border: 1px solid rgba(68, 158, 222, 0.12);
  color: var(--sb-icon);
}

.nav-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-item.active .nav-icon {
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(255, 255, 255, 0.14);
  color: #cbfaff;
}

.nav-label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 高级分析 / 导入：独立圆角科技功能框 */
.nav-frame {
  margin: 14px 2px 10px;
  padding: 5px;
  border-radius: 12px;
  background: rgba(12, 43, 76, 0.48);
  border: 1px solid rgba(61, 137, 204, 0.15);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
  transition: border-color 0.16s ease, background 0.16s ease;
}

.nav-frame:hover {
  border-color: rgba(55, 169, 255, 0.30);
  background: rgba(16, 57, 100, 0.60);
}

/* 折叠分组标题（高级分析 / 导入 均用 nav-group-toggle，可独立展开） */
.nav-group-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  margin: 0;
  padding: 0 10px;
  border-radius: 9px;
  font-size: 14px;
  letter-spacing: 0;
  color: var(--sb-text);
  cursor: pointer;
  user-select: none;
  transition: color 0.16s ease, background 0.16s ease;
}

.nav-group-toggle:hover {
  background: rgba(255, 255, 255, 0.03);
}

.nav-group-toggle .nav-label {
  flex: 1 1 auto;
}

.nav-group-toggle[aria-expanded="true"] {
  color: #eaf4ff;
}

.nav-chevron {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  color: var(--sb-muted);
}

.nav-chevron svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.16s ease;
}

.nav-group-toggle[aria-expanded="true"] .nav-chevron svg {
  transform: rotate(90deg);
}

.nav-advanced-body,
.nav-import-body {
  padding: 4px 4px 6px;
}

.nav-subgroup-label {
  padding: 10px 12px 4px 26px;
  font-size: 10.5px;
  color: var(--sb-muted);
  letter-spacing: 0.04em;
}

.nav-advanced-body .nav-item,
.nav-import-body .nav-item {
  min-height: 40px;
  margin: 0 0 2px;
  padding: 0 12px 0 26px;
  font-size: 13px;
  font-weight: 500;
  color: var(--sb-sub);
  border-radius: 9px;
  gap: 0;
  white-space: normal;
}

.nav-advanced-body .nav-item:hover,
.nav-import-body .nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: transparent;
  box-shadow: none;
  color: #d8ecff;
}

.nav-advanced-body .nav-item.active,
.nav-import-body .nav-item.active {
  background: rgba(28, 118, 226, 0.14);
  color: #8edbff;
  font-weight: 600;
  box-shadow: inset 2px 0 0 rgba(34, 233, 240, 0.8);
}

/* 键盘焦点可见（Accessibility） */
.nav-item:focus-visible,
.nav-group-toggle:focus-visible {
  outline: 1px solid rgba(58, 178, 255, 0.65);
  outline-offset: 1px;
}

/* 侧栏底部：仅版本号（真实来源），不伪造系统状态 */
.sidebar-footer {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 10px 18px 12px;
  font-size: 11px;
  color: rgba(145, 175, 205, 0.5);
}

.sidebar-footer-version {
  color: rgba(145, 175, 205, 0.5);
  letter-spacing: 0.04em;
}

.sidebar-footer-link {
  margin-right: auto;
  color: rgba(145, 175, 205, 0.8);
  text-decoration: none;
  font-size: 11px;
}

.sidebar-footer-link:hover {
  color: #1677ff;
}

/* ------------------------------------------------------------------------ */
/* 顶部状态栏                                                                */
/* ------------------------------------------------------------------------ */
.topbar {
  position: sticky;
  top: 0;
  height: var(--topbar-h);
  background: var(--card-bg);
  border-bottom: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 50;
}

.topbar-breadcrumb {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-strong);
}

.topbar-breadcrumb .crumb-sep {
  color: var(--text-faint);
  font-weight: 400;
  margin: 0 6px;
}

.topbar-status {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  margin-right: 6px;
}

/* ------------------------------------------------------------------------ */
/* 主内容区                                                                  */
/* ------------------------------------------------------------------------ */
.content {
  flex: 1;
  padding: 20px 24px;
  width: 100%;
  max-width: 1560px;
}

/* ------------------------------------------------------------------------ */
/* 站点备案信息（ICP）                                                        */
/* ------------------------------------------------------------------------ */
.site-footer {
  flex: 0 0 auto;
  padding: 8px 24px 16px;
  text-align: center;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-faint);
}
.site-footer a {
  color: var(--text-faint);
  text-decoration: none;
}
.site-footer a:hover {
  color: var(--text-muted);
  text-decoration: underline;
}

/* ------------------------------------------------------------------------ */
/* 页面标题                                                                  */
/* ------------------------------------------------------------------------ */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.page-header h1 {
  font-size: 1.625rem;
  font-weight: 600;
  margin: 0;
  color: var(--text-strong);
}

.page-header .page-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ------------------------------------------------------------------------ */
/* 说明面板 / 快捷操作                                                        */
/* ------------------------------------------------------------------------ */
.page-hint {
  margin-bottom: 18px;
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* ------------------------------------------------------------------------ */
/* 统计卡片（首页总览）                                                       */
/* ------------------------------------------------------------------------ */
.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 14px 18px;
  height: 100%;
}

.stat-card .stat-label {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-bottom: 6px;
}

.stat-card .stat-value {
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.1;
  color: var(--text-strong);
  word-break: break-all;
}

.stat-card .stat-value.stat-text {
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.4;
}

/* ------------------------------------------------------------------------ */
/* 筛选面板                                                                  */
/* ------------------------------------------------------------------------ */
.filter-panel {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 16px;
}

.filter-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
}

.filter-form .filter-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 140px;
}

.filter-form .filter-item > .filter-label {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.filter-form .filter-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ------------------------------------------------------------------------ */
/* 数据表                                                                    */
/* ------------------------------------------------------------------------ */
.data-table {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  overflow: hidden;
}

.data-table .table {
  margin-bottom: 0;
}

.table thead th {
  background: var(--table-head-bg);
  color: #374151;
  font-weight: 600;
  font-size: 0.83rem;
  border-bottom: 1px solid var(--card-border);
  padding: 0.68rem 0.75rem;
  white-space: nowrap;
}

.table tbody td {
  padding: 0.62rem 0.75rem;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--table-row-border);
  vertical-align: middle;
}

.table tbody tr:last-child td {
  border-bottom: 0;
}

.table tbody tr:hover {
  background: #f8fafc;
}

.table-responsive {
  overflow-x: auto;
}

.table .nowrap {
  white-space: nowrap;
}

/* ------------------------------------------------------------------------ */
/* 空状态                                                                    */
/* ------------------------------------------------------------------------ */
.empty-state {
  text-align: center;
  padding: 52px 20px;
  color: var(--text-faint);
  background: var(--card-bg);
  border: 1px dashed var(--card-border);
  border-radius: 8px;
}

/* ------------------------------------------------------------------------ */
/* 分页                                                                      */
/* ------------------------------------------------------------------------ */
.pagination-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.pagination {
  margin-bottom: 0;
}

/* ------------------------------------------------------------------------ */
/* Alert 统一微调：错误红 / 成功绿                                            */
/* ------------------------------------------------------------------------ */
.alert {
  border-radius: 8px;
  border: none;
}

/* ------------------------------------------------------------------------ */
/* 批量导入：拖拽区 / 已选文件 / 批处理表格                                  */
/* ------------------------------------------------------------------------ */
.drop-zone {
  border: 2px dashed var(--card-border);
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  background: var(--table-head-bg);
  transition: border-color 0.12s ease, background 0.12s ease;
}

.drop-zone.dragover {
  border-color: var(--primary);
  background: #eff6ff;
}

.drop-zone-hint {
  color: var(--text-muted);
  margin-bottom: 8px;
}

.drop-zone-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 12px;
}

.selected-files {
  text-align: left;
  max-height: 180px;
  overflow-y: auto;
}

.selected-files-title {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.selected-file {
  font-size: 0.85rem;
  padding: 3px 6px;
  border-radius: 4px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  margin-bottom: 3px;
  word-break: break-all;
}

.batch-table td {
  vertical-align: middle;
}

.batch-filename {
  max-width: 220px;
  word-break: break-all;
}

.batch-row-unsupported_file,
.batch-row-duplicate {
  opacity: 0.6;
}

.batch-row-error {
  background: #fef2f2;
}

/* ------------------------------------------------------------------------ */
/* 响应式：较窄宽度时压缩侧栏                                                */
/* ------------------------------------------------------------------------ */
@media (max-width: 1100px) {
  :root { --sidebar-w: 220px; }
}

/* ------------------------------------------------------------------------ */
/* 骨架屏（重型研究页首屏占位）                                              */
/* ------------------------------------------------------------------------ */
.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--card-border);
  border-radius: 6px;
  min-height: 14px;
}
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
  animation: skeleton-shimmer 1.3s infinite;
}
@keyframes skeleton-shimmer {
  100% { transform: translateX(100%); }
}
.skeleton-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 14px 18px;
  height: 100%;
}
.skeleton-line { height: 14px; margin-bottom: 8px; }
.skeleton-line.w-40 { width: 40%; }
.skeleton-line.w-60 { width: 60%; }
.skeleton-line.w-80 { width: 80%; }
.skeleton-value { height: 30px; width: 60%; margin-top: 10px; }

/* ------------------------------------------------------------------------ */
/* 宽表通用组件（数据密集页）：独立横向滚动 + 吸顶表头 + 固定关键列           */
/*                                                                          */
/* 结构约定（服务端模板生成）：                                              */
/*   <div class="table-scroll-container">                                    */
/*     <div class="table-scroll-head">   <table>…<thead>…</thead></table>    */
/*     <div class="table-scroll-body">   <table>…<tbody>…</tbody></table>    */
/*                                                                          */
/* 两张表共享同一 <colgroup> 且 table-layout:fixed，列宽严格一致，头/体       */
/* 天然对齐；表头 viewport-sticky（top = 顶部导航高度），表体独立横向滚动；    */
/* 固定关键列的 left 偏移由 table-scroll.js 按列宽动态计算。                 */
/* ------------------------------------------------------------------------ */
.table-scroll-container {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 8px;
}

.table-scroll-head {
  position: sticky;
  top: var(--topbar-h);      /* 顶部导航真实高度，绝不被系统 Header 遮住 */
  z-index: 40;               /* 高于表体内容(sticky 列 z=2)，低于 topbar(z=50) */
  overflow-x: auto;          /* 方案B：表头自身带横向滚动条（顶部同步滚动条） */
  overflow-y: hidden;
  background: var(--table-head-bg);
  border-bottom: 1px solid var(--card-border);
  border-radius: 8px 8px 0 0;
}

.table-scroll-body {
  overflow: auto;            /* 表体独立横向滚动（纵向随页面滚动，无 max-height） */
  border-radius: 0 0 8px 8px;
}

.table-scroll-head table,
.table-scroll-body table {
  border-collapse: separate;
  border-spacing: 0;
  margin-bottom: 0;
  table-layout: fixed;       /* 固定布局：头/体列宽严格一致，永不错位 */
}

/* 表头/表体单元格：固定列宽下长文本省略 + 悬停 title 提示 */
.table-scroll-head th,
.table-scroll-body td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 固定关键列（sticky column）：不透明背景 + 右侧分隔线；left 由 JS 赋值 */
.table-scroll-head th.sticky-col,
.table-scroll-body td.sticky-col {
  position: sticky;
  z-index: 2;
  background: var(--card-bg);
  box-shadow: inset -1px 0 0 var(--card-border);
}

.table-scroll-head th.sticky-col {
  z-index: 4;                /* 表头固定列：既吸顶又吸左，层级最高 */
  background: var(--table-head-bg);
}

/* ------------------------------------------------------------------------ */
/* 宽表页全宽内容：去除 .content 的 max-width 限制，充分利用页面宽度           */
/* ------------------------------------------------------------------------ */
.page-fluid .content {
  max-width: none;
}

/* ------------------------------------------------------------------------ */
/* 账号权限管理：数据范围 / 权限模板卡片 + 权限目录网格                       */
/* ------------------------------------------------------------------------ */
.scope-row,
.profile-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.scope-card,
.profile-card {
  flex: 1 1 220px;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  background: var(--card-bg);
  cursor: pointer;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.scope-card:hover,
.profile-card:hover {
  border-color: var(--primary);
}

.scope-card input,
.profile-card input {
  margin-bottom: 2px;
}

.scope-card-title,
.profile-card-title {
  font-weight: 600;
  color: var(--text-strong);
}

.profile-card.selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
  background: #eff6ff;
}

.scope-card-desc,
.profile-card-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.store-list {
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 10px 14px;
  background: var(--table-head-bg);
}

.perm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.perm-group {
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--card-bg);
}

.perm-group-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  margin-bottom: 6px;
}

.perm-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
  font-size: 0.86rem;
}

.perm-item .form-check-input {
  flex: 0 0 auto;
  margin-top: 0;
}

.perm-item .perm-label {
  flex: 1 1 auto;
}

.perm-item .badge {
  flex: 0 0 auto;
  font-size: 0.66rem;
}
