:root {
  color-scheme: light;
  --color-primary: #1458a8;
  --color-primary-hover: #0f4a8f;
  --color-primary-deep: #0b2f63;
  --color-background: #f5f7fa;
  --color-background-soft: #eef3f8;
  --color-card: #ffffff;
  --color-card-muted: #f8fafc;
  --color-page-bg: #f4f7fb;
  --color-surface: #ffffff;
  --color-surface-muted: #f8fafc;
  --border-soft: #e5ebf3;
  --border-subtle: #eef2f7;
  --shadow-card: 0 8px 24px rgba(15, 23, 42, 0.045);
  --shadow-panel: 0 1px 2px rgba(15, 23, 42, 0.045);
  --color-border: #d9e2ec;
  --color-border-strong: #b8c7d9;
  --color-text-primary: #172033;
  --color-text-secondary: #66758a;
  --color-success: #15805f;
  --color-warning: #b96c00;
  --color-danger: #c43d3d;
  --color-info: #2563b8;
  --color-draft: #697386;
  --color-disabled: #98a2b3;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 10px;
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow-sm: 0 8px 20px rgba(15, 35, 70, 0.07);
  --shadow-md: 0 18px 44px rgba(15, 35, 70, 0.11);
  --table-row-height: 44px;
  --form-control-height: 36px;
  --button-height: 36px;
  --bg: #f4f7fb;
  --bg-soft: #edf4fb;
  --panel: #ffffff;
  --panel-soft: #f8fbff;
  --line: #d7e2ee;
  --line-strong: #b9c9dc;
  --text: #172236;
  --muted: #65758a;
  --muted-soft: #94a3b8;
  --brand: var(--color-primary);
  --brand-hover: var(--color-primary-hover);
  --brand-deep: var(--color-primary-deep);
  --brand-soft: #eaf3ff;
  --brand-tint: #f4f8ff;
  --portal: #1d6fd6;
  --portal-deep: #0b3a78;
  --accent: #0f9f9a;
  --success: var(--color-success);
  --warning: var(--color-warning);
  --danger: var(--color-danger);
  --neutral: #667085;
  --focus: 0 0 0 3px rgba(11, 99, 206, 0.18);
  --shadow: var(--shadow-md);
  --shadow-soft: var(--shadow-sm);
  --radius: var(--radius-md);
  --radius-sm: 6px;
  font-family:
    "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

html {
  background: var(--bg);
}

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

button,
input,
select,
textarea {
  min-width: 0;
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 0;
  box-shadow: var(--focus);
  border-color: var(--brand);
}

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(560px, 1fr) minmax(420px, 520px);
  background: var(--panel);
}

.login-visual {
  padding: 64px;
  background:
    linear-gradient(135deg, rgba(8, 47, 105, 0.98), rgba(11, 99, 206, 0.92)),
    linear-gradient(90deg, rgba(255, 255, 255, 0.1) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: auto, 96px 96px, 96px 96px;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
}

.login-visual h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1.25;
  letter-spacing: 0;
}

.login-visual p {
  max-width: 680px;
  margin: 18px 0 0;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.8;
}

.login-brand-lockup {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 34px;
}

.brand-unit {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 10px 14px 10px 10px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 28px rgba(8, 34, 72, 0.18);
}

.brand-emblem {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  background: #fff;
}

.brand-emblem img {
  display: block;
  max-width: none;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.group-emblem img {
  width: 68px;
  height: 68px;
  transform: translateY(-2px);
}

.xingyun-emblem img {
  width: 92px;
  height: 92px;
  object-fit: cover;
  object-position: 50% 7%;
  transform: scale(1.1);
}

.brand-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
  color: var(--brand-deep);
  line-height: 1.2;
}

.brand-copy strong {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0;
  white-space: nowrap;
}

.brand-copy small {
  color: #42638c;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  white-space: nowrap;
}

.brand-divider {
  width: 1px;
  height: 42px;
  background: rgba(255, 255, 255, 0.45);
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  color: inherit;
  line-height: 1.15;
}

.brand-lockup__mark {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex: 0 0 auto;
  background: #fff;
}

