/* ============================================================
   综合业务平台 · V3 深浅混合现代金融科技风
   深色导航壳 #101623/#151c2c · 主强调靛蓝 #4f46e5 · 辅助青 #06b6d4
   ============================================================ */
:root {
  color-scheme: dark;
  --shell-900: #101623;
  --shell-800: #151c2c;
  --shell-line: #232d3f;
  --shell-text: #e2e8f0;
  --shell-muted: #8b96a8;
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-soft: rgba(79, 70, 229, 0.16);
  --cyan: #06b6d4;
  --r-s: 10px;
  --r-m: 14px;
  --shadow-panel: 0 4px 16px rgba(15, 23, 42, 0.08);
  --shadow-glass: 0 24px 64px -16px rgba(0, 0, 0, 0.55);
  font-family: -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--shell-text);
  background: var(--shell-900);
}

* { box-sizing: border-box; }

html, body { min-width: 320px; min-height: 100%; margin: 0; }

body {
  min-height: 100svh;
  overflow-x: hidden;
  background: var(--shell-900);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input, select { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

::selection { background: rgba(79, 70, 229, 0.35); }
:focus-visible { outline: 2px solid #6366f1; outline-offset: 2px; border-radius: 4px; }

.ic {
  width: 16px; height: 16px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}

/* ============ 全局背景：深靛渐变 + 细腻光斑 + 网格 ============ */
.background {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(1100px 520px at 82% -18%, rgba(79, 70, 229, 0.28), transparent 62%),
    radial-gradient(760px 420px at 8% 108%, rgba(6, 182, 212, 0.14), transparent 60%),
    linear-gradient(160deg, #0c1224 0%, #101623 52%, #0a0f1c 100%);
}

.background::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("/static/system-portal-background.jpg") center / cover no-repeat;
  opacity: 0.14;
  filter: saturate(0.7);
}

.background::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.55;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='46' height='46'%3E%3Cpath d='M46 .5H.5V46' fill='none' stroke='rgba(148,163,184,.10)'/%3E%3C/svg%3E");
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.35));
  -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.35));
}

