:root {
  --sidebar: #eef6ff;
  --sidebar-2: #dbeafe;
  --sidebar-text: #334155;
  --sidebar-text-strong: #0f3f78;
  --sidebar-border: #cfe1f7;
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --topbar: #ffffff;
  --soft: #f3f4f6;
  --soft-2: #f8fafc;
  --field: #ffffff;
  --primary: #2563eb;
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --shadow: 0 10px 26px rgba(15, 23, 42, .06);
}

:root[data-theme="dark"] {
  --sidebar: #0b1720;
  --sidebar-2: #152b35;
  --sidebar-text: #cbd5e1;
  --sidebar-text-strong: #ffffff;
  --sidebar-border: #263449;
  --bg: #0f172a;
  --card: #172033;
  --text: #e5edf7;
  --muted: #94a3b8;
  --line: #263449;
  --topbar: #121c2d;
  --soft: #1f2a3d;
  --soft-2: #141f31;
  --field: #101a2b;
  --shadow: 0 10px 26px rgba(0, 0, 0, .22);
}

* { box-sizing: border-box; }
html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  font-weight: 400;
  letter-spacing: 0;
}
button, input, select, textarea {
  font: inherit;
}
code {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.hidden { display: none !important; }

.login-view {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 64px 24px;
  overflow: hidden;
  background:
    linear-gradient(138deg, rgba(255, 255, 255, .92) 0%, rgba(235, 246, 255, .88) 36%, rgba(201, 226, 252, .92) 100%),
    #dceeff;
}
.login-view::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(42deg, transparent 0 40%, rgba(62, 139, 220, .30) 40.3%, rgba(62, 139, 220, .08) 48%, transparent 58%),
    linear-gradient(158deg, transparent 0 52%, rgba(255, 255, 255, .72) 52.3%, rgba(255, 255, 255, .26) 62%, transparent 72%);
  opacity: .88;
}
.login-view::after {
  content: "";
  position: absolute;
  left: -8%;
  right: -8%;
  bottom: -18%;
  height: 44%;
  background: linear-gradient(180deg, rgba(255, 255, 255, .56), rgba(127, 183, 241, .20));
  transform: rotate(-3deg);
  transform-origin: center;
}
.login-page-brand {
  position: absolute;
  top: 58px;
  left: 68px;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #08111f;
}
.login-page-brand strong {
  display: block;
  font-style: normal;
  letter-spacing: 0;
  font-size: 28px;
  font-weight: 900;
  line-height: 1.08;
}
.login-brand-mark {
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, #0b4e9c 0%, #0e63bd 100%);
  color: #fff;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: .5px;
  box-shadow: 0 16px 32px rgba(11, 78, 156, .22);
}
.login-shell {
  width: min(520px, 100%);
}
.login-hero-panel {
  display: none;
}
.login-brand-invert h1,
.login-brand-invert p {
  color: var(--text);
}
.login-hero-copy {
  display: none;
}
.login-kicker {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 9px;
  border: 1px solid #d6e4ff;
  border-radius: 999px;
  color: #2454c6;
  background: #f5f8ff;
  font-size: 12px;
  font-weight: 700;
}
.login-hero-copy h2 {
  display: none;
}
.login-hero-copy p {
  display: none;
}
.login-metrics {
  display: none;
}
.login-metrics div {
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid #e8edf5;
  border-radius: 8px;
  background: #fbfcff;
}
.login-metrics strong {
  display: block;
  color: #172033;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.1;
}
.login-metrics span {
  display: block;
  margin-top: 6px;
  color: #748094;
  font-size: 12px;
}
.login-card {
  width: 100%;
  background: rgba(255, 255, 255, .94);
  border: 1px solid rgba(255, 255, 255, .86);
  border-radius: 10px;
  box-shadow: 0 24px 70px rgba(20, 80, 145, .20);
  padding: 44px 46px 34px;
}
.login-card-unified {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
}
.login-brand {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 24px;
}
.login-brand-main {
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid #edf1f6;
}
.compact-brand {
  margin: 18px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft-2);
}
.compact-brand strong,
.compact-brand span {
  display: block;
}
.compact-brand span {
  color: var(--muted);
  font-size: 12px;
}
.login-card-head h2 {
  margin: 0 0 38px;
  color: #050b16;
  font-size: 32px;
  line-height: 1.2;
  letter-spacing: 0;
}
.login-card-head p {
  display: none;
}
.login-reset-card .login-card-head p {
  display: block;
  margin: -24px 0 26px;
  color: #64748b;
  font-size: 14px;
}
.login-form-panel {
  padding-top: 0;
}
.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  background: #2563eb;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(37, 99, 235, .18);
}
.brand-mark.small {
  width: 32px;
  height: 32px;
  font-size: 12px;
}
.login-brand h1 {
  margin: 0;
  color: #172033;
  font-size: 21px;
  font-weight: 800;
}
.login-brand p {
  margin: 4px 0 0;
  color: #6b7484;
}
.login-brand-invert p {
  color: #cbd5e1;
}
.login-card .login-kicker {
  color: #1d4ed8;
  border-color: #bfdbfe;
  background: #eff6ff;
}
.login-card label {
  margin: 0;
}
.login-card input,
.filters input,
.filters select {
  width: 100%;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  outline: none;
  background: var(--field);
  color: var(--text);
}
.login-card input {
  height: 52px;
  border-color: transparent;
  background: transparent;
  font-size: 16px;
}
.login-card input:focus,
.filters input:focus,
.filters select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .10);
}
.login-card .login-field input:focus {
  border-color: transparent;
  box-shadow: none;
}
.login-field {
  position: relative;
  display: flex !important;
  align-items: center;
  height: 52px;
  margin-bottom: 24px !important;
  border: 1px solid #d9dfe8;
  border-radius: 8px;
  background: rgba(255, 255, 255, .88);
  overflow: hidden;
}
.login-field:focus-within {
  border-color: #1f5fae;
  box-shadow: 0 0 0 3px rgba(31, 95, 174, .10);
}
.login-field-prefix {
  width: 62px;
  height: 100%;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-right: 1px solid #e5eaf1;
  color: #657083;
  font-size: 14px;
  font-weight: 700;
  background: rgba(247, 250, 253, .72);
}
.login-field input {
  flex: 1;
  min-width: 0;
  padding: 0 18px;
  color: #0f172a;
}
.login-field input::placeholder {
  color: #a1a8b3;
}
.login-textarea-field {
  display: block !important;
  margin-bottom: 22px !important;
}
.login-textarea-field span {
  display: block;
  margin-bottom: 8px;
  color: #334155;
  font-weight: 700;
}
.login-textarea-field textarea {
  width: 100%;
  min-height: 92px;
  resize: vertical;
  border: 1px solid #d9dfe8;
  border-radius: 8px;
  padding: 12px 14px;
  outline: none;
  color: #0f172a;
  background: rgba(255, 255, 255, .88);
}
.login-textarea-field textarea:focus {
  border-color: #1f5fae;
  box-shadow: 0 0 0 3px rgba(31, 95, 174, .10);
}
.login-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 2px 0 28px;
  color: #1b3868;
  font-size: 14px;
}
.remember-row {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  color: #1f2937;
}
.remember-row input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  accent-color: #0f4e9c;
}
.login-options a {
  color: #123f78;
  text-decoration: none;
}
.login-options a:hover {
  color: #0b59b0;
}
.login-footnote {
  margin-top: 12px;
  color: #7b8494;
  font-size: 12px;
  text-align: center;
}
.login-copyright {
  margin-top: 34px;
  color: #1f2937;
  font-size: 14px;
  text-align: center;
}
.login-copyright,
.site-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 14px;
}
.login-copyright a,
.site-footer a {
  color: #315d92;
  text-decoration: none;
}
.login-copyright a:hover,
.site-footer a:hover {
  color: #0b59b0;
  text-decoration: underline;
}
.primary-btn,
.ghost-btn,
.icon-btn {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}
.primary-btn {
  width: 100%;
  height: 40px;
  margin-top: 18px;
  color: #fff;
  background: var(--primary);
  font-weight: 700;
}
.login-card .primary-btn {
  height: 58px;
  margin-top: 0;
  border: 1px solid #0b4082;
  border-radius: 8px;
  background: #0d4c96;
  box-shadow: 0 16px 28px rgba(13, 76, 150, .24);
  font-size: 18px;
  font-weight: 800;
}
.login-card .primary-btn:hover {
  background: #083d7c;
}
.login-secondary-btn {
  width: 100%;
  height: 58px;
  margin-top: 12px;
  border-radius: 8px;
  background: #f1f5f9;
  color: #123f78;
  font-size: 18px;
  font-weight: 800;
}
.login-secondary-btn:hover {
  background: #e2e8f0;
}
.login-card .form-error {
  margin-top: 10px;
  text-align: center;
}
.small-btn {
  width: auto;
  min-width: 88px;
  margin-top: 0;
}
.ghost-btn {
  height: 34px;
  padding: 0 12px;
  color: var(--text);
  background: var(--soft);
}
.login-card .login-secondary-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 58px;
  padding: 0;
  border-radius: 8px;
  background: #f1f5f9;
  color: #123f78;
  font-size: 18px;
  font-weight: 800;
}
.ghost-link {
  color: var(--text);
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 8px;
}
.ghost-link:hover,
.ghost-btn:hover,
.icon-btn:hover {
  background: var(--line);
}
.icon-btn {
  width: 36px;
  height: 36px;
  background: var(--soft);
}
.form-error {
  min-height: 20px;
  margin-top: 12px;
  color: var(--danger);
  font-size: 13px;
}
.form-error.success {
  color: var(--success);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 208px minmax(0, 1fr);
}
.app-shell.sidebar-collapsed {
  grid-template-columns: 76px minmax(0, 1fr);
}
.sidebar {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .72), rgba(236, 247, 255, .88)),
    var(--sidebar);
  color: var(--sidebar-text);
  border-right: 1px solid var(--sidebar-border);
  padding: 18px 12px;
  overflow: hidden;
}
:root[data-theme="dark"] .sidebar {
  background: var(--sidebar);
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 42px;
  margin-bottom: 18px;
  padding: 0 8px;
  color: var(--sidebar-text-strong);
  font-weight: 800;
}
.sidebar-brand span {
  white-space: nowrap;
  transition: opacity .15s ease;
}
.sidebar nav {
  display: grid;
  gap: 4px;
}
.nav-item {
  width: 100%;
  height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  color: var(--sidebar-text);
  background: transparent;
  border: 0;
  border-radius: 8px;
  text-align: left;
  cursor: pointer;
  font-weight: 600;
  white-space: nowrap;
}
.nav-item:hover,
.nav-item.active {
  color: var(--sidebar-text-strong);
  background: var(--sidebar-2);
}
.nav-item.active {
  box-shadow: inset 3px 0 0 #2563eb;
}
.nav-item span {
  width: 18px;
  text-align: center;
  flex: 0 0 18px;
}
.sidebar-collapsed .sidebar {
  padding-left: 10px;
  padding-right: 10px;
}
.sidebar-collapsed .sidebar-brand {
  justify-content: center;
  padding: 0;
}
.sidebar-collapsed .sidebar-brand > span {
  opacity: 0;
  width: 0;
  overflow: hidden;
}
.sidebar-collapsed .nav-item {
  justify-content: center;
  gap: 0;
  padding: 0;
  font-size: 0;
}
.sidebar-collapsed .nav-item span {
  font-size: 17px;
}

