* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
  font-family: Arial, "Microsoft YaHei", sans-serif;
  background: #f3f6fa;
  color: #142033;
}

.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  place-items: center;
  background: rgba(15, 23, 42, 0.72);
  padding: 20px;
}

.is-logged-out .login-overlay {
  display: grid;
}

.login-card {
  display: grid;
  gap: 14px;
  width: min(420px, 100%);
  border-radius: 8px;
  background: #ffffff;
  padding: 28px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.28);
}

.login-card h1 {
  margin: 0;
  font-size: 24px;
}

.login-card p {
  margin: 0 0 4px;
  color: #64748b;
}

.login-card input {
  width: 100%;
}

#loginError {
  min-height: 18px;
  color: #dc2626;
  font-size: 13px;
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
  border-radius: 6px;
  background: #2563eb;
  color: #fff;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

button:hover {
  background: #1d4ed8;
}

button:active {
  transform: translateY(1px);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: #101827;
  color: #fff;
  padding: 24px 18px;
  overflow: auto;
}

.brand {
  display: grid;
  gap: 6px;
  margin-bottom: 22px;
}

.brand strong {
  font-size: 22px;
  line-height: 1.25;
}

.brand span,
.side-note span,
.section-title span,
.topbar p {
  color: #64748b;
  font-size: 13px;
}

.sidebar .brand span,
.sidebar .side-note span {
  color: #b8c2d4;
}

.user-box {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.34);
  padding: 10px 12px;
  margin-bottom: 14px;
}

.user-box b {
  color: #f8fafc;
}

.user-box span {
  color: #cbd5e1;
  font-size: 12px;
}

.user-box .mini {
  justify-self: start;
  margin-top: 4px;
}

.nav-actions {
  display: grid;
  gap: 10px;
}

.nav-actions button {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  text-align: left;
  background: #1f3757;
}

.nav-actions button:hover {
  background: #28507d;
}

.nav-actions .primary {
  background: #0ea5e9;
  font-weight: 700;
}

.nav-actions .primary:hover {
  background: #0284c7;
}

.side-note {
  display: grid;
  gap: 8px;
  margin-top: 20px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  line-height: 1.6;
}

.page {
  min-width: 0;
  padding: 24px 28px 36px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 18px;
}

[hidden] {
  display: none !important;
}

.module-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 0 0 14px;
  padding: 10px;
  border: 1px solid #dfe7f1;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  overflow-x: auto;
}

.module-tab {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 14px;
  background: #e7edf5;
  color: #1e293b;
  white-space: nowrap;
}

.module-tab:hover {
  background: #dbe5f0;
}

.module-tab.active {
  background: #2563eb;
  color: #fff;
  font-weight: 700;
}

.module-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

h1,
h2 {
  margin: 0;
}

h1 {
  font-size: 24px;
}

h2 {
  font-size: 18px;
}

.date-tools {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  align-items: center;
}

.filters,
.account-form,
.schedule-toolbar {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr)) auto;
  gap: 10px;
  align-items: end;
}

.filters label,
.account-form label,
.schedule-toolbar label {
  display: grid;
  gap: 6px;
  color: #334155;
  font-size: 13px;
}

.account-form {
  grid-template-columns: minmax(150px, 1fr) minmax(160px, 1.1fr) minmax(180px, 1.2fr) minmax(120px, 0.8fr) auto auto auto;
  margin-bottom: 14px;
}

.account-tools {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 180px;
  gap: 10px;
  margin-bottom: 12px;
}

.schedule-toolbar {
  grid-template-columns: 160px minmax(320px, 1fr) minmax(260px, 0.8fr) auto auto;
  margin-bottom: 12px;
}

.operator-schedule-toolbar {
  grid-template-columns: 160px minmax(280px, 1fr) minmax(280px, 1fr) minmax(260px, 0.8fr);
  align-items: stretch;
}

.schedule-triggerbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px 12px;
}

.schedule-triggerbar span {
  color: #64748b;
  font-size: 13px;
}

.schedule-triggerbar label {
  display: grid;
  gap: 6px;
  min-width: 260px;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
}

.schedule-action-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-height: 62px;
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  background: #ffffff;
  padding: 10px 12px;
}

.schedule-action-group strong {
  min-width: 54px;
  color: #0f172a;
}

.operator-bulk-actions {
  display: none !important;
}

