:root {
  --bg: #f6f7f8;
  --panel: #ffffff;
  --line: #dfe4e8;
  --text: #1e252b;
  --muted: #66727d;
  --brand: #b42318;
  --brand-dark: #861b13;
  --brand-soft: #fff0ed;
  --red: #b42318;
  --amber: #b96b00;
  --green: #12805c;
  --blue: #1f6feb;
  --ink: #29333d;
  --shadow: 0 18px 60px rgba(24, 33, 42, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(246, 247, 248, 0.94)),
    radial-gradient(circle at 12% 8%, rgba(180, 35, 24, 0.12), transparent 34%),
    var(--bg);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.app {
  min-height: 100vh;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 520px) 1fr;
  background: #111820;
}

.login-art {
  padding: 56px;
  color: #fff;
  background:
    linear-gradient(160deg, rgba(180, 35, 24, 0.88), rgba(22, 28, 34, 0.98)),
    url("data:image/svg+xml,%3Csvg width='900' height='900' viewBox='0 0 900 900' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.18' stroke-width='2'%3E%3Cpath d='M198 617C320 383 470 252 705 165'/%3E%3Cpath d='M150 504c185-31 331-12 478 82'/%3E%3Cpath d='M290 716c51-173 170-315 358-427'/%3E%3C/g%3E%3Cpath d='M551 229c-102 50-169 116-204 206-58-41-124-55-200-42 69 36 120 84 151 144-41 30-80 69-117 119 99-27 178-28 238-3 45 19 78 55 99 107 8-80-3-143-33-189 94-63 158-177 192-342-46 34-88 54-126 60z' fill='%23fff' fill-opacity='.16'/%3E%3C/svg%3E");
  background-size: cover;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 54px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: #050505;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.brand-title {
  font-size: 28px;
  font-weight: 800;
}

.login-art h1 {
  margin: 0 0 18px;
  font-size: 42px;
  line-height: 1.12;
}

.login-art p {
  margin: 0;
  max-width: 420px;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.8;
}

.login-panel {
  display: grid;
  place-items: center;
  padding: 42px;
  background: var(--bg);
}

