:root {
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  color: #25232a;
  background: #f4f5f7;
  font-size: 14px;
  letter-spacing: 0;
}

/* Operation log: extends the existing admin table and form styles. */
.audit-filters { padding: 20px; background: white; border: 1px solid #e3e1e7; border-radius: 8px; }
.audit-filter-row { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 24px; align-items: end; }
.audit-filter-row label { margin: 0; }
.audit-date-range { min-width: 0; margin: 0; padding: 0; border: 0; display: flex; align-items: center; gap: 10px; }
.audit-date-range legend { padding: 0; margin-bottom: 8px; color: #56515e; font-weight: 600; }
.audit-date-range input { min-width: 0; }
.audit-keyword-row { display: flex; gap: 12px; margin-top: 18px; }
.audit-keyword-row input { flex: 1; min-width: 0; }
.audit-keyword-row button { flex-shrink: 0; }
.audit-message { min-height: 20px; color: #ad3f48; }
.audit-table { min-width: 780px; }
#auditPanel .table-wrap { overflow-x: auto; border: 1px solid #e3e1e7; background: white; }
#auditPanel table { display: table; min-width: 780px; }
#auditPanel thead { display: table-header-group; }
#auditPanel tbody { display: table-row-group; }
#auditPanel tr { display: table-row; }
#auditPanel td { display: table-cell; padding: 14px 15px; }
#auditPanel td::before { display: none; }
.audit-table td { vertical-align: top; }
.audit-table td:nth-child(1) { white-space: nowrap; }
.audit-table td:nth-child(2), .audit-table td:nth-child(4) { max-width: 260px; overflow-wrap: anywhere; }
.audit-result { display: inline-block; border-radius: 5px; padding: 5px 10px; font-weight: 600; white-space: nowrap; }
.audit-result.success { color: #1d6547; background: #e0f6ec; }
.audit-result.failure { color: #a62e38; background: #fce7ea; }
.audit-result.partial, .audit-result.unknown { color: #855400; background: #fff0cb; }
.audit-result.skipped { color: #56515e; background: #eeedf1; }
.audit-expand { color: #7046b8; background: transparent; min-height: 32px; padding: 0 8px; }
.audit-expand:hover { background: #f1ebf9; }
.audit-details-row td { background: #f8f8fa; padding: 16px 24px; white-space: normal !important; }
.audit-details-row p { margin: 4px 0 8px; overflow-wrap: anywhere; color: #56515e; }
.audit-item-list { max-height: 420px; overflow: auto; }
.audit-item { padding: 10px 0; border-top: 1px solid #e4e3e7; }
.audit-change { padding-left: 14px; }
.audit-footer { display: flex; gap: 20px; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.audit-footer > p { color: #56515e; }
.audit-footer .pagination { margin: 16px 0; flex-wrap: wrap; }
#auditPanel button:disabled { opacity: .55; cursor: default; }
#auditPanel button:focus-visible { outline: 2px solid #7046b8; outline-offset: 3px; }
@media (max-width: 900px) { .audit-filter-row { grid-template-columns: 1fr 1fr; gap: 16px; } .audit-date-range { grid-column: 1 / -1; } }
@media (max-width: 520px) { .audit-filters { padding: 14px; } .audit-keyword-row { flex-wrap: wrap; } .audit-keyword-row input { flex-basis: 100%; } .audit-filter-row { gap: 12px; } .audit-footer .pagination { gap: 8px; } }
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button, input, textarea { font: inherit; letter-spacing: 0; }
button { border: 0; cursor: pointer; }
.hidden { display: none !important; }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: #f1f2f5; }
.login-panel { width: min(390px, 100%); padding: 34px 32px; background: white; border: 1px solid #e5e4e9; border-radius: 8px; box-shadow: 0 12px 36px rgba(28, 24, 38, .08); }
.brand-mark { width: 56px; height: 56px; display: grid; place-items: center; border-radius: 8px; color: white; font-size: 24px; font-weight: 700; background: #7046b8; }
.brand-mark.small { width: 38px; height: 38px; font-size: 17px; }
.login-panel h1 { margin: 22px 0 8px; font-size: 24px; }
.login-panel p { color: #777380; line-height: 1.65; margin: 0 0 24px; }
label { display: grid; gap: 8px; margin: 16px 0; color: #56515e; font-weight: 600; }
input, select, textarea { width: 100%; border: 1px solid #dcd9e2; border-radius: 6px; padding: 11px 12px; color: #25232a; background: white; outline: none; }
input:focus, select:focus, textarea:focus { border-color: #7046b8; box-shadow: 0 0 0 3px rgba(112, 70, 184, .11); }
button { min-height: 40px; border-radius: 6px; padding: 0 16px; color: white; background: #7046b8; font-weight: 600; }
button:hover { background: #6039a3; }
.login-panel > button { width: 100%; margin-top: 8px; }
.message { min-height: 20px; margin-top: 12px; color: #c83f49; text-align: center; }
header { height: 64px; display: flex; align-items: center; justify-content: space-between; padding: 0 max(24px, calc((100vw - 1320px) / 2)); background: white; border-bottom: 1px solid #e4e3e7; }
.brand, .brand > div { display: flex; align-items: center; }
.brand > div { align-items: flex-start; flex-direction: column; gap: 2px; margin-left: 10px; }
.brand strong { font-size: 17px; }
.brand span:not(.brand-mark) { color: #85818b; font-size: 12px; }
.header-actions { display: flex; align-items: center; gap: 8px; color: #777380; }
.quiet, .secondary { color: #5f5967; background: #eeedf1; }
.quiet:hover, .secondary:hover { background: #e2e0e6; }
main { width: min(1320px, calc(100% - 48px)); margin: 30px auto 60px; }
.view-switch { display: flex; gap: 8px; margin-bottom: 24px; }
.view-switch button { min-width: 110px; color: #5f5967; background: #eeedf1; }
.view-switch button.active { color: white; background: #7046b8; }
.view-switch #supportButton { margin-left: auto; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
h1, h2, p { letter-spacing: 0; }
.page-heading h1 { margin: 0 0 6px; font-size: 26px; }
.page-heading p { margin: 0; color: #777380; }
.heading-actions, .toolbar-actions { display: flex; align-items: center; gap: 10px; }
.danger-button { color: #ad3f48; background: #fde8ea; }
.danger-button:hover { color: white; background: #b63f49; }
.stats { display: grid; grid-template-columns: repeat(5, minmax(120px, 1fr)); border: 1px solid #e3e1e7; border-radius: 8px; background: white; overflow: hidden; }
.stats button { display: flex; min-height: 80px; flex-direction: column; align-items: flex-start; justify-content: center; gap: 7px; padding: 14px 18px; color: #6e6974; background: white; border-right: 1px solid #eceaf0; border-radius: 0; }
.stats button:last-child { border-right: 0; }
.stats button:hover, .stats button.active { background: #f6f2fc; }
.stats button.active { box-shadow: inset 0 -3px #7046b8; color: #7046b8; }
.stats strong { color: #29262e; font-size: 23px; }
.client-stats { grid-template-columns: repeat(3, minmax(160px, 1fr)); margin-bottom: 18px; }
.client-table { min-width: 1280px; }
.toolbar { display: flex; justify-content: space-between; gap: 12px; margin: 18px 0 12px; }
.toolbar input { max-width: 360px; }
.page-size-label { display: flex; align-items: center; gap: 6px; margin: 0; color: #6d6872; font-weight: 400; white-space: nowrap; }
.page-size-label select { width: 74px; padding: 9px 8px; }
.batch-toolbar { display: flex; align-items: center; gap: 16px; min-height: 52px; margin-bottom: 12px; padding: 8px 12px; border: 1px solid #e3e1e7; border-radius: 7px; background: white; }
.batch-toolbar > div { display: flex; gap: 8px; margin-left: auto; }
.batch-toolbar button:disabled { cursor: not-allowed; opacity: .48; }
.select-page { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 500; }
.select-page input, .select-column input, .row-select { width: 18px; height: 18px; margin: 0; accent-color: #7046b8; box-shadow: none; }
.select-column { width: 48px; text-align: center; }
.select-cell { text-align: center; }
.table-wrap { overflow-x: auto; border: 1px solid #e3e1e7; border-radius: 8px; background: white; }
table { width: 100%; border-collapse: collapse; min-width: 1080px; }
th, td { padding: 14px 15px; text-align: left; border-bottom: 1px solid #eceaf0; vertical-align: middle; }
th { color: #777380; background: #faf9fb; font-size: 12px; font-weight: 600; }
td { color: #4e4954; }
td code { font-family: Consolas, monospace; color: #29262e; font-size: 14px; font-weight: 700; }
.copy-code { display: inline-grid; place-items: center; min-height: 28px; padding: 0 8px; margin-left: 7px; color: #7046b8; background: #f1ebfa; font-size: 12px; }
.badge { display: inline-block; border-radius: 20px; padding: 5px 9px; font-size: 12px; font-weight: 600; }
.badge.unused { color: #735620; background: #fff3d7; }
.badge.active { color: #28724c; background: #e3f6eb; }
.badge.expired { color: #6f6a74; background: #eeedf0; }
.badge.disabled { color: #ad3f48; background: #fde8ea; }
.badge.online { color: #28724c; background: #e3f6eb; }
.badge.offline { color: #6f6a74; background: #eeedf0; }
.row-action { min-height: 32px; padding: 0 10px; color: #5f5967; background: #eeedf1; font-size: 12px; }
.row-action.danger { color: #ad3f48; background: #fde8ea; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.empty { padding: 54px; color: #8a8590; text-align: center; }
.pagination { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 14px; color: #6d6872; }
.pagination button { min-width: 82px; }
.pagination button:disabled { cursor: not-allowed; opacity: .5; }
dialog { width: min(480px, calc(100% - 32px)); border: 0; border-radius: 8px; padding: 24px; box-shadow: 0 20px 70px rgba(26, 20, 35, .25); }
dialog::backdrop { background: rgba(24, 21, 29, .44); }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.dialog-head h2 { margin: 0; font-size: 20px; }
.dialog-head p { margin: 6px 0 0; color: #777380; }
.icon-button { width: 34px; min-height: 34px; padding: 0; color: #6d6872; background: #efedf1; font-size: 22px; line-height: 1; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
#generatedCodes { height: 240px; margin-top: 18px; resize: none; font-family: Consolas, monospace; line-height: 1.8; }
#supportNote { resize: vertical; min-height: 94px; }
.field-hint { margin-left: 6px; color: #99939f; font-size: 11px; font-weight: 400; }
.required { color: #c83f49; }
.rule-fieldset { margin: 16px 0; border: 1px solid #e2dfe6; border-radius: 6px; padding: 13px 14px 14px; }
.rule-fieldset legend { padding: 0 4px; color: #56515e; font-weight: 600; }
.rule-options { display: flex; flex-wrap: wrap; gap: 10px 22px; }
.rule-options label { display: flex; align-items: center; gap: 8px; margin: 0; color: #5f5967; font-weight: 400; cursor: pointer; }
.rule-options input { width: 18px; height: 18px; margin: 0; accent-color: #7046b8; box-shadow: none; }
.toast { position: fixed; right: 24px; bottom: 24px; max-width: min(360px, calc(100% - 48px)); transform: translateY(120px); opacity: 0; transition: .2s ease; padding: 12px 16px; border-radius: 6px; color: white; background: #29262e; box-shadow: 0 8px 28px rgba(0,0,0,.2); }
.toast.show { transform: translateY(0); opacity: 1; }
@media (max-width: 760px) {
  header { height: auto; min-height: 64px; padding: 10px 14px; }
  .header-actions #adminName { display: none; }
  main { width: calc(100% - 24px); margin-top: 20px; }
  .view-switch { display: grid; grid-template-columns: 1fr 1fr; }
  .view-switch #supportButton { grid-column: 1 / -1; margin-left: 0; }
  .view-switch button { min-width: 0; }
  .page-heading { align-items: stretch; flex-direction: column; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stats button { min-height: 68px; border-bottom: 1px solid #eceaf0; }
  .stats button:last-child { grid-column: 1 / -1; }
  .toolbar { display: grid; grid-template-columns: minmax(0, 1fr) 68px; }
  .toolbar input { max-width: none; min-width: 0; }
  .toolbar button { width: 68px; padding: 0; }
  .login-panel { padding: 28px 22px; }
  .table-wrap { overflow: visible; border: 0; background: transparent; }
  table, tbody { display: block; min-width: 0; }
  .client-table { min-width: 0; }
  thead { display: none; }
  tbody { display: grid; gap: 10px; }
  tbody tr { display: grid; grid-template-columns: 1fr auto; padding: 13px 14px; border: 1px solid #e3e1e7; border-radius: 8px; background: white; }
  tbody td { grid-column: 1 / -1; display: grid; grid-template-columns: 92px minmax(0, 1fr); align-items: center; min-width: 0; padding: 8px 0; border-bottom: 1px solid #efedf2; }
  tbody td::before { content: attr(data-label); color: #85818b; font-size: 12px; font-weight: 600; }
  tbody td:first-child { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 7px; padding-top: 1px; }
  tbody td:first-child::before { width: 100%; }
  tbody td:first-child code { overflow-wrap: anywhere; }
  tbody td:nth-child(2) { grid-column: 2; grid-row: 1; display: block; padding: 0; border: 0; }
  tbody td:nth-child(2)::before { display: none; }
  tbody td:last-child { border-bottom: 0; padding-bottom: 1px; }
  .copy-code { margin-left: 0; }
  .empty { border: 1px solid #e3e1e7; border-radius: 8px; background: white; }
  dialog { padding: 20px; }
  .dialog-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .dialog-actions button { width: 100%; }
}

/* Management console layout */
.app-shell { min-height: 100vh; background: #f4f6f8; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 30; width: 248px;
  display: flex; flex-direction: column; color: #cfdae4; background: #071c2c;
  box-shadow: 6px 0 24px rgba(7, 28, 44, .08);
}
.sidebar-brand { height: 76px; display: flex; align-items: center; gap: 11px; padding: 0 24px; border-bottom: 1px solid rgba(207, 218, 228, .1); }
.sidebar-brand .brand-mark { background: #7046b8; }
.sidebar-brand > div { display: flex; flex-direction: column; gap: 3px; }
.sidebar-brand strong { color: #fff; font-size: 17px; }
.sidebar-brand span:not(.brand-mark) { color: #8497a8; font-size: 11px; }
.side-nav { flex: 1; overflow-y: auto; padding: 14px 10px 18px; scrollbar-width: thin; scrollbar-color: #2f4352 transparent; }
.side-nav button { width: 100%; }
.nav-item, .nav-subitem {
  display: flex; align-items: center; min-height: 48px; border-radius: 6px;
  color: #c5d1dc; background: transparent; font-size: 15px; font-weight: 500; text-align: left;
}
.nav-item { gap: 13px; padding: 0 13px; }
.nav-item:hover, .nav-item.active { color: #fff; background: #173247; }
.nav-item.active { box-shadow: inset 3px 0 #8a62ce; }
.nav-icon { width: 24px; color: #9eb0bf; font-size: 21px; text-align: center; line-height: 1; }
.nav-item.active .nav-icon { color: #b99be8; }
.chevron { margin-left: auto; color: #7890a2; font-size: 17px; transition: transform .18s ease; }
.nav-group-toggle[aria-expanded="false"] .chevron { transform: rotate(-90deg); }
.nav-submenu { display: grid; gap: 2px; padding: 2px 0 7px 50px; overflow: hidden; }
.nav-submenu.collapsed { display: none; }
.nav-subitem { min-height: 38px; padding: 0 12px; color: #91a4b4; font-size: 13px; }
.nav-subitem:hover, .nav-subitem.active { color: #fff; background: #132c3f; }
.nav-item.unavailable { color: #9aabb9; }
.nav-tag { margin-left: auto; border: 1px solid #3a4f5f; border-radius: 10px; padding: 2px 6px; color: #768d9e; font-size: 9px; font-weight: 500; }
.sidebar-foot { display: flex; align-items: center; gap: 9px; height: 54px; padding: 0 24px; border-top: 1px solid rgba(207, 218, 228, .1); color: #8497a8; font-size: 11px; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #37a76f; box-shadow: 0 0 0 3px rgba(55, 167, 111, .13); }
.workspace { min-height: 100vh; margin-left: 248px; }
.workspace > header {
  position: sticky; top: 0; z-index: 20; width: 100%; height: 64px;
  padding: 0 28px; background: rgba(255,255,255,.97); box-shadow: 0 1px 0 #e5e8eb;
}
.header-title { display: flex; flex-direction: column; gap: 2px; }
.header-title strong { color: #242a31; font-size: 16px; }
.header-title span { color: #8b949e; font-size: 11px; }
.menu-button { display: none; width: 40px; min-height: 40px; margin-right: 10px; padding: 0; color: #39434d; background: #edf0f3; font-size: 20px; }
.workspace > main { width: min(1380px, calc(100% - 56px)); margin: 28px auto 56px; }
.page-heading { align-items: center; }
.dashboard-heading { margin-bottom: 20px; }
.dashboard-stats { display: grid; grid-template-columns: repeat(4, minmax(175px, 1fr)); gap: 14px; }
.dashboard-stats article { display: flex; align-items: center; gap: 15px; min-height: 112px; padding: 20px; border: 1px solid #e3e7eb; border-radius: 7px; background: #fff; box-shadow: 0 2px 9px rgba(35, 42, 49, .035); }
.metric-icon { flex: 0 0 42px; height: 42px; display: grid; place-items: center; border-radius: 7px; font-size: 15px; font-weight: 700; }
.metric-icon.purple { color: #7046b8; background: #eee7f9; }
.metric-icon.green { color: #287a52; background: #e2f3e9; }
.metric-icon.amber { color: #9a6818; background: #fff0d4; }
.metric-icon.red { color: #b0444e; background: #fbe5e7; }
.dashboard-stats article > div { min-width: 0; }
.dashboard-stats small { display: block; color: #767f89; font-size: 12px; }
.dashboard-stats strong { display: block; margin: 3px 0 2px; color: #252b32; font-size: 26px; line-height: 1.1; }
.dashboard-stats p { margin: 0; color: #9aa1a9; font-size: 11px; white-space: nowrap; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(270px, .8fr); gap: 14px; margin-top: 14px; }
.dashboard-block { padding: 20px; border: 1px solid #e3e7eb; border-radius: 7px; background: #fff; }
.block-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 17px; }
.block-heading h2 { margin: 0 0 4px; color: #2a3037; font-size: 17px; }
.block-heading p { margin: 0; color: #929aa3; font-size: 12px; }
.quick-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.quick-actions button { min-height: 74px; display: grid; grid-template-columns: 34px 1fr; grid-template-rows: auto auto; align-content: center; column-gap: 11px; padding: 10px 13px; border: 1px solid #e5e8eb; color: #2f363e; background: #fff; text-align: left; }
.quick-actions button:hover { border-color: #cfc1e7; background: #faf8fd; }
.quick-actions button > span { grid-row: 1 / 3; align-self: center; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 6px; color: #7046b8; background: #eee7f9; font-size: 18px; }
.quick-actions strong { font-size: 13px; }
.quick-actions small { color: #8b949d; font-size: 11px; font-weight: 400; }
.system-block dl { margin: 0; }
.system-block dl > div { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 43px; border-bottom: 1px solid #edf0f2; }
.system-block dl > div:last-child { border-bottom: 0; }
.system-block dt { color: #858e97; }
.system-block dd { display: flex; align-items: center; gap: 8px; margin: 0; color: #424a53; text-align: right; }
.sidebar-backdrop { display: none; }

@media (max-width: 1050px) {
  .dashboard-stats { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  body.sidebar-open { overflow: hidden; }
  .sidebar { width: min(360px, calc(100vw - 30px)); transform: translateX(-105%); transition: transform .2s ease; }
  body.sidebar-open .sidebar { transform: translateX(0); }
  .sidebar-backdrop { position: fixed; inset: 0; z-index: 25; width: 100%; min-height: 100%; border-radius: 0; padding: 0; background: rgba(15, 22, 28, .5); }
  .sidebar-backdrop:hover { background: rgba(15, 22, 28, .5); }
  body.sidebar-open .sidebar-backdrop { display: block; }
  .workspace { margin-left: 0; }
  .workspace > header { min-height: 62px; padding: 9px 12px; }
  .menu-button { display: block; }
  .header-actions { margin-left: auto; }
  .header-actions #passwordButton { display: none; }
  .workspace > main { width: calc(100% - 24px); margin: 20px auto 38px; }
  .dashboard-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .dashboard-stats article { min-height: 100px; gap: 10px; padding: 13px; }
  .metric-icon { flex-basis: 34px; width: 34px; height: 34px; }
  .dashboard-stats strong { font-size: 22px; }
  .dashboard-stats p { overflow: hidden; text-overflow: ellipsis; }
  .dashboard-block { padding: 15px; }
  .quick-actions { grid-template-columns: 1fr; }
  .quick-actions button { min-height: 68px; }
  .heading-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .toolbar, .batch-toolbar { align-items: stretch; flex-direction: column; }
  .toolbar input { max-width: none; }
  .toolbar-actions { justify-content: space-between; }
  .batch-toolbar > div { display: grid; grid-template-columns: 1fr 1fr; width: 100%; margin-left: 0; }
  .pagination { justify-content: space-between; }
  .pagination span { text-align: center; }
}

@media (max-width: 420px) {
  .header-title span { display: none; }
  .dashboard-stats { grid-template-columns: 1fr 1fr; }
  .dashboard-stats article { display: block; }
  .dashboard-stats .metric-icon { margin-bottom: 9px; }
  .dashboard-stats p { white-space: normal; }
}

#batchOperationDialog button:focus-visible,#batchOperationDialog summary:focus-visible{outline:3px solid #b89add;outline-offset:3px}
#batchOperationDialog button:disabled{opacity:.48;cursor:not-allowed}
#batchOperationDialog{width:min(680px,calc(100% - 24px));max-height:calc(100dvh - 24px);padding:0;color:#25232a;overflow:hidden}
#batchOperationForm{max-height:calc(100dvh - 24px);display:flex;flex-direction:column;margin:0}
#batchOperationDialog .dialog-head{padding:24px 26px 20px;border-bottom:1px solid #eceaf0;flex-shrink:0}
#batchOperationDialog .dialog-head p{font-size:13px}
.batch-body{padding:20px 26px 24px;overflow-y:auto;min-height:0}
.batch-source-tabs{display:flex;gap:20px;border-bottom:1px solid #e8e5ec;margin-bottom:18px}
.batch-source-tabs button{padding:0 0 12px;min-height:34px;background:none;color:#6d6872;border-radius:0;border-bottom:2px solid transparent}
.batch-source-tabs button:hover{color:#7046b8;background:none}
.batch-source-tabs button[aria-pressed=true]{color:#7046b8;border-bottom-color:#7046b8}
.batch-source-tabs span{padding:2px 7px;border-radius:4px;background:#f1ebfa;margin-left:4px;font-size:12px}
.batch-scope-line{display:flex;justify-content:space-between;gap:8px;color:#57515f;font-size:13px;line-height:1.7}
.batch-scope-line strong{color:#7046b8;font-size:17px;padding:0 2px}
.batch-muted{color:#777380}
#batchOperationDialog summary{color:#7046b8;cursor:pointer;font-size:13px;margin-top:10px;width:fit-content}
#batchSelectedList{margin-top:10px;padding:10px 12px;background:#faf9fb;border:1px solid #eceaf0;border-radius:6px;max-height:100px;overflow:auto;font:13px/1.9 Consolas,monospace}
#batchSelectedList span{display:inline-block;margin-right:20px}
#batchPastedSource label{margin-top:0}
#batchOperationCodes{font:13px/1.8 Consolas,monospace;resize:vertical;max-height:180px}
#batchOperationError{color:#ad3f48;font-size:13px;margin:6px 0 0}
.batch-operation-field{border:0;padding:0;margin:24px 0 18px;min-width:0}
.batch-operation-field legend{font-weight:600;margin-bottom:12px;font-size:14px}
.batch-operation-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
.batch-operation-grid label{margin:0;position:relative;cursor:pointer;display:block}
.batch-operation-grid input{position:absolute;width:1px;height:1px;opacity:0;margin:0}
.batch-operation-grid span{min-height:42px;padding:10px 6px;border:1px solid #e2dfe6;border-radius:6px;display:block;text-align:center;background:white;font-weight:500;color:#514b58}
.batch-operation-grid input:checked+span{border-color:#7046b8;background:#f5f0fc;color:#7046b8;box-shadow:inset 0 0 0 1px #7046b8;font-weight:600}
.batch-operation-grid input:focus-visible+span{outline:3px solid #b89add;outline-offset:2px}
.batch-operation-grid label:hover span{border-color:#ad97d0}
.batch-operation-grid .batch-delete-option span{color:#ad3f48}
.batch-operation-grid .batch-delete-option input:checked+span{background:#fff1f2;border-color:#b63f49;color:#ad3f48;box-shadow:inset 0 0 0 1px #b63f49}
#batchOperationDetails{padding:16px;background:#faf9fc;border:1px solid #ece8f1;border-radius:6px;line-height:1.75}
#batchOperationDetails h3{margin:0 0 6px;font-size:14px;color:#393240}
#batchOperationDetails p{margin:0;font-size:13px;color:#655e6e}
#batchOperationExtra{margin-top:6px!important;color:#77707d!important}
#batchOperationDetails.is-danger{background:#fff5f5;border-color:#f0ced2}
#batchOperationDetails.is-danger h3,#batchOperationDetails.is-danger p{color:#a13c46!important}
#batchParameterFields label{margin:16px 0 0}
.batch-days-input{display:flex;gap:10px;align-items:center;font-weight:400}
.batch-days-input input{width:140px}
#batchDeleteField{display:flex;align-items:flex-start;gap:10px;font-size:13px;line-height:1.7;color:#983944;font-weight:400}
#batchDeleteField input{width:17px;height:17px;flex-shrink:0;margin:3px 0 0;accent-color:#b63f49}
.batch-footer{padding:18px 26px;border-top:1px solid #eceaf0;background:white;display:flex;align-items:center;justify-content:space-between;gap:12px;flex-shrink:0}
.batch-footer>span{font-size:12px;color:#777380}
.batch-footer>div{display:flex;gap:10px}
#submitBatchOperation.is-danger{color:white;background:#b63f49}
#batchOperationResult{padding:12px 14px;margin-top:16px;background:#edf7f1;color:#276f4c;border:1px solid #c8e3d1;border-radius:6px;line-height:1.8;font-size:13px}


#batchRequestError{color:#a13c46;line-height:1.7;margin:14px 0 0;font-size:13px}
#batchOperationResult{overflow-wrap:anywhere}
#batchOperationDialog [aria-busy=true]{cursor:progress}
#batchOperationDialog .batch-operation-grid input:disabled+span{cursor:default;opacity:.7}

@media(max-width:600px){.batch-operation-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.batch-body{padding:16px 18px}.batch-footer{padding:14px 18px;flex-direction:column;align-items:stretch}.batch-footer>div{justify-content:flex-end}.batch-scope-line{flex-wrap:wrap}#batchOperationDialog .dialog-head{padding:18px}.batch-toolbar>div{grid-template-columns:1fr}.toolbar{display:flex}.toolbar-actions{min-width:0}.toolbar-actions input,.toolbar-actions select,.toolbar-actions button{width:auto;flex-shrink:0}}

.diagnostic-table { width:100%; min-width:720px; }
.diagnostic-actions { white-space:nowrap; }
.diagnostic-actions button + button { margin-left:8px; }
#diagnosticDialog { width:min(600px,calc(100vw - 32px)); }
#diagnosticDetails { display:grid; grid-template-columns:90px minmax(0,1fr); gap:0 16px; }
#diagnosticDetails dt,#diagnosticDetails dd { margin:0; padding:12px 0; border-bottom:1px solid #eceaf0; overflow-wrap:anywhere; }
#diagnosticDetails dt { color:#625e6c; }
#diagnosticMessage { color:#625e6c; min-height:20px; }
#diagnosticPanel .table-wrap { overflow-x:auto; }

/* Approved first agent layout: inline quota editor and a separate agent workspace. */
.agent-search { display:flex; gap:12px; align-items:center; margin:24px 0 14px; }
.agent-search input { max-width:420px; }
.agent-message { color:#ad3f48; min-height:20px; margin:8px 0 14px; }
.agent-note { color:#777380; line-height:1.7; font-size:14px; }
.agent-table { min-width:840px; }
#agentsPanel .agent-table, #agentView .agent-table { display:table; }
#agentsPanel thead, #agentView thead { display:table-header-group; }
#agentsPanel tbody, #agentView tbody { display:table-row-group; }
#agentsPanel tr, #agentView tr { display:table-row; }
#agentsPanel td, #agentView td { display:table-cell; padding:18px; }
#agentsPanel td::before, #agentView td::before { display:none; }
.agent-table td { max-width:260px; overflow-wrap:anywhere; }
.agent-table th { white-space:nowrap; }
.agent-actions { min-width:270px; }
.agent-link { color:#7046b8; padding:4px 8px; background:transparent; min-height:32px; white-space:nowrap; }
.agent-link:hover { background:#f0eaf8; }
.quota-editor-row td { background:#faf8fd; padding:0 22px 22px !important; }
.quota-editor { border:1px solid #e4dbf1; border-radius:6px; padding:22px; margin-top:4px; }
.quota-title { font-size:16px; }
.quota-fields { display:flex; align-items:center; gap:24px; }
.quota-fields label { width:180px; }
.quota-projection { color:#7046b8; font-weight:600; margin-top:40px; }
.quota-editor > label { max-width:620px; }
.quota-buttons { display:flex; gap:12px; }
.quota-message { color:#ad3f48; }
.agent-generate { background:white; border:1px solid #e4e3e7; border-radius:8px; padding:24px; display:flex; gap:24px; align-items:center; flex-wrap:wrap; }
.agent-generate label { margin:0; width:190px; }
.agent-generate label:has(#myCount) { width:120px; }
.agent-generate > button { align-self:center; margin-top:24px; }
.agent-generate > p { width:100%; margin:0; }
.agent-balance { display:flex; flex-direction:column; min-width:180px; gap:8px; color:#777380; }
.agent-balance strong { color:#7046b8; font-size:30px; }
#agentView main { max-width:1240px; }
#agentView header { padding:0 32px; }
#licenseAgentFilter { width:200px; }
#agentEditDialog { width:min(520px, calc(100% - 32px)); max-height:90vh; overflow:auto; }
#agentEditDialog label { margin:12px 0; }
#agentsPanel button:disabled, #agentView button:disabled, #agentEditDialog button:disabled { opacity:.55; cursor:default; }
.card-code { font-family:monospace; font-weight:700; letter-spacing:1px; }
@media(max-width:700px) {
 .agent-search { flex-wrap:wrap; } .agent-search input { max-width:none; flex-basis:100%; }
 #agentView header { height:auto; min-height:72px; padding:14px 16px; gap:12px; flex-wrap:wrap; }
 #agentView .header-actions { flex-wrap:wrap; }
 #agentView main { width:calc(100% - 32px); }
 .agent-generate { padding:18px; gap:18px; }
 .agent-balance { width:100%; }
 .agent-generate label { width:100%; }
 .agent-generate label:has(#myCount) { flex:1; }
 #licenseAgentFilter { width:100%; }
 #agentsPanel .page-heading { align-items:flex-start; }
 #agentsPanel .page-heading h1 { font-size:24px; }
 #agentsPanel .page-heading p { line-height:1.6; }
 #agentsPanel .page-heading > button { white-space:nowrap; }
}
.agent-search { padding:14px; background:white; border:1px solid #e4e3e7; border-radius:7px; }
.agent-search input { max-width:none; flex:1; }
#agentsPanel .agent-message:empty { display:none; }
#agentsPanel .agent-table td:nth-child(4) { color:#7046b8; font-weight:600; }
.quota-editor { display:grid; grid-template-columns:190px 1fr; gap:16px 24px; border:0; padding:24px 0 4px; }
.quota-summary { display:flex; gap:10px; align-items:center; border-right:1px solid #e4dbf1; padding-right:20px; }
.quota-title { color:#7046b8; font-size:23px; white-space:nowrap; }
.quota-fields { gap:22px; }
.quota-fields label { display:flex; align-items:center; gap:10px; width:auto; margin:0; white-space:nowrap; }
.quota-fields label input { width:130px; }
.quota-modes { display:flex; }
.quota-modes button { background:#eeedf1; color:#56515e; border-radius:0; }
.quota-modes button:first-of-type { border-radius:5px 0 0 5px; }
.quota-modes button:last-of-type { border-radius:0 5px 5px 0; }
.quota-modes button.active { color:white; background:#7046b8; }
.quota-projection { margin:14px 0 0; }
.quota-footer { grid-column:1 / -1; display:flex; align-items:center; gap:16px; }
.quota-footer label { display:flex; align-items:center; gap:12px; flex:1; white-space:nowrap; font-weight:400; }
.quota-footer input { flex:1; }
.quota-message { grid-column:1 / -1; margin:0; }
.quota-message:empty { display:none; }
.agent-generate { gap:28px; }
.agent-generate > p { width:auto; flex:1; padding-left:24px; border-left:1px solid #e4e3e7; min-width:180px; }
.agent-generate > button { margin-top:24px; }
@media(max-width:1000px) { .quota-fields { flex-wrap:wrap; gap:12px; } .quota-footer { flex-wrap:wrap; } }
@media(max-width:700px) {
 #agentsPanel .table-wrap, #agentView .table-wrap { overflow:hidden; border:1px solid #e4e3e7; background:white; }
 #agentsPanel .agent-table, #agentView .agent-table { display:block; min-width:0; width:100%; }
 #agentsPanel thead, #agentView thead { display:none; }
 #agentsPanel tbody, #agentView tbody { display:block; }
 #agentsPanel tr, #agentView tr { display:block; border-bottom:1px solid #e4e3e7; }
 #agentsPanel td, #agentView td { display:flex; gap:16px; justify-content:space-between; padding:8px 14px; max-width:none; min-width:0; border:0; }
 #agentsPanel td[data-label]::before, #agentView td[data-label]::before { display:block; content:attr(data-label); color:#777380; font-weight:400; white-space:nowrap; }
 #agentsPanel td.agent-actions { flex-wrap:wrap; justify-content:flex-end; }
 #agentsPanel .quota-editor-row td { display:block; padding:0 14px 18px !important; }
 .quota-editor { display:block; }
 .quota-summary { border:0; margin-bottom:16px; }
 .quota-fields { display:flex; flex-wrap:wrap; }
 .quota-footer { display:block; }
 .quota-footer label { display:grid; }
 .quota-footer input { width:100%; }
 .quota-buttons { margin-top:16px; }
 .quota-message { margin-top:12px; }
 .agent-generate > p { width:100%; padding:0; border:0; }
 .agent-search input { flex-basis:100%; }
}
#myAgentMessage:empty { display:none; }
#generateProjection { color:#7046b8; font-weight:600; }
#myPreset[readonly] { background:#f7f6f9; }
