:root {
  color-scheme: light;
  --bg: #f5f4f0;
  --surface: #ffffff;
  --surface-soft: #f8f7f3;
  --ink: #202423;
  --muted: #8c8c8c;
  --line: #e5e2dc;
  --teal: #187c72;
  --teal-dark: #0f5e57;
  --blue: #2f86dc;
  --amber: #b87918;
  --red: #a93535;
  --green: #3b8a54;
  --shadow: 0 1px 2px rgba(32, 36, 35, 0.04);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.auth-locking .app-shell {
  display: none;
}

body.auth-locking {
  background: #ffffff;
}

body.auth-ready .auth-gate {
  display: none;
}

body.auth-checking .auth-card h1,
body.auth-checking .auth-card .auth-copy,
body.auth-checking .auth-card .auth-login-button {
  display: none;
}

body.auth-checking .auth-card {
  text-align: center;
}

body.auth-checking .auth-status::before {
  content: "";
  display: block;
  width: 24px;
  height: 24px;
  margin: 2px auto 10px;
  border: 2px solid #cfe2df;
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: auth-spin 0.8s linear infinite;
}

@keyframes auth-spin {
  to { transform: rotate(360deg); }
}

.auth-gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: transparent;
}

.auth-card {
  width: min(520px, 100%);
  background: transparent;
}

.auth-visual {
  display: grid;
  background: transparent;
}

.auth-visual img {
  width: 100%;
  height: auto;
  display: block;
}

.auth-visual strong {
  padding: 18px 0 6px;
  color: var(--teal-dark);
  font-size: 28px;
  line-height: 1.2;
  text-align: center;
}

.auth-content {
  display: grid;
  gap: 12px;
  padding: 24px 28px 28px;
}

.auth-card h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.2;
}

.auth-copy,
.auth-status {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.auth-login-button {
  justify-content: center;
  margin-top: 8px;
}

@media (max-width: 560px) {
  .auth-gate {
    padding: 16px;
  }

  .auth-visual {
    height: auto;
  }

  .auth-visual strong {
    padding: 14px 0 4px;
    font-size: 24px;
  }

  .auth-content {
    padding: 20px;
  }
}

.auth-user {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  margin: -12px 0 20px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.auth-user span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.auth-user strong {
  display: block;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  padding: 24px 16px;
  border-right: 1px solid var(--line);
  background: #faf9f5;
}

.brand {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  align-items: center;
  margin-bottom: 28px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--teal);
  color: white;
  font-weight: 800;
  font-size: 22px;
}

.brand h1,
.topbar h2,
.panel h3 {
  margin: 0;
}

.brand h1 {
  color: #202423;
  font-size: 18px;
  line-height: 1.2;
  font-weight: 800;
}

.brand p,
.panel-header span,
#tableSummary,
#pageLabel {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

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

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

.nav-parent {
  padding: 0 12px 4px;
  color: #0f5e57;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-parent::after {
  content: "⌄";
  color: var(--muted);
  font-size: 12px;
  transition: transform 0.16s ease;
}

.nav-section.is-collapsed > .nav-parent::after {
  transform: rotate(-90deg);
}

.nav-section.is-collapsed > .side-nav {
  display: none !important;
}

.nav-section {
  display: grid;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.nav-section:first-of-type {
  padding-top: 0;
  border-top: 0;
}

.nav-parent.child {
  color: var(--teal-dark);
}

.nav-section .tab {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  column-gap: 10px;
  min-height: 34px;
  padding: 0 12px 0 18px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 8px;
}

.nav-section .tab > span:last-child {
  min-width: 0;
  line-height: 1.25;
  text-align: left;
  word-break: keep-all;
}

.nav-section .tab:hover {
  background: rgba(24, 124, 114, 0.06);
  color: var(--ink);
}

.nav-section .nav-icon {
  width: 22px;
  height: 22px;
}

.meeting-side-nav {
  gap: 8px;
}

.meeting-nav-item {
  width: 100%;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  min-height: 34px;
  column-gap: 10px;
  padding: 0 12px 0 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-align: left;
}

.meeting-nav-item .nav-icon {
  width: 22px;
  height: 22px;
}

.meeting-nav-item > span:last-child {
  min-width: 0;
  line-height: 1.25;
  text-align: left;
  word-break: keep-all;
}

.meeting-nav-item:hover {
  background: rgba(24, 124, 114, 0.06);
  color: var(--ink);
}

.meeting-nav-item.active {
  background: var(--teal);
  color: white;
}

.meeting-nav-item.active .nav-icon {
  background: rgba(255, 255, 255, 0.18);
  color: white;
}

.meeting-nav-item.month-selected {
  background: #e6f1fb;
  color: #185fa5;
}

.meeting-nav-item.month-selected .nav-icon {
  background: rgba(24, 95, 165, 0.08);
  color: #185fa5;
}

.field {
  display: grid;
  gap: 4px;
  margin: 0 0 8px;
}

.field span {
  color: #606965;
  font-size: 12px;
  font-weight: 700;
}

.field input,
.field select {
  width: 100%;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: white;
  color: var(--ink);
  outline: none;
}

.field input:focus,
.field select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(24, 124, 114, 0.12);
}

.primary-button,
.secondary-button,
.pager button,
.tab {
  min-height: 32px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
}

.primary-button {
  border-color: var(--teal);
  background: var(--teal);
  color: white;
  font-weight: 700;
}

.secondary-button {
  color: var(--teal-dark);
  font-weight: 700;
}

.done-action-button {
  min-height: 32px;
  border: 1px solid var(--green);
  border-radius: 8px;
  padding: 0 14px;
  background: var(--green);
  color: white;
  font-weight: 800;
}

.main-panel {
  min-width: 0;
  padding: 24px;
  background: var(--bg);
}

.main-layout {
  min-width: 0;
}

.content-zone {
  min-width: 0;
}

.topbar {
  margin-bottom: 20px;
}

.topbar.is-hidden-title {
  display: none;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--teal);
  font-size: 13px;
  font-weight: 800;
}

.topbar h2 {
  color: #202423;
  font-size: 28px;
  line-height: 1.25;
  font-weight: 800;
}

.tab {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-start;
  padding: 0 12px;
  border-color: transparent;
  color: var(--muted);
  background: transparent;
  font-weight: 800;
  line-height: 1.35;
}

.tab.active {
  background: var(--teal);
  color: white;
}