.operator-account-preview {
  display: grid;
  gap: 6px;
  min-height: 62px;
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px 12px;
  color: #475569;
  font-size: 13px;
}

.operator-account-preview b {
  color: #0f172a;
}

.schedule-manual-panel {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
  border: 1px dashed #93c5fd;
  border-radius: 8px;
  background: #eff6ff;
  padding: 12px;
}

.schedule-manual-panel label {
  display: grid;
  gap: 6px;
  color: #1e3a8a;
  font-size: 13px;
  font-weight: 700;
}

.schedule-manual-panel textarea {
  min-height: 76px;
  background: #ffffff;
}

.schedule-manual-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.schedule-manual-actions span {
  flex: 1 1 280px;
  color: #475569;
  font-size: 13px;
}

.schedule-actionbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px 12px;
}

.schedule-actionbar strong {
  margin-right: auto;
  color: #1e3a8a;
}

.schedule-process {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.schedule-step {
  display: grid;
  gap: 4px;
  border: 1px solid #dbe4f0;
  border-left: 4px solid #64748b;
  border-radius: 8px;
  background: #ffffff;
  padding: 10px 12px;
  line-height: 1.55;
}

.schedule-step.ok {
  border-left-color: #16a34a;
}

.schedule-step.running {
  border-left-color: #2563eb;
  background: #eff6ff;
}

.schedule-step.error {
  border-left-color: #dc2626;
  background: #fff1f2;
}

.schedule-step b {
  color: #0f172a;
}

.schedule-step span {
  color: #334155;
}

.schedule-step em {
  color: #64748b;
  font-style: normal;
  font-size: 12px;
}

.schedule-log-title {
  margin-top: 18px;
}

.check {
  display: flex !important;
  grid-template-columns: none !important;
  flex-direction: row;
  align-items: center;
  gap: 8px !important;
  min-height: 38px;
  white-space: nowrap;
}

.date-tools label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #334155;
  white-space: nowrap;
}

input,
select,
textarea {
  border: 1px solid #d6dee9;
  border-radius: 6px;
  background: #fff;
  color: #142033;
  padding: 9px 10px;
}

select {
  width: 100%;
  min-height: 38px;
}

input[type="date"] {
  min-width: 152px;
}

textarea {
  width: 100%;
  min-height: 104px;
  resize: vertical;
}

.ghost,
.secondary {
  min-height: 38px;
  padding: 0 14px;
}

.ghost {
  background: #e7edf5;
  color: #1e293b;
}

.ghost:hover {
  background: #dbe5f0;
}

.secondary {
  background: #334155;
}

.secondary:hover {
  background: #1e293b;
}

.danger {
  background: #dc2626;
}

.danger:hover {
  background: #b91c1c;
}

.inline {
  width: auto;
  min-height: 38px;
  padding: 0 18px;
  margin: 10px 0;
}

.mini {
  width: auto;
  min-height: 28px;
  padding: 0 9px;
  margin-left: 6px;
  background: #475569;
  font-size: 12px;
}

.mini:hover {
  background: #334155;
}

.mini.danger {
  background: #be123c;
}

.mini.danger:hover {
  background: #9f1239;
}

.panel {
  background: #fff;
  border: 1px solid #dfe7f1;
  border-radius: 8px;
  padding: 18px 20px;
  margin-bottom: 18px;
  box-shadow: 0 1px 1px rgba(15, 23, 42, 0.03);
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 14px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 12px;
}

.metrics.compact {
  grid-template-columns: repeat(5, minmax(110px, 1fr));
}

.metric {
  min-height: 78px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px 14px;
  background: #fbfdff;
}

.metric span {
  display: block;
  color: #64748b;
  font-size: 13px;
}

.metric b {
  display: block;
  margin-top: 8px;
  font-size: 22px;
  line-height: 1.15;
}

.date-context {
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #f8fbff;
  padding: 14px 16px;
}

.date-context-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.date-context-main strong {
  font-size: 18px;
}

.date-context-main span {
  border-radius: 999px;
  background: #e0f2fe;
  color: #075985;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
}

.date-context p {
  margin: 0 0 8px;
  color: #334155;
  line-height: 1.7;
}

.date-context small {
  color: #64748b;
}

.job-supply {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fbfdff;
  padding: 14px 16px;
}

.job-supply-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.job-supply-head span,
.job-supply-meta span {
  color: #64748b;
  font-size: 13px;
}

