:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --line: #dfe4ea;
  --line-strong: #c8d0da;
  --text: #1f2933;
  --muted: #667085;
  --brand: #1769e0;
  --brand-strong: #0f55ba;
  --good: #0f8f61;
  --warn: #a86900;
  --bad: #b42318;
  --blue-soft: #eef5ff;
  --green-soft: #eaf7f1;
  --yellow-soft: #fff7df;
  --red-soft: #fff0ee;
  font-family: "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
}

button,
input,
select {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.auth-page {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  place-items: center;
  min-height: 100%;
  background: linear-gradient(180deg, #f8fafc 0%, #eef3f8 100%);
}

.auth-shell {
  display: grid;
  grid-template-columns: minmax(320px, 440px) 380px;
  gap: 44px;
  align-items: center;
  width: min(960px, calc(100vw - 48px));
}

.auth-brand h1,
.topbar h1,
.section-head h2 {
  margin: 0;
  letter-spacing: 0;
}

.auth-brand h1 {
  font-size: 42px;
  line-height: 1.15;
}

.auth-brand p {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 18px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin-bottom: 22px;
  background: var(--brand);
  color: #fff;
  font-size: 28px;
  font-weight: 700;
  border-radius: 8px;
}

.auth-panel,
.submit-panel,
.task-section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.auth-panel {
  padding: 24px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 22px;
  padding: 4px;
  background: #eef2f6;
  border-radius: 8px;
}

.auth-tab {
  height: 38px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.auth-tab.is-active {
  background: #fff;
  color: var(--text);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}

.form-stack {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: #344054;
  font-size: 13px;
  font-weight: 600;
}

input,
select {
  width: 100%;
  height: 38px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--text);
  background: #fff;
  outline: none;
}

textarea {
  width: 100%;
  min-height: 92px;
  padding: 10px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--text);
  background: #fff;
  font: inherit;
  line-height: 1.45;
  resize: vertical;
  outline: none;
}

input[type="file"] {
  height: auto;
  padding: 8px 10px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(23, 105, 224, 0.12);
}

input.needs-choice,
select.needs-choice,
textarea.needs-choice {
  border-color: var(--bad);
  background: #fffafa;
}

input.needs-choice:focus,
select.needs-choice:focus,
textarea.needs-choice:focus {
  border-color: var(--bad);
  box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.12);
}

input.is-confirmed,
select.is-confirmed {
  border-color: #9fd7bd;
}

.field-hint {
  min-height: 15px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.35;
}

.field-hint.is-warning {
  color: var(--bad);
}

.report-file-hint {
  min-height: 0;
  color: var(--bad);
  font-weight: 500;
}

.inline-guide-button {
  display: inline;
  margin: 0 0 0 4px;
  padding: 0;
  border: 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  color: var(--bad);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.primary-button,
.ghost-button,
.danger-button,
.mini-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 16px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}

.primary-button {
  border: 1px solid var(--brand);
  background: var(--brand);
  color: #fff;
  font-weight: 700;
}

.primary-button:hover {
  background: var(--brand-strong);
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.ghost-button {
  border: 1px solid var(--line-strong);
  background: #fff;
  color: #344054;
}

.danger-button {
  border: 1px solid #fecaca;
  background: #fff;
  color: #b42318;
  font: inherit;
  font-weight: 800;
}

.danger-button:hover {
  border-color: #fca5a5;
  background: #fff1f2;
}

.danger-button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}
.mini-button {
  width: 100%;
  min-height: 30px;
  margin-top: 8px;
  border: 1px solid #b8c8dd;
  background: #fff;
  color: #17324d;
  font-size: 12px;
  font-weight: 700;
}

.form-message {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.form-message.is-error {
  color: var(--bad);
}

.form-message.is-ok {
  color: var(--good);
}

.app-page,
.report-page {
  min-width: 1100px;
  height: 100%;
  overflow: hidden;
}

.shell-page {
  min-width: 1188px;
}

.workspace-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 88px;
  padding: 14px 10px;
  background: #111827;
  color: #cbd5e1;
  box-shadow: 1px 0 0 rgba(255, 255, 255, 0.06);
}