.brand-lockup__mark img {
  display: block;
  max-width: none;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-lockup__primary,
.brand-lockup__group strong,
.brand-lockup__group small,
.brand-lockup__endorsement {
  white-space: nowrap;
}

.brand-lockup--header {
  align-self: center;
  min-height: 40px;
  max-width: 100%;
  gap: 10px;
  margin-top: clamp(-64px, -5vh, -28px);
  margin-bottom: clamp(64px, 8vh, 88px);
  color: var(--text);
}

.brand-lockup--header .brand-lockup__mark {
  width: 38px;
  height: 38px;
  border-radius: 8px;
}

.brand-lockup--header .brand-lockup__primary {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.brand-lockup__wordmark,
.brand-lockup__primary--wordmark img {
  display: block;
  width: 102px;
  height: auto;
}

.brand-lockup__divider {
  width: 1px;
  height: 28px;
  margin: 0 1px;
  background: rgba(20, 88, 168, 0.18);
}

.brand-lockup__group {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.brand-lockup__group strong {
  color: rgba(11, 47, 99, 0.72);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
}

.brand-lockup__group small {
  color: rgba(102, 117, 138, 0.78);
  font-size: 11px;
  font-weight: 500;
}

.boundary-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.boundary-list span {
  min-height: 76px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: var(--radius-sm);
  padding: 14px;
  background: rgba(255, 255, 255, 0.08);
  line-height: 1.55;
}

.login-card {
  padding: clamp(36px, 7vh, 72px) clamp(28px, 3.5vw, 52px);
  background: var(--panel);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  box-shadow: var(--shadow);
}

.login-card > :not(.brand-lockup--header) {
  width: min(100%, 400px);
  margin-left: auto;
  margin-right: auto;
}

.login-card h2 {
  margin: 0 0 10px;
  font-size: 26px;
  letter-spacing: 0;
}

.login-card p {
  margin: 0 0 24px;
  color: var(--muted);
}

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

.form-grid .full-span {
  grid-column: 1 / -1;
}

.demo-account-panel {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.demo-account-panel > span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}

.demo-account-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.form-field {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  height: var(--form-control-height);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0 11px;
  background: #fff;
  color: var(--text);
}

textarea {
  min-height: 96px;
  padding: 10px 11px;
  resize: vertical;
}

.primary-btn,
.secondary-btn,
.text-btn,
.tab-btn {
  min-width: 0;
  height: var(--button-height);
  border-radius: var(--radius-sm);
  padding: 0 14px;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  text-decoration: none;
  transition:
    background-color 0.12s ease,
    border-color 0.12s ease,
    color 0.12s ease,
    box-shadow 0.12s ease;
}

.primary-btn.compact,
.secondary-btn.compact {
  height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.primary-btn {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 1px 0 rgba(9, 41, 88, 0.08);
}

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

.secondary-btn {
  background: #fff;
  color: var(--brand-deep);
  border-color: var(--line-strong);
}

.secondary-btn:hover {
  background: var(--brand-soft);
  border-color: #8fb5e5;
}

.secondary-btn.danger-light {
  color: var(--danger);
  border-color: #efc2c2;
  background: #fff7f7;
}

.secondary-btn.danger-light:hover {
  color: var(--danger);
  border-color: var(--danger);
  background: #fff0f0;
}

.text-btn {
  height: 32px;
  background: transparent;
  color: var(--brand);
  padding: 0 8px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: 56px minmax(0, 1fr);
  background: var(--color-background);
}

.portal-shell {
  grid-template-rows: 56px minmax(0, 1fr);
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-width: 0;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow-xs);
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.app-brand strong,
.app-brand span {
  display: block;
}

.app-brand strong {
  color: var(--text);
  font-size: 15px;
  line-height: 1.25;
}

.app-brand span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.app-userbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
}

.app-userbar > span,
.app-userbar > strong {
  white-space: nowrap;
}

.app-userbar strong {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--brand-deep);
  font-size: 12px;
}

.app-body {
  min-width: 0;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 0;
}

.portal-shell .app-body {
  grid-template-columns: minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  overflow-y: auto;
  background: #0b2f63;
  color: #dfeaf1;
  padding: 18px 14px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.portal-shell .sidebar {
  display: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 0 4px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  background: #2f8cff;
  color: #fff;
  font-weight: 800;
  box-shadow: inset 0 -10px 18px rgba(10, 47, 102, 0.18);
}

.portal-shell .brand-mark {
  background: var(--portal);
}

.brand strong,
.brand span {
  display: block;
}

.brand span {
  margin-top: 3px;
  color: #a9bdc9;
  font-size: 12px;
}

.nav-menu {
  display: grid;
  gap: 16px;
}

.portal-shell .brand {
  min-height: 44px;
  padding: 0;
  border-bottom: 0;
}

.portal-shell .brand span {
  color: var(--muted);
}

.portal-shell .nav-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.portal-shell .nav-menu {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: thin;
}

.portal-shell .nav-group .nav-title {
  display: none;
}

.portal-shell .sidebar > .nav-group {
  min-width: 0;
}

.nav-group {
  display: grid;
  gap: 6px;
}

.nav-title {
  margin: 12px 0 6px;
  padding: 0 12px;
  color: #bcd4f2;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0;
}

.portal-shell .nav-title {
  color: var(--muted);
}

.nav-title-link {
  width: 100%;
  min-height: 38px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.nav-title-link:hover,
.nav-title-link.active {
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.nav-item {
  width: 100%;
  min-height: 38px;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 0 10px 0 18px;
  background: transparent;
  color: #d6e6f7;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  line-height: 1.35;
  position: relative;
}

.portal-shell .nav-item {
  width: auto;
  min-height: 34px;
  padding: 0 12px;
  color: var(--muted);
  border: 1px solid transparent;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(255, 255, 255, 0.13);
  color: #fff;
  font-weight: 600;
}

.portal-shell .nav-item:hover,
.portal-shell .nav-item.active {
  border-color: #bdd5f4;
  background: var(--brand-soft);
  color: var(--portal-deep);
  font-weight: 700;
}

.nav-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 99px;
  background: #64b5ff;
}

.portal-shell .nav-item.active::before {
  display: none;
}

.nav-item.disabled {
  color: #8299a9;
  cursor: default;
}

.workspace {
  min-width: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 24px;
}

.portal-shell .workspace {
  min-height: calc(100vh - 56px);
}

.topbar {
  min-height: 78px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
}

.portal-shell .topbar {
  min-height: 82px;
  border-bottom-color: #dce7f4;
  background: #f8fbff;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  min-width: 0;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.page-header-main {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.page-header-main > p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  max-width: 920px;
}

.page-header h1 {
  margin: 0;
  color: var(--text);
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: 0;
}

.page-header-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 18px;
}

.page-header-meta:empty {
  display: none;
}

.page-header-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  color: var(--muted);
  font-size: 12px;
}

.content {
  width: 100%;
  max-width: none;
  padding: 0;
}

.topbar {
  display: none;
}

.operator {
  flex: 0 0 auto;
  text-align: right;
  font-size: 13px;
  color: var(--muted);
}

.operator strong {
  display: block;
  margin-top: 3px;
  color: var(--text);
}

/*
 * Legacy shell selectors below are intentionally left for older markup paths,
 * but the active internal shell uses app-topbar/app-sidebar/app-main.
 */

.legacy-page-header {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}

.breadcrumbs span + span::before {
  content: "/";
  margin-right: 6px;
  color: var(--muted-soft);
}

.page-heading-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.page-heading-row h1 {
  min-width: 0;
}

.page-header-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  color: var(--muted);
  font-size: 12px;
}

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

.operator-card {
  display: grid;
  justify-items: end;
  gap: 5px;
  min-width: 220px;
}

.operator-channel {
  max-width: 360px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-title {
  min-width: 0;
}

.topbar h1 {
  margin: 0;
  font-size: 21px;
  line-height: 1.3;
  letter-spacing: 0;
}

.topbar p {
  max-width: 920px;
  margin: 5px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.operator {
  flex: 0 0 auto;
  text-align: right;
  font-size: 13px;
  color: var(--muted);
}

.operator strong {
  display: block;
  margin-top: 3px;
  color: var(--text);
}

.content {
  width: 100%;
  max-width: none;
  padding: 0;
}

.grid {
  display: grid;
  gap: 16px;
}

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

.grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 16px;
}

.daily-metrics,
.lookup-metrics,
.daily-progress {
  margin-bottom: 16px;
}

.daily-business-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

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

.daily-import-status {
  display: grid;
  grid-template-columns: minmax(260px, 1.2fr) minmax(220px, 0.8fr) minmax(260px, 1fr) minmax(260px, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

.daily-auto-scan-form {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(320px, 1.4fr) 140px minmax(300px, 1fr) auto;
  gap: 12px;
  align-items: end;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.daily-progress {
  overflow-x: auto;
}

.daily-reports-page {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.daily-report-filter-card,
.daily-report-workbench {
  min-width: 0;
}

.daily-report-filter-card {
  padding: 14px 16px;
}

.daily-report-filter-card .toolbar {
  margin-bottom: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.daily-report-filter-card .quick-toolbar {
  justify-content: flex-start;
  align-items: end;
}

.daily-report-filter-card .quick-toolbar .inline-field {
  flex: 0 0 auto;
}

.daily-report-filter-card .quick-toolbar .date-input {
  width: 180px;
}

.daily-report-filter-card .quick-toolbar .channel-select {
  flex: 0 1 260px;
  min-width: 220px;
}

.daily-report-filter-card .quick-toolbar .search-input {
  flex: 1 1 320px;
  min-width: 260px;
  max-width: 440px;
}

.daily-report-workbench {
  align-content: start;
}

.daily-report-workbench .tabbar {
  justify-content: flex-start;
  margin: 0 0 14px;
}

.daily-report-workbench .daily-metrics,
.daily-report-workbench .daily-business-metrics {
  margin-bottom: 14px;
}

.daily-report-workbench > .empty {
  min-height: 144px;
}

.portal-daily-page {
  min-width: 0;
}

.portal-daily-filter-card {
  gap: 12px;
}

.portal-supplement-upload {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

.portal-supplement-upload .inline-field {
  flex: 0 1 360px;
}

.portal-file-upload-field {
  flex: 0 1 360px;
}

.file-picker-box {
  position: relative;
  min-width: 260px;
  height: var(--form-control-height);
  display: flex;
  align-items: center;
  overflow: hidden;
  border: 1px solid #dbe5f0;
  border-radius: var(--radius-sm);
  background: #fff;
}

.file-picker-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.file-picker-placeholder {
  display: block;
  min-width: 0;
  padding: 0 11px;
  color: var(--muted-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
}

.portal-supplement-upload .muted {
  flex: 1 1 360px;
  min-width: 260px;
  line-height: 1.6;
}

.portal-supplement-upload .supplement-match-hint {
  align-self: center;
  font-size: 12px;
  line-height: 1.45;
}

.supplement-rule-note {
  margin: -4px 0 14px;
  font-size: 12px;
  line-height: 1.5;
}

.portal-daily-workbench {
  align-content: start;
}

.card {
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-xs);
}

.card h2,
.card h3 {
  margin: 0 0 12px;
  font-size: 16px;
  letter-spacing: 0;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.section-head h2 {
  margin-bottom: 6px;
}

.section-head p {
  margin: 0;
  line-height: 1.6;
}

.section-head.compact {
  margin-bottom: 12px;
}

.section-head.compact h3 {
  margin-bottom: 4px;
}

.stacked-sections {
  display: grid;
  gap: 16px;
}

.stacked-sections > .subpanel {
  background: #fff;
  border-color: #d2dde5;
}

.stacked-sections .section-head {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.subpanel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--panel);
  box-shadow: var(--shadow-xs);
}

.subpanel h3 {
  margin: 0 0 12px;
  font-size: 16px;
}

.metric {
  display: grid;
  gap: 6px;
  min-height: 76px;
  border-top: 2px solid #cfe2ff;
  padding-block: 14px;
}

.metric span {
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  font-size: 23px;
  line-height: 1.1;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

.placeholder-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.placeholder-list li {
  min-height: 38px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--muted);
  background: var(--panel-soft);
  line-height: 1.55;
}

.portal-home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.portal-home-column {
  display: grid;
  gap: 16px;
  align-content: start;
}

.portal-compact-card {
  display: grid;
  gap: 12px;
}

.compact-channel-list li {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.portal-quick-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.portal-quick-actions .primary-btn,
.portal-quick-actions .secondary-btn {
  flex: 1 1 120px;
}

.portal-action-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.portal-action-grid .primary-btn,
.portal-action-grid .secondary-btn {
  width: 100%;
}

.portal-download-hub-card {
  grid-column: span 1;
}

.portal-download-hub {
  display: grid;
  grid-template-columns: minmax(240px, 0.42fr) minmax(360px, 0.58fr);
  gap: 18px;
  align-items: start;
}

.portal-download-hub .muted {
  margin: 0 0 12px;
}

.portal-download-hub-summary .compact-list {
  gap: 8px;
}

.portal-download-hub-summary .compact-list-item {
  min-height: 42px;
  padding-block: 8px;
}

.portal-download-hub .portal-action-grid {
  grid-template-columns: 1fr;
}

.portal-download-hub .portal-action-grid .primary-btn,
.portal-download-hub .portal-action-grid .secondary-btn {
  justify-content: flex-start;
  min-width: 0;
}

.module-progress-page {
  display: grid;
  gap: 16px;
}

.module-hero {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.module-hero h2 {
  margin: 4px 0 8px;
  font-size: 25px;
  letter-spacing: 0;
}

.dashboard-role-hero {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin-bottom: 16px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.dashboard-role-hero h2 {
  margin: 4px 0 8px;
  font-size: 25px;
  letter-spacing: 0;
}

.dashboard-role-hero .row-actions {
  justify-content: flex-end;
}

.dashboard-card-grid {
  align-items: stretch;
}

.dashboard-card-grid > .card {
  min-height: 190px;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.dashboard-card-grid-large > .card {
  min-height: 260px;
}

.dashboard-card-grid .compact-list,
.dashboard-card-grid .stacked-actions,
.dashboard-card-grid .admin-snapshot-grid {
  flex: 0 0 auto;
  align-content: start;
}

.admin-snapshot-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.admin-snapshot-item {
  min-height: 66px;
  display: grid;
  gap: 8px;
  align-content: center;
  padding: 13px 14px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #fff, #fbfdff);
  box-shadow: var(--shadow-panel);
}

.admin-snapshot-item span {
  color: var(--muted);
  font-size: 13px;
}

.admin-snapshot-item strong {
  color: var(--brand-deep);
  font-size: 24px;
  line-height: 1;
  white-space: nowrap;
}

.eyebrow {
  margin: 0;
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
}

.module-progress-meter {
  min-width: 170px;
  min-height: 94px;
  display: grid;
  place-items: center;
  gap: 4px;
  border: 1px solid #b9d5f8;
  border-radius: var(--radius);
  background: var(--brand-soft);
  color: var(--brand-deep);
  text-align: center;
}

.module-progress-meter strong {
  font-size: 34px;
  line-height: 1;
  letter-spacing: 0;
}

.module-progress-meter span {
  color: var(--muted);
  font-size: 13px;
}

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

.module-kpi {
  min-height: 84px;
  padding: 16px;
  border: 1px solid #b8dfcb;
  border-radius: var(--radius);
  background: #ecfdf5;
  color: var(--success);
}

.module-kpi.warn {
  border-color: #f0cc8b;
  background: #fff7e8;
  color: var(--warning);
}

.module-kpi.neutral {
  border-color: #c8d7ea;
  background: #f1f6fc;
  color: var(--neutral);
}

.module-kpi.danger {
  border-color: #efb5b2;
  background: #fff1f0;
  color: var(--danger);
}

.module-kpi span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.module-kpi strong {
  display: block;
  margin-top: 8px;
  font-size: 30px;
  line-height: 1;
  letter-spacing: 0;
}

.module-layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.module-phase-rail {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 8px;
}

.module-phase-rail a {
  display: grid;
  gap: 3px;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--text);
  text-decoration: none;
}

.module-phase-rail a:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.module-phase-rail strong {
  font-size: 14px;
}

.module-phase-rail span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.module-board {
  display: grid;
  gap: 16px;
}

.module-phase {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
  scroll-margin-top: 20px;
}

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

.module-card {
  min-height: 132px;
  padding: 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--success);
  border-radius: var(--radius);
  background: #fff;
}

.module-card.active {
  border-left-color: var(--warning);
}

.module-card.review {
  border-left-color: var(--neutral);
}

.module-card.pending {
  border-left-color: var(--danger);
}

.module-card-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.module-card h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.35;
  letter-spacing: 0;
}

.module-card p {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.toolbar {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding: var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--color-card);
  box-shadow: var(--shadow-xs);
}

.filter-bar,
.toolbar {
  container-type: inline-size;
}

.toolbar label {
  min-width: 178px;
  flex: 1 1 178px;
}

.toolbar button {
  flex: 0 0 auto;
  align-self: end;
}

.toolbar .full-row {
  flex: 1 1 100%;
  display: flex;
  align-items: center;
  gap: 10px;
}

.channel-policy-form .row-actions {
  flex: 1 1 100%;
}

.channel-template-panel {
  display: grid;
  align-items: stretch;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
}

.toolbar .channel-template-panel {
  display: grid;
  align-items: stretch;
}

.template-subsection {
  display: grid;
  gap: 10px;
}

.field-toggle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 8px;
}

.field-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-soft);
}

.field-toggle input {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
}

.quick-toolbar {
  align-items: center;
  gap: 12px;
  padding: 12px;
}

.quick-toolbar .inline-field {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  min-width: 0;
  color: var(--text);
  font-size: 14px;
}

.quick-toolbar .inline-field span {
  color: var(--muted);
  white-space: nowrap;
}

.quick-toolbar .date-input {
  width: 190px;
}

.quick-toolbar .channel-select {
  flex: 0 1 320px;
  min-width: 220px;
}

.quick-toolbar .search-input {
  flex: 1 1 360px;
  min-width: 240px;
}

.table-wrap,
.wide-table {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  max-height: calc(100vh - 360px);
  overflow-x: auto;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: none;
}

table {
  width: 100%;
  min-width: 880px;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--panel);
}

.wide-table table {
  width: max-content;
  min-width: 100%;
  border: 0;
}

th,
td {
  height: var(--table-row-height);
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  line-height: 1.45;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #344054;
  background: #f1f5f9;
  font-weight: 700;
  white-space: nowrap;
}

tbody tr:hover td {
  background: #f8fbff;
}

tbody tr:last-child td {
  border-bottom: 0;
}

td {
  color: var(--text);
}

th.numeric-col,
td.numeric-cell {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

td.numeric-cell {
  color: #12335f;
  font-weight: 600;
}

td:nth-child(n + 6):not(:last-child),
.wide-table td:nth-child(n + 2) {
  font-variant-numeric: tabular-nums;
}

table th:first-child.numeric-col,
table td:first-child.numeric-cell {
  text-align: right;
}

.wide-table th,
.wide-table td {
  min-width: 118px;
  white-space: nowrap;
}

.policy-month-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.policy-detail-block {
  display: grid;
  gap: 14px;
}

.channel-policy-template-view {
  margin-top: 16px;
}

.policy-matrix {
  max-height: none;
  width: 100%;
  border-color: #c9d6df;
}

.policy-matrix table {
  width: 100%;
  min-width: 100%;
  table-layout: fixed;
}

.policy-matrix th {
  text-align: center;
  vertical-align: middle;
  white-space: normal;
  line-height: 1.35;
  padding: 12px 10px;
  border-right: 1px solid #d8e5f4;
  border-bottom: 1px solid #c6d8ee;
  background: #eef6ff;
  color: #294b75;
}

.policy-matrix td {
  border-right: 1px solid #e0e7ed;
  border-bottom: 1px solid #d9e3ea;
  background: #fff;
}

.policy-matrix th:last-child,
.policy-matrix td:last-child {
  border-right: 0;
}

.policy-matrix tbody tr:nth-child(even) td {
  background: #f8fbff;
}

.policy-matrix tbody tr:hover td {
  background: #f1f7ff;
}

.policy-matrix thead tr:first-child th {
  background: #e2f0ff;
  font-weight: 800;
}

.policy-matrix tbody td:first-child,
.policy-matrix tbody td:nth-child(2) {
  font-weight: 700;
  color: #203142;
}

.july-policy-matrix table {
  min-width: 1320px;
}

.july-policy-matrix th,
.july-policy-matrix td {
  min-width: 0;
  white-space: normal;
  word-break: break-word;
  line-height: 1.45;
  padding: 10px 10px;
}

.july-policy-matrix td {
  text-align: center;
  vertical-align: middle;
}

.july-policy-matrix td:nth-child(3) {
  text-align: center;
}

.july-policy-matrix td:nth-child(1),
.july-policy-matrix td:nth-child(2),
.july-policy-matrix td:nth-child(10) {
  text-align: left;
}

.july-policy-matrix td:nth-child(10) {
  min-width: 210px;
  color: #34495a;
}

.channel-policy-input-matrix .matrix-toggle-col {
  width: 58px;
}

.channel-policy-input-matrix table {
  min-width: 1568px;
  transform: translateZ(0);
}

.matrix-header-toggle,
.matrix-row-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  width: 100%;
  font-weight: 700;
}

.matrix-header-toggle {
  flex-direction: column;
}

.matrix-header-toggle input,
.matrix-row-toggle input {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
}

.matrix-row-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  cursor: pointer;
}

.matrix-row-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.matrix-row-toggle::before {
  content: "";
  display: block;
  width: 18px;
  height: 18px;
  border: 2px solid #6f8496;
  border-radius: 4px;
  background-color: #fff;
  box-shadow: 0 1px 2px rgba(29, 39, 51, 0.12);
}

.matrix-row-toggle:has(input:checked)::before {
  border-color: #0b74de;
  background-color: #0b74de;
  background-image: url("data:image/svg+xml,%3Csvg width='14' height='14' viewBox='0 0 14 14' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 7.2 5.7 10 11 4' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 14px 14px;
}

.matrix-checkmark {
  display: none;
}

.row-visibility-select {
  width: 54px;
  height: 30px;
  padding: 0 4px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--text);
  font-size: 12px;
  text-align: center;
}

.policy-matrix td {
  text-align: center;
  vertical-align: middle;
  padding: 9px 8px;
}

.policy-matrix th:first-child,
.policy-matrix th:nth-child(2),
.policy-matrix td:first-child,
.policy-matrix td:nth-child(2) {
  text-align: left;
}

.policy-matrix td:nth-child(3) {
  min-width: 0;
  max-width: none;
  white-space: normal;
  line-height: 1.55;
  text-align: left;
}

.channel-policy-input-matrix th:nth-child(3),
.channel-policy-input-matrix td:nth-child(3) {
  text-align: left;
}

.channel-policy-input-matrix th:first-child,
.channel-policy-input-matrix td:first-child {
  text-align: center;
  padding-left: 6px;
  padding-right: 6px;
  overflow: hidden;
}

.channel-policy-input-matrix td:nth-child(4) {
  min-width: 0;
  max-width: none;
  white-space: normal;
  line-height: 1.55;
  text-align: left;
}

.policy-month-lines table {
  min-width: 980px;
}

.policy-month-lines th,
.policy-month-lines td {
  text-align: center;
}

.policy-month-lines td:nth-child(1),
.policy-month-lines td:nth-child(2) {
  text-align: left;
  white-space: normal;
}

.policy-month-lines td:nth-child(2) {
  min-width: 320px;
  line-height: 1.55;
}

.policy-month-lines td:nth-child(3) {
  min-width: 160px;
  text-align: center;
}

.policy-note-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
  padding: 16px 18px;
}

.policy-note-panel h3 {
  margin: 0 0 10px;
  font-size: 16px;
}

.policy-note-panel .section-head {
  align-items: center;
  margin-bottom: 10px;
}

.policy-note-panel ol {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 8px;
}

.policy-note-panel li {
  line-height: 1.7;
  white-space: normal;
  overflow-wrap: anywhere;
}

.policy-note-group {
  display: grid;
  gap: 8px;
}

.policy-note-group + .policy-note-group {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.policy-note-group > strong {
  font-size: 13px;
  color: var(--text);
}

.policy-note-group.supplemental {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.policy-approval-notice {
  margin: 0 0 14px;
  color: var(--warning);
  border: 1px solid #efd3ae;
  border-radius: var(--radius-sm);
  background: #fff8ed;
  padding: 10px 12px;
}

.wide-table .sticky-col {
  white-space: nowrap;
}

.portal-supplement-table table {
  width: 100%;
  min-width: 1180px;
}

.portal-supplement-table .sticky-col {
  width: 220px;
  min-width: 220px;
  max-width: 280px;
}

.portal-supplement-table .supplement-action-col {
  position: sticky;
  left: 220px;
  z-index: 2;
  width: 88px;
  min-width: 88px;
  background: var(--panel);
  box-shadow: 8px 0 12px rgba(47, 78, 99, 0.06);
}

.portal-supplement-table th:nth-child(3),
.portal-supplement-table td:nth-child(3) {
  min-width: 118px;
}

.portal-supplement-table th:nth-child(4),
.portal-supplement-table td:nth-child(4) {
  min-width: 116px;
}

.portal-supplement-table th:nth-child(5),
.portal-supplement-table td:nth-child(5),
.portal-supplement-table th:nth-child(6),
.portal-supplement-table td:nth-child(6),
.portal-supplement-table th:nth-child(7),
.portal-supplement-table td:nth-child(7),
.portal-supplement-table th:nth-child(8),
.portal-supplement-table td:nth-child(8) {
  min-width: 104px;
}

.portal-supplement-table th:nth-last-child(4),
.portal-supplement-table td:nth-last-child(4),
.portal-supplement-table th:nth-last-child(3),
.portal-supplement-table td:nth-last-child(3) {
  min-width: 142px;
}

.portal-supplement-table th:nth-last-child(2),
.portal-supplement-table td:nth-last-child(2),
.portal-supplement-table th:nth-last-child(1),
.portal-supplement-table td:nth-last-child(1) {
  min-width: 150px;
}

.portal-supplement-table th.supplement-action-col {
  z-index: 4;
  background: #f1f5f9;
}

.supplement-action-btn {
  min-width: 60px;
  font-weight: 700;
}

.sticky-col {
  position: sticky;
  left: 0;
  z-index: 2;
  min-width: 220px;
  max-width: 320px;
  background: var(--panel);
}

th.sticky-col {
  z-index: 3;
  background: #eef6ff;
}

.table-wrap th:last-child,
.table-wrap td:last-child {
  position: static;
  right: auto;
  z-index: auto;
  background: inherit;
  box-shadow: none;
}

.table-wrap th:last-child {
  background: #f1f5f9;
}

.policy-month-detail-row > td {
  background: #f8fbff;
  padding: 12px;
}

.policy-month-detail-row .table-wrap {
  max-height: 420px;
}

.table-input {
  width: 100%;
  min-width: 92px;
  height: 32px;
  padding: 0 8px;
}

.percent-input-wrap {
  display: grid;
  grid-template-columns: minmax(58px, 1fr) 22px;
  align-items: center;
  width: 100%;
  min-width: 92px;
  height: 32px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
}

.percent-input-wrap .table-input {
  min-width: 0;
  height: 30px;
  border: 0;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.percent-input-wrap .table-input:focus {
  outline: none;
  box-shadow: none;
}

.percent-input-wrap span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  border-left: 1px solid var(--line);
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 12px;
}

.date-input {
  width: 190px;
}

.status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 24px;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid #a9d5c5;
  background: #eafaf4;
  color: var(--success);
  font-size: 12px;
  line-height: 1.25;
  white-space: nowrap;
  font-weight: 700;
}

.status.success {
  border-color: #a9d5c5;
  background: #eafaf4;
  color: var(--success);
}

.status.info,
.status.processing {
  border-color: #b8d0f5;
  background: #eef5ff;
  color: var(--color-info);
}

.status.warn {
  border-color: #f0cc8b;
  background: #fff7e8;
  color: var(--warning);
}

.status.danger {
  border-color: #efb5b2;
  background: #fff1f0;
  color: var(--danger);
}

.status.neutral {
  border-color: #c8d7ea;
  background: #f1f6fc;
  color: var(--neutral);
}

.status.draft,
.status.disabled {
  border-color: #d0d5dd;
  background: #f2f4f7;
  color: var(--color-draft);
}

.status.offline,
.status.archived,
.status.cancelled {
  border-color: #d8dee8;
  background: #f5f7fa;
  color: var(--color-disabled);
}

.empty {
  min-height: 104px;
  display: grid;
  place-items: center;
  padding: 24px;
  border: 1px solid #d7e2ee;
  border-radius: var(--radius);
  background: var(--color-card-muted);
  color: var(--muted);
  text-align: center;
}

.table-loading,
.table-error {
  min-height: 104px;
  display: grid;
  place-items: center;
  padding: 24px;
  border-radius: var(--radius);
}

.table-loading {
  border: 1px solid var(--line);
  background: var(--color-card-muted);
  color: var(--muted);
}

.table-error {
  border: 1px solid #efb5b2;
  background: #fff1f0;
  color: var(--danger);
}

.muted,
.subtext {
  color: var(--muted);
}

.subtext {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 360px;
}

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

.automation-panel {
  margin-top: 16px;
}

.automation-files-panel {
  margin-top: 0;
  margin-bottom: 16px;
}

.automation-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 420px);
  gap: 16px;
  align-items: end;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.automation-hero-copy {
  min-width: 0;
}

.files-scan-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.files-scan-actions .primary-btn,
.files-scan-actions .secondary-btn,
.files-scan-actions .primary-btn.compact,
.files-scan-actions .secondary-btn.compact {
  width: 128px;
  height: 42px;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 800;
}

.section-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  margin-bottom: 6px;
  padding: 2px 8px;
  border-radius: 6px;
  background: #eef5ff;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
}

.automation-create-form {
  display: grid;
  gap: 10px;
  justify-items: stretch;
}

.automation-create-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.automation-create-form input[type="date"] {
  width: 100%;
  min-width: 0;
  height: 38px;
}

.automation-create-actions {
  justify-content: flex-end;
}

.automation-create-actions .primary-btn,
.automation-create-actions .secondary-btn,
.automation-create-actions .primary-btn.compact,
.automation-create-actions .secondary-btn.compact {
  min-width: 112px;
  height: 42px;
  padding: 0 18px;
  font-size: 14px;
  font-weight: 800;
}

.automation-primary-action,
.publish-primary-action {
  min-width: 112px;
  height: 42px;
  padding: 0 20px;
  font-size: 15px;
  font-weight: 800;
  box-shadow: 0 6px 14px rgba(21, 93, 168, 0.18);
}

.automation-primary-action {
  min-width: 128px;
}

.files-scan-actions .primary-btn,
.files-scan-actions .secondary-btn,
.files-scan-actions .primary-btn.compact,
.files-scan-actions .secondary-btn.compact {
  width: 128px;
  min-width: 128px;
  height: 42px;
}

.publish-row-action {
  min-width: 72px;
  min-height: 36px;
  padding: 0 14px;
  font-size: 13px;
  box-shadow: 0 3px 8px rgba(21, 93, 168, 0.14);
}

.automation-support-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.automation-support-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fbfcfe;
}

.automation-support-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.automation-support-card h3 {
  margin: 0;
  font-size: 15px;
}

.automation-support-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.automation-ops-notice {
  margin-top: 10px;
}

.daily-upload-precheck-form {
  margin: 12px 0 0;
}

.daily-upload-file-field {
  flex: 1 1 360px;
}

.daily-upload-file-field .file-picker-box {
  min-width: 280px;
}

.daily-import-preview-panel {
  margin-top: 12px;
}

.daily-import-preview-panel .risk-alert {
  margin: 12px 0;
}

.daily-import-preview-grid {
  margin-top: 12px;
}

.daily-import-issue-list {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.daily-import-issues {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
}

.daily-import-issues h4 {
  margin: 0 0 8px;
}

.daily-import-issues ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
}

.daily-import-issues li span {
  display: block;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.daily-import-issues.danger {
  border-color: #efb5b2;
  background: #fff7f6;
}

.daily-import-issues.warning {
  border-color: #efd3ae;
  background: #fffaf1;
}

.checkbox-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: var(--form-control-height);
  color: var(--text);
}

.checkbox-line input {
  width: 16px;
  height: 16px;
}

.automation-advanced-panel {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fbfcfe;
}

.automation-advanced-panel summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
}