.job-supply-head strong {
  display: block;
  margin-top: 4px;
  font-size: 30px;
  line-height: 1;
}

.job-supply-head em {
  border-radius: 999px;
  padding: 5px 12px;
  font-style: normal;
  font-weight: 700;
  font-size: 13px;
}

.job-supply-head.ok em {
  color: #166534;
  background: #dcfce7;
}

.job-supply-head.low em {
  color: #9f1239;
  background: #ffe4e6;
}

.job-supply-head.missing em {
  color: #92400e;
  background: #fef3c7;
}

.job-supply-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}

.job-supply p {
  margin: 10px 0 0;
  color: #334155;
  line-height: 1.7;
}

.learning-principle {
  margin-top: 14px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #f8fbff;
  padding: 12px 14px;
}

.learning-principle strong {
  display: block;
  margin-bottom: 6px;
  font-size: 15px;
}

.learning-principle p {
  margin: 4px 0;
  color: #334155;
  line-height: 1.7;
}

.context-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 12px;
}

.context-card {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fbfdff;
  padding: 12px 14px;
  min-height: 112px;
}

.context-card strong {
  display: block;
  margin-bottom: 8px;
  color: #0f172a;
}

.context-card p {
  margin: 0;
  color: #334155;
  line-height: 1.7;
}

.context-card ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.context-card li {
  margin: 6px 0;
  color: #334155;
  line-height: 1.55;
}

.context-card li b {
  display: block;
  color: #0f172a;
}

.context-card li span {
  color: #64748b;
}

.metric.good {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.metric.ok {
  border-color: #fde68a;
  background: #fffbeb;
}

.metric.bad {
  border-color: #fecaca;
  background: #fff1f2;
}

.metric.blue {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.table-wrap {
  overflow: auto;
  border: 1px solid #e5ebf3;
  border-radius: 8px;
}

.table-wrap.small {
  max-height: 260px;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.table-count {
  margin: -4px 0 10px;
  color: #64748b;
  font-size: 13px;
}

.tab,
.learning-tab {
  width: auto;
  min-height: 34px;
  padding: 0 13px;
  background: #e7edf5;
  color: #1e293b;
}

.tab:hover,
.tab.active,
.learning-tab:hover,
.learning-tab.active {
  background: #2563eb;
  color: #fff;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: #fff;
}

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid #edf2f7;
  white-space: nowrap;
}

td.left {
  white-space: normal;
}

th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  color: #475569;
  font-weight: 700;
  z-index: 1;
}

tr:hover td {
  background: #f8fbff;
}

.left {
  text-align: left;
}

.right {
  text-align: right;
}

td.good {
  color: #15803d;
  font-weight: 700;
}

td.ok {
  color: #a16207;
  font-weight: 700;
}

td.bad {
  color: #be123c;
  font-weight: 700;
}

.suggestion-object {
  display: grid;
  gap: 3px;
  min-width: 180px;
}

.suggestion-object span {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 700;
}

.suggestion-object b {
  color: #0f172a;
  font-size: 14px;
}

.suggestion-object em {
  color: #64748b;
  font-style: normal;
  font-size: 12px;
}

.suggestion-reason {
  max-width: 680px;
  white-space: normal;
  line-height: 1.65;
}

.suggestion-reason mark {
  background: #fef3c7;
  color: #92400e;
  border-radius: 4px;
  padding: 1px 4px;
  font-weight: 800;
}

.empty {
  text-align: center;
  color: #64748b;
  padding: 24px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(360px, 1.2fr);
  gap: 18px;
}

.alert-list {
  display: grid;
  gap: 10px;
}

.alert-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 2px;
}

.alert-filter {
  width: auto;
  min-height: 32px;
  padding: 0 10px;
  background: #e7edf5;
  color: #1e293b;
}

.alert-filter.active {
  background: #0f172a;
  color: #fff;
}

.alert-filter b {
  display: inline-flex;
  justify-content: center;
  min-width: 20px;
  margin-left: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.32);
  padding: 1px 6px;
}

.alert {
  display: grid;
  gap: 6px;
  border-left: 4px solid #f59e0b;
  background: #fffbeb;
  padding: 12px;
  border-radius: 6px;
  line-height: 1.55;
}

.alert-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.alert-head em {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 2px 8px;
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
}