.workspace {
  min-width: 0;
}
.topbar {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: var(--topbar);
  border-bottom: 1px solid var(--line);
}
.topbar-left {
  display: flex;
  align-items: center;
  min-width: 48px;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-badge {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}
.admin-chip {
  height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px 0 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft-2);
}
.admin-avatar {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #b45309;
  background: #ffedd5;
  font-size: 12px;
  font-weight: 800;
}
.topbar-icon-btn {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--card);
  cursor: pointer;
  font-size: 16px;
}
.topbar-icon-btn:hover {
  background: var(--soft);
}
.sidebar-toggle {
  color: var(--muted);
  background: transparent;
}
.sidebar-toggle:hover {
  color: var(--text);
  background: var(--soft);
}
.topbar-logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.content {
  padding: 32px 24px 24px;
}
.site-footer {
  padding: 0 24px 20px;
  color: var(--muted);
  font-size: 12px;
}
.page {
  display: none;
}
.page.active {
  display: block;
}
.page-title {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 18px;
}
.page-title-with-actions {
  justify-content: space-between;
}
.page-title-with-actions > div:nth-child(2) {
  min-width: 0;
  flex: 1;
}
.page-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}
.page-action-btn {
  min-width: 88px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line);
  color: var(--text);
  background: var(--card);
  box-shadow: 0 4px 12px rgba(15, 23, 42, .04);
  font-weight: 700;
}
.page-action-btn:hover {
  color: var(--primary);
  border-color: rgba(37, 99, 235, .28);
  background: #f8fbff;
}
.page-action-btn:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
:root[data-theme="dark"] .page-action-btn:hover {
  background: var(--soft);
}
.page-actions .primary-btn,
.form-actions .primary-btn,
.subpage-head .primary-btn {
  width: auto;
  margin-top: 0;
}
.page-actions .page-action-btn {
  margin-top: 0;
}
.title-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: var(--primary);
  font-size: 20px;
}
.page-title h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
}
.page-title p {
  margin: 4px 0 0;
  color: var(--muted);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
.metric-card,
.panel,
.config-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.metric-card {
  padding: 18px;
}
.clickable-card {
  width: 100%;
  border: 1px solid var(--line);
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.clickable-card:hover {
  border-color: rgba(37, 99, 235, .45);
  box-shadow: 0 12px 28px rgba(37, 99, 235, .12);
}
.metric-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
}
.metric-value {
  margin-top: 10px;
  font-size: 26px;
  font-weight: 800;
}
.metric-sub {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.panel {
  padding: 16px;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.panel-head h3 {
  margin: 0;
  font-size: 16px;
}
.panel-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.filters {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 180px 140px 90px;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}
.checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #4b5563;
}
.switch-row {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  padding: 0 2px;
}
.filter-switch {
  width: 120px;
  justify-content: flex-start;
  gap: 10px;
  color: #4b5563;
  font-size: 13px;
  font-weight: 700;
}
.switch {
  position: relative;
  width: 42px;
  height: 24px;
  flex: 0 0 auto;
}
.switch input {
  position: absolute;
  inset: 0;
  width: 42px;
  height: 24px;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}
.switch i {
  position: absolute;
  inset: 0;
  display: block;
  border-radius: 999px;
  background: #cbd5e1;
  transition: background .16s ease;
}
.switch i::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .22);
  transition: transform .16s ease;
}
.switch input:checked + i {
  background: var(--primary);
}
.switch input:checked + i::after {
  transform: translateX(18px);
}
.switch input:focus-visible + i {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .18);
}
.stack {
  display: grid;
  gap: 16px;
}
.form-grid {
  display: grid;
  gap: 12px;
}
.form-grid label {
  display: grid;
  gap: 6px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}