.nav-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: rgba(24, 124, 114, 0.1);
  color: var(--teal);
  font-size: 14px;
  line-height: 1;
}

.tab.active .nav-icon {
  background: rgba(255, 255, 255, 0.18);
  color: white;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.kpi-card,
.panel,
.flow-column {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.kpi-card {
  min-height: 116px;
  padding: 16px;
  display: grid;
  align-content: space-between;
}

.kpi-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.kpi-card strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
  line-height: 1;
  font-weight: 800;
}

.kpi-card small {
  color: var(--muted);
  font-size: 12px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr);
  gap: 14px;
}

.panel {
  min-width: 0;
  padding: 14px;
}

.panel.wide {
  grid-column: span 1;
}

.panel-header {
  min-height: 32px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #edeae4;
}

.panel h3 {
  color: #202423;
  font-size: 16px;
  line-height: 1.4;
  font-weight: 800;
}

.bar-chart {
  min-height: 260px;
  display: grid;
  grid-auto-rows: minmax(28px, auto);
  gap: 10px;
}

.bar-row {
  display: grid;
  grid-template-columns: 76px 1fr 56px;
  gap: 10px;
  align-items: center;
  font-size: 12px;
}

.bar-track {
  position: relative;
  height: 16px;
  overflow: hidden;
  border-radius: 999px;
  background: #e9eeec;
}

.bar-fill,
.bar-fill-alt {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  min-width: 2px;
  border-radius: inherit;
}

.bar-fill {
  background: var(--blue);
}

.bar-fill-alt {
  background: var(--green);
  opacity: 0.78;
}

.donut-wrap {
  display: grid;
  grid-template-columns: 136px 1fr;
  gap: 18px;
  align-items: center;
}

.donut {
  width: 136px;
  height: 136px;
  border-radius: 50%;
  background: conic-gradient(var(--teal) 0 0, #e9eeec 0 100%);
  position: relative;
}

.donut::after {
  content: "";
  position: absolute;
  inset: 22px;
  border-radius: 50%;
  background: white;
}

.legend,
.rank-list {
  display: grid;
  gap: 10px;
}

.legend-item,
.rank-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  font-size: 12px;
}

.legend-name {
  min-width: 0;
  display: flex;
  gap: 8px;
  align-items: center;
}

.swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex: 0 0 auto;
}

.rank-item {
  grid-template-columns: minmax(90px, 160px) 1fr auto;
}

.rank-bar {
  height: 8px;
  border-radius: 999px;
  background: #e9eeec;
  overflow: hidden;
}

.rank-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
}

.flow-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 14px;
}

.flow-column {
  padding: 14px;
  min-height: 260px;
}

.flow-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.flow-head h3 {
  margin: 0;
  font-size: 15px;
}

.flow-count {
  color: var(--teal);
  font-weight: 800;
}

.flow-card {
  border-top: 1px solid var(--line);
  padding: 10px 0;
}

.flow-card strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.flow-card span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.table-panel {
  padding-bottom: 0;
}

.review-panel {
  padding-bottom: 0;
  overflow: hidden;
  border-color: rgba(0, 0, 0, 0.09);
  background: #fff;
  box-shadow: 0 1px 2px rgba(24, 30, 28, 0.04);
}

/* Keep operational lists visually identical to the embedded review views. */
.system-data-view {
  color: #1a1a18;
  font-size: 13px;
  line-height: 1.5;
}

.system-data-view .panel {
  padding: 16px 20px 0;
  border: 0.5px solid rgba(0, 0, 0, 0.09);
  border-radius: 10px;
  background: #fff;
  box-shadow: none;
}

.system-data-view .panel-header {
  min-height: 0;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.09);
}

.system-data-view .panel h3 {
  color: #1a1a18;
  font-size: 13px;
  line-height: 1.4;
  font-weight: 500;
}

.system-data-view .eyebrow {
  margin-bottom: 4px;
  color: #187c72;
  font-size: 11px;
  font-weight: 600;
}

.system-data-view .panel-header span,
.system-data-view .summary-line,
.system-data-view .empty {
  color: #9e9d99;
  font-size: 11px;
  line-height: 1.5;
}

.system-data-view .review-filters {
  gap: 8px;
  margin-bottom: 12px;
}

.system-data-view .field span {
  color: #6b6a65;
  font-size: 11px;
  font-weight: 500;
}

.system-data-view input,
.system-data-view select,
.system-data-view .table-select {
  border-width: 0.5px;
  border-color: rgba(0, 0, 0, 0.16);
  border-radius: 6px;
  color: #1a1a18;
  font-size: 12px;
}

.system-data-view .table-scroll {
  margin: 0 -20px;
}

.system-data-view table {
  font-size: 11px;
}

.system-data-view th {
  padding: 7px 10px;
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.09);
  background: #f5f4f0;
  color: #6b6a65;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

.system-data-view td {
  padding: 8px 10px;
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.09);
  color: #1a1a18;
  font-size: 11px;
  line-height: 1.45;
}

.system-data-view tbody tr:hover {
  background: #fafaf8;
}

.meeting-frame-panel {
  height: calc(100vh - 132px);
  min-height: 680px;
  overflow: hidden;
  padding: 0;
}

.meeting-iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #f5f4f0;
}

.upload-panel {
  max-width: 980px;
}

.upload-box {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 180px 140px 120px;
  gap: 12px;
  align-items: end;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.upload-mapping {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.upload-mapping strong {
  color: #202423;
  font-size: 14px;
}

.upload-field input {
  padding-top: 7px;
}

.upload-status {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.permission-grid {
  display: grid;
  grid-template-columns: minmax(360px, 0.95fr) minmax(420px, 1.3fr);
  gap: 14px;
  align-items: start;
}

.permission-grid-single {
  grid-template-columns: minmax(0, 1fr);
}

.permission-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
}

.permission-card-title h4,
.module-permission-card h5 {
  margin: 0;
}

.permission-card-title span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.permission-form {
  display: grid;
  gap: 10px;
}

.permission-form .field {
  margin: 0;
}

.permission-tree-field {
  display: grid;
  gap: 6px;
}

.permission-tree-field > span {
  color: #40504c;
  font-size: 12px;
  font-weight: 800;
}

.permission-department-tree {
  position: relative;
}

.permission-department-tree > summary {
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  list-style: none;
}

.permission-department-tree > summary::-webkit-details-marker {
  display: none;
}

.permission-department-tree > summary::after {
  content: "⌄";
  color: var(--muted);
  font-size: 14px;
}

.permission-department-tree[open] > summary {
  border-color: var(--teal);
  box-shadow: 0 0 0 2px rgba(26, 136, 122, 0.12);
}

.permission-tree-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 5px);
  right: 0;
  left: 0;
  display: grid;
  max-height: 330px;
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: 0 14px 30px rgba(27, 46, 42, 0.14);
}