.login-box {
  width: min(420px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.login-box h2 {
  margin: 0 0 20px;
  font-size: 22px;
}

.login-link-button {
  width: 100%;
  margin-top: 10px;
}

.login-password-dialog {
  max-width: 560px;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

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

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 10px;
  color: var(--text);
  background: #fff;
}

.field input.required-error,
.field select.required-error,
.field textarea.required-error,
.publish-field input.required-error,
.publish-field select.required-error,
.publish-field textarea.required-error,
.publish-title-input.required-error {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(162, 27, 19, 0.12);
}

.required-error-wrap > span {
  color: var(--brand);
}

.field textarea {
  min-height: 94px;
  resize: vertical;
}

.remember-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0 18px;
  color: var(--muted);
  font-size: 13px;
}

.remember-row label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.primary,
.ghost,
.danger,
.warning,
.success,
.small-btn {
  flex: 0 0 auto;
  min-height: 38px;
  border-radius: 6px;
  padding: 0 14px;
  font-weight: 700;
  white-space: nowrap;
}

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

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

.ghost {
  color: var(--ink);
  background: #eef1f4;
}

.danger {
  color: #fff;
  background: #a61b1b;
}

.warning {
  color: #7c4f00;
  background: #fff0bf;
}

.warning:hover:not(:disabled) {
  background: #ffd86b;
}

.success {
  color: #fff;
  background: var(--green);
}

.audit-complete-button {
  color: #fff;
  background: var(--blue);
}

.audit-complete-button:hover:not(:disabled) {
  background: #1558c7;
}

button:disabled {
  cursor: not-allowed;
  color: #7b858f;
  background: #d8dee4;
  opacity: 1;
}

.small-btn {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
  color: var(--ink);
  background: #eef1f4;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
}

.notice-button {
  position: relative;
  min-height: 38px;
  border-radius: 6px;
  padding: 0 14px;
  color: var(--ink);
  background: #eef1f4;
  font-weight: 800;
}

.notice-count {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  padding: 0 6px;
  color: #fff;
  background: var(--brand);
  font-size: 12px;
}

.notice-panel {
  position: absolute;
  top: 58px;
  right: 20px;
  width: min(420px, calc(100vw - 28px));
  max-height: min(520px, calc(100vh - 90px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

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

.notice-panel-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.memo-dialog {
  margin: auto;
  width: min(760px, calc(100vw - 32px));
  max-height: min(760px, calc(100vh - 48px));
  overflow: auto;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.memo-compose {
  display: grid;
  grid-template-columns: 1fr auto 210px auto auto;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.memo-compose textarea {
  min-height: 42px;
  resize: vertical;
}

.memo-list,
.memo-history {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.memo-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.memo-row p {
  margin: 6px 0;
  color: var(--ink);
  line-height: 1.5;
}

.notice-list {
  max-height: 460px;
  overflow: auto;
}

.notice-item {
  position: relative;
  padding: 12px 14px;
  padding-right: 44px;
  border-bottom: 1px solid #edf0f2;
  background: #fff8f6;
}

.notice-delete {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 24px;
  height: 24px;
  min-height: 24px;
  padding: 0;
  border-radius: 999px;
  color: #7b8794;
  background: #eef1f4;
  font-size: 16px;
  line-height: 1;
}

.notice-delete:hover {
  color: #fff;
  background: var(--brand);
}

.notice-item.read {
  background: #fff;
}

.notice-item b {
  display: block;
  margin-bottom: 5px;
}

.notice-item p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.top-left,
.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
}

.layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  min-height: calc(100vh - 65px);
}

.sidebar {
  padding: 18px 14px;
  border-right: 1px solid var(--line);
  background: #fff;
  max-height: calc(100vh - 65px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.nav-title {
  margin: 18px 10px 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.platform-nav-title {
  width: 100%;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  padding: 0 12px;
  border-radius: 6px;
  color: var(--brand);
  background: transparent;
  font-size: 18px;
  font-weight: 900;
}

.platform-nav-title span:last-child {
  color: var(--ink);
  font-size: 12px;
  font-weight: 400;
}

.my-task-nav-title {
  margin-top: 12px;
}

.platform-nav-list {
  margin-bottom: 12px;
}

.platform-nav-list.collapsed {
  display: none;
}

.nav-btn {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  padding: 0 12px;
  border-radius: 6px;
  color: var(--brand);
  background: transparent;
  font-size: 16px;
  font-weight: 900;
  text-align: left;
}

.platform-nav-btn {
  min-height: 34px;
  padding-left: 18px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 400;
}

.platform-nav-btn.active {
  color: var(--ink);
  background: #f2f5f7;
}

.nav-btn.active {
  color: var(--brand);
  background: #fdf1ef;
  font-weight: 900;
}

.nav-btn.platform-nav-btn,
.nav-btn.platform-nav-btn.active {
  color: var(--ink);
  font-size: 13px;
  font-weight: 400;
}

.nav-btn.platform-nav-btn.active {
  background: #f2f5f7;
}

.badge {
  min-width: 24px;
  height: 22px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  padding: 0 8px;
  color: var(--muted);
  background: #eef1f4;
  font-size: 12px;
}

.badge.flash {
  color: #fff;
  background: #b91c1c;
  animation: badge-flash 0.9s ease-in-out infinite;
}

@keyframes badge-flash {
  0%, 100% { box-shadow: 0 0 0 0 rgba(185, 28, 28, 0.35); }
  50% { box-shadow: 0 0 0 6px rgba(185, 28, 28, 0); }
}

.content {
  min-width: 0;
  padding: 22px;
}

.toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.toolbar h1 {
  margin: 0 0 6px;
  font-size: 26px;
}

.toolbar p {
  margin: 0;
  color: var(--muted);
}

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

.filters select,
.filters input {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  background: #fff;
}

.daily-search-row {
  flex-basis: 100%;
  display: flex;
  gap: 8px;
}

.daily-search-row input {
  min-width: 260px;
  flex: 1;
}

.gantt-delete-btn {
  width: 100%;
  margin-top: 4px;
}

.publish-toolbar {
  align-items: end;
}

.date-range-wrap {
  position: relative;
}

.date-range-wrap > input {
  min-width: 210px;
  cursor: pointer;
}

.date-range-panel {
  position: absolute;
  top: 44px;
  left: 0;
  z-index: 12;
  width: 260px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.date-tabs {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.date-tab {
  position: relative;
}

.date-popup {
  position: absolute;
  top: 36px;
  left: 0;
  z-index: 14;
  display: none;
  min-width: 230px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.date-popup.open {
  display: block;
}

.date-popup input {
  width: 100%;
}

.small-btn.active-date {
  color: #fff;
  background: var(--brand);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.workflow-metrics {
  grid-template-columns: repeat(4, minmax(150px, 1fr));
}

.metric {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-align: left;
}

.metric b {
  display: block;
  margin-top: 8px;
  font-size: 28px;
}

.metric-button {
  cursor: pointer;
}

.metric-button:hover {
  border-color: rgba(162, 27, 19, 0.28);
  background: #fff8f6;
}

.board {
  display: grid;
  grid-template-columns: minmax(320px, 430px) minmax(0, 1fr);
  gap: 16px;
}

.task-list,
.detail-panel,
.admin-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.list-head,
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.list-head > div:first-child,
.panel-head > div:first-child {
  min-width: 0;
}

.list-head > .action-row,
.panel-head > .action-row,
.panel-head > .compact-actions,
.panel-head .compact-actions {
  flex: 0 0 auto;
}

.task-list-body {
  max-height: calc(100vh - 260px);
  overflow: auto;
}

.expense-board {
  grid-template-columns: minmax(280px, .62fr) minmax(0, 1.38fr);
}

.expense-horizontal-board {
  grid-template-columns: 1fr;
}

.expense-horizontal-board .expense-list .task-list-body {
  max-height: 360px;
}

.expense-finance-hub {
  display: grid;
  grid-template-columns: minmax(420px, 1.2fr) minmax(320px, .8fr);
  gap: 12px;
  margin-bottom: 18px;
}

.expense-mini-metrics {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 0;
}

.expense-batch-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.muted-panel {
  display: grid;
  align-items: center;
  min-height: 140px;
}

.expense-batch-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.expense-batch-list {
  display: grid;
  gap: 8px;
  max-height: 210px;
  margin-top: 12px;
  overflow: auto;
}

.expense-batch-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafbfc;
}

.expense-batch-row small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.compact-empty {
  padding: 18px;
}

.expense-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(260px, 1fr));
  gap: 10px;
  padding: 12px;
}

.expense-card {
  position: relative;
  min-height: 132px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(15, 23, 42, .04);
}

.expense-card.active {
  border-color: rgba(162, 27, 19, .28);
  background: #fff8f6;
}

.expense-card.done {
  background: #f7fbf8;
}

.expense-card-main {
  width: 100%;
  height: 100%;
  padding: 14px 68px 14px 40px;
  background: transparent;
  text-align: left;
}

.expense-card:not(:has(.expense-card-check)) .expense-card-main {
  padding-left: 12px;
}

.expense-card-check {
  position: absolute;
  top: 16px;
  left: 12px;
  z-index: 1;
}

.compact-actions {
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
  margin: 0;
  white-space: nowrap;
  overflow-x: auto;
  max-width: 100%;
}

.expense-delete-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  color: var(--muted);
  background: #eef1f4;
  font-size: 16px;
  line-height: 1;
}

.expense-add-btn {
  position: absolute;
  top: 8px;
  right: 38px;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  color: #fff;
  background: var(--green);
  font-size: 17px;
  line-height: 1;
}

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

.expense-delete-btn:hover {
  color: #fff;
  background: var(--brand);
}

.task-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 12px;
  width: 100%;
  padding: 13px 14px;
  border-bottom: 1px solid #edf0f2;
  background: #fff;
  text-align: left;
}

.task-row-shell {
  position: relative;
  grid-template-columns: minmax(0, 1fr) 28px 28px;
  align-items: start;
}

.task-row-shell[draggable="true"] {
  cursor: grab;
}

.task-row-shell.dragging {
  opacity: .6;
}

.task-row-shell.drag-over {
  outline: 2px solid rgba(192, 31, 24, .35);
  outline-offset: -2px;
}

.task-row-main {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 12px;
  width: 100%;
  min-height: 36px;
  padding: 0;
  background: transparent;
  text-align: left;
}

.archive-row-shell {
  grid-template-columns: minmax(0, 1fr) 28px;
  align-items: start;
}

.archive-row-main {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 12px;
  width: 100%;
  min-height: 36px;
  padding: 0;
  background: transparent;
  text-align: left;
}

.task-row-icon {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  color: var(--muted);
  background: #eef1f4;
  font-size: 16px;
  line-height: 1;
}

.task-row-icon:hover {
  color: #fff;
  background: var(--brand);
}

.task-add-btn:hover {
  background: var(--green);
}

.archive-delete-btn {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  color: var(--muted);
  background: #eef1f4;
  font-size: 16px;
  line-height: 1;
}

.archive-delete-btn:hover {
  color: #fff;
  background: var(--brand);
}

.archive-score {
  border-radius: 999px;
  padding: 2px 8px;
  color: #087443;
  background: #ddf5ea;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.task-row-shell.selected-row {
  background: #fff8f6;
}

.task-row-shell.selected-row {
  border-left: 3px solid var(--brand);
  background: #fff4f1;
}

.task-row-shell.selected-row .task-row-main {
  background: transparent;
}

.step-dot {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: #eef1f4;
  font-size: 12px;
  font-weight: 800;
}

.task-row.done .step-dot {
  color: #fff;
  background: #2563eb;
}

.done-dot {
  color: #fff;
  background: #2563eb;
}

.step-dot.has-tasks {
  color: #fff;
  background: var(--brand);
}

.task-row.done .step-dot.has-tasks {
  color: #fff;
  background: var(--brand);
}

.step-dot.no-tasks {
  color: #fff;
  background: var(--green);
}

.task-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-weight: 800;
}

.task-meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  padding: 0 8px;
  font-size: 12px;
  white-space: nowrap;
}

.status.pending {
  color: #59636e;
  background: #eef1f4;
}

.status.active {
  color: #087443;
  background: #ddf5ea;
}

.status.done {
  color: #1d4ed8;
  background: #dbeafe;
}

.detail-body,
.admin-body {
  padding: 16px;
}

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

.compact-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

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

.expense-detail-grid .field input,
.expense-detail-grid .field select,
.expense-detail-grid .field textarea {
  min-height: 34px;
  padding: 7px 9px;
}

.expense-detail-grid .field textarea {
  min-height: 54px;
}

.expense-detail-grid .drop-zone {
  min-height: 44px;
  padding: 8px;
}

.expense-detail-grid .attachments {
  margin-top: 6px;
}

.expense-file-field {
  grid-column: span 2;
}

.expense-two-pane {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.expense-pane {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.expense-pane .section-title-row {
  margin-bottom: 12px;
}

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

.expense-publish-panel {
  display: grid;
  gap: 12px;
}

.expense-publish-card {
  box-shadow: none;
}

.expense-publish-card .publish-draft-body {
  grid-template-columns: minmax(170px, 0.62fr) minmax(220px, 0.95fr) 240px;
  align-items: stretch;
}

.expense-publish-card .publish-info-section,
.expense-publish-card .expense-upload-grid,
.expense-publish-card .publish-work-section {
  grid-column: auto;
}

.expense-publish-card .publish-work-section {
  grid-template-columns: 1fr;
}

.expense-publish-card .publish-content-cell {
  grid-column: 1;
}

.expense-note-field {
  grid-column: 1 / -1;
}

.expense-note-field textarea {
  min-height: 66px;
}

.expense-publish-card .drop-zone {
  min-height: 62px;
  padding: 10px;
}

.expense-publish-card .expense-publish-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.expense-upload-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  overflow: hidden;
}

.expense-upload-column {
  min-width: 0;
}

.expense-publish-actions {
  grid-row: 1;
  grid-column: 1;
  width: 100%;
  border-left: 0;
  padding-left: 0;
  justify-items: stretch;
  gap: 10px;
}

.expense-publish-actions .publish-row-submit {
  min-height: 42px;
  font-size: 14px;
  font-weight: 800;
}

.expense-table-panel {
  overflow: auto;
}

.expense-query-table {
  min-width: 820px;
}

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

.section-title-row,
.subtask-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.task-detail-title-row {
  margin-bottom: 12px;
}

.small-inline {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

.subtask-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.publish-table-wrap {
  overflow-x: auto;
  padding-bottom: 4px;
}

.publish-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

.publish-table th,
.publish-table td {
  vertical-align: top;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 8px;
  background: #fff;
}

.publish-table th {
  position: sticky;
  top: 0;
  z-index: 4;
  color: var(--muted);
  background: #f7f8fa;
  font-weight: 900;
  white-space: nowrap;
}

.publish-table th:first-child,
.publish-table td:first-child {
  border-left: 1px solid var(--line);
}

.publish-table thead th {
  border-top: 1px solid var(--line);
}

.publish-table th:first-child {
  border-top-left-radius: 8px;
}

.publish-table th:last-child {
  border-top-right-radius: 8px;
}

.publish-table input,
.publish-table select,
.publish-table textarea {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 8px;
  background: #fff;
}

.publish-table input[type="checkbox"],
.publish-batch-tools input[type="checkbox"] {
  width: 14px;
  height: 14px;
  min-height: 14px;
  padding: 0;
}

.publish-table textarea {
  min-height: 88px;
  resize: vertical;
}

.publish-action-cell {
  width: 124px;
  min-width: 124px;
}

.publish-action-cell .subtask-head-actions {
  margin: 6px 0;
}

.publish-table td:nth-child(2) {
  width: 180px;
  min-width: 180px;
}

.publish-image-cell {
  width: 150px;
  min-width: 150px;
}

.publish-image-paste-zone {
  width: 100%;
  aspect-ratio: 1;
  height: auto;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 8px;
  border: 1px dashed #b7c0c9;
  border-radius: 6px;
  color: var(--muted);
  background: #f8fafb;
  font-size: 12px;
  text-align: center;
  cursor: text;
  overflow: hidden;
}

.publish-image-paste-zone.has-images {
  place-items: stretch;
  align-content: start;
  padding: 0;
}

.publish-image-zone-hint {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
}

.publish-image-paste-zone:focus {
  border-color: var(--brand);
  outline: 2px solid rgba(192, 31, 24, .12);
  background: #fff8f6;
}

.publish-image-paste-zone.image-upload-card {
  max-width: 180px;
  min-height: 180px;
  margin: 0 auto;
  border-color: #ef4444;
  background: #fff7f5;
  color: #667085;
  line-height: 1.5;
}

.publish-image-paste-zone.image-upload-card.has-images {
  background: #fff;
  border-color: #d7dde5;
}

.publish-table td:nth-child(4) {
  width: 135px;
  min-width: 135px;
}

.publish-table td:nth-child(5) {
  width: 125px;
  min-width: 125px;
}

.publish-table td:nth-child(6),
.publish-table td:nth-child(8) {
  width: 170px;
  min-width: 170px;
}

.publish-table td:nth-child(7) {
  width: 82px;
  min-width: 82px;
}

.publish-table td:nth-child(9) {
  width: 110px;
  min-width: 110px;
}

.publish-members-cell {
  width: 175px;
  min-width: 175px;
}

.publish-content-cell {
  width: 300px;
  min-width: 300px;
}

.publish-image-list {
  display: grid;
  gap: 8px;
  max-height: 190px;
  overflow-y: auto;
}

.publish-card-check {
  align-items: center;
}

.new-task-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #b91c1c;
  box-shadow: 0 0 0 3px rgba(185, 28, 28, 0.12);
  display: inline-block;
  margin-left: 6px;
  flex: 0 0 auto;
}

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

.publish-draft-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff 0%, #fbfcfd 100%);
  box-shadow: 0 8px 22px rgba(15, 23, 42, .05);
  overflow: visible;
}

.publish-draft-card[draggable="true"] {
  cursor: grab;
}

.publish-draft-card.dragging {
  opacity: .65;
}

.publish-draft-card.drag-over {
  outline: 2px solid rgba(192, 31, 24, .32);
  outline-offset: -2px;
}

.publish-draft-head {
  display: grid;
  grid-template-columns: 96px minmax(180px, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.publish-title-input {
  width: 100%;
}

.publish-draft-body {
  display: grid;
  grid-template-columns: minmax(140px, 190px) minmax(190px, 0.86fr) minmax(240px, 1fr);
  gap: 10px;
  align-items: stretch;
  padding: 10px 12px;
}

.publish-row-submit {
  width: 100%;
}

.publish-card-section {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  padding: 9px;
  border: 1px solid #edf0f3;
  border-radius: 8px;
  background: #fff;
}

.publish-section-title {
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.publish-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.publish-field {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.publish-field input,
.publish-field select,
.publish-field textarea,
.publish-title-input {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 8px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
}

.publish-draft-card input[type="checkbox"],
.publish-batch-tools input[type="checkbox"] {
  width: 14px;
  height: 14px;
  min-height: 14px;
  padding: 0;
}

.publish-draft-card .subtask-head-actions {
  display: flex;
  gap: 6px;
}

.publish-draft-card .person-picker summary {
  min-height: 34px;
}

.publish-draft-card .content-upload-box textarea {
  min-height: 72px;
}

.publish-draft-card .publish-image-cell {
  align-content: stretch;
  width: auto;
  min-width: 0;
}

.publish-draft-card .publish-members-cell {
  width: auto;
  min-width: 0;
}

.publish-draft-card .publish-work-section {
  grid-template-columns: minmax(0, 1fr) 240px;
  align-items: stretch;
  overflow: hidden;
}

.publish-draft-card .publish-content-cell {
  width: auto;
  min-width: 0;
}

.publish-side-actions {
  grid-column: 2;
  grid-row: 1 / span 2;
  display: grid;
  align-content: start;
  justify-items: stretch;
  gap: 8px;
  width: 240px;
  padding-left: 10px;
  border-left: 1px solid var(--line);
  min-width: 0;
}

.publish-side-actions select,
.publish-side-actions input {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 8px;
  background: #fff;
}

.publish-side-actions label {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.publish-side-actions label > span {
  color: var(--muted);
  font-size: 12px;
}

.task-audit-card .publish-draft-body {
  grid-template-columns: minmax(120px, 145px) minmax(300px, .9fr) minmax(430px, 1.2fr);
  align-items: start;
  gap: 8px;
}

.task-audit-card .task-audit-actions {
  width: 205px;
  gap: 7px;
  padding-left: 8px;
}

.task-audit-card .publish-card-section {
  align-self: start;
  padding: 8px;
}

.task-audit-card .publish-work-section {
  grid-template-columns: minmax(0, 1fr) 205px;
}

.task-audit-card .content-upload-box textarea {
  min-height: 54px;
}

.task-audit-actions .publish-row-submit,
.my-task-side-actions .publish-row-submit {
  min-height: 42px;
  font-size: 14px;
  font-weight: 800;
}

.audit-owner-picker.required-error {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(162, 27, 19, .12);
}

.audit-owner-dropdown {
  position: absolute;
  z-index: 40;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  box-shadow: var(--shadow);
}

.audit-owner-dropdown > input {
  width: calc(100% - 16px);
  margin: 8px;
}

.audit-owner-list {
  display: grid;
  max-height: 210px;
  overflow-y: auto;
  padding: 0 8px 8px;
}

.audit-owner-list button {
  min-height: 34px;
  padding: 0 10px;
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.audit-owner-list button:hover {
  color: var(--brand);
  background: #fff4f2;
}

.publish-hidden-line {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.publish-hidden-note {
  margin-top: -6px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
}

.publish-draft-card .publish-image-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: minmax(0, 1fr);
  gap: 8px;
  height: 100%;
  min-height: 0;
  max-height: none;
  overflow: hidden;
}

.publish-draft-card .publish-image-list.single-image {
  grid-template-columns: 1fr;
}

.publish-draft-card .publish-image-list:not(.single-image) .publish-image-card {
  aspect-ratio: auto;
  height: 100%;
  min-height: 0;
}

.my-task-panel {
  width: 100%;
}

.my-task-card {
  cursor: default;
}

.my-task-card .publish-draft-head {
  grid-template-columns: 96px minmax(0, 1fr) auto auto auto;
  align-items: center;
  overflow-x: auto;
}

.my-task-card .publish-draft-head .publish-title-input {
  min-width: 0;
}

.my-task-card .publish-draft-head .linked-product-badge {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.my-task-card .publish-image-paste-zone {
  pointer-events: auto;
}

.my-task-card.required-error-wrap {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(162, 27, 19, 0.12);
}

.static-members {
  min-height: 34px;
  align-content: start;
}

@media (max-width: 1280px) {
  .publish-draft-body {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .publish-work-section {
    grid-column: 1 / -1;
  }

  .publish-draft-card .publish-work-section {
    grid-template-columns: minmax(0, 1fr) 230px;
  }

  .task-audit-card .publish-draft-body {
    grid-template-columns: minmax(150px, .7fr) minmax(260px, 1.3fr);
  }

  .task-audit-card .publish-work-section {
    grid-template-columns: minmax(0, 1fr) 205px;
  }

  .task-audit-card .task-audit-actions {
    width: 205px;
  }

  .publish-side-actions {
    width: 230px;
  }

  .expense-publish-card .publish-draft-body {
    grid-template-columns: minmax(170px, .75fr) minmax(240px, 1.25fr) 230px;
  }
}

.publish-batch-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.publish-batch-tools select,
.publish-batch-tools input {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 8px;
  background: #fff;
}

.publish-avoid-sunday {
  white-space: nowrap;
  min-height: 34px;
}

.product-panel .detail-body {
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-gutter: stable;
}

.product-form-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 16px;
}

.product-image-box {
  position: relative;
  min-height: 260px;
  display: grid;
  place-items: center;
  border: 1px dashed #b8c2cc;
  border-radius: 8px;
  color: var(--muted);
  background: #fbfcfd;
  text-align: center;
  overflow: hidden;
}

.image-delete-corner {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 2;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 999px;
  background: #b91c1c;
  color: #fff;
  font-weight: 900;
  cursor: pointer;
}

.image-delete-corner.tiny {
  right: 4px;
  bottom: 4px;
  width: 20px;
  height: 20px;
  font-size: 12px;
}

.product-image-box.small {
  min-height: 120px;
}

.product-image-box img,
.product-task-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.product-task-card img.product-thumb-preview {
  display: none;
}

.product-task-card .product-thumb-wrap.preview-open img.product-thumb-preview {
  display: block;
}

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

.product-full {
  grid-column: 1 / -1;
}

.product-full textarea {
  min-height: 110px;
}

.product-thumb {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.product-thumb-wrap {
  position: relative;
  display: inline-block;
}

.product-table-image-zone {
  position: relative;
  display: grid;
  place-items: center;
  width: 74px;
  min-height: 74px;
  border: 1px dashed #d7dde3;
  border-radius: 6px;
  background: #fbfcfd;
}

.product-thumb-preview {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 40;
  width: min(520px, 70vw);
  height: min(520px, 70vh);
  display: none;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  transform: translate(-50%, -50%);
  padding: 10px;
  pointer-events: none;
}

.product-thumb-wrap.preview-open .product-thumb-preview {
  display: block;
}

.green-check {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  color: #fff;
  background: var(--green);
  font-weight: 900;
}

.green-check input {
  position: absolute;
  opacity: 0;
}

.product-table th,
.product-table td {
  vertical-align: middle;
  border: 1px solid #d7dde3;
  height: 58px;
  padding: 8px 6px;
  background: #fff;
}

.product-table {
  width: max-content;
  min-width: 100%;
  table-layout: fixed;
}

.product-table .arrival-col {
  width: 92px;
  white-space: normal;
}

.table-check-box {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
}

.product-select-head,
.product-select-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.product-drag-handle {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 5px;
  color: var(--muted);
  background: #eef1f4;
  font-weight: 900;
  cursor: grab;
  user-select: none;
}

.product-drag-handle:active {
  cursor: grabbing;
}

.product-table th {
  position: relative;
  background: #f2f5f7;
  text-align: center;
  white-space: nowrap;
}

.product-table input:not([type="checkbox"]),
.product-table select,
.craft-cell-btn {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  height: 38px;
  min-height: 38px;
  margin: 0;
  border: 1px solid #d7dde3;
  border-radius: 4px;
  background: #fff;
  padding: 7px 8px;
  line-height: 22px;
  vertical-align: middle;
}

.product-table th:nth-child(7),
.product-table td:nth-child(7) {
  width: 72px;
  min-width: 72px;
  max-width: 72px;
}

.product-table th:nth-child(6),
.product-table td:nth-child(6) {
  width: 220px;
  min-width: 220px;
}

.product-table th:nth-child(13),
.product-table td:nth-child(13) {
  width: 140px;
  min-width: 140px;
}

.product-table th:nth-child(14),
.product-table td:nth-child(14) {
  width: 92px;
  min-width: 92px;
}

.product-table th:nth-child(16),
.product-table td:nth-child(16) {
  width: 72px;
  min-width: 72px;
}

.product-table input:not([type="checkbox"]):hover,
.product-table select:hover,
.craft-cell-btn:hover {
  border-color: #9aa8b5;
}

.product-table input:not([type="checkbox"]):focus,
.product-table select:focus,
.craft-cell-btn:focus {
  border-color: var(--blue);
  outline: none;
  background: #fff;
}

.craft-cell-btn {
  text-align: left;
  color: var(--ink);
  cursor: pointer;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.product-column-resizer {
  position: absolute;
  top: 0;
  right: -4px;
  z-index: 8;
  width: 8px;
  height: 100%;
  cursor: col-resize;
  touch-action: none;
}

.product-column-resizer:hover,
.resizing-product-column .product-column-resizer {
  background: rgba(191, 38, 29, 0.22);
}

.resizing-product-column {
  cursor: col-resize;
  user-select: none;
}

.product-binary-select.is-complete {
  color: #087443;
  border-color: #8bcdb0;
  background: #e6f7ef;
}

.product-note-input {
  min-width: 180px;
}

.product-note-rich-btn {
  min-width: 180px;
}

.product-edit-actions {
  display: flex;
  min-width: 0;
  justify-content: center;
  align-items: center;
  gap: 6px;
}

.product-log-dialog {
  width: min(1320px, calc(100vw - 40px));
  max-height: calc(100vh - 50px);
}

.product-log-table-wrap {
  max-height: 620px;
  margin: 14px 0;
  overflow: auto;
  border: 1px solid var(--line);
}

.product-log-table {
  min-width: 1120px;
}

.product-log-table th {
  position: sticky;
  z-index: 2;
  top: 0;
  background: #eef1f3;
}

.product-log-detail {
  min-width: 260px;
  max-width: 420px;
  white-space: normal;
  line-height: 1.5;
}

.product-edit-dialog {
  width: min(1120px, calc(100vw - 40px));
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}

.product-edit-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 18px;
  margin: 16px 0;
}

.product-edit-image-wrap {
  display: grid;
  align-content: start;
  gap: 8px;
}

.product-edit-image-zone {
  width: 100%;
  aspect-ratio: 1 / 1;
  min-height: 0;
}

.product-edit-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
  gap: 12px;
}

.product-edit-fields .field input,
.product-edit-fields .field select,
.product-edit-fields .field textarea {
  width: 100%;
}

.product-edit-full {
  grid-column: 1 / -1;
}

.product-edit-full textarea,
.product-edit-full .rich-editor {
  min-height: 90px;
}

.product-edit-check {
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f7f8f9;
}

@media (max-width: 900px) {
  .product-edit-layout {
    grid-template-columns: 1fr;
  }

  .product-edit-image-wrap {
    max-width: 260px;
  }

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

.operation-log-dialog {
  width: min(820px, calc(100vw - 40px));
  max-height: calc(100vh - 50px);
}

.operation-log-list {
  display: grid;
  gap: 8px;
  max-height: 620px;
  margin: 14px 0;
  overflow-y: auto;
}

.operation-log-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.operation-log-row > div {
  display: grid;
  gap: 3px;
}

.operation-log-row strong {
  color: var(--ink);
}

.operation-log-row span,
.operation-log-row small {
  color: var(--muted);
}

.operation-log-row p {
  margin: 0;
}

.operation-log-row.undone {
  opacity: 0.65;
  background: #f5f6f7;
}

.operation-log-row .operation-log-actions {
  display: flex;
  grid-auto-flow: initial;
  align-items: center;
  gap: 6px;
}

.product-craft-dialog {
  width: min(820px, calc(100vw - 40px));
  max-height: min(720px, calc(100vh - 50px));
  margin: auto;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.product-craft-body {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.rich-toolbar {
  display: flex;
  gap: 8px;
}

.rich-toolbar button {
  width: 34px;
  height: 32px;
  border-radius: 6px;
  background: #eef1f4;
  color: var(--ink);
  font-weight: 900;
}

.rich-editor {
  min-height: 360px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  overflow: auto;
  line-height: 1.7;
}

.product-task-grid,
.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
}

.product-task-card,
.shop-card {
  position: relative;
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.product-task-card {
  grid-template-columns: 118px minmax(0, 1fr);
  align-items: start;
}

.product-task-card > .check-line,
.product-task-card > strong,
.product-task-card > .status-pill {
  grid-column: 1 / -1;
}

.product-task-identity {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  grid-column: 1 / -1;
  gap: 8px;
  min-width: 0;
  align-items: center;
}

.product-task-identity label {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  grid-column: 1 / -1;
  align-items: center;
  gap: 4px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
}

.product-task-identity input {
  width: 100%;
  min-height: 34px;
  min-width: 0;
}

.product-knowledge-panel .panel-head {
  align-items: center;
}

.product-knowledge-search {
  min-width: 260px;
  min-height: 34px;
}

.product-query-search {
  min-width: 260px;
  min-height: 34px;
}

.product-knowledge-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}

.product-knowledge-sections {
  display: grid;
  gap: 14px;
}

.product-knowledge-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.product-knowledge-tabs button.active,
.product-knowledge-panel .product-knowledge-tabs button.secondary.active,
.product-knowledge-panel .product-knowledge-tabs button.active,
.staff-evaluation-filters button.secondary.active,
.staff-evaluation-filters button.active,
.staff-evaluation-panel .staff-evaluation-filters button.secondary.active {
  border-color: var(--red);
  background: var(--red) !important;
  color: #fff !important;
}

.product-knowledge-section {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.product-knowledge-table-wrap {
  overflow-x: auto;
}

.product-knowledge-table {
  min-width: 840px;
  table-layout: fixed;
}

.product-knowledge-table th,
.product-knowledge-table td {
  vertical-align: top;
}

.product-knowledge-table select,
.product-knowledge-table input,
.product-knowledge-table textarea {
  width: 100%;
  min-width: 0;
}

.product-knowledge-table input[type="checkbox"] {
  width: 14px;
  min-width: 14px;
  height: 14px;
  min-height: 14px;
}

.product-knowledge-table textarea {
  min-height: 76px;
  resize: vertical;
  line-height: 1.5;
}

.knowledge-rich-editor {
  width: 100%;
  min-height: 76px;
  border: 1px solid var(--line);
  border-radius: 0 0 5px 5px;
  background: #fff;
  padding: 8px 10px;
  line-height: 1.5;
  overflow: auto;
}

.knowledge-rich-editor:empty::before {
  content: attr(placeholder);
  color: var(--muted);
}

.knowledge-compact-rich-btn {
  width: 100%;
  min-height: 32px;
  max-height: 32px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  padding: 0 9px;
  text-align: left;
  color: var(--text);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.knowledge-compact-rich-btn:hover {
  border-color: var(--red);
  background: #fff7f6;
}

.knowledge-dialog-field {
  display: grid;
  gap: 6px;
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.knowledge-dialog-field .knowledge-rich-editor {
  min-height: 120px;
  color: var(--text);
  font-weight: 500;
}

.inline-rich-box {
  display: grid;
  width: 100%;
}

.mini-rich-toolbar {
  min-height: 28px;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 5px 5px 0 0;
  background: #f8fafc;
  padding: 3px 5px;
}

.mini-rich-toolbar button {
  min-width: 24px;
  min-height: 22px;
  padding: 0 6px;
  border-radius: 4px;
}

.knowledge-scope-col {
  width: 100px;
}

.knowledge-category-col {
  width: 140px;
}

.knowledge-select-col,
.knowledge-select-cell {
  width: 42px;
  text-align: center;
}

.knowledge-shop-col {
  width: 190px;
}

.knowledge-stage-col {
  width: 110px;
}

.knowledge-product-col {
  width: 220px;
}

.knowledge-question-col {
  width: 260px;
}

.knowledge-answer-col {
  width: 360px;
}

.knowledge-action-col {
  width: 150px;
}

.knowledge-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.knowledge-child-row td {
  background: #fbfcfd;
}

.knowledge-drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  min-height: 28px;
  color: var(--muted);
  cursor: grab;
  user-select: none;
}

.knowledge-child-row:active .knowledge-drag-handle {
  cursor: grabbing;
}

.knowledge-child-label {
  color: var(--muted);
  text-align: center;
  font-weight: 700;
}

.knowledge-column-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24px;
  align-items: center;
  gap: 6px;
}

.product-knowledge-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.product-knowledge-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  gap: 8px;
  align-items: center;
}

.product-knowledge-title {
  min-width: 0;
  font-weight: 800;
}

.product-knowledge-card .compact-line {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  margin: 0;
}

.product-knowledge-content {
  min-height: 160px;
  resize: vertical;
  line-height: 1.6;
}

.product-task-image-zone {
  position: relative;
  display: grid;
  place-items: center;
  grid-column: 1 / -1;
  width: 100%;
  aspect-ratio: 1 / 1;
  min-height: 0;
  border: 1px dashed #d7dde3;
  border-radius: 6px;
  background: #fbfcfd;
  color: var(--muted);
  text-align: center;
  overflow: hidden;
  font-size: 12px;
}

.product-task-card .compact-line {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  grid-column: 1 / -1;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.product-task-card .compact-line select,
.product-task-card .compact-line input {
  width: 100%;
  min-height: 34px;
}

.product-task-card .compact-line span {
  margin: 0;
}

.product-task-block .section-title-row {
  display: grid;
  grid-template-columns: 160px 130px 160px 160px minmax(280px, 1fr);
  align-items: start;
  gap: 10px;
  min-width: 0;
}

.product-block-name-field {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.product-block-name-field small {
  color: var(--muted);
  font-weight: 500;
}

.product-block-setting {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.product-block-setting select {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 0 8px;
}

.product-task-block .section-title-row > .action-row {
  justify-self: start;
  align-self: start;
  margin-top: 22px;
}

@media (max-width: 1000px) {
  .product-task-block .section-title-row {
    grid-template-columns: 150px 120px 150px 150px minmax(260px, 1fr);
  }

  .product-task-block .section-title-row > .action-row {
    justify-self: start;
  }
}

.product-task-corner-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  gap: 5px;
  z-index: 2;
}

.product-locate-button {
  min-height: 28px;
  padding: 0 8px;
}

.product-task-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
}

.product-task-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  grid-column: 1 / -1;
  margin-top: 2px;
}

.product-task-content-button {
  margin-left: auto;
  min-height: 28px;
  padding: 0 9px;
}

.product-task-content-dialog {
  width: min(720px, calc(100vw - 40px));
}

.product-task-content-box {
  max-height: 420px;
  overflow: auto;
  padding: 14px 0 4px;
}

.product-task-content-box textarea {
  width: 100%;
  min-height: 160px;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafbfc;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.7;
  resize: vertical;
}

.product-task-history-dialog {
  width: min(1080px, calc(100vw - 48px));
}

@keyframes product-location-flash {
  0%, 100% { background: #fff; box-shadow: inset 0 0 0 1px transparent; }
  50% { background: #fff0ee; box-shadow: inset 0 0 0 2px #c4251a; }
}

.product-table tr.product-location-highlight > td {
  animation: product-location-flash 0.9s ease-in-out infinite;
}

.product-task-board {
  display: grid;
  gap: 14px;
}

.product-task-block {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow-x: auto;
}

.product-block-name {
  max-width: 260px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  font-weight: 800;
}

.linked-product-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--brand);
  background: var(--brand-soft);
  font-size: 12px;
  font-weight: 800;
}

.product-task-card img {
  height: 160px;
  border-radius: 6px;
  background: #f7f8fa;
}

.product-task-image-zone img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 0;
}

.product-task-image-zone .product-thumb-wrap {
  display: block;
  width: 100%;
  height: 100%;
}

.product-task-image-zone.suppress-preview .product-thumb-preview {
  display: none;
}

.product-task-image-zone .product-thumb-preview {
  width: min(520px, 70vw);
  height: min(520px, 70vh);
  border-radius: 8px;
}

.shop-event-table input,
.shop-event-table select,
.shop-event-table textarea {
  width: 100%;
  min-height: 32px;
}

.shop-event-table input[type="checkbox"] {
  width: 14px;
  min-width: 14px;
  height: 14px;
  min-height: 14px;
}

.shop-overview-table {
  min-width: 980px;
}

.shop-overview-table th:first-child,
.shop-overview-table td:first-child {
  width: 60px;
  text-align: center;
}

.shop-overview-table th:last-child,
.shop-overview-table td:last-child {
  width: 88px;
  text-align: center;
}

.shop-overview-table input {
  width: 100%;
  min-width: 130px;
  height: 36px;
  border: 1px solid #d7dde3;
  border-radius: 5px;
  background: #fff;
  padding: 0 9px;
}

.shop-event-filters {
  margin-bottom: 0;
}

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

.shop-event-head-tools .shop-event-filters {
  justify-content: flex-end;
}

.event-status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.event-pending {
  color: #475569;
  background: #e2e8f0;
}

.event-active {
  color: #047857;
  background: #d1fae5;
}

.event-done {
  color: #1d4ed8;
  background: #dbeafe;
}

.shop-event-table textarea {
  min-width: 180px;
  min-height: 54px;
  resize: vertical;
}

.shop-event-dialog {
  width: min(760px, 92vw);
}

.modal-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 18px;
}

.shop-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.publish-batch-picker {
  min-width: 150px;
}

.publish-batch-picker .check-grid {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 20;
  width: 260px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.subtask-card {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafbfc;
}

.subtask-card[draggable="true"] {
  cursor: grab;
}

.subtask-card.dragging {
  opacity: .6;
}

.subtask-card.drag-over {
  outline: 2px solid rgba(192, 31, 24, .36);
  outline-offset: -2px;
}

.subtask-card.running-status {
  border-color: rgba(36, 124, 86, 0.28);
  background: #f7fbf8;
}

.subtask-card.warning-status {
  border-color: rgba(178, 118, 0, 0.32);
  background: #fffaf0;
}

.subtask-card.overdue-status {
  border-color: rgba(162, 27, 19, 0.35);
  background: #fff8f6;
}

.subtask-card.done {
  border-color: rgba(36, 124, 86, 0.28);
  background: #f7fbf8;
}

.subtask-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto auto;
  align-items: start;
  margin-bottom: 8px;
}

.priority-chip {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.priority-chip.normal {
  color: #087443;
  background: #ddf5ea;
}

.priority-chip.important {
  color: #7c4f00;
  background: #fff0bf;
}

.priority-chip.urgent {
  color: var(--brand);
  background: #fde2df;
}

.priority-select.priority-normal {
  color: #087443;
  background: #f7fbf8;
}

.priority-select.priority-important {
  color: #7c4f00;
  background: #fffaf0;
}

.priority-select.priority-urgent {
  color: var(--brand);
  background: #fff8f6;
}

.subtask-status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.subtask-submit-state {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 10px;
  color: #087443;
  background: #ddf5ea;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.subtask-submit-state.returned {
  color: #7c4f00;
  background: #fff0bf;
}

.subtask-submit-state.scheduled {
  color: #59636e;
  background: #eef1f4;
}

.subtask-status.running-status {
  color: #087443;
  background: #ddf5ea;
}

.subtask-status.warning-status {
  color: #7c4f00;
  background: #fff0bf;
}

.subtask-status.overdue-status {
  color: var(--brand);
  background: #fde2df;
}

.subtask-status.done-status {
  color: #1d4ed8;
  background: #dbeafe;
}

.subtask-status.completed-overdue-status {
  color: #9a3412;
  background: #ffedd5;
}

.subtask-card .field {
  gap: 4px;
  margin-bottom: 0;
}

.subtask-card .field input,
.subtask-card .field select,
.subtask-card .field textarea {
  min-height: 34px;
  padding: 7px 9px;
}

.subtask-card .field textarea {
  min-height: 58px;
}

.content-upload-box {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #fff;
}

.content-upload-box textarea {
  border: 0;
  padding: 0;
  min-height: 76px;
  resize: vertical;
}

.content-upload-box textarea:focus {
  outline: 0;
}

.publish-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.publish-attachments .publish-image-card {
  width: 120px;
  height: 120px;
}

.publish-image-card {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
}

.publish-image-card img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #f5f7f9;
  cursor: zoom-in;
}

.publish-image-card > div {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(3px);
}

.publish-image-card .file-chip-preview {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
  color: var(--ink);
  background: transparent;
  font-size: 12px;
}

.publish-image-card button:last-child {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  color: var(--brand);
  background: #fff1ef;
  font-weight: 800;
}

.subtask-file-input {
  display: none;
}

.subtask-file-trigger {
  justify-self: start;
  margin-top: 2px;
}

.subtask-remove-btn {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  color: var(--muted);
  background: #eef1f4;
  font-size: 18px;
  line-height: 1;
}

.subtask-head-actions {
  display: inline-flex;
  gap: 4px;
}

.subtask-move-btn {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  color: var(--muted);
  background: #eef1f4;
  font-size: 14px;
  line-height: 1;
}

.subtask-move-btn:hover:not(:disabled) {
  color: #fff;
  background: var(--green);
}

.subtask-move-btn:disabled {
  cursor: not-allowed;
  opacity: .45;
}

.subtask-remove-btn:hover {
  color: #fff;
  background: var(--brand);
}

.task-complete-btn {
  margin-left: auto;
}

.subtask-actions {
  margin-top: 8px;
}

.flow-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafbfc;
}

.subtask-flow-options {
  margin-top: 8px;
  padding: 8px;
}

.subtask-pager {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 8px 0 2px;
  color: var(--muted);
  font-size: 13px;
}

.person-picker {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.person-picker summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 40px;
  padding: 8px 10px;
  cursor: pointer;
  list-style: none;
}

.person-picker summary::-webkit-details-marker {
  display: none;
}

.person-picker summary span {
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.person-picker summary b {
  color: var(--brand);
  font-size: 12px;
  white-space: nowrap;
}

.person-picker .check-grid {
  max-height: 210px;
  overflow-y: auto;
  padding: 10px;
  border-top: 1px solid var(--line);
}

.selected-persons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.person-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid rgba(162, 27, 19, 0.18);
  color: var(--brand);
  background: #fff4f2;
  font-size: 12px;
  font-weight: 800;
}

.person-chip button {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  color: #fff;
  background: var(--brand);
  line-height: 1;
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
}

.check-item {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  font-size: 13px;
}

.check-item input {
  width: 16px;
  min-height: 16px;
  padding: 0;
}

.check-item span {
  color: var(--text);
  font-weight: 700;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.secondary-action-row {
  margin-top: 8px;
}

.drop-zone {
  min-height: 86px;
  display: grid;
  place-items: center;
  padding: 14px;
  border: 1px dashed #aeb8c2;
  border-radius: 8px;
  color: var(--muted);
  background: #fafbfc;
}

.attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.file-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 260px;
  min-height: 30px;
  border-radius: 999px;
  padding: 0 10px;
  background: #eef1f4;
  color: var(--ink);
  font-size: 12px;
}

.file-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-chip-preview {
  max-width: 220px;
  min-height: 24px;
  padding: 0;
  overflow: hidden;
  color: var(--ink);
  background: transparent;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-chip button {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #d8dee4;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(17, 24, 32, .42);
}

.preview-modal {
  width: min(720px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow);
}

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

.preview-body {
  overflow: auto;
  padding: 14px;
}

.preview-actions {
  justify-content: center;
  margin-top: 12px;
}

.preview-body pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
  font-family: inherit;
  line-height: 1.7;
}

.preview-image,
.preview-frame {
  width: 100%;
  border: 0;
  border-radius: 6px;
  background: #fafbfc;
}

.preview-image {
  max-height: 640px;
  object-fit: contain;
}

.preview-frame {
  min-height: 620px;
}

.preview-open-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  margin-top: 12px;
  text-decoration: none;
}

.admin-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 16px;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 10px;
  border-bottom: 1px solid #edf0f2;
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}

.table th {
  color: var(--muted);
  font-size: 12px;
}

.daily-task-wrap {
  overflow: auto;
}

.daily-task-table th:nth-child(1),
.daily-task-table td:nth-child(1) {
  width: 92px;
}

.daily-task-table th:nth-child(2),
.daily-task-table td:nth-child(2) {
  width: 72px;
}

.daily-task-chip {
  display: grid;
  gap: 4px;
  margin-bottom: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fafbfc;
}

.daily-task-chip.completed {
  background: #eff6ff;
}

.daily-task-chip.completed-overdue {
  border-color: #fdba74;
  background: #ffedd5;
}

.gantt-shell {
  display: grid;
  grid-template-columns: 170px minmax(720px, 1fr);
  min-width: 980px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.gantt-head-cell {
  position: sticky;
  top: 0;
  z-index: 2;
  border-bottom: 1px solid var(--line);
  background: #fff;
  font-weight: 800;
}

.gantt-side {
  padding: 10px 12px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid #edf0f2;
  background: #fff;
}

.gantt-days {
  display: grid;
  grid-template-columns: repeat(var(--day-count), minmax(34px, 1fr));
}

.gantt-day {
  min-height: 38px;
  display: grid;
  place-items: center;
  border-right: 1px solid #edf0f2;
  color: var(--muted);
  font-size: 12px;
}

.gantt-track {
  display: grid;
  grid-template-columns: repeat(var(--day-count), minmax(34px, 1fr));
  grid-template-rows: repeat(var(--lane-count), minmax(30px, auto));
  gap: 4px 0;
  min-height: calc(var(--lane-count) * 34px + 20px);
  padding: 10px 0;
  border-bottom: 1px solid #edf0f2;
  background:
    repeating-linear-gradient(
      to right,
      #fff 0,
      #fff calc((100% / var(--day-count)) - 1px),
      #edf0f2 calc((100% / var(--day-count)) - 1px),
      #edf0f2 calc(100% / var(--day-count))
    );
}

.gantt-grid-cell {
  display: none;
}

.gantt-bar {
  min-width: 28px;
  margin: 0 3px;
  border: 0;
  border-radius: 6px;
  padding: 4px 7px;
  overflow: hidden;
  color: #fff;
  background: var(--green);
  box-shadow: 0 2px 5px rgba(16, 24, 32, .12);
  text-align: left;
  cursor: pointer;
}

.gantt-bar[draggable="true"] {
  cursor: grab;
}

.gantt-bar[draggable="true"]:active {
  cursor: grabbing;
}

.gantt-bar span,
.gantt-bar small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gantt-bar span {
  font-size: 12px;
  font-weight: 800;
}

.gantt-bar small {
  opacity: .9;
  font-size: 11px;
}

.gantt-bar.helper {
  color: #fff;
  background: #ec4899;
}

.gantt-bar.overdue {
  background: var(--brand);
}

.gantt-bar.upcoming {
  color: #6b4600;
  background: #facc15;
}

.gantt-bar.completed {
  color: #fff;
  background: #2563eb;
}

.gantt-bar.completed-overdue {
  color: #fff;
  background: #f97316;
}

.task-overview-filters,
.task-lookup-filters {
  justify-content: flex-end;
  max-width: 980px;
}

.task-overview-filters .date-tabs,
.task-lookup-filters .date-tabs {
  margin-left: auto;
}

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

.task-query-card {
  position: relative;
  display: grid;
  gap: 10px;
  min-height: 210px;
  padding: 12px 42px 12px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(15, 23, 42, .05);
}

.task-query-delete {
  position: absolute;
  top: 10px;
  right: 10px;
}

.task-query-card-head {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
}

.status-running {
  background: #0f8a5f;
}

.status-overdue {
  background: var(--brand);
}

.status-completed-overdue {
  background: #f97316;
}

.status-completed {
  background: #2563eb;
}

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

.task-query-info div {
  padding: 8px;
  border: 1px solid #edf0f3;
  border-radius: 6px;
  background: #fafbfc;
}

.task-query-info span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.task-query-info input,
.task-query-info select {
  width: 100%;
  min-height: 32px;
  margin-top: 4px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 5px 7px;
  background: #fff;
}

.task-query-info b {
  font-size: 13px;
}

.task-query-log {
  display: grid;
  gap: 6px;
  align-content: start;
}

.task-query-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-top: 2px;
}

.daily-toggle-group {
  min-height: 38px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.daily-toggle-group .check-line {
  white-space: nowrap;
}

.gantt-empty {
  grid-column: 1 / -1;
  align-self: center;
  padding-left: 12px;
  color: var(--muted);
  font-size: 13px;
}

.gantt-empty-row {
  grid-column: 1 / -1;
  padding: 18px;
  color: var(--muted);
  background: #fff;
}

.gantt-detail-popover {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 80;
  width: min(420px, calc(100vw - 40px));
  max-height: min(78vh, 680px);
  overflow: auto;
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.gantt-detail-popover .field {
  margin: 0;
}

.gantt-detail-media,
.task-query-media {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.gantt-detail-image-list,
.task-query-image-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.gantt-detail-image-list > img,
.task-query-image-list > img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.task-hover-image {
  width: 72px;
  height: 72px;
  flex: 0 0 72px;
}

.task-hover-image .product-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.task-hover-image .product-thumb-preview {
  width: min(460px, calc(100vw - 80px));
  height: min(460px, calc(100vh - 120px));
  object-fit: contain;
  background: #fff;
}

.gantt-detail-content-text,
.task-query-content-text {
  max-height: 130px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
}

.gantt-detail-close {
  position: absolute;
  top: 8px;
  right: 8px;
}

.metric-date {
  font-size: 20px !important;
}

.permission-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.account-admin-shell {
  min-height: calc(100vh - 150px);
}

.admin-tabs {
  display: flex;
  gap: 4px;
  padding: 10px 14px 0;
  border-bottom: 1px solid var(--line);
}

.admin-tabs button {
  min-height: 40px;
  padding: 0 18px;
  border-bottom: 3px solid transparent;
  color: var(--muted);
  background: transparent;
  font-weight: 700;
}

.admin-tabs button.active {
  border-bottom-color: var(--brand);
  color: var(--brand);
}

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

.admin-section-head h3,
.admin-section-head p {
  margin: 0;
}

.admin-table-wrap {
  overflow: auto;
}

.account-table {
  min-width: 900px;
}

.account-status-toggle {
  min-width: 72px;
  min-height: 30px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.account-status-toggle.enabled {
  color: #087443;
  background: #ddf5ea;
}

.account-status-toggle.disabled {
  color: #8b1e18;
  background: #fde5e2;
}

.admin-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 45;
  background: rgba(17, 24, 32, .32);
}

.admin-drawer {
  position: absolute;
  top: 0;
  right: 0;
  width: min(980px, 96vw);
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: #fff;
  box-shadow: -12px 0 34px rgba(15, 23, 42, .16);
}

.admin-drawer-body {
  display: grid;
  align-content: start;
  gap: 14px;
  overflow-y: auto;
  padding: 18px;
}

.admin-drawer-submit {
  position: sticky;
  bottom: -18px;
  z-index: 3;
  width: calc(100% + 36px);
  margin: 8px -18px -18px;
  padding: 16px;
  border-radius: 0;
  box-shadow: 0 -8px 18px rgba(15, 23, 42, .08);
}

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

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

.permission-table-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: auto;
  background: #fff;
}

.permission-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
}

.permission-table th,
.permission-table td {
  border: 1px solid var(--line);
  padding: 14px;
  vertical-align: middle;
}

.permission-table th {
  background: #f8fafc;
  text-align: center;
  color: var(--text);
}

.permission-category-cell {
  width: 130px;
  background: #fafbfc;
  text-align: center;
}

.permission-level-cell {
  width: 190px;
  background: #fbfcfe;
}

.permission-section {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.permission-parent {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  background: transparent;
}

.permission-parent input {
  width: 17px;
  height: 17px;
}

.permission-parent span {
  display: grid;
  gap: 2px;
}

.permission-parent small {
  color: var(--muted);
  font-weight: 400;
}

.permission-children {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px 18px;
  padding: 0;
}

.inherited-permission {
  color: #66727f;
  background: #f3f5f7;
}

.super-admin-note {
  padding: 12px;
  border: 1px solid #f1c7c2;
  border-radius: 8px;
  color: var(--brand);
  background: #fff4f1;
  font-weight: 800;
}

.super-admin-badge {
  display: inline-block;
  margin-left: 8px;
  border-radius: 999px;
  padding: 2px 7px;
  color: #fff;
  background: var(--brand);
  font-size: 11px;
}

.mini-tag {
  display: inline-flex;
  align-items: center;
  margin: 2px 4px 2px 0;
  border-radius: 999px;
  padding: 2px 7px;
  color: #1f2937;
  background: #eef2f7;
  font-size: 12px;
  font-weight: 700;
}

.online-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 999px;
  background: #cbd5e1;
}

.online-dot.online {
  background: #059669;
  box-shadow: 0 0 0 3px rgba(5, 150, 105, .12);
}

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

.workflow-step-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 8px;
}

.workflow-step-row input {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 8px;
}

.workflow-tree-config {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 10px;
}

.workflow-tree-level {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.workflow-tree-level .workflow-tree-level {
  margin-top: 0;
  border-color: #dce2e8;
}

.workflow-tree-children > .workflow-tree-level + .workflow-tree-level,
.workflow-shop-items > .workflow-shop-item + .workflow-shop-item {
  border-top: 1px solid #e3e7eb;
}

.workflow-tree-level > summary {
  position: relative;
  display: block;
  list-style: none;
  cursor: pointer;
}

.workflow-tree-level > summary::before {
  content: "▾";
  position: absolute;
  top: 13px;
  left: 5px;
  z-index: 2;
  color: var(--muted);
  font-size: 11px;
}

.workflow-tree-level:not([open]) > summary::before {
  content: "▸";
}

.workflow-tree-level > summary::-webkit-details-marker {
  display: none;
}

.workflow-tree-node-row {
  display: grid;
  grid-template-columns: 54px minmax(90px, 1fr) 26px 26px;
  align-items: center;
  gap: 4px;
  min-height: 34px;
  padding: 2px 4px 2px 16px;
}

.workflow-tree-node-row.level-branch {
  grid-template-columns: 48px minmax(72px, 1fr) minmax(68px, 86px) minmax(48px, 58px) minmax(74px, 82px) 26px 26px;
  margin-top: 0;
  border: 0;
  border-radius: 0;
}

.workflow-flow-owner {
  width: 100%;
  min-width: 0;
  height: 32px;
  border: 1px solid #d3dae1;
  border-radius: 5px;
  background: #fff;
  padding: 0 5px;
  font-size: 12px;
}

.workflow-flow-duration-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 16px;
  align-items: center;
  width: 100%;
  border: 1px solid #d3dae1;
  border-radius: 5px;
  background: #fff;
  padding: 0 4px 0 0;
  overflow: hidden;
}

.workflow-flow-duration {
  width: 100%;
  min-width: 0;
  height: 30px;
  border: 0;
  background: transparent;
  padding: 0 4px;
  font-size: 12px;
}

.workflow-flow-duration-wrap span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
}

.workflow-auto-flow {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  white-space: nowrap;
  color: #4b5563;
  font-size: 10px;
  overflow: hidden;
}

.workflow-auto-flow input {
  width: 14px;
  height: 14px;
  min-height: 14px;
  padding: 0;
}

.workflow-tree-node-row input {
  width: 100%;
  min-width: 0;
  height: 32px;
  border: 1px solid #d3dae1;
  border-radius: 5px;
  background: #fff;
  padding: 0 7px;
}

.workflow-tree-level-label {
  font-size: 12px;
  font-weight: 800;
  color: #4b5563;
}

.level-platform .workflow-tree-level-label {
  color: var(--brand);
}

.level-main .workflow-tree-level-label {
  color: #087443;
}

.workflow-tree-children {
  position: relative;
  margin: 0 4px 4px 12px;
  padding-left: 8px;
  border-left: 1px solid #cbd3db;
}

.workflow-shop-group > summary {
  border-bottom: 1px solid #e3e7eb;
}

.workflow-shop-items {
  display: grid;
  min-width: 0;
}

.workflow-shop-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 26px;
  align-items: center;
  gap: 4px;
  min-width: 0;
  padding: 2px 0;
  cursor: grab;
}

.workflow-shop-item input {
  width: 100%;
  min-width: 0;
  height: 30px;
  border: 1px solid #d3dae1;
  border-radius: 5px;
  padding: 0 8px;
}

.workflow-tree-shop-drop {
  display: grid;
  min-height: 36px;
  place-items: center;
  margin-top: 5px;
  border: 1px dashed #8ebca7;
  border-radius: 5px;
  color: #487866;
  background: #f7fbf9;
  font-size: 12px;
}

.workflow-node-drop-active {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
  background: var(--brand-soft);
}

[data-workflow-node-drag].dragging {
  opacity: .45;
}

.workflow-tree-children::before {
  content: "";
  position: absolute;
  top: 24px;
  left: 0;
  width: 8px;
  border-top: 1px solid #cbd3db;
}

.workflow-tree-branches {
  padding-top: 1px;
}

.workflow-tree-empty {
  min-height: 38px;
  padding: 6px;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 1050px) {
  .workflow-tree-config {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .workflow-tree-config {
    grid-template-columns: 1fr;
  }
}

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

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

.group-management-card .section-title-row {
  padding: 0 0 10px;
}

.group-management-card .section-title-row input {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 8px;
  font-weight: 700;
}

.group-member-select {
  min-width: 190px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  padding: 0 8px;
}

.group-member-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  max-height: 260px;
  overflow-y: auto;
}

.check-line {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 13px;
}

.timeline {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.log-item {
  padding: 10px 12px;
  border-left: 3px solid var(--brand);
  background: #fafbfc;
  color: var(--muted);
  font-size: 13px;
}

.toast-root {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  display: grid;
  gap: 10px;
}

.toast {
  position: relative;
  width: min(360px, calc(100vw - 36px));
  padding: 14px;
  border: 1px solid rgba(180, 35, 24, 0.22);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.toast-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  color: var(--muted);
  background: #eef1f4;
  font-size: 16px;
  line-height: 1;
}

.toast-close:hover {
  color: var(--text);
  background: #d8dee4;
}

.toast b {
  display: block;
  padding-right: 28px;
  margin-bottom: 4px;
}

.toast p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.choice-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, .32);
}

.choice-modal {
  width: min(420px, calc(100vw - 32px));
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow);
}

.choice-modal strong {
  display: block;
  margin-bottom: 8px;
  font-size: 18px;
}

.choice-modal p {
  margin: 0 0 18px;
  color: var(--muted);
}

.choice-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.empty {
  padding: 36px;
  color: var(--muted);
  text-align: center;
}

.mobile-only {
  display: none;
}

@media (max-width: 980px) {
  .group-management-grid {
    grid-template-columns: 1fr;
  }

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

  .login-shell,
  .layout,
  .board,
  .expense-finance-hub,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .login-art {
    padding: 32px;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

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

  .task-list-body {
    max-height: none;
  }

  .publish-draft-body,
  .expense-publish-card .publish-draft-body {
    grid-template-columns: 1fr;
  }

  .publish-draft-card .publish-work-section,
  .expense-publish-card .publish-work-section {
    grid-template-columns: 1fr;
  }

  .publish-side-actions {
    grid-column: 1;
    grid-row: auto;
    width: 100%;
    border-left: 0;
    padding-left: 0;
  }

  .expense-upload-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .permission-children,
  .group-management-grid,
  .group-member-list {
    grid-template-columns: 1fr;
  }

  .admin-tabs {
    overflow-x: auto;
  }

  .admin-tabs button {
    flex: 0 0 auto;
  }

  .group-member-list {
    grid-template-columns: 1fr;
  }

  .topbar,
  .toolbar,
  .top-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .content {
    padding: 14px;
  }

  .metrics,
  .workflow-metrics,
  .form-grid,
  .compact-grid,
  .expense-two-pane,
  .expense-batch-controls,
  .expense-mini-metrics,
  .expense-detail-grid,
  .flow-options,
  .permission-list,
  .subtask-list,
  .expense-card-grid {
    grid-template-columns: 1fr;
  }

  .expense-file-field {
    grid-column: 1 / -1;
  }

  .login-art h1 {
    font-size: 30px;
  }
}
.staff-duty-input {
  width: 100%;
  min-width: 320px;
  min-height: 76px;
  resize: vertical;
}

.work-assignment-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(460px, 1fr));
  gap: 14px;
  align-items: start;
}

.work-assignment-tree {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  overflow: visible;
}

.work-tree-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: #f7f9fa;
}

.work-tree-title {
  font-weight: 800;
}

.work-tree-root,
.work-tree-root ul {
  position: relative;
  margin: 0;
  padding: 10px 12px 4px 26px;
  list-style: none;
}

.work-tree-root {
  padding: 14px 16px 18px;
}

.work-tree-root ul::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 19px;
  left: 12px;
  border-left: 1px solid #c9d1d8;
}

.work-tree-root li {
  position: relative;
}

.work-tree-root ul > li::before {
  content: "";
  position: absolute;
  top: 20px;
  left: -14px;
  width: 14px;
  border-top: 1px solid #c9d1d8;
}

.work-tree-node {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 3px 0;
}

.work-tree-node > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.work-tree-node input,
.work-tree-node select {
  width: 100%;
  min-width: 0;
  height: 34px;
  border: 1px solid #d7dde3;
  border-radius: 5px;
  background: #fff;
  padding: 0 9px;
}

.work-flow-picker {
  position: relative;
  min-width: 0;
  border: 1px solid #d7dde3;
  border-radius: 5px;
  background: #fff;
}

.work-flow-picker > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 34px;
  padding: 0 9px;
  list-style: none;
  cursor: pointer;
}

.work-flow-picker > summary::-webkit-details-marker {
  display: none;
}

.work-flow-picker > summary span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.work-flow-picker > summary b {
  flex: 0 0 auto;
  color: var(--brand);
  font-size: 12px;
}

.work-flow-picker-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 80;
  width: max(100%, 320px);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 8px;
}