/* ============ 通用文字与控件 ============ */
.kicker {
  margin: 0 0 8px;
  color: #6d7890;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

h1, h2, h3 { margin: 0; letter-spacing: 0.01em; }

.form-error { min-height: 20px; margin: 0 0 10px; color: #fda4af; font-size: 13px; }

input, select {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  color: #e8edf6;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: var(--r-s);
  outline: none;
  background: rgba(255, 255, 255, 0.05);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

input::placeholder { color: #57637a; }
input:hover, select:hover { border-color: rgba(255, 255, 255, 0.22); }
input:focus, select:focus {
  border-color: #6366f1;
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.22);
}
input:disabled, select:disabled { opacity: 0.5; cursor: not-allowed; }
input[type="checkbox"] { accent-color: var(--primary); }
select option { background: var(--shell-800); color: var(--shell-text); }

.primary-button {
  width: 100%;
  min-height: 44px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #fff;
  border: 0;
  border-radius: var(--r-s);
  background: linear-gradient(135deg, #5b54ee, var(--primary));
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.06em;
  box-shadow: 0 10px 24px -8px rgba(79, 70, 229, 0.6);
  transition: background 0.18s, box-shadow 0.18s, transform 0.18s;
}

.primary-button:hover {
  background: linear-gradient(135deg, #6366f1, var(--primary-hover));
  box-shadow: 0 12px 28px -8px rgba(79, 70, 229, 0.75);
  transform: translateY(-1px);
}
.primary-button:active { transform: translateY(0); }
.primary-button:disabled { cursor: wait; opacity: 0.62; transform: none; }
.primary-button .ic { width: 17px; height: 17px; }

.primary-button.compact {
  width: auto;
  min-width: 112px;
  min-height: 38px;
  font-size: 13.5px;
  letter-spacing: 0.02em;
  box-shadow: 0 4px 12px -4px rgba(79, 70, 229, 0.5);
}
.primary-button.compact:hover { background: var(--primary-hover); }

/* ============ 登录页 ============ */
.login-view {
  position: relative;
  z-index: 1;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 20px 28px;
}

.login-panel {
  position: relative;
  width: min(400px, 100%);
  padding: 40px 36px 26px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: var(--shadow-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.login-panel.bootstrap-active { width: min(620px, 100%); }

.bootstrap-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 14px;
}

.login-bootstrap-link { display: block; margin: 14px auto 0; }

.login-code-message {
  margin: 0 0 20px;
  color: #b8c4d8;
  font-size: 13px;
  line-height: 1.7;
}

.login-trust-check {
  min-height: 34px;
  margin: -2px 0 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #b8c4d8;
  font-size: 13px;
}

.login-trust-check input { width: 16px; height: 16px; margin: 0; }

.login-code-actions {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.login-text-button {
  padding: 4px 0;
  color: #a5b4fc;
  border: 0;
  background: transparent;
  font-size: 13px;
}

.login-text-button:hover { color: #d7ddff; }
.login-text-button:disabled { color: #69758b; cursor: default; }

#login-code {
  text-align: center;
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 20px;
  letter-spacing: 0;
}

.login-mark {
  display: block;
  width: 46px;
  height: 46px;
  margin: 0 auto 16px;
  filter: drop-shadow(0 6px 18px rgba(79, 70, 229, 0.45));
}

.login-panel h1 {
  font-size: 23px;
  font-weight: 700;
  color: #f1f5f9;
  text-align: center;
  letter-spacing: 0.02em;
}

.login-panel .kicker { margin: 8px 0 0; text-align: center; letter-spacing: 0.24em; }

.login-subtitle {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  width: fit-content;
  margin: 18px auto 24px;
  height: 26px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: #c3cbdd;
  font-size: 12px;
}
.login-subtitle .ic { width: 13px; height: 13px; color: #818cf8; }

.login-panel form label:not(.login-trust-check) {
  display: block;
  margin-bottom: 14px;
}

.login-panel form label:not(.login-trust-check) > span:first-child {
  display: block;
  margin-bottom: 7px;
  color: #9aa6bc;
  font-size: 12.5px;
}

.input-wrap { position: relative; display: block; }
.input-wrap .ic {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: #5f6b82;
  pointer-events: none;
}
.input-wrap input { height: 44px; padding-left: 38px; }

#login-form .primary-button, .bootstrap-form .primary-button { margin-top: 8px; }

.login-foot {
  position: relative;
  margin: 26px 0 0;
  font-size: 12px;
  color: #525f78;
  text-align: center;
}

/* ============ 门户顶栏 ============ */
.portal-view {
  position: relative;
  z-index: 1;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  transition: transform 560ms cubic-bezier(0.72, 0, 0.18, 1), opacity 300ms ease;
}

.topbar {
  flex: none;
  border-bottom: 1px solid var(--shell-line);
  background: rgba(16, 22, 35, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.topbar-inner {
  width: min(1264px, 100%);
  min-height: 64px;
  margin: 0 auto;
  padding: 10px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand-mark { width: 32px; height: 32px; flex: none; }
.brand .kicker { margin: 0 0 2px; font-size: 10.5px; }
.brand h1 { font-size: 16.5px; font-weight: 700; color: #f1f5f9; white-space: nowrap; }

.account-bar { display: flex; align-items: center; justify-content: flex-end; gap: 4px; flex-wrap: wrap; }
.reminder-focus { position: relative; gap: 6px; }
.reminder-focus .ic { width: 15px; height: 15px; color: #a5b4fc; }
.notification-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  border: 1px solid rgba(251, 113, 133, 0.55);
  border-radius: 999px;
  background: #e11d48;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.current-user {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 10px;
  margin-right: 4px;
  border-radius: 8px;
  color: var(--shell-text);
  font-size: 13.5px;
  font-weight: 600;
}
.current-user::before {
  content: "";
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #06b6d4);
  box-shadow: 0 0 14px -2px rgba(79, 70, 229, 0.55);
}

.text-button {
  min-height: 36px;
  padding: 0 11px;
  color: var(--shell-muted);
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  font-size: 13.5px;
  transition: color 0.15s, background 0.15s;
}

.text-button:hover { color: var(--shell-text); background: rgba(255, 255, 255, 0.05); }
.text-button.danger:hover { color: #fda4af; background: rgba(251, 113, 133, 0.08); }

/* ============ 门户系统卡 ============ */
.portal-main {
  flex: 1;
  width: min(1264px, 100%);
  margin: 0 auto;
  padding: 56px 32px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.portal-content {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(310px, 360px);
  align-items: stretch;
  gap: 24px;
}
.portal-systems { min-width: 0; display: flex; flex-direction: column; justify-content: center; }

.choices {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

.choice {
  --sys: #818cf8;
  --sys-bg: rgba(129, 140, 248, 0.13);
  --sys-b: rgba(129, 140, 248, 0.38);
  --sys-g: rgba(129, 140, 248, 0.35);
  position: relative;
  min-height: 240px;
  padding: 24px 22px 20px;
  display: flex;
  flex-direction: column;
  color: var(--shell-text);
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--r-m);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.choice.ia { --sys: #22d3ee; --sys-bg: rgba(34, 211, 238, 0.12); --sys-b: rgba(34, 211, 238, 0.36); --sys-g: rgba(34, 211, 238, 0.32); }
.choice.ccass { --sys: #fb7185; --sys-bg: rgba(251, 113, 133, 0.12); --sys-b: rgba(251, 113, 133, 0.36); --sys-g: rgba(251, 113, 133, 0.32); }
.choice.hkconnect { --sys: #a78bfa; --sys-bg: rgba(167, 139, 250, 0.13); --sys-b: rgba(167, 139, 250, 0.38); --sys-g: rgba(167, 139, 250, 0.34); }
.choice.ipo-center { --sys: #f59e0b; --sys-bg: rgba(245, 158, 11, 0.13); --sys-b: rgba(245, 158, 11, 0.38); --sys-g: rgba(245, 158, 11, 0.34); }

.choice:hover, .choice:focus-visible {
  transform: translateY(-4px);
  border-color: var(--sys-b);
  box-shadow: 0 0 0 1px var(--sys-b), 0 20px 44px -14px var(--sys-g);
  outline: none;
}

.choice-head { display: contents; }

.system-code {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  flex: none;
  border-radius: 14px;
  color: var(--sys);
  background: linear-gradient(135deg, var(--sys-bg), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--sys-b);
  box-shadow: 0 0 30px -8px var(--sys-g);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.03em;
}
.choice.ccass .system-code { font-size: 20px; }

.system-kind {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  margin-top: 16px;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--sys-bg);
  color: var(--sys);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.choice h2 { margin-top: 12px; font-size: 17px; font-weight: 700; color: #f1f5f9; }
.choice p { margin: 8px 0 0; color: var(--shell-muted); font-size: 12.8px; line-height: 1.65; }

.enter {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  align-items: center;
  gap: 6px;
  color: #c9d2e4;
  font-size: 13px;
  font-weight: 600;
  transition: color 0.15s;
}
.enter span { transition: transform 0.18s; }
.choice:hover .enter { color: var(--sys); }
.choice:hover .enter span { transform: translateX(4px); }

.portal-intro { margin-bottom: 34px; }
.portal-eyebrow { margin: 0 0 12px; font-size: 11.5px; letter-spacing: 0.22em; color: #6d7890; }
.portal-sub { margin: 0; font-size: 13.5px; color: var(--shell-muted); }

.empty-state { margin: 48px auto; color: var(--shell-muted); font-size: 15px; }

/* ============ 首页提醒 ============ */
.reminder-panel {
  min-width: 0;
  height: min(610px, calc(100svh - 220px));
  min-height: 420px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--r-m);
  background: rgba(21, 28, 44, 0.72);
  box-shadow: var(--shadow-panel);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.reminder-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.reminder-heading { min-width: 0; }
.reminder-heading .kicker { margin-bottom: 6px; }
.reminder-title-row { display: flex; align-items: center; gap: 8px; }
.reminder-title-row h2 { color: #f1f5f9; font-size: 19px; font-weight: 700; }
.reminder-add { min-width: 82px; min-height: 34px; padding: 0 11px; }
.reminder-add .ic { width: 15px; height: 15px; }
.reminder-toolbar { min-height: 32px; margin: 16px 0 8px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.reminder-tabs { min-width: 0; display: inline-flex; align-items: center; gap: 3px; padding: 3px; border: 1px solid rgba(148, 163, 184, 0.16); border-radius: 7px; background: rgba(255, 255, 255, 0.035); }
.reminder-tab { min-height: 27px; padding: 0 9px; color: #8f9db3; border: 0; border-radius: 5px; background: transparent; font-size: 11px; white-space: nowrap; cursor: pointer; }
.reminder-tab:hover { color: #e2e8f0; background: rgba(255, 255, 255, 0.06); }
.reminder-tab.is-active, .reminder-tab[aria-selected="true"] { color: #fff; background: #4f46e5; box-shadow: 0 2px 7px rgba(79, 70, 229, 0.42); }
.reminder-toolbar .row-button { min-height: 29px; padding: 0 8px; display: inline-flex; align-items: center; gap: 5px; }
.reminder-toolbar .row-button .ic { width: 13px; height: 13px; }
.reminder-panel > .form-error { min-height: 0; margin: 0 0 6px; }
.reminder-feed { min-height: 0; flex: 1; overflow-y: auto; padding: 2px 4px 2px 0; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #34415d transparent; }
.reminder-card { position: relative; margin-bottom: 10px; padding: 13px 13px 11px; border: 1px solid rgba(148, 163, 184, 0.16); border-radius: 9px; background: rgba(255, 255, 255, 0.045); }
.reminder-card:last-child { margin-bottom: 0; }
.reminder-card.is-unread { border-color: rgba(129, 140, 248, 0.48); background: rgba(79, 70, 229, 0.12); box-shadow: inset 3px 0 0 #818cf8; }
.reminder-card.is-pinned { border-color: rgba(245, 158, 11, 0.45); }
.reminder-card-head { min-width: 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.reminder-kind, .reminder-status, .reminder-owner, .reminder-source, .reminder-period { display: inline-flex; align-items: center; min-height: 20px; padding: 0 7px; border-radius: 999px; font-size: 10.5px; line-height: 1; }
.reminder-period { margin-left: 12px; color: #fcd34d; background: rgba(245, 158, 11, 0.14); white-space: nowrap; }
.reminder-period.is-last-day { color: #fecaca; background: rgba(239, 68, 68, 0.2); box-shadow: inset 0 0 0 1px rgba(248, 113, 113, 0.35); font-weight: 700; }
.reminder-kind.category-personal { color: #bfdbfe; background: rgba(96, 165, 250, 0.14); }
.reminder-kind.category-ipo { color: #67e8f9; background: rgba(6, 182, 212, 0.14); }
.reminder-kind.category-rights { color: #fcd34d; background: rgba(245, 158, 11, 0.14); }
.reminder-kind.category-unlock { color: #c4b5fd; background: rgba(139, 92, 246, 0.16); }
.reminder-kind.category-other { color: #cbd5e1; background: rgba(148, 163, 184, 0.13); }
.reminder-pin { width: 22px; height: 22px; flex: none; display: inline-flex; align-items: center; justify-content: center; padding: 0; color: #71809a; border: 1px solid transparent; border-radius: 5px; background: transparent; cursor: pointer; }
.reminder-pin:hover { color: #fcd34d; border-color: rgba(245, 158, 11, 0.3); background: rgba(245, 158, 11, 0.1); }
.reminder-pin.is-pinned { color: #fbbf24; background: rgba(245, 158, 11, 0.14); }
.reminder-pin:disabled { cursor: wait; opacity: 0.5; }
.reminder-pin .ic { width: 13px; height: 13px; }
.reminder-owner { max-width: 100px; overflow: hidden; color: #aab6c8; background: rgba(148, 163, 184, 0.12); text-overflow: ellipsis; white-space: nowrap; }
.reminder-status { margin-left: auto; color: #94a3b8; background: rgba(148, 163, 184, 0.1); }
.reminder-card-head.has-action-link .reminder-head-link { margin-left: auto; }
.reminder-card-head.has-action-link .reminder-status { margin-left: 0; }
.reminder-status.unread { color: #fda4af; background: rgba(244, 63, 94, 0.14); }
.reminder-status.pending { color: #fbbf24; background: rgba(251, 191, 36, 0.13); }
.reminder-status.snoozed { color: #67e8f9; background: rgba(6, 182, 212, 0.13); }
.reminder-status.completed { color: #86efac; background: rgba(34, 197, 94, 0.14); }
.reminder-card-title-row { min-width: 0; margin-top: 10px; display: flex; align-items: center; gap: 8px; }
.reminder-card h3 { min-width: 0; flex: 1; margin: 0; color: #eef2ff; font-size: 14px; font-weight: 700; line-height: 1.45; overflow-wrap: anywhere; }
.reminder-expand { flex: none; min-height: 25px; padding: 0 6px; display: inline-flex; align-items: center; gap: 3px; color: #aebbd0; border: 1px solid rgba(148, 163, 184, 0.18); border-radius: 5px; background: rgba(255, 255, 255, 0.035); font-size: 10.5px; cursor: pointer; }
.reminder-expand:hover { color: #fff; border-color: rgba(129, 140, 248, 0.55); background: rgba(99, 102, 241, 0.16); }
.reminder-expand .ic { width: 12px; height: 12px; transition: transform 0.16s ease; }
.reminder-card.is-expanded .reminder-expand .ic { transform: rotate(90deg); }
.reminder-card-details[hidden] { display: none; }
.reminder-card-details:not([hidden]) { animation: reminder-details-in 0.16s ease-out; }
@keyframes reminder-details-in { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: translateY(0); } }
.reminder-content { margin: 6px 0 0; color: #9eabc0; font-size: 12px; line-height: 1.55; overflow-wrap: anywhere; }
.reminder-meta { min-width: 0; margin-top: 9px; display: flex; align-items: center; gap: 5px; color: #71809a; font-size: 11px; }
.reminder-meta .ic { width: 13px; height: 13px; flex: none; color: #818cf8; }
.reminder-meta time { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reminder-source { max-width: 80px; margin-left: auto; overflow: hidden; color: #67e8f9; background: rgba(6, 182, 212, 0.1); text-overflow: ellipsis; white-space: nowrap; }
.reminder-card-actions { min-width: 0; margin-top: 10px; padding-top: 8px; display: flex; align-items: center; justify-content: flex-end; gap: 4px; flex-wrap: wrap; border-top: 1px solid rgba(255, 255, 255, 0.07); }
.reminder-action, .reminder-link { min-height: 27px; padding: 0 7px; display: inline-flex; align-items: center; gap: 4px; color: #aebbd0; border: 1px solid transparent; border-radius: 6px; background: transparent; font-size: 11px; text-decoration: none; }
.reminder-action:hover, .reminder-link:hover { color: #eef2ff; border-color: rgba(129, 140, 248, 0.42); background: rgba(99, 102, 241, 0.14); }
.reminder-action .ic, .reminder-link .ic { width: 13px; height: 13px; }
.reminder-action.danger:hover { color: #fda4af; border-color: rgba(251, 113, 133, 0.42); background: rgba(251, 113, 133, 0.1); }
.reminder-action:disabled { cursor: wait; opacity: 0.5; }
.reminder-snooze-wrap { position: relative; display: inline-flex; }
.reminder-snooze-menu { position: absolute; right: 0; bottom: calc(100% + 5px); z-index: 3; min-width: 100px; padding: 4px; border: 1px solid #33405a; border-radius: 7px; background: #151c2c; box-shadow: 0 12px 26px rgba(0, 0, 0, 0.35); }
.reminder-snooze-menu button { width: 100%; min-height: 28px; padding: 0 8px; color: #c3cbdd; border: 0; border-radius: 5px; background: transparent; font-size: 11px; text-align: left; white-space: nowrap; }
.reminder-snooze-menu button:hover { color: #fff; background: rgba(99, 102, 241, 0.16); }
.reminder-state { margin: auto; padding: 30px 10px; color: #71809a; font-size: 12px; text-align: center; }
.reminder-load-more { width: 100%; min-height: 31px; margin-top: 10px; }
.reminder-modal { width: min(480px, 100%); }
.reminder-modal textarea { width: 100%; padding: 10px 12px; color: #e8edf6; border: 1px solid rgba(255, 255, 255, 0.13); border-radius: var(--r-s); outline: none; background: rgba(255, 255, 255, 0.05); font: inherit; font-size: 13px; line-height: 1.55; resize: vertical; transition: border-color 0.15s, box-shadow 0.15s, background 0.15s; }
.reminder-modal textarea:focus { border-color: #6366f1; background: rgba(255, 255, 255, 0.07); box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.22); }
.reminder-modal .form-actions { margin-top: 6px; display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.reminder-modal .form-actions .primary-button { width: auto; }

.portal-foot {
  flex: none;
  padding: 20px 32px 26px;
  text-align: center;
  font-size: 12px;
  color: #4d586e;
}

/* ============ 转场层（已移除：系统卡片直达，不再闪背景图） ============ */

/* ============ 浮层（深色玻璃语言） ============ */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  padding: 32px;
  overflow: auto;
  background: rgba(9, 13, 22, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.admin-shell {
  width: min(1380px, 100%);
  min-height: calc(100svh - 64px);
  margin: 0 auto;
  padding: 28px;
  border: 1px solid var(--shell-line);
  border-radius: var(--r-m);
  background: rgba(21, 28, 44, 0.97);
  box-shadow: var(--shadow-glass);
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}
.panel-header h2 { font-size: 20px; font-weight: 700; color: #f1f5f9; }
.panel-header-actions { display: flex; align-items: center; gap: 10px; }

.close-button {
  width: 36px;
  height: 36px;
  padding: 0;
  color: var(--shell-muted);
  border: 1px solid var(--shell-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  font-size: 20px;
  line-height: 1;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.close-button:hover { color: #fff; background: rgba(255, 255, 255, 0.08); border-color: #33405a; }

/* ---- 创建用户 / 批量生成 ---- */
.create-user-form {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) minmax(130px, 1fr) minmax(150px, 1fr) 140px minmax(250px, auto) 170px 150px auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.create-user-form input, .create-user-form select { margin: 0; }

.compact-field { min-width: 0; margin: 0; display: grid; gap: 5px; }
.compact-field span { color: #7c8aa5; font-size: 11px; }
.compact-field input { width: 100%; margin: 0; }
.inline-check { min-height: 40px; margin: 0; display: flex; align-items: center; gap: 8px; white-space: nowrap; color: #aab6c8; font-size: 13px; }
.inline-check input { width: 16px; height: 16px; margin: 0; }

.system-checks {
  min-height: 40px;
  margin: 0;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: var(--r-s);
}
.system-checks label { margin: 0; display: flex; align-items: center; gap: 6px; white-space: nowrap; color: #aab6c8; font-size: 13px; }
.system-checks input { width: 15px; height: 15px; }

.batch-user-section { margin: 22px 0 20px; padding-top: 20px; border-top: 1px solid var(--shell-line); }
.batch-user-form { display: grid; grid-template-columns: repeat(5, minmax(120px, 1fr)); align-items: end; gap: 12px; }
.batch-user-form .system-checks { grid-column: 1 / 4; }
.batch-user-form .inline-check { align-self: center; }
.batch-actions { display: flex; justify-content: flex-end; gap: 8px; }
.batch-preview { margin-top: 14px; }
.batch-preview-summary { margin-bottom: 8px; color: #8b96a8; font-size: 13px; }
.batch-preview-table { max-height: 230px; }

.section-toolbar { min-height: 42px; margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.section-toolbar h3 { margin: 0; font-size: 15px; font-weight: 700; color: #e2e8f0; }

/* ---- 表格（浮层内深色） ---- */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--shell-line);
  border-radius: var(--r-s);
}
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td {
  min-height: 44px;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid #1d2637;
  white-space: nowrap;
}
th {
  color: #7c8aa5;
  background: rgba(255, 255, 255, 0.03);
  font-size: 12px;
  font-weight: 600;
}
td { color: #dbe3ee; }
tbody tr { transition: background 0.12s; }
tbody tr:hover { background: rgba(255, 255, 255, 0.025); }
tbody tr:last-child td { border-bottom: 0; }
td input[type="checkbox"] { width: 16px; height: 16px; }
td select { min-width: 138px; height: 34px; }
td strong { color: #f1f5f9; }

.row-actions { display: flex; gap: 7px; }
.row-button {
  min-height: 32px;
  padding: 0 10px;
  color: #c3cbdd;
  border: 1px solid #33405a;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  font-size: 12.5px;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.row-button:hover { color: #fff; border-color: #6366f1; background: rgba(99, 102, 241, 0.12); }
.row-button.danger:hover { color: #fda4af; border-color: rgba(251, 113, 133, 0.5); background: rgba(251, 113, 133, 0.1); }
.row-button:disabled { cursor: not-allowed; opacity: 0.46; }

.expiry-input { width: 142px; height: 34px; }
.display-name-input { min-width: 150px; height: 34px; }
.login-email-editor { display: grid; gap: 6px; }
.login-email-editor input { width: 100%; min-width: 0; height: 34px; }
.login-email-editor .status-badge { justify-self: start; }
.threshold-input { width: 82px; height: 34px; }

.user-status { display: grid; gap: 5px; }
.user-status .status-badge { justify-self: start; }
.active-toggle { display: flex; align-items: center; gap: 6px; color: #8b96a8; font-size: 12px; }
.active-toggle input { margin: 0; }

/* ---- 状态徽标 ---- */
.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 62px;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  color: #94a3b8;
  background: rgba(148, 163, 184, 0.12);
  font-size: 12px;
  font-weight: 600;
}
.status-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-badge.success { color: #34d399; background: rgba(52, 211, 153, 0.12); }
.status-badge.cached { color: #fbbf24; background: rgba(251, 191, 36, 0.12); }
.status-badge.error, .status-badge.failed { color: #fb7185; background: rgba(251, 113, 133, 0.12); }
.status-badge.running { color: #22d3ee; background: rgba(34, 211, 238, 0.12); }
.status-badge.queued, .status-badge.pending { color: #a5b4fc; background: rgba(165, 180, 252, 0.12); }

/* ---- API 管理 ---- */
.api-shell { max-width: 980px; min-height: 0; }
.api-tabs { margin: 0 -2px 20px; }
.api-view[hidden] { display: none; }
.api-credentials-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; margin-top: 20px; }
.api-credentials-form label { display: grid; gap: 7px; color: #aab6c8; font-size: 12px; font-weight: 600; }
.api-credentials-form input, .api-credentials-form textarea { width: 100%; min-width: 0; box-sizing: border-box; padding: 10px 11px; border: 1px solid #33405a; border-radius: 7px; color: #e2e8f0; background: rgba(255,255,255,.045); font: inherit; }
.api-credentials-form textarea { resize: vertical; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; line-height: 1.5; }
.api-credentials-form .field-wide { grid-column: 1 / -1; }
.api-enabled-toggle { align-self: center; display: flex !important; align-items: center; gap: 7px; }
.api-enabled-toggle input { width: auto; }
.api-form-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px; }
.longbridge-details { margin-top: 12px; }
.tiger-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--shell-line); border-radius: var(--r-s); overflow: hidden; margin-bottom: 18px; }
.tiger-summary > div { min-width: 0; min-height: 74px; padding: 14px 16px; border-right: 1px solid var(--shell-line); background: rgba(255, 255, 255, 0.03); }
.tiger-summary > div:last-child { border-right: 0; }
.tiger-summary span, .tiger-summary strong, .tiger-details span, .tiger-details strong { display: block; }
.tiger-summary span, .tiger-details span { color: #7c8aa5; font-size: 12px; }
.tiger-summary strong { margin-top: 8px; overflow-wrap: anywhere; font-size: 17px; color: #f1f5f9; }
.tiger-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--shell-line); border-radius: var(--r-s); overflow: hidden; }
.tiger-details > div { min-width: 0; min-height: 68px; padding: 13px 16px; border-right: 1px solid var(--shell-line); border-bottom: 1px solid var(--shell-line); }
.tiger-details > div:nth-child(2n) { border-right: 0; }
.tiger-details > div:nth-last-child(-n+2) { border-bottom: 0; }
.tiger-details strong { margin-top: 7px; overflow-wrap: anywhere; font-size: 14px; color: #e2e8f0; }
.panel-note { margin: 16px 0 8px; color: #8b96a8; font-size: 13px; line-height: 1.7; }
.tiger-actions { display: grid; grid-template-columns: minmax(260px, 1fr) auto auto auto; align-items: center; gap: 10px; margin-top: 18px; }
.tiger-actions input[type="file"] { min-width: 0; height: 40px; padding: 8px 10px; }
.tiger-actions input[type="file"]::file-selector-button {
  margin-right: 10px;
  padding: 4px 12px;
  color: #c3cbdd;
  border: 1px solid #33405a;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.06);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
}
.test-result { min-height: 22px; margin: 14px 0 0; color: #34d399; font-size: 13px; }

/* ---- 代理订阅 ---- */
.proxy-shell { max-width: 1240px; }
.proxy-health { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--shell-line); border-radius: var(--r-s); overflow: hidden; margin-bottom: 18px; }
.proxy-health > div { min-width: 0; min-height: 74px; padding: 14px 16px; border-right: 1px solid var(--shell-line); background: rgba(255, 255, 255, 0.03); }
.proxy-health > div:last-child { border-right: 0; }
.proxy-health span, .proxy-health strong { display: block; }
.proxy-health span { color: #7c8aa5; font-size: 12px; }
.proxy-health strong { margin-top: 8px; overflow-wrap: anywhere; font-size: 18px; color: #f1f5f9; }
.proxy-capture-panel { margin: -6px 0 22px; }
.proxy-capture-panel .section-toolbar { margin-bottom: 10px; }
.proxy-capture-health { grid-template-columns: repeat(6, minmax(0, 1fr)); margin-bottom: 0; }
.capture-limit-form { display: flex; align-items: center; gap: 8px; }
.capture-limit-form label { color: #aab6c8; font-size: 13px; }
.capture-limit-form input { width: 82px; height: 36px; }
.rotation-policy { margin-bottom: 22px; }
.proxy-note { margin: 4px 0 0; color: #7c8aa5; font-size: 12px; }
.rotation-table select { min-width: 152px; }
.rotation-table td { vertical-align: middle; }
.rotation-table td:nth-child(8) span, .rotation-table td:nth-child(8) small { display: block; }
.rotation-table td:nth-child(8) small { margin-top: 4px; color: #5f6b82; font-size: 11px; }
.rotation-table .status-badge { min-width: 0; min-height: 22px; margin-left: 6px; padding: 0 8px; }
.node-id { font-family: Consolas, "SFMono-Regular", monospace; color: #67e8f9; }

/* ---- 固定 IP 节点 ---- */
.static-nodes { margin-bottom: 22px; }
.static-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--shell-line); border-radius: var(--r-s); overflow: hidden; margin-bottom: 14px; }
.static-summary > div { min-width: 0; min-height: 66px; padding: 12px 16px; border-right: 1px solid var(--shell-line); background: rgba(255, 255, 255, 0.03); }
.static-summary > div:last-child { border-right: 0; }
.static-summary span, .static-summary strong { display: block; }
.static-summary span { color: #7c8aa5; font-size: 12px; }
.static-summary strong { margin-top: 7px; font-size: 17px; color: #f1f5f9; }
.static-add-form { display: grid; grid-template-columns: minmax(150px, 1.2fr) 104px minmax(110px, 1fr) minmax(110px, 1fr) minmax(130px, 1fr) auto; gap: 10px; margin-bottom: 12px; }
.static-add-form .primary-button { width: auto; justify-self: start; }
.static-import { display: grid; gap: 10px; margin-bottom: 12px; }
.static-import textarea {
  width: 100%;
  min-height: 132px;
  padding: 10px 12px;
  color: #e8edf6;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: var(--r-s);
  outline: none;
  background: rgba(255, 255, 255, 0.05);
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 12.5px;
  line-height: 1.7;
  resize: vertical;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.static-import textarea:focus { border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.22); }
.static-import-actions { display: flex; justify-content: flex-end; }
.static-import-result { padding: 10px 14px; border: 1px solid var(--shell-line); border-radius: var(--r-s); background: rgba(255, 255, 255, 0.03); color: #c3cbdd; font-size: 13px; }
.import-summary { margin: 0; }
.import-invalid { max-height: 150px; margin: 8px 0 0; padding-left: 18px; overflow-y: auto; color: #fda4af; font-size: 12.5px; line-height: 1.8; }
.static-table-wrap { max-height: 560px; overflow-y: auto; }
.static-test-ok { color: #34d399; }
.static-test-fail { color: #fb7185; }
.static-test-none { color: #5f6b82; }

.provider-form { display: grid; grid-template-columns: minmax(220px, 420px) auto; gap: 12px; margin-bottom: 8px; }
.provider-form .primary-button, .subscription-form .primary-button { width: auto; justify-self: start; }
.providers-list { display: grid; gap: 14px; }
.provider-block { border: 1px solid var(--shell-line); border-radius: var(--r-s); background: rgba(255, 255, 255, 0.02); overflow: hidden; }
.provider-header { min-height: 54px; padding: 10px 12px; display: grid; grid-template-columns: minmax(180px, 1fr) auto; align-items: center; gap: 12px; border-bottom: 1px solid var(--shell-line); }
.provider-controls { display: flex; align-items: center; gap: 8px; color: #aab6c8; font-size: 13px; }
.provider-controls input[type="checkbox"], .subscription-table input[type="checkbox"] { width: 16px; height: 16px; }
.provider-name { max-width: 360px; height: 36px; }
.subscription-form { padding: 12px; display: grid; grid-template-columns: minmax(260px, 1fr) auto; gap: 10px; border-bottom: 1px solid var(--shell-line); }
.subscription-table { border: 0; border-radius: 0; }
.subscription-url { max-width: 480px; overflow: hidden; text-overflow: ellipsis; font-family: Consolas, "SFMono-Regular", monospace; font-size: 12.5px; color: #9fb0c6; }
.refresh-history { margin-top: 24px; }
.refresh-history h3 { margin: 0 0 10px; font-size: 15px; font-weight: 700; color: #e2e8f0; }
.empty-row { color: #7c8aa5; text-align: center; }

/* ---- 登录日志 ---- */
.login-logs-filter {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) minmax(150px, 220px) auto;
  align-items: end;
  gap: 10px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--shell-line);
  border-radius: var(--r-s);
  background: rgba(255, 255, 255, 0.025);
}
.login-logs-filter .compact-field { min-width: 0; }
.login-logs-filter-actions { display: flex; gap: 8px; }
.logs-filter { display: grid; grid-template-columns: repeat(4, minmax(140px, 1fr)); gap: 10px; margin: 12px 0; }
.logs-filter input, .logs-filter select { min-width: 0; }
.logs-filter button { align-self: end; }
.login-logs-filter-actions .row-button { min-width: 72px; }
.login-logs-table-wrap { max-height: 620px; }
.login-logs-table { min-width: 1060px; }
.login-logs-table th, .login-logs-table td { vertical-align: middle; }
.login-logs-table th:nth-child(1) { min-width: 154px; }
.login-logs-table th:nth-child(2) { min-width: 112px; }
.login-logs-table th:nth-child(3) { min-width: 132px; }
.login-logs-table th:nth-child(4) { min-width: 128px; }
.login-logs-table th:nth-child(5) { min-width: 72px; }
.login-logs-table th:nth-child(6) { min-width: 154px; }
.login-logs-table th:nth-child(7) { min-width: 112px; }
.login-logs-table th:nth-child(8) { min-width: 250px; }
.login-logs-table .status-badge { white-space: nowrap; }
.logs-shell { max-width: min(1500px, 96vw); }
.logs-tabs { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: -4px 0 18px; }
.logs-tabs .admin-tab { min-height: 36px; padding: 0 15px; border: 1px solid transparent; border-radius: 8px; color: var(--shell-muted); background: rgba(255, 255, 255, .04); font-weight: 650; transition: color .15s, border-color .15s, background .15s, box-shadow .15s; }
.logs-tabs .admin-tab:hover { color: var(--shell-text); background: rgba(255, 255, 255, .08); }
.logs-tabs .admin-tab.active { color: #eff6ff; border-color: rgba(96, 165, 250, .7); background: linear-gradient(135deg, rgba(37, 99, 235, .82), rgba(59, 130, 246, .68)); box-shadow: 0 7px 18px -10px rgba(59, 130, 246, .95); }
.logs-actions { display: flex; align-items: center; gap: 8px; }
.logs-table-wrap { max-height: 620px; }
.logs-table { min-width: 980px; }
.logs-table th, .logs-table td { vertical-align: middle; }
.logs-table td small { display: block; margin-top: 3px; color: #71809a; font-size: 11px; }
.ledger-log-summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; color: #9aa6bc; font-size: 12px; }
.ledger-log-summary > div { display: flex; gap: 8px; }
.ledger-logs-table { min-width: 1120px; }
.ledger-logs-table th:nth-child(1),
.ledger-logs-table td:nth-child(1),
.ledger-logs-table th:nth-child(4),
.ledger-target-cell { width: 150px; min-width: 150px; max-width: 150px; }
.ledger-target-name { display: block; color: #e2e8f0; font-weight: 700; }
.ledger-target-name,
.ledger-target-detail { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ledger-target-detail { display: block; margin-top: 4px; color: #8290a8; font-size: 11px; font-weight: 400; line-height: 1.4; }
.ledger-log-detail { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; background: rgba(0, 0, 0, .48); }
.ledger-log-detail-card { width: min(760px, 94vw); max-height: 90vh; overflow: auto; padding: 22px; border: 1px solid var(--shell-line); border-radius: var(--r-m); background: #151c2c; box-shadow: var(--shadow-glass); }
.ledger-log-detail-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.ledger-log-detail-header h3 { margin: 0; color: var(--shell-text); }
.ledger-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 20px; margin: 0; }
.ledger-detail-grid div { min-width: 0; padding-bottom: 10px; border-bottom: 1px solid var(--shell-line); }
.ledger-detail-grid dt { color: #7c8aa5; font-size: 11px; }
.ledger-detail-grid dd { margin: 4px 0 0; overflow-wrap: anywhere; color: #e2e8f0; font-size: 13px; }
.ledger-log-detail-card h4 { margin: 18px 0 8px; color: #c3cbdd; font-size: 13px; }
.ledger-log-detail-card h5 { margin: 14px 0 7px; color: #9aa6bc; font-size: 12px; font-weight: 600; }
.ledger-log-detail-card pre { max-height: 260px; overflow: auto; margin: 0; padding: 12px; border-radius: var(--r-s); background: rgba(0, 0, 0, .2); color: #c3cbdd; font: 12px/1.5 Consolas, monospace; white-space: pre-wrap; }
.ledger-change-table-wrap { overflow-x: auto; border: 1px solid var(--shell-line); border-radius: var(--r-s); }
.ledger-change-table { width: 100%; min-width: 540px; border-collapse: collapse; font-size: 12px; }
.ledger-change-table th, .ledger-change-table td { padding: 9px 10px; border-bottom: 1px solid var(--shell-line); text-align: left; vertical-align: top; }
.ledger-change-table th { color: #9aa6bc; background: rgba(255, 255, 255, .035); font-weight: 600; }
.ledger-change-table tr:last-child td { border-bottom: 0; }
.ledger-change-table td { color: #d8e0ed; overflow-wrap: anywhere; }
.ledger-change-table td:nth-child(3) { color: #f2a8a8; }
.ledger-change-table td:nth-child(4) { color: #8ee0b9; font-weight: 600; }
.ledger-detail-empty { margin: 0; padding: 13px; border: 1px dashed var(--shell-line); border-radius: var(--r-s); color: #7c8aa5; font-size: 12px; }
.ledger-detail-values { margin: 0; }
.ledger-detail-values div { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 12px; padding: 7px 0; border-bottom: 1px solid rgba(148, 163, 184, .12); }
.ledger-detail-values div:last-child { border-bottom: 0; }
.ledger-detail-values dt { color: #7c8aa5; font-size: 11px; }
.ledger-detail-values dd { margin: 0; color: #cbd5e1; font-size: 12px; overflow-wrap: anywhere; }
.ledger-detail-technical { margin-top: 18px; border-top: 1px solid var(--shell-line); padding-top: 12px; }
.ledger-detail-technical summary { color: #7c8aa5; cursor: pointer; font-size: 12px; }
.ledger-detail-technical[open] summary { margin-bottom: 10px; color: #aab7ca; }
.ledger-detail-raw { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ledger-detail-raw > div { min-width: 0; }
.ledger-detail-raw strong { display: block; margin-bottom: 6px; color: #7c8aa5; font-size: 11px; font-weight: 600; }
.ledger-detail-error { margin: 0; padding: 10px 12px; border-radius: var(--r-s); color: #fecaca; background: rgba(248, 113, 113, .1); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.logs-table .row-button.danger { color: #fecaca; border-color: rgba(248,113,113,.35); }
.status-badge.login-event-success { color: #34d399; background: rgba(52, 211, 153, 0.12); }
.status-badge.login-event-error { color: #fb7185; background: rgba(251, 113, 133, 0.12); }
.status-badge.login-event-cached { color: #fbbf24; background: rgba(251, 191, 36, 0.12); }
.status-badge.login-event-pending { color: #a5b4fc; background: rgba(165, 180, 252, 0.12); }
.login-log-ip, .device-fingerprint { color: #9fb0c6; font-family: Consolas, "SFMono-Regular", monospace; font-size: 12.5px; }
.device-fingerprint-secondary { display: block; margin-top: 8px; color: #718096; }
.device-type { color: #c3cbdd; }
.login-log-subtext { display: block; margin-top: 4px; color: #7c8aa5; font-size: 11.5px; }
.login-log-details { max-width: 360px; overflow-wrap: anywhere; color: #9aa6bc; font-size: 12px; line-height: 1.5; }
@media (max-width: 760px) { .ledger-detail-grid { grid-template-columns: 1fr; } .ledger-detail-raw { grid-template-columns: 1fr; } }

/* ---- 弹窗 ---- */
.modal-overlay { display: grid; place-items: center; }
.modal {
  width: min(420px, 100%);
  padding: 26px;
  border: 1px solid var(--shell-line);
  border-radius: var(--r-m);
  background: rgba(21, 28, 44, 0.98);
  box-shadow: var(--shadow-glass);
}
.modal label { display: grid; gap: 7px; margin-bottom: 14px; color: #9aa6bc; font-size: 12.5px; }
.modal .panel-header { margin-bottom: 18px; }
.settings-modal { width: min(620px, 100%); }
.settings-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.settings-summary > div { min-width: 0; padding: 12px; border: 1px solid var(--shell-line); border-radius: var(--r-s); background: rgba(255,255,255,.025); }
.settings-summary span, .settings-summary strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.settings-summary span { margin-bottom: 6px; color: var(--shell-muted); font-size: 11px; }
.settings-summary strong { color: var(--shell-text); font-size: 13px; }
.settings-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.settings-action { min-height: 86px; padding: 14px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 6px; color: var(--shell-text); border: 1px solid var(--shell-line); border-radius: var(--r-s); background: rgba(255,255,255,.025); text-align: left; }
.settings-action:hover { border-color: rgba(129, 140, 248, .6); background: rgba(99, 102, 241, .12); }
.settings-action strong { font-size: 13px; }
.settings-action span { color: var(--shell-muted); font-size: 11px; line-height: 1.45; }
.field-hint { color: #69768d; font-size: 12px; line-height: 1.5; }

.credentials-modal { width: min(720px, 100%); }
.credentials-toolbar { min-height: 44px; margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.credentials-toolbar strong { color: #c3cbdd; font-size: 14px; }
.credentials-table { max-height: min(55svh, 520px); }

/* ---- Toast ---- */
.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 40;
  max-width: 360px;
  padding: 12px 16px;
  border: 1px solid rgba(99, 102, 241, 0.45);
  border-left: 3px solid #6366f1;
  border-radius: var(--r-s);
  background: rgba(21, 28, 44, 0.97);
  color: var(--shell-text);
  font-size: 13.5px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.mail-shell { max-width: 1180px; }
.mail-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 20px; }
.mail-tabs .admin-tab { min-height: 36px; padding: 0 15px; border: 1px solid transparent; border-radius: 7px; color: var(--shell-muted); background: rgba(255, 255, 255, .04); font-weight: 650; transition: color .15s, border-color .15s, background .15s, box-shadow .15s; }
.mail-tabs .admin-tab:hover { color: var(--shell-text); background: rgba(255, 255, 255, .08); }
.mail-tabs .admin-tab.active { color: #eff6ff; border-color: rgba(96, 165, 250, .7); background: linear-gradient(135deg, rgba(37, 99, 235, .88), rgba(59, 130, 246, .72)); box-shadow: 0 7px 18px -10px rgba(59, 130, 246, .95); }
.mail-tabs .admin-tab:focus-visible { outline: 2px solid #93c5fd; outline-offset: 2px; }
.mail-form, .mail-inline-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 16px; border: 1px solid var(--shell-line); border-radius: var(--r-s); background: rgba(255,255,255,.018); margin-bottom: 16px; }
.mail-form label, .mail-inline-form label { display: grid; gap: 6px; color: var(--shell-muted); font-size: 12px; }
.mail-form textarea, .mail-form .form-actions, .mail-form .mail-recipient-picker { grid-column: 1 / -1; }
.mail-form textarea { min-height: 150px; resize: vertical; }
.mail-form .inline-check { display: flex; }
.mail-provider-heading, .mail-resend-key-label, .mail-resend-hint, .mail-test-result, .mail-resend-current { grid-column: 1 / -1; }
.mail-provider-heading { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; }
.mail-provider-heading h4 { margin: 0 0 4px; color: var(--shell-text); font-size: 16px; }
.mail-provider-heading p, .mail-resend-hint { margin: 0; }
.mail-provider-heading p, .mail-provider-heading small, .mail-resend-hint { color: var(--shell-muted); font-size: 12px; }
.mail-resend-guidance { color: var(--shell-muted); font-size: 13px; line-height: 1.6; }
.mail-resend-guidance p { margin: 0 0 4px; }
#mail-test-form { grid-template-columns: minmax(0, 1fr) minmax(0, .6fr) auto; }
.mail-test-result { margin: 0; color: var(--shell-text); font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.mail-resend-current { margin: 0; color: var(--shell-text); font-size: 13px; }
.mail-view :is(input, select) { min-width: 0; }
@media (max-width: 760px) { #mail-test-form { grid-template-columns: minmax(0, 1fr); } }
.mail-login-verification-form { max-width: 660px; grid-template-columns: minmax(0, 1fr); }
.mail-login-verification-current { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 12px; color: var(--shell-muted); font-size: 13px; }
.mail-login-verification-current strong { color: var(--shell-text); }
.mail-login-verification-current strong.mail-status-enabled { color: #86efac; }
.mail-login-verification-current strong.mail-status-paused { color: #fbbf24; }
.mail-login-verification-current small { color: var(--shell-muted); font-size: 12px; }
.mail-login-verification-hint { color: var(--shell-muted); font-size: 13px; line-height: 1.5; }
.mail-login-verification-hint p { margin: 0 0 4px; }
.mail-login-verification-form .form-error { min-height: 0; margin: 0; }
.mail-login-verification-form .form-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.mail-recipient-picker { border: 1px solid var(--shell-line); border-radius: var(--r-s); padding: 10px; }
.mail-recipient-picker legend { padding: 0 5px; color: var(--shell-muted); font-size: 12px; }
#mail-task-recipient-options { display: flex; flex-wrap: wrap; gap: 8px; }
.mail-recipient-option { display: inline-flex; align-items: center; gap: 5px; padding: 6px 9px; border: 1px solid var(--shell-line); border-radius: 6px; color: var(--shell-text); font-size: 12px; }
.mail-task-modal { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 24px; background: rgba(5, 9, 18, .76); backdrop-filter: blur(7px); -webkit-backdrop-filter: blur(7px); }
.mail-task-modal[hidden] { display: none; }
.mail-task-dialog { display: flex; flex-direction: column; width: min(820px, 100%); max-height: min(88svh, 850px); overflow: hidden; border: 1px solid rgba(148, 163, 184, .24); border-radius: 10px; background: #111827; box-shadow: 0 28px 90px rgba(0, 0, 0, .58); color: var(--shell-text); }
.mail-task-dialog-header { display: flex; flex: 0 0 auto; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 22px 26px 17px; border-bottom: 1px solid var(--shell-line); }
.mail-task-dialog-header .kicker { margin: 0 0 5px; }
.mail-task-dialog-header h3 { margin: 0; font-size: 20px; line-height: 1.35; }
.mail-task-dialog-header .section-subtitle { margin: 5px 0 0; }
.mail-task-form { min-height: 0; overflow-y: auto; padding: 2px 26px 0; }
.mail-task-section { padding: 18px 0; border-bottom: 1px solid rgba(148, 163, 184, .14); }
.mail-task-section h4 { margin: 0 0 13px; color: #e2e8f0; font-size: 13px; font-weight: 700; }
.mail-task-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px 16px; }
.mail-task-fields label { display: grid; min-width: 0; gap: 7px; color: var(--shell-muted); font-size: 12px; }
.mail-task-fields input, .mail-task-fields select, .mail-task-fields textarea { width: 100%; min-width: 0; }
.mail-task-fields textarea { min-height: 120px; resize: vertical; }
.mail-task-wide { grid-column: 1 / -1; }
.mail-task-form .mail-recipient-picker { margin: 0; }
.mail-task-dialog-footer { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 -26px; padding: 14px 26px; border-top: 1px solid var(--shell-line); background: #111827; }
.mail-task-dialog-footer .inline-check { display: inline-flex; align-items: center; gap: 8px; color: var(--shell-muted); font-size: 12px; }
.mail-task-dialog-footer .form-actions { display: flex; justify-content: flex-end; gap: 9px; margin: 0; }
.mail-send-modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(5, 9, 18, .78); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.mail-send-modal[hidden] { display: none; }
.mail-send-dialog { width: min(460px, 100%); padding: 22px; border: 1px solid rgba(148, 163, 184, .25); border-radius: 10px; background: #111827; color: var(--shell-text); box-shadow: 0 24px 76px rgba(0, 0, 0, .58); }
.mail-send-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding-bottom: 17px; border-bottom: 1px solid var(--shell-line); }
.mail-send-header .kicker { margin: 0 0 5px; }
.mail-send-header h3 { margin: 0; font-size: 18px; }
.mail-send-header .section-subtitle { margin: 6px 0 0; overflow-wrap: anywhere; }
.mail-send-date-field { display: grid; gap: 8px; margin-top: 18px; color: var(--shell-muted); font-size: 12px; }
.mail-send-date-field input { width: 100%; }
.mail-send-date-field small { color: #7f8ba1; font-size: 11px; }
.mail-send-notice { margin: 16px 0 0; color: var(--shell-muted); font-size: 12px; line-height: 1.55; }
.mail-send-dialog .form-error { margin: 10px 0 0; }
.mail-send-footer { display: flex; justify-content: flex-end; gap: 9px; margin-top: 20px; padding-top: 15px; border-top: 1px solid var(--shell-line); }
.mail-send-footer button { width: auto; }
.mail-table { min-width: 760px; }
.mail-table td { vertical-align: middle; }
.mail-status-enabled { color: #86efac; }
.mail-status-disabled, .mail-status-failed { color: #fda4af; }
.mail-status-success { color: #86efac; }
.mail-inline-form { grid-template-columns: minmax(190px, .8fr) minmax(220px, 1fr) auto auto; align-items: end; }
.mail-inline-form button { width: auto; }
@media (max-width: 760px) { .mail-form, .mail-inline-form { grid-template-columns: 1fr; } .mail-form textarea, .mail-form .form-actions, .mail-form .mail-recipient-picker { grid-column: auto; } .mail-task-modal { padding: 12px; } .mail-task-dialog { max-height: 94svh; } .mail-task-dialog-header { padding: 18px 18px 14px; } .mail-task-form { padding: 0 18px; } .mail-task-fields { grid-template-columns: 1fr; } .mail-task-wide { grid-column: auto; } .mail-task-dialog-footer { margin: 0 -18px; padding: 12px 18px; } }
@media (max-width: 760px) { .settings-summary, .settings-actions { grid-template-columns: 1fr; } }
@media (max-width: 480px) { .mail-task-dialog-footer { align-items: stretch; flex-direction: column; gap: 12px; } .mail-task-dialog-footer .form-actions { display: grid; grid-template-columns: 1fr 1fr; } .mail-task-dialog-footer .form-actions button { width: 100%; } }
@media (max-width: 480px) { .mail-send-dialog { padding: 18px; } .mail-send-footer button { flex: 1; } }

/* ---- 滚动条 ---- */
.overlay::-webkit-scrollbar, .table-wrap::-webkit-scrollbar { width: 10px; height: 10px; }
.overlay::-webkit-scrollbar-thumb, .table-wrap::-webkit-scrollbar-thumb { background: #2b3650; border-radius: 8px; border: 2px solid var(--shell-800); }

/* ============ 响应式 ============ */
@media (max-width: 1400px) {
  .create-user-form { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 1200px) {
  .choices { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .create-user-form { grid-template-columns: 1fr 1fr 1fr; }
  .create-user-form .system-checks { grid-column: 1 / -1; }
  .batch-user-form { grid-template-columns: repeat(3, minmax(140px, 1fr)); }
  .batch-user-form .system-checks { grid-column: 1 / -1; }
}

@media (max-width: 1100px) {
  .portal-content { grid-template-columns: minmax(0, 1fr) minmax(286px, 320px); gap: 16px; }
  .reminder-panel { padding: 15px; }
  .reminder-action span, .reminder-link span { display: none; }
  .reminder-action, .reminder-link { width: 27px; padding: 0; justify-content: center; }
  .reminder-head-link { width: auto; padding: 0 7px; justify-content: initial; }
  .reminder-head-link span { display: inline; }
}

@media (max-width: 900px) {
  .topbar-inner { align-items: flex-start; flex-direction: column; padding: 14px 20px; gap: 10px; }
  .account-bar { justify-content: flex-start; }
  .portal-main { padding: 36px 20px 28px; justify-content: flex-start; }
  .portal-content { grid-template-columns: 1fr; gap: 22px; }
  .choices { grid-template-columns: 1fr; gap: 14px; }
  .choice { min-height: 0; }
  .reminder-panel { height: 520px; min-height: 0; }
  .create-user-form { grid-template-columns: 1fr 1fr; }
  .batch-user-form { grid-template-columns: 1fr 1fr; }
  .batch-user-form .system-checks { grid-column: 1 / -1; }
  .proxy-health { grid-template-columns: 1fr 1fr; }
  .tiger-summary { grid-template-columns: 1fr 1fr; }
  .tiger-summary > div:nth-child(2) { border-right: 0; }
  .tiger-summary > div:nth-child(-n+2) { border-bottom: 1px solid var(--shell-line); }
  .tiger-actions { grid-template-columns: 1fr 1fr; }
  .tiger-actions input[type="file"] { grid-column: 1 / -1; }
  .proxy-health > div:nth-child(2) { border-right: 0; }
  .proxy-health > div:nth-child(-n+2) { border-bottom: 1px solid var(--shell-line); }
  .proxy-capture-health > div:nth-child(2n) { border-right: 0; }
  .proxy-capture-health > div:nth-child(-n+4) { border-bottom: 1px solid var(--shell-line); }
  .proxy-capture-health > div:nth-child(n+5) { border-bottom: 0; }
  .static-summary { grid-template-columns: 1fr 1fr; }
  .static-summary > div:nth-child(2) { border-right: 0; }
  .static-summary > div:nth-child(-n+2) { border-bottom: 1px solid var(--shell-line); }
  .static-add-form { grid-template-columns: 1fr 1fr; }
  .provider-header { grid-template-columns: 1fr; }
  .login-logs-filter { grid-template-columns: 1fr 1fr; }
  .logs-filter { grid-template-columns: 1fr 1fr; }
  .login-logs-filter-actions { grid-column: 1 / -1; }
  .section-toolbar { align-items: flex-start; flex-direction: column; }
  .provider-controls { justify-content: flex-start; flex-wrap: wrap; }
  .system-checks { grid-column: 1 / -1; }
  .primary-button.compact { width: 100%; }
}

@media (max-width: 520px) {
  .login-view, .overlay { padding: 16px; }
  .login-panel, .admin-shell { padding: 24px 20px; }
  .bootstrap-fields { grid-template-columns: 1fr; }
  .portal-main { padding: 24px 16px; }
  .account-bar { width: 100%; justify-content: flex-start; }
  .reminder-panel { height: 500px; padding: 14px; }
  .reminder-add { min-width: 72px; }
  .reminder-action span, .reminder-link span { display: inline; }
  .reminder-action, .reminder-link { width: auto; padding: 0 7px; justify-content: initial; }
  .create-user-form { grid-template-columns: 1fr; }
  .batch-user-form { grid-template-columns: 1fr; }
  .create-user-form .system-checks, .batch-user-form .system-checks { grid-column: auto; }
  .batch-actions, .credentials-toolbar { align-items: stretch; flex-direction: column; }
  .provider-form, .subscription-form { grid-template-columns: 1fr; }
  .login-logs-filter { grid-template-columns: 1fr; }
  .logs-filter { grid-template-columns: 1fr; }
  .login-logs-filter-actions { grid-column: auto; }
  .static-add-form { grid-template-columns: 1fr; }
  .tiger-summary, .tiger-details, .tiger-actions, .api-credentials-form { grid-template-columns: 1fr; }
  .tiger-summary > div, .tiger-details > div { border-right: 0; border-bottom: 1px solid var(--shell-line); }
  .tiger-summary > div:last-child, .tiger-details > div:last-child { border-bottom: 0; }
  .tiger-actions input[type="file"] { grid-column: auto; }
  .api-credentials-form .field-wide, .api-form-actions { grid-column: auto; }
  .panel-header-actions { align-items: flex-end; flex-direction: column-reverse; }
  .system-checks { grid-column: auto; flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
}

/* ---------- 外部系统接入 ---------- */
.choice.external { --sys: #34d399; --sys-bg: rgba(52, 211, 153, 0.12); --sys-b: rgba(52, 211, 153, 0.36); --sys-g: rgba(52, 211, 153, 0.32); }

.extsys-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  margin-bottom: 4px;
}
.extsys-form input, .extsys-form select { margin: 0; }
.extsys-form .primary-button { width: auto; justify-self: start; }

.extsys-table td { vertical-align: middle; }
.extsys-table input, .extsys-table select { margin: 0; min-width: 0; }
.extsys-table input:not([type="checkbox"]) { width: 100%; height: 34px; padding: 6px 10px; font-size: 13px; }
.extsys-table select { height: 34px; padding: 4px 8px; font-size: 13px; }
.extsys-table input.ext-badge { width: 70px; }
.extsys-table input.ext-sort { width: 72px; }
.extsys-table input[data-ext-base-url] { min-width: 210px; }
.extsys-table input[data-ext-secret] { min-width: 170px; }
.extsys-table input[data-ext-name] { min-width: 130px; }
.extsys-table input[data-ext-subtitle] { min-width: 140px; }
.ext-check-time { display: block; margin-top: 4px; color: #5f6b82; font-size: 11px; }

.module-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: -4px 0 20px;
  padding: 4px;
  overflow-x: auto;
  border: 1px solid var(--shell-line);
  border-radius: var(--r-s);
  background: rgba(255, 255, 255, 0.025);
}
.module-tabs .admin-tab {
  min-height: 36px;
  flex: 0 0 auto;
  padding: 0 15px;
  color: var(--shell-muted);
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  font-size: 13px;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.module-tabs .admin-tab:hover { color: var(--shell-text); background: rgba(255, 255, 255, 0.05); }
.module-tabs .admin-tab.active {
  color: #eef2ff;
  border-color: rgba(129, 140, 248, 0.42);
  background: rgba(79, 70, 229, 0.2);
}
.extsys-shell .section-subtitle { margin: 5px 0 0; color: #71809a; font-size: 12px; line-height: 1.5; }
.module-table { min-width: 760px; }
.module-table td { vertical-align: middle; }
.module-table input { margin: 0; min-width: 0; height: 34px; padding: 6px 10px; font-size: 13px; }
.module-table input:not([type="checkbox"]) { width: 100%; }
.module-table .module-badge { width: 72px; }
.module-table .module-key { min-width: 150px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.module-table .module-subtitle { min-width: 220px; }
.module-table .module-sort { width: 72px; }
.module-type { color: #9aa6bc; font-size: 12px; }
.module-table .active-toggle { margin: 0; white-space: nowrap; }

.secret-value {
  margin: 10px 0 4px;
  padding: 14px;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 14px;
  color: #a5f3fc;
  word-break: break-all;
  user-select: all;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
}

@media (max-width: 760px) {
  .extsys-form { grid-template-columns: 1fr; }
  .extsys-form .primary-button { width: 100%; }
  .module-tabs .admin-tab { padding: 0 11px; }
}

/* ===== 用户管理：可扩展权限工作区 ===== */
#admin-panel .admin-shell {
  min-width: 0;
}

#admin-panel .admin-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: -4px 0 20px;
  padding: 4px;
  overflow-x: auto;
  border: 1px solid var(--shell-line);
  border-radius: var(--r-s);
  background: rgba(255, 255, 255, 0.025);
}

#admin-panel .admin-tab {
  min-height: 36px;
  flex: 0 0 auto;
  padding: 0 15px;
  color: var(--shell-muted);
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  font-size: 13px;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}

#admin-panel .admin-tab:hover {
  color: var(--shell-text);
  background: rgba(255, 255, 255, 0.05);
}

#admin-panel .admin-tab.active {
  color: #eef2ff;
  border-color: rgba(129, 140, 248, 0.42);
  background: rgba(79, 70, 229, 0.2);
  box-shadow: 0 5px 15px -10px rgba(99, 102, 241, 0.8);
}

#admin-panel .admin-view {
  min-width: 0;
}

#admin-panel .section-subtitle {
  margin: 5px 0 0;
  color: #71809a;
  font-size: 12px;
  line-height: 1.5;
}

#admin-panel .section-count {
  flex: none;
  color: #a5b4fc;
  font-size: 12px;
  white-space: nowrap;
}

#admin-panel .users-toolbar {
  align-items: flex-end;
  margin-bottom: 12px;
}

#admin-panel .account-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  min-width: 0;
  margin: 0;
  padding: 18px;
  border: 1px solid var(--shell-line);
  border-radius: var(--r-s);
  background: rgba(255, 255, 255, 0.018);
}

#admin-panel .account-form > *,
#admin-panel .create-user-form > * {
  grid-area: auto !important;
}

#admin-panel .form-fields-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: end;
  gap: 12px;
  min-width: 0;
}

#admin-panel .batch-fields-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

#admin-panel .compact-field,
#permissions-modal .compact-field {
  min-width: 0;
  margin: 0;
  display: grid;
  gap: 6px;
  color: #9aa6bc;
  font-size: 12px;
}

#admin-panel .compact-field span,
#permissions-modal .compact-field span {
  color: #8b96a8;
  font-size: 12px;
}

#admin-panel .compact-field em,
#permissions-modal .compact-field em {
  margin-left: 4px;
  color: #5f6b82;
  font-size: 11px;
  font-style: normal;
  font-weight: 400;
}

#admin-panel .compact-field input,
#admin-panel .compact-field select,
#permissions-modal .compact-field input,
#permissions-modal .compact-field select {
  width: 100%;
  min-width: 0;
  margin: 0;
}

#admin-panel .form-check {
  min-height: 42px;
  align-self: end;
  padding: 0 12px;
  border: 1px solid var(--shell-line);
  border-radius: var(--r-s);
  background: rgba(255, 255, 255, 0.025);
}

#admin-panel .permission-picker,
#permissions-modal .permission-picker {
  min-width: 0;
  width: 100%;
  margin: 0;
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: var(--r-s);
  background: rgba(7, 12, 24, 0.22);
}

#admin-panel .account-form .permission-picker {
  border-color: rgba(129, 140, 248, 0.28);
}

#admin-panel .permission-picker > legend,
#permissions-modal .permission-picker > legend {
  width: auto;
  margin: 0;
  padding: 0;
  color: #c3cbdd;
  font-size: 13px;
  font-weight: 600;
}

#admin-panel .permission-picker-toolbar,
#permissions-modal .permission-picker-toolbar {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

#admin-panel .permission-picker-actions,
#permissions-modal .permission-picker-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  flex: 0 0 328px;
  flex-wrap: nowrap;
}

#admin-panel .permission-picker-summary,
#permissions-modal .permission-picker-summary {
  color: #8b96a8;
  font-size: 12px;
}

#admin-panel .permission-search,
#permissions-modal .permission-search {
  min-width: 0;
  width: auto;
  flex: 1 1 auto;
  height: 34px;
  margin: 0;
  font-size: 12px;
}

#admin-panel .permission-grid,
#permissions-modal .permission-grid {
  min-width: 0;
  max-height: 190px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 8px;
  padding: 2px;
}

#admin-panel .permission-option,
#permissions-modal .permission-option {
  min-width: 0;
  min-height: 38px;
  margin: 0;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #b6c1d3;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  font-size: 13px;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

#admin-panel .permission-option:hover,
#admin-panel .permission-option:focus-within,
#admin-panel .permission-option.selected,
#permissions-modal .permission-option:hover,
#permissions-modal .permission-option:focus-within,
#permissions-modal .permission-option.selected {
  color: #eef2ff;
  border-color: rgba(129, 140, 248, 0.65);
  background: rgba(79, 70, 229, 0.16);
}

#admin-panel .permission-option input,
#permissions-modal .permission-option input {
  width: 16px;
  height: 16px;
  flex: none;
  margin: 0;
}

#admin-panel .permission-picker-empty,
#permissions-modal .permission-picker-empty {
  grid-column: 1 / -1;
  margin: 4px 0;
  color: #69768d;
  font-size: 12px;
  text-align: center;
}

#admin-panel .form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

#admin-panel .users-table-wrap {
  min-width: 0;
  max-height: min(64svh, 700px);
  overflow: auto;
  overscroll-behavior: contain;
}

#admin-panel .users-table {
  width: 100%;
  min-width: 1140px;
  table-layout: fixed;
}

#admin-panel .users-table th,
#admin-panel .users-table td {
  vertical-align: middle;
}

#admin-panel .users-table th {
  position: sticky;
  top: 0;
  z-index: 3;
}

#admin-panel .users-table th:nth-child(1),
#admin-panel .users-table td:nth-child(1) { width: 160px; }
#admin-panel .users-table th:nth-child(2),
#admin-panel .users-table td:nth-child(2) { width: 130px; }
#admin-panel .users-table th:nth-child(3),
#admin-panel .users-table td:nth-child(3) { width: 280px; }
#admin-panel .users-table th:nth-child(4),
#admin-panel .users-table td:nth-child(4) { width: 130px; }
#admin-panel .users-table th:nth-child(5),
#admin-panel .users-table td:nth-child(5) { width: 120px; }
#admin-panel .users-table th:nth-child(6),
#admin-panel .users-table td:nth-child(6) { width: 320px; }

#admin-panel .users-table th:nth-child(-n+2) {
  position: sticky;
  left: 0;
  z-index: 5;
  background: #1a2335;
}

#admin-panel .users-table th:nth-child(2) { left: 160px; box-shadow: 8px 0 14px -14px rgba(0, 0, 0, 0.9); }
#admin-panel .users-table td:nth-child(-n+2) {
  position: sticky;
  z-index: 2;
  background: rgba(21, 28, 44, 0.99);
}
#admin-panel .users-table td:nth-child(1) { left: 0; }
#admin-panel .users-table td:nth-child(2) { left: 160px; box-shadow: 8px 0 14px -14px rgba(0, 0, 0, 0.9); }

#admin-panel .user-display-name,
#admin-panel .user-remark {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

#admin-panel .user-permissions-cell,
#admin-panel .user-actions-cell {
  white-space: normal;
}

#admin-panel .user-actions-cell { min-width: 220px; }
#admin-panel .user-actions-cell .row-actions { min-width: 0; flex-wrap: wrap; }

#admin-panel .permission-summary {
  min-width: 0;
  display: grid;
  gap: 6px;
}

#admin-panel .permission-summary-head {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

#admin-panel .permission-count { color: #c7d2fe; font-size: 12px; }
#admin-panel .permission-note { color: #71809a; font-size: 12px; }
#admin-panel .permission-tags { min-width: 0; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
#admin-panel .permission-tag,
#admin-panel .permission-more {
  max-width: 150px;
  padding: 3px 7px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #c7d2fe;
  border: 1px solid rgba(129, 140, 248, 0.36);
  border-radius: 999px;
  background: rgba(79, 70, 229, 0.14);
  font-size: 11px;
}
#admin-panel .permission-more { color: #a5b4fc; }

#admin-panel .scheduled-tasks-table-wrap,
#admin-panel .task-history-table-wrap { min-width: 0; max-height: min(58svh, 650px); overflow: auto; }
#admin-panel .scheduled-tasks-toolbar-actions { display: flex; align-items: center; gap: 10px; }
#admin-panel .task-history-filters label { display: flex; align-items: center; gap: 6px; color: #aebbd1; font-size: 12px; }
#admin-panel .task-history-filters select,
#admin-panel .task-history-filters input { min-height: 32px; padding: 5px 8px; border: 1px solid var(--shell-line); border-radius: 5px; color: #e4eaf4; background: #141b29; }
#admin-panel .scheduled-tasks-tabs { margin: -4px 0 18px; }
#admin-panel .scheduled-tasks-tabs .admin-tab { min-height: 36px; }
#admin-panel .scheduled-tasks-table { width: 100%; min-width: 980px; table-layout: fixed; }
#admin-panel .scheduled-tasks-table th,
#admin-panel .scheduled-tasks-table td { vertical-align: middle; }
#admin-panel .scheduled-tasks-table th { position: sticky; top: 0; z-index: 2; }
#admin-panel .scheduled-tasks-table th:nth-child(1), #admin-panel .scheduled-tasks-table td:nth-child(1) { width: 290px; }
#admin-panel .scheduled-tasks-table th:nth-child(2), #admin-panel .scheduled-tasks-table td:nth-child(2) { width: 190px; }
#admin-panel .scheduled-tasks-table th:nth-child(3), #admin-panel .scheduled-tasks-table td:nth-child(3) { width: 125px; }
#admin-panel .scheduled-tasks-table th:nth-child(4), #admin-panel .scheduled-tasks-table td:nth-child(4) { width: 165px; }
#admin-panel .scheduled-tasks-table th:nth-child(5), #admin-panel .scheduled-tasks-table td:nth-child(5) { width: 165px; }
#admin-panel .scheduled-tasks-table th:nth-child(6), #admin-panel .scheduled-tasks-table td:nth-child(6) { width: 310px; }
#admin-panel .task-description,
#admin-panel .task-error { display: block; margin-top: 4px; color: #71809a; font-size: 11px; line-height: 1.45; }
#admin-panel .task-error { color: #fca5a5; }
#admin-panel .task-time-control { display: flex; align-items: center; gap: 4px; }
#admin-panel .task-time-input { width: 58px; min-width: 0; padding: 7px 5px; text-align: center; }
#admin-panel .task-time-zone { display: block; margin-top: 4px; color: #71809a; font-size: 10px; }
#admin-panel .task-fixed-time { color: #c7d2fe; }
#admin-panel .task-enabled { margin-right: 4px; }
#admin-panel .task-history { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--shell-line); }
#admin-panel .task-history-filters { display: flex; align-items: end; flex-wrap: wrap; gap: 10px; margin: 14px 0; }
#admin-panel .task-history-pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; color: #93a3bb; font-size: 12px; }
#admin-panel .task-history table { width: 100%; min-width: 780px; }
#admin-panel .task-run-message { max-width: 360px; white-space: pre-wrap; word-break: break-word; }

#permissions-modal { z-index: 35; padding: 24px; }
#permissions-modal .permissions-modal {
  width: min(760px, 100%);
  max-height: calc(100svh - 48px);
  min-width: 0;
  overflow: auto;
}
#permissions-modal .permission-grid { max-height: min(52svh, 460px); }
#permissions-modal .user-settings-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 14px;
  margin-bottom: 18px;
}
#permissions-modal .user-settings-fields label { min-width: 0; }
#permissions-modal .user-settings-fields .inline-check { align-self: center; margin: 0; }
#permissions-modal .user-settings-remark { grid-column: 1 / -1; }
#permissions-modal textarea {
  width: 100%;
  min-width: 0;
  resize: vertical;
  padding: 10px 12px;
  font: inherit;
  color: inherit;
  background: #141b29;
  border: 1px solid var(--shell-line);
  border-radius: 5px;
}
#permissions-modal .permissions-modal .form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 18px;
}
#permissions-modal .permissions-modal .form-actions .primary-button { width: auto; }

@media (max-width: 900px) {
  #admin-panel .admin-shell { padding: 22px; }
  #admin-panel .permission-grid,
  #permissions-modal .permission-grid { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
}

@media (max-width: 700px) {
  #admin-panel { padding: 18px; }
  #admin-panel .admin-shell { padding: 18px; }
  #admin-panel .form-fields-grid,
  #admin-panel .batch-fields-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #admin-panel .permission-picker-toolbar,
  #permissions-modal .permission-picker-toolbar { align-items: flex-start; flex-direction: column; }
  #admin-panel .permission-picker-actions,
  #permissions-modal .permission-picker-actions { width: 100%; flex: 1 1 auto; justify-content: flex-start; flex-wrap: wrap; }
  #admin-panel .permission-search,
  #permissions-modal .permission-search { flex: 1 1 160px; }
  #permissions-modal { padding: 14px; }
}

@media (max-width: 520px) {
  #admin-panel { padding: 0; }
  #admin-panel .admin-shell {
    min-height: 100svh;
    padding: 18px;
    border-width: 0;
    border-radius: 0;
  }
  #admin-panel .form-fields-grid,
  #admin-panel .batch-fields-grid { grid-template-columns: minmax(0, 1fr); }
  #admin-panel .admin-tabs { margin-bottom: 16px; }
  #admin-panel .admin-tab { flex: 1 0 auto; padding: 0 11px; }
  #admin-panel .form-actions,
  #permissions-modal .form-actions { align-items: stretch; flex-direction: column; }
  #admin-panel .form-actions > *,
  #permissions-modal .form-actions > * { width: 100%; }
  #permissions-modal { padding: 10px; }
  #permissions-modal .permissions-modal { max-height: calc(100svh - 20px); padding: 20px; }
  #permissions-modal .user-settings-fields { grid-template-columns: minmax(0, 1fr); }
  #admin-panel .users-table th:nth-child(2),
  #admin-panel .users-table td:nth-child(2) {
    position: static;
    box-shadow: none;
  }
  #admin-panel .permission-grid,
  #permissions-modal .permission-grid { grid-template-columns: minmax(0, 1fr); }
}