.permission-tree-node {
  min-width: 0;
}

.permission-tree-node-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 3px;
  align-items: center;
}

.permission-tree-toggle,
.permission-tree-toggle-placeholder {
  width: 24px;
  height: 32px;
}

.permission-tree-toggle {
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  transition: transform 0.15s ease, background 0.15s ease;
}

.permission-tree-toggle:hover {
  background: var(--surface-soft);
  color: var(--teal-dark);
}

.permission-tree-toggle.is-expanded {
  transform: rotate(90deg);
}

.permission-tree-choice {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  width: 100%;
  min-height: 34px;
  padding: 5px 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-weight: 700;
  text-align: left;
}

.permission-tree-choice:hover,
.permission-tree-choice.is-selected {
  background: #eaf5f2;
  color: var(--teal-dark);
}

.permission-tree-choice small {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.permission-tree-children {
  margin-left: 12px;
  padding-left: 12px;
  border-left: 1px solid #cfe0dc;
}

.permission-people-picker {
  display: grid;
  gap: 7px;
}

.permission-people-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
  color: #40504c;
  font-size: 12px;
  font-weight: 800;
}

.permission-select-all {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  color: var(--teal-dark);
  cursor: pointer;
}

.permission-select-all input {
  margin: 0;
}

.danger-button {
  color: var(--red);
  border-color: #e5c7c7;
}

.review-edit-status {
  margin: 0 0 10px;
  padding: 8px 10px;
  border-left: 3px solid var(--teal);
  background: #eef6f4;
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 600;
}

.review-edit-row td {
  padding: 6px;
  background: #f7fbfa;
}

.review-edit-input {
  width: 100%;
  min-width: 92px;
  height: 34px;
  padding: 5px 8px;
  border: 1px solid #c9d8d5;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
}

.review-edit-input:focus {
  border-color: var(--teal);
  outline: 2px solid rgba(24, 124, 114, 0.12);
}

.review-row-actions {
  min-width: 112px;
  white-space: nowrap;
}

.review-row-actions button + button {
  margin-left: 4px;
}

.permission-people-list {
  display: grid;
  gap: 5px;
  max-height: 250px;
  overflow: auto;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.permission-person-row {
  display: grid;
  grid-template-columns: 18px minmax(110px, 0.7fr) minmax(150px, 1.3fr);
  gap: 8px;
  align-items: center;
  padding: 6px;
  border-radius: 6px;
}

.permission-person-row:hover {
  background: var(--surface-soft);
}

.permission-person-row > input[type="checkbox"] {
  width: 14px;
  height: 14px;
  margin: 0;
}

.permission-person-row > input[type="text"] {
  width: 100%;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 9px;
  color: var(--ink);
  background: white;
}

.permission-person-row > input:disabled {
  color: var(--muted);
  background: #f2f4f3;
}

.permission-person-name {
  display: grid;
  min-width: 0;
}

.permission-person-name strong,
.permission-person-name small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.permission-person-name small {
  color: var(--muted);
  font-size: 11px;
}

.permission-departments {
  display: grid;
  gap: 8px;
}

.permission-departments > span {
  color: #40504c;
  font-size: 12px;
  font-weight: 800;
}

.permission-departments > div {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 6px;
  max-height: 152px;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.permission-departments label,
.module-permission-card label {
  display: flex;
  min-width: 0;
  gap: 6px;
  align-items: center;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.permission-departments input,
.module-permission-card input {
  width: 13px;
  height: 13px;
  margin: 0;
}

.permission-table-scroll {
  max-height: 520px;
  min-height: 120px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.permission-table {
  width: 100%;
  min-width: 980px;
}

.permission-table td input[type="text"],
.permission-table td select {
  width: 100%;
  min-width: 110px;
  min-height: 30px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--ink);
  font: inherit;
}

.permission-editing-row {
  background: #f6faf9;
}

.permission-inline-departments {
  display: grid;
  grid-template-columns: repeat(2, minmax(100px, 1fr));
  gap: 4px 8px;
  min-width: 240px;
}

.permission-inline-departments label {
  display: flex;
  gap: 5px;
  align-items: center;
  font-size: 12px;
  white-space: nowrap;
}

.permission-actions {
  width: 132px;
  min-width: 132px;
  vertical-align: middle;
  white-space: nowrap;
}

.permission-action-buttons {
  display: flex;
  gap: 6px;
  align-items: center;
}

.permission-table-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
  justify-content: space-between;
  margin-top: 14px;
}

.permission-table-toolbar .field {
  width: min(320px, 100%);
  margin: 0;
}

.permission-table-toolbar > span {
  padding-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.permission-role-tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #edf1f0;
  color: #52605d;
  font-size: 12px;
  font-weight: 800;
}

.permission-role-tag.role-admin {
  background: #dff1ec;
  color: #0f6559;
}

.permission-role-tag.role-supervisor {
  background: #e8e5ff;
  color: #4d3ca6;
}

.permission-role-tag.role-manager {
  background: #e6effa;
  color: #285f94;
}

.permission-role-tag.role-personal {
  background: #f4edd9;
  color: #7a5c15;
}

.permission-role-tag.role-support {
  background: #eeeafe;
  color: #6750b5;
}

.compact-button {
  min-height: 28px;
  padding: 0 10px;
  font-size: 12px;
}

.module-permission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.module-permission-card {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.module-permission-card h5 {
  color: var(--teal-dark);
  font-size: 14px;
}

.module-permission-card > div {
  display: grid;
  gap: 6px;
}

.access-denied-panel {
  max-width: 720px;
  padding: 28px;
}

.access-denied-panel p:last-child {
  margin-bottom: 0;
  color: var(--muted);
}

.responsibility-overview-panel {
  padding-bottom: 16px;
}

.responsibility-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.responsibility-summary article,
.responsibility-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
}

.responsibility-summary article {
  padding: 12px;
}

.responsibility-summary span,
.responsibility-card dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.responsibility-summary strong {
  display: block;
  margin-top: 5px;
  font-size: 20px;
}

.responsibility-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.responsibility-card {
  min-width: 0;
  padding: 14px;
  color: var(--ink);
  text-align: left;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.responsibility-card:hover {
  border-color: rgba(24, 124, 114, 0.5);
  box-shadow: 0 10px 24px rgba(22, 33, 31, 0.08);
  transform: translateY(-1px);
}

.responsibility-card-label {
  display: block;
  color: var(--teal-dark);
  font-size: 14px;
  font-weight: 800;
}

.responsibility-card > strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
  line-height: 1;
}

.responsibility-card-bar {
  height: 8px;
  margin: 12px 0;
  overflow: hidden;
  border-radius: 999px;
  background: #e6eeeb;
}

.responsibility-card-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
}

.responsibility-card dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.responsibility-card dl div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.responsibility-card dd {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
}

.reason-category-list,
.report-analysis-list {
  display: grid;
  gap: 12px;
}

.reason-category-card,
.report-analysis-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
  padding: 14px;
}

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