.workspace-brand {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin: 2px auto 22px;
  border-radius: 8px;
  background: #1769e0;
  color: #fff;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 0;
}

.workspace-nav {
  display: grid;
  gap: 8px;
}

.workspace-nav-link {
  display: grid;
  justify-items: center;
  gap: 6px;
  min-height: 78px;
  padding: 10px 4px;
  border-radius: 8px;
  color: #b6c2d2;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
}

.workspace-nav-link:hover,
.workspace-nav-link.is-active {
  background: #374151;
  color: #fff;
}

.workspace-nav-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.12);
  color: inherit;
  font-size: 15px;
  font-weight: 900;
}

.workspace-main {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-width: 1100px;
  height: 100%;
  margin-left: 88px;
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

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

.report-topbar,
.tool-topbar {
  align-items: center;
}

.topbar-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
}

.breadcrumb-nav {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.35;
}

.breadcrumb-nav a {
  color: var(--muted);
  text-decoration: none;
}

.breadcrumb-nav a:hover {
  color: var(--brand);
}

.breadcrumb-nav span {
  color: #98a2b3;
  font-size: 24px;
  line-height: 1;
}

.breadcrumb-nav strong {
  color: #111827;
  font-weight: 800;
}

.eyebrow {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
}

.tool-layout {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 16px;
  height: calc(100vh - 104px);
  padding: 16px;
}

.submit-panel {
  height: 100%;
  padding: 18px;
  overflow: hidden;
}

.submit-panel .form-stack {
  gap: 11px;
  height: 100%;
  overflow-y: auto;
  padding-right: 4px;
  padding-bottom: 8px;
  scrollbar-width: thin;
}

.submit-panel .form-stack::-webkit-scrollbar {
  width: 8px;
}

.submit-panel .form-stack::-webkit-scrollbar-thumb {
  background: #c9d4e2;
  border-radius: 999px;
}

.submit-task-button,
#submit-task,
#voc-submit-task {
  width: 100%;
  min-height: 38px;
  height: 38px;
}

#task-message {
  min-height: 0;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.product-key-fields {
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
}

.product-key-fields input {
  min-width: 0;
}

.product-summary {
  min-height: 64px;
  max-height: 112px;
  overflow: auto;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.product-summary strong {
  display: block;
  margin-bottom: 3px;
  color: var(--text);
}

.usage-note {
  order: 30;
  padding: 10px 11px;
  border: 1px solid #d9e7f7;
  border-radius: 6px;
  background: #f3f8ff;
  color: #425466;
  font-size: 12px;
  line-height: 1.55;
}

.usage-note strong {
  display: block;
  margin-bottom: 4px;
  color: #17324d;
}

.usage-note p {
  margin: 4px 0 0;
}

.advanced-product-fields {
  border: 1px solid #d9e7f7;
  border-radius: 6px;
  background: #f8fbff;
  color: #425466;
  font-size: 12px;
  line-height: 1.55;
}

.advanced-product-fields summary {
  display: flex;
  align-items: center;
  min-height: 34px;
  padding: 0 11px;
  color: #17324d;
  font-weight: 800;
  cursor: pointer;
  list-style-position: inside;
}

.advanced-product-fields[open] summary {
  border-bottom: 1px solid #d9e7f7;
}

.advanced-product-fields {
  display: grid;
  gap: 10px;
}

.advanced-product-fields[open] {
  padding-bottom: 10px;
}

.advanced-product-fields label,
.advanced-product-fields .field-grid {
  margin: 0 10px;
}

.task-section {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  overflow: hidden;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--line);
}

.section-head h2 {
  font-size: 18px;
}

.task-list {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 14px;
  overflow-y: auto;
}

.task-card {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) 86px 88px 104px;
  gap: 12px;
  align-items: center;
  min-height: 86px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.task-card.is-supervisor-view {
  grid-template-columns: 150px minmax(0, 1fr) 86px 88px 136px 104px;
}

.task-card strong {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 4px;
  font-size: 14px;
}

.task-label {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  background: #eef5ff;
  color: var(--brand-strong);
  font-size: 11px;
  font-weight: 700;
}

