* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  background: linear-gradient(180deg, #f3f7fb 0%, #eef3f7 100%);
  color: #1f2937;
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
.hidden { display: none !important; }

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at top left, rgba(31,78,120,0.14), transparent 38%),
    radial-gradient(circle at bottom right, rgba(16,185,129,0.12), transparent 28%),
    #eef3f7;
}
.login-card {
  width: min(460px, 100%);
  background: rgba(255,255,255,0.94);
  border: 1px solid rgba(31,78,120,0.08);
  border-radius: 24px;
  padding: 32px;
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.12);
}
.login-eyebrow {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #1f4e78;
  font-weight: 700;
}
.login-card h1 { margin: 8px 0 10px; font-size: 32px; }
.login-subtitle { margin: 0 0 24px; color: #64748b; line-height: 1.6; }
.login-form { display: grid; gap: 16px; }
.login-form label, .grid-form label {
  display: grid;
  gap: 8px;
}
.login-form span, .grid-form span { font-size: 13px; color: #475569; font-weight: 600; }
input, select {
  width: 100%;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid #d0dae5;
  background: #fff;
}
input:focus, select:focus {
  outline: none;
  border-color: #1f4e78;
  box-shadow: 0 0 0 3px rgba(31,78,120,0.12);
}
.btn {
  border: none;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, opacity .12s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: #1f4e78; color: #fff; box-shadow: 0 12px 24px rgba(31,78,120,0.18); }
.btn-secondary { background: #e2e8f0; color: #0f172a; }
.btn-danger { background: #dc2626; color: #fff; }
.btn-ghost { background: transparent; color: #475569; border: 1px solid #cbd5e1; }
.btn-block { width: 100%; }
.login-tip {
  margin-top: 20px;
  padding: 14px 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.7;
  color: #475569;
}
.flash-stack { margin-bottom: 16px; }
.flash {
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
  margin-bottom: 8px;
}
.flash.error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }

.app-shell { padding: 20px; }
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 22px 24px;
  background: rgba(255,255,255,0.92);
  border-radius: 22px;
  border: 1px solid rgba(31,78,120,0.08);
  box-shadow: 0 16px 40px rgba(15,23,42,0.08);
}
.topbar h1 { margin: 6px 0 0; font-size: 28px; }
.brand-tag { font-size: 12px; color: #1f4e78; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.userbox {
  min-width: 150px;
  padding: 10px 14px;
  border-radius: 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}
#currentUserName { font-weight: 700; }
#currentUserRole { font-size: 12px; color: #64748b; margin-top: 4px; }

.workspace-toolbar {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 18px 0;
}
.tabbar {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
}
.tabbar button {
  background: rgba(255,255,255,0.88);
  border: 1px solid #d7e0ea;
  color: #334155;
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
}
.tabbar button.active {
  background: #1f4e78;
  color: #fff;
  border-color: #1f4e78;
}
.bot-entry {
  flex: 0 0 auto;
  min-height: 0;
  padding: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
}
.bot-entry-button {
  border: 1px solid #d7e0ea;
  border-radius: 999px;
  padding: 9px 14px;
  background: linear-gradient(135deg, #2f7fd6 0%, #1f5f9e 52%, #1f4e78 100%);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(31,78,120,0.16);
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease, background .12s ease;
}
.bot-entry-button:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, #3b8ee6 0%, #246ab0 52%, #1a4369 100%);
  border-color: #8fbbe6;
  box-shadow: 0 10px 22px rgba(31,78,120,0.22);
}
.bot-entry-title,
.bot-entry-subtitle {
  display: block;
  white-space: nowrap;
}
.bot-entry-title { font-size: 13px; }
.bot-entry-subtitle {
  display: none;
}
.bot-panel {
  margin: 0 0 18px;
  padding: 18px;
  background: rgba(255,255,255,0.96);
  border: 1px solid rgba(31,78,120,0.1);
  border-radius: 18px;
  box-shadow: 0 18px 42px rgba(15,23,42,0.1);
}
.bot-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.bot-panel-title {
  font-size: 20px;
  font-weight: 900;
  color: #0f172a;
}
.bot-panel-subtitle {
  margin-top: 4px;
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
}
.bot-close-btn {
  flex: 0 0 auto;
}
.bot-quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}
.bot-quick-grid button {
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid #d7e0ea;
  border-radius: 10px;
  background: #f8fafc;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}
.bot-quick-grid button:hover {
  border-color: #1f4e78;
  background: #eff6ff;
  color: #1e40af;
}
.bot-quick-grid button:focus,
.bot-quick-grid button:focus-visible,
.bot-quick-grid button:active {
  outline: none;
  border-color: #9db8d4;
  background: #eef6ff;
  color: #1f4e78;
  box-shadow: 0 0 0 2px rgba(31,78,120,0.12);
}
.bot-messages {
  max-height: 360px;
  overflow: auto;
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #f8fafc;
}
.bot-message {
  max-width: min(860px, 100%);
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.7;
}
.bot-message.user {
  justify-self: end;
  background: #1f4e78;
  color: #fff;
  font-weight: 700;
}
.bot-message.assistant {
  justify-self: start;
  background: #fff;
  border: 1px solid #e2e8f0;
  color: #1f2937;
}
.bot-answer-title {
  font-size: 15px;
  font-weight: 900;
  color: #0f172a;
  margin-bottom: 6px;
}
.bot-answer-lines {
  display: grid;
  gap: 5px;
}
.bot-answer-lines b {
  color: #1f4e78;
}
.bot-table-wrap {
  overflow: auto;
  max-width: 100%;
}
.bot-markdown-table {
  min-width: 760px;
  font-size: 12px;
}
.bot-download-row {
  margin-top: 8px;
}
.bot-download-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 7px 12px;
  text-decoration: none;
}
.bot-input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-top: 12px;
}

.tab-pane { display: none; }
.tab-pane.active { display: block; }

.card {
  background: rgba(255,255,255,0.93);
  border-radius: 22px;
  padding: 20px;
  border: 1px solid rgba(31,78,120,0.08);
  box-shadow: 0 16px 36px rgba(15,23,42,0.06);
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-bottom: 8px;
}
.warning-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}
.warning-subtitle {
  margin-top: 6px;
  color: #64748b;
  font-size: 13px;
}
.warning-card {
  padding: 18px;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #f8fafc;
}
.warning-card-title {
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
}
.warning-card-value {
  margin-top: 10px;
  font-size: 32px;
  line-height: 1.1;
  font-weight: 800;
  color: #b91c1c;
}
.warning-card-sub {
  margin-top: 6px;
  font-size: 13px;
  color: #475569;
}
.warning-card-note {
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.6;
  color: #64748b;
}
.warning-info-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1.15fr) minmax(320px, 0.85fr);
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
}
.warning-panel,
.warning-table-panel {
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #fff;
  padding: 16px;
  overflow: hidden;
}
.warning-panel-head {
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 12px;
}
.warning-rule-list {
  display: grid;
  gap: 10px;
}
.warning-rule-item {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #dbeafe;
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 13px;
  line-height: 1.7;
}
.warning-hook-list {
  display: grid;
  gap: 12px;
}
.warning-hook-item {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px 16px;
  background: #f8fafc;
}
.warning-hook-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.warning-hook-label {
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
}
.warning-hook-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 10px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}
.warning-hook-count {
  font-size: 12px;
  color: #64748b;
  font-weight: 700;
}
.warning-hook-note {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.7;
  color: #334155;
  white-space: normal;
  word-break: break-word;
}
.warning-table-wrap {
  overflow-x: auto;
  overflow-y: auto;
}
.warning-data-table {
  min-width: 2200px;
  table-layout: auto;
}
.warning-data-table th,
.warning-data-table td {
  white-space: nowrap;
  vertical-align: top;
}
.warning-data-table th:nth-child(4),
.warning-data-table td:nth-child(4),
.warning-data-table th:nth-child(20),
.warning-data-table td:nth-child(20) {
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.warning-data-table th:nth-child(1),
.warning-data-table td:nth-child(1) { min-width: 128px; }
.warning-data-table th:nth-child(2),
.warning-data-table td:nth-child(2) { min-width: 96px; }
.warning-data-table th:nth-child(3),
.warning-data-table td:nth-child(3) { min-width: 128px; }
.warning-data-table th:nth-child(4),
.warning-data-table td:nth-child(4) { min-width: 220px; }
.warning-data-table th:nth-child(5),
.warning-data-table td:nth-child(5) { min-width: 120px; }
.warning-data-table th:nth-child(6),
.warning-data-table td:nth-child(6),
.warning-data-table th:nth-child(7),
.warning-data-table td:nth-child(7),
.warning-data-table th:nth-child(8),
.warning-data-table td:nth-child(8) { min-width: 110px; }
.warning-data-table th:nth-child(9),
.warning-data-table td:nth-child(9),
.warning-data-table th:nth-child(10),
.warning-data-table td:nth-child(10),
.warning-data-table th:nth-child(11),
.warning-data-table td:nth-child(11),
.warning-data-table th:nth-child(12),
.warning-data-table td:nth-child(12),
.warning-data-table th:nth-child(13),
.warning-data-table td:nth-child(13),
.warning-data-table th:nth-child(17),
.warning-data-table td:nth-child(17) { min-width: 132px; }
.warning-data-table th:nth-child(14),
.warning-data-table td:nth-child(14),
.warning-data-table th:nth-child(15),
.warning-data-table td:nth-child(15),
.warning-data-table th:nth-child(16),
.warning-data-table td:nth-child(16) { min-width: 118px; }
.warning-data-table th:nth-child(18),
.warning-data-table td:nth-child(18),
.warning-data-table th:nth-child(19),
.warning-data-table td:nth-child(19) { min-width: 120px; }
.warning-data-table th:nth-child(20),
.warning-data-table td:nth-child(20) { min-width: 220px; }
.warning-data-table th:nth-child(21),
.warning-data-table td:nth-child(21) { min-width: 190px; }
.warning-op-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.warning-mini-btn {
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #1f4e78;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.warning-mini-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.warning-mini-btn.primary {
  background: #1f4e78;
  border-color: #1f4e78;
  color: #fff;
}
.warning-reason-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.warning-reason-item {
  padding: 12px 14px;
  border: 1px solid #dbe5ef;
  border-radius: 12px;
  background: #f8fbff;
}
.warning-reason-label {
  font-size: 12px;
  color: #64748b;
  font-weight: 700;
}
.warning-reason-value {
  margin-top: 6px;
  color: #0f172a;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.6;
  word-break: break-word;
}
.warning-reason-form {
  align-items: end;
}
.warning-reason-full {
  grid-column: 1 / -1;
}
.warning-reason-form textarea {
  width: 100%;
  min-height: 108px;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid #d0dae5;
  background: #fff;
  resize: vertical;
  font: inherit;
}
.warning-reason-check {
  display: flex !important;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  min-height: 44px;
}
.warning-reason-check input {
  width: 18px;
  height: 18px;
  margin: 0;
}
.warning-action-log {
  margin-top: 14px;
  border-top: 1px solid #e2e8f0;
  padding-top: 14px;
}
.warning-action-log-title {
  font-size: 13px;
  color: #475569;
  font-weight: 800;
  margin-bottom: 10px;
}
.warning-action-log-empty {
  color: #94a3b8;
  font-size: 13px;
}
.warning-action-item {
  padding: 10px 0;
  border-bottom: 1px dashed #e2e8f0;
}
.warning-action-item:last-child {
  border-bottom: none;
}
.warning-action-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
}
.warning-action-note {
  margin-top: 6px;
  color: #64748b;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
}
@media (max-width: 1180px) {
  .warning-info-grid {
    grid-template-columns: 1fr;
  }
}
.metric-card {
  position: relative;
  border-radius: 24px;
  padding: 28px 30px;
  min-height: 180px;
  color: #fff;
  overflow: hidden;
  box-shadow: 0 20px 48px rgba(15, 23, 42, 0.18);
}
.metric-card:nth-child(1) {
  background: linear-gradient(135deg, #e11d48 0%, #7f1d1d 100%);
}
.metric-card:nth-child(2) {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e3a8a 100%);
}
.metric-card:nth-child(3) {
  background: linear-gradient(135deg, #059669 0%, #064e3b 100%);
}
.metric-card::before {
  content: "";
  position: absolute;
  top: -40px;
  right: -40px;
  width: 160px;
  height: 160px;
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
}
.metric-label {
  font-size: 13px;
  opacity: 0.92;
  letter-spacing: 0.06em;
  font-weight: 600;
  position: relative;
}
.metric-value {
  font-size: 42px;
  font-weight: 800;
  margin-top: 18px;
  letter-spacing: -0.02em;
  position: relative;
  line-height: 1.1;
}
.metric-desc {
  margin-top: 14px;
  font-size: 13px;
  color: rgba(255,255,255,0.88);
  line-height: 1.7;
  position: relative;
}

.two-col {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 16px;
  margin-top: 16px;
}
.card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}
.card-head h2 { margin: 0; font-size: 20px; }
.btn-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.upload-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}
.upload-form, .single-upload {
  display: grid;
  gap: 12px;
  background: #f8fafc;
  border: 1px dashed #b8c6d8;
  border-radius: 18px;
  padding: 16px;
}
.upload-form.has-file,
.single-upload.has-file {
  border-color: #86efac;
  background: #f0fdf4;
}
.upload-form h3 { margin: 0; font-size: 16px; }
.upload-form input[type="file"],
.single-upload input[type="file"] {
  width: 100%;
  min-height: 46px;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  background: #fff;
  color: #334155;
  cursor: pointer;
}
.upload-form input[type="file"]::file-selector-button,
.single-upload input[type="file"]::file-selector-button {
  margin-right: 12px;
  padding: 8px 14px;
  border: 1px solid #94a3b8;
  border-radius: 10px;
  background: #fff;
  color: #0f172a;
  font-weight: 700;
  cursor: pointer;
}
.upload-form input[type="file"]:focus,
.single-upload input[type="file"]:focus {
  outline: none;
  border-color: #1f4e78;
  box-shadow: 0 0 0 3px rgba(31,78,120,0.12);
}
.meta-note {
  margin: 14px 0;
  color: #64748b;
  font-size: 13px;
}
.table-wrap {
  width: 100%;
  overflow: auto;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #fff;
}
table.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 840px;
}
table.data-table th, table.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #edf2f7;
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}
table.data-table th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  color: #334155;
  font-weight: 800;
}
table.data-table tr:nth-child(even) td { background: #fbfdff; }
table.data-table td.number { text-align: right; font-variant-numeric: tabular-nums; }
.details-block { margin-top: 16px; }
.details-block summary { cursor: pointer; font-weight: 700; color: #334155; margin-bottom: 10px; }
.top-gap { margin-top: 14px; }

.panel {
  margin: 18px 0;
  padding: 18px;
  background: rgba(255,255,255,0.93);
  border-radius: 20px;
  border: 1px solid rgba(31,78,120,0.08);
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.grid-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}
.grid-form button { align-self: end; }
.user-form { margin-bottom: 18px; }
.password-tip {
  margin: 12px 0 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.6;
}

.toast {
  margin: 16px 0;
  padding: 12px 14px;
  border-radius: 14px;
  font-weight: 700;
}
.toast.success { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.toast.error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }

.module-status {
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
}
.module-status.success {
  background: #dcfce7;
  border: 1px solid #bbf7d0;
  color: #166534;
}
.module-status.error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
}
.module-status.info {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
}
.overview-forecast-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.overview-forecast-card table {
  width: 100%;
  border-collapse: collapse;
}
.overview-forecast-card th,
.overview-forecast-card td {
  padding: 12px 10px;
  border-bottom: 1px solid #e2e8f0;
  text-align: center;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.overview-forecast-card th {
  background: #f8fafc;
  color: #475569;
  font-weight: 800;
}
.overview-forecast-card td:first-child,
.overview-forecast-card th:first-child {
  text-align: left;
}
.project-count {
  margin-bottom: 12px;
  font-size: 12px;
  color: #64748b;
}
.project-detail-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1300px;
}
.project-detail-table thead th {
  padding: 9px 10px;
  white-space: nowrap;
  font-weight: 800;
  font-size: 12px;
  border: 1px solid #cbd5e1;
}
.project-detail-table .th-group {
  text-align: center;
}
.project-detail-table .th-base {
  background: #f1f5f9;
  color: #475569;
}
.project-detail-table .th-invoice {
  background: #dbeafe;
  color: #1e40af;
}
.project-detail-table .th-payment {
  background: #d1fae5;
  color: #065f46;
}
.project-detail-table .th-forecast {
  background: #fef3c7;
  color: #92400e;
}
.project-detail-table td {
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  white-space: nowrap;
  font-size: 13px;
}
.project-detail-table tbody tr:hover {
  background: #f8fbff;
}
.project-detail-table td.number {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.status-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}
.status-tag.green {
  background: #d1fae5;
  color: #065f46;
}
.status-tag.blue {
  background: #dbeafe;
  color: #1e40af;
}
.status-tag.yellow {
  background: #fef3c7;
  color: #92400e;
}
.status-tag.red {
  background: #fee2e2;
  color: #991b1b;
}

@media (max-width: 980px) {
  .two-col { grid-template-columns: 1fr; }
  .topbar { flex-direction: column; align-items: stretch; }
  .topbar-right { justify-content: space-between; flex-wrap: wrap; }
  .workspace-toolbar { flex-direction: column; }
  .bot-entry { flex-basis: auto; width: 100%; justify-content: flex-start; }
  .bot-input-row { grid-template-columns: 1fr; }
}

.history-banner {
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  padding: 12px 20px;
  border-radius: 14px;
  margin-bottom: 16px;
  box-shadow: 0 6px 20px rgba(217, 119, 6, 0.3);
}
.history-banner-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.history-banner-icon { font-size: 22px; }
.history-banner b { font-weight: 800; }
#historyBannerText { flex: 1; font-weight: 700; font-size: 14px; line-height: 1.5; }
.history-row { cursor: pointer; transition: background 0.15s; }
.history-row:hover { background: #f0f7ff !important; }
.history-row td { padding: 12px 14px; }
.history-action-tag {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700;
  background: #dbeafe; color: #1e40af;
}
body.readonly-mode .upload-form button[type="submit"],
body.readonly-mode .upload-form input[type="file"],
body.readonly-mode #saveCycleBtn,
body.readonly-mode #userCreateForm,
body.readonly-mode input[data-cycle-index],
body.readonly-mode .user-toggle-btn,
body.readonly-mode .user-reset-btn {
  opacity: 0.4; pointer-events: none;
}

/* Anomaly banner for project detail + cycle unmatched */
.anom-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  background: linear-gradient(90deg, #fef2f2 0%, #fff5f5 100%);
  border: 1px solid #fecaca;
  border-radius: 14px;
  margin-bottom: 14px;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.08);
}
.anom-left {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  flex: 1;
  min-width: 0;
}
.anom-icon {
  font-size: 24px;
  line-height: 1;
  color: #dc2626;
  flex-shrink: 0;
}
.anom-title {
  font-weight: 700;
  color: #991b1b;
  font-size: 14px;
}
.anom-sub {
  margin-top: 6px;
  color: #7f1d1d;
  font-size: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.anom-chip {
  display: inline-block;
  padding: 2px 10px;
  background: #fff;
  border: 1px solid #fecaca;
  border-radius: 99px;
  font-size: 11px;
  color: #991b1b;
  font-weight: 600;
}
.anom-chip-more {
  background: #fecaca;
  color: #7f1d1d;
}
.cycle-missing {
  background: #fef2f2 !important;
}
.missing-tag {
  display: inline-block;
  padding: 2px 8px;
  background: #fee2e2;
  color: #991b1b;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
}
.project-count-text {
  margin-top: 4px;
  color: #64748b;
  font-size: 12px;
}