.reason-category-head h4 {
  margin: 2px 0 0;
  font-size: 16px;
}

.reason-category-head > strong {
  color: var(--ink);
  font-size: 18px;
  white-space: nowrap;
}

.reason-category-rows {
  display: grid;
  gap: 9px;
}

.reason-category-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) minmax(180px, 2fr) 72px;
  gap: 12px;
  align-items: center;
}

.reason-category-row strong {
  display: block;
  font-size: 13px;
}

.reason-category-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.reason-category-row em {
  color: var(--ink);
  font-size: 13px;
  font-style: normal;
  font-weight: 800;
  text-align: right;
}

.reason-category-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6eeeb;
}

.reason-category-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
}

.report-analysis-summary {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.6;
}

.report-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.report-chip-row span {
  border-radius: 999px;
  padding: 3px 8px;
  background: #eaf2ef;
  color: #315a54;
  font-size: 12px;
  font-weight: 800;
}

.report-excerpts {
  display: grid;
  gap: 8px;
}

.report-excerpts blockquote {
  margin: 0;
  border-left: 3px solid var(--teal);
  border-radius: 6px;
  background: white;
  padding: 8px 10px;
}

.report-excerpts strong {
  display: block;
  margin-bottom: 4px;
  color: var(--teal-dark);
  font-size: 12px;
}

.report-excerpts p {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.responsibility-comparison-scroll {
  margin-top: 10px;
}

.responsibility-comparison-table th,
.responsibility-comparison-table td {
  min-width: 104px;
  text-align: right;
  white-space: nowrap;
}

.responsibility-comparison-table th:first-child,
.responsibility-comparison-table td:first-child,
.responsibility-comparison-table .comparison-label {
  text-align: left;
}

.responsibility-comparison-table thead th:nth-child(2) {
  text-align: left;
}

.responsibility-comparison-table tbody th {
  position: sticky;
  left: 0;
  z-index: 1;
  background: #f7faf9;
  color: var(--teal-dark);
  text-align: left;
  vertical-align: top;
}

.comparison-after-row,
.comparison-after-percent-row {
  background: #fbf7f0;
}

.comparison-before-row,
.comparison-before-percent-row {
  background: #f8fbfb;
}

.comparison-fine-after-row {
  background: #fffaf2;
}

.comparison-fine-before-row {
  background: #f6fbf9;
}

.comparison-delta-row {
  background: #fff;
  font-weight: 800;
}

.responsibility-comparison-table .comparison-percent {
  color: #17406f;
  font-style: italic;
  font-weight: 800;
}

.responsibility-comparison-table .is-up {
  color: #bd4b4b;
}

.responsibility-comparison-table .is-down {
  color: #187c72;
}

.responsibility-comparison-table .comparison-percent.is-up,
.responsibility-comparison-table .comparison-percent.is-down {
  color: #17406f;
}

.rule-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: -4px 0 10px;
}

.rule-strip span {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  border-radius: 999px;
  padding: 0 9px;
  background: #eeece7;
  color: #5f625f;
  font-size: 12px;
  font-weight: 700;
}

.review-filters {
  display: grid;
  grid-template-columns: 106px minmax(112px, 0.8fr) minmax(112px, 0.8fr) minmax(112px, 0.8fr) 100px 108px minmax(138px, 1.1fr);
  gap: 7px;
  align-items: end;
  margin: 0 0 8px;
  padding: 2px 0 10px;
  border-bottom: 1px solid #edeae4;
}

.review-filters .field {
  margin: 0;
}

.review-filters .field span {
  font-size: 11px;
}

.review-filters .field input,
.review-filters .field select {
  height: 28px;
  border-radius: 7px;
  padding: 0 8px;
  background: white;
  color: #202423;
  font-size: 12px;
}

.period-dropdown {
  position: relative;
  min-width: 0;
}

.period-dropdown summary {
  width: 100%;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 8px;
  background: white;
  color: var(--ink);
  font-size: 12px;
  list-style: none;
  cursor: pointer;
}

.period-dropdown summary::-webkit-details-marker {
  display: none;
}

.period-dropdown summary::after {
  content: "⌄";
  color: #40504c;
  font-size: 14px;
}

.period-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 10;
  min-width: 160px;
  max-height: 220px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px;
  background: white;
  box-shadow: var(--shadow);
}

.period-menu label {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  padding: 0 6px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
}

.period-menu label:hover {
  background: var(--surface-soft);
}

.period-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  padding: 6px 2px 0;
  background: white;
}

.period-apply {
  min-height: 26px;
  padding: 0 10px;
  font-size: 12px;
}

.review-filters .period-menu input {
  width: 13px;
  height: 13px;
  margin: 0;
  padding: 0;
}

.responsibility-overview-filters {
  grid-template-columns: 124px minmax(132px, 1fr) minmax(132px, 1fr) minmax(132px, 1fr) minmax(164px, 1.4fr);
  margin-bottom: 10px;
}

.table-header {
  align-items: center;
}

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

.batch-action-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid #d8e5df;
  border-radius: 10px;
  background: #f5faf8;
}

.batch-select-page {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.batch-select-page input,
.batch-select-column input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--teal-dark);
  cursor: pointer;
}