.form-grid input,
.form-grid select,
.form-grid textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  background: var(--field);
  color: var(--text);
  font-weight: 400;
}
.form-grid input,
.form-grid select {
  height: 38px;
  padding: 0 10px;
}
.form-grid textarea {
  min-height: 108px;
  padding: 10px;
  resize: vertical;
  line-height: 1.5;
}
.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .10);
}
.table-wrap {
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1180px;
}
th, td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
  font-size: 13px;
}
th {
  color: #64748b;
  background: var(--soft-2);
  font-weight: 700;
}
td {
  color: var(--text);
}
.clickable-row {
  cursor: pointer;
}
.clickable-row:hover td {
  background: var(--soft-2);
}
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
}
.tag.success { color: #166534; background: #dcfce7; }
.tag.warning { color: #92400e; background: #fef3c7; }
.tag.danger { color: #991b1b; background: #fee2e2; }
.tag.info { color: #1d4ed8; background: #dbeafe; }
.link-btn {
  border: 0;
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  font-weight: 700;
}
.detail-table-wrap table {
  min-width: 980px;
}
.danger-link {
  color: var(--danger);
}
.actions-cell {
  display: flex;
  gap: 10px;
}
.remark-cell {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.summary-table {
  min-width: 1280px;
}
.summary-table td {
  vertical-align: top;
  line-height: 1.55;
}
.progress-line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}
.muted-text {
  color: var(--muted);
  font-size: 12px;
}
.bar-chart {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  align-items: end;
  gap: 10px;
  min-height: 220px;
  padding-top: 20px;
}
.bar {
  display: grid;
  align-items: end;
  gap: 8px;
  min-width: 0;
  text-align: center;
}
.bar-fill {
  min-height: 8px;
  border-radius: 6px 6px 0 0;
  background: var(--primary);
}
.bar-label {
  color: var(--muted);
  font-size: 12px;
}
.rank-list,
.log-list,
.role-list {
  display: grid;
  gap: 10px;
}
.rank-item,
.log-item,
.follow-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft-2);
  font-size: 13px;
}
.follow-item {
  align-items: flex-start;
}
.follow-item strong,
.follow-item span,
.follow-item time {
  display: block;
}
.follow-item span {
  margin-top: 3px;
  color: var(--primary);
  font-weight: 700;
}
.follow-item p {
  margin: 5px 0 0;
  color: var(--muted);
}
.follow-item time {
  color: var(--muted);
  white-space: nowrap;
}
.role-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft-2);
}
.role-card div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.role-card code {
  color: var(--muted);
  font-size: 12px;
}
.role-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
.role-perms {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.user-subview {
  display: grid;
  gap: 16px;
}
.user-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.user-stat-card {
  min-height: 110px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.user-stat-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}
.user-stat-card strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
  line-height: 1.1;
}
.user-stat-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.user-list-panel {
  min-width: 0;
}
.subpage-head {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 64px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.subpage-head > div {
  min-width: 0;
  flex: 1;
}
.subpage-head h3 {
  margin: 0;
  font-size: 18px;
}
.subpage-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.user-form-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
}
.user-form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.user-form-grid input[type="hidden"] {
  display: none;
}
.user-form-grid #newStoreScopeWrap {
  grid-column: 1 / -1;
}
.form-switch-row {
  align-self: end;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--soft-2);
}
.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}
.user-guide-panel h3 {
  margin: 0 0 12px;
  font-size: 16px;
}
.guide-list {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}
.guide-list div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft-2);
}
.guide-list strong,
.guide-list span {
  display: block;
}
.guide-list span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}
.role-page-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.role-page-list .role-card {
  align-content: start;
  min-height: 150px;
}
.config-grid {
  display: grid;
  gap: 16px;
}
.config-card {
  padding: 18px;
  min-width: 0;
}
.integration-panel {
  min-width: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.integration-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}
