:root {
  --bg: #eef2f6;
  --panel: #ffffff;
  --soft: #f8fafc;
  --line: #d9e2ec;
  --line-strong: #b7c4d3;
  --text: #1f2933;
  --muted: #64748b;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --green: #15803d;
  --green-soft: #e8f5ec;
  --amber: #b7791f;
  --amber-soft: #fff7db;
  --red: #b91c1c;
  --red-soft: #fee2e2;
  --shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
  font-size: 14px;
}
button, input, select, textarea { font: inherit; }
button { border: 0; cursor: pointer; }
a { text-decoration: none; }
body.booting {
  background: #e8eef6;
}
body:not(.booting) .boot-splash {
  display: none !important;
}
.boot-splash {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #e8eef6;
}
.boot-card {
  width: min(280px, 100%);
  padding: 26px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
  display: grid;
  justify-items: center;
  gap: 10px;
}
.boot-card strong {
  font-size: 18px;
}
.boot-card small {
  color: var(--muted);
}
.boot-mark {
  width: 46px;
  height: 46px;
  border-radius: 10px;
}
.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #e8eef6;
}
.login-card {
  width: min(420px, 100%);
  padding: 28px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  display: grid;
  gap: 14px;
}
.login-mark, .brand-mark, .boot-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  flex: 0 0 auto;
  background: linear-gradient(135deg, #2563eb 0%, #0ea5e9 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 8px 18px rgba(37, 99, 235, 0.22);
}
.app-logo::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 8px;
  width: 20px;
  height: 26px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 8px 5px 0 rgba(255, 255, 255, 0.24);
}
.app-logo::after {
  content: "";
  position: absolute;
  left: 15px;
  top: 17px;
  width: 13px;
  height: 2px;
  border-radius: 99px;
  background: #2563eb;
  box-shadow: 0 6px 0 #38bdf8, 0 12px 0 #93c5fd;
}
.app-logo span {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 21px;
  height: 2px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.7);
}
.login-card h1, .brand h1 { margin: 0; font-size: 20px; }
.login-card p, .brand p { margin: 0; color: var(--muted); font-size: 12px; }
.auth-tabs {
  height: 36px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
}
.auth-tab {
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}
.auth-tab.active {
  background: #fff;
  color: var(--blue-dark);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}