.batch-select-page input:disabled,
.batch-select-column input:disabled {
  cursor: not-allowed;
}

.batch-row-choice {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin: 2px 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.batch-row-choice:has(input:not(:disabled)) {
  color: var(--teal-dark);
  cursor: pointer;
}

.batch-selection-summary {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.batch-complete-button {
  min-width: 136px;
  min-height: 34px;
  padding: 0 14px;
}

.batch-action-status {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
}

.batch-action-status.is-success {
  color: #23613a;
  font-weight: 800;
}

.batch-action-status.is-error {
  color: #9b2f33;
  font-weight: 800;
}

.batch-action-status.is-working {
  color: var(--teal-dark);
  font-weight: 800;
}

.export-excel-button {
  min-width: 88px;
  padding: 0 12px;
  white-space: nowrap;
}

.pager {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pager button {
  width: 32px;
  font-size: 22px;
  line-height: 1;
}

.table-scroll {
  overflow: auto;
  margin: 0 -14px;
  border-top: 0;
}

.review-scroll {
  max-height: calc(100vh - 292px);
  min-height: 260px;
}

table {
  width: 100%;
  min-width: 1060px;
  border-collapse: collapse;
}

.review-table {
  width: max-content;
}

th,
td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  font-size: 12.5px;
  line-height: 1.45;
  color: #303432;
}

.review-table th,
.review-table td {
  max-width: 190px;
  overflow-wrap: anywhere;
}

.review-table .batch-select-column {
  position: sticky;
  left: 0;
  z-index: 2;
  width: 112px;
  min-width: 112px;
  max-width: 112px;
  padding-right: 6px;
  padding-left: 6px;
  background: white;
  text-align: center;
}

.review-table th.batch-select-column {
  z-index: 3;
  background: #f7f6f2;
}

.review-table tr.is-selected,
.review-table tr.is-selected .batch-select-column {
  background: #eaf6f1;
}

.review-table th.adjusted-ratio-cell,
.review-table td.adjusted-ratio-cell {
  color: #174a7c;
  font-weight: 700;
}

.table-select {
  width: 100%;
  min-width: 120px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 8px;
  background: white;
  color: var(--ink);
  font-size: 13px;
}

.table-select.has-reason-color,
.readonly-value.has-reason-color {
  border-color: var(--reason-border);
  background: var(--reason-bg);
  color: var(--reason-ink);
  font-weight: 800;
}

.table-select option {
  background: var(--reason-bg, white);
  color: var(--reason-ink, var(--ink));
}

.reason-detail-select {
  min-width: 100%;
  height: 34px;
  font-size: 13px;
}

.readonly-value {
  min-height: 34px;
  display: flex;
  align-items: center;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f7f6f2;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.sku-link {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--teal-dark);
  font: inherit;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.sku-link-with-status {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.review-confirmed-badge {
  display: inline-flex;
  align-items: center;
  min-height: 21px;
  padding: 0 7px;
  border-radius: 999px;
  background: #dcefe7;
  color: #176b57;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.review-status {
  display: inline-flex;
  min-width: 34px;
  min-height: 22px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0 8px;
  font-weight: 800;
}

.review-status.yes {
  color: #9b2f33;
  background: #fde6e6;
}

.review-status.no {
  color: #23613a;
  background: #e5f3e9;
}

.review-status-select.yes {
  color: #9b2f33;
  border-color: #f4caca;
  background: #fde6e6;
  font-weight: 800;
}

.review-status-select.no {
  color: #23613a;
  border-color: #cbe7d3;
  background: #e5f3e9;
  font-weight: 800;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f7f6f2;
  color: #5f625f;
  font-size: 12.5px;
  font-weight: 800;
}

tbody tr {
  cursor: pointer;
}

tbody tr:hover {
  background: #faf9f5;
}

.product-cell {
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  max-width: 160px;
  padding: 0 8px;
  border-radius: 999px;
  color: #4d5652;
  background: #eeece7;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.badge.warning {
  color: #764d09;
  background: #fff1d6;
}

.badge.danger {
  color: #873236;
  background: #fde6e6;
}

.badge.done {
  color: #23613a;
  background: #e5f3e9;
}

.badge.neutral {
  color: #4d5a57;
  background: #ecefed;
}

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

.sku-detail-actions {
  display: grid;
  grid-template-columns: repeat(3, max-content);
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.sku-detail-actions .done-action-button {
  grid-column: 2;
  justify-self: stretch;
}

.sku-detail-actions .done-action-button + .done-action-button {
  grid-column: 2;
}

.sku-detail-save-status {
  grid-column: 1 / -1;
  max-width: 420px;
  justify-self: end;
  color: #60706c;
  font-size: 12px;
  line-height: 1.45;
  text-align: right;
}

.sku-detail-save-status.working {
  color: #7a6500;
}

.sku-detail-save-status.error {
  color: #b42318;
  font-weight: 600;
}

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

.sku-metric,
.reason-card,
.sku-editor,
.sku-responsibility,
.sku-report {
  border: 1px solid rgba(0, 0, 0, 0.09);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(24, 30, 28, 0.03);
}

.sku-metric {
  min-width: 0;
  padding: 10px;
}

.sku-metric span,
.reason-meta span,
.sku-section-title span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.sku-metric strong {
  display: block;
  margin-top: 5px;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.sku-metric-field select {
  width: 100%;
  min-width: 0;
  height: 30px;
  margin-top: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 9px;
  background: white;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.sku-metric-field select:focus {
  outline: 2px solid rgba(25, 132, 119, 0.18);
  border-color: var(--green);
}

.sku-editor,
.sku-responsibility,
.sku-report {
  padding: 14px;
}

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

.sku-section-title h4 {
  margin: 0;
  font-size: 14px;
}

.reason-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}

.reason-card {
  padding: 10px;
}

.reason-card .field {
  margin: 0 0 8px;
}

.reason-meta strong {
  display: block;
  margin-top: 5px;
  font-size: 13px;
}

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

.responsibility-row {
  display: grid;
  grid-template-columns: 82px 1fr 96px;
  gap: 10px;
  align-items: center;
  font-size: 12px;
}

.responsibility-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e9eeec;
}

.responsibility-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
}

.responsibility-input-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px;
  align-items: center;
}

.responsibility-input-wrap input {
  width: 100%;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 6px;
  background: white;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  text-align: right;
}

.responsibility-input-wrap span {
  color: var(--muted);
  font-weight: 800;
}

.responsibility-readonly-value {
  min-width: 72px;
  text-align: right;
  font-size: 13px;
}

.responsibility-total {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  font-weight: 800;
}

.responsibility-total span {
  color: var(--muted);
}

.responsibility-total strong {
  color: var(--ink);
}

.responsibility-total em {
  font-style: normal;
  border-radius: 999px;
  padding: 2px 8px;
}

.responsibility-total.valid em {
  color: #16764e;
  background: #e3f4e9;
}

.responsibility-total.invalid strong,
.responsibility-total.invalid em {
  color: #bd3f3f;
}

.responsibility-total.invalid em {
  background: #fde4e4;
}

.reason-report-grid {
  display: grid;
  grid-template-columns: minmax(180px, 280px) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.reason-report-grid .field {
  margin: 0;
}

.reason-report-grid select {
  width: 100%;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: white;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  outline: none;
}

.reason-report-grid select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(24, 124, 114, 0.12);
}

.reason-report-extra-list {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.reason-report-row {
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.report-add-block {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.report-add-block button {
  display: block;
  min-height: 30px;
  margin-top: 8px;
  margin-left: auto;
  padding: 0 18px;
  white-space: nowrap;
}

.responsibility-add-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) 120px auto;
  gap: 8px;
  align-items: center;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.responsibility-add-row input,
.responsibility-add-row select {
  width: 100%;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 8px;
  background: white;
  color: var(--ink);
  font-size: 12px;
  outline: none;
}

.responsibility-add-row input:focus,
.responsibility-add-row select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(24, 124, 114, 0.12);
}

.responsibility-add-row label {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px;
  align-items: center;
}

.responsibility-add-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.responsibility-add-row button {
  min-height: 30px;
  padding: 0 10px;
  white-space: nowrap;
}

.report-responsibility-add-row {
  grid-template-columns: minmax(180px, 280px) auto;
  margin-top: 10px;
}

.report-textarea {
  width: 100%;
  min-height: 92px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: white;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  line-height: 1.5;
  outline: none;
}

.report-textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(24, 124, 114, 0.12);
}

.report-readonly {
  min-height: 92px;
  align-items: flex-start;
  white-space: pre-wrap;
}

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

.audit-log-column {
  position: sticky;
  right: 0;
  z-index: 2;
  width: 112px;
  min-width: 112px;
  text-align: center;
  background: #fff;
  box-shadow: -1px 0 0 var(--line);
}

thead .audit-log-column {
  z-index: 3;
  background: #f7f6f2;
}

.audit-log-button {
  min-width: 84px;
  padding: 7px 10px;
  white-space: nowrap;
}

.audit-log-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(20, 31, 29, 0.42);
}

.audit-log-overlay[hidden] {
  display: none;
}

.audit-log-dialog {
  width: min(680px, 100%);
  max-height: min(720px, calc(100vh - 48px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(20, 31, 29, 0.22);
}

.audit-log-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--line);
}

.audit-log-header h3 {
  margin: 2px 0 4px;
  font-size: 20px;
}

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

.audit-log-close {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.audit-log-content {
  max-height: min(610px, calc(100vh - 160px));
  overflow-y: auto;
  padding: 8px 22px 22px;
}

.audit-log-list {
  display: grid;
}

.audit-log-item {
  display: grid;
  grid-template-columns: 160px 110px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}

.audit-log-item time,
.audit-log-item strong,
.audit-log-item p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
}

.audit-log-item time {
  color: var(--muted);
}

.audit-log-item p {
  color: var(--ink);
}

.audit-log-empty,
.audit-log-warning {
  margin: 0;
  padding: 24px 0;
  color: var(--muted);
  font-size: 13px;
}

.audit-log-warning {
  color: #a23b36;
}

body.audit-log-open {
  overflow: hidden;
}

.dingtalk-todo-dialog {
  /* 三类推送弹层共用(#9 加宽):宽屏最宽约 1100px,窄屏占满、不溢出 */
  width: min(1100px, 100%);
  max-width: 100%;
}

.dingtalk-todo-month {
  max-width: 280px;
  margin: 14px 0 6px;
}

.dingtalk-todo-summary,
.dingtalk-todo-line {
  margin: 12px 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.6;
}

.dingtalk-todo-table-wrap {
  max-width: 100%;
  overflow-x: auto;
}

.dingtalk-todo-table {
  width: 100%;
}

/* 各列不折行、不截断;放不下时表格在弹层里横向滚动 */
.dingtalk-todo-table th,
.dingtalk-todo-table td {
  max-width: none;
  overflow-wrap: normal;
  white-space: nowrap;
}

.dingtalk-todo-table tr.is-blocked td {
  color: var(--muted);
  background: #f4f5f4;
}

.dingtalk-todo-departments {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  margin: 6px 0 10px;
  font-size: 13px;
}

.dingtalk-todo-departments-label {
  color: var(--muted);
}

.dingtalk-todo-department {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  cursor: pointer;
}

.dingtalk-todo-departments-clear {
  min-height: 26px;
  padding: 2px 10px;
  font-size: 12px;
}

.dingtalk-todo-table th:first-child,
.dingtalk-todo-table td:first-child {
  width: 1%;
  white-space: nowrap;
}

.dingtalk-todo-select-all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: inherit;
  cursor: pointer;
}

.dingtalk-todo-hint {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.dingtalk-todo-subtitle {
  margin: 18px 0 6px;
  font-size: 14px;
}

.dingtalk-todo-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.dingtalk-todo-list.is-failed {
  color: #a23b36;
}

.dingtalk-todo-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 18px;
}

.dingtalk-todo-actions .audit-log-warning {
  padding: 0;
}

.dingtalk-todo-due {
  /* 最晚完成日期(#10):两个推送按钮上方,选填 */
  margin-top: 18px;
}

.dingtalk-todo-due .field {
  max-width: 280px;
}

.dingtalk-todo-due-date {
  color: #d4380d;
}

.department-leader-segment-title {
  margin-top: 22px;
}

.department-leader-editor {
  display: grid;
  gap: 12px;
}

.department-leader-chosen {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.department-leader-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 4px 2px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
}

.department-leader-chip button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}