.integration-head h3 {
  margin: 0;
  font-size: 17px;
}
.integration-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.integration-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}
.integration-status {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
  background: var(--soft-2);
}
.integration-status div {
  min-width: 0;
  padding: 13px 18px;
  border-right: 1px solid var(--line);
}
.integration-status div:last-child {
  border-right: 0;
}
.integration-status span,
.callback-preview span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.integration-status strong {
  display: block;
  margin-top: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-size: 15px;
}
.integration-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 18px;
  padding: 18px;
}
.integration-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
}
.integration-form .wide-field {
  grid-column: 1 / -1;
}
.config-toggle {
  align-self: end;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--soft-2);
}
.integration-help {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft-2);
}
.integration-help h4 {
  margin: 0 0 12px;
  font-size: 15px;
}
.integration-help dl {
  display: grid;
  gap: 10px;
  margin: 0;
}
.integration-help dl div {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px;
}
.integration-help dt {
  color: var(--muted);
  font-size: 12px;
}
.integration-help dd {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.55;
}
.callback-preview {
  display: grid;
  gap: 6px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.callback-preview code {
  display: block;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #1e3a8a;
  background: var(--soft);
  font-size: 12px;
}
.config-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.config-row span:first-child {
  color: var(--muted);
}
.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}
.pager-total {
  margin-right: 4px;
  color: var(--muted);
  font-size: 13px;
}
.pager-btn {
  min-width: 34px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--card);
  cursor: pointer;
}
.pager-btn.active {
  color: #fff;
  border-color: var(--primary);
  background: var(--primary);
}
.pager-btn:disabled {
  cursor: not-allowed;
  color: #9ca3af;
  background: #f3f4f6;
}
.pager-ellipsis {
  color: var(--muted);
}
.form-grid select[multiple] {
  height: auto;
  min-height: 116px;
  padding: 8px 10px;
}
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(620px, 100vw);
  height: 100vh;
  background: var(--card);
  border-left: 1px solid var(--line);
  box-shadow: -12px 0 30px rgba(15, 23, 42, .12);
  z-index: 20;
  display: flex;
  flex-direction: column;
}
.drawer-head {
  height: 74px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}
