/* ============================================================
   吕巷产业扶持ERP - 全局样式（与现有 ERP 界面一致）
   布局：左侧深蓝导航 + 右侧内容区
   ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", -apple-system, sans-serif;
  font-size: 14px;
  color: #1f2937;
  background: #f4f6f9;
  overflow: hidden;
}

/* ---------- 整体布局 ---------- */
.app { display: flex; height: 100vh; }
.sidebar {
  width: 224px; min-width: 224px; background: #0f3d63; color: #c9d6e3;
  display: flex; flex-direction: column; flex-shrink: 0;
}
.brand {
  padding: 10px 16px; height: 64px; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; color: #fff; font-size: 16px; font-weight: 700;
  border-bottom: 1px solid rgba(255,255,255,.10); letter-spacing: .5px; line-height: 1.2;
}
.brand small { display: block; font-size: 11px; font-weight: 400; color: #94a3b8; margin-top: 3px; letter-spacing: 0; }
.nav { flex: 1; padding: 12px 0; overflow-y: auto; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 10px 16px;
  color: #c9d6e3; text-decoration: none; font-size: 14px; border-left: 3px solid transparent;
  transition: background .15s, color .15s;
}
.nav a:hover { background: rgba(20,85,140,.55); color: #fff; }
.nav a.active { background: #14558c; color: #fff; border-left-color: #3b82c4; font-weight: 500; }
.nav .ico { width: 18px; text-align: center; font-size: 15px; }
.foot { padding: 12px 16px; font-size: 11px; color: #8aa3b8; border-top: 1px solid rgba(255,255,255,.10); }

.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.topbar {
  height: 56px; background: #fff; border-bottom: 1px solid #e5e7eb;
  display: flex; align-items: center; justify-content: flex-end; padding: 0 20px; gap: 12px; flex-shrink: 0;
}
.topbar .user { font-size: 13px; color: #374151; }
.topbar .role { font-size: 12px; color: #6b7280; }
.topbar .logout, .topbar .account {
  background: #fff; border: 1px solid #d3dae3; border-radius: 8px; padding: 7px 14px;
  font-family: inherit; font-size: 12px; color: #3f4a57; cursor: pointer;
  transition: background .18s, border-color .18s, color .18s;
}
.topbar .logout:hover, .topbar .account:hover { background: #f6f8fb; border-color: #bcc6d2; color: #1f2937; }
.content { flex: 1; overflow-y: auto; padding: 20px; }

/* ---------- 标题 ---------- */
.page-title { font-size: 20px; font-weight: 700; color: #111827; }
.page-desc { font-size: 13px; color: #6b7280; margin-top: 4px; margin-bottom: 16px; }

/* ---------- 卡片 ---------- */
.card { background: #fff; border-radius: 8px; box-shadow: 0 2px 12px rgba(0,0,0,.03); margin-bottom: 16px; border: 1px solid #dce2e8; }
.card .card-body { padding: 16px; }

/* ---------- 工具栏 ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar .grow { flex: 1; }
.toolbar .label { font-size: 12px; color: #6b7280; white-space: nowrap; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 15px; border: 1px solid transparent; border-radius: 8px;
  font-family: inherit; font-size: 13px; font-weight: 500; line-height: 1;
  white-space: nowrap; cursor: pointer; background: #f1f3f6; color: #374151;
  transition: background .18s ease, color .18s ease, border-color .18s ease, box-shadow .18s ease, transform .06s ease;
  user-select: none;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid rgba(35,98,149,.35); outline-offset: 2px; }
.btn-primary { background: #236295; color: #fff; box-shadow: 0 2px 6px rgba(35,98,149,.28); }
.btn-primary:hover { background: #1b4f76; box-shadow: 0 3px 10px rgba(35,98,149,.34); }
.btn-outline { background: #fff; border-color: #d3dae3; color: #3f4a57; }
.btn-outline:hover { background: #f6f8fb; border-color: #bcc6d2; color: #1f2937; }
.btn-ghost { background: #eff4fb; border-color: #dce7f4; color: #1f5f95; }
.btn-ghost:hover { background: #e2ecf9; border-color: #c9dcf1; color: #174e7d; }
.btn-red-ghost { background: #fdf0f0; border-color: #f7dada; color: #c62b2b; }
.btn-red-ghost:hover { background: #fbe2e2; border-color: #f2c4c4; color: #a91f1f; }
.btn-danger { background: #dc2626; color: #fff; box-shadow: 0 2px 6px rgba(220,38,38,.25); }
.btn-danger:hover { background: #b91c1c; box-shadow: 0 3px 10px rgba(220,38,38,.3); }
.btn-green { background: #2e9e5b; color: #fff; box-shadow: 0 2px 6px rgba(46,158,91,.25); }
.btn-green:hover { background: #25824b; box-shadow: 0 3px 10px rgba(46,158,91,.3); }
.btn-sm { height: 28px; padding: 0 11px; font-size: 12px; border-radius: 6px; }
.btn:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; transform: none; }
/* 表格行内操作按钮之间留白，避免挤成一串文字 */
.list td .btn { margin: 2px 6px 2px 0; }
.list td:last-child { white-space: nowrap; }
/* 表格里的“配置选项”类文字操作，做成轻量按钮 */
.list a[data-opts], .list a[style*="color:#236295"] {
  display: inline-flex; align-items: center; height: 26px; padding: 0 9px;
  border-radius: 6px; background: #eff4fb; border: 1px solid #dce7f4;
  color: #1f5f95 !important; text-decoration: none !important; font-size: 12px;
  transition: background .18s, border-color .18s;
}
.list a[data-opts]:hover, .list a[style*="color:#236295"]:hover { background: #e2ecf9; border-color: #c9dcf1; }

/* ---------- 输入 ---------- */
.input, select.input, textarea.input {
  border: 1px solid #d1d5db; border-radius: 6px; padding: 7px 10px; font-size: 13px;
  outline: none; background: #fff; color: #111827; font-family: inherit;
  box-sizing: border-box; max-width: 100%; min-width: 0;
}
.input:focus { border-color: #236295; box-shadow: 0 0 0 2px rgba(35,98,149,.15); }
.input[type=date] { padding: 6px 8px; }
.input.w36 { width: 150px; }
.input.w64 { width: 260px; }
.input::placeholder { color: #9ca3af; }
select.input { padding: 6px 8px; }

/* 密码可见切换 */
.pwd-wrap { position: relative; display: block; min-width: 0; }
.pwd-wrap .input { width: 100%; padding-right: 42px; }
.pwd-eye {
  position: absolute; right: 5px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 6px; background: transparent; color: #9ca3af;
  cursor: pointer; padding: 0; line-height: 1;
}
.pwd-eye:hover { color: #236295; background: #f1f5f9; }
.pwd-eye:focus-visible { outline: 2px solid rgba(35,98,149,.35); outline-offset: 1px; }
.pwd-eye.on { color: #236295; }
.pwd-eye svg { width: 18px; height: 18px; display: block; }

/* ---------- 表格 ---------- */
.table-wrap { overflow: auto; max-height: 640px; border-radius: 8px; }
table.list { width: 100%; border-collapse: collapse; background: #fff; }
table.list thead th {
  position: sticky; top: 0; background: #f8fafc; color: #475569; font-weight: 600;
  font-size: 12px; text-align: left; padding: 10px 12px; border-bottom: 1px solid #e2e8f0;
  white-space: nowrap; z-index: 1;
}
table.list tbody td { padding: 10px 12px; border-bottom: 1px solid #f1f5f9; font-size: 13px; white-space: nowrap; }
table.list tbody tr:hover { background: #f8fafc; }
table.list .num { color: #6b7280; }
table.list .empty { text-align: center; color: #9ca3af; padding: 32px 0 !important; }

/* ---------- 徽章 ---------- */
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px;
  border: 1px solid transparent; white-space: nowrap;
}
.bg-blue-50 { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.bg-green-50 { background: #f0fdf4; color: #15803d; border-color: #bbf7d0; }
.bg-red-50 { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.bg-amber-50 { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.bg-orange-50 { background: #fff7ed; color: #c2410c; border-color: #fed7aa; }
.bg-indigo-50 { background: #eef2ff; color: #4338ca; border-color: #c7d2fe; }
.bg-gray-100 { background: #f3f4f6; color: #4b5563; }
.bg-purple-50 { background: #faf5ff; color: #7e22ce; border-color: #e9d5ff; }
.bg-teal-50 { background: #f0fdfa; color: #0f766e; border-color: #99f6e4; }
.bg-rose-50 { background: #fff1f2; color: #be123c; border-color: #fecdd3; }
.bg-sky-50 { background: #f0f9ff; color: #0369a1; border-color: #bae6fd; }
.bg-lime-50 { background: #f7fee7; color: #4d7c0f; border-color: #d9f99d; }
.bg-fuchsia-50 { background: #fdf4ff; color: #a21caf; border-color: #f5d0fe; }
.bg-cyan-50 { background: #ecfeff; color: #0e7490; border-color: #a5f3fc; }
.bg-yellow-50 { background: #fefce8; color: #a16207; border-color: #fef08a; }
.bg-emerald-50 { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.bg-violet-50 { background: #f5f3ff; color: #6d28d9; border-color: #ddd6fe; }

/* ---------- 分页 ---------- */
.pager { display: flex; align-items: center; gap: 8px; padding: 12px 16px; font-size: 12px; color: #6b7280; flex-wrap: wrap; }
.pager .pages { display: flex; gap: 4px; }
.pager button {
  border: 1px solid #d1d5db; background: #fff; border-radius: 6px; padding: 4px 10px;
  font-size: 12px; cursor: pointer; color: #374151;
}
.pager button.active { background: #236295; color: #fff; border-color: #236295; }
.pager button:disabled { opacity: .4; cursor: not-allowed; }
.pager select { border: 1px solid #d1d5db; border-radius: 6px; padding: 3px 6px; font-size: 12px; }

/* ---------- 统计卡（工作台） ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; margin-bottom: 20px; }
@media (max-width: 1100px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
.stat-card { background: #fff; border-radius: 8px; padding: 18px; box-shadow: 0 2px 12px rgba(0,0,0,.03); border: 1px solid #dce2e8; display: flex; justify-content: space-between; align-items: flex-start; }
.stat-card .v { font-size: 26px; font-weight: 700; margin-top: 6px; }
.stat-card .l { font-size: 13px; color: #6b7280; }
.stat-card .ico { width: 34px; height: 34px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 16px; }
.dash-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .dash-cols { grid-template-columns: 1fr; } }
.quick-list { display: flex; flex-direction: column; gap: 10px; }
.quick-list a {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 8px;
  background: #fff; border: 1px solid #e5e7eb; color: #374151; text-decoration: none; font-size: 14px;
}
.quick-list a:hover { border-color: #236295; color: #236295; }
.quick-list a.primary { background: #236295; border-color: #236295; color: #fff; }
.quick-list a .qi { font-size: 15px; width: 20px; text-align: center; }
.todo-list { display: flex; flex-direction: column; }
.todo-item { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid #f0f2f5; }
.todo-item:last-child { border-bottom: none; }
.todo-item .t-name { font-size: 14px; font-weight: 500; color: #1f2937; }
.todo-item .t-sub { font-size: 12px; color: #9ca3af; margin-top: 3px; }
.todo-item .t-go { font-size: 13px; color: #236295; text-decoration: none; white-space: nowrap; }
.todo-item .t-go:hover { text-decoration: underline; }
.quick-links { display: flex; gap: 12px; flex-wrap: wrap; }
.quick-links a {
  display: inline-block; background: #fff; border: 1px solid #e5e7eb; border-radius: 8px;
  padding: 12px 18px; color: #374151; text-decoration: none; font-size: 13px;
}
.quick-links a:hover { border-color: #236295; color: #236295; }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 100;
  display: flex; align-items: center; justify-content: center;
}
.modal {
  background: #fff; border-radius: 10px; width: 480px; max-width: 92vw; max-height: 85vh;
  display: flex; flex-direction: column; box-shadow: 0 20px 50px rgba(0,0,0,.2);
  min-width: 0;
}
.modal.w600 { width: 620px; }
.modal .modal-h { padding: 16px 20px; font-size: 15px; font-weight: 700; border-bottom: 1px solid #e5e7eb; display: flex; align-items: center; gap: 8px; }
.modal .modal-b { padding: 18px 20px; overflow-y: auto; overflow-x: hidden; min-width: 0; overflow-wrap: anywhere; }
.modal .modal-f { padding: 14px 20px; border-top: 1px solid #e5e7eb; display: flex; justify-content: flex-end; gap: 10px; }

/* ---------- 表单 ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 20px; min-width: 0; }
.form-item { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.form-item.full { grid-column: 1 / -1; }
.form-item label { font-size: 13px; color: #374151; }
.form-item label .req { color: #dc2626; margin-left: 2px; }
.form-item .hint { font-size: 12px; color: #9ca3af; }
.section-title { font-size: 14px; font-weight: 700; color: #111827; margin: 18px 0 10px; padding-left: 10px; border-left: 3px solid #2563eb; }

/* ---------- 上传 ---------- */
.upload-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid #e5e7eb; border-radius: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.upload-item .fn { font-size: 12px; color: #6b7280; flex: 1; min-width: 100px; word-break: break-all; }
.upload-item input[type=file] { display: none; }
.upload-item .up-btn { font-size: 12px; }
.file-list { display: flex; flex-wrap: wrap; gap: 6px; }
.file-chip { display: inline-flex; align-items: center; gap: 4px; background: #f1f5f9; border-radius: 6px; padding: 3px 8px; font-size: 12px; }
.file-chip a { color: #2563eb; text-decoration: none; }
.file-chip .rm { color: #dc2626; cursor: pointer; }

/* ---------- Toast ---------- */
#toast-wrap { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: #111827; color: #fff; padding: 10px 18px; border-radius: 8px; font-size: 13px; box-shadow: 0 4px 12px rgba(0,0,0,.2); animation: fadeIn .2s; max-width: 80vw; }
.toast.ok { background: #16a34a; }
.toast.err { background: #dc2626; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; } }

/* ---------- 详情展示 ---------- */
.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 20px; }
.detail-item .k { font-size: 12px; color: #6b7280; margin-bottom: 3px; }
.detail-item .v { font-size: 14px; color: #111827; word-break: break-all; }
.detail-item.full { grid-column: 1 / -1; }

/* ---------- 驳回原因框 ---------- */
.reject-box { background: #fef2f2; border: 1px solid #fecaca; border-radius: 8px; padding: 12px; font-size: 13px; }
.reject-box .t { color: #b91c1c; font-weight: 600; margin-bottom: 4px; }
.reject-box .r { color: #6b7280; }

/* ---------- 系统管理 Tab ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid #e5e7eb; margin-bottom: 16px; flex-wrap: wrap; }
.tab {
  padding: 9px 16px; font-size: 13px; cursor: pointer; color: #6b7280;
  border-bottom: 2px solid transparent; background: none; border-top: none; border-left: none; border-right: none;
}
.tab.active { color: #2563eb; border-bottom-color: #2563eb; font-weight: 600; }
.tab-body { display: none; }
.tab-body.active { display: block; }

/* ---------- 路径选择 ---------- */
.path-dialog .dir-list { max-height: 320px; overflow-y: auto; overflow-x: hidden; border: 1px solid #e5e7eb; border-radius: 8px; }
.path-dialog .dir-row { display: flex; align-items: center; gap: 8px; padding: 8px 12px; cursor: pointer; border-bottom: 1px solid #f1f5f9; font-size: 13px; min-width: 0; }
.path-dialog .dir-row > * { min-width: 0; overflow-wrap: anywhere; word-break: break-all; }
.path-dialog .dir-row:hover { background: #f8fafc; }
.path-dialog .cur-path { font-size: 12px; color: #6b7280; margin-bottom: 8px; word-break: break-all; }
.path-dialog .free { font-size: 12px; color: #16a34a; margin-left: auto; }

/* ---------- 其他 ---------- */
.muted { color: #6b7280; }
.text-red { color: #dc2626; }
.text-green { color: #16a34a; }
.text-blue { color: #2563eb; }
.text-right { text-align: right; }
.flex { display: flex; align-items: center; gap: 8px; }
.flex-1 { flex: 1; }
.mt8 { margin-top: 8px; }
.mt16 { margin-top: 16px; }
.mb8 { margin-bottom: 8px; }
.mb16 { margin-bottom: 16px; }
.hidden { display: none; }
/* 角色权限：左侧角色列表 + 右侧权限矩阵 */
.role-layout { display: flex; gap: 14px; align-items: flex-start; }
.role-nav { width: 150px; flex: 0 0 150px; display: flex; flex-direction: column; gap: 6px; }
.role-nav-item { padding: 9px 12px; text-align: left; border: 1px solid #e5e7eb; border-radius: 6px; background: #fff; font-size: 13px; color: #374151; cursor: pointer; transition: border-color .15s, color .15s; }
.role-nav-item:hover { border-color: #236295; color: #236295; }
.role-nav-item.active { background: #236295; border-color: #236295; color: #fff; font-weight: 600; }
.role-panel { flex: 1; min-width: 0; border: 1px solid #e5e7eb; border-radius: 8px; padding: 12px; background: #fff; }
.role-panel-head { display: flex; align-items: center; gap: 18px; padding-bottom: 10px; margin-bottom: 10px; border-bottom: 1px solid #e5e7eb; }
.role-panel-name { font-weight: 600; font-size: 14px; margin-right: auto; }
.perm-act { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: #6b7280; white-space: nowrap; }
.perm-act input:disabled { opacity: .45; }
.perm-matrix th, .perm-matrix td { text-align: center; }
.perm-matrix th:first-child, .perm-matrix td:first-child { text-align: left; }
.perm-mod { white-space: nowrap; font-weight: 500; }
.perm-matrix input:disabled { opacity: .45; }
.perm-na { color: #d1d5db; }
@media (max-width: 760px) {
  .role-layout { flex-direction: column; }
  .role-nav { width: 100%; flex: none; flex-direction: row; flex-wrap: wrap; }
}

/* ---------- 窄屏（手机 / 窄窗口）---------- */
.pager .pg-gap { padding: 0 2px; color: #9ca3af; align-self: center; }
@media (max-width: 900px) {
  .app { flex-direction: column; height: 100vh; min-height: 0; }
  .sidebar { width: 100%; min-width: 0; flex: 0 0 auto; max-height: none; }
  .brand {
    height: 44px; padding: 5px 12px; flex-direction: row; align-items: center; gap: 8px;
    font-size: 14px; letter-spacing: 0;
  }
  .brand small { display: none; }
  .nav {
    flex: 0 0 auto; display: flex; overflow-x: auto; overflow-y: hidden;
    padding: 3px 8px; gap: 2px; border-bottom: 1px solid rgba(255,255,255,.12);
    scrollbar-width: thin;
  }
  .nav a {
    flex: 0 0 auto; padding: 8px 10px; border-left: 0; border-bottom: 2px solid transparent;
    border-radius: 0; font-size: 12px; white-space: nowrap;
  }
  .nav a.active { background: transparent; border-left-color: transparent; border-bottom-color: #7dd3fc; color: #fff; }
  .nav .ico { width: 15px; font-size: 13px; }
  .foot { display: none; }

  .main { min-height: 0; }
  .topbar { height: 44px; padding: 0 10px; gap: 6px; flex-wrap: nowrap; overflow: hidden; }
  .topbar .user { font-size: 12px; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar .role { display: none; }
  .topbar .logout, .topbar .account { padding: 5px 8px; font-size: 11px; border-radius: 6px; }
  .content { padding: 10px; overflow-y: auto; overflow-x: hidden; }
  .page-title { font-size: 17px; }
  .page-desc { font-size: 12px; margin-bottom: 10px; line-height: 1.6; }

  .card { margin-bottom: 10px; }
  .card .card-body { padding: 10px; }
  .section-title { font-size: 13px; margin: 12px 0 8px; padding-left: 8px; }

  .toolbar { gap: 6px; align-items: stretch !important; }
  .toolbar .grow { display: none; }
  .toolbar .label { width: 100%; }
  .toolbar .input, .toolbar select.input, .toolbar input.input {
    width: 100% !important; min-width: 0 !important; max-width: 100% !important;
  }
  .toolbar .btn { flex: 1 1 auto; }
  .toolbar > .muted { display: none; }

  .stat-grid { grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
  .stat-card { padding: 10px; gap: 5px; }
  .stat-card .v { font-size: 18px; margin-top: 2px; }
  .stat-card .l { font-size: 11px; line-height: 1.35; }
  .stat-card .ico { width: 26px; height: 26px; font-size: 13px; }

  .form-grid, .detail-grid { grid-template-columns: 1fr; gap: 10px; }
  .form-item.full, .detail-item.full { grid-column: 1; }
  .form-item label { font-size: 12px; }
  .input, select.input, textarea.input { font-size: 13px; width: 100%; }

  .table-wrap { max-height: none; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table.list { min-width: 760px; }
  table.list thead th, table.list tbody td { padding: 8px; }
  table.list td:last-child { white-space: normal; min-width: 128px; }
  .list td .btn { margin: 2px 4px 2px 0; }

  .pager { padding: 8px; gap: 4px; }
  .pager button { padding: 4px 8px; }
  .pager select { font-size: 11px; }

  .tabs {
    flex-wrap: nowrap; overflow-x: auto; border: 1px solid #e5e7eb; border-radius: 8px;
    background: #fff; padding: 3px; margin-bottom: 10px; gap: 2px;
  }
  .tab { flex: 0 0 auto; padding: 7px 10px; font-size: 12px; white-space: nowrap; border-radius: 6px; }
  .tab.active { background: #eff4fb; border-bottom-color: transparent; }

  .role-layout { flex-direction: column; gap: 8px; }
  .role-nav { width: 100%; flex: none; flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .role-nav-item { flex: 1 1 92px; text-align: center; padding: 7px 6px; font-size: 12px; }
  .role-panel { width: 100%; padding: 8px; overflow-x: auto; }
  .role-panel-head { flex-wrap: wrap; gap: 8px; }
  .perm-matrix { min-width: 560px; }
  .perm-act { font-size: 11px; }

  .modal { width: calc(100vw - 20px); max-height: calc(100vh - 20px); border-radius: 8px; }
  .modal .modal-h { padding: 12px 14px; font-size: 14px; }
  .modal .modal-b { padding: 12px 14px; }
  .modal .modal-f { padding: 10px 14px; flex-wrap: wrap; gap: 6px; }
  .modal .modal-f .btn { flex: 1 1 auto; }

  .upload-item { flex-direction: column; align-items: flex-start; gap: 5px; }
  .upload-item > span { min-width: 0 !important; }
  .file-list { width: 100%; }
  .file-chip { max-width: 100%; overflow-wrap: anywhere; }
}