.department-leader-picker {
  max-width: 520px;
}

@media (max-width: 1120px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    padding: 14px 16px;
  }

  .brand {
    margin-bottom: 0;
  }

  .nav-group {
    min-width: 320px;
  }

  .side-nav {
    display: flex;
  }

  .nav-section .side-nav {
    display: flex;
  }

  .tab {
    justify-content: center;
    min-width: 96px;
  }

  .main-layout {
    grid-template-columns: 1fr;
  }

  .table-header,
  .table-actions {
    align-items: flex-start;
  }

  .table-actions {
    flex-wrap: wrap;
  }

  .field {
    margin: 0;
  }

  .kpi-grid,
  .dashboard-grid,
  .flow-board,
  .upload-box,
  .sku-summary,
  .reason-grid,
  .reason-category-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .review-filters {
    grid-template-columns: repeat(3, minmax(120px, 1fr));
  }
}

.support-adjustment-filters {
  display: grid;
  grid-template-columns: minmax(150px, 0.7fr) minmax(180px, 0.9fr) minmax(220px, 1.4fr);
  gap: 12px;
  margin-bottom: 14px;
}

.support-adjustment-guidance {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  padding: 10px 14px;
  border: 1px solid #e7c878;
  border-radius: 8px;
  background: #fff8df;
  color: #76540c;
  font-size: 13px;
}