.login-card label, .detail-form label {
  display: grid;
  gap: 6px;
}
.login-card label span, .detail-form label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.login-card input, .project-form input, .project-form select, .project-select, .detail-form input, .detail-form select, .detail-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  outline: 0;
  background: #fff;
  color: var(--text);
}
.login-error { min-height: 18px; color: var(--red); font-size: 12px; }
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  height: 76px;
  padding: 14px 22px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand, .top-actions, .button-row, .toolbar, .segments {
  display: flex;
  align-items: center;
}
.brand { gap: 12px; min-width: 0; }
.top-actions, .button-row { gap: 10px; }
.top-actions { position: relative; }
.primary-button, .secondary-button, .ghost-button, .danger-button {
  min-height: 36px;
  border-radius: 8px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  white-space: nowrap;
}
.primary-button { color: #fff; background: var(--blue); }
.primary-button:hover { background: var(--blue-dark); }
.secondary-button { color: var(--blue-dark); background: #e8f1ff; border: 1px solid #bdd4ff; }
.ghost-button { color: #334155; background: #f1f5f9; border: 1px solid var(--line); }
.danger-button { color: var(--red); background: var(--red-soft); border: 1px solid #fecaca; margin-top: 12px; }
.full { width: 100%; }
.user-badge {
  height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  background: #f1f5f9;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
}
.system-badge {
  height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  background: #ecfeff;
  border: 1px solid #a5f3fc;
  color: #155e75;
  font-size: 12px;
  font-weight: 800;
}
.notice-button {
  position: relative;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #f8fafc;
  color: #102a43;
  padding: 0 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}
.notice-button.active,
.notice-button:hover {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: var(--blue-dark);
}
.notice-button i {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--red);
}
.notice-popover {
  position: absolute;
  top: 46px;
  right: 0;
  z-index: 60;
  width: min(520px, calc(100vw - 28px));
  min-height: 360px;
  max-height: calc(100vh - 110px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
  padding: 18px;
}
.notice-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.notice-head strong {
  display: block;
  color: #102a43;
  font-size: 18px;
}
.notice-head small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}
.notice-close {
  min-height: 30px;
  border-radius: 999px;
  background: #111827;
  color: #fff;
  padding: 0 12px;
  font-weight: 800;
}
.notice-tabs {
  height: 38px;
  margin-top: 18px;
  padding: 3px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  border-radius: 999px;
  background: #f1f5f9;
}
.notice-tabs button {
  border-radius: 999px;
  background: transparent;
  color: #334155;
  font-weight: 800;
}
.notice-tabs button.active {
  background: #fff;
  box-shadow: 0 1px 5px rgba(15, 23, 42, 0.12);
}
.notice-list {
  margin-top: 22px;
}
.notice-item {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 14px;
}
.notice-item i {
  width: 8px;
  height: 8px;
  margin-top: 7px;
  border-radius: 999px;
  background: #94a3b8;
}
.notice-item strong {
  display: block;
  color: #102a43;
  font-size: 15px;
}
.notice-item p {
  margin: 8px 0 0;
  color: #1f2933;
  font-size: 14px;
  line-height: 1.65;
  white-space: pre-line;
}
.notice-item small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}
.timeline-item + .timeline-item {
  margin-top: 16px;
}
.timeline-item i {
  background: var(--blue);
  box-shadow: 0 0 0 4px #dbeafe;
}
.timeline-item p {
  color: var(--muted);
}
.timeline-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.timeline-title-row small {
  margin: 0;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef6ff;
  color: var(--blue);
  font-weight: 800;
}
.timeline-body {
  margin-top: 8px;
  color: #344054;
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-line;
}
.timeline-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
}
.timeline-meta small {
  margin: 0;
}
.timeline-meta button {
  border: 0;
  background: transparent;
  color: var(--blue);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}
.notice-empty {
  padding: 68px 10px;
  color: var(--muted);
  text-align: center;
}
button:disabled, .primary-button:disabled, .secondary-button:disabled, .ghost-button:disabled, .danger-button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}
.disabled-link {
  pointer-events: none;
  opacity: 0.52;
}
.soft-disabled {
  opacity: 0.58;
  filter: grayscale(0.2);
}
.layout {
  flex: 1;
  display: grid;
  grid-template-columns: 280px minmax(680px, 1fr) 320px;
  gap: 14px;
  padding: 14px;
  min-height: 0;
}
.sidebar, .inspector { min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.panel, .workbench {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.panel { padding: 14px; }
.panel-heading { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.panel-heading span {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: #e6f6fb;
  color: #0e7490;
  font-size: 12px;
  font-weight: 800;
}
.panel-heading h2 { margin: 0; font-size: 14px; }
.project-form { display: grid; gap: 8px; margin-top: 10px; }
.project-field {
  display: grid;
  gap: 6px;
}
.project-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.template-info {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  padding: 9px 10px;
}
.template-info:empty {
  display: none;
}
.template-info strong,
.template-info small {
  display: block;
}
.template-info strong {
  color: #102a43;
  font-size: 13px;
}
.template-info small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.template-info .template-hint {
  color: var(--blue-dark);
  font-weight: 700;
}
.upload-zone {
  min-height: 140px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: var(--soft);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 18px;
  text-align: center;
  cursor: pointer;
}
.upload-zone.dragover { border-color: var(--blue); background: #eff6ff; }
.upload-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.upload-zone small { color: var(--muted); }
.button-row { margin-top: 12px; }
.button-row button { flex: 1; }
.button-row.compact {
  margin-top: 8px;
  gap: 8px;
}
.file-list, .status-feed, .audit-list, .quota-list { display: grid; gap: 8px; }
.file-list, .audit-list, .user-list { max-height: 250px; overflow: auto; }
.file-list { max-height: 360px; }
.commercial-list, .quality-list { display: grid; gap: 8px; }
.commercial-list { margin-bottom: 10px; }
.quality-list + .quality-list { margin-top: 10px; }
.user-list { display: grid; gap: 8px; margin-top: 10px; }
.admin-subhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 12px 0 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.admin-subhead strong { font-size: 13px; }
.template-admin-entry .secondary-button {
  padding: 6px 12px;
}
.admin-console {
  position: fixed;
  inset: 0;
  z-index: 80;
  padding: 32px;
  background: rgba(15, 23, 42, 0.38);
  display: grid;
  place-items: center;
}
.admin-dialog {
  width: min(1180px, 100%);
  max-height: min(860px, calc(100vh - 64px));
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}
.admin-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}
.admin-dialog-head strong,
.template-editor-head strong,
.template-library-head strong,
.template-fields-head strong {
  display: block;
  color: #102a43;
  font-size: 16px;
}
.admin-dialog-head small,
.template-editor-head small,
.template-fields-head small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}
.admin-dialog-body {
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
}
.admin-console-nav {
  padding: 14px;
  border-right: 1px solid var(--line);
  background: #f8fafc;
  display: grid;
  align-content: start;
  gap: 8px;
}
.admin-console-nav button {
  min-height: 40px;
  padding: 0 12px;
  border-radius: 8px;
  background: transparent;
  color: #334155;
  font-weight: 800;
  text-align: left;
}
.admin-console-nav button.active {
  background: #e8f0ff;
  color: var(--blue-dark);
}
.admin-workspace {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}
.template-admin {
  height: 100%;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 0;
}
.template-library {
  min-height: 0;
  padding: 16px;
  border-right: 1px solid var(--line);
  background: #f8fafc;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
}
.template-library-head,
.template-editor-head,
.template-fields-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.template-admin-list {
  display: grid;
  gap: 6px;
  align-content: start;
  max-height: none;
  overflow: auto;
}
.template-admin-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}
.template-admin-item strong,
.template-admin-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.template-admin-item small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}
.template-admin-item.inactive { opacity: 0.58; }
.template-editor {
  min-height: 0;
  padding: 18px;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 14px;
}
.template-form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) 150px 120px;
  gap: 10px;
  align-items: end;
}
.template-editor label,
.template-description {
  display: grid;
  gap: 6px;
}
.template-editor label span,
.template-description span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.template-editor input,
.template-editor select,
.template-editor textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  outline: 0;
  background: #fff;
  color: var(--text);
}
.template-active-line {
  min-height: 38px;
  display: flex !important;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}