.automation-advanced-panel summary::-webkit-details-marker {
  display: none;
}

.automation-advanced-panel summary::after {
  content: "展开";
  flex: 0 0 auto;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
}

.automation-advanced-panel[open] summary::after {
  content: "收起";
}

.automation-advanced-panel summary span {
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
}

.automation-advanced-panel summary small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  text-align: right;
}

.automation-advanced-body {
  display: grid;
  gap: 12px;
  padding: 0 14px 14px;
  border-top: 1px solid var(--line);
}

.automation-advanced-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: 16px;
  align-items: end;
  padding-top: 14px;
}

.automation-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.automation-summary-item {
  display: grid;
  gap: 6px;
  min-height: 72px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--color-card-muted);
}

.automation-summary-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.automation-summary-item strong {
  color: var(--text);
  font-size: 26px;
  line-height: 1;
}

.automation-summary-success {
  border-left: 3px solid var(--success);
}

.automation-summary-risk {
  border-left: 3px solid #f59f00;
}

.automation-summary-danger {
  border-left: 3px solid var(--danger);
}

.automation-files-grid {
  align-items: stretch;
  margin-top: 12px;
  grid-template-columns: minmax(320px, 0.9fr) minmax(520px, 1.4fr);
}

.automation-files-grid .subpanel {
  min-width: 0;
  height: 100%;
}