.task-meta {
  color: var(--muted);
  font-size: 12px;
}

.task-owner {
  color: #17324d;
  font-weight: 600;
}

.task-product {
  display: grid;
  gap: 7px;
  min-width: 0;
  overflow: visible;
  color: #344054;
  font-size: 12px;
  line-height: 1.45;
}

.task-product-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.task-product-tags span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #f3f6fa;
  color: #475467;
  white-space: nowrap;
}

.task-product-tags b {
  color: #17324d;
  font-weight: 700;
}

.task-product-name {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #1f2933;
  font-weight: 600;
}

.status-pill,
.advice-tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.status-pending {
  background: var(--yellow-soft);
  color: var(--warn);
}

.status-running {
  background: var(--blue-soft);
  color: var(--brand-strong);
}

.status-done {
  background: var(--green-soft);
  color: var(--good);
}

.status-failed {
  background: var(--red-soft);
  color: var(--bad);
}

.status-cancelled {
  background: #f2f4f7;
  color: #667085;
}
.task-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.task-actions .ghost-button,
.task-actions .danger-button {
  width: 92px;
  justify-content: center;
  white-space: nowrap;
}

.task-notice {
  grid-column: 2 / -1;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.task-card.is-supervisor-view .task-notice {
  grid-column: 2 / -1;
}

.choice-field {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
}

.choice-field legend {
  padding: 0 4px;
  color: #344054;
  font-size: 13px;
  font-weight: 700;
}

.choice-field label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #344054;
  font-size: 13px;
  font-weight: 600;
}

.choice-field input {
  width: 16px;
  height: 16px;
}

.voc-layout {
  grid-template-columns: 330px minmax(0, 1fr);
}

.voc-submit-panel {
  padding: 18px;
}

.voc-submit-panel .form-stack {
  gap: 11px;
}

.voc-submit-panel textarea {
  min-height: 92px;
}

.voc-submit-panel .usage-note {
  order: initial;
}

.voc-task-card {
  grid-template-columns: 150px 88px minmax(360px, 820px) 82px 82px 136px 104px;
  justify-content: start;
}

.voc-task-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 88px;
  min-width: 0;
}

.voc-task-thumb-img {
  display: block;
  width: auto;
  max-width: 88px;
  height: 62px;
  object-fit: contain;
  border: 1px solid #e4eaf2;
  border-radius: 6px;
  background: #fff;
}

.voc-task-thumb-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 88px;
  height: 62px;
  border: 1px solid #e4eaf2;
  border-radius: 6px;
  background: #f3f6fa;
  color: #667085;
  font-size: 12px;
  font-weight: 800;
}

.voc-task-card .task-notice {
  grid-column: 3 / -1;
}

.voc-progress {
  width: 100%;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7edf4;
}

.voc-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--good));
}

.report-shell {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: calc(100vh - 104px);
  padding: 0 28px 18px;
}

.report-shell > .form-message:empty {
  display: none;
}

.report-summary {
  display: none;
  width: min(1680px, 100%);
  margin: 0 auto;
  padding: 12px 0 14px;
  border-bottom: 1px solid #dde1e7;
  background: transparent;
}

.report-summary.is-ready {
  display: block;
}

.report-summary-inner {
  width: 100%;
  margin: 0;
}

.report-version {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 12px;
}

.report-summary-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.report-summary-title-row h1 {
  margin: 0;
  color: #111827;
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: 0;
}

.guide-button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  background: #eff6ff;
  color: #174ea6;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.guide-button:hover {
  border-color: #93c5fd;
  background: #dbeafe;
}

.th-help {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  border: 1px solid #9fb7d8;
  border-radius: 999px;
  color: #2f6fce;
  background: #fff;
  font-size: 10px;
  font-weight: 800;
  cursor: help;
}

.weekly-hero-title-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.weekly-module-hero {
  padding: 22px 24px;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(120deg, #123a70, #2468d8);
}

.weekly-module-hero-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.weekly-module-hero h2 {
  margin: 0 0 8px;
  color: #fff;
  font-size: 24px;
  line-height: 1.25;
  letter-spacing: 0;
}

.weekly-module-hero-title-row p {
  margin: 0;
  color: rgba(255, 255, 255, .82);
  font-size: 13px;
}

.weekly-principle-brief-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, .24);
}