.work-flow-picker-dropdown > input {
  width: 100%;
  height: 34px;
  margin-bottom: 6px;
  border: 1px solid #d7dde3;
  border-radius: 5px;
  padding: 0 9px;
}

.work-flow-option-list {
  display: grid;
  max-height: 220px;
  overflow-y: auto;
}

.work-flow-option-list button {
  border: 0;
  border-bottom: 1px solid #edf0f2;
  border-radius: 0;
  background: #fff;
  padding: 8px;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.work-flow-option-list button:hover {
  color: var(--brand);
  background: var(--brand-soft);
}

.work-tree-node.root-node > span,
.main-work-node > span {
  color: #b42318;
}

.sub-work-node {
  grid-template-columns: 82px minmax(0, 1fr) 28px;
}

.work-tree-add-row {
  padding-top: 7px;
}

.work-tree-toolbar {
  display: grid;
  grid-template-columns: 24px minmax(180px, 1fr) auto 30px;
  gap: 8px;
}

.work-assignment-drag {
  display: grid;
  width: 24px;
  height: 30px;
  place-items: center;
  color: var(--muted);
  cursor: grab;
  user-select: none;
}

.work-assignment-drop-active {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
}

.work-tree-person {
  display: grid;
  grid-template-columns: 44px minmax(120px, 220px);
  align-items: center;
  gap: 8px;
  font-weight: 800;
}

.work-tree-person select {
  height: 34px;
  border: 1px solid #d7dde3;
  border-radius: 5px;
  background: #fff;
  padding: 0 9px;
}

.work-tree-groups {
  display: grid;
  gap: 12px;
}

.work-platform-group {
  border: 1px solid #dce2e8;
  border-radius: 6px;
  background: #fff;
  padding: 10px;
}

.work-tree-node,
.sub-work-node {
  grid-template-columns: 92px minmax(0, 1fr) 30px 30px;
}

.work-node-items {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  min-width: 0;
}

.work-node-chip {
  display: grid;
  grid-template-columns: minmax(100px, 1fr) 26px;
  align-items: center;
  gap: 4px;
  min-width: 150px;
  border: 1px solid #d7dde3;
  border-radius: 5px;
  padding: 3px;
  background: #f8fafb;
  cursor: grab;
}

.work-node-chip input {
  border: 0;
  background: transparent;
}

.work-shop-items {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.work-shop-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  align-items: center;
  gap: 6px;
  min-width: 0;
  cursor: grab;
}

.work-shop-item input {
  width: 100%;
  min-width: 0;
}

.work-shop-node {
  align-items: start;
}

.work-tree-branch-content {
  display: grid;
  gap: 8px;
  margin-left: 25px;
  padding: 7px 0 3px 18px;
  border-left: 1px solid #c9d1d8;
}

.work-shop-branch,
.work-main-branch {
  border: 1px solid #e3e8ed;
  border-radius: 5px;
  padding: 7px;
  background: #fcfdfd;
}

.work-shop-group {
  display: grid;
  gap: 8px;
  border: 1px solid #e3e8ed;
  border-radius: 5px;
  padding: 8px;
  background: #fcfdfd;
}

.work-branch-task-list {
  padding-bottom: 6px;
}

.work-tree-new-branch-drop {
  min-height: 44px;
  display: grid;
  place-items: center;
  border: 1px dashed #b9c3cc;
  border-radius: 6px;
  color: var(--muted);
  background: #f8fafb;
  font-size: 13px;
}

.work-tree-bottom-add {
  width: 100%;
  min-height: 34px;
  margin-top: 7px;
}

.work-node-drop-active,
.work-tree-new-branch-drop.work-node-drop-active {
  border-color: var(--brand);
  background: var(--brand-soft);
}

[data-work-node-drag].dragging {
  opacity: .45;
}

@media (max-width: 1180px) {
  .work-assignment-board {
    grid-template-columns: 1fr;
  }
}

.staff-duty-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(260px, 1fr));
  align-items: start;
  gap: 12px;
}