.automation-current-card {
  display: grid;
  gap: 12px;
  align-content: start;
  border-left: 3px solid var(--primary);
}

.automation-current-success {
  border-left-color: var(--success);
}

.automation-current-risk {
  border-left-color: #f59f00;
}

.automation-current-danger {
  border-left-color: var(--danger);
}

.automation-current-grid {
  margin: 0;
}

.automation-next-step {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: #f8fafc;
}

.automation-next-step span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.automation-next-step strong {
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
}

.automation-current-actions {
  justify-content: flex-end;
}

.automation-records-panel .table-wrap {
  max-height: 360px;
}

.automation-detail-modal-backdrop {
  align-items: center;
  justify-content: center;
}

.automation-detail-modal-panel {
  width: min(1180px, calc(100vw - 48px));
  height: auto;
  max-height: calc(100vh - 48px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

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

.automation-detail-modal-head h2 {
  margin: 0 0 6px;
}

.automation-detail-modal-body {
  min-height: 0;
  overflow: auto;
  padding: 18px 20px 20px;
}

.automation-detail-modal-body .automation-detail-panel {
  margin: 0;
  padding: 0;
  border: 0;
  box-shadow: none;
}

.automation-detail-panel-modal {
  display: grid;
  gap: 14px;
}

.automation-modal-actions {
  justify-content: flex-end;
}

.automation-detail-modal-body .automation-detail-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
}

.automation-detail-modal-body .automation-detail-grid > div,
.automation-detail-modal-body .automation-log-excerpt,
.automation-detail-modal-body .table-wrap {
  box-shadow: none;
}

.automation-detail-modal-body .automation-message,
.automation-detail-modal-body .automation-log-block {
  margin: 0;
}

.automation-detail-modal-body .automation-log-excerpt {
  max-height: 150px;
}

.automation-detail-modal-body .table-wrap {
  max-height: 240px;
}

.automation-detail-modal-body h3 {
  margin: 0;
}

.automation-result-text {
  display: block;
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
}

.automation-result-text.risk {
  color: #9a6700;
  font-weight: 700;
}

.automation-result-text.danger {
  color: var(--danger);
  font-weight: 700;
}

.automation-detail-grid {
  margin: 12px 0;
}

.automation-message {
  margin: 12px 0;
  padding: 12px;
}

.automation-message p {
  margin: 6px 0 0;
}

.automation-log-block {
  margin: 12px 0;
}

.automation-log-excerpt {
  max-height: 260px;
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--color-card-muted);
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

@media (max-width: 980px) {
  .automation-hero,
  .automation-advanced-head,
  .automation-files-grid {
    grid-template-columns: 1fr;
  }

  .files-scan-actions,
  .automation-advanced-panel summary {
    align-items: stretch;
    flex-direction: column;
  }

  .automation-advanced-panel summary small {
    text-align: left;
  }

  .automation-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .automation-support-grid {
    grid-template-columns: 1fr;
  }

  .automation-detail-modal-panel {
    width: min(760px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
  }

  .automation-detail-modal-body .automation-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .automation-detail-modal-head {
    padding: 14px;
  }

  .automation-detail-modal-body {
    padding: 14px;
  }

  .automation-detail-modal-body .automation-detail-grid {
    grid-template-columns: 1fr;
  }
}

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

.compact-list {
  display: grid;
  gap: 8px;
}

.compact-list-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  align-items: center;
  min-height: 54px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--color-card-muted);
}

.compact-list-item strong,
.compact-list-item span:not(.status) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-list-item strong {
  color: var(--text);
  font-size: 14px;
}

.compact-list-item span:not(.status) {
  color: var(--muted);
  font-size: 12px;
}

.compact-list-item .status {
  grid-row: 1 / span 2;
  grid-column: 2;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  padding: 16px 0 4px;
  color: var(--text);
}

.pagination strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 42px;
  border-radius: 4px;
  background: var(--brand);
  color: #fff;
  font-size: 18px;
}

.pagination .icon-btn {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 24px;
  line-height: 1;
}

.pagination .icon-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.pagination-pages {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.pagination-page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--text);
  font-weight: 700;
}

.pagination-page.active {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.pagination-ellipsis {
  color: var(--muted);
}

.pagination select,
.pagination input {
  flex: 0 0 auto;
  width: auto;
  height: 42px;
  border-radius: 4px;
  background: #f4f8ff;
}

.pagination input {
  width: 54px;
  text-align: center;
}

.pagination .secondary-btn.compact {
  flex: 0 0 auto;
  min-width: 52px;
}

.tabbar {
  display: flex;
  gap: 8px;
  margin: 12px 0 14px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}

.tab-btn {
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  padding: 0 12px;
}

.tab-btn.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
  font-weight: 700;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  background: rgba(10, 35, 75, 0.32);
}

