.tk-daily-shell {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
}

.tk-daily-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.tk-daily-tabs {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-alt, #f1f5f9);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid var(--border, #e2e8f0);
}

.tk-daily-tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted, #475569);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 7px;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.tk-daily-tab:hover {
  color: var(--text, #0f172a);
}

.tk-daily-tab.is-active {
  background: var(--surface, #ffffff);
  color: var(--primary, #1d4ed8);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.tk-daily-meta-note {
  font-size: 12px;
  color: var(--muted, #64748b);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.tk-daily-filterbar {
  padding: 12px 14px;
}

.tk-daily-filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
}

.tk-daily-filter-row label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--muted, #475569);
}

.tk-daily-filter-row input[type="date"],
.tk-daily-filter-row select {
  height: 32px;
  padding: 0 8px;
  font-size: 12px;
  min-width: 128px;
}

.tk-daily-presets {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  align-self: flex-end;
  padding-bottom: 1px;
}

.tk-daily-preset {
  height: 30px;
  padding: 0 10px;
  font-size: 12px;
  border-radius: 6px;
  border: 1px solid var(--border, #cbd5e1);
  background: var(--surface, #ffffff);
  color: var(--text, #334155);
  cursor: pointer;
}

.tk-daily-preset:hover {
  border-color: var(--primary, #2563eb);
  color: var(--primary, #2563eb);
}

.tk-daily-preset.is-active {
  background: #eff6ff;
  border-color: var(--primary, #2563eb);
  color: var(--primary, #1d4ed8);
  font-weight: 600;
}

.tk-daily-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-wrap: wrap;
}

.tk-daily-actions .button {
  height: 32px;
  padding: 0 12px;
  font-size: 12px;
}

.tk-daily-summary-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: var(--muted, #475569);
}

.tk-daily-summary-pills {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tk-summary-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--surface, #ffffff);
  border: 1px solid var(--border, #e2e8f0);
  font-size: 12px;
  color: var(--text, #1e293b);
}

.tk-summary-pill.is-alert {
  background: #fff1f2;
  border-color: #fecdd3;
  color: #9c0006;
  font-weight: 600;
}

.tk-matrix-panel {
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border, #cbd5e1);
  border-radius: 10px;
  background: var(--surface, #ffffff);
}

.tk-matrix-panel.is-loading {
  opacity: 0.72;
}

.tk-matrix-scroll {
  overflow: auto;
  max-height: calc(100vh - 295px);
  min-height: 220px;
}

.tk-matrix-table {
  border-collapse: separate;
  border-spacing: 0;
  width: max-content;
  min-width: 100%;
  font-size: 12px;
  color: #111827;
  border-top: 1px solid #64748b;
  border-left: 1px solid #64748b;
}

.tk-matrix-table th,
.tk-matrix-table td {
  border-right: 1px solid #64748b;
  border-bottom: 1px solid #64748b;
  box-sizing: border-box;
  vertical-align: middle;
}

.tk-matrix-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  height: 34px;
  padding: 4px 8px;
  background: #D2F4F2;
  color: #111827;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
  border-bottom: 1px solid #475569;
}

.tk-col-1 {
  width: 112px;
  min-width: 112px;
  max-width: 112px;
}

.tk-col-2 {
  width: 136px;
  min-width: 136px;
  max-width: 136px;
}

.tk-col-3 {
  width: 72px;
  min-width: 72px;
  max-width: 72px;
}

.tk-col-4 {
  width: 108px;
  min-width: 108px;
  max-width: 108px;
}

.tk-sticky-col-1 {
  position: sticky;
  left: 0;
  z-index: 2;
  background: #FADADE;
}

.tk-sticky-col-2 {
  position: sticky;
  left: 112px;
  z-index: 2;
  background: #FADADE;
}

.tk-sticky-col-3 {
  position: sticky;
  left: 248px;
  z-index: 2;
}

.tk-sticky-col-4 {
  position: sticky;
  left: 320px;
  z-index: 2;
  border-right: 2px solid #475569 !important;
}

.tk-matrix-table thead th.tk-sticky-col-1,
.tk-matrix-table thead th.tk-sticky-col-2,
.tk-matrix-table thead th.tk-sticky-col-3,
.tk-matrix-table thead th.tk-sticky-col-4 {
  z-index: 5;
  background: #D2F4F2;
}

.tk-owner-cell,
.tk-shop-cell {
  padding: 8px 6px;
  text-align: center;
  vertical-align: middle !important;
  background: #FADADE;
  color: #111827;
  border-bottom: 2px solid #334155;
}

.tk-owner-cell {
  font-weight: 600;
  line-height: 1.4;
  word-break: break-word;
}

.tk-shop-title {
  font-weight: 700;
  color: #111827;
  line-height: 1.35;
  word-break: break-word;
}

.tk-shop-tags {
  margin-top: 5px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 3px;
}

.tk-shop-tag {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 10px;
  line-height: 1.4;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(100, 116, 139, 0.35);
  color: #334155;
}

.tk-shop-tag.is-disabled {
  background: #fef2f2;
  color: #991b1b;
}

.tk-shop-tag.is-custom {
  background: #eff6ff;
  color: #1d4ed8;
}

.tk-shop-tag.is-alert {
  background: #FF4D4F;
  border-color: #FF4D4F;
  color: #FFFFFF;
  font-weight: 700;
}

.tk-shop-gear-btn {
  margin-top: 5px;
  height: 22px;
  padding: 0 7px;
  font-size: 11px;
  border-radius: 4px;
  border: 1px solid #94a3b8;
  background: rgba(255, 255, 255, 0.9);
  color: #1e293b;
  cursor: pointer;
}

.tk-shop-gear-btn:hover {
  border-color: var(--primary, #2563eb);
  color: var(--primary, #2563eb);
  background: #ffffff;
}

.tk-matrix-table tr.tk-group-ops > td.tk-dim-cell,
.tk-matrix-table tr.tk-group-ops > td.tk-metric-cell,
.tk-matrix-table tr.tk-group-ops > td.tk-date-cell {
  background: #C9E4B4;
}

.tk-matrix-table tr.tk-group-score > td.tk-dim-cell,
.tk-matrix-table tr.tk-group-score > td.tk-metric-cell,
.tk-matrix-table tr.tk-group-score > td.tk-date-cell,
.tk-matrix-table tr.tk-group-violation > td.tk-dim-cell,
.tk-matrix-table tr.tk-group-violation > td.tk-metric-cell,
.tk-matrix-table tr.tk-group-violation > td.tk-date-cell {
  background: #FCE4D3;
}

.tk-matrix-table tr.tk-group-product > td.tk-dim-cell,
.tk-matrix-table tr.tk-group-product > td.tk-metric-cell,
.tk-matrix-table tr.tk-group-product > td.tk-date-cell {
  background: #D9E1F4;
}

.tk-dim-cell {
  text-align: center;
  font-weight: 700;
  color: #111827;
  padding: 4px 6px;
  line-height: 1.35;
}

.tk-metric-cell {
  height: 26px;
  padding: 2px 8px;
  white-space: nowrap;
  color: #111827;
  font-weight: 500;
  text-align: left;
}

.tk-date-cell {
  height: 26px;
  min-width: 84px;
  padding: 0;
  text-align: center;
  font-variant-numeric: tabular-nums;
  color: #111827;
}

.tk-cell-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 26px;
  padding: 0 8px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: center;
  cursor: pointer;
  white-space: nowrap;
}

.tk-cell-btn:hover {
  background: rgba(15, 23, 42, 0.06);
}

.tk-matrix-table tr.tk-metric-row > td.tk-date-cell.is-alert {
  background: #FF4D4F;
  color: #FFFFFF;
  font-weight: 700;
}

.tk-matrix-table tr.tk-metric-row > td.tk-date-cell.is-alert .tk-cell-btn:hover {
  background: rgba(255, 255, 255, 0.14);
}

.tk-cell-manual-badge {
  position: absolute;
  top: 0;
  right: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 8px 8px 0;
  border-color: transparent #2563eb transparent transparent;
  pointer-events: none;
}

.tk-cell-note-badge {
  position: absolute;
  top: 0;
  right: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 8px 8px 0;
  border-color: transparent #d97706 transparent transparent;
  pointer-events: none;
}

.tk-cell-note-badge.is-resolved {
  border-color: transparent #16a34a transparent transparent;
}

.tk-cell-note-badge.is-top-left {
  right: auto;
  left: 0;
  border-width: 8px 8px 0 0;
  border-color: #d97706 transparent transparent transparent;
}

.tk-cell-note-badge.is-top-left.is-resolved {
  border-color: #16a34a transparent transparent transparent;
}

.tk-group-row-end > td:not(.tk-owner-cell):not(.tk-shop-cell),
.tk-group-end-cell {
  border-bottom: 1px solid #475569;
}

.tk-shop-row-end > th,
.tk-shop-row-end > td,
.tk-shop-end-cell {
  border-bottom: 2px solid #334155 !important;
}

.tk-empty-box {
  padding: 36px 16px;
  text-align: center;
  color: var(--muted, #64748b);
  font-size: 13px;
}

/* 5 维执行力页签 */
.tk-exec-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 10px;
}

@media (max-width: 1120px) {
  .tk-exec-kpis {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }
}

.tk-exec-kpi-card {
  background: var(--surface, #ffffff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  padding: 10px 12px;
}

.tk-exec-kpi-label {
  font-size: 12px;
  color: var(--muted, #64748b);
}

.tk-exec-kpi-val {
  margin-top: 4px;
  font-size: 20px;
  font-weight: 700;
  color: var(--text, #0f172a);
  font-variant-numeric: tabular-nums;
}

.tk-exec-kpi-sub {
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted, #64748b);
}

.tk-exec-table-wrap {
  background: var(--surface, #ffffff);
  border: 1px solid var(--border, #cbd5e1);
  border-radius: 10px;
  overflow: auto;
  max-height: calc(100vh - 360px);
}

.tk-exec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.tk-exec-table th,
.tk-exec-table td {
  padding: 6px 8px;
  border-bottom: 1px solid #e2e8f0;
  border-right: 1px solid #f1f5f9;
  white-space: nowrap;
}

.tk-exec-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #e8eef5;
  color: #1e293b;
  font-weight: 600;
  text-align: center;
  border-bottom: 2px solid #cbd5e1;
}

.tk-exec-table td.is-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.tk-exec-inline-input {
  width: 68px;
  height: 26px;
  padding: 0 6px;
  font-size: 12px;
  text-align: right;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  background: #ffffff;
  font-variant-numeric: tabular-nums;
}

.tk-exec-inline-note {
  width: 150px;
  height: 26px;
  padding: 0 6px;
  font-size: 12px;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  background: #ffffff;
}

.tk-exec-inline-input:focus,
.tk-exec-inline-note:focus {
  outline: none;
  border-color: var(--primary, #2563eb);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.14);
}

.tk-exec-inline-input.is-invalid {
  border-color: #dc2626;
  background: #fef2f2;
}

.tk-exec-row.is-saving {
  opacity: 0.7;
}

.tk-exec-total-row td {
  background: #f1f5f9;
  font-weight: 700;
  border-top: 2px solid #cbd5e1;
}

/* 轻量浮层（单元格人工填值与批注 / 违规明细 / 阈值与店铺设置） */
.tk-popover {
  position: fixed;
  z-index: 60;
  width: 368px;
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 12px;
}

.tk-popover[hidden] {
  display: none !important;
}

.tk-popover-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.tk-popover-title {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
}

.tk-popover-sub {
  margin-top: 2px;
  font-size: 11px;
  color: #64748b;
}

.tk-popover-close {
  border: 0;
  background: transparent;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  color: #64748b;
  padding: 2px 4px;
}

.tk-popover-section {
  border-top: 1px solid #e2e8f0;
  padding-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tk-popover-section-title {
  font-size: 12px;
  font-weight: 600;
  color: #334155;
}

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

.tk-popover-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 11px;
  color: #475569;
}

.tk-popover-field input,
.tk-popover-field select,
.tk-popover-field textarea {
  width: 100%;
  box-sizing: border-box;
  font-size: 12px;
  padding: 5px 7px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
}

.tk-popover-field textarea {
  min-height: 68px;
  resize: vertical;
}

.tk-popover-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

.tk-popover-foot .button {
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
}

.tk-popover-error {
  color: #b91c1c;
  font-size: 11px;
  line-height: 1.4;
}

.tk-popover-ref {
  font-size: 11px;
  color: #1e40af;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  padding: 4px 8px;
}

.tk-popover-hint {
  font-size: 11px;
  color: #64748b;
  line-height: 1.45;
}

.tk-violation-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 160px;
  overflow-y: auto;
}

.tk-violation-item {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 6px;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.tk-violation-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 11px;
  color: #9a3412;
}

.tk-violation-id {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 600;
}

.tk-violation-reason {
  font-size: 12px;
  color: #1e293b;
  line-height: 1.4;
  word-break: break-word;
}
