/* 后台登录、用户/角色/权限管理（aa- 前缀，配色沿用 admin-shell.css 的 --ad-* 变量） */

html.aa-pending #modalBackendAdmin > .modal { visibility: hidden; }
#adminSide .aa-deny { display: none !important; }
html.aa-nomenu body.is-admin-page .admin-main > :not(header) { visibility: hidden; }

/* ---- 登录 ---- */
.aa-login {
  position: fixed; inset: 0; z-index: 9000; visibility: visible;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(1200px 600px at 20% 10%, #e8efff 0%, transparent 60%), linear-gradient(180deg, #f4f7fc 0%, #e9eef7 100%);
  font-family: var(--ad-font, system-ui, sans-serif);
}
.aa-login-card {
  width: 340px; padding: 32px 30px 28px; border-radius: 14px;
  background: var(--ad-card-bg, #fff); box-shadow: var(--ad-card-shadow, 0 10px 30px rgba(30, 45, 80, .15));
  display: flex; flex-direction: column; gap: 14px;
}
.aa-login-brand { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 6px; }
.aa-login-mark {
  width: 40px; height: 40px; border-radius: 50%; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  background: #e7f6ff; color: #1282b8;
}
.aa-login-mark svg { width: 22px; height: 22px; fill: currentColor; }
.aa-login-brand strong { font-size: 20px; color: var(--ad-ink-strong, #16203a); letter-spacing: .04em; }
.aa-login-err, .aa-modal-err { margin: 0; color: #d93838; font-size: 13px; text-align: center; }

/* ---- 表单 ---- */
.aa-field { display: flex; flex-direction: column; align-items: stretch; gap: 6px; font-size: 13px; color: var(--ad-ink-regular, #4b5567); }
.aa-login .aa-field > span { text-align: center; }
.aa-field > span em { color: #e5484d; font-style: normal; margin-left: 2px; }
.aa-field input:not([type=checkbox]) {
  height: 36px; padding: 0 12px; border: 1px solid var(--ad-line, #e1e7f0); border-radius: 8px;
  font: inherit; font-size: 14px; line-height: 36px; color: var(--ad-ink, #1d2433); background: #fff; text-align: center;
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.aa-login .aa-field input {
  text-align: center !important; line-height: 36px !important; height: 36px !important;
  background: #fff !important; color: #1d2433 !important; color-scheme: light !important;
  border: 1px solid #d3dcea !important;
}
.aa-field input:focus { border-color: var(--ad-primary, #2b67ff); box-shadow: 0 0 0 3px rgba(43, 103, 255, .14); }
.aa-field input[readonly] { background: var(--ad-line-soft, #edf1f7); color: var(--ad-ink-muted, #8a93a6); }

.aa-btn {
  height: 34px; padding: 0 16px; border: 1px solid var(--ad-line, #e1e7f0); border-radius: 8px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; line-height: 1; text-align: center;
  font: inherit; font-size: 14px; color: var(--ad-ink, #1d2433);
  background: var(--ad-btn-bg, #f6f8fc); box-shadow: var(--ad-btn-shadow, none);
}
.aa-btn--primary { border-color: transparent; color: #fff; background: var(--ad-primary-bg, #2b67ff); box-shadow: var(--ad-primary-shadow, none); }
.aa-btn--block { width: 100%; height: 40px; font-size: 15px; margin-top: 4px; }
.aa-btn:disabled { opacity: .6; cursor: default; }

/* ---- 标题行主按钮 ---- */
.aa-title-actions { display: flex; gap: 8px; margin-left: auto; }
.aa-title-actions:empty { display: none; }

/* ---- 我的密码 ---- */
.aa-mypass {
  display: flex; flex-direction: column; gap: 14px; width: min(100%, 440px); margin: 24px auto; padding: 24px 26px;
  background: var(--ad-card-bg, #fff); border: 1px solid #e1e8f3; border-radius: 12px; box-shadow: 0 12px 30px -16px rgba(23, 52, 120, .28);
}
.aa-mypass h3 { margin: 0; font-size: 16px; color: var(--ad-ink-strong, #16203a); }
.aa-mypass-who { margin: -6px 0 2px; font-size: 13px; color: var(--ad-ink-muted, #8a93a6); }
.aa-mypass-who b { color: var(--ad-ink, #1d2433); font-weight: 600; }
.aa-mypass .aa-field input:not([type=checkbox]) { height: 40px; }
.aa-mypass .aa-btn { height: 40px; margin-top: 4px; }

/* ---- 表格 ---- */
.aa-host { padding: 4px 0 16px; }
.aa-card { background: var(--ad-card-bg, #fff); box-shadow: var(--ad-card-shadow, none); border-radius: 12px; overflow: hidden; }
.aa-table { width: 100%; border-collapse: collapse; font-size: 13px; color: var(--ad-ink, #1d2433); }
.aa-table th, .aa-table td { padding: 11px 12px; text-align: center; vertical-align: middle; border-bottom: 1px solid var(--ad-line-soft, #edf1f7); }
.aa-table th { font-weight: 600; color: var(--ad-ink-regular, #4b5567); background: #f6f8fc; white-space: nowrap; }
.aa-table tbody tr:hover td { background: #f8faff; }
.aa-table .aa-num { font-family: var(--ad-mono, monospace); font-variant-numeric: tabular-nums; white-space: nowrap; }
.aa-table .aa-wrap { max-width: 320px; white-space: normal; }
.aa-empty { padding: 40px 0; text-align: center; color: var(--ad-ink-muted, #8a93a6); }

.aa-ops { display: inline-flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.aa-op {
  height: 26px; padding: 0 10px; border-radius: 6px; cursor: pointer; font: inherit; font-size: 12px;
  border: 1px solid #cfdcff; color: var(--ad-link, #2563eb); background: #f2f6ff;
}
.aa-op--ok { border-color: #bfe8cf; color: #16833f; background: #effaf3; }
.aa-op--warn { border-color: #f6dcb0; color: #b46b00; background: #fff8ec; }
.aa-op--danger { border-color: #f7c9c9; color: #d93838; background: #fff3f3; }

.aa-tag {
  display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 10px; font-size: 12px; font-weight: 500;
  color: var(--ad-ink-regular, #4b5567); background: var(--ad-line-soft, #edf1f7); vertical-align: 1px;
}
td > .aa-tag:first-child { margin-left: 0; }
.aa-tag--blue { color: #2459d6; background: #e8efff; }
.aa-tag--red { color: #c4302b; background: #fdecec; }
.aa-tag--green { color: #1f7a4d; background: #e6f6ee; }
.aa-tag--amber { color: #a35a00; background: #fff3e0; }
.aa-tag--gray { color: #5b6476; background: #eef1f5; }
.aa-dim { color: var(--ad-ink-muted, #8a93a6); font-size: 12px; }

.aa-logbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--ad-line-soft, #edf1f7); }
.aa-logbar select, .aa-logbar input { height: 32px; padding: 0 10px; border: 1px solid var(--ad-line, #d9dfe8); border-radius: 8px; font-size: 13px; background: #fff; color: inherit; }
.aa-logbar input[name=user], .aa-logbar input[name=q] { width: 170px; }
.aa-logbar-sep { color: var(--ad-ink-muted, #8a93a6); font-size: 13px; }
.aa-table--log td { vertical-align: middle; }
.aa-log-detail { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--ad-mono, monospace); font-size: 12px; }
.aa-pager { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 10px 14px; font-size: 13px; color: var(--ad-ink-regular, #4b5567); border-top: 1px solid var(--ad-line-soft, #edf1f7); }
.aa-pager > span:first-child { margin-right: auto; }
.aa-st { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; }
.aa-st::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.aa-st--on { color: #16833f; }
.aa-st--warn { color: #c27800; }
.aa-st--off { color: #9aa3b5; }

/* ---- 弹窗 ---- */
.aa-modal-backdrop {
  position: fixed; inset: 0; z-index: 8000; visibility: visible;
  display: flex; align-items: center; justify-content: center; background: rgba(22, 32, 58, .38);
  font-family: var(--ad-font, system-ui, sans-serif);
}
.aa-modal {
  width: min(460px, 92vw); max-height: 88vh; display: flex; flex-direction: column;
  background: #fff; border-radius: 12px; box-shadow: 0 24px 60px rgba(22, 32, 58, .3);
}
.aa-modal--wide { width: min(760px, 94vw); }
.aa-modal header { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--ad-line-soft, #edf1f7); }
.aa-modal header h3 { margin: 0; font-size: 16px; color: var(--ad-ink-strong, #16203a); }
.aa-x { border: 0; background: none; font-size: 22px; line-height: 1; color: var(--ad-ink-muted, #8a93a6); cursor: pointer; }
.aa-modal-body { padding: 16px 18px; overflow: auto; display: flex; flex-direction: column; gap: 14px; }
.aa-modal footer { display: flex; justify-content: flex-end; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--ad-line-soft, #edf1f7); }
.aa-modal-err { padding: 0 18px; }

.aa-check-grid { display: flex; flex-wrap: wrap; gap: 8px 10px; }
.aa-check {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--ad-line, #e1e7f0); font-size: 13px; color: var(--ad-ink, #1d2433); background: #fff;
}
.aa-check:has(input:checked) { border-color: #9fbaff; background: #eef3ff; }
.aa-check input:disabled + span { color: var(--ad-ink-muted, #8a93a6); }
.aa-perm-block { display: flex; flex-direction: column; gap: 8px; }
.aa-perm-sub { font-size: 12px; color: var(--ad-ink-muted, #8a93a6); }

/* ---- 权限管理：角色卡 ---- */
.aa-role-list { display: flex; flex-direction: column; gap: 14px; }
.aa-role-card { padding: 14px 18px 16px; }
.aa-role-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.aa-role-head h4 { margin: 0; font-size: 15px; color: var(--ad-ink-strong, #16203a); }
.aa-role-sub { font-size: 12px; color: var(--ad-ink-muted, #8a93a6); }
.aa-perm-group { padding-top: 8px; border-top: 1px dashed var(--ad-line-soft, #edf1f7); margin-top: 8px; }
.aa-perm-group h5 { margin: 0 0 6px; font-size: 13px; font-weight: 600; color: var(--ad-ink-regular, #4b5567); }
.aa-perm-row { display: flex; align-items: center; gap: 10px; padding: 3px 0; }
.aa-perm-row .aa-perm-sub { flex: 0 0 64px; text-align: right; }
.aa-chip-wrap { display: flex; flex-wrap: wrap; gap: 6px; }
.aa-chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 14px; font-size: 12px;
  color: var(--ad-ink-muted, #8a93a6); background: #f3f5f9; border: 1px solid transparent; user-select: none; position: relative;
}
.aa-chip.is-on { color: #1f56e6; background: #e8efff; border-color: #c6d6ff; }
.aa-chip.is-on::before { content: "✓"; font-weight: 700; }
.aa-chip--switch { cursor: pointer; }
.aa-chip--switch:hover { border-color: #9fbaff; }
.aa-chip--switch input { position: absolute; opacity: 0; pointer-events: none; }

/* ---- 底栏用户 ---- */
.aa-foot-ops { display: inline-flex; gap: 4px; margin-left: 8px; }
.aa-foot-ops button {
  border: 0; background: none; padding: 0 4px; cursor: pointer; font: inherit; font-size: 12px; color: var(--ad-link, #2563eb);
}