.compact-backdrop {
  align-items: center;
  justify-content: center;
}

.modal-panel {
  width: 520px;
  max-width: calc(100vw - 48px);
  height: 100vh;
  overflow-y: auto;
  background: var(--panel);
  padding: 22px;
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.modal-panel.wide-modal {
  width: min(1120px, calc(100vw - 48px));
}

.user-detail-modal-backdrop {
  align-items: center;
  justify-content: center;
}

.user-detail-modal-panel {
  width: min(1180px, calc(100vw - 48px));
  height: auto;
  max-height: calc(100vh - 48px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.modal-panel h2 {
  margin: 0 0 6px;
  font-size: 18px;
}

.modal-panel p {
  margin: 0;
}

.modal-summary {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 16px;
}

.detail-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 16px;
}

.workflow-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.workflow-strip div {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 4px 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-soft);
}

.workflow-strip span {
  grid-row: span 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
}

.workflow-strip strong {
  font-size: 14px;
}

.workflow-strip small {
  color: var(--muted);
}

.governance-note {
  margin-top: 16px;
}

.governance-note p {
  margin: 0 0 12px;
  color: var(--muted);
}

.detail-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr)) auto;
  gap: 12px;
  align-items: end;
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.detail-form.channel-form {
  grid-template-columns: minmax(260px, 420px) auto;
  justify-content: start;
}

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

.detail-item {
  min-height: 74px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #f8fbff;
  overflow-wrap: anywhere;
}

.detail-item span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
}

.detail-item strong {
  font-size: 13px;
  font-weight: 600;
}

.user-detail-page {
  display: grid;
  gap: 16px;
  width: 100%;
}

.user-detail-head {
  justify-content: space-between;
  margin-bottom: 0;
}

.user-detail-head-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-account-card {
  display: grid;
  gap: 16px;
}

.user-detail-summary {
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  align-items: stretch;
}

.user-account-controls {
  display: grid;
  grid-template-columns: minmax(520px, 760px);
  gap: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.user-review-choice {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.user-review-option {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-soft);
}

.user-review-option h3 {
  margin-bottom: 8px;
}

.user-permission-panel {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-soft);
}

.user-permission-panel h3 {
  margin-bottom: 12px;
}

.user-channel-binding-card {
  width: 100%;
  border-left: 3px solid var(--accent);
}

.user-role-function-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.user-status-modal-actions {
  display: flex;
  gap: 10px;
  margin: 16px 0;
  flex-wrap: wrap;
}

.account-profile {
  display: grid;
  gap: 18px;
  width: 100%;
}

.account-warning {
  margin-top: 0;
  color: var(--warning);
}

.account-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.account-summary div {
  min-height: 66px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-soft);
  overflow-wrap: anywhere;
}

.account-summary span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
}

.account-summary strong {
  font-size: 14px;
  line-height: 1.5;
}

.account-summary-wide {
  grid-column: span 2;
}

.account-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.account-edit-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(360px, 1.1fr);
  gap: 14px;
  align-items: start;
}

.compact-modal {
  width: 420px;
  height: auto;
  min-height: 0;
  max-height: calc(100vh - 56px);
  margin: 0;
  border-radius: var(--radius);
}

