.uploads {
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  gap: 8px !important;
}

.upload-card {
  min-height: 0 !important;
  padding: 10px 11px !important;
  border-radius: 12px !important;
  box-shadow: 0 5px 16px rgba(44, 38, 30, 0.045) !important;
}

.upload-card::before {
  width: 3px !important;
}

.upload-card p {
  display: none !important;
}

.upload-card h3 {
  margin: 2px 0 0 !important;
  font-size: 14px !important;
}

.upload-card .upload-no {
  font-size: 9px !important;
}

.upload-card .upload-action {
  gap: 6px !important;
  margin-top: 8px !important;
}

.upload-card .pick {
  flex: 0 0 auto;
  padding: 6px 9px !important;
  font-size: 10px !important;
}

.upload-card .file-name,
.upload-card .ready {
  font-size: 9px !important;
}

.upload-card.manager {
  --accent: var(--green);
}

.upload-card.schedule {
  --accent: #7352a3;
}

.schedule-export-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: end;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.schedule-export-controls label {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
}

.schedule-export-date {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  padding: 6px;
  color: var(--ink);
  font: inherit;
  font-size: 9px;
}

.schedule-export-button {
  border: 1px solid #7352a3;
  border-radius: 999px;
  background: #f5effd;
  padding: 6px 9px;
  color: #60418b;
  font-size: 9px;
  font-weight: 900;
  white-space: nowrap;
  cursor: pointer;
}

.schedule-export-button:disabled,
.schedule-export-date:disabled {
  cursor: not-allowed;
  opacity: .48;
}

@media (max-width: 1050px) {
  .uploads {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 700px) {
  .uploads {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 460px) {
  .uploads {
    grid-template-columns: 1fr !important;
  }
}

.top-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.penalty-rule-open {
  color: #8d1d25 !important;
  border-color: #a9252e !important;
  background: #fff6f3 !important;
}

.penalty-rule-form {
  display: grid;
  gap: 0;
}

.penalty-editor-section {
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}

.penalty-editor-section h3 {
  margin: 0 0 5px;
  font-size: 15px;
}

.penalty-editor-section > p {
  margin: 0 0 13px;
  color: var(--muted);
  font-size: 11px;
}

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

.threshold-grid label,
.content-field {
  display: grid;
  gap: 6px;
  color: #554d43;
  font-size: 12px;
  font-weight: 800;
}

.trigger-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fffdfa;
  font-size: 12px;
  font-weight: 750;
}

.trigger-grid input {
  width: 17px;
  height: 17px;
  accent-color: #a9252e;
}

.content-field + .content-field {
  margin-top: 11px;
}

.content-field textarea {
  width: 100%;
  resize: vertical;
  line-height: 1.55;
}

.penalty-form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px 22px;
}

.daily-top-card {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 85% 12%, rgba(255, 222, 119, 0.62), transparent 28%),
    linear-gradient(135deg, #7e1018 0%, #c7352c 48%, #d89222 100%) !important;
  border: 1px solid rgba(255, 218, 118, 0.74) !important;
  box-shadow: 0 12px 28px rgba(151, 32, 27, 0.22), inset 0 1px rgba(255, 255, 255, 0.28) !important;
}

.daily-top-card::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -80% -45%;
  background: linear-gradient(115deg, transparent 42%, rgba(255, 248, 210, 0.44) 50%, transparent 58%);
  transform: translateX(-45%);
  animation: daily-shine 3.2s ease-in-out infinite;
}

.daily-top-card h3 {
  color: #ffe5a0;
  letter-spacing: 0.06em;
}

.daily-top-card .daily-winner {
  border-color: rgba(255, 232, 176, 0.28);
}

.daily-top-card .daily-place {
  color: #ffe08a;
}

.daily-top-card .placeholder {
  color: rgba(255, 255, 255, 0.75);
}

.section-tools,
.penalty-title-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.capture-action {
  appearance: none;
  border: 1px solid #c9bca8;
  border-radius: 999px;
  padding: 7px 11px;
  color: #4f4639;
  background: #fffdfa;
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
  cursor: pointer;
}

.capture-action:hover {
  border-color: #a69072;
  background: #f8f1e6;
}