.alert-head em.priority {
  background: #ffe4e6;
  color: #be123c;
}

.alert-head em.watch {
  background: #e0f2fe;
  color: #0369a1;
}

.alert.critical {
  border-left-color: #e11d48;
  background: #fff1f2;
}

.alert.high {
  border-left-color: #f97316;
}

.alert-body {
  display: grid;
  gap: 8px;
  color: #475569;
  font-size: 13px;
}

.alert span,
.empty-card {
  color: #475569;
  font-size: 13px;
}

.alert-summary {
  display: grid;
  gap: 8px;
}

.alert-summary-item {
  display: grid;
  gap: 3px;
  border: 1px solid rgba(148, 163, 184, 0.36);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.74);
  padding: 8px 10px;
}

.alert-summary-item.object {
  border-color: rgba(37, 99, 235, 0.22);
  background: rgba(239, 246, 255, 0.74);
}

.alert-summary-item b {
  color: #0f172a;
  font-size: 13px;
}

.alert-summary-item span {
  white-space: normal;
}

.alert-details {
  margin-top: 2px;
}

.alert-details summary {
  cursor: pointer;
  color: #0f172a;
  font-weight: 800;
  user-select: none;
}

.alert-details div {
  margin-top: 8px;
  max-height: 420px;
  overflow: auto;
  border-top: 1px solid rgba(148, 163, 184, 0.35);
  padding-top: 8px;
  line-height: 1.65;
}

.alert mark {
  background: #fde68a;
  color: #92400e;
  border-radius: 4px;
  padding: 1px 4px;
  font-weight: 800;
}

.empty-card {
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  padding: 18px;
  text-align: center;
}

pre {
  margin: 0;
  min-height: 130px;
  max-height: 420px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  background: #0f172a;
  color: #dbeafe;
  border-radius: 8px;
  padding: 14px;
  font-size: 13px;
  line-height: 1.55;
}

#answer {
  margin-top: 4px;
}

.advisor-chat-panel {
  display: flex;
  flex-direction: column;
  min-height: 720px;
}

.advisor-title {
  align-items: flex-start;
  gap: 12px;
}

.advisor-title > div {
  display: grid;
  gap: 4px;
}

.ai-helper {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  padding: 12px 14px;
  color: #1e3a8a;
  line-height: 1.65;
}

.ai-helper span {
  color: #334155;
}

.ai-quick-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.ai-prompt-chip {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: #1e293b;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.ai-prompt-chip:hover {
  border-color: #2563eb;
  color: #1d4ed8;
  background: #eff6ff;
}

.ai-answer {
  display: grid;
  gap: 12px;
  color: #0f172a;
  max-height: 720px;
  overflow: auto;
  padding-right: 4px;
}

.ai-chat-shell {
  align-content: start;
  min-height: 420px;
  max-height: 620px;
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  background: #f8fafc;
  padding: 14px;
}

.ai-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin-top: 12px;
}

.ai-composer textarea {
  min-height: 86px;
  margin: 0;
  resize: vertical;
}

.ai-composer-actions {
  display: grid;
  gap: 8px;
  justify-items: stretch;
}

.ai-composer-actions span {
  color: #64748b;
  font-size: 12px;
  text-align: center;
  white-space: nowrap;
}

.ai-chat-message {
  display: grid;
  gap: 6px;
}

.ai-chat-meta {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.ai-chat-body {
  display: grid;
  gap: 12px;
}

.ai-chat-user .ai-chat-body {
  justify-self: end;
  max-width: 82%;
  border-radius: 8px;
  background: #2563eb;
  color: #ffffff;
  padding: 12px 14px;
  line-height: 1.7;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.16);
}

.ai-chat-assistant .ai-chat-body {
  max-width: 100%;
}

.ai-answer-block,
.ai-answer-card,
.ai-answer-note {
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  background: #ffffff;
  padding: 14px 16px;
  line-height: 1.7;
}

.ai-answer-conclusion {
  border-color: #bfdbfe;
  background: linear-gradient(180deg, #eff6ff 0%, #ffffff 100%);
  font-size: 16px;
  font-weight: 700;
}

.ai-answer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 12px;
}

.ai-answer-title {
  margin-bottom: 8px;
  color: #1e3a8a;
  font-size: 15px;
  font-weight: 800;
}

.ai-answer-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
}

.ai-answer-list li::marker {
  color: #2563eb;
  font-weight: 700;
}