.template-active-line input {
  width: auto;
}
.template-admin-feedback {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--soft);
  color: #102a43;
  font-weight: 700;
}
.template-admin-feedback.success {
  border-color: #bbf7d0;
  background: #ecfdf5;
  color: #15803d;
}
.template-admin-feedback.error {
  border-color: #fecaca;
  background: #fff1f2;
  color: #b91c1c;
}
.template-field-list {
  display: grid;
  gap: 8px;
}
.template-field-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.8fr) minmax(150px, 1fr) minmax(220px, 1.5fr) 120px 78px 70px;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}
.template-field-row .field-required {
  justify-content: center;
  font-size: 12px;
  padding: 0;
}
.template-field-row .field-required input {
  width: auto;
}
.template-field-row .field-remove { height: 36px; }
.usage-log-admin {
  height: 100%;
  min-height: 0;
  padding: 18px;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 14px;
}
.commercial-admin,
.accounts-admin,
.announcement-admin-view {
  height: 100%;
  min-height: 0;
  padding: 18px;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 14px;
}
.admin-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.admin-section-head strong,
.admin-card h3 {
  display: block;
  margin: 0;
  color: #102a43;
  font-size: 16px;
}
.admin-section-head small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}
.admin-card-list {
  max-width: 980px;
}
.admin-split-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(420px, 1.1fr);
  gap: 14px;
  align-items: start;
}
.admin-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 14px;
  display: grid;
  gap: 12px;
}
.announcement-history-list {
  display: grid;
  gap: 8px;
  max-height: 540px;
  overflow: auto;
}
.announcement-history-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--soft);
  padding: 10px;
}
.announcement-history-item.active {
  border-color: #bfdbfe;
  background: #eff6ff;
}
.announcement-history-item.inactive {
  opacity: 0.72;
}
.announcement-history-item strong,
.announcement-history-item small,
.announcement-history-item p {
  display: block;
}
.announcement-history-item small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}
.announcement-history-item p {
  margin: 8px 0 0;
  color: #334155;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
}
.usage-log-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.usage-log-head strong {
  display: block;
  color: #102a43;
  font-size: 16px;
}
.usage-log-head small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}
.usage-log-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.usage-log-stats div {
  min-height: 70px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}