.capture-action:disabled {
  opacity: 0.68;
  cursor: wait;
}

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

.store-page-capture {
  width: max-content;
  min-width: 960px;
  max-width: none;
}

.store-page-capture > p {
  margin: -8px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.penalty-title-row {
  justify-content: space-between;
  margin-bottom: 7px;
}

.penalty-title-row h3 {
  margin: 0 !important;
}

.penalty-title-row .capture-action {
  border-color: rgba(255, 255, 255, 0.42);
  color: #fff;
  background: rgba(255, 255, 255, 0.13);
}

.capture-composite {
  position: fixed;
  top: 0;
  left: -10000px;
  z-index: -1;
  display: grid;
  gap: 16px;
  box-sizing: border-box;
  padding: 24px;
  color: #211e19;
  background: #f3f0e9;
}

.capture-composite > h2 {
  margin: 0;
  font: 750 25px STSong, "Songti SC", serif;
}

.capture-composite .capture-one {
  grid-template-columns: 1fr !important;
}

.capture-composite .daily-table-wrap {
  overflow: visible !important;
}

/* The punishment list needs its own compact capture layout.  Keeping the
   canvas at a readable width prevents long desktop pages from shrinking all
   copy into tiny text in the exported image. */
.penalty-capture-stage {
  width: 1200px !important;
  gap: 0;
  padding: 18px;
}

.penalty-capture-stage .penalty-section {
  width: 100%;
  border-radius: 14px;
  box-shadow: none;
}

.penalty-capture-stage .penalty-head {
  padding: 16px 18px;
}

.penalty-capture-stage .penalty-head h3 {
  font-size: 23px;
}

.penalty-capture-stage .penalty-head p {
  font-size: 13px;
  line-height: 1.5;
}

.penalty-capture-stage .penalty-item {
  grid-template-columns: minmax(0, 36%) minmax(170px, 20%) minmax(0, 44%);
  gap: 14px;
  min-height: 0;
  padding: 12px 16px;
}

.penalty-capture-stage .penalty-store b {
  font-size: 16px;
  line-height: 1.35;
}

.penalty-capture-stage .penalty-store > span,
.penalty-capture-stage .penalty-failed {
  font-size: 13px;
  line-height: 1.5;
}

.penalty-capture-stage .attendance-summary,
.penalty-capture-stage .employee-roster {
  gap: 4px;
  margin-top: 5px;
}

.penalty-capture-stage .penalty-store .attendance-chip,
.penalty-capture-stage .penalty-store .employee-status {
  padding: 4px 7px;
  font-size: 11px;
}

.penalty-capture-stage .penalty-actions {
  justify-content: flex-start;
  gap: 5px;
}

.penalty-capture-stage .penalty-chip {
  padding: 6px 9px;
  font-size: 12px;
}

.penalty-capture-stage .penalty-achieved {
  margin-top: 6px;
  padding: 7px 9px;
  font-size: 12px;
  line-height: 1.45;
}

.penalty-capture-stage .penalty-achieved b {
  font-size: 12px;
}

.penalty-capture-stage .penalty-success {
  font-size: 18px;
}

.penalty-capture-stage .penalty-crown {
  font-size: 38px;
}

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

.daily-table td.zero {
  color: #b51f2a;
  background: #fff0f0;
  font-weight: 900;
}

.penalty-section {
  overflow: hidden;
  background: var(--card);
  border: 1px solid #e3b7b9;
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.penalty-head {
  padding: 18px 20px;
  color: #fff;
  background: linear-gradient(135deg, #74141b, #b7252e);
}

.penalty-head h3 {
  margin: 0 0 7px;
  font-size: 19px;
}

.penalty-head p {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 11px;
  line-height: 1.65;
}

.penalty-list {
  display: grid;
}

.penalty-item {
  display: grid;
  grid-template-columns: minmax(260px, 1.4fr) minmax(210px, 0.9fr) minmax(230px, 1fr);
  gap: 12px;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid #eee4df;
}

.penalty-item:last-child {
  border-bottom: 0;
}

.penalty-store b,
.penalty-store span {
  display: block;
}

.penalty-store b {
  font-size: 13px;
  line-height: 1.45;
}

.penalty-store span,
.penalty-failed {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}

.penalty-not-triggered {
  display: none !important;
  margin-top: 8px;
  padding: 9px 11px;
  border: 1px solid #e5ddd1;
  border-radius: 10px;
  color: #625b52;
  background: #f8f5ef;
  line-height: 1.55;
}

.penalty-not-triggered b {
  display: block;
  margin-bottom: 3px;
  color: #3f3932;
  font-size: 11px;
}

.penalty-not-triggered ul {
  margin: 0;
  padding-left: 17px;
}

.penalty-not-triggered li + li {
  margin-top: 4px;
}

.penalty-achieved {
  margin-top: 8px;
  padding: 9px 11px;
  border: 1px solid #bfe1d1;
  border-radius: 10px;
  color: #276a50;
  background: #edf9f2;
  line-height: 1.55;
}

.penalty-achieved b {
  display: block;
  margin-bottom: 3px;
  color: #1e5c43;
  font-size: 11px;
}

.penalty-achieved ul {
  margin: 0;
  padding-left: 17px;
}

.penalty-achieved li + li {
  margin-top: 4px;
}

.attendance-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}

.employee-roster {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}

.penalty-store .employee-status {
  display: inline-flex;
  width: max-content;
  margin: 0;
  padding: 4px 7px;
  border: 1px solid transparent;
  border-radius: 7px;
  font-size: 10px;
  font-weight: 750;
  line-height: 1.2;
}

.employee-status.working { color: #146246; background: #e5f6ee; }
.employee-status.resting { color: #85551a; background: #fff0cf; }
.employee-status.other { color: #59616b; background: #edf0f2; }
.employee-status.manager { border-color: currentColor; }

.penalty-panel .action-rule-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 11px;
  align-items: stretch;
}

.action-rule-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #ece7de;
}

.action-rule-card-head b {
  font-size: 13px;
}

.rule-condition-list {
  display: grid;
  gap: 9px;
}

.rule-condition-row {
  display: grid;
  grid-template-columns: minmax(190px, .9fr) minmax(320px, 1.5fr) auto;
  gap: 10px;
  align-items: start;
  padding: 11px;
  border: 1px solid #e5dfd5;
  border-radius: 11px;
  background: #faf8f3;
}

.rule-condition-row .rule-condition-dimension,
.rule-condition-row .rule-benchmark {
  width: 100%;
}

.delete-condition,
.add-condition {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 8px 10px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.delete-condition {
  color: var(--red);
  align-self: end;
}

.add-condition {
  width: max-content;
  color: var(--blue);
}

.action-rule-footer {
  display: grid;
  grid-template-columns: minmax(220px, .8fr) minmax(300px, 1.4fr);
  gap: 10px;
  padding-top: 3px;
}

.action-rule-footer textarea {
  resize: vertical;
  min-height: 58px;
}

@media (max-width: 760px) {
  .rule-condition-row,
  .action-rule-footer {
    grid-template-columns: 1fr;
  }

  .delete-condition {
    justify-self: end;
  }
}

.store-table-section {
  display: grid;
  gap: 14px;
  margin-top: 18px;
  padding-top: 22px;
  border-top: 2px solid var(--line);
}

.upload-card.market {
  --accent: #6b4fc7;
}

.store-subview-switch {
  display: flex;
  gap: 6px;
  width: max-content;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 253, 250, .72);
}

.store-subview-btn {
  border: 0;
  border-radius: 8px;
  padding: 9px 16px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}

.store-subview-btn.active {
  background: var(--dark);
  color: #fff;
  box-shadow: 0 4px 12px rgba(23, 34, 46, .16);
}

.anomaly-dimension-filter {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 253, 250, .72);
  color: var(--ink);
}

.anomaly-dimension-filter > summary {
  padding: 12px 15px;
  list-style-position: inside;
}

.anomaly-filter-panel {
  display: grid;
  gap: 11px;
  padding: 0 14px 14px;
}

.anomaly-filter-options {
  display: grid;
  gap: 11px;
}

.anomaly-filter-group {
  display: grid;
  gap: 7px;
  padding: 11px;
  border: 1px solid #ebe5db;
  border-radius: 11px;
  background: #fff;
}

.anomaly-filter-group > b {
  color: var(--muted);
  font-size: 11px;
}

.anomaly-scope-filters {
  display: grid;
  grid-template-columns: minmax(180px, 220px) minmax(260px, 1fr) minmax(240px, 300px);
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 253, 250, .72);
}

.anomaly-scope-filters > label.corner-mode-control {
  grid-template-columns: 72px 1fr;
}

.anomaly-scope-filters > label {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.anomaly-scope-filters .store-table-picker > summary {
  background: #fff;
}

.store-table-filters {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(260px, 1fr);
  gap: 10px;
}

.store-filter-search {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px 11px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
}

.store-name-options {
  max-height: 280px;
  overflow: auto;
}

.daily-dimension-filter {
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 253, 250, .72);
}

.daily-dimension-filter > summary {
  background: #fff;
}

.weekly-history-controls {
  display: grid;
  grid-template-columns: minmax(150px, .75fr) minmax(180px, 1fr) auto minmax(260px, 1.7fr);
  gap: 10px;
  align-items: end;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 253, 250, .82);
}