.ai-answer-note {
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
  font-weight: 700;
}

.ai-answer-json {
  min-height: auto;
  max-height: 240px;
  margin-top: 6px;
}

.builder-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 12px;
}

.builder-form label {
  display: grid;
  gap: 7px;
  color: #334155;
  font-weight: 700;
}

.builder-form .wide {
  grid-column: 1 / -1;
}

.builder-legacy-field {
  display: none !important;
}

.builder-form textarea {
  min-height: 96px;
  resize: vertical;
}

.builder-auto-note {
  padding: 10px 12px;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  background: #eff6ff;
  color: #1e40af;
  font-size: 13px;
  font-weight: 600;
}

.builder-batch-panel {
  display: grid;
  gap: 10px;
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  background: #f8fafc;
  padding: 12px;
}

.builder-batch-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.builder-batch-head strong {
  display: block;
  color: #0f172a;
}

.builder-batch-head span,
.builder-batch-panel p {
  margin: 0;
  color: #64748b;
  font-size: 13px;
  font-weight: 500;
}

.builder-batch-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.builder-batch-table {
  display: grid;
  gap: 6px;
  overflow-x: auto;
}

.builder-batch-header,
.builder-batch-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.25fr) minmax(145px, .95fr) minmax(110px, .8fr) minmax(110px, .8fr) minmax(92px, .7fr) minmax(92px, .7fr) minmax(100px, .8fr) minmax(100px, .75fr) 72px;
  gap: 8px;
  align-items: center;
  min-width: 1120px;
}

.builder-batch-header {
  color: #475569;
  font-size: 13px;
  font-weight: 800;
}

.builder-batch-rows {
  display: grid;
  gap: 8px;
}

.builder-batch-row {
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #ffffff;
  padding: 8px;
}

.builder-batch-row input,
.builder-batch-row select {
  width: 100%;
  min-width: 0;
}

.builder-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.builder-actions span {
  color: #64748b;
  font-size: 13px;
}

.builder-result {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.builder-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  padding: 12px 14px;
}

.builder-summary b {
  color: #1e3a8a;
}

.builder-summary span {
  font-weight: 800;
}

.builder-summary em {
  color: #64748b;
  font-style: normal;
}

.builder-summary.has-error {
  border-color: #fecaca;
  background: #fef2f2;
}

.builder-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 12px;
}

.builder-card {
  display: grid;
  gap: 8px;
  border: 1px solid #dbe4f0;
  border-left: 4px solid #2563eb;
  border-radius: 8px;
  background: #ffffff;
  padding: 14px 16px;
}

.builder-card.warning {
  border-left-color: #f59e0b;
}

.builder-card.error {
  border-left-color: #dc2626;
}

.builder-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.builder-card-head b {
  color: #0f172a;
  font-size: 16px;
}

.builder-card-head span {
  border-radius: 999px;
  background: #e0ecff;
  color: #1d4ed8;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 800;
}

.builder-card.error .builder-card-head span {
  background: #fee2e2;
  color: #b91c1c;
}

.builder-card.warning .builder-card-head span {
  background: #fef3c7;
  color: #92400e;
}

.builder-card p {
  margin: 0;
  color: #334155;
  line-height: 1.55;
}

.builder-card mark {
  border-radius: 4px;
  background: #fef9c3;
  color: #713f12;
  padding: 1px 4px;
  font-weight: 800;
}

@media (max-width: 1180px) {
  body {
    grid-template-columns: 220px 1fr;
  }

  .metrics,
  .metrics.compact,
  .context-grid {
    grid-template-columns: repeat(3, minmax(130px, 1fr));
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .filters,
  .account-form,
  .account-tools,
  .schedule-toolbar,
  .schedule-manual,
  .builder-form {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }

  .builder-cards {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  body {
    display: block;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .page {
    padding: 18px;
  }

  .topbar {
    display: grid;
  }

  .date-tools {
    justify-content: flex-start;
  }

  .metrics,
  .metrics.compact,
  .context-grid,
  .ai-answer-grid,
  .filters,
  .account-form,
  .account-tools,
  .schedule-toolbar,
  .schedule-manual,
  .builder-form {
    grid-template-columns: 1fr;
  }

  .ai-composer {
    grid-template-columns: 1fr;
  }

  .ai-composer-actions {
    justify-items: start;
  }
}