.usage-log-stats span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.usage-log-stats strong {
  display: block;
  margin-top: 8px;
  color: #102a43;
  font-size: 24px;
}
.usage-log-list {
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 8px;
}
.usage-log-item {
  display: grid;
  grid-template-columns: 132px minmax(150px, 1fr) 110px minmax(220px, 1.4fr);
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.usage-time {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.usage-log-item strong,
.usage-log-item small,
.usage-detail span,
.usage-detail small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.usage-log-item strong {
  color: #102a43;
}
.usage-log-item small,
.usage-detail small {
  color: var(--muted);
  font-size: 12px;
}
.usage-action {
  justify-self: start;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  background: #eef2f7;
  color: #334155;
}
.usage-action.primary {
  background: #dbeafe;
  color: #1d4ed8;
}
.usage-action.success {
  background: #dcfce7;
  color: #15803d;
}
.usage-action.danger {
  background: #fee2e2;
  color: #b91c1c;
}
.file-item, .status-line, .audit-item, .user-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  padding: 10px;
}
.selected-file {
  background: #fff;
}
.file-row-head, .job-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.file-actions,
.job-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex: 0 0 auto;
}
.file-row-head strong {
  min-width: 0;
  flex: 1;
}
.file-item strong, .audit-item strong, .user-item strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}
.file-item small, .status-line, .audit-item p, .user-item small { color: var(--muted); font-size: 12px; line-height: 1.45; margin: 4px 0 0; }
.job-item {
  background: #fff;
}
.job-item.running {
  border-color: #93c5fd;
  background: #eff6ff;
}
.job-item.failed {
  border-color: #fecaca;
  background: #fff7f7;
}
.job-item.cancelled {
  border-color: #cbd5e1;
  background: #f8fafc;
}
.job-head > div {
  min-width: 0;
}
.job-head strong {
  color: #102a43;
}
.job-head small {
  display: block;
  margin-top: 3px;
}
.queue-badge {
  flex: 0 0 auto;
  min-height: 22px;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}
.queue-badge.done {
  color: var(--green);
  background: var(--green-soft);
}
.queue-badge.running {
  color: var(--blue-dark);
  background: #dbeafe;
}
.queue-badge.pending {
  color: #475569;
  background: #e2e8f0;
}
.queue-badge.failed {
  color: var(--red);
  background: var(--red-soft);
}
.queue-badge.cancelled {
  color: #475569;
  background: #f1f5f9;
}
.job-progress {
  height: 6px;
  margin-top: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}
