:root {
  --canvas: #f5f6f7;
  --surface: #ffffff;
  --surface-soft: #f8f9fa;
  --surface-hover: #f2f4f5;
  --ink: #202327;
  --muted: #858b93;
  --line: #e7e9ec;
  --line-dark: #d5d8dd;
  --brand: #b33737;
  --brand-soft: #fff1f0;
  --teal: #16756b;
  --teal-soft: #eaf5f2;
  --gold: #a66f20;
  --gold-soft: #fbf3e5;
  --blue: #356a8a;
  --blue-soft: #edf4f8;
  --danger: #b42318;
  --shadow: 0 8px 26px rgba(32, 35, 39, 0.08);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

* { box-sizing: border-box; letter-spacing: 0; }
[hidden] { display: none !important; }
html, body { min-height: 100%; }
body { margin: 0; background: var(--canvas); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.48; }
h1, h2, h3, h4, p, dl, dd { margin: 0; }
a { color: inherit; }
:focus-visible { outline: 2px solid rgba(179, 55, 55, 0.4); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.primary-button,
.secondary-button,
.danger-button,
.icon-button,
.text-button,
.operator-button,
.table-button,
.filter-button {
  min-height: 36px;
  border: 1px solid var(--line-dark);
  border-radius: 6px;
  background: var(--surface);
  font-weight: 600;
}

.primary-button { width: 100%; min-height: 46px; border-color: var(--brand); color: #fff; background: var(--brand); }
.primary-button:hover, .danger-button:hover { filter: brightness(0.96); }
.secondary-button { padding: 0 15px; background: var(--surface); }
.secondary-button:hover, .icon-button:hover, .table-button:hover { background: var(--surface-hover); }
.danger-button { padding: 0 16px; border-color: var(--danger); color: #fff; background: var(--danger); }
.icon-button { min-width: 38px; padding: 0 10px; }

/* Access */
.access-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(260px, 380px) minmax(360px, 440px);
  align-content: center;
  justify-content: center;
  gap: 64px;
  padding: 44px 24px;
  background: var(--canvas);
}
.access-brand { align-self: center; display: flex; align-items: center; gap: 18px; }
.access-brand small,
.access-heading p,
.page-heading p,
.detail-drawer header p,
.operation-modal header p {
  color: var(--brand);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}
.access-brand h1 { margin-top: 7px; max-width: 300px; font-size: 34px; line-height: 1.25; }
.brand-mark { display: grid; place-items: center; width: 62px; height: 62px; flex: 0 0 auto; border-radius: 7px; background: #191a1c; }
.brand-mark.compact { width: 38px; height: 38px; box-shadow: none; }
.admin-brand-art { position: relative; overflow: hidden; background: #17130f; }
.admin-brand-art img { position: absolute; top: -18%; left: -21%; display: block; width: 482%; max-width: none; height: auto; user-select: none; pointer-events: none; }
.cat-face { --cat-bg: #fff; --cat-ink: #191a1c; position: relative; display: inline-block; width: 31px; height: 28px; border-radius: 46% 46% 42% 42%; background: var(--cat-bg); }
.cat-face::before, .cat-face::after { content: ""; position: absolute; top: -7px; width: 14px; height: 15px; background: var(--cat-bg); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.cat-face::before { left: 1px; transform: rotate(-18deg); }
.cat-face::after { right: 1px; transform: rotate(18deg); }
.cat-face i::before { content: ""; position: absolute; left: 8px; top: 11px; width: 4px; height: 5px; border-radius: 50%; background: var(--cat-ink); box-shadow: 11px 0 0 var(--cat-ink); }
.cat-face i::after { content: ""; position: absolute; left: 14px; top: 18px; width: 5px; height: 4px; border-radius: 50%; background: var(--cat-ink); }
.compact .cat-face { width: 21px; height: 19px; }
.compact .cat-face::before, .compact .cat-face::after { top: -5px; width: 9px; height: 10px; }
.compact .cat-face i::before { left: 5px; top: 7px; width: 3px; height: 3px; box-shadow: 8px 0 0 var(--cat-ink); }
.compact .cat-face i::after { left: 9px; top: 12px; width: 4px; height: 3px; }
.access-panel { padding: 30px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); }
.access-heading { margin-bottom: 26px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.access-heading h2 { margin-top: 6px; font-size: 28px; }
.access-panel > label { display: block; margin-bottom: 9px; font-size: 13px; font-weight: 700; }
.access-tabs { display: grid; grid-template-columns: 1fr 1fr; margin: -8px 0 20px; border-bottom: 1px solid var(--line); }
.access-tabs button { min-height: 42px; border: 0; border-bottom: 2px solid transparent; color: var(--muted); background: transparent; font-weight: 700; }
.access-tabs button.active { border-bottom-color: var(--brand); color: var(--ink); }
.access-input { width: 100%; height: 46px; margin-bottom: 14px; padding: 0 13px; border: 1px solid var(--line-dark); border-radius: 6px; background: var(--surface); }
.login-mode-panel > label { display: block; margin-bottom: 9px; font-size: 13px; font-weight: 700; }
.password-field { display: grid; grid-template-columns: minmax(0, 1fr) auto; margin-bottom: 14px; }
.password-field input { min-width: 0; height: 46px; padding: 0 13px; border: 1px solid var(--line-dark); border-right: 0; border-radius: 6px 0 0 6px; background: var(--surface); }
.password-field button { border-radius: 0 6px 6px 0; }
.code-field { display: grid; grid-template-columns: minmax(0, 1fr) auto; margin-bottom: 8px; }
.code-field input { min-width: 0; height: 46px; padding: 0 13px; border: 1px solid var(--line-dark); border-right: 0; border-radius: 6px 0 0 6px; background: var(--surface); }
.code-field button { min-width: 116px; border: 1px solid var(--line-dark); border-radius: 0 6px 6px 0; color: var(--brand); background: var(--surface-soft); font-weight: 700; }
.dev-code-hint { display: block; margin: 0 0 13px; color: var(--teal); font-size: 11px; font-weight: 700; }
.access-security { display: grid; gap: 5px; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; line-height: 1.55; }
.access-security strong { color: var(--ink); }
.return-link { grid-column: 2; justify-self: end; color: var(--muted); font-size: 12px; text-decoration: none; }
.return-link:hover { color: var(--brand); }

/* Shell */
.admin-shell { min-height: 100vh; display: grid; grid-template-columns: 232px minmax(0, 1fr); }
.sidebar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  background: var(--surface);
  border-right: 1px solid var(--line);
}
.sidebar-brand { min-height: 68px; display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.sidebar-brand div { display: grid; gap: 2px; }
.sidebar-brand strong { font-size: 18px; }
.sidebar-brand span { color: var(--muted); font-size: 11px; }
.side-nav { flex: 1; padding: 12px 10px 20px; overflow-y: auto; }
.side-nav p { margin: 18px 11px 6px; color: #a0a5ab; font-size: 10px; font-weight: 700; }
.nav-item {
  position: relative;
  width: 100%;
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border: 0;
  border-radius: 6px;
  color: #545a62;
  background: transparent;
  text-align: left;
}
.nav-item > span { width: 24px; height: 24px; display: grid; place-items: center; flex: 0 0 24px; border: 1px solid var(--line-dark); border-radius: 5px; color: #858b93; font-size: 11px; }
.nav-item:hover { color: var(--ink); background: var(--surface-hover); }
.nav-item.active { color: var(--ink); background: var(--brand-soft); font-weight: 700; }
.nav-item.active::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); }
.nav-item.active > span { border-color: #e8bcbc; color: var(--brand); background: #fff; }
.nav-group { display: grid; }
.nav-parent > i { margin-left: auto; color: var(--muted); font-size: 12px; font-style: normal; transition: transform 160ms ease; }
.nav-parent[aria-expanded="false"] > i { transform: rotate(-90deg); }
.sub-nav {
  display: grid;
  gap: 2px;
  margin: 2px 0 5px 31px;
  padding: 2px 0 2px 11px;
  border-left: 1px solid var(--line);
}
.sub-nav-item {
  min-height: 31px;
  padding: 5px 9px;
  border: 0;
  border-radius: 5px;
  color: #737981;
  background: transparent;
  text-align: left;
  font-size: 11px;
}
.sub-nav-item:hover { color: var(--ink); background: var(--surface-hover); }
.sub-nav-item.active { color: var(--brand); background: var(--brand-soft); font-weight: 700; }
.sidebar-foot { display: grid; gap: 8px; padding: 15px 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.sidebar-foot a { text-decoration: none; }
.sidebar-foot a:hover { color: var(--brand); }
.environment-dot::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: #55a487; }

.workspace { min-width: 0; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 24;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 26px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.98);
}
.menu-button { display: none; }
.global-search { width: min(620px, 54vw); display: grid; grid-template-columns: minmax(0, 1fr) auto; }
.global-search input { min-width: 0; height: 38px; padding: 0 13px; border: 1px solid var(--line); border-right: 0; border-radius: 6px 0 0 6px; background: var(--surface-soft); }
.global-search input:focus { background: #fff; }
.global-search button { padding: 0 15px; border: 1px solid var(--line-dark); border-radius: 0 6px 6px 0; background: var(--surface); font-weight: 600; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 5px; }
.top-badge { padding: 5px 8px; border: 1px solid #bad6cf; border-radius: 5px; color: var(--teal); background: var(--teal-soft); font-size: 10px; font-weight: 800; }
.text-button { padding: 0 10px; border-color: transparent; color: #656b73; background: transparent; font-size: 12px; }
.text-button:hover { color: var(--ink); background: var(--surface-hover); }
.text-button b { display: inline-grid; min-width: 17px; height: 17px; place-items: center; margin-left: 3px; border-radius: 9px; color: #fff; background: var(--brand); font-size: 9px; }
.operator-button { max-width: 158px; min-width: 126px; display: flex; align-items: center; gap: 8px; padding: 3px 10px 3px 4px; white-space: nowrap; overflow: hidden; }
.operator-button > span:last-child { overflow: hidden; text-overflow: ellipsis; }
.operator-avatar { width: 29px; height: 29px; display: grid; place-items: center; flex: 0 0 29px; border-radius: 50%; color: #fff; background: var(--brand); }
.operator-menu { position: absolute; right: 26px; top: 56px; width: 286px; padding: 18px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); }
.operator-menu > span { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.operator-menu dl { margin: 15px 0; border-top: 1px solid var(--line); }
.operator-menu dl div { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.operator-menu dd { color: var(--muted); }
.operator-menu button { width: 100%; min-height: 36px; border: 1px solid var(--line-dark); border-radius: 6px; background: var(--surface-soft); font-weight: 600; }
.operator-menu > button + button { margin-top: 8px; }

/* Main content */
.admin-main { width: 100%; max-width: 1580px; margin: 0 auto; padding: 26px 30px 58px; }
.page-heading { min-height: 72px; display: flex; align-items: start; justify-content: space-between; gap: 22px; margin-bottom: 18px; }
.page-heading h1 { margin: 5px 0; font-size: 29px; font-weight: 700; }
.page-heading > div > span { color: var(--muted); font-size: 12px; }
.page-actions { display: flex; gap: 8px; }
.view-root { min-height: 480px; }
.loading-state, .empty-state, .error-state {
  min-height: 300px;
  display: grid;
  place-content: center;
  gap: 9px;
  padding: 36px;
  color: var(--muted);
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.error-state strong { color: var(--danger); }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.metric { position: relative; min-height: 112px; padding: 17px 18px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: 0 1px 2px rgba(32, 35, 39, 0.03); }
.metric::after { content: ""; position: absolute; top: 18px; right: 18px; width: 7px; height: 7px; border-radius: 50%; background: #b7bcc3; }
.metric.accent-red::after { background: var(--brand); }
.metric.accent-teal::after { background: var(--teal); }
.metric.accent-gold::after { background: var(--gold); }
.metric.accent-blue::after { background: var(--blue); }
.metric header { display: flex; align-items: center; justify-content: space-between; padding-right: 14px; color: var(--muted); font-size: 11px; }
.metric strong { display: block; margin-top: 15px; font-size: 28px; line-height: 1; }
.metric small { display: block; margin-top: 10px; color: var(--muted); font-size: 11px; }
.dashboard-section-title { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin: 27px 0 12px; }
.dashboard-section-title h2 { font-size: 18px; }
.dashboard-section-title p { margin-top: 5px; color: var(--muted); font-size: 11px; }

.overview-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.75fr); gap: 12px; margin-top: 12px; }
.panel { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); overflow: hidden; }
.panel-head { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 14px 17px; border-bottom: 1px solid var(--line); }
.panel-head h2 { font-size: 16px; }
.panel-head span, .panel-head a { color: var(--muted); font-size: 11px; }
.chart { height: 258px; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); align-items: end; gap: 14px; padding: 26px 20px 16px; }
.chart-column { min-width: 0; height: 100%; display: grid; grid-template-rows: 1fr auto; gap: 8px; align-items: end; }
.chart-bars { height: 100%; display: flex; align-items: end; justify-content: center; gap: 3px; border-bottom: 1px solid var(--line); }
.chart-bar { width: 10px; min-height: 3px; border-radius: 2px 2px 0 0; background: var(--teal); }
.chart-bar.works { background: var(--gold); }
.chart-bar.words { background: var(--brand); }
.chart-column label { color: var(--muted); font-size: 10px; text-align: center; }
.chart-legend { display: flex; gap: 13px; padding: 0 20px 16px; color: var(--muted); font-size: 10px; }
.chart-legend span::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 2px; background: var(--teal); }
.chart-legend .works::before { background: var(--gold); }
.chart-legend .words::before { background: var(--brand); }
.alert-list, .health-list { padding: 3px 17px 11px; }
.alert-row, .health-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 11px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.alert-row:last-child, .health-row:last-child { border-bottom: 0; }
.alert-level { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); }
.alert-level.warning { background: var(--gold); }
.alert-level.critical { background: var(--danger); }
.alert-row strong, .health-row strong { display: block; font-size: 12px; }
.alert-row small, .health-row small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.alert-row .table-button { margin-top: 9px; }
.alert-row > div { overflow-wrap: anywhere; }
.alert-check-time { margin: 0; padding: 8px 17px 15px; color: var(--muted); font-size: 11px; }
.alert-refresh-error { color: var(--danger); font-size: 12px; line-height: 1.6; }
#alertCount[hidden] { display: none; }
.analytics-list { padding: 5px 17px 12px; }
.analytics-list > div { min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.analytics-list > div:last-child { border-bottom: 0; }
.analytics-list span { min-width: 0; }
.analytics-list strong { display: block; font-size: 12px; }
.analytics-list small { display: block; margin-top: 4px; overflow: hidden; color: var(--muted); font-size: 10px; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }
.analytics-list b { flex: 0 0 auto; font-size: 12px; }
.skill-usage-list { display: grid; gap: 13px; padding: 16px 17px 18px; }
.skill-usage-list > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px 12px; }
.skill-usage-list header { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 11px; }
.skill-usage-list header span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.skill-usage-list header b { color: var(--teal); }
.skill-usage-list small { color: var(--muted); font-size: 9px; }
.usage-track { height: 6px; overflow: hidden; border-radius: 3px; background: #eceeef; }
.usage-track i { display: block; height: 100%; border-radius: inherit; background: var(--teal); }
.analytics-empty { grid-column: 1 / -1; min-height: 90px !important; display: grid !important; place-items: center; color: var(--muted); font-size: 11px; }

.status-badge { display: inline-flex; align-items: center; min-height: 23px; padding: 3px 8px; border-radius: 5px; color: #626870; background: var(--surface-hover); font-size: 10px; font-weight: 700; white-space: nowrap; }
.status-badge.active, .status-badge.completed, .status-badge.paid, .status-badge.normal { color: var(--teal); background: var(--teal-soft); }
.status-badge.running, .status-badge.queued, .status-badge.pending, .status-badge.watch { color: #805a1c; background: var(--gold-soft); }
.status-badge.error, .status-badge.banned, .status-badge.high, .status-badge.critical { color: var(--danger); background: var(--brand-soft); }
.status-badge.frozen, .status-badge.cancelled, .status-badge.restricted { color: var(--blue); background: var(--blue-soft); }
.status-badge.approved { color: var(--teal); background: var(--teal-soft); }
.status-badge.locked, .status-badge.pending { color: var(--gold); background: var(--gold-soft); }
.status-badge.disabled, .status-badge.departed, .status-badge.rejected, .status-badge.revoked { color: var(--danger); background: var(--brand-soft); }
.status-badge.expired, .status-badge.withdrawn { color: var(--muted); background: var(--surface-hover); }

/* Filters and tables */
.filters { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; margin-bottom: 12px; padding: 13px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.filter-field { min-width: 145px; display: grid; gap: 6px; }
.filter-field.grow { flex: 1; min-width: 250px; }
.filter-field label { color: var(--muted); font-size: 10px; font-weight: 700; }
.filter-field input, .filter-field select, .operation-fields input, .operation-fields select, .reason-field textarea { width: 100%; min-height: 37px; padding: 7px 10px; border: 1px solid var(--line-dark); border-radius: 6px; background: var(--surface); }
.filter-button { padding: 0 16px; border-color: #292d32; color: #fff; background: #292d32; }
.filter-button:hover { background: #181b1f; }
.data-panel { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); overflow: hidden; }
.batch-toolbar {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.batch-toolbar p { color: var(--muted); font-size: 10px; font-weight: 700; }
.batch-toolbar strong { display: block; margin-top: 4px; font-size: 13px; }
.batch-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.batch-actions .secondary-button { min-height: 34px; }
.table-meta { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.table-meta strong { color: var(--ink); font-size: 13px; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; min-width: 980px; border-collapse: collapse; }
th, td { padding: 11px 13px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: #777d85; background: var(--surface-soft); font-size: 10px; font-weight: 700; white-space: nowrap; }
td { font-size: 12px; }
tr:last-child td { border-bottom: 0; }
tbody tr[data-user-id] { cursor: pointer; }
tbody tr:hover td { background: #fafbfb; }
tbody tr.selected-row td { background: #fff7f6; }
.selection-cell { width: 44px; text-align: center; }
.selection-cell input { width: 16px; height: 16px; accent-color: var(--brand); cursor: pointer; }
.cell-primary { display: block; font-weight: 700; }
.cell-secondary { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.numeric { font-variant-numeric: tabular-nums; white-space: nowrap; }
.delta-positive { color: var(--teal); font-weight: 700; }
.delta-negative { color: var(--danger); font-weight: 700; }
.table-button { min-height: 29px; padding: 4px 9px; color: #4e555d; border-color: var(--line-dark); background: #fff; font-size: 11px; }
.progress-cell { min-width: 130px; }
.progress-track { width: 100%; height: 5px; overflow: hidden; border-radius: 3px; background: #e9ebed; }
.progress-track span { display: block; height: 100%; background: var(--teal); }
.progress-cell small { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; }

/* Configuration */
.config-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 8px; background: var(--surface); overflow: hidden; }
.config-item { min-height: 140px; padding: 18px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.config-item:nth-child(3n) { border-right: 0; }
.config-item h3 { font-size: 14px; }
.config-item strong { display: block; margin: 15px 0 6px; font-size: 22px; }
.config-item p { color: var(--muted); font-size: 11px; line-height: 1.6; }
.system-list { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); overflow: hidden; }
.system-row { min-height: 86px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 22px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.system-row:last-child { border-bottom: 0; }
.system-row h3 { font-size: 14px; }
.system-row p { margin-top: 6px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.switch-button { min-width: 84px; min-height: 34px; padding: 0 11px; border: 1px solid var(--line-dark); border-radius: 17px; color: var(--muted); background: var(--surface-soft); font-size: 11px; font-weight: 700; }
.switch-button.on { border-color: var(--teal); color: #fff; background: var(--teal); }
.switch-button.danger.on { border-color: var(--danger); background: var(--danger); }
.security-note { margin-top: 12px; padding: 14px 16px; border: 1px solid #eadfc9; border-radius: 7px; background: #fffdf8; color: #777064; font-size: 11px; line-height: 1.65; }

.settings-panel { margin-top: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); overflow: hidden; }
.section-title { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.section-title h2 { font-size: 16px; }
.section-title p, .section-title span { margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.section-title > strong { color: var(--muted); font-size: 11px; font-weight: 600; }
.section-actions, .product-head-actions, .media-upload-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.creation-channel-header-actions { justify-content: flex-end; }
.compact-primary { width: auto; min-width: 150px; padding: 0 18px; }
.panel-actions { display: flex; justify-content: flex-end; padding: 0 18px 18px; }
.admin-config-form + .admin-config-form { margin-top: 14px; }
.numeric-settings-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.numeric-setting { min-height: 106px; display: grid; align-content: center; gap: 10px; padding: 16px 18px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.numeric-setting:nth-child(3n) { border-right: 0; }
.numeric-setting div { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.numeric-setting input { min-width: 0; height: 40px; padding: 0 10px; border: 1px solid var(--line-dark); border-radius: 6px; font-size: 17px; font-weight: 700; }
.numeric-setting b { color: var(--ink); }
.product-editor-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.product-editor { padding: 17px 18px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.product-editor:nth-child(2n) { border-right: 0; }
.product-editor > header { display: flex; align-items: start; justify-content: space-between; gap: 14px; margin-bottom: 15px; }
.product-editor header span, .skill-kind { color: var(--brand); font-size: 10px; font-weight: 800; }
.product-editor h3 { margin-top: 4px; font-size: 15px; }
.product-editor header small { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; }
.product-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.product-fields > label, .activity-fields label, .staff-create-grid label, .skill-upload-form label, .custom-skill label { display: grid; gap: 6px; color: #5e646b; font-size: 10px; font-weight: 700; }
.product-fields input, .activity-fields input, .activity-fields textarea, .staff-create-grid input, .staff-create-grid select, .skill-upload-form input, .custom-skill input { width: 100%; min-width: 0; min-height: 38px; padding: 7px 10px; border: 1px solid var(--line-dark); border-radius: 6px; background: var(--surface); }
.renewal-admin-note { margin: 11px 0 0; padding: 9px 11px; border-left: 3px solid var(--teal); color: #405f58; background: #edf6f3; font-size: 11px; font-weight: 700; line-height: 1.6; }
.toggle-field { display: inline-flex !important; grid-auto-flow: column; align-items: center; justify-content: start; gap: 7px !important; color: var(--ink) !important; white-space: nowrap; }
.toggle-field input { width: 16px !important; min-height: 16px !important; accent-color: var(--brand); }
.discount-toggle { align-self: end; min-height: 38px; }
.discount-fields { grid-column: 1 / -1; display: none; grid-template-columns: 1fr 1fr; gap: 11px; padding: 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-soft); }
.discount-fields.active { display: grid; }
.input-suffix { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.config-submit-bar { position: sticky; bottom: 12px; z-index: 8; display: flex; align-items: end; gap: 12px; margin-top: 12px; padding: 13px; border: 1px solid var(--line-dark); border-radius: 8px; background: rgba(255, 255, 255, 0.97); box-shadow: var(--shadow); }
.config-submit-bar label { flex: 1; display: grid; gap: 6px; color: var(--muted); font-size: 10px; }
.config-submit-bar input { width: 100%; min-height: 40px; padding: 0 10px; border: 1px solid var(--line-dark); border-radius: 6px; }
.activity-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 18px; }
.activity-fields .wide { grid-column: 1 / -1; }
.activity-fields textarea { resize: vertical; }
.media-uploader { display: grid; grid-template-columns: minmax(220px, 0.8fr) minmax(220px, 1.2fr); align-items: center; gap: 12px 18px; padding: 16px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-soft); }
.media-uploader > small { grid-column: 2; color: var(--muted); font-size: 10px; line-height: 1.6; }
.media-preview { grid-row: span 2; display: grid; place-items: center; min-height: 210px; overflow: hidden; border: 1px dashed var(--line-dark); border-radius: 6px; background: #fff; color: var(--muted); font-size: 11px; }
.media-preview img { display: block; width: 100%; max-height: 360px; object-fit: contain; }
.file-button { position: relative; display: inline-flex !important; align-items: center; justify-content: center; min-height: 36px; padding: 0 13px; overflow: hidden; border: 1px solid var(--line-dark); border-radius: 6px; color: var(--ink) !important; background: #fff; cursor: pointer; }
.file-button input { position: absolute; width: 1px !important; height: 1px; min-height: 0 !important; opacity: 0; pointer-events: none; }
.customer-service-layout { display: grid; grid-template-columns: minmax(300px, 0.8fr) minmax(300px, 1.2fr); gap: 18px; padding: 18px; }
.customer-service-layout .media-uploader { display: grid; grid-template-columns: 1fr; align-content: start; }
.customer-service-layout .media-uploader > small { grid-column: auto; }
.customer-service-layout .media-preview { grid-row: auto; }
.qr-preview { aspect-ratio: 1; min-height: 260px; }
.qr-preview img { height: 100%; max-height: 380px; }
.customer-copy-fields { display: grid; align-content: start; gap: 13px; }
.customer-copy-fields label { display: grid; gap: 7px; color: #5e646b; font-size: 10px; font-weight: 700; }
.customer-copy-fields input, .customer-copy-fields textarea { width: 100%; min-height: 40px; padding: 9px 11px; border: 1px solid var(--line-dark); border-radius: 6px; background: var(--surface); }
.customer-copy-fields textarea { resize: vertical; }

.filter-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  margin-bottom: 12px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.filter-panel label { min-width: 170px; flex: 1; display: grid; gap: 6px; color: var(--muted); font-size: 10px; font-weight: 700; }
.filter-panel input, .filter-panel select { width: 100%; min-height: 37px; padding: 7px 10px; border: 1px solid var(--line-dark); border-radius: 6px; background: var(--surface); }
.filter-panel .primary-button { width: auto; min-height: 37px; padding: 0 15px; }

.support-workbench {
  height: calc(100vh - 182px);
  min-height: 590px;
  display: grid;
  grid-template-columns: 260px minmax(390px, 1fr) 280px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(32, 35, 39, 0.03);
}
.support-queue, .support-user-rail { min-width: 0; overflow: auto; background: var(--surface-soft); }
.support-queue { border-right: 1px solid var(--line); }
.support-user-rail { border-left: 1px solid var(--line); }
.support-queue > header {
  min-height: 67px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.support-queue > header p { color: var(--muted); font-size: 10px; }
.support-queue > header strong { display: block; margin-top: 4px; font-size: 14px; }
.support-queue-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 9px; border-bottom: 1px solid var(--line); }
.support-queue-tabs button { min-height: 31px; border: 0; border-radius: 5px; color: var(--muted); background: transparent; font-size: 10px; font-weight: 700; }
.support-queue-tabs button.active { color: var(--brand); background: var(--brand-soft); }
.support-conversation-list { display: grid; align-content: start; }
.support-conversation-item {
  position: relative;
  min-width: 0;
  min-height: 78px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
}
.support-conversation-item:hover { background: var(--surface-hover); }
.support-conversation-item.active { background: var(--brand-soft); }
.support-conversation-item.active::before { content: ""; position: absolute; inset: 10px auto 10px 0; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); }
.support-conversation-item > span:nth-child(2) { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 7px; }
.support-conversation-item strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.support-conversation-item small { grid-column: 1 / -1; overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.support-conversation-item time { grid-column: 2; grid-row: 1; color: var(--muted); font-size: 8px; }
.support-conversation-item > b { position: absolute; right: 10px; bottom: 9px; min-width: 17px; height: 17px; display: grid; place-items: center; border-radius: 9px; color: #fff; background: var(--brand); font-size: 8px; }
.support-user-avatar { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; color: #fff; background: var(--brand); font-size: 12px; font-weight: 800; }
.support-user-avatar.large { width: 46px; height: 46px; font-size: 16px; }

.support-chat-desk { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--surface); }
.support-chat-head {
  min-height: 67px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
}
.support-chat-head > div:first-child > strong { display: block; margin-bottom: 5px; font-size: 13px; }
.support-chat-controls { display: flex; align-items: center; flex-wrap: wrap; justify-content: end; gap: 6px; }
.support-chat-controls select, .data-panel select { min-height: 32px; padding: 4px 8px; border: 1px solid var(--line-dark); border-radius: 5px; background: var(--surface); font-size: 10px; }
.support-message-stream { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 13px; padding: 18px; background: #fafbfb; }
.support-message { width: min(78%, 620px); align-self: flex-end; }
.support-message.user { align-self: flex-start; }
.support-message header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 5px; color: var(--muted); font-size: 9px; }
.support-message > div { padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); box-shadow: 0 1px 2px rgba(32, 35, 39, 0.04); font-size: 11px; line-height: 1.65; overflow-wrap: anywhere; }
.support-message.user > div { border-color: #e6bcbc; background: var(--brand-soft); }
.support-message.ai > div { border-color: #badfd8; background: var(--teal-soft); }
.support-message.system > div { background: var(--surface-soft); }
.support-message img { display: block; max-width: 100%; max-height: 260px; border-radius: 5px; object-fit: contain; }
.support-message a { color: var(--blue); }
.support-transfer-progress {
  display: grid;
  grid-template-columns: minmax(170px, 0.8fr) minmax(260px, 1.4fr) auto;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border-bottom: 1px solid #d7e1de;
  background: #f0f7f5;
}
.support-transfer-progress > div { min-width: 0; }
.support-transfer-progress strong,
.support-transfer-progress small { display: block; }
.support-transfer-progress strong { color: var(--teal); font-size: 11px; }
.support-transfer-progress small { margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.support-transfer-progress ol {
  display: grid;
  grid-template-columns: repeat(3, minmax(64px, 1fr));
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.support-transfer-progress li {
  min-height: 27px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  background: var(--surface);
  font-size: 8px;
  font-weight: 700;
}
.support-transfer-progress li.active { border-color: #d9ae56; color: #76530d; background: #fff8e8; }
.support-transfer-progress li.complete { border-color: #9bc9bf; color: var(--teal); background: #e4f4f0; }
.support-transfer-progress > span { color: var(--muted); font-size: 9px; white-space: nowrap; }
.support-reply-box { padding: 12px 14px; border-top: 1px solid var(--line); background: var(--surface); }
.support-reply-box textarea { width: 100%; min-height: 72px; padding: 9px 10px; resize: none; border: 1px solid var(--line-dark); border-radius: 6px; background: var(--surface); font-size: 11px; line-height: 1.6; }
.support-reply-box footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 7px; }
.support-reply-hint { min-width: 0; color: var(--muted); font-size: 9px; }
.support-reply-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex: 0 0 auto; }
.support-quick-reply-trigger {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: var(--surface);
  font: inherit;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}
.support-quick-reply-trigger i {
  width: 7px;
  height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateX(-2px) rotate(-45deg);
  transition: transform 160ms ease;
}
.support-quick-reply-trigger[aria-expanded="true"] { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.support-quick-reply-trigger[aria-expanded="true"] i { transform: translateX(2px) rotate(135deg); }
.support-quick-reply-trigger:hover { border-color: var(--brand); color: var(--brand); }
.support-quick-reply-trigger:focus-visible,
.support-quick-reply-panel button:focus-visible,
.support-quick-reply-search input:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.support-quick-reply-drawer {
  position: fixed;
  z-index: 95;
  inset: 0;
  pointer-events: none;
}
.support-quick-reply-drawer[hidden] { display: none; }
.support-quick-reply-scrim {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(32, 35, 39, 0.08);
  opacity: 0;
  pointer-events: auto;
  transition: opacity 220ms ease, background-color 220ms ease;
}
.support-quick-reply-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(660px, calc(100vw - 28px));
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-left: 1px solid var(--line-dark);
  background: var(--surface);
  box-shadow: -20px 0 52px rgba(26, 31, 38, 0.18);
  transform: translateX(100%);
  pointer-events: auto;
  transition: transform 220ms ease;
  contain: layout paint;
  isolation: isolate;
}
.support-quick-reply-drawer.open .support-quick-reply-scrim {
  background: rgba(32, 35, 39, 0.28);
  opacity: 1;
}
.support-quick-reply-drawer.open .support-quick-reply-panel { transform: translateX(0); }
.support-quick-reply-panel > header {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 17px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.support-quick-reply-panel > header div { min-width: 0; }
.support-quick-reply-panel > header strong,
.support-quick-reply-panel > header span { display: block; }
.support-quick-reply-panel > header strong { color: var(--ink); font-size: 16px; }
.support-quick-reply-panel > header span { margin-top: 4px; color: var(--muted); font-size: 10px; }
.support-quick-reply-close {
  position: relative;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  cursor: pointer;
}
.support-quick-reply-close::before,
.support-quick-reply-close::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 13px;
  height: 1.5px;
  border-radius: 2px;
  background: var(--ink);
}
.support-quick-reply-close::before { transform: translate(-50%, -50%) rotate(45deg); }
.support-quick-reply-close::after { transform: translate(-50%, -50%) rotate(-45deg); }
.support-quick-reply-close:hover { border-color: var(--brand); background: var(--brand-soft); }
.support-quick-reply-search { display: block; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.support-quick-reply-search input {
  width: 100%;
  height: 42px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: var(--surface-soft);
  font: inherit;
  font-size: 11px;
}
.support-quick-reply-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  overflow: hidden;
  background: var(--surface);
}
.support-quick-reply-nav {
  min-width: 0;
  padding: 8px;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: var(--surface-soft);
  scrollbar-width: thin;
}
.support-quick-reply-nav button {
  width: 100%;
  min-height: 44px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px 9px;
  border: 0;
  border-left: 3px solid transparent;
  border-radius: 4px;
  color: var(--muted);
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.support-quick-reply-nav button + button { margin-top: 3px; }
.support-quick-reply-nav button:hover { color: var(--ink); background: var(--surface); }
.support-quick-reply-nav button.active {
  border-left-color: var(--brand);
  color: var(--brand);
  background: var(--brand-soft);
}
.support-quick-reply-nav span {
  min-width: 0;
  overflow: hidden;
  font-size: 10px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.support-quick-reply-nav small { font-size: 9px; font-weight: 700; }
.support-quick-reply-options {
  position: relative;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
}
.support-quick-reply-group + .support-quick-reply-group { border-top: 1px solid var(--line-dark); }
.support-quick-reply-group > header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 16px;
  color: var(--brand);
  background: var(--panel);
}
.support-quick-reply-group > header strong { font-size: 11px; }
.support-quick-reply-group > header span { color: var(--muted); font-size: 9px; }
.support-quick-reply-options button {
  width: 100%;
  min-height: 50px;
  display: block;
  padding: 11px 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  background: var(--surface);
  font: inherit;
  text-align: left;
  font-size: 11px;
  line-height: 1.55;
  cursor: pointer;
}
.support-quick-reply-options button:last-child { border-bottom: 0; }
.support-quick-reply-options button:hover { color: var(--brand); background: var(--brand-soft); }
.support-quick-reply-empty { margin: 0; padding: 22px 14px; color: var(--muted); text-align: center; font-size: 10px; }
.support-reply-box .compact-primary { min-width: 104px; min-height: 34px; }
.support-empty { min-height: 110px; display: grid; place-content: center; gap: 6px; padding: 18px; color: var(--muted); text-align: center; font-size: 10px; }
.support-empty.large { min-height: 320px; }
.support-empty strong { color: var(--ink); font-size: 14px; }

.support-profile { padding: 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
.support-profile > header { display: flex; align-items: center; gap: 11px; }
.support-profile > header strong, .support-profile > header small { display: block; }
.support-profile > header strong { font-size: 12px; }
.support-profile > header small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.support-profile dl { margin-top: 14px; }
.support-profile dl div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 10px; }
.support-profile dt { color: var(--muted); }
.support-profile dd { font-weight: 700; text-align: right; overflow-wrap: anywhere; }
.support-side-list { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.support-side-list h3 { margin-bottom: 8px; font-size: 11px; }
.support-side-list > span { color: var(--muted); font-size: 9px; }
.support-side-list p { display: grid; gap: 3px; padding: 8px 0; border-top: 1px solid var(--line); }
.support-side-list p strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.support-side-list p span { color: var(--muted); font-size: 8px; }

.knowledge-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.knowledge-card { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.knowledge-card > header, .knowledge-card > footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.knowledge-card > header > span:first-child { color: var(--brand); font-size: 10px; font-weight: 800; }
.knowledge-card h3 { margin-top: 13px; font-size: 14px; }
.knowledge-card > p { min-height: 48px; margin-top: 8px; color: #5d636a; font-size: 10px; line-height: 1.65; }
.knowledge-card > footer { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.knowledge-card > footer small { color: var(--muted); font-size: 9px; }
.knowledge-card > footer div { display: flex; gap: 5px; }
.tag-row { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.tag-row span { padding: 3px 6px; border-radius: 4px; color: var(--teal); background: var(--teal-soft); font-size: 8px; }
.support-rating { color: var(--gold); letter-spacing: 1px; white-space: nowrap; }
.support-note-list { display: grid; padding: 6px 17px 12px; }
.support-note-list p { display: grid; gap: 4px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.support-note-list p:last-child { border-bottom: 0; }
.support-note-list strong { font-size: 11px; }
.support-note-list span { color: var(--muted); font-size: 9px; line-height: 1.55; }
.field-toggle { min-height: 38px; align-self: end; }

.skill-zone-panel { margin-top: 14px; }
.skill-management-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.55fr); }
.creation-channel-management { grid-template-columns: minmax(220px, 0.7fr) minmax(320px, 1.3fr); }
.skill-list.creation-channel-admin-list { grid-template-columns: 1fr; gap: 10px; padding: 18px; }
.creation-channel-admin-choice { display: grid; gap: 8px; padding: 16px; text-align: left; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); overflow-wrap: anywhere; }
.creation-channel-admin-choice.active { border-color: var(--teal); background: var(--surface-soft); }
.creation-channel-admin-choice small, .creation-channel-admin-choice span { color: var(--muted); }
#creationChannelEditor textarea, #creationChannelEditor select { width: 100%; min-width: 0; padding: 9px 10px; border: 1px solid var(--line-dark); border-radius: 6px; background: var(--surface); color: var(--ink); }
.skill-list { display: grid; grid-template-columns: 1fr 1fr; align-content: start; border-right: 1px solid var(--line); }
.skill-manage-card { min-height: 150px; padding: 16px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.skill-manage-card:nth-child(2n) { border-right: 0; }
.skill-manage-card.built-in { display: block; }
.skill-card-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.skill-manage-card.skill-deleted { background: #faf7f6; }
.skill-manage-card.skill-deleted input:not([type="file"]) { color: var(--muted); }
.skill-manage-card h3 { margin-top: 7px; font-size: 15px; }
.skill-manage-card p { margin-top: 7px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.skill-manage-card small { display: block; margin-top: 12px; color: var(--muted); font-size: 9px; overflow-wrap: anywhere; }
.custom-skill form, .skill-upload-form { display: grid; gap: 11px; }
.skill-presentation-fields { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.skill-presentation-fields > label { min-width: 0; }
.skill-presentation-fields small { margin-top: 0; font-weight: 400; }
.custom-skill input[type="file"] { padding: 7px; background: var(--surface-soft); font-size: 10px; }
.skill-upload-form { align-content: start; padding: 18px; background: var(--surface-soft); }
.skill-upload-form h3 { margin-top: 5px; font-size: 16px; }
.skill-upload-form label small { color: var(--muted); font-weight: 400; line-height: 1.45; }
.skill-card-actions, .table-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.danger-text { color: var(--danger); }

.staff-layout { display: grid; grid-template-columns: minmax(300px, 0.7fr) minmax(0, 1.3fr); gap: 12px; margin-bottom: 12px; }
.staff-layout .settings-panel { margin-top: 0; }
.staff-create-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; padding: 18px; }
.staff-create-grid .wide { grid-column: 1 / -1; }
.role-matrix { display: grid; grid-template-columns: 1fr 1fr; }
.role-matrix article { min-height: 132px; padding: 15px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.role-matrix article:nth-child(2n) { border-right: 0; }
.role-matrix header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.role-matrix code { color: var(--muted); font-size: 9px; }
.role-matrix p { margin-top: 7px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.role-matrix article div { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 9px; }
.role-matrix article div span { padding: 3px 5px; border-radius: 4px; color: var(--teal); background: var(--teal-soft); font-size: 8px; }
.link-button { padding: 0; border: 0; background: transparent; text-align: left; }
.drawer-actions { display: flex; flex-wrap: wrap; gap: 7px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.drawer-actions .secondary-button { min-height: 32px; }
.drawer-body > .detail-grid { margin: 17px 20px; }
.drawer-section { padding: 2px 20px 30px; }
.drawer-section h3 { margin-bottom: 10px; font-size: 14px; }
.grant-list { border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.grant-list article { padding: 12px; border-bottom: 1px solid var(--line); }
.grant-list article:last-child { border-bottom: 0; }
.grant-list header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.grant-list p { margin-top: 6px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.grant-list small { display: block; margin: 7px 0; color: var(--muted); font-size: 9px; }

/* Creator partners */
.creator-visibility-state {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 17px;
  color: var(--muted);
  background: var(--surface);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

/* Redemption codes retain the operations console's existing surfaces and controls. */
.redemption-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.redemption-tabs button { min-height: 43px; padding: 0 18px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-weight: 700; }
.redemption-tabs button.active { border-bottom-color: var(--brand); color: var(--brand); }
.redemption-filters { flex-wrap: wrap; }
.redemption-filters label { min-width: 185px; }
.redemption-filters input, .redemption-filters select { min-width: 0; max-width: 100%; }
.redemption-note { margin: 0 0 14px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.redemption-table { min-width: 900px; }
.redemption-table td { vertical-align: top; }
.redemption-table .table-button { margin: 2px 4px 2px 0; white-space: nowrap; }
.redemption-code { font-family: Consolas, monospace; font-size: 13px; }
.redemption-id { display: block; max-width: 270px; overflow-wrap: anywhere; font-size: 11px; }
.redemption-toolbar, .redemption-detail-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); margin-bottom: 12px; font-size: 12px; }
.redemption-toolbar label { display: flex; align-items: center; gap: 5px; }
.redemption-toolbar input, .redemption-table input, .redemption-confirm-check input { accent-color: var(--brand); width: 16px; height: 16px; flex: 0 0 auto; }
.redemption-pagination { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px; padding: 14px 0; color: var(--muted); font-size: 12px; }
.redemption-generator { max-width: 1000px; }
.redemption-generator .panel-head p { margin-top: 7px; color: var(--muted); font-size: 12px; }
.redemption-generator form { padding: 24px; }
.redemption-form-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 20px; }
.redemption-form-grid label { min-width: 0; display: grid; align-content: start; gap: 9px; font-size: 13px; font-weight: 700; }
.redemption-form-grid input, .redemption-form-grid select, .redemption-form-grid textarea { width: 100%; min-width: 0; min-height: 43px; padding: 10px 12px; border: 1px solid var(--line-dark); border-radius: 6px; background: var(--surface); font-weight: 400; }
.redemption-form-grid textarea { resize: vertical; }
.redemption-wide { grid-column: 1 / -1; }
.redemption-generation-summary { display: flex; flex-wrap: wrap; gap: 8px 24px; padding: 18px; margin-top: 22px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-soft); }
.redemption-generation-summary span { width: 100%; color: var(--muted); font-size: 12px; line-height: 1.7; }
.redemption-generation-summary strong { font-size: 18px; color: var(--brand); overflow-wrap: anywhere; }
.redemption-lock-note { margin-top: 14px; padding: 12px 14px; border-radius: 6px; color: var(--brand); background: var(--brand-soft); font-size: 12px; line-height: 1.8; }
.redemption-form-actions { display: flex; justify-content: flex-end; margin-top: 20px; }
.redemption-form-actions .primary-button { width: auto; padding: 0 24px; }
.redemption-detail-actions { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; margin: 0; }
.redemption-detail-records { padding: 16px 20px; }
.redemption-detail-records .redemption-table { min-width: 740px; }
.redemption-batch-states { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0,1fr)); padding: 0 20px 20px; }
.redemption-batch-states div { display: grid; gap: 8px; padding: 12px; background: var(--surface-soft); border-radius: 6px; font-size: 12px; }
.redemption-batch-states span { color: var(--muted); }
.redemption-batch-states strong { font-size: 20px; }
.redemption-revealed { display: grid; gap: 12px; padding: 18px; margin: 16px 20px; border: 1px solid var(--line-dark); border-radius: 6px; background: var(--gold-soft); }
.redemption-revealed p { font-size: 12px; color: var(--gold); }
.redemption-revealed code { font-size: 18px; user-select: all; overflow-wrap: anywhere; }
.redemption-revealed button { justify-self: start; }
.operation-fields .redemption-confirm-check { display: flex; align-items: flex-start; gap: 10px; line-height: 1.6; }
@media (max-width: 640px) {
  .filter-panel.redemption-filters label { flex: 1 1 100%; min-width: 0; }
  .redemption-tabs button { padding: 0 10px; font-size: 12px; }
  .redemption-generator form { padding: 16px; }
  .redemption-form-grid { grid-template-columns: minmax(0,1fr); gap: 16px; }
  .redemption-generation-summary strong { font-size: 16px; }
  .redemption-toolbar .secondary-button { width: 100%; }
}
.creator-visibility-state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #b7bcc3; }
.creator-visibility-state.on { color: var(--teal); border-color: #b7d9d1; background: var(--teal-soft); }
.creator-visibility-state.on::before { background: var(--teal); }
.creator-visibility-button { border-radius: 6px; }
.creator-metric-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.creator-dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.6fr); gap: 12px; margin-top: 12px; }
.creator-funnel { display: grid; gap: 11px; padding: 20px 18px 22px; }
.creator-funnel > div { min-height: 38px; display: grid; grid-template-columns: 92px minmax(100px, 1fr) 72px 56px; align-items: center; gap: 10px; }
.creator-funnel span { color: var(--muted); font-size: 11px; font-weight: 700; }
.creator-funnel i { height: 23px; border-radius: 3px; background: linear-gradient(90deg, var(--brand), #d56b5d); }
.creator-funnel > div:nth-child(2) i { background: linear-gradient(90deg, #c77e2b, #e2ae62); }
.creator-funnel > div:nth-child(3) i { background: linear-gradient(90deg, var(--gold), #e8c484); }
.creator-funnel > div:nth-child(4) i { background: linear-gradient(90deg, var(--teal), #74b9a9); }
.creator-funnel b { font-size: 13px; font-variant-numeric: tabular-nums; text-align: right; }
.creator-funnel small { color: var(--muted); font-size: 9px; text-align: right; }
.creator-recent-panel { margin-top: 12px; }
.creator-compact-empty { min-height: 150px; border: 0; border-radius: 0; }
.creator-partner-filters label.grow { min-width: 260px; flex: 1; }
.creator-partner-table { min-width: 1120px; }
.creator-partner-contact { min-width: 190px; }
.creator-directory-table { min-width: 1600px; }
.creator-partner-subject { min-width: 220px; }
.creator-partner-subject .cell-secondary { max-width: 240px; }
.creator-directory-table th:last-child, .creator-directory-table td:last-child { min-width: 225px; }
.creator-partner-batch-toolbar .batch-actions { align-items: center; }
.creator-partner-select-all { min-height: 34px; display: inline-flex; align-items: center; gap: 7px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); background: var(--surface-soft); font-size: 10px; font-weight: 700; white-space: nowrap; }
.creator-partner-select-all input { width: 15px; height: 15px; accent-color: var(--brand); }
.creator-partner-revoke-button { color: var(--danger); border-color: #dfb4b0; background: #fff8f7; }
.creator-partner-revoke-button:hover { color: #fff; border-color: var(--danger); background: var(--danger); }
.creator-partner-termination-warning { display: grid; gap: 5px; border-color: #dfb4b0; color: var(--danger); background: #fff7f6; }
.creator-partner-termination-warning strong { font-size: 11px; }
.creator-partner-termination-warning span { color: #8b4640; font-size: 10px; font-weight: 500; line-height: 1.55; }
.creator-tag-list { display: flex; flex-wrap: wrap; gap: 4px; }
.creator-tag-list span { padding: 3px 6px; border-radius: 4px; color: var(--teal); background: var(--teal-soft); font-size: 9px; white-space: nowrap; }
.creator-security-note { margin: 0 0 12px; border-color: #e7d9bd; }
.creator-payout-toolbar { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 12px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.creator-payout-toolbar > label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; font-weight: 700; }
.creator-payout-toolbar > div { display: flex; align-items: center; gap: 12px; }
.creator-payout-toolbar strong { color: var(--ink); font-size: 11px; }
.creator-payout-table .selection-cell { width: 44px; text-align: center; }
.creator-sensitive-payout .security-note { margin-bottom: 16px; border-color: #e3b8b4; color: var(--danger); }
.creator-sensitive-payout dd { font-family: Consolas, "Microsoft YaHei", monospace; letter-spacing: 0.03em; }
.creator-sensitive-close { width: 100%; margin-top: 16px; }
.creator-rule-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.creator-rule-summary .config-item:nth-child(3n) { border-right: 1px solid var(--line); }
.creator-rule-summary .config-item:last-child { border-right: 0; }
.creator-rule-editor { margin-top: 12px; }
.creator-rule-fields { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; padding: 18px; border-bottom: 1px solid var(--line); }
.creator-rule-fields > label { display: grid; align-content: start; gap: 7px; color: #5e646b; font-size: 10px; font-weight: 700; }
.creator-rule-fields input { width: 100%; min-height: 40px; }
.creator-rule-fields small { color: var(--muted); font-size: 9px; font-weight: 400; line-height: 1.45; }
.creator-rule-matrix-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; padding: 18px 18px 12px; border-top: 1px solid var(--line); }
.creator-rule-matrix-head h3 { font-size: 15px; }
.creator-rule-matrix-head p { max-width: 760px; margin-top: 5px; color: var(--muted); font-size: 10px; line-height: 1.55; }
.creator-rule-legend { display: flex; gap: 6px; flex-wrap: wrap; }
.creator-rule-legend span { padding: 5px 8px; border-radius: 4px; background: var(--teal-soft); color: var(--teal); font-size: 9px; font-weight: 800; white-space: nowrap; }
.creator-rule-batch { display: grid; grid-template-columns: minmax(210px, 1.5fr) minmax(120px, .7fr) minmax(130px, .7fr) minmax(130px, .7fr) auto; align-items: end; gap: 10px; margin: 0 18px 14px; padding: 13px; border: 1px solid #d9dfdc; border-radius: 7px; background: #f4f8f7; }
.creator-rule-batch > div:first-child { align-self: center; }
.creator-rule-batch strong, .creator-rule-batch small { display: block; }
.creator-rule-batch strong { font-size: 11px; }
.creator-rule-batch small { margin-top: 4px; color: var(--muted); font-size: 9px; line-height: 1.45; }
.creator-rule-batch > label { display: grid; gap: 5px; color: #5e646b; font-size: 9px; font-weight: 700; }
.creator-rule-batch select, .creator-rule-batch input { width: 100%; min-height: 36px; }
.creator-rule-batch .secondary-button { min-height: 36px; white-space: nowrap; }
.creator-rule-edit-table table { min-width: 1260px; table-layout: fixed; }
.creator-rule-edit-table th:nth-child(2), .creator-rule-edit-table td:nth-child(2) { width: 178px; }
.creator-rule-edit-table th:nth-child(3), .creator-rule-edit-table td:nth-child(3),
.creator-rule-edit-table th:nth-child(4), .creator-rule-edit-table td:nth-child(4),
.creator-rule-edit-table th:nth-child(5), .creator-rule-edit-table td:nth-child(5) { width: 236px; }
.creator-rule-edit-table th small, .creator-current-rule-table th small { display: block; margin-top: 3px; color: var(--muted); font-size: 8px; font-weight: 500; }
.creator-rule-edit-table td:nth-child(2) strong, .creator-rule-edit-table td:nth-child(2) small { display: block; }
.creator-rule-edit-table td:nth-child(2) small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.creator-level-rate-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.creator-level-rate-pair > label { min-width: 0; display: grid; gap: 4px; color: var(--muted); font-size: 8px; font-weight: 700; }
.creator-rate-input { min-width: 0; display: flex; align-items: center; overflow: hidden; border: 1px solid var(--line-dark); border-radius: 6px; background: var(--surface); }
.creator-rate-input input { min-width: 0; width: 100%; min-height: 34px; padding: 6px 5px 6px 7px; border: 0; background: transparent; font-size: 10px; font-variant-numeric: tabular-nums; }
.creator-rate-input i { padding-right: 6px; color: var(--muted); font-size: 9px; font-style: normal; }
.creator-current-rule-table table { min-width: 920px; }
.creator-rule-rate-readonly { min-width: 95px; display: grid; gap: 3px; }
.creator-rule-rate-readonly b { color: var(--ink); font-size: 11px; font-variant-numeric: tabular-nums; }
.creator-rule-rate-readonly small { color: var(--muted); font-size: 9px; font-variant-numeric: tabular-nums; }
.creator-rule-note { margin: 14px 18px 18px; }
.creator-message-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.creator-message-editor { display: grid; align-content: start; gap: 11px; padding: 18px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.creator-message-editor:nth-child(2n) { border-right: 0; }
.creator-message-editor > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.creator-message-editor > header span { color: var(--brand); font-size: 9px; font-weight: 800; }
.creator-message-editor h3 { margin-top: 4px; font-size: 14px; }
.creator-message-editor > label { display: grid; gap: 6px; color: #5e646b; font-size: 10px; font-weight: 700; }
.creator-message-editor input, .creator-message-editor textarea { width: 100%; min-height: 38px; padding: 8px 10px; border: 1px solid var(--line-dark); border-radius: 6px; background: var(--surface); resize: vertical; }
.creator-message-editor > small { color: var(--muted); font-size: 9px; }
.creator-application-summary { min-height: 90px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; border-bottom: 1px solid var(--line); background: var(--surface-soft); }
.creator-application-summary p { color: var(--brand); font-size: 9px; font-weight: 800; }
.creator-application-summary h3 { margin-top: 5px; font-size: 17px; }
.creator-application-summary div > span { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; }
.creator-review-actions { display: flex; flex-wrap: wrap; gap: 7px; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.creator-review-actions .primary-button, .creator-review-actions .secondary-button { min-width: 0; min-height: 34px; width: auto; padding: 0 12px; }
.creator-application-content > h3, .creator-drawer-section > h3 { margin-bottom: 10px; font-size: 14px; }
.creator-drawer-section { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.creator-text-details { display: grid; gap: 8px; }
.creator-text-details article { padding: 11px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-soft); }
.creator-text-details strong { font-size: 10px; }
.creator-text-details p { margin-top: 6px; color: #555c64; font-size: 11px; line-height: 1.65; white-space: pre-wrap; }
.creator-proof-list { display: flex; flex-wrap: wrap; gap: 7px; }
.creator-proof-list a, .creator-proof-list span { padding: 7px 9px; border: 1px solid var(--line); border-radius: 5px; color: var(--blue); background: var(--surface-soft); font-size: 10px; text-decoration: none; }
.creator-muted { padding: 12px; color: var(--muted); background: var(--surface-soft); font-size: 11px; line-height: 1.6; }

/* Drawer and modal */
.drawer-scrim, .sidebar-scrim { position: fixed; inset: 0; z-index: 44; border: 0; background: rgba(25, 28, 31, 0.32); }
.detail-drawer { position: fixed; z-index: 46; top: 0; right: 0; width: min(650px, 100vw); height: 100vh; overflow: hidden; border-left: 1px solid var(--line); background: var(--surface); box-shadow: -16px 0 42px rgba(32, 35, 39, 0.12); }
.detail-drawer > header { height: 72px; display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.detail-drawer h2 { margin-top: 4px; font-size: 23px; }
.drawer-body { height: calc(100vh - 72px); overflow-y: auto; }
.user-summary { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 13px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.user-avatar { width: 52px; height: 52px; display: grid; place-items: center; overflow: hidden; border-radius: 50%; color: #fff; background: var(--brand); font-size: 18px; font-weight: 700; }
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-summary strong { display: block; }
.user-summary small { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; }
.user-actions { display: flex; flex-wrap: wrap; gap: 7px; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.user-actions button { min-height: 32px; padding: 5px 10px; border: 1px solid var(--line-dark); border-radius: 6px; background: var(--surface); font-size: 11px; font-weight: 600; }
.user-actions button.primary { color: #fff; border-color: var(--brand); background: var(--brand); }
.drawer-tabs { display: flex; gap: 2px; padding: 9px 13px 0; overflow-x: auto; border-bottom: 1px solid var(--line); }
.drawer-tabs button { min-height: 37px; padding: 0 10px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-size: 11px; white-space: nowrap; }
.drawer-tabs button.active { border-bottom-color: var(--brand); color: var(--ink); font-weight: 700; }
.drawer-content { padding: 17px 20px 32px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.detail-grid div { min-height: 70px; padding: 12px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.detail-grid div:nth-child(2n) { border-right: 0; }
.detail-grid dt { color: var(--muted); font-size: 10px; }
.detail-grid dd { margin-top: 7px; font-size: 12px; font-weight: 700; overflow-wrap: anywhere; }
.drawer-list { border-top: 1px solid var(--line); }
.drawer-list article { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 11px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.drawer-list strong { display: block; font-size: 12px; }
.drawer-list p { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.drawer-list time { color: var(--muted); font-size: 10px; white-space: nowrap; }

.modal-backdrop { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; background: rgba(25, 28, 31, 0.42); }
.operation-modal { width: min(520px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); }
.operation-modal > header { min-height: 70px; display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.operation-modal h2 { margin-top: 4px; font-size: 20px; }
.operation-modal form { padding: 18px; }
.password-modal { width: min(460px, 100%); }
.operation-summary { margin-bottom: 16px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-soft); color: var(--muted); font-size: 12px; line-height: 1.55; }
.operation-fields { display: grid; gap: 13px; }
.operation-fields label, .reason-field { display: grid; gap: 7px; font-size: 12px; font-weight: 700; }
.operation-fields label span, .reason-field span { color: var(--muted); font-size: 10px; font-weight: 400; }
.reason-field { margin-top: 15px; }
.reason-field textarea { resize: vertical; min-height: 88px; }
.modal-actions { display: flex; justify-content: end; gap: 8px; margin-top: 18px; }
.admin-toast { position: fixed; z-index: 80; left: 50%; bottom: 22px; min-width: 230px; max-width: min(500px, calc(100vw - 32px)); transform: translateX(-50%); padding: 11px 15px; border-radius: 6px; color: #fff; background: #292d32; box-shadow: var(--shadow); text-align: center; font-size: 12px; }

@media (max-width: 1180px) {
  .admin-shell { grid-template-columns: 210px minmax(0, 1fr); }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-grid { grid-template-columns: 1fr; }
  .config-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .config-item:nth-child(3n) { border-right: 1px solid var(--line); }
  .config-item:nth-child(2n) { border-right: 0; }
  .top-actions .text-button { display: none; }
  .skill-management-grid, .staff-layout { grid-template-columns: 1fr; }
  .skill-list { border-right: 0; border-bottom: 1px solid var(--line); }
  .support-workbench { height: auto; min-height: 680px; grid-template-columns: 235px minmax(0, 1fr); }
  .support-user-rail { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 0; }
  .support-profile { grid-row: span 2; }
  .creator-metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .creator-rule-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .creator-rule-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .creator-rule-batch { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .creator-rule-batch > div:first-child { grid-column: 1 / -1; }
  .creator-rule-batch .secondary-button { width: 100%; }
  .creator-rule-summary .config-item:nth-child(2n) { border-right: 0; }
}

@media (max-width: 860px) {
  .access-page { grid-template-columns: minmax(0, 460px); gap: 28px; }
  .return-link { grid-column: 1; }
  .admin-shell { display: block; }
  .sidebar { position: fixed; left: 0; transform: translateX(-100%); width: 232px; transition: transform 180ms ease; box-shadow: var(--shadow); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-scrim { z-index: 29; }
  .menu-button { display: inline-block; }
  .topbar { padding: 10px 14px; }
  .global-search { width: auto; flex: 1; }
  .operator-button { min-width: 38px; width: 38px; padding: 3px; }
  .operator-button > span:last-child { display: none; }
  .top-badge { display: none; }
  .operator-menu { right: 14px; }
  .admin-main { padding: 22px 17px 46px; }
  .page-heading { min-height: 66px; }
  .page-heading h1 { font-size: 27px; }
  .config-grid { grid-template-columns: 1fr; }
  .config-item, .config-item:nth-child(2n), .config-item:nth-child(3n) { border-right: 0; }
  .numeric-settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .numeric-setting:nth-child(3n) { border-right: 1px solid var(--line); }
  .numeric-setting:nth-child(2n) { border-right: 0; }
  .product-editor-list { grid-template-columns: 1fr; }
  .product-editor, .product-editor:nth-child(2n) { border-right: 0; }
  .customer-service-layout { grid-template-columns: 1fr; }
  .support-workbench { min-height: 0; grid-template-columns: 1fr; overflow: visible; }
  .support-queue { max-height: 340px; border-right: 0; border-bottom: 1px solid var(--line); }
  .support-chat-desk { min-height: 580px; }
  .support-user-rail { grid-column: auto; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .support-profile { grid-row: auto; }
  .creator-dashboard-grid { grid-template-columns: 1fr; }
  .creator-rule-matrix-head { align-items: flex-start; flex-direction: column; }
  .creator-rule-batch { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .creator-rule-batch > div:first-child, .creator-rule-batch .secondary-button { grid-column: 1 / -1; }
}

@media (max-width: 620px) {
  .access-page { padding: 24px 16px; }
  .access-brand { gap: 13px; }
  .brand-mark { width: 52px; height: 52px; }
  .access-brand h1 { font-size: 27px; }
  .access-panel { padding: 22px 17px; }
  .topbar { gap: 7px; }
  .global-search input { font-size: 11px; }
  .global-search button { padding: 0 10px; }
  .admin-main { padding: 18px 11px 40px; }
  .page-heading { align-items: stretch; flex-direction: column; gap: 9px; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .metric { min-height: 100px; padding: 13px; }
  .metric::after { top: 14px; right: 14px; }
  .metric strong { font-size: 22px; }
  .chart { gap: 6px; padding-inline: 11px; }
  .chart-bar { width: 7px; }
  .filters { align-items: stretch; }
  .filter-field, .filter-field.grow { width: 100%; min-width: 0; }
  .filter-button { width: 100%; }
  .batch-toolbar { align-items: stretch; flex-direction: column; }
  .batch-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .batch-actions .secondary-button { width: 100%; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-grid div, .detail-grid div:nth-child(2n) { border-right: 0; }
  .user-summary { grid-template-columns: auto minmax(0, 1fr); }
  .user-summary > .status-badge { grid-column: 2; justify-self: start; }
  .system-row { grid-template-columns: 1fr; gap: 11px; }
  .switch-button { justify-self: start; }
  .numeric-settings-grid, .product-fields, .activity-fields, .skill-list, .staff-create-grid, .role-matrix { grid-template-columns: 1fr; }
  .skill-presentation-fields { grid-template-columns: 1fr; gap: 8px; }
  .numeric-setting, .numeric-setting:nth-child(2n), .numeric-setting:nth-child(3n), .skill-manage-card, .skill-manage-card:nth-child(2n), .role-matrix article, .role-matrix article:nth-child(2n) { border-right: 0; }
  .activity-fields .wide, .staff-create-grid .wide { grid-column: auto; }
  .section-title { align-items: flex-start; flex-direction: column; }
  .dashboard-section-title { align-items: flex-start; }
  .media-uploader { grid-template-columns: 1fr; }
  .media-uploader > small { grid-column: auto; }
  .media-preview { grid-row: auto; }
  .config-submit-bar { position: static; display: grid; }
  .config-submit-bar .compact-primary { width: 100%; }
  .filter-panel { align-items: stretch; }
  .filter-panel label, .filter-panel .primary-button, .filter-panel .secondary-button { width: 100%; min-width: 0; }
  .support-chat-head { align-items: flex-start; flex-direction: column; }
  .support-chat-controls { width: 100%; justify-content: stretch; }
  .support-chat-controls select { flex: 1; min-width: 100px; }
  .support-message { width: 92%; }
  .support-reply-box footer { align-items: stretch; flex-direction: column; }
  .support-reply-actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .support-reply-actions > button { width: 100%; }
  .support-quick-reply-panel { width: 100%; }
  .support-quick-reply-body { grid-template-columns: 112px minmax(0, 1fr); }
  .support-quick-reply-nav { padding: 6px; }
  .support-quick-reply-nav button { padding: 7px 6px; }
  .support-reply-box .compact-primary { width: 100%; }
  .support-user-rail, .knowledge-grid { grid-template-columns: 1fr; }
  .page-actions { align-items: stretch; flex-wrap: wrap; }
  .creator-visibility-state, .creator-visibility-button { flex: 1; justify-content: center; }
  .creator-message-list, .creator-rule-summary { grid-template-columns: 1fr; }
  .creator-message-editor, .creator-message-editor:nth-child(2n), .creator-rule-summary .config-item, .creator-rule-summary .config-item:nth-child(2n), .creator-rule-summary .config-item:nth-child(3n) { border-right: 0; }
  .creator-funnel > div { grid-template-columns: 76px minmax(70px, 1fr) 58px; }
  .creator-funnel small { display: none; }
  .creator-review-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .creator-review-actions .primary-button, .creator-review-actions .secondary-button { width: 100%; }
  .creator-payout-toolbar { align-items: stretch; flex-direction: column; }
  .creator-payout-toolbar > div { align-items: stretch; flex-direction: column; }
  .creator-partner-batch-toolbar .batch-actions { grid-template-columns: 1fr; }
  .creator-partner-select-all { justify-content: center; }
  .creator-rule-fields, .creator-rule-batch { grid-template-columns: 1fr; }
  .creator-rule-batch > div:first-child, .creator-rule-batch .secondary-button { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .support-quick-reply-scrim,
  .support-quick-reply-panel { transition-duration: 1ms; }
}
.creation-channel-check-warning {
  padding: 14px 16px;
  border: 1px solid #d9aa5d;
  border-left: 4px solid #ac741f;
  border-radius: 8px;
  color: #6b4718;
  background: #fff6e6;
  overflow-wrap: anywhere;
}
.creation-channel-check-warning p { margin: 6px 0; }