.weekly-principle-brief-row p {
  flex: 0 1 auto;
  min-width: 0;
  margin: 0 !important;
  color: rgba(255, 255, 255, .9) !important;
  font-size: 13px;
  line-height: 1.6;
}

.principle-link-button {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, .62);
  border-radius: 6px;
  background: rgba(255, 255, 255, .14);
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
}

.principle-link-button:hover {
  background: rgba(255, 255, 255, .22);
}

.principle-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(15, 23, 42, .48);
}

.principle-overlay.is-open {
  display: flex;
}

.principle-dialog {
  box-sizing: border-box;
  width: min(760px, 100%);
  max-height: min(82vh, 720px);
  overflow: auto;
  border: 1px solid #d9e1ea;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .24);
}

.principle-dialog-top {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 10px 12px;
  border-bottom: 1px solid #eef2f7;
  background: #fff;
}

.principle-close {
  width: 32px;
  height: 32px;
  border: 1px solid #d7dee8;
  border-radius: 6px;
  background: #f8fafc;
  color: #344054;
  font: inherit;
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
}

.principle-dialog-body {
  padding: 0 22px 22px;
}

.principle-modal-header {
  padding: 6px 0 14px;
}

.principle-modal-header h2 {
  margin: 0 0 8px;
  color: #172033;
  font-size: 22px;
}

.principle-modal-header p {
  margin: 0;
  color: #475467;
  font-size: 14px;
  line-height: 1.7;
}

.principle-modal-sections {
  display: grid;
  gap: 10px;
}

.principle-modal-section {
  padding: 12px 14px;
  border: 1px solid #d9e1ea;
  border-radius: 8px;
  background: #f8fafc;
}

.principle-modal-section strong {
  display: block;
  margin-bottom: 5px;
  color: #174ea6;
  font-size: 13px;
}

.principle-modal-section p {
  margin: 0;
  color: #344054;
  font-size: 13px;
  line-height: 1.7;
}

.weekly-kpi-grid article > span,
.weekly-insight-kpis article > span,
.weekly-chart-legend b {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 18px;
}

.weekly-kpi-grid article > span .th-help,
.weekly-insight-kpis article > span .th-help {
  display: inline-flex;
  flex: 0 0 15px;
  margin: 0;
  transform: none;
}

.weekly-detail-table th .th-help,
.weekly-anomaly-table th .th-help,
.weekly-hierarchy-table th .th-help {
  margin-left: 5px;
  transform: translateY(1px);
}

.weekly-filter-bar label,
.weekly-insight-filters label {
  position: relative;
}

.weekly-filter-bar label > .th-help,
.weekly-insight-filters label > .th-help {
  position: absolute;
  top: 0;
  right: 0;
}

@media (max-width: 720px) {
  .weekly-page .topbar-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .weekly-page .topbar-actions .ghost-button {
    min-height: 34px;
    padding: 0 9px;
    font-size: 12px;
  }
}

