:root {
  --ink: #17211b;
  --muted: #68746d;
  --line: #dfe6de;
  --paper: #f7f3e9;
  --panel: #fffdf6;
  --green: #2f8d59;
  --green-soft: #dff0e4;
  --red: #c85046;
  --red-soft: #f5ddd8;
  --blue: #1f5f7a;
  --blue-soft: #dcecf2;
  --gold: #a77d2a;
  --shadow: 0 10px 30px rgba(31, 45, 37, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(242, 228, 190, 0.72), rgba(214, 233, 221, 0.76)),
    radial-gradient(circle at 12% 0%, rgba(255, 255, 255, 0.85), transparent 32%),
    var(--paper);
  color: var(--ink);
  font-family: "Avenir Next", "PingFang SC", "Hiragino Sans GB", sans-serif;
}

button {
  font: inherit;
}

.date-chip {
  text-decoration: none;
  text-align: center;
}

.staffing-hero { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin: 18px 0; padding: 17px; border: 1px solid rgba(40, 73, 54, .3); border-radius: 12px; background: linear-gradient(130deg, #e7f3e7, #f9f0d8); box-shadow: var(--shadow); }
.staffing-hero h2 { margin: 2px 0 7px; font-size: 22px; }
.staffing-hero p { margin: 0; color: #395145; font-size: 14px; line-height: 1.55; }
.staffing-kicker, .section-eyebrow { color: var(--gold) !important; font-size: 12px !important; font-weight: 900; letter-spacing: .04em; }
.staffing-badge { flex: 0 0 auto; padding: 6px 8px; border: 1px solid rgba(40, 73, 54, .24); border-radius: 99px; background: rgba(255,255,255,.6); color: #284936; font-size: 12px; font-weight: 900; }
.entry-context { display: grid; gap: 12px; }
.entry-context .section-eyebrow { margin: 0; }
.staffing-form label { display: grid; gap: 7px; font-weight: 800; }
.staffing-form label > span { color: var(--ink); }
.entry-note, .submit-note { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.shift-heading { margin-top: 6px; }
.shift-heading .section-eyebrow { margin: 0 0 3px; }
.shift-heading h2 { margin: 0; font-size: 18px; }
.shift-heading p:last-child { margin: 5px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.staffing-form select, .staffing-form input {
  min-height: 46px; padding: 10px; border: 1px solid var(--line); border-radius: 8px;
  background: #fffdf6; color: var(--ink); font: inherit;
}
.shift-stack { display: grid; gap: 10px; }
.shift-card { display: grid; gap: 8px; margin: 0; padding: 14px; border: 1px solid var(--line); border-left: 4px solid var(--green); border-radius: 10px; background: var(--panel); }
.shift-card legend { padding: 0 4px; font-weight: 900; font-size: 16px; }
.shift-hint { margin: 0; color: var(--muted); font-size: 13px; }
.employee-checklist { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.employee-option { display: grid; gap: 6px; }
.employee-checklist label { display: flex; align-items: center; gap: 7px; min-height: 42px; padding: 7px 8px; border: 1px solid var(--line); border-radius: 7px; background: #fffdf6; font-weight: 700; }
.employee-checklist input { min-height: auto; width: 17px; height: 17px; margin: 0; accent-color: var(--green); }
.person-hours { display: grid; grid-template-columns: auto 30px 1fr 30px; align-items: center; gap: 5px; padding: 5px 6px; border-radius: 7px; background: #edf5ec; color: #355542; font-size: 12px; font-weight: 800; }
.person-hours[hidden] { display: none; }
.person-hours input { width: 100%; min-height: 30px; padding: 3px; border: 0; border-radius: 5px; background: #fffdf6; color: var(--ink); text-align: center; font-weight: 900; }
.hours-step { min-height: 30px; border: 0; border-radius: 5px; background: #28563a; color: #fff; font-size: 18px; font-weight: 900; cursor: pointer; }
.form-message { min-height: 20px; margin: 0; color: var(--blue); font-weight: 800; }
.form-message.is-error { color: var(--red); }
.staffing-submit { width: 100%; min-height: 52px; border-radius: 10px; }
.entry-summary { margin-top: 12px; background: #f4f8f1; border-color: #c9ddcb; }
.entry-summary h2 { margin: 2px 0 7px; font-size: 16px; }
.entry-summary p { margin: 4px 0; color: #4d5c51; font-size: 14px; }
.entry-summary strong { color: #21643f; }
.expense-heading { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin: 20px 0 10px; }
.expense-heading h2 { margin: 3px 0 0; font-size: 20px; }
.expense-stack { display: grid; gap: 10px; }
.expense-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.expense-row-heading { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; }
.expense-row label { display: grid; gap: 7px; font-weight: 800; }
.expense-row label:last-child { grid-column: 1 / -1; }
.expense-row select, .expense-row input { width: 100%; min-height: 46px; border: 1px solid #cdd9d0; border-radius: 8px; padding: 10px; background: #fffdf7; font: inherit; }
.remove-expense { border: 0; background: transparent; color: #9b4036; font: inherit; font-size: 13px; font-weight: 800; }

@media (max-width: 370px) {
  .employee-checklist { grid-template-columns: 1fr; }
}

.app-shell {
  width: min(100%, 480px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px 14px 28px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.05;
  letter-spacing: 0;
}

.date-chip,
.role-tab {
  border: 1px solid var(--line);
  background: rgba(255, 253, 246, 0.84);
  color: var(--ink);
}

.date-chip {
  min-width: 82px;
  padding: 10px 12px;
  border-radius: 8px;
  font-weight: 800;
  box-shadow: var(--shadow);
}

.role-switch {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin: 18px 0 12px;
  padding: 4px;
  border: 1px solid rgba(223, 230, 222, 0.85);
  border-radius: 8px;
  background: rgba(255, 253, 246, 0.62);
}

.role-tab {
  min-height: 38px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 800;
}

.role-tab.is-active {
  border-color: #284936;
  background: #284936;
  color: #fffdf6;
}

.status-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 246, 0.72);
  color: var(--muted);
  font-size: 13px;
}

.status-strip div {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(47, 141, 89, 0.16);
}

.screen {
  display: grid;
  gap: 12px;
  animation: page-in 240ms ease-out;
}

.hero-panel,
.panel {
  border: 1px solid rgba(213, 221, 211, 0.92);
  border-radius: 8px;
  background: rgba(255, 253, 246, 0.88);
  box-shadow: var(--shadow);
}

.hero-panel {
  padding: 16px;
  background:
    linear-gradient(145deg, rgba(40, 73, 54, 0.96), rgba(31, 95, 122, 0.88)),
    var(--panel);
  color: #fffdf6;
}

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

.hero-title p,
.panel-title p {
  margin: 0;
  color: inherit;
}

.hero-title .hero-summary {
  margin-top: 7px;
  color: rgba(255, 253, 246, 0.82);
  font-size: 14px;
  font-weight: 800;
}

.hero-title small {
  color: rgba(255, 253, 246, 0.72);
  font-weight: 700;
}

.hero-number {
  font-size: 36px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0;
}

.trend-good,
.trend-bad,
.trend-flat {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.trend-good {
  background: var(--green-soft);
  color: #176139;
}

.trend-bad {
  background: var(--red-soft);
  color: #96342e;
}

.trend-flat {
  background: var(--blue-soft);
  color: #174f68;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.metric {
  min-height: 74px;
  padding: 10px;
  border-radius: 8px;
  background: rgba(255, 253, 246, 0.14);
}

.metric span {
  display: block;
  color: rgba(255, 253, 246, 0.72);
  font-size: 12px;
}

.metric strong {
  display: block;
  margin-top: 6px;
  font-size: 19px;
  line-height: 1.1;
}

.panel {
  padding: 14px;
}

.panel-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.panel-title h2 {
  margin: 0;
  font-size: 17px;
  line-height: 1.2;
}

.panel-title p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.rank-list,
.alert-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rank-item,
.alert-item {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 8px;
  border-radius: 8px;
  background: #f5f1e7;
}

.store-link {
  width: 100%;
  border: 0;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.store-link:hover,
.store-link:focus-visible {
  background: #e8f1e7;
  outline: 2px solid rgba(47, 141, 89, 0.42);
  outline-offset: 2px;
}

.rank-num {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: #284936;
  color: #fffdf6;
  font-size: 12px;
  font-weight: 900;
}

.rank-name,
.alert-main {
  font-weight: 900;
}

.rank-sub,
.alert-sub {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.value,
.rank-value {
  text-align: right;
  font-weight: 900;
}

.rank-value strong,
.rank-value span {
  display: block;
}

.rank-value span {
  margin-top: 2px;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.spark {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  align-items: end;
  gap: 7px;
  height: 92px;
  padding: 8px 2px 0;
}

.comparison-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.comparison-item {
  min-height: 104px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f5f1e7;
}

.comparison-item span,
.comparison-item small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.comparison-item strong {
  margin: 8px 0 7px;
}

.bar {
  min-height: 14px;
  border-radius: 5px 5px 2px 2px;
  background: linear-gradient(180deg, #2f8d59, #1f5f7a);
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.action {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f5f1e7;
  color: var(--ink);
  font-weight: 900;
}

.action-primary {
  border-color: #284936;
  background: #284936;
  color: #fffdf6;
  cursor: pointer;
}

.action-primary:hover,
.action-primary:focus-visible {
  background: #1f5f7a;
  outline: 2px solid rgba(31, 95, 122, 0.42);
  outline-offset: 2px;
}

.store-action-panel { border-color: rgba(47, 141, 89, .35); background: linear-gradient(125deg, rgba(223, 240, 228, .92), rgba(255, 253, 246, .95)); }
.store-action-link { display: grid; place-items: center; text-decoration: none; }
.store-daily-entry-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

.text-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: #1f5f7a;
  font-weight: 900;
  cursor: pointer;
}

.category-list,
.product-list {
  display: grid;
  gap: 8px;
}

.category-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f5f1e7;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.category-item > span {
  font-weight: 900;
}

.category-item small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
}

.category-item.is-active,
.category-item:hover,
.category-item:focus-visible {
  border-color: #2f8d59;
  background: #e8f1e7;
  outline: none;
}

.product-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
  border-radius: 8px;
  background: #f5f1e7;
}

.product-item strong,
.product-item small,
.product-value strong,
.product-value small {
  display: block;
}

.product-item small,
.product-value small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.product-value {
  min-width: 92px;
  text-align: right;
}

.data-note {
  margin: 12px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.store-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.store-picker-item {
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f5f1e7;
  color: var(--ink);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.store-picker-item.is-active,
.store-picker-item:hover,
.store-picker-item:focus-visible {
  border-color: #2f8d59;
  background: #e8f1e7;
  outline: none;
}

.alert-item {
  grid-template-columns: 1fr auto;
}

.alert-item.is-warning {
  background: var(--red-soft);
}

.alert-item.is-info {
  background: var(--blue-soft);
}

.empty-note {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.market-filter-panel {
  padding: 14px;
}

.market-filter-panel .panel-title {
  margin-bottom: 10px;
}

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

.market-filters label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.market-filters input,
.market-filters select {
  min-width: 0;
  min-height: 42px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fffdf6;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
}

@keyframes page-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 680px) {
  .app-shell {
    width: min(100%, 760px);
    padding-inline: 22px;
  }

  .screen {
    grid-template-columns: 1.1fr 0.9fr;
    align-items: start;
  }

  .hero-panel,
  .wide {
    grid-column: 1 / -1;
  }
}

@media (max-width: 360px) {
  .expense-row { grid-template-columns: 1fr; }
  .expense-row label:last-child { grid-column: auto; }
  .expense-heading { align-items: flex-start; flex-direction: column; }
  .store-daily-entry-actions { grid-template-columns: 1fr; }
  .market-filters {
    grid-template-columns: 1fr;
  }

  .comparison-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 679px) {
  .expense-row { grid-template-columns: 1fr; }
  .expense-row label:last-child { grid-column: auto; }
  .expense-heading { align-items: flex-start; flex-direction: column; }
  .store-daily-entry-actions { grid-template-columns: 1fr; }
}

/* Internal pilot login. It stays deliberately separate from dashboard cards. */
.login-body {
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 12% 8%, rgba(208, 152, 39, 0.22), transparent 31%),
    radial-gradient(circle at 91% 91%, rgba(47, 141, 89, 0.18), transparent 36%),
    #f5f1e7;
}

.login-shell {
  width: min(100%, 470px);
}

.login-card {
  padding: 38px 30px 30px;
  border: 1px solid rgba(35, 48, 39, 0.16);
  border-radius: 18px;
  background: rgba(255, 253, 246, 0.94);
  box-shadow: 0 22px 70px rgba(35, 48, 39, 0.16);
}

.login-card h1 {
  max-width: 360px;
  margin: 11px 0 18px;
  color: var(--ink);
  font-size: clamp(30px, 7vw, 42px);
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.login-copy,
.login-status {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.75;
}

.dingtalk-login {
  width: 100%;
  min-height: 50px;
  margin: 28px 0 14px;
  border: 0;
  border-radius: 9px;
  background: #1677ff;
  color: #fff;
  font: inherit;
  font-size: 16px;
  font-weight: 900;
}

.dingtalk-login:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.login-footnote {
  margin: 16px 0 0;
  color: #6b726a;
  text-align: center;
  font-size: 12px;
}