.weekly-history-controls.weekly-date-controls {
  grid-template-columns: minmax(240px, .8fr) auto minmax(320px, 2.2fr);
}

.weekly-date-controls .weekly-history-status {
  min-height: 39px;
}

.weekly-delete {
  border: 1px solid #e3aeb2;
  border-radius: 9px;
  padding: 10px 13px;
  color: var(--red);
  background: #fff4f4;
  font-weight: 850;
  cursor: pointer;
}

.weekly-delete:disabled {
  cursor: not-allowed;
  opacity: .45;
}

.weekly-history-controls label {
  display: grid;
  gap: 5px;
}

.weekly-history-controls label > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
}

.weekly-save {
  border: 0;
  border-radius: 9px;
  padding: 11px 14px;
  color: #fff;
  background: var(--dark);
  font-weight: 850;
  cursor: pointer;
}

.weekly-save:disabled {
  cursor: not-allowed;
  opacity: .45;
}

.weekly-history-status {
  min-height: 39px;
  display: flex;
  align-items: center;
  padding: 8px 10px;
  border-radius: 9px;
  color: var(--muted);
  background: #f3f0e9;
  font-size: 10px;
  line-height: 1.5;
}

.weekly-table td {
  vertical-align: middle;
}

.weekly-rule-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 16px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 253, 250, .82);
}