.job-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}
.job-meta {
  margin-top: 8px;
  color: #334155;
  font-size: 12px;
  line-height: 1.45;
}
.job-files {
  margin-top: 8px;
  display: grid;
  gap: 0;
}
.job-file-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  padding: 6px 0;
  border-top: 1px dashed var(--line);
}
.job-file-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #334155;
  font-size: 12px;
}
.job-file-row small {
  grid-column: 1 / -1;
  margin-top: 0;
  color: var(--red);
  overflow-wrap: anywhere;
}
.job-more {
  padding-top: 6px;
  border-top: 1px dashed var(--line);
}
.job-secondary-action {
  margin-top: 8px;
}
.danger-lite {
  color: #b91c1c;
  background: #fff1f2;
  border-color: #fecdd3;
}
.icon-button {
  min-width: 30px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
}
.quota-status {
  border-radius: 8px;
  border: 1px solid #bbf7d0;
  background: var(--green-soft);
  padding: 9px 10px;
}
.quota-status.expired {
  border-color: #fecaca;
  background: var(--red-soft);
}
.quota-status strong, .quota-status span {
  display: block;
}
.quota-status strong {
  color: var(--green);
  font-size: 13px;
}
.quota-status.expired strong {
  color: var(--red);
}
.quota-status span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}
.quota-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 9px 10px;
}
.quota-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.quota-line span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.quota-line strong {
  color: #102a43;
  font-size: 12px;
}
.quota-bar {
  height: 7px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
  margin-top: 8px;
}
.quota-bar i {
  display: block;
  height: 100%;
  min-width: 4px;
  border-radius: inherit;
  background: linear-gradient(90deg, #22c55e, #2563eb);
}
.quota-item small, .quota-note small, .quota-note span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.quota-item small {
  margin-top: 6px;
}
.quota-note {
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  padding: 9px 10px;
}
.quota-note span {
  color: #1e3a8a;
  font-weight: 700;
}
.quota-note small {
  margin-top: 4px;
}
.commercial-row {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  padding: 8px 10px;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}
.commercial-row span, .quality-summary {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.commercial-row strong {
  color: #102a43;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.commercial-alert, .quality-summary, .quality-ok {
  border: 1px solid #facc15;
  border-radius: 8px;
  background: var(--amber-soft);
  color: #92400e;
  padding: 9px 10px;
  font-size: 12px;
  line-height: 1.45;
}
.plan-list, .order-list {
  display: grid;
  gap: 8px;
}
.plan-list { margin-top: 10px; }
.order-list {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.plan-card {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}
.plan-card.active {
  border-color: #93c5fd;
  background: #eff6ff;
}
.plan-card strong, .order-item strong {
  display: block;
  color: #102a43;
  font-size: 13px;
}
.plan-card span, .plan-card small, .order-item small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.plan-card .contact-line {
  color: #0f766e;
  font-weight: 700;
}
.plan-card .contact-line a {
  color: #0f766e;
}
.announcement-admin, .invite-admin {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.quota-adjust-admin strong {
  font-size: 13px;
  color: #0f172a;
}
.quota-adjust-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.invite-code-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}
.invite-summary {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
  padding: 8px 10px;
}
.invite-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 8px 10px;
}
.invite-item strong {
  display: block;
  color: #102a43;
  font-size: 13px;
}
.invite-item small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}
.invite-item.used {
  background: #f8fafc;
}
.invite-item.disabled {
  opacity: 0.65;
}
.announcement-admin textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  resize: vertical;
}
.check-line {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}
.check-line input {
  width: auto;
}
.plan-card b {
  color: var(--blue-dark);
  font-size: 18px;
}
.plan-card b small {
  display: inline;
  margin-left: 2px;
  color: var(--muted);
  font-weight: 700;
}
.order-item {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.quality-ok {
  border-color: #bbf7d0;
  background: var(--green-soft);
  color: var(--green);
  font-weight: 800;
}
.quality-item {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 9px 10px;
}
.quality-item:hover { border-color: var(--blue); background: #eff6ff; }
.quality-item strong {
  display: block;
  color: #102a43;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.quality-item small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.user-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.tiny {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}
.empty, .empty-table { padding: 18px 8px; color: var(--muted); text-align: center; }
.workbench { display: flex; flex-direction: column; min-height: calc(100vh - 104px); overflow: hidden; }
.metrics {
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 10px;
  border-bottom: 1px solid var(--line);
}
.metric {
  min-height: 76px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.metric span { color: var(--muted); font-size: 12px; }
.metric strong { color: #102a43; font-size: 24px; line-height: 1; }
.metric.ok { background: var(--green-soft); }
.metric.ok strong { color: var(--green); }
.metric.warn { background: var(--amber-soft); }
.metric.warn strong { color: var(--amber); }
.metric.money { background: #eef2ff; }
.metric.money strong { color: #3730a3; }
.toolbar { padding: 12px 14px; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.search-box {
  min-width: 280px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
}
.search-box input { width: 100%; border: 0; outline: 0; }
.segments { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.segment { height: 34px; padding: 0 12px; color: #334155; background: #fff; border-right: 1px solid var(--line); }
.segment:last-child { border-right: 0; }
.segment.active { color: #fff; background: var(--blue); font-weight: 800; }
.table-frame { flex: 1; overflow: auto; }
.ledger-table { width: 1360px; min-width: 1360px; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
.ledger-table th, .ledger-table td {
  padding: 11px 14px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  line-height: 1.48;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.ledger-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #edf5ff;
  color: #102a43;
  font-size: 12px;
  text-align: left;
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: normal;
}
.ledger-table.template-table th {
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
}
.ledger-table.template-table td {
  word-break: normal;
  overflow-wrap: anywhere;
}
.ledger-table th:first-child, .ledger-table td:first-child { text-align: center; padding-left: 8px; padding-right: 8px; }
.ledger-table.contract-table th:first-child, .ledger-table.contract-table td:first-child { width: 52px; }
.ledger-table.contract-table th:nth-child(2) { width: 190px; }
.ledger-table.contract-table th:nth-child(8) { width: 150px; }
.ledger-table.contract-table th:nth-child(7), .ledger-table.contract-table th:nth-child(11) { width: 220px; }
.ledger-table tbody tr { background: #fff; }
.ledger-table tbody tr:nth-child(even) { background: #fbfdff; }
.ledger-table tbody tr.selected { outline: 2px solid var(--blue); outline-offset: -2px; background: #eff6ff; }
.ledger-table .term-cell { white-space: pre-line; }
.ledger-table .amount-cell {
  white-space: nowrap;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.ledger-table .note-cell {
  color: #334155;
  line-height: 1.45;
}
.ledger-table .note-cell div {
  max-height: 72px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}
.muted-cell {
  color: #94a3b8;
}
.status-pill {
  display: inline-flex;
  min-width: 72px;
  min-height: 26px;
  border-radius: 999px;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 800;
}
.status-done { color: var(--green); background: var(--green-soft); }
.status-review { color: var(--amber); background: var(--amber-soft); }
.status-failed { color: var(--red); background: var(--red-soft); }
.status-pending { color: #475569; background: #f1f5f9; }
.detail-form { display: grid; gap: 10px; }
.detail-form textarea { resize: vertical; line-height: 1.45; }
.custom-field-list {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}
.two-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.record-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.record-meta div {
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  padding: 8px;
}
.record-meta span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.record-meta strong {
  display: block;
  margin-top: 6px;
  color: #102a43;
  font-size: 12px;
  word-break: break-all;
}
@media (max-width: 1240px) {
  .layout { grid-template-columns: 260px minmax(620px, 1fr); }
  .inspector { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .topbar { height: auto; align-items: flex-start; flex-direction: column; }
  .top-actions { width: 100%; flex-wrap: wrap; }
  .layout { grid-template-columns: 1fr; }
  .inspector { display: flex; }
  .metrics { grid-template-columns: repeat(2, minmax(130px, 1fr)); }
  .toolbar { align-items: stretch; flex-direction: column; }
}

/* Product UI refresh 1.1.33 */
:root {
  --bg: #f3f6fb;
  --panel: #ffffff;
  --soft: #f8fafc;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --text: #102033;
  --muted: #667085;
  --blue: #165dff;
  --blue-dark: #0e42cc;
  --blue-soft: #eef5ff;
  --green: #0f8f4d;
  --green-soft: #eaf8f0;
  --amber: #b7791f;
  --amber-soft: #fff8e5;
  --red: #c5221f;
  --red-soft: #fff0f0;
  --shadow: 0 12px 32px rgba(18, 38, 63, 0.07);
  --shadow-strong: 0 24px 70px rgba(18, 38, 63, 0.18);
}

body {
  background:
    linear-gradient(180deg, #f8fbff 0, #f2f6fb 220px, #edf2f7 100%);
  color: var(--text);
  font-family: "Noto Sans SC", "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
}

body::-webkit-scrollbar,
.file-list::-webkit-scrollbar,
.status-feed::-webkit-scrollbar,
.audit-list::-webkit-scrollbar,
.user-list::-webkit-scrollbar,
.table-frame::-webkit-scrollbar,
.notice-popover::-webkit-scrollbar,
.template-admin-list::-webkit-scrollbar,
.template-editor::-webkit-scrollbar,
.usage-log-list::-webkit-scrollbar,
.announcement-history-list::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

body::-webkit-scrollbar-thumb,
.file-list::-webkit-scrollbar-thumb,
.status-feed::-webkit-scrollbar-thumb,
.audit-list::-webkit-scrollbar-thumb,
.user-list::-webkit-scrollbar-thumb,
.table-frame::-webkit-scrollbar-thumb,
.notice-popover::-webkit-scrollbar-thumb,
.template-admin-list::-webkit-scrollbar-thumb,
.template-editor::-webkit-scrollbar-thumb,
.usage-log-list::-webkit-scrollbar-thumb,
.announcement-history-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #b9c4d3;
}

.login-view,
.boot-splash {
  background: linear-gradient(180deg, #f8fbff 0, #eef3f8 100%);
}

.login-card,
.boot-card {
  border-radius: 16px;
  border-color: rgba(203, 213, 225, 0.78);
  box-shadow: var(--shadow-strong);
}

.login-card {
  gap: 16px;
  padding: 32px;
}

.login-mark,
.brand-mark,
.boot-mark {
  border-radius: 12px;
  background: linear-gradient(135deg, #165dff 0%, #0ea5e9 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24), 0 12px 24px rgba(22, 93, 255, 0.24);
}

.brand-mark {
  width: 48px;
  height: 48px;
}

.topbar {
  height: 78px;
  padding: 14px 26px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid rgba(226, 232, 240, 0.92);
  box-shadow: 0 8px 24px rgba(18, 38, 63, 0.05);
  backdrop-filter: blur(12px);
}

.brand {
  gap: 14px;
}

.brand h1 {
  font-size: 22px;
  line-height: 1.1;
  font-weight: 900;
  color: #0f172a;
}

.brand p {
  margin-top: 6px;
  color: #5f6f86;
  font-size: 12px;
}

.top-actions {
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.primary-button,
.secondary-button,
.ghost-button,
.danger-button,
.notice-button,
.system-badge,
.user-badge {
  min-height: 38px;
  border-radius: 10px;
}

.primary-button {
  background: linear-gradient(135deg, var(--blue), #0e42cc);
  box-shadow: 0 8px 18px rgba(22, 93, 255, 0.18);
}

.primary-button:hover {
  background: linear-gradient(135deg, #0e42cc, #1238ad);
}

.secondary-button {
  color: var(--blue-dark);
  background: #eef5ff;
  border-color: #c9dcff;
}

.secondary-button:hover {
  border-color: #9fc0ff;
  background: #e4efff;
}

.ghost-button {
  color: #334155;
  background: #f7f9fc;
}

.system-badge {
  border-color: #b7f0ff;
  background: #ecfeff;
  color: #075985;
}

.user-badge {
  background: #f1f5f9;
  color: #334155;
}

.notice-button {
  width: 40px;
  min-width: 40px;
  padding: 0;
  border-color: #d9e2ec;
  background: #f8fafc;
  color: #0f172a;
}

.notice-button span {
  position: relative;
  width: 18px;
  height: 18px;
  font-size: 0;
}

.notice-button span::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 2px;
  width: 12px;
  height: 13px;
  border: 2px solid currentColor;
  border-bottom: 0;
  border-radius: 10px 10px 4px 4px;
}

.notice-button span::after {
  content: "";
  position: absolute;
  left: 7px;
  bottom: 0;
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 -13px 0 -1px currentColor;
}

.notice-button i {
  top: 6px;
  right: 7px;
  width: 8px;
  height: 8px;
  box-shadow: 0 0 0 2px #fff;
}

.notice-button.active,
.notice-button:hover {
  color: var(--blue-dark);
  border-color: #bdd4ff;
  background: #eff6ff;
}

.notice-popover {
  position: fixed;
  top: 86px;
  right: 22px;
  width: min(560px, calc(100vw - 44px));
  min-height: 520px;
  max-height: calc(100vh - 108px);
  border-radius: 18px;
  border-color: rgba(203, 213, 225, 0.86);
  padding: 22px;
  box-shadow: var(--shadow-strong);
}

.notice-head strong {
  font-size: 20px;
}

.notice-head small {
  color: #667085;
}

.notice-close {
  background: #101828;
  min-height: 32px;
}

.notice-tabs {
  height: 42px;
  margin-top: 20px;
  background: #f2f4f7;
  box-shadow: inset 0 0 0 1px #e4e7ec;
}

.notice-tabs button.active {
  color: #101828;
  box-shadow: 0 3px 10px rgba(16, 24, 40, 0.1);
}

.notice-list {
  margin-top: 24px;
}

.notice-item {
  grid-template-columns: 12px minmax(0, 1fr);
}

.notice-item i {
  width: 9px;
  height: 9px;
  margin-top: 7px;
}

.notice-item strong {
  font-size: 16px;
}

.notice-item p {
  color: #344054;
  line-height: 1.75;
}

.layout {
  grid-template-columns: minmax(276px, 304px) minmax(760px, 1fr) minmax(312px, 340px);
  gap: 16px;
  padding: 16px;
}

.sidebar,
.inspector {
  gap: 14px;
}

.panel,
.workbench {
  border-radius: 12px;
  border-color: rgba(210, 221, 235, 0.92);
  box-shadow: 0 10px 28px rgba(18, 38, 63, 0.06);
}

.panel {
  padding: 16px;
}

.panel-heading {
  margin-bottom: 14px;
}

.panel-heading span {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: #eaf7ff;
  color: #0f6b87;
}

.panel-heading h2 {
  font-size: 15px;
  color: #101828;
}

.project-select,
.login-card input,
.project-form input,
.project-form select,
.detail-form input,
.detail-form select,
.detail-form textarea,
.template-editor input,
.template-editor select,
.template-editor textarea {
  min-height: 40px;
  border-radius: 10px;
  border-color: #d7e0eb;
  background: #fff;
}

.project-select:focus,
.login-card input:focus,
.project-form input:focus,
.project-form select:focus,
.detail-form input:focus,
.detail-form select:focus,
.detail-form textarea:focus,
.template-editor input:focus,
.template-editor select:focus,
.template-editor textarea:focus,
.search-box:focus-within {
  border-color: #9fc0ff;
  box-shadow: 0 0 0 3px rgba(22, 93, 255, 0.12);
}

.template-info,
.quota-item,
.commercial-row,
.plan-card,
.order-item,
.record-meta div,
.custom-field-list,
.status-line,
.file-item,
.user-item,
.quality-item,
.invite-item,
.invite-summary {
  border-radius: 10px;
  border-color: #dce6f2;
}

.upload-zone {
  min-height: 156px;
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(248, 250, 252, 0.9)),
    #f8fafc;
  border-color: #b8c7dc;
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--blue);
  background: #eff6ff;
  box-shadow: inset 0 0 0 1px rgba(22, 93, 255, 0.12);
}

.file-list,
.status-feed,
.audit-list,
.user-list {
  gap: 10px;
}

.workbench {
  min-height: calc(100vh - 110px);
  background: rgba(255, 255, 255, 0.98);
}

.metrics {
  padding: 16px;
  gap: 12px;
}

.metric {
  min-height: 84px;
  border-radius: 12px;
  background: #f8fafc;
  border-color: #dce6f2;
}

.metric span {
  color: #667085;
  font-weight: 700;
}

.metric strong {
  font-size: 28px;
  font-weight: 900;
}

.metric.ok {
  background: linear-gradient(180deg, #f4fbf6, var(--green-soft));
}

.metric.warn {
  background: linear-gradient(180deg, #fffdf3, var(--amber-soft));
}

.metric.money {
  background: linear-gradient(180deg, #f8faff, #edf3ff);
}

.toolbar {
  padding: 14px 16px;
  background: #fff;
}

.search-box {
  min-width: 320px;
  height: 40px;
  border-radius: 11px;
  border-color: #d7e0eb;
}

.segments {
  border-radius: 11px;
  background: #f8fafc;
}

.segment {
  height: 38px;
  padding: 0 14px;
}

.segment.active {
  background: var(--blue);
  box-shadow: 0 6px 14px rgba(22, 93, 255, 0.2);
}

.table-frame {
  background: #fff;
}

.ledger-table th,
.ledger-table td {
  border-color: #dbe6f2;
}

.ledger-table th {
  background: #f2f7ff;
  color: #1d2939;
  font-size: 13px;
  font-weight: 900;
}

.ledger-table td {
  color: #1f2937;
}

.ledger-table tbody tr {
  transition: background 0.14s ease;
}

.ledger-table tbody tr:hover {
  background: #f8fbff;
}

.ledger-table tbody tr.selected {
  outline: 2px solid #2f6eff;
  background: #eef6ff;
}

.status-pill {
  min-height: 28px;
}

.detail-panel {
  position: sticky;
  top: 94px;
}

.admin-console {
  padding: 28px;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(8px);
}

.admin-dialog {
  width: min(1280px, calc(100vw - 56px));
  max-height: min(900px, calc(100vh - 56px));
  border-radius: 18px;
  box-shadow: var(--shadow-strong);
}

.admin-dialog-head {
  padding: 20px 24px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.admin-dialog-head strong {
  font-size: 20px;
}

.admin-dialog-body {
  grid-template-columns: 210px minmax(0, 1fr);
}

.admin-console-nav {
  padding: 18px;
  background: #f7f9fc;
  gap: 10px;
}

.admin-console-nav button {
  min-height: 44px;
  border-radius: 11px;
  padding: 0 14px;
}

.admin-console-nav button:hover {
  background: #eef5ff;
  color: var(--blue-dark);
}

.admin-console-nav button.active {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 8px 18px rgba(22, 93, 255, 0.18);
}

.template-admin {
  grid-template-columns: 300px minmax(0, 1fr);
}

.template-library {
  padding: 18px;
  background: #f7f9fc;
}

.template-admin-item {
  padding: 11px;
  border-radius: 11px;
  background: #fff;
}

.template-admin-item:hover {
  border-color: #9fc0ff;
  background: #f8fbff;
}

.template-editor,
.usage-log-admin,
.commercial-admin,
.accounts-admin,
.announcement-admin-view {
  padding: 22px;
}

.template-form-grid {
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) 140px 130px;
}

.template-field-row,
.usage-log-item,
.usage-log-stats div,
.admin-card,
.announcement-history-item {
  border-radius: 12px;
  border-color: #dce6f2;
}

.usage-log-stats div {
  background: #f8fafc;
}

.usage-log-item:hover {
  background: #f8fbff;
}

.admin-card {
  box-shadow: 0 8px 24px rgba(18, 38, 63, 0.04);
}

.announcement-history-item:hover {
  border-color: #9fc0ff;
  background: #f8fbff;
}

@media (max-width: 1320px) {
  .layout {
    grid-template-columns: minmax(260px, 292px) minmax(680px, 1fr);
  }

  .inspector {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr);
  }

  .detail-panel {
    position: static;
  }
}

@media (max-width: 900px) {
  .admin-split-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 960px) {
  .topbar {
    padding: 14px 16px;
  }

  .brand h1 {
    font-size: 20px;
  }

  .layout {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .inspector {
    display: flex;
  }

  .search-box {
    min-width: 0;
  }

  .admin-dialog {
    width: calc(100vw - 24px);
  }

  .admin-dialog-body,
  .template-admin {
    grid-template-columns: 1fr;
  }

  .admin-console-nav {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