.drawer-head h3 {
  margin: 0;
}
.drawer-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.drawer-body {
  padding: 18px;
  overflow: auto;
}
.drawer-json {
  margin: 0;
  padding: 14px;
  overflow: auto;
  white-space: pre-wrap;
  font-family: Consolas, Monaco, monospace;
  font-size: 12px;
  color: #dbeafe;
  background: #0f172a;
  border-radius: 8px;
}
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.detail-item {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft-2);
}
.detail-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.detail-item strong {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
}
.drawer-section {
  margin-top: 16px;
}
.drawer-section h4 {
  margin: 0 0 10px;
  font-size: 15px;
}
.process-list {
  display: grid;
  gap: 8px;
}
.process-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft-2);
}
.process-item span {
  color: var(--muted);
}
.drawer-form {
  padding: 18px;
  overflow: auto;
}
.drawer-form .primary-btn {
  margin-top: 16px;
}
.lead-context {
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--soft-2);
  font-size: 13px;
}

@media (max-width: 1100px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-hero-panel { min-height: 420px; }
  .app-shell { grid-template-columns: 76px minmax(0, 1fr); }
  .sidebar-brand span,
  .nav-item { font-size: 0; }
  .nav-item span { font-size: 17px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2, .config-grid { grid-template-columns: 1fr; }
  .user-stats-grid,
  .role-page-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .user-form-layout { grid-template-columns: 1fr; }
  .integration-status { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .integration-status div:nth-child(2) { border-right: 0; }
  .integration-status div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .integration-body { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .login-view {
    align-items: flex-start;
    padding: 112px 18px 24px;
  }
  .login-page-brand {
    top: 24px;
    left: 20px;
    right: 20px;
  }
  .login-page-brand strong {
    font-size: 20px;
  }
  .login-brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    font-size: 15px;
  }
  .login-hero-panel,
  .login-card { padding: 22px; }
  .login-card-head h2 { font-size: 28px; }
  .login-hero-copy h2 { font-size: 26px; }
  .login-metrics { grid-template-columns: 1fr; }
  .content { padding: 24px 14px 14px; }
  .metric-grid { grid-template-columns: 1fr; }
  .page-title-with-actions {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .page-actions {
    width: 100%;
    justify-content: flex-end;
  }
  .user-stats-grid,
  .role-page-list,
  .user-form-grid {
    grid-template-columns: 1fr;
  }
  .subpage-head {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .subpage-head .primary-btn {
    margin-left: auto;
  }
  .filters { grid-template-columns: 1fr; }
  .integration-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .integration-actions {
    width: 100%;
    justify-content: space-between;
  }
  .integration-status { grid-template-columns: 1fr; }
  .integration-status div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .integration-status div:last-child {
    border-bottom: 0;
  }
  .integration-form { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
}