.report-summary-meta {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.report-frame {
  display: none;
  flex: 1 1 auto;
  width: 100%;
  margin: 0;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.report-frame.is-ready {
  display: block;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 36px;
  padding: 8px 16px;
  border-top: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 12px;
}

.site-footer a:hover {
  color: var(--brand-strong);
}

.report-guide-dialog {
  width: min(1320px, calc(100vw - 56px));
  max-height: calc(100vh - 56px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
}

.tool-guide-dialog {
  width: min(760px, calc(100vw - 56px));
  max-height: calc(100vh - 56px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 22px 70px rgba(15, 23, 42, 0.22);
}

.tool-guide-dialog::backdrop {
  background: rgba(15, 23, 42, 0.46);
}

.tool-guide-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 16px 20px 20px;
  overflow: auto;
}

.tool-guide-body section {
  min-width: 0;
  padding: 14px;
  border: 1px solid #dbe4ef;
  border-radius: 8px;
  background: #f8fbff;
}

.tool-guide-body h3 {
  margin: 0 0 8px;
  color: #17324d;
  font-size: 15px;
  line-height: 1.35;
}

.tool-guide-body p,
.tool-guide-body ol {
  margin: 0;
  color: #475467;
  font-size: 13px;
  line-height: 1.7;
}

.tool-guide-body ol {
  padding-left: 20px;
}

.tool-guide-body li + li {
  margin-top: 4px;
}

.report-guide-dialog::backdrop {
  background: rgba(15, 23, 42, 0.46);
}

.report-guide-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
}

.report-guide-head h2 {
  margin: 0;
  color: #111827;
  font-size: 20px;
  line-height: 1.3;
  letter-spacing: 0;
}

.dialog-close-button {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: #344054;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.report-guide-alert {
  margin: 0;
  padding: 14px 20px 0;
  color: var(--bad);
  font-size: 14px;
  font-weight: 800;
}

.report-guide-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 14px 20px 20px;
  overflow: auto;
}

.report-guide-grid figure {
  position: relative;
  min-width: 0;
  margin: 0;
}

.report-guide-grid figcaption {
  margin-bottom: 8px;
  color: #17324d;
  font-size: 14px;
  font-weight: 800;
}

.report-guide-grid img {
  display: block;
  width: 100%;
  max-height: 68vh;
  object-fit: contain;
  object-position: top left;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.image-zoom-button {
  position: absolute;
  top: 34px;
  left: 10px;
  z-index: 2;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.94);
  color: #174ea6;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
}

.image-zoom-button:hover {
  border-color: #93c5fd;
  background: #eff6ff;
}

.image-zoom-dialog {
  width: min(1680px, calc(100vw - 40px));
  max-height: calc(100vh - 40px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.26);
}

.image-zoom-dialog::backdrop {
  background: rgba(15, 23, 42, 0.58);
}

.image-zoom-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.image-zoom-head h2 {
  margin: 0;
  color: #111827;
  font-size: 18px;
  line-height: 1.35;
  letter-spacing: 0;
}

.image-zoom-body {
  max-height: calc(100vh - 112px);
  padding: 14px;
  overflow: hidden;
  background: #f6f7f9;
}

.image-zoom-body img {
  display: block;
  width: 100%;
  max-width: none;
  height: calc(100vh - 140px);
  margin: 0 auto;
  object-fit: contain;
  object-position: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

@media (max-width: 760px) {
  .auth-shell {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .auth-brand h1 {
    font-size: 32px;
  }

  .report-guide-grid {
    grid-template-columns: 1fr;
  }
}







/* Weekly report section */
.has-workspace-subnav .workspace-main {
  min-width: 920px;
  margin-left: 268px;
}

.workspace-subnav {
  position: fixed;
  inset: 0 auto 0 88px;
  z-index: 25;
  width: 180px;
  padding: 28px 16px;
  border-right: 1px solid var(--line);
  background: #fff;
  box-shadow: 1px 0 0 rgba(15, 23, 42, 0.03);
}

.workspace-subnav-title {
  margin-bottom: 18px;
  color: #98a2b3;
  font-size: 16px;
  font-weight: 800;
}

.workspace-subnav-link {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 6px;
  color: #1f2933;
  font-size: 15px;
  font-weight: 700;
}

.workspace-subnav-link:hover,
.workspace-subnav-link.is-active {
  background: #eef5ff;
  color: var(--brand-strong);
}

.weekly-page .topbar {
  flex: 0 0 auto;
}

.weekly-overview {
  display: grid;
  align-content: start;
  gap: 14px;
  height: calc(100vh - 104px);
  padding: 16px;
  overflow-y: auto;
}

.weekly-hero,
.weekly-filter-bar,
.weekly-kpi-grid article,
.weekly-spu-card,
.weekly-action-grid article,
.weekly-detail-placeholder section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.weekly-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
}

.weekly-hero h1,
.weekly-detail-placeholder h1 {
  margin: 0;
  color: #111827;
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: 0;
}

.weekly-hero p,
.weekly-detail-placeholder p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.weekly-sync-status {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--good);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.weekly-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 16px;
}

.weekly-filter-bar label {
  display: grid;
  gap: 6px;
  color: #344054;
  font-size: 12px;
  font-weight: 700;
}

.weekly-filter-bar select {
  min-width: 132px;
}

.weekly-filter-static {
  display: flex;
  align-items: center;
  min-width: 250px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid #cfd7e3;
  border-radius: 6px;
  background: #f8fafc;
  color: #344054;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.weekly-kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.weekly-kpi-grid article {
  min-width: 0;
  padding: 13px 14px;
  box-shadow: none;
}

.weekly-kpi-grid span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.weekly-kpi-grid strong {
  display: block;
  margin-top: 6px;
  color: var(--text);
  font-size: 22px;
  line-height: 1.15;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.weekly-kpi-grid em {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.35;
}

.is-good {
  color: var(--good) !important;
}

.is-bad {
  color: var(--bad) !important;
}

.is-warn {
  color: var(--warn) !important;
}

.weekly-spu-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.weekly-spu-card {
  min-width: 0;
  overflow: hidden;
  box-shadow: none;
}

.weekly-spu-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  min-height: 64px;
  padding: 12px 12px 10px;
  border-bottom: 1px solid var(--line);
}

.weekly-spu-head h2 {
  margin: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 15px;
  line-height: 1.35;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.weekly-spu-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
  white-space: nowrap;
}

.weekly-spu-head span {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.weekly-mini-list {
  display: grid;
  gap: 1px;
  margin: 0;
  padding: 8px;
  list-style: none;
  counter-reset: weekly-rank;
}

.weekly-mini-list li {
  counter-increment: weekly-rank;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  min-height: 32px;
  padding: 5px 6px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 12px;
}

.weekly-mini-list li:nth-child(odd) {
  background: #f8fafc;
}

.weekly-mini-list li::before {
  content: counter(weekly-rank);
  color: var(--muted);
  font-weight: 800;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.weekly-mini-list b {
  overflow: hidden;
  color: var(--text);
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.weekly-mini-list span {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.weekly-action-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.weekly-action-grid article {
  padding: 14px;
  box-shadow: none;
}

.weekly-action-grid article > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.weekly-action-grid h2 {
  margin: 0;
  font-size: 15px;
  line-height: 1.35;
  font-weight: 800;
}

.weekly-action-grid p {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.weekly-action-grid b {
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.is-good-bg {
  background: var(--green-soft);
  color: var(--good);
}

.is-warn-bg {
  background: var(--yellow-soft);
  color: var(--warn);
}

.is-bad-bg {
  background: var(--red-soft);
  color: var(--bad);
}

.weekly-detail-placeholder {
  display: grid;
  align-items: start;
  height: calc(100vh - 104px);
  padding: 16px;
  overflow: auto;
}

.weekly-detail-placeholder section {
  padding: 22px;
}

@media (max-width: 1440px) {
  .weekly-kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .weekly-spu-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.weekly-overview-detailed {
  display: grid;
  gap: 18px;
  padding: 16px;
}

.weekly-overview-detailed .weekly-hero {
  margin: 0;
}

.weekly-detail-section {
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.06);
}

.weekly-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
}

.weekly-detail-head h2 {
  margin: 0;
  color: var(--text);
  font-size: 20px;
  line-height: 1.25;
  font-weight: 900;
}

.weekly-detail-head p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.weekly-criteria-label {
  margin-left: 8px;
  color: #174ea6;
  font-weight: 900;
}

.weekly-detail-head > span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  white-space: nowrap;
}

.weekly-detail-head > .weekly-anomaly-period {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--good);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.weekly-detail-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 12px;
}

.weekly-detail-table th,
.weekly-detail-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  line-height: 1.35;
  overflow-wrap: anywhere;
  vertical-align: middle;
}

.weekly-detail-table th {
  background: #f8fafc;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-align: left;
}

.weekly-detail-table tbody tr:nth-child(even) {
  background: #fbfdff;
}

.weekly-detail-table tbody tr:last-child td {
  border-bottom: 0;
}

.weekly-detail-table td:first-child,
.weekly-detail-table th:first-child {
  width: 9%;
  padding-left: 18px;
  font-weight: 900;
}

.weekly-detail-table td:nth-child(2),
.weekly-detail-table th:nth-child(2) {
  width: 8%;
}

.weekly-detail-table td:nth-child(3),
.weekly-detail-table th:nth-child(3),
.weekly-detail-table td:nth-child(6),
.weekly-detail-table th:nth-child(6) {
  width: 10%;
}

.weekly-detail-table td:nth-child(4),
.weekly-detail-table th:nth-child(4),
.weekly-detail-table td:nth-child(5),
.weekly-detail-table th:nth-child(5),
.weekly-detail-table td:nth-child(7),
.weekly-detail-table th:nth-child(7),
.weekly-detail-table td:nth-child(8),
.weekly-detail-table th:nth-child(8),
.weekly-detail-table td:nth-child(9),
.weekly-detail-table th:nth-child(9) {
  width: 7%;
}

.weekly-detail-table td:last-child,
.weekly-detail-table th:last-child {
  width: 15%;
  padding-right: 18px;
}

.weekly-detail-table .num,
.weekly-detail-table td:nth-child(n+3):nth-child(-n+9) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.weekly-detail-table .is-good {
  color: var(--good);
  font-weight: 800;
}

.weekly-detail-table .is-bad {
  color: var(--bad);
  font-weight: 800;
}

.weekly-stock-table td:first-child,
.weekly-stock-table th:first-child {
  width: 8%;
}

.weekly-stock-table td:nth-child(3),
.weekly-stock-table th:nth-child(3),
.weekly-stock-table td:nth-child(4),
.weekly-stock-table th:nth-child(4),
.weekly-stock-table td:nth-child(5),
.weekly-stock-table th:nth-child(5),
.weekly-stock-table td:nth-child(6),
.weekly-stock-table th:nth-child(6),
.weekly-stock-table td:nth-child(7),
.weekly-stock-table th:nth-child(7),
.weekly-stock-table td:nth-child(8),
.weekly-stock-table th:nth-child(8),
.weekly-stock-table td:nth-child(9),
.weekly-stock-table th:nth-child(9) {
  width: 8%;
}

.weekly-stock-table td:last-child,
.weekly-stock-table th:last-child {
  width: 20%;
}

/* Weekly table render fix */
.weekly-overview.weekly-overview-detailed {
  align-content: start;
  overflow-y: auto;
}

.weekly-detail-section {
  overflow: visible;
}

.weekly-detail-table {
  display: table !important;
  visibility: visible !important;
}

.weekly-detail-table thead {
  display: table-header-group !important;
}

.weekly-detail-table tbody {
  display: table-row-group !important;
}

.weekly-detail-table tr {
  display: table-row !important;
  visibility: visible !important;
}

.weekly-detail-table th,
.weekly-detail-table td {
  display: table-cell !important;
  visibility: visible !important;
}

/* Weekly sticky filters */
.weekly-filter-sticky {
  position: sticky;
  top: 0;
  z-index: 12;
  align-items: end;
  margin-top: -4px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(10px);
}

.weekly-filter-sticky label {
  min-width: 156px;
}

.weekly-filter-sticky label:first-child {
  min-width: 270px;
}

.weekly-filter-sticky select {
  width: 100%;
}

/* Weekly slim filters */
.weekly-filter-sticky {
  gap: 12px;
}

.weekly-filter-sticky label {
  flex: 0 1 220px;
}

.weekly-filter-sticky label:first-child {
  flex-basis: 360px;
}

.weekly-filter-sticky label:last-child {
  flex-basis: 320px;
}

/* Weekly site filter cells */
.weekly-site-cell {
  color: #334155;
  font-weight: 800;
}

/* Weekly centered table columns */
.weekly-detail-table th,
.weekly-detail-table td,
.weekly-detail-table .num,
.weekly-detail-table td:nth-child(n+3):nth-child(-n+9) {
  text-align: center !important;
}

.weekly-detail-table td:first-child,
.weekly-detail-table th:first-child,
.weekly-detail-table td:last-child,
.weekly-detail-table th:last-child {
  text-align: center !important;
}
