:root {
  color-scheme: light;
  --bg: #f6f7f8;
  --surface: #ffffff;
  --surface-muted: #f1f5f4;
  --line: #d9e1df;
  --text: #202426;
  --muted: #66706f;
  --accent: #0f766e;
  --accent-soft: #d8f1ed;
  --blue: #2563eb;
  --amber: #d97706;
  --red: #dc2626;
  --green: #15803d;
  --shadow: 0 8px 24px rgba(31, 41, 55, 0.08);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  letter-spacing: 0;
}

button,
select,
input {
  font: inherit;
}

textarea {
  font: inherit;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg);
}

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

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

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

.login-card label,
.user-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.login-card input,
.login-card button,
.user-form input,
.user-form select,
.user-form textarea,
.user-form button {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  padding: 8px 10px;
}

.login-card button,
.user-form button {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-weight: 650;
}

.button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.login-card button.secondary-button {
  border-color: var(--line);
  background: var(--surface);
  color: var(--accent);
}

.form-error {
  padding: 9px 10px;
  border: 1px solid #fecaca;
  border-radius: 6px;
  background: #fff1f2;
  color: #991b1b;
  line-height: 1.35;
}

.form-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 88px;
  padding: 18px 28px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.title-block h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 760;
  line-height: 1.2;
}

.title-block p {
  margin: 7px 0 0;
  color: var(--muted);
  line-height: 1.35;
}

.controls {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.controls label {
  display: grid;
  gap: 5px;
  min-width: 118px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}

.controls select {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  padding: 6px 30px 6px 10px;
}

.controls label.filter-disabled {
  opacity: 0.52;
}

.controls label.filter-disabled select {
  cursor: not-allowed;
  background: #f8fafc;
  color: #94a3b8;
}

.icon-button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--accent);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.icon-button:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.text-button,
.link-button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--accent);
  cursor: pointer;
  padding: 7px 11px;
  font-weight: 650;
}

.link-button {
  min-height: 0;
  border: 0;
  padding: 0;
  background: transparent;
  text-align: left;
}

.text-button:hover,
.link-button:hover {
  color: #0b5f59;
}

main {
  width: min(1540px, 100%);
  margin: 0 auto;
  padding: 20px 28px 36px;
}

.status-band {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.status-band > div {
  min-width: 0;
  padding: 14px 16px;
  background: var(--surface);
}

.label {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}

.status-band strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 15px;
  line-height: 1.35;
}

.view-tabs {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  border-bottom: 1px solid var(--line);
}

.view-tab-group {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  border-bottom: 3px solid transparent;
}

.view-tab-group.active {
  border-color: var(--accent);
}

.view-tab {
  min-height: 40px;
  padding: 8px 14px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 650;
}

.view-tab.active {
  color: var(--accent);
}

.tab-refresh-button {
  width: 28px;
  height: 28px;
  margin-right: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
}

.view-tab-group.active .tab-refresh-button {
  border-color: rgba(18, 127, 119, 0.32);
  color: var(--accent);
}

.tab-refresh-button:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.tab-refresh-button:disabled {
  cursor: wait;
  opacity: 0.56;
}

.dashboard-view {
  display: none;
}

.dashboard-view.active {
  display: block;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-top: 18px;
  padding: 2px 0 0;
}

.section-head h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
}

.section-head p {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  text-align: right;
}

.summary-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.summary-item {
  min-height: 58px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: var(--surface);
  line-height: 1.45;
  box-shadow: var(--shadow);
}

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