.weekly-rule-control > div:first-child {
  display: grid;
  gap: 4px;
}

.weekly-rule-control strong {
  font-size: 12px;
}

.weekly-rule-control > div:first-child span {
  color: var(--muted);
  font-size: 10px;
}

.weekly-rule-control > button {
  border: 1px solid var(--dark);
  border-radius: 9px;
  padding: 9px 12px;
  color: var(--dark);
  background: #fff;
  font-weight: 850;
  cursor: pointer;
}

.weekly-rule-list {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.weekly-rule-list span {
  padding: 5px 8px;
  border-radius: 999px;
  color: #6c5946;
  background: #f4eee6;
  font-size: 9px;
  font-weight: 750;
}

.weekly-table td.weekly-abnormal {
  color: var(--red);
  background: var(--red-soft);
  font-weight: 850;
  box-shadow: inset 0 0 0 1px #efc1c5;
}

.weekly-table td.weekly-abnormal .weekly-mom {
  color: inherit;
  background: rgba(255, 255, 255, .7);
}

.weekly-mom {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 5px;
  border-radius: 999px;
  color: #52616d;
  background: #edf0f2;
  font-size: 8px;
  font-weight: 850;
}

.weekly-mom.up {
  color: #a51f2a;
  background: #fff0f0;
}

.weekly-mom.down {
  color: #24705a;
  background: #eaf7f1;
}

.weekly-mom.unavailable {
  color: #8b8277;
  background: #f1eee8;
}

@media (max-width: 900px) {
  .weekly-history-controls {
    grid-template-columns: 1fr 1fr;
  }

  .weekly-history-status {
    grid-column: 1 / -1;
  }
}

@media (max-width: 560px) {
  .weekly-history-controls {
    grid-template-columns: 1fr;
  }

  .weekly-history-status {
    grid-column: auto;
  }

  .weekly-history-controls.weekly-date-controls {
    grid-template-columns: 1fr;
  }

  .weekly-rule-control {
    grid-template-columns: 1fr;
  }

  .weekly-rule-control > button {
    width: 100%;
  }
}

.store-table-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.store-table-head h2 {
  margin: 0;
  font-size: 20px;
}

.store-table-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.store-table-tabs {
  display: flex;
  gap: 5px;
  padding: 4px;
  border-radius: 999px;
  background: #e8e3da;
}

.store-table-tab {
  border: 0;
  border-radius: 999px;
  padding: 8px 15px;
  color: var(--muted);
  background: transparent;
  font-weight: 800;
  cursor: pointer;
}

.store-table-tab.active {
  color: #fff;
  background: var(--dark);
}

.store-table-picker {
  position: relative;
  margin: 0;
  color: var(--ink);
  font-size: 12px;
}

.store-table-picker > summary {
  width: max-content;
  list-style: none;
  border: 1px solid var(--dark);
  border-radius: 999px;
  padding: 9px 14px;
  background: var(--card);
  font-weight: 850;
}

.store-table-picker > summary::-webkit-details-marker {
  display: none;
}

.store-table-picker-panel {
  display: grid;
  gap: 11px;
  margin-top: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.store-table-picker-tools {
  display: flex;
  gap: 8px;
}

.store-table-picker-tools button,
.store-table-save {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 11px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
}

.store-table-save {
  justify-self: start;
  border-color: var(--dark);
  color: #fff;
  background: var(--dark);
}

.store-table-options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 7px;
  max-height: 310px;
  overflow: auto;
}

.store-table-options label {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding: 8px 9px;
  border: 1px solid #ebe5db;
  border-radius: 9px;
  background: #fbfaf7;
  line-height: 1.35;
}

.store-data-region {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.store-data-table th,
.store-data-table td {
  text-align: center;
  white-space: nowrap;
}

.store-data-table th:first-child,
.store-data-table td:first-child {
  min-width: 290px;
  white-space: normal;
}

.store-data-table td.abnormal-cell {
  color: var(--red);
  background: var(--red-soft);
  font-weight: 900;
}

.store-table-empty {
  padding: 26px 20px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  color: var(--muted);
  background: rgba(255, 253, 250, .55);
  text-align: center;
  font-size: 12px;
}

.store-table-empty b,
.store-table-empty span {
  display: block;
}

.store-table-empty b {
  margin-bottom: 5px;
  color: var(--ink);
  font-size: 15px;
}

@media (max-width: 760px) {
  .anomaly-scope-filters {
    grid-template-columns: 1fr;
  }

  .store-table-filters {
    grid-template-columns: 1fr;
  }

  .store-table-head {
    align-items: stretch;
    flex-direction: column;
  }

  .store-table-tabs {
    align-self: flex-start;
  }
}

.penalty-store .attendance-chip {
  display: inline-flex;
  align-items: center;
  width: max-content;
  margin: 0;
  padding: 4px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 850;
}

.attendance-chip.working {
  color: #146246;
  background: #e5f6ee;
}

.attendance-chip.resting {
  color: #85551a;
  background: #fff0cf;
}

.attendance-chip.unknown {
  color: #6b7280;
  background: #edf0f2;
}

.attendance-chip.workforce {
  color: #3f3a6c;
  background: #efedfb;
}

.penalty-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.penalty-chip {
  border-radius: 999px;
  padding: 6px 9px;
  font-size: 11px;
  font-weight: 900;
}

.penalty-chip.online {
  color: #fff;
  background: #b51f2a;
}

.penalty-chip.written {
  color: #82510c;
  background: #fff0c8;
}

.penalty-chip.copy {
  color: #5d2b05;
  background: #f4c669;
}

.penalty-chip.pending {
  color: #5f594f;
  background: #ebe6de;
}

.penalty-item.success {
  background: linear-gradient(100deg, #fffdf7, #fff6d8 58%, #ffedb0);
}

.penalty-success {
  grid-column: 2 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: #8d5200;
  font-size: 17px;
  text-align: center;
}

.penalty-crown {
  display: inline-block;
  font-size: 46px;
  line-height: 1;
  filter: drop-shadow(0 4px 7px rgba(190, 112, 0, 0.3));
  animation: crown-float 2.4s ease-in-out infinite;
}

.penalty-empty {
  padding: 34px 20px;
  color: var(--green);
  text-align: center;
  font-weight: 800;
}

@keyframes daily-shine {
  0%, 36% { transform: translateX(-45%); opacity: 0; }
  48% { opacity: 1; }
  66%, 100% { transform: translateX(45%); opacity: 0; }
}

@keyframes crown-float {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-4px) rotate(4deg); }
}

@media (prefers-reduced-motion: reduce) {
  .daily-top-card::before { animation: none; }
  .penalty-crown { animation: none; }
}

@media (max-width: 900px) {
  .uploads {
    grid-template-columns: 1fr !important;
  }

  .penalty-item {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .penalty-success {
    grid-column: 1;
  }

  .section-tools {
    align-items: flex-end;
    flex-direction: column;
  }
}

@media (max-width: 620px) {
  .top-actions,
  .threshold-grid,
  .trigger-grid {
    width: 100%;
    grid-template-columns: 1fr;
  }

  .top-actions {
    display: grid;
  }

  .penalty-form-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }
}

.stage2-page {
  display: grid;
  gap: 18px;
}

.stage2-overview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.stage2-summary-card {
  min-height: 190px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.stage2-summary-card.time-card {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(145deg, #17222e, #31536d);
}

.stage2-kicker {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
}

.time-card .stage2-kicker {
  color: rgba(255, 255, 255, .7);
}

.stage2-summary-card > b {
  display: block;
  font: 850 clamp(34px, 5vw, 56px)/1 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.stage2-progress-track {
  height: 8px;
  margin: 18px 0;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, .15);
}

.stage2-progress-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f0bf58, #fff1a8);
}

.stage2-date-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.stage2-date-controls label {
  display: grid;
  gap: 5px;
  color: rgba(255, 255, 255, .72);
  font-size: 10px;
  font-weight: 800;
}

.stage2-date-controls input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 9px;
  padding: 9px 10px;
  color: #fff;
  background: rgba(255, 255, 255, .1);
  color-scheme: dark;
}

.average-card p {
  margin: 18px 0 6px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.stage2-average-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.stage2-average-head .stage2-kicker {
  margin: 0;
}

.stage2-scope-select {
  min-width: 104px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 30px 8px 11px;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  background: #fff;
}

.stage2-category-breakdown {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin: 8px 0 5px;
}

.stage2-category-breakdown > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.stage2-category-breakdown > b {
  border: 1px solid #dfe6eb;
  border-radius: 999px;
  padding: 5px 9px;
  color: #27445a;
  font-size: 11px;
  background: #f4f8fa;
}

.store-code-upload {
  grid-column: 1 / -1;
  align-items: stretch;
}

.store-code-editor {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.store-code-editor textarea {
  width: 100%;
  min-height: 86px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--ink);
  font: 700 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
  background: #fff;
}

.store-code-editor > div {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.store-code-warning {
  color: var(--red) !important;
  font-weight: 900;
}

@media (max-width: 720px) {
  .store-code-editor {
    grid-template-columns: 1fr;
  }

  .store-code-editor > div {
    flex-direction: row;
    flex-wrap: wrap;
  }
}

.average-card small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.6;
}

.stage2-section {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.stage2-table th,
.stage2-table td,
.stage2-table th:first-child,
.stage2-table td:first-child {
  text-align: center;
}

.stage2-table td.behind {
  color: var(--red);
  background: var(--red-soft);
  font-weight: 900;
}

.stage2-table td.ontrack {
  color: var(--green);
  font-weight: 800;
}

.stage2-table .missing-column {
  color: #9a9287;
  background: #f1eee8;
}

.stage2-empty,
.stage2-unmatched {
  padding: 28px 20px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}

.stage2-unmatched {
  border: 1px dashed var(--line);
  border-radius: 14px;
  background: rgba(255, 253, 250, .55);
}

.stage2-capture {
  display: grid;
  gap: 16px;
}

@media (max-width: 760px) {
  .stage2-overview {
    grid-template-columns: 1fr;
  }

  .stage2-date-controls {
    grid-template-columns: 1fr;
  }
}