.support-adjustment-guidance strong {
  flex: 0 0 auto;
  padding-right: 10px;
  border-right: 1px solid #dfc272;
}

.support-adjustment-filters label,
.support-report-month label,
.support-report-card > label {
  display: grid;
  gap: 6px;
  color: #5f625f;
  font-size: 12px;
  font-weight: 600;
}

.support-adjustment-filters input,
.support-adjustment-filters select,
.support-report-month select,
.support-report-card textarea,
.support-adjustment-table textarea,
.support-adjustment-table input {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.support-adjustment-filters input,
.support-adjustment-filters select,
.support-report-month select {
  min-height: 36px;
  padding: 0 10px;
}

.support-adjustment-scroll {
  overflow: auto;
  max-height: calc(100vh - 250px);
  border: 1px solid #ece9e2;
  border-radius: 8px;
}

.support-adjustment-table {
  width: 100%;
  min-width: 1900px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
}

.support-adjustment-table th,
.support-adjustment-table td {
  padding: 9px 8px;
  border-bottom: 1px solid #ece9e2;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

.support-adjustment-table th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #f6f5f1;
  color: #555955;
  font-weight: 700;
}

.support-adjustment-table th:nth-child(1),
.support-adjustment-table td:nth-child(1) {
  position: sticky;
  left: 0;
  width: 90px;
  min-width: 90px;
}

.support-adjustment-table th:nth-child(2),
.support-adjustment-table td:nth-child(2) {
  position: sticky;
  left: 90px;
  width: 110px;
  min-width: 110px;
}

.support-adjustment-table th:nth-child(3),
.support-adjustment-table td:nth-child(3) {
  position: sticky;
  left: 200px;
  width: 130px;
  min-width: 130px;
}

.support-adjustment-table th:nth-child(4),
.support-adjustment-table td:nth-child(4) {
  position: sticky;
  left: 330px;
  z-index: 2;
  width: 190px;
  min-width: 190px;
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  background: #fff;
  box-shadow: 1px 0 0 #dedbd4;
}

.support-adjustment-table th:nth-child(-n+4) {
  z-index: 5;
  background: #f6f5f1;
}

.support-adjustment-table td:nth-child(-n+3) {
  z-index: 2;
  background: #fff;
}

.support-adjustment-table textarea {
  width: 200px;
  min-height: 54px;
  padding: 7px 8px;
  resize: vertical;
  white-space: normal;
}

.ratio-cell {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.ratio-cell input {
  width: 72px;
  min-height: 32px;
  padding: 0 6px;
  text-align: right;
  -moz-appearance: textfield;
  appearance: textfield;
}

.ratio-cell input::-webkit-outer-spin-button,
.ratio-cell input::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.ratio-cell.has-value input,
.ratio-cell.has-value span {
  color: #1f2321;
  font-weight: 800;
}

.ratio-cell.is-adjusted input,
.ratio-cell.is-adjusted span {
  color: #c43434;
  font-weight: 800;
}

.ratio-value {
  display: inline-block;
  min-width: 72px;
  text-align: right;
  color: #7b7f7b;
}

.ratio-value.has-value {
  color: #1f2321;
  font-weight: 800;
}

.ratio-value.is-adjusted {
  color: #c43434;
  font-weight: 800;
}

.support-ratio-display {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.support-ratio-delta {
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.support-ratio-delta.increase {
  color: #c43434;
}

.support-ratio-delta.decrease {
  color: #2f8a4c;
}

.support-responsibility-amount {
  color: #303432;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.support-belonging-reason {
  width: 225px;
  min-width: 225px;
  max-width: 225px;
  white-space: normal !important;
}

.support-belonging-reason span {
  display: block;
  line-height: 1.45;
}

.support-history-cell {
  width: 230px;
  min-width: 230px;
  white-space: normal !important;
}

.support-history-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.support-history-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  border: 1px solid #cfd6ff;
  border-radius: 4px;
  padding: 3px 6px;
  background: #f7f8ff;
  color: #4d56b3;
  font-size: 11px;
  white-space: nowrap;
}

.support-history-chip b {
  font-weight: 800;
}

.support-adjustment-reason-readonly {
  width: 200px;
  min-height: 36px;
  padding: 7px 2px;
  white-space: pre-wrap;
  line-height: 1.5;
}

.support-adjustment-action-cell {
  min-width: 178px;
  white-space: normal;
}

.support-no-change-button {
  margin-left: 6px;
}

.support-row-notice {
  display: block;
  margin-top: 5px;
  max-width: 210px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.support-row-notice.success {
  color: #287243;
}

.support-row-notice.error {
  color: #b52c2c;
}

.support-department-tag,
.support-adjusted-status,
.support-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 3px 9px;
  font-weight: 700;
}

.support-department-tag {
  background: #e8f4f2;
  color: var(--teal-dark);
}

.support-check.valid {
  background: #e8f5eb;
  color: #287243;
}

.support-check.invalid {
  background: #c53a3a;
  color: #fff;
}

.support-adjusted-status {
  background: #efefec;
  color: #777a76;
}

.support-adjusted-status.adjusted,
.support-adjusted-status.no-change {
  background: #fff0d8;
  color: #9a5d08;
}

.support-report-month {
  display: flex;
  margin-bottom: 14px;
}

.support-report-notice {
  margin-bottom: 14px;
  border: 1px solid #d9e3df;
  border-radius: 8px;
  padding: 10px 12px;
  background: #f4f8f6;
  color: #45605a;
  font-size: 13px;
  font-weight: 700;
}

.support-report-notice.success {
  border-color: #b9ddc5;
  background: #e9f6ed;
  color: #23683a;
}

.support-report-notice.error {
  border-color: #efc5c5;
  background: #fff0f0;
  color: #a32f2f;
}

.support-report-month label {
  min-width: 220px;
}

.support-report-list {
  display: grid;
  gap: 14px;
  padding-bottom: 16px;
}

.support-report-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #e8e5de;
  border-radius: 9px;
  background: #fbfaf7;
}

.support-report-card-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
}

.support-report-meta {
  display: grid;
  grid-template-columns: auto minmax(110px, 1fr) auto minmax(110px, 1fr) auto minmax(90px, 0.6fr);
  gap: 8px 12px;
  align-items: center;
}

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

.support-report-meta strong {
  color: #303432;
  font-size: 13px;
}

.support-report-card textarea {
  width: 100%;
  min-height: 78px;
  padding: 10px 12px;
  line-height: 1.6;
  resize: vertical;
}

.support-report-card textarea.is-readonly {
  border-color: transparent;
  outline: none;
  box-shadow: none;
  background: transparent;
  resize: none;
  cursor: default;
}

.support-report-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.support-report-actions small {
  color: var(--muted);
}

.support-report-actions .primary-button {
  min-width: 90px;
  padding: 0 18px;
}

.task-check-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0 12px;
}