.readonly-field {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.readonly-field strong {
  min-height: 38px;
  display: flex;
  align-items: center;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #f8fbff;
  color: var(--text);
  font-weight: 600;
}

.notice {
  margin-top: 12px;
  min-height: 28px;
  color: var(--danger);
  line-height: 1.6;
  border-radius: var(--radius-sm);
}

.file-workflow-strip {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fbff;
  color: var(--brand-deep);
  font-size: 13px;
  font-weight: 700;
}

.workflow-step {
  display: inline-flex;
  align-items: center;
  width: auto;
  height: auto;
  border-radius: 0;
  background: transparent;
  color: var(--brand-deep);
  white-space: nowrap;
}

.workflow-divider {
  display: inline-flex;
  align-items: center;
  width: auto;
  height: auto;
  border-radius: 0;
  background: transparent;
  color: var(--muted-soft);
  font-weight: 600;
}

.status-overview {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.status-overview-item {
  min-width: 0;
  min-height: 68px;
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: none;
}

.status-overview-risk {
  border-left: 3px solid #f0cc8b;
}

.status-overview-risk .status-overview-dot {
  background: var(--warning);
}

.status-overview-danger {
  border-left: 3px solid #efb5b2;
}

.status-overview-danger .status-overview-dot {
  background: var(--danger);
}

.status-overview-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
}

.status-overview-label,
.metric-card-title {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.status-overview-value,
.metric-card-value {
  color: var(--text);
  font-size: 22px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.metric-card {
  min-width: 0;
  min-height: 84px;
  display: grid;
  align-content: space-between;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-left: 3px solid #8fb5e5;
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: none;
}

.metric-card.danger {
  border-left-color: var(--danger);
}

.metric-card-desc {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.file-workbench {
  display: grid;
  gap: 12px;
}

.file-filter-bar {
  margin-bottom: 0;
}

.channel-filter-bar {
  margin-top: 14px;
  margin-bottom: 14px;
}

.channel-filter-bar .search-input {
  flex: 1 1 280px;
  min-width: 220px;
}

.channel-filter-bar .channel-select {
  flex: 1 1 260px;
  min-width: 220px;
}

.mapping-match-list {
  display: grid;
  gap: 6px;
  min-width: 220px;
}

.mapping-match-item {
  display: grid;
  gap: 2px;
  padding: 6px 8px;
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  background: #f8fbff;
}

.mapping-match-item strong,
.mapping-match-item span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.mapping-match-item span {
  color: var(--muted);
  font-size: 12px;
}

.filter-actions {
  display: flex;
  align-items: end;
  gap: 8px;
  margin-left: 0;
}

.file-table table {
  min-width: 1080px;
  table-layout: fixed;
}

.file-table th:nth-child(1),
.file-table td:nth-child(1) {
  width: 32%;
}

.file-table th:nth-child(2),
.file-table td:nth-child(2) {
  width: 16%;
}

.file-table th:nth-child(3),
.file-table td:nth-child(3) {
  width: 18%;
}

.file-table th:nth-child(4),
.file-table td:nth-child(4) {
  width: 11%;
}

.file-table th:nth-child(5),
.file-table td:nth-child(5) {
  width: 14%;
}

.file-table th:nth-child(6),
.file-table td:nth-child(6) {
  width: 170px;
}

.file-info-cell,
.file-meta {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.file-title,
.file-name-cell {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-subtitle {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-meta-row,
.file-meta-line {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  min-width: 0;
}

.file-type-tag {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 8px;
  border: 1px solid #c8d7ea;
  border-radius: 999px;
  background: #f1f6fc;
  color: var(--brand-deep);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.risk-tag {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 2px 8px;
  border: 1px solid #d8dee8;
  border-radius: 999px;
  background: #f5f7fa;
  color: var(--neutral);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.risk-tag-danger {
  border-color: #efb5b2;
  background: #fff1f0;
  color: var(--danger);
}

.risk-tag-warning {
  border-color: #f0cc8b;
  background: #fff7e8;
  color: var(--warning);
}

.risk-tag-success {
  border-color: #a9d5c5;
  background: #eafaf4;
  color: var(--success);
}

.risk-reason {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.risk-alert {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid #efb5b2;
  border-radius: var(--radius-sm);
  background: #fff1f0;
  color: var(--danger);
  line-height: 1.45;
}

.risk-alert.compact {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 700;
}

.section-card {
  min-width: 0;
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-xs);
}

.section-card > form,
.section-card > .table-wrap,
.section-card > .wide-table {
  min-width: 0;
  max-width: 100%;
}

.section-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.section-card-title {
  margin: 0 0 5px;
  font-size: 16px;
  line-height: 1.35;
}

.section-card-desc {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.portal-download-intro {
  margin-bottom: 16px;
}

.portal-download-source-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.portal-download-source-grid .primary-btn,
.portal-download-source-grid .secondary-btn {
  width: 100%;
}

.portal-download-filter-bar {
  display: grid;
  grid-template-columns: minmax(170px, 0.8fr) minmax(190px, 0.9fr) minmax(240px, 1.3fr) auto;
  align-items: end;
  min-width: 0;
  width: 100%;
}

.portal-download-module-panel {
  display: grid;
  gap: 12px;
  width: 100%;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
}

.portal-download-module-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.portal-download-module-head > div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.portal-download-module-head strong {
  color: var(--text);
  font-size: 15px;
}

.portal-download-module-head span {
  color: var(--muted);
  line-height: 1.5;
}

.portal-download-module-table table {
  min-width: 920px;
  table-layout: fixed;
}

.portal-file-list {
  grid-template-columns: minmax(0, 1fr);
  overflow: hidden;
}

.portal-file-list > .portal-download-filter-bar,
.portal-file-list > .table-wrap {
  min-width: 0;
  width: 100%;
  max-width: 100%;
}

.portal-download-module-table th:nth-child(1),
.portal-download-module-table td:nth-child(1) {
  width: 30%;
}

.portal-download-module-table th:nth-child(2),
.portal-download-module-table td:nth-child(2) {
  width: 42%;
}

.portal-download-module-table th:nth-child(3),
.portal-download-module-table td:nth-child(3) {
  width: 14%;
}

.portal-download-module-table th:nth-child(4),
.portal-download-module-table td:nth-child(4) {
  width: 160px;
}

.portal-download-module-table td:nth-child(2) {
  color: var(--muted);
}

.section-card-actions,
.table-actions,
.table-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.table-toolbar {
  justify-content: space-between;
  padding: 0 2px;
}

.table-result-count {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.action-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.action-button,
.action-disabled {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
}

.action-button {
  background: var(--brand);
  color: #fff;
}

.action-button.secondary {
  background: #fff;
  color: var(--brand-deep);
  border-color: var(--line-strong);
}

.action-link {
  min-height: 30px;
  padding: 0 2px;
  border: 0;
  background: transparent;
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
}

.action-disabled,
.is-disabled {
  background: #f2f4f7;
  color: var(--color-disabled);
  border-color: #d0d5dd;
}

button[data-action="report-publish"],
.publish-row-action {
  min-width: 72px;
  min-height: 36px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 3px 8px rgba(21, 93, 168, 0.14);
}

.permission-panel {
  display: grid;
  gap: 14px;
}

.file-detail-page,
.portal-download-detail {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.detail-summary {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.detail-summary h2 {
  margin: 0 0 4px;
  font-size: 18px;
}

.detail-summary-status {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

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

.lookup-key-grid,
.lookup-brief-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.lookup-brief-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.lookup-processing-layout {
  display: grid;
  gap: 16px;
}

.lookup-process-controls {
  display: grid;
  gap: 16px;
}

.lookup-process-step {
  position: relative;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.lookup-process-step::before {
  content: "";
  position: absolute;
  left: 39px;
  top: 58px;
  bottom: -16px;
  width: 1px;
  background: var(--border-soft);
}

.lookup-process-controls > .lookup-process-step:last-child::before {
  display: none;
}

.lookup-step-number {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.lookup-step-main {
  min-width: 0;
}

.lookup-step-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.lookup-step-head h3 {
  margin: 0 0 8px;
}

.lookup-step-head .muted {
  margin: 0;
}

.lookup-step-main h3 {
  margin: 0 0 8px;
}

.lookup-step-main > .muted {
  margin: -2px 0 14px;
}

.lookup-handoff-panel {
  display: grid;
  gap: 7px;
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid #cfe0f5;
  border-radius: var(--radius-sm);
  background: #f5f9ff;
  color: var(--text);
}

.lookup-handoff-panel strong {
  color: var(--brand-deep);
}

.lookup-handoff-panel span {
  color: var(--muted);
  line-height: 1.55;
}

.lookup-exception-actions {
  margin-left: 58px;
  padding: 12px 14px;
  border: 1px dashed var(--border-soft);
  border-radius: var(--radius-sm);
  background: #fbfcfe;
}

.lookup-exception-actions summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 700;
}

.lookup-exception-actions .form-grid {
  margin-top: 12px;
}

.lookup-exception-inline {
  flex: 0 0 auto;
  margin-left: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.lookup-exception-inline summary {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 13px;
  border: 1px solid #efb85d;
  border-radius: var(--radius-sm);
  background: #fff8e8;
  color: var(--warning);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.lookup-exception-inline summary::after {
  content: "⌄";
  font-size: 12px;
  line-height: 1;
}

.lookup-exception-inline[open] summary {
  border-color: #d99025;
  background: #fff1d4;
}

.lookup-exception-inline[open] summary::after {
  content: "⌃";
}

.lookup-exception-inline .form-grid {
  min-width: 300px;
  margin-top: 8px;
  padding: 12px;
  border: 1px solid var(--border-soft);
  border-top: 3px solid #d99025;
  border-radius: var(--radius-sm);
  background: #fff;
  box-shadow: var(--shadow-panel);
}

.lookup-processing-summary .detail-head {
  align-items: center;
}

.lookup-collapse-card {
  padding: 0;
  overflow: hidden;
}

.lookup-collapse-card summary {
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  cursor: pointer;
  list-style: none;
}

.lookup-collapse-card summary::-webkit-details-marker {
  display: none;
}

.lookup-collapse-card summary span {
  color: var(--muted);
  font-size: 13px;
}

.lookup-collapse-card summary::after {
  content: "展开";
  margin-left: auto;
  color: var(--brand);
  font-weight: 700;
}

.lookup-collapse-card[open] summary {
  border-bottom: 1px solid var(--border-soft);
}

.lookup-collapse-card[open] summary::after {
  content: "收起";
}

.lookup-collapse-body {
  padding: 16px 18px;
}

.lookup-collapse-card > .row-actions {
  padding: 0 18px 18px;
}

.detail-summary-item {
  min-width: 0;
}

.detail-section-grid {
  display: grid;
  gap: 16px;
}

.detail-section-grid-two {
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.88fr);
  align-items: start;
}

.risk-panel {
  border-left: 3px solid #e8b04e;
}

.audit-timeline {
  display: grid;
  gap: 10px;
}

.audit-timeline-item {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: var(--color-surface-muted);
}

.audit-timeline-item span,
.audit-timeline-item small {
  color: var(--muted);
  font-size: 12px;
}

.audit-timeline-item strong {
  color: var(--text);
  font-size: 14px;
}

.audit-timeline-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.download-card {
  display: grid;
  grid-template-columns: minmax(260px, 1.4fr) repeat(2, minmax(180px, 0.8fr));
  gap: 14px;
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid #c8d7ea;
  border-radius: var(--radius);
  background: #f8fbff;
  box-shadow: var(--shadow-xs);
}

.download-card > div {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.download-card strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-size: 18px;
}

.download-overview {
  display: grid;
  grid-template-columns: minmax(280px, 1.4fr) repeat(3, minmax(180px, 0.8fr));
  gap: 12px;
  margin-bottom: 16px;
}

.portal-lookup-overview {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.download-overview > div,
.download-detail-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--color-surface);
  box-shadow: var(--shadow-card);
}

.download-overview strong {
  min-width: 0;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-size: 18px;
}

.portal-file-list {
  gap: 14px;
}

.lookup-month-container {
  display: grid;
  gap: 16px;
  width: 100%;
  min-width: 0;
}

.lookup-month-section,
.lookup-history-section {
  display: grid;
  gap: 12px;
  justify-items: stretch;
}

.lookup-history-section {
  margin-top: 16px;
}

.lookup-history-section h3 {
  text-align: left;
}

.lookup-month-head,
.lookup-month-details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.lookup-month-head h3,
.lookup-history-section h3 {
  margin: 0;
  font-size: 16px;
}

.lookup-month-head span,
.lookup-month-details summary span {
  color: var(--muted);
  font-size: 13px;
}

.lookup-month-details {
  width: 100%;
  justify-self: stretch;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--color-surface);
  box-shadow: var(--shadow-panel);
  overflow: hidden;
}

.lookup-month-details summary {
  cursor: pointer;
  min-height: 52px;
  padding: 14px 18px;
  list-style: none;
}

.lookup-month-details summary::-webkit-details-marker {
  display: none;
}

.lookup-month-details summary::after {
  content: "展开";
  margin-left: auto;
  color: var(--brand);
  font-weight: 700;
}

.lookup-month-details[open] summary {
  border-bottom: 1px solid var(--border-soft);
}

.lookup-month-details[open] summary::after {
  content: "收起";
}

.lookup-month-details .table-wrap {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.task-workbench,
.lookup-admin-workbench,
.portal-lookup-list,
.portal-lookup-new,
.task-detail-page,
.portal-lookup-detail {
  min-width: 0;
}

.task-status-overview {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

#lookupAdminSummary.task-status-overview {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.lookup-admin-workbench + .notice {
  margin-top: 0;
}

.task-filter-bar .inline-field {
  flex: 1 1 180px;
}

.lookup-admin-filter {
  display: grid;
  grid-template-columns: minmax(200px, 1.1fr) minmax(180px, 0.8fr) minmax(200px, 1fr) minmax(200px, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.lookup-admin-filter-range {
  grid-template-columns:
    minmax(150px, 1fr)
    minmax(118px, 0.72fr)
    minmax(118px, 0.72fr)
    minmax(140px, 0.95fr)
    minmax(140px, 0.95fr)
    auto;
}

.lookup-admin-filter .inline-field {
  width: 100%;
}

.lookup-admin-filter .inline-field select,
.lookup-admin-filter .inline-field input {
  width: 100%;
}

.lookup-admin-filter .date-input {
  width: 100%;
}

.lookup-admin-filter .filter-actions {
  flex-wrap: nowrap;
  margin-left: 0;
  white-space: nowrap;
}

.task-table table {
  min-width: 980px;
  table-layout: fixed;
}

.lookup-admin-table table {
  min-width: 880px;
}

.task-table.lookup-admin-table th:nth-child(1),
.task-table.lookup-admin-table td:nth-child(1) {
  width: 16%;
}

.task-table.lookup-admin-table th:nth-child(2),
.task-table.lookup-admin-table td:nth-child(2) {
  width: 18%;
}

.task-table.lookup-admin-table th:nth-child(3),
.task-table.lookup-admin-table td:nth-child(3) {
  width: 34%;
}

.task-table.lookup-admin-table th:nth-child(4),
.task-table.lookup-admin-table td:nth-child(4),
.task-table.lookup-admin-table th:nth-child(5),
.task-table.lookup-admin-table td:nth-child(5) {
  width: 12%;
}

.task-table.lookup-admin-table th:last-child,
.task-table.lookup-admin-table td:last-child {
  width: 110px;
}

.portal-task-table table {
  min-width: 820px;
}

.task-table th:nth-child(1),
.task-table td:nth-child(1) {
  width: 24%;
}

.task-table th:last-child,
.task-table td:last-child {
  width: 180px;
}

.portal-task-table th:nth-child(1),
.portal-task-table td:nth-child(1) {
  width: 30%;
}

.task-profile-tags {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.task-profile-tags span {
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border: 1px solid #d6e2f0;
  border-radius: 6px;
  background: #f5f8fc;
  color: #24547f;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.task-profile-tags .danger {
  border-color: #f2c3c0;
  background: #fff4f2;
  color: #b42318;
}

.task-summary,
.task-detail-page .detail-summary,
.portal-lookup-detail .detail-summary {
  margin-bottom: 14px;
}

.step-flow {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-panel);
}

.portal-lookup-detail .step-flow {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.step-flow-item {
  position: relative;
  min-width: 0;
  min-height: 58px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid #dbe5f0;
  border-radius: 8px;
  background: #f8fafc;
  color: #667085;
}

.step-flow-item span {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #e8eef6;
  color: #536173;
  font-size: 12px;
  font-weight: 800;
}

.step-flow-item strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: inherit;
  font-size: 13px;
}

.step-flow-item.done {
  border-color: #b8decf;
  background: #eefaf5;
  color: #147556;
}

.step-flow-item.done span {
  background: #147556;
  color: #fff;
}

.step-flow-item.active {
  border-color: #9cc1ea;
  background: #f1f7ff;
  color: #155da8;
}

.step-flow-item.active span {
  background: #1d6fd6;
  color: #fff;
}

.step-flow-item.failed {
  border-color: #f2c3c0;
  background: #fff8f7;
  color: #b42318;
}

.step-flow-item.failed span {
  background: #df6b64;
  color: #fff;
}

.step-flow-terminal-note {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 4px;
  color: #6b7a90;
  font-size: 13px;
}

.current-action-card {
  align-content: start;
  border-left: 3px solid #7ea9d7;
}

.current-action-card h2 {
  margin: 4px 0;
}

.current-action-card .row-actions {
  align-items: center;
}

.task-file-card {
  align-content: start;
}

.quality-panel {
  border-left: 3px solid #8fb5e5;
}

.quality-panel.danger {
  border-left-color: #df6b64;
}

.portal-help-card {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.portal-help-card > div {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-panel);
}

.portal-help-card strong {
  color: #172033;
  font-size: 14px;
}

.portal-help-card span {
  color: #718096;
  font-size: 13px;
  line-height: 1.45;
}

.lookup-new-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.lookup-upload-card .form-grid {
  align-items: end;
}

.lookup-file-field {
  min-width: 0;
}

.lookup-file-field .file-picker-box {
  width: 100%;
  min-width: 0;
}

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

.task-rule-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.task-rule-grid > div {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: #f8fafc;
}

.task-rule-grid strong {
  color: #172033;
}

.task-rule-grid span {
  color: #536173;
  font-size: 13px;
}

.task-rule-note {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: #f8fafc;
}

.task-rule-note strong {
  flex: 0 0 auto;
  line-height: 24px;
  color: #172033;
}

.task-rule-note div {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: #536173;
  font-size: 13px;
}

.task-rule-note span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
}

.download-detail-card {
  display: grid;
  gap: 16px;
}

.download-action-panel {
  align-items: center;
  grid-template-columns: minmax(0, 1fr) auto;
}

.empty-state {
  min-height: 120px;
  display: grid;
  place-items: center;
  padding: 24px;
  border: 1px solid #d7e2ee;
  border-radius: var(--radius);
  background: var(--color-card-muted);
  color: var(--muted);
  text-align: center;
}

.config-row {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(260px, 1fr) minmax(180px, 220px) 84px;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-bottom: 1px solid var(--line);
}

.config-row:first-child {
  border-top: 1px solid var(--line);
}

.empty {
  min-height: 104px;
  display: grid;
  place-items: center;
  color: var(--muted);
  padding: 24px;
  text-align: center;
  border: 1px solid #d7e2ee;
  border-radius: var(--radius);
  background: var(--color-card-muted);
}

/* UI V3 visual polish: shell, workbench, tables, and shared states. */
body,
html {
  background: var(--color-page-bg);
}

body {
  color: var(--color-text-primary);
}

.app-shell {
  background: var(--color-page-bg);
}

.app-topbar {
  min-height: 58px;
  padding: 0 28px;
  border-bottom-color: var(--border-soft);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02);
  backdrop-filter: blur(10px);
}

.app-brand {
  gap: 11px;
}

.app-brand .brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, #185fae, #0f7fb8);
  box-shadow: 0 8px 18px rgba(20, 88, 168, 0.16);
  font-size: 13px;
  letter-spacing: 0.02em;
}

.app-brand strong {
  color: #101828;
  font-size: 15px;
  font-weight: 800;
}

.app-brand span {
  color: #667085;
  font-size: 12px;
}

.app-userbar {
  gap: 9px;
}

.app-userbar > span:not(.operator-channel) {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: var(--color-surface-muted);
  color: #344054;
  font-weight: 600;
}

.app-userbar strong {
  min-height: 24px;
  padding: 0 8px;
  border-color: #d8e4f2;
  border-radius: var(--radius-sm);
  background: #eef6ff;
  color: #1458a8;
  font-weight: 700;
}

.app-userbar .text-btn {
  height: 28px;
  color: #475467;
}

.app-userbar .text-btn:hover {
  background: #f2f6fb;
  color: #1458a8;
}

.app-body {
  grid-template-columns: 236px minmax(0, 1fr);
}

.portal-shell .app-body {
  grid-template-columns: 236px minmax(0, 1fr);
}

.sidebar {
  --sidebar-group-gap: 18px;
  --sidebar-item-gap: 6px;
  --sidebar-title-size: 15px;
  --sidebar-title-link-size: 16px;
  --sidebar-item-size: 14px;
  --sidebar-title-link-height: 44px;
  --sidebar-item-height: 36px;
  --sidebar-child-indent: 26px;
  top: 58px;
  height: calc(100vh - 58px);
  padding: 18px 12px 24px;
  background: #102a4c;
  color: #d9e7f4;
  box-shadow: inset -1px 0 rgba(255, 255, 255, 0.05);
}

.portal-shell .sidebar {
  display: flex;
}

.nav-menu {
  gap: var(--sidebar-group-gap);
}

.portal-shell .nav-menu {
  display: grid;
  align-items: stretch;
  justify-content: stretch;
  gap: var(--sidebar-group-gap);
  overflow: visible;
}

.nav-group {
  gap: var(--sidebar-item-gap);
}

.portal-shell .nav-group {
  display: grid;
  align-items: stretch;
  gap: var(--sidebar-item-gap);
}

.nav-title {
  margin: 13px 0 8px;
  padding: 0 10px;
  border: 0;
  background: transparent;
  color: #ffffff;
  font-size: var(--sidebar-title-size);
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: 0;
  text-align: left;
}

.portal-shell .nav-group .nav-title {
  display: block;
}

.portal-shell .nav-title {
  color: #ffffff;
}

.nav-item,
.nav-title-link,
.nav-collapse-toggle {
  border-radius: 7px;
}

.nav-collapse-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 36px;
  cursor: pointer;
}

.nav-collapse-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
}

.nav-collapse-icon {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-right: 2px solid rgba(255, 255, 255, 0.82);
  border-bottom: 2px solid rgba(255, 255, 255, 0.82);
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.16s ease;
}

.nav-children {
  display: grid;
  gap: var(--sidebar-item-gap);
}

.nav-group.collapsed {
  gap: 0;
}

.nav-group.collapsed .nav-children {
  display: none;
}

.nav-group.collapsed .nav-collapse-icon {
  transform: rotate(-45deg);
}

.nav-group.collapsed .nav-title {
  color: rgba(255, 255, 255, 0.82);
}

.nav-title-link {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: var(--sidebar-title-link-height);
  margin: 2px 0 5px;
  padding: 0 10px;
  color: #ffffff;
  font-size: var(--sidebar-title-link-size);
  font-weight: 850;
  position: relative;
}

.nav-item {
  min-height: var(--sidebar-item-height);
  padding: 0 10px 0 var(--sidebar-child-indent);
  color: rgba(232, 241, 250, 0.76);
  font-size: var(--sidebar-item-size);
  font-weight: 600;
}

.portal-shell .nav-item {
  width: 100%;
  min-height: var(--sidebar-item-height);
  padding: 0 10px 0 var(--sidebar-child-indent);
  border: 0;
  color: rgba(232, 241, 250, 0.76);
}

.nav-item:hover,
.nav-title-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.portal-shell .nav-item:hover {
  border-color: transparent;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.nav-item.active,
.nav-title-link.active {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-weight: 800;
}

.nav-item.active::before {
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: #76c7ff;
}

.nav-title-link.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 99px;
  background: #76c7ff;
}

.portal-shell .nav-item.active {
  border-color: transparent;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.portal-shell .nav-item.active::before {
  display: block;
}

@media (min-height: 900px) {
  .sidebar {
    --sidebar-group-gap: 20px;
    --sidebar-item-gap: 7px;
    --sidebar-title-link-height: 46px;
    --sidebar-item-height: 38px;
  }
}

@media (max-height: 760px) {
  .sidebar {
    --sidebar-group-gap: 12px;
    --sidebar-item-gap: 4px;
    --sidebar-title-link-height: 40px;
    --sidebar-item-height: 34px;
  }

  .nav-title {
    margin: 9px 0 5px;
  }
}

@media (min-width: 1440px) {
  .app-body,
  .portal-shell .app-body {
    grid-template-columns: 256px minmax(0, 1fr);
  }
}

.workspace {
  padding: 22px 26px 28px;
}

.page-header {
  align-items: center;
  margin-bottom: 16px;
  padding: 0 0 15px;
  border-bottom-color: var(--border-soft);
}

.page-header-main {
  gap: 6px;
}

.page-header h1 {
  color: #111827;
  font-size: 22px;
  font-weight: 800;
}

.page-header-main > p {
  color: #667085;
  font-size: 14px;
  line-height: 1.55;
}

.breadcrumbs,
.page-header-meta {
  color: #8a98aa;
}

.page-header-actions {
  align-items: center;
  padding-top: 0;
}

.primary-btn,
.secondary-btn,
.text-btn,
.tab-btn,
.action-button,
.action-link,
.action-disabled {
  border-radius: 7px;
  font-weight: 700;
}

.primary-btn {
  background: #155da8;
  box-shadow: 0 1px 2px rgba(20, 88, 168, 0.16);
}

.primary-btn:hover {
  background: #0f4f91;
}

.secondary-btn,
.action-button.secondary {
  border-color: #d7e2ee;
  background: #fff;
  color: #1f3f66;
}

.secondary-btn:hover,
.action-button.secondary:hover {
  border-color: #b8cbe1;
  background: #f6f9fd;
}

.excel-download-btn,
button[data-action="daily-report-download"],
button[data-action="portal-daily-report-download"] {
  border-color: #8fc6a7;
  background: #eaf8f0;
  color: #10623a;
  box-shadow: 0 1px 2px rgba(16, 98, 58, 0.1);
}

.excel-download-btn:hover,
button[data-action="daily-report-download"]:hover,
button[data-action="portal-daily-report-download"]:hover {
  border-color: #57a87b;
  background: #d8f1e3;
  color: #0b5530;
}

.card,
.subpanel,
.section-card,
.detail-summary,
.download-card {
  border-color: var(--border-soft);
  background: var(--color-surface);
  box-shadow: var(--shadow-card);
}

.section-card,
.subpanel,
.card {
  padding: 18px;
}

.section-card {
  gap: 14px;
}

.section-card-header,
.section-head {
  gap: 18px;
}

.section-card-title,
.card h2,
.card h3,
.subpanel h3 {
  color: #172033;
  font-size: 16px;
  font-weight: 800;
}

.section-card-desc,
.section-head p {
  color: #6b7a90;
  font-size: 14px;
}

.stacked-sections {
  gap: 14px;
  min-width: 0;
}

.stacked-sections > .subpanel {
  min-width: 0;
  border-color: var(--border-soft);
}

.stacked-sections .section-head {
  border-bottom-color: var(--border-subtle);
}

.toolbar {
  gap: 12px;
  margin-bottom: 14px;
  padding: 14px;
  border-color: var(--border-soft);
  background: var(--color-surface);
  box-shadow: var(--shadow-panel);
}

.quick-toolbar {
  padding: 12px;
}

.quick-toolbar .inline-field {
  font-size: 14px;
}

input,
select,
textarea {
  border-color: #dbe5f0;
  background: #fff;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #c7d5e6;
}

.table-wrap,
.wide-table {
  border-color: var(--border-soft);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-panel);
}

table {
  background: #fff;
}

th,
td {
  height: 42px;
  padding: 8px 12px;
  border-bottom-color: var(--border-subtle);
}

th {
  color: #536173;
  background: #f7f9fc;
  font-size: 12px;
  font-weight: 800;
}

td {
  color: #263445;
  font-size: 14px;
}

tbody tr:hover td {
  background: #f9fbfe;
}

.table-wrap th:last-child {
  background: #f7f9fc;
}

.sticky-col,
th.sticky-col {
  background: #fff;
}

th.sticky-col {
  background: #f7f9fc;
}

.status,
.status-badge,
.risk-tag,
.file-type-tag {
  min-height: 23px;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
}

.file-type-tag {
  border-color: #d6e2f0;
  background: #f5f8fc;
  color: #24547f;
}

.risk-tag {
  border-color: #dde5ef;
  background: #f8fafc;
  color: #59687a;
}

.risk-tag-danger {
  border-color: #f2c3c0;
  background: #fff4f2;
  color: #b42318;
}

.risk-tag-warning {
  border-color: #f1d39f;
  background: #fff8ea;
  color: #a45f00;
}

.risk-tag-success {
  border-color: #b8decf;
  background: #eefaf5;
  color: #147556;
}

.status-overview {
  gap: 12px;
  margin-bottom: 14px;
}

.status-overview-item {
  min-height: 74px;
  grid-template-columns: minmax(0, 1fr);
  align-content: space-between;
  gap: 8px;
  padding: 13px 14px;
  border-color: var(--border-soft);
  background: linear-gradient(180deg, #fff, #fbfdff);
  box-shadow: var(--shadow-panel);
}

.status-overview-dot {
  display: none;
}

.status-overview-label {
  color: #667085;
  font-size: 12px;
  font-weight: 700;
}

.status-overview-value {
  color: #101828;
  font-size: 24px;
  font-weight: 800;
}

.status-overview-risk {
  border-left: 3px solid #e8b04e;
}

.status-overview-danger {
  border-left: 3px solid #df6b64;
  background: linear-gradient(180deg, #fff, #fff8f7);
}

.metric-grid {
  gap: 12px;
  margin-bottom: 14px;
}

.metric-card,
.metric {
  border-color: var(--border-soft);
  background: #fff;
  box-shadow: var(--shadow-panel);
}

.metric-card {
  min-height: 88px;
  padding: 14px;
  border-left-color: #7ea9d7;
}

.metric-card.danger {
  border-left-color: #df6b64;
}

.metric-card-title,
.metric span {
  color: #667085;
  font-size: 12px;
}

.metric-card-value,
.metric strong {
  color: #111827;
  font-size: 23px;
  font-weight: 800;
}

.file-workbench {
  gap: 14px;
}

.file-filter-bar {
  margin-bottom: 0;
}

.file-title,
.file-name-cell {
  color: #172033;
  font-weight: 800;
}

.file-subtitle,
.file-meta-row,
.file-meta-line,
.risk-reason {
  color: #718096;
}

.table-toolbar {
  min-height: 30px;
  padding: 0 2px;
}

.table-result-count {
  color: #1f2a3d;
  font-weight: 800;
}

.action-group {
  gap: 7px;
}

.action-button,
.action-disabled,
.action-link {
  min-height: 28px;
  font-size: 12px;
}

.action-link {
  color: #155da8;
}

.empty,
.empty-state {
  border-color: var(--border-soft);
  background: #f8fafc;
  color: #718096;
}

#dailySupplementsPanel > .empty,
#dailySupplementsPanel .empty {
  text-align: center;
}

#dailySupplementsPanel .subpanel {
  min-width: 0;
  box-shadow: var(--shadow-card);
}

#dailySupplementsPanel .toolbar,
#dailySupplementsPanel .grid {
  min-width: 0;
}

#dailySupplementsPanel .grid.cols-4 {
  gap: 12px;
  margin-bottom: 0;
}

.sidebar {
  overflow: hidden;
}

.nav-menu {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.sidebar-footer {
  flex: 0 0 auto;
  margin-top: auto;
  padding: 10px 8px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.brand-lockup--sidebar {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  grid-template-areas:
    "mark primary"
    "mark endorsement";
  column-gap: 9px;
  row-gap: 4px;
  width: 100%;
  min-height: 48px;
  align-items: center;
  color: #fff;
}

.brand-lockup--sidebar .brand-lockup__mark {
  grid-area: mark;
  box-sizing: border-box;
  width: 32px;
  height: 32px;
  padding: 3px;
  border-radius: 6px;
  align-self: center;
}

.brand-lockup--sidebar .brand-lockup__primary {
  grid-area: primary;
  align-self: end;
  color: rgba(255, 255, 255, 0.92);
  font-size: 13px;
  font-weight: 800;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-lockup--sidebar .brand-lockup__endorsement {
  grid-area: endorsement;
  align-self: start;
  color: rgba(217, 231, 244, 0.64);
  font-size: 11px;
  font-weight: 500;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-collapsed .brand-lockup--sidebar,
.is-collapsed .brand-lockup--sidebar,
.collapsed .brand-lockup--sidebar {
  display: flex;
  justify-content: center;
  min-height: 44px;
}

.sidebar-collapsed .brand-lockup--sidebar .brand-lockup__primary,
.sidebar-collapsed .brand-lockup--sidebar .brand-lockup__endorsement,
.is-collapsed .brand-lockup--sidebar .brand-lockup__primary,
.is-collapsed .brand-lockup--sidebar .brand-lockup__endorsement,
.collapsed .brand-lockup--sidebar .brand-lockup__primary,
.collapsed .brand-lockup--sidebar .brand-lockup__endorsement {
  display: none;
}

@media (max-width: 1200px) {
  .login-page {
    grid-template-columns: minmax(520px, 1fr) minmax(380px, 460px);
  }

  .login-card > :not(.brand-lockup--header) {
    width: min(100%, 360px);
  }

  .app-shell {
    grid-template-rows: 56px minmax(0, 1fr);
  }

  .portal-shell {
    grid-template-rows: 56px minmax(0, 1fr);
  }

  .content {
    padding: 0;
  }

  .grid.cols-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .status-overview {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #lookupAdminSummary.task-status-overview {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .lookup-admin-filter {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .user-detail-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .user-account-controls {
    grid-template-columns: 1fr;
  }

  .lookup-admin-filter .filter-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .step-flow,
  .portal-lookup-detail .step-flow,
  .portal-help-card {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .module-layout {
    grid-template-columns: 1fr;
  }

  .module-phase-rail {
    position: static;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .module-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-grid,
  .detail-summary-grid,
  .lookup-key-grid,
  .lookup-brief-grid,
  .detail-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-section-grid-two,
  .download-overview,
  .download-action-panel {
    grid-template-columns: 1fr;
  }

  .download-card {
    grid-template-columns: 1fr;
  }

  .section-card-header,
  .table-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .lookup-process-step {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .lookup-process-step::before {
    left: 37px;
  }
}

@media (max-width: 820px) {
  .login-page {
    grid-template-columns: 1fr;
  }

  .login-visual {
    padding: 28px 24px;
  }

  .login-visual .boundary-list {
    display: none;
  }

  .login-brand-lockup {
    gap: 10px;
  }

  .brand-lockup--header {
    min-height: 40px;
    gap: 9px;
    margin-top: 0;
    margin-bottom: clamp(28px, 5vh, 42px);
  }

  .brand-lockup--header .brand-lockup__mark {
    width: 36px;
    height: 36px;
  }

  .brand-lockup__primary--wordmark img {
    width: 96px;
  }

  .brand-lockup__group strong {
    font-size: 12px;
  }

  .brand-lockup__group small {
    font-size: 11px;
  }

  .brand-unit {
    min-height: 62px;
    padding: 8px 10px 8px 8px;
  }

  .brand-emblem {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
  }

  .brand-copy strong {
    font-size: 14px;
  }

  .brand-copy small {
    font-size: 11px;
  }

  .brand-divider {
    display: none;
  }

  .boundary-list,
  .grid.cols-2,
  .grid.cols-3,
  .grid.cols-4,
  .portal-home-grid,
  .module-summary-grid,
  .module-phase-rail,
  .module-card-grid,
    .detail-grid,
    .detail-summary-grid,
    .lookup-key-grid,
    .lookup-brief-grid,
    .detail-form,
    .metric-grid,
    .status-overview,
    #lookupAdminSummary.task-status-overview,
    .step-flow,
    .portal-lookup-detail .step-flow,
    .portal-help-card,
    .task-rule-grid,
    .lookup-admin-filter,
    .modal-summary {
    grid-template-columns: 1fr;
  }

  .lookup-process-step {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 10px;
  }

  .lookup-process-step::before {
    left: 32px;
  }

  .lookup-step-number {
    width: 26px;
    height: 26px;
  }

  .lookup-step-head {
    flex-direction: column;
  }

  .lookup-exception-inline {
    flex-basis: auto;
    width: 100%;
  }

  .module-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .module-progress-meter {
    width: 100%;
  }

  .app-shell {
    grid-template-rows: 56px minmax(0, 1fr);
  }

  .app-body {
    grid-template-columns: 1fr;
  }

  .portal-shell .app-body {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .portal-shell .sidebar {
    display: none;
  }

  .portal-shell .nav-menu {
    justify-content: flex-start;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 18px;
  }

  .operator {
    text-align: left;
  }

  .content {
    padding: 0;
  }

  .toolbar {
    align-items: stretch;
  }

  .toolbar label,
  .toolbar button,
  .filter-actions,
  .portal-download-filter-bar,
  .quick-toolbar .channel-select,
  .quick-toolbar .search-input {
    flex: 1 1 100%;
  }

  .portal-download-filter-bar {
    grid-template-columns: 1fr;
  }

  .portal-download-hub {
    grid-template-columns: minmax(0, 1fr);
  }

  .portal-download-source-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .portal-download-source-grid .primary-btn,
  .portal-download-source-grid .secondary-btn {
    min-width: 0;
    white-space: normal;
  }

  .portal-file-list,
  .portal-download-intro,
  .portal-download-hub-card {
    overflow: hidden;
  }

  .filter-actions {
    margin-left: 0;
  }

  .quick-toolbar .date-input {
    flex: 1 1 auto;
    width: auto;
  }

  .daily-import-status,
  .daily-auto-scan-form,
  .user-detail-summary,
  .user-role-function-grid,
  .account-summary,
  .account-edit-grid {
    grid-template-columns: 1fr;
  }

  .config-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .config-row strong,
  .config-row span {
    overflow-wrap: anywhere;
  }

  .config-row input,
  .config-row button {
    min-width: 0;
    width: 100%;
  }

  .pagination {
    gap: 8px;
  }

  .account-summary-wide {
    grid-column: auto;
  }
}

@media (max-height: 760px) and (min-width: 821px) {
  .login-card {
    padding-top: 32px;
    padding-bottom: 32px;
  }

  .brand-lockup--header {
    margin-top: -16px;
    margin-bottom: 48px;
  }

  .login-card p {
    margin-bottom: 18px;
  }

  .form-grid {
    gap: 12px;
  }
}

@media (max-width: 460px) {
  .brand-lockup--header {
    align-items: center;
    flex-wrap: nowrap;
  }

  .brand-lockup--header .brand-lockup__group strong {
    display: none;
  }

  .brand-lockup--header .brand-lockup__group {
    display: flex;
    align-items: center;
  }
}