.kpi {
  min-width: 0;
  min-height: 122px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.kpi .name {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.3;
}

.kpi-title-meta {
  flex: 1 1 auto;
  min-width: 48px;
  color: #7f8a89;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kpi-streak {
  flex: 0 0 auto;
  max-width: 52%;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kpi-streak.pass {
  background: #dcfce7;
  color: #15803d;
}

.kpi-streak.fail {
  background: #fee2e2;
  color: #dc2626;
}

.kpi .value {
  margin-top: 12px;
  font-size: 25px;
  font-weight: 780;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.kpi .delta {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  margin-top: 12px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.kpi .delta.positive {
  background: #def7e7;
  color: var(--green);
}

.kpi .delta.negative {
  background: #fee2e2;
  color: var(--red);
}

.kpi .note {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

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

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

.grid.uneven {
  grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.65fr);
}

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.daily-performance-grid {
  align-items: stretch;
}

.daily-performance-grid > .panel {
  display: flex;
  height: 640px;
  min-height: 0;
  flex-direction: column;
}

.daily-performance-grid .chart.compact,
.daily-performance-wrap {
  flex: 1 1 auto;
  min-height: 0;
}

.table-wrap.daily-performance-wrap {
  max-height: none;
  overflow: auto;
}

.trend-panel {
  margin-top: 14px;
}

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

.panel-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 720;
  line-height: 1.25;
}

.panel-head span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
  text-align: right;
}

.chart {
  position: relative;
  min-height: 310px;
  padding: 14px 16px 16px;
}

.chart.compact {
  min-height: 300px;
}

.chart svg {
  display: block;
  width: 100%;
  height: 280px;
}

.chart.combo-chart {
  min-height: 360px;
}

.chart.combo-chart svg {
  height: 320px;
}

.chart.large-combo-chart {
  min-height: 390px;
}

.chart.large-combo-chart svg {
  height: 350px;
}

.combo-legend {
  display: flex;
  gap: 16px;
  align-items: center;
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
}

.combo-legend span {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.combo-legend i {
  display: inline-block;
  width: 20px;
  height: 8px;
  border-radius: 3px;
}

.combo-legend i.host {
  background: var(--blue);
}

.combo-legend i.profit {
  height: 3px;
  background: var(--accent);
}

.combo-bar {
  fill: var(--blue);
  opacity: 0.86;
}

.chart-hit-area {
  fill: transparent;
  pointer-events: all;
}

.chart-tooltip {
  position: absolute;
  z-index: 5;
  min-width: 220px;
  padding: 10px 12px;
  border: 1px solid rgba(15, 118, 110, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: 12px;
  line-height: 1.7;
  pointer-events: none;
}

.chart-tooltip strong {
  display: block;
  margin-bottom: 2px;
  font-size: 13px;
}

.chart-tooltip span {
  display: inline-block;
  margin: 0 0 5px;
  padding: 1px 7px;
  border-radius: 999px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 11px;
}

.task-progress-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.task-progress-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.task-progress-legend i {
  display: inline-block;
  width: 18px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
}

.task-progress-legend i.marker {
  width: 2px;
  height: 14px;
  border-radius: 0;
  background: #2f4050;
}

.task-progress-list {
  display: grid;
  gap: 14px;
}

.task-progress-item {
  min-width: 0;
}

.task-progress-head,
.task-progress-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.task-progress-head strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
  line-height: 1.35;
}

.task-progress-head span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.task-progress-head span.positive {
  color: var(--green);
}

.task-progress-head span.negative {
  color: var(--red);
}

.task-progress-bar {
  position: relative;
  height: 14px;
  margin-top: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #eef3f2;
}

.task-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
}

.task-progress-fill.negative {
  background: var(--red);
}

.task-progress-fill.positive {
  background: var(--green);
}

.task-progress-marker {
  position: absolute;
  top: -3px;
  bottom: -3px;
  width: 2px;
  background: #2f4050;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9);
}

.task-progress-foot {
  flex-wrap: wrap;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.area-evaluation {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.area-evaluation-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.area-evaluation-head strong {
  color: var(--text);
  font-size: 13px;
  line-height: 1.35;
}

.area-evaluation-head span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
  text-align: right;
}

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

.area-evaluation-card {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-left: 3px solid #9ca3af;
  border-radius: 8px;
  background: #fbfcfc;
}

.area-evaluation-card b {
  display: block;
  margin-bottom: 5px;
  color: var(--text);
  font-size: 12px;
  line-height: 1.35;
}

.area-evaluation-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.area-evaluation-card.positive {
  border-left-color: var(--green);
}

.area-evaluation-card.warning {
  border-left-color: #d97706;
}

.area-evaluation-card.negative {
  border-left-color: var(--red);
}

.monthly-task-chart {
  min-height: 190px;
  padding: 14px 16px 16px;
}

.monthly-task-list {
  display: grid;
  gap: 16px;
}

.monthly-task-row {
  min-width: 0;
}

.monthly-task-row-head,
.monthly-task-row-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.monthly-task-row-head strong {
  font-size: 14px;
  line-height: 1.3;
}

.monthly-task-row-head span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.monthly-task-row-head span.positive {
  color: var(--green);
}

.monthly-task-row-head span.negative {
  color: var(--red);
}

.monthly-task-row-foot {
  flex-wrap: wrap;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.monthly-task-bar {
  height: 18px;
  margin-top: 8px;
}

.axis text,
.chart-label {
  fill: var(--muted);
  font-size: 11px;
}

.grid-line {
  stroke: #e6ecea;
  stroke-width: 1;
}

.line-profit {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
}

.line-sales {
  fill: none;
  stroke: var(--blue);
  stroke-width: 3;
}

.bar {
  fill: var(--accent);
}

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

.dot {
  fill: var(--accent);
  stroke: #ffffff;
  stroke-width: 2;
}

.dot.warn {
  fill: var(--amber);
}

.dot.risk {
  fill: var(--red);
}

.table-wrap {
  overflow: auto;
  max-height: 480px;
}

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

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  vertical-align: top;
  line-height: 1.35;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fbfa;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

td:first-child,
td:nth-child(2),
th:first-child,
th:nth-child(2) {
  text-align: left;
}

tr.risk-row td {
  background: #fff1f2;
  color: #7f1d1d;
}

tr.risk-row .store-name {
  color: #991b1b;
}

.store-name {
  display: block;
  max-width: 210px;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.row-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  margin-top: 5px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}

.row-badge.red {
  background: #fee2e2;
  color: var(--red);
}

.risk-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  min-height: 24px;
  border-radius: 999px;
  background: #fee2e2;
  color: var(--red);
  font-weight: 800;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  max-width: 360px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 7px;
  border-radius: 999px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 12px;
  line-height: 1.25;
}

.tag.red {
  background: #fee2e2;
  color: var(--red);
}

.tag.green {
  background: #dcfce7;
  color: var(--green);
}

.completion-rate {
  font-weight: 700;
}

.completion-rate.positive {
  color: var(--green);
}

.completion-rate.warning {
  color: #d97706;
}

.completion-rate.negative {
  color: var(--red);
}

.action-list {
  display: grid;
  gap: 10px;
  max-height: 480px;
  overflow: auto;
  padding: 12px 14px 16px;
}

.action {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.action:last-child {
  border-bottom: 0;
}

.action h3 {
  margin: 0;
  font-size: 14px;
  line-height: 1.35;
}

.action h4 {
  margin: 0;
  font-size: 13px;
  line-height: 1.35;
}

.action p {
  margin: 7px 0 0;
  color: var(--muted);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
}

.report-column {
  min-width: 0;
  max-height: 520px;
  overflow: auto;
  padding: 12px 12px 14px;
  background: var(--surface);
}

.report-column h3 {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 8px;
  font-size: 15px;
  line-height: 1.3;
}

.report-column h3 span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.report-column .action {
  padding: 10px 0;
}

.report-column .action p {
  white-space: pre-line;
}

.online-report-column {
  grid-column: 1 / -1;
  max-height: 360px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 82px;
  padding: 14px 16px 16px;
}

.chip {
  display: inline-grid;
  gap: 3px;
  min-width: 164px;
  max-width: 260px;
  padding: 9px 11px;
  border: 1px solid #f1d6a4;
  border-radius: 8px;
  background: #fff9ed;
  color: #7c2d12;
}

.chip strong {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  line-height: 1.25;
}

.chip strong em {
  flex: 0 0 auto;
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
}

.chip span {
  color: #9a3412;
  font-size: 12px;
  line-height: 1.35;
}

.chip small {
  color: #9a3412;
  font-size: 12px;
  line-height: 1.25;
}

.chip.upcoming {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.chip.upcoming span,
.chip.upcoming small {
  color: #15803d;
}

.chip.pending {
  border-color: #cbd5e1;
  background: #f8fafc;
  color: #475569;
}

.chip.pending span,
.chip.pending small {
  color: #64748b;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 14px 16px 16px;
}

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

.module-card {
  display: grid;
  align-content: start;
  gap: 7px;
  min-width: 0;
  min-height: 104px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: #fbfcfc;
}

.module-card.warning {
  border-left-color: var(--amber);
  background: #fff8eb;
}

.module-card strong {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.module-card b {
  color: var(--text);
  font-size: 18px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.module-card span,
.module-card a {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.module-card a {
  color: var(--accent);
  font-weight: 650;
  text-decoration: none;
}

.module-card a:hover {
  text-decoration: underline;
}

.module-card ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.module-card li {
  margin: 2px 0;
}

.module-card.summary-card {
  min-height: 132px;
}

.analysis-list {
  min-height: 82px;
  margin: 0;
  padding: 14px 18px 16px 30px;
  color: var(--text);
  line-height: 1.45;
}

.analysis-list li {
  margin: 0 0 8px;
}

.analysis-list .analysis-reminder {
  color: var(--muted);
  font-size: 12px;
}

.shared-foot {
  margin-top: 16px;
}

.shared-foot.single {
  grid-template-columns: 1fr;
}

.admin-shell {
  min-height: 100vh;
  background: var(--bg);
  padding: 20px 28px 36px;
}

.admin-panel {
  width: min(1540px, 100%);
  margin: 0 auto;
}

.admin-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
  margin-bottom: 14px;
}

.admin-head h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
}

.admin-grid {
  margin-top: 0;
}

.admin-user-row {
  cursor: pointer;
}

.admin-user-row:hover td {
  background: #f8fbfa;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-log-panel {
  margin-top: 16px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 2px 9px;
  background: #eef2f7;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.status-pill.positive {
  background: #e8f6ef;
  color: #167047;
}

.status-pill.negative {
  background: #fff0ed;
  color: #b33b29;
}

.user-form {
  display: grid;
  gap: 12px;
  padding: 14px 16px 16px;
}

.user-form fieldset {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.user-form legend {
  color: var(--muted);
  font-size: 13px;
}

.user-form .check-line {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}

.user-form .check-line input {
  width: 16px;
  min-height: 16px;
  padding: 0;
}

.user-form textarea {
  min-height: 84px;
  resize: vertical;
}

.empty {
  padding: 18px 16px;
  color: var(--muted);
}

.loading-state {
  color: var(--accent);
}

.error-state {
  color: var(--danger);
}

.store-selector-panel {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
}

.store-selector-copy {
  min-width: 0;
}

.store-selector-copy h3 {
  margin: 5px 0 6px;
  font-size: 18px;
  line-height: 1.25;
}

.store-selector-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.store-selector-controls {
  display: flex;
  align-items: end;
  gap: 10px;
  min-width: min(520px, 100%);
}

.store-selector-controls label {
  display: grid;
  flex: 1;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.store-selector-controls select {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  padding: 7px 32px 7px 10px;
}

.store-identity-panel {
  margin-top: 14px;
}

.store-identity-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  padding: 14px 16px 16px;
}

.identity-item {
  min-width: 0;
  min-height: 72px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.identity-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.identity-item strong {
  display: block;
  margin-top: 8px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.identity-item small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.25;
}

.store-sales-grid {
  margin-top: 14px;
}

.store-analysis-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 14px 16px 16px;
}

.store-analysis-item {
  min-width: 0;
  min-height: 86px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: var(--surface-muted);
}

.store-analysis-item.positive {
  border-left-color: #16a34a;
}

.store-analysis-item.negative {
  border-left-color: #ef4444;
}

.store-analysis-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.store-analysis-item strong {
  display: block;
  margin-top: 7px;
  color: var(--text);
  font-size: 20px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.store-analysis-item small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.store-trend-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: 0 16px 14px;
  color: var(--muted);
  font-size: 12px;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 20;
  max-width: min(420px, calc(100vw - 44px));
  padding: 12px 14px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fff1f2;
  color: #991b1b;
  box-shadow: var(--shadow);
}

@media (max-width: 1120px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .controls {
    width: 100%;
    justify-content: flex-start;
  }

  .kpi-grid,
  .grid.two,
  .grid.uneven,
  .status-band,
  .summary-list,
  .report-grid,
  .module-grid,
  .store-identity-grid,
  .store-analysis-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .section-head p {
    text-align: left;
  }
}

@media (max-width: 720px) {
  .topbar {
    padding: 16px;
  }

  main {
    padding: 14px 14px 28px;
  }

  .title-block h1 {
    font-size: 20px;
  }

  .controls label {
    min-width: min(100%, 152px);
    flex: 1 1 142px;
  }

  .status-band,
  .kpi-grid,
  .grid.two,
  .grid.uneven,
  .summary-list,
  .report-grid,
  .module-grid,
  .store-identity-grid,
  .store-analysis-list {
    grid-template-columns: 1fr;
  }

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

  .view-tab-group {
    flex: 0 0 auto;
  }

  .view-tab {
    white-space: nowrap;
  }

  .module-grid.monitoring-grid {
    grid-template-columns: 1fr;
  }

  .store-selector-panel,
  .store-selector-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .area-evaluation-grid {
    grid-template-columns: 1fr;
  }

  .kpi .value {
    font-size: 22px;
  }

  .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .panel-head span {
    text-align: left;
  }

  .chart svg {
    height: 240px;
  }

  .daily-performance-grid > .panel {
    height: auto;
    min-height: 0;
  }
}