.task-check-toolbar label {
  display: grid;
  gap: 6px;
  min-width: 240px;
  color: #696b68;
  font-size: 12px;
  font-weight: 700;
}

.task-check-toolbar select {
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid #dedbd4;
  border-radius: 8px;
  background: #fff;
  font: inherit;
  color: #242725;
}

.task-check-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.task-check-summary span,
.task-check-note {
  border-radius: 999px;
  background: #f1f5f2;
  color: #63706a;
  font-size: 12px;
}

.task-check-summary span {
  padding: 7px 11px;
}

.task-check-summary b {
  color: #117569;
}

.task-check-note {
  display: inline-block;
  margin-bottom: 12px;
  padding: 6px 10px;
}

.task-check-scroll {
  max-height: calc(100vh - 275px);
}

.task-check-table {
  min-width: 1680px;
  font-size: 12px;
}

.task-check-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f6f5f1;
}

.task-check-table td {
  vertical-align: top;
}

.task-check-table th:nth-child(3),
.task-check-table td:nth-child(3) {
  min-width: 125px;
}

.task-check-table th:nth-child(4),
.task-check-table td:nth-child(4) {
  min-width: 200px;
  white-space: normal;
}

.task-check-table th:nth-child(8),
.task-check-table td:nth-child(8) {
  min-width: 310px;
  white-space: normal;
}

.task-check-table th:nth-child(9),
.task-check-table td:nth-child(9),
.task-check-table th:nth-child(10),
.task-check-table td:nth-child(10) {
  min-width: 230px;
  white-space: normal;
}

.task-check-difference-tags,
.task-check-ratio-diffs,
.task-check-reason-diff {
  display: grid;
  gap: 5px;
}

.task-check-difference-tags span {
  width: max-content;
  padding: 3px 7px;
  border-radius: 999px;
  background: #fff0e8;
  color: #a34624;
  font-weight: 700;
}

.task-check-reason-diff > div {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 6px;
}

.task-check-reason-diff > div > span {
  display: grid;
  gap: 3px;
}

.task-check-reason-diff span {
  line-height: 1.45;
}

.task-check-reason-diff em {
  display: inline-block;
  margin-right: 6px;
  padding: 1px 5px;
  border-radius: 4px;
  background: #f0efeb;
  color: #6d6e69;
  font-style: normal;
  font-size: 11px;
}

.task-check-reason-diff > div:last-child em {
  background: #e5f4ef;
  color: #147365;
}

.task-check-reason-item {
  width: fit-content;
  border-radius: 4px;
  padding: 2px 5px;
}

.task-check-reason-item.is-removed {
  background: #fff0ed;
  color: #b0442c;
}

.task-check-reason-item.is-added {
  background: #e8f6f1;
  color: #087568;
}

.task-check-reason-item.is-shared {
  padding-left: 0;
  color: #4f5350;
}

.task-check-reason-empty {
  color: #aaa8a2;
}

.task-check-ratio-diffs span {
  line-height: 1.45;
}

.task-check-ratio-diffs b {
  display: inline-block;
  min-width: 38px;
  margin-right: 4px;
  color: #343735;
}

.task-check-ratio-diffs i {
  color: #9b9d99;
  font-style: normal;
}

.task-check-same {
  color: #aaa8a2;
}

@media (max-width: 720px) {
  .task-check-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .task-check-toolbar label {
    min-width: 0;
  }

  .support-adjustment-filters,
  .support-report-meta {
    grid-template-columns: 1fr;
  }

  .support-report-card-header {
    grid-template-columns: 1fr;
  }

  .support-report-month,
  .support-report-month label {
    width: 100%;
  }

  .main-panel,
  .sidebar {
    padding: 16px;
  }

  .sidebar,
  .review-filters,
  .kpi-grid,
  .dashboard-grid,
  .flow-board,
  .upload-box,
  .sku-summary,
  .reason-grid,
  .reason-report-grid,
  .reason-category-row {
    grid-template-columns: 1fr;
  }

  .table-actions {
    grid-column: 1 / -1;
  }

  .table-header {
    align-items: stretch;
  }

  .table-actions {
    justify-content: space-between;
  }

  .batch-action-bar {
    align-items: stretch;
  }

  .batch-action-status {
    width: 100%;
    margin-left: 0;
  }

  .sidebar {
    display: grid;
    align-items: stretch;
  }

  .side-nav {
    min-width: 0;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .nav-group {
    min-width: 0;
  }

  .tab {
    min-width: 0;
    justify-content: center;
    padding: 0 8px;
  }

  .nav-icon {
    display: none;
  }

  .donut-wrap {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .audit-log-overlay {
    padding: 12px;
  }

  .audit-log-item {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}