.staff-duty-person {
  height: 380px;
  min-height: 380px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.staff-duty-person.drag-over {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.staff-duty-person-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.staff-duty-person-head > div {
  display: grid;
  min-width: 0;
  flex: 1;
  gap: 5px;
}

.staff-duty-person-head strong {
  color: var(--brand);
  font-size: 16px;
}

.staff-role-input {
  width: 100%;
  min-height: 30px;
  padding: 4px 8px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: #f5f7f8;
  color: var(--muted);
}

.staff-role-input:focus {
  border-color: var(--brand);
  background: #fff;
}

.staff-duty-list {
  display: grid;
  align-content: start;
  gap: 7px;
  max-height: 298px;
  overflow-y: auto;
  padding-right: 3px;
}

.staff-duty-card {
  position: relative;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 6px;
  min-height: 52px;
  padding: 6px;
  border-top: 1px solid var(--line);
  background: #fafbfc;
  cursor: grab;
}

.staff-duty-card.dragging {
  opacity: 0.45;
}

.staff-duty-card textarea {
  width: 100%;
  min-height: 42px;
  padding: 7px;
  border: 0;
  background: transparent;
  resize: vertical;
}

.staff-duty-drag {
  display: inline-grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--brand);
  font-size: 12px;
  font-weight: 800;
  cursor: grab;
}

.product-status-filters {
  display: inline-flex;
  gap: 5px;
}

.product-status-filters button.active {
  color: #fff;
  border-color: var(--brand);
  background: var(--brand);
}

.performance-board,
.performance-section {
  display: grid;
  gap: 12px;
}

.performance-section + .performance-section {
  margin-top: 10px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.performance-table {
  min-width: 1180px;
}

.performance-table input,
.performance-table select {
  width: 100%;
  min-height: 34px;
}

.performance-table input[type="number"] {
  min-width: 70px;
}

.performance-task-select {
  min-width: 280px;
}

.performance-score {
  display: inline-grid;
  place-items: center;
  min-width: 44px;
  height: 30px;
  border-radius: 6px;
  color: #fff;
  background: var(--green);
  font-weight: 800;
}

@media (max-width: 1180px) {
  .staff-duty-board {
    grid-template-columns: repeat(2, minmax(260px, 1fr));
  }
}

@media (max-width: 760px) {
  .staff-duty-board {
    grid-template-columns: 1fr;
  }
}

.file-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.file-button input {
  display: none;
}

.shop-report-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  min-height: 620px;
  border-top: 1px solid var(--line);
}

.shop-report-files {
  padding: 12px;
  border-right: 1px solid var(--line);
  background: #f8f9fa;
}

.shop-report-files-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.shop-report-files-title span {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  height: 24px;
  border-radius: 12px;
  background: #e8ecef;
  color: var(--muted);
  font-size: 12px;
}

.shop-report-file {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  text-align: left;
}

.shop-report-file-select {
  display: block;
  min-width: 0;
  flex: 1;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.shop-report-file-select > span {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.shop-report-file:hover,
.shop-report-file.active {
  border-color: #e2a8a2;
  background: var(--brand-soft);
}

.shop-report-file-select > span:first-child {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.shop-report-file strong,
.shop-report-file small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shop-report-file small {
  color: var(--muted);
}

.shop-report-delete {
  display: inline-grid;
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: var(--muted);
  font-size: 18px;
}

.shop-report-delete:hover {
  color: #fff;
  background: var(--brand);
}

.shop-report-content {
  min-width: 0;
  padding: 14px;
}

.shop-data-filters {
  margin: 0;
}

.shop-data-filters select {
  min-width: 130px;
}

.shop-data-metric-settings {
  position: relative;
}

.shop-data-metric-settings > summary {
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  list-style: none;
  cursor: pointer;
}

.shop-data-metric-settings > div {
  position: absolute;
  z-index: 28;
  top: calc(100% + 6px);
  right: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(130px, 1fr));
  gap: 7px;
  width: 360px;
  max-height: 320px;
  padding: 12px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  box-shadow: var(--shadow);
}

.shop-data-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
}

.shop-data-summary > div {
  display: grid;
  gap: 5px;
  min-height: 78px;
  padding: 12px 14px;
  border-right: 1px solid var(--line);
}

.shop-data-summary > div:last-child {
  border-right: 0;
}

.shop-data-summary span,
.shop-data-store small {
  color: var(--muted);
  font-size: 12px;
}

.shop-data-summary strong {
  font-size: 24px;
}

.shop-data-store-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(105px, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.shop-data-store {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 3px 8px;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 8px 10px;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.shop-data-store span {
  overflow: hidden;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shop-data-store strong {
  grid-row: 1 / 3;
  grid-column: 2;
  color: var(--brand);
  font-size: 20px;
}

.shop-data-store.active,
.shop-data-store:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.shop-data-table {
  min-width: 980px;
}

.shop-data-table th:first-child,
.shop-data-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  min-width: 110px;
  background: #fff;
}

.shop-data-table th:first-child {
  z-index: 3;
  background: #f4f6f8;
}

@media (max-width: 1180px) {
  .shop-data-store-strip {
    grid-template-columns: repeat(3, minmax(120px, 1fr));
  }
}

@media (max-width: 760px) {
  .shop-data-summary {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }

  .shop-data-store-strip {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }
}

.shop-report-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.shop-report-summary > div {
  display: grid;
  gap: 4px;
  padding: 10px;
  border-left: 3px solid var(--brand);
  background: #f7f8f9;
}

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

.shop-report-sheet-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
  overflow-x: auto;
}

.shop-report-sheet-tabs button.active {
  color: #fff;
  background: var(--brand);
}

.report-limit-note {
  margin-bottom: 8px;
  padding: 8px 10px;
  border-left: 3px solid #d59d18;
  background: #fff8df;
  color: #795b0b;
  font-size: 12px;
}

.shop-report-table-wrap {
  max-width: 100%;
  max-height: 620px;
  overflow: auto;
  border: 1px solid var(--line);
}

.shop-report-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  font-size: 13px;
}

.shop-report-table th,
.shop-report-table td {
  min-width: 130px;
  max-width: 280px;
  height: 36px;
  padding: 7px 9px;
  overflow: hidden;
  border-right: 1px solid #dfe3e6;
  border-bottom: 1px solid #dfe3e6;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shop-report-table th {
  position: sticky;
  z-index: 2;
  top: 0;
  background: #eef1f3;
  font-weight: 800;
  text-align: left;
}

.shop-report-table .report-row-number {
  position: sticky;
  z-index: 1;
  left: 0;
  min-width: 58px;
  width: 58px;
  background: #f5f6f7;
  color: var(--muted);
  text-align: center;
}

.shop-report-table th.report-row-number {
  z-index: 3;
  background: #e8ecef;
}

.shop-report-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

.shop-report-empty {
  display: grid;
  min-height: 500px;
  place-items: center;
  align-content: center;
  gap: 10px;
  color: var(--muted);
  text-align: center;
}

.shop-report-empty strong {
  color: var(--text);
  font-size: 20px;
}

@media (max-width: 900px) {
  .shop-report-layout {
    grid-template-columns: 1fr;
  }

  .shop-report-files {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .shop-report-summary {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }
}

.product-create-dialog {
  width: min(980px, calc(100vw - 40px));
  max-height: calc(100vh - 48px);
  overflow-y: auto;
}

.product-create-dialog-body {
  padding: 18px 0;
}

.product-create-dialog .modal-actions {
  position: sticky;
  bottom: 0;
  padding-top: 12px;
  background: #fff;
}

.task-query-table-wrap {
  width: 100%;
  max-height: calc(100vh - 330px);
  overflow: auto;
}

.task-query-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  font-size: 13px;
}

.task-query-table th,
.task-query-table td {
  min-width: 130px;
  height: 50px;
  padding: 8px 10px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  white-space: nowrap;
}

.task-query-table th {
  position: sticky;
  z-index: 2;
  top: 0;
  background: #eef1f3;
  text-align: left;
}

.task-query-table th:nth-child(3),
.task-query-table td:nth-child(3) {
  min-width: 220px;
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.task-query-table select,
.task-query-table input {
  min-height: 34px;
}

.task-query-table select {
  min-width: 130px;
}

.task-query-days {
  width: 76px;
}

.task-query-row-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.task-row-expand {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.task-query-summary-row.expanded td {
  background: #fff7f6;
}

.task-query-detail-row[hidden] {
  display: none;
}

.task-query-detail-row td {
  padding: 0 !important;
  background: #fafbfc;
}

.task-query-expanded-content {
  display: grid;
  grid-template-columns: minmax(240px, 0.9fr) minmax(260px, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.task-query-expanded-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.task-evaluation-dialog {
  width: min(760px, calc(100vw - 40px));
}

.evaluation-dimension-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.evaluation-score-summary {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 12px 14px;
  background: #fff7f6;
  border-left: 3px solid var(--red);
}

.evaluation-score-summary strong {
  font-size: 24px;
  color: var(--red);
}

.staff-evaluation-layout {
  display: grid;
  grid-template-columns: minmax(300px, 420px) minmax(420px, 1fr);
  gap: 14px;
  align-items: start;
}

.staff-radar-panel,
.staff-dimension-panel,
.staff-evaluation-history {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.staff-radar {
  display: block;
  width: min(100%, 300px);
  height: auto;
  margin: 0 auto;
}

.staff-radar .radar-grid polygon,
.staff-radar .radar-grid line {
  fill: none;
  stroke: #dfe4e8;
  stroke-width: 1;
}

.staff-radar .radar-value {
  fill: rgba(194, 33, 25, .18);
  stroke: var(--red);
  stroke-width: 2;
}

.staff-radar text {
  fill: #4b5563;
  font-size: 11px;
  text-anchor: middle;
  dominant-baseline: middle;
}

.staff-dimension-list {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.staff-dimension-list > div {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 44px;
  gap: 10px;
  align-items: center;
}

.dimension-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 4px;
  background: #edf0f2;
}

.dimension-bar i {
  display: block;
  height: 100%;
  background: var(--red);
}

.evaluation-overall {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 10px;
}

.staff-summary-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 10px;
}

.staff-average-time {
  min-height: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.evaluation-overall strong {
  color: var(--red);
  font-size: 26px;
}

.staff-evaluation-history {
  grid-column: 1 / -1;
  max-height: 360px;
  overflow: auto;
}

.staff-evaluation-filters {
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.staff-evaluation-filters input,
.staff-evaluation-filters select {
  min-height: 34px;
  min-width: 90px;
}

.staff-evaluation-filters button {
  min-height: 34px;
}

.staff-year-picker {
  z-index: 40;
}

.staff-year-calendar {
  width: 292px;
}

.staff-evaluation-head {
  align-items: center;
}

@media (max-width: 900px) {
  .evaluation-dimension-grid,
  .staff-evaluation-layout {
    grid-template-columns: 1fr;
  }

  .task-query-expanded-content {
    grid-template-columns: 1fr;
  }
}

.task-log-dialog {
  width: min(760px, calc(100vw - 40px));
  max-height: calc(100vh - 60px);
}

.task-log-list {
  display: grid;
  max-height: 520px;
  margin: 14px 0;
  overflow-y: auto;
  border: 1px solid var(--line);
}

.task-log-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: start;
  border-bottom: 1px solid var(--line);
}

.task-log-row:last-child {
  border-bottom: 0;
}

.task-log-row span {
  display: grid;
  min-height: 44px;
  place-items: center;
  color: var(--muted);
  background: #f3f5f6;
}

.task-log-row p {
  margin: 0;
  padding: 11px 12px;
  line-height: 1.55;
}

.shop-report-year-select {
  min-width: 100px;
  min-height: 34px;
}

.shop-year-picker {
  position: relative;
}

.shop-year-calendar {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  right: 0;
  width: 292px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.shop-year-calendar-head {
  display: grid;
  grid-template-columns: 34px 1fr 34px;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  text-align: center;
}

.shop-year-calendar-head button {
  height: 32px;
  border: 0;
  border-radius: 5px;
  background: #eef1f3;
  font-size: 20px;
}

.shop-year-calendar-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.shop-year-calendar-grid button {
  height: 36px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: #f6f7f8;
}

.shop-year-calendar-grid button:hover,
.shop-year-calendar-grid button.active {
  color: #fff;
  border-color: var(--brand);
  background: var(--brand);
}

.product-knowledge-panel .product-knowledge-tabs .secondary.active,
.product-knowledge-panel .product-knowledge-tabs .secondary.active:hover,
.product-knowledge-panel .product-knowledge-tabs .secondary.active:focus {
  color: #fff !important;
  border-color: var(--red) !important;
  background: var(--red) !important;
}

.shop-annual-report {
  display: grid;
  gap: 16px;
}

.annual-report-table {
  width: 100%;
}

.annual-report-table th,
.annual-report-table td {
  width: 25%;
}

.metrics.task-lookup-metrics {
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  overflow-x: auto;
}

.task-query-check-cell {
  width: 42px;
  min-width: 42px;
  text-align: center;
}

.task-query-check-cell input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}
