:root {
  --bg: #fff7e6;
  --panel: #fff;
  --line: #f1d8aa;
  --text: #231815;
  --muted: #7c6757;
  --primary: #d71920;
  --primary-dark: #b9151b;
  --accent: #f5a400;
  --danger: #b91c1c;
  --success: #15803d;
  --shadow: 0 10px 30px rgba(74, 38, 0, .08);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background:
    radial-gradient(circle at 12% 0, rgba(245, 164, 0, .22), transparent 270px),
    linear-gradient(180deg, rgba(255, 241, 207, .95), rgba(255, 247, 232, .95) 340px),
    var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei", Arial, sans-serif;
}
a { color: inherit; text-decoration: none; }
input, select, textarea, button { font: inherit; }

.wrap {
  width: min(1320px, calc(100vw - 32px));
  margin: 0 auto;
}
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 250, 240, .94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.site-topbar {
  display: grid;
  grid-template-columns: minmax(270px, auto) 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 12px 0;
}
.brand-title {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, #111 0%, #3b160e 100%);
  color: #ffd36a;
  font-size: 24px;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(74, 38, 0, .14);
}
.brand-title strong {
  display: block;
  font-size: 18px;
  line-height: 1.2;
}
.brand-title small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}
.nav {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}
.nav a {
  padding: 9px 11px;
  border-radius: 999px;
  color: #5c4638;
  font-size: 13px;
}
.nav a:hover {
  background: #fff1cf;
  color: #9a3412;
}
.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.user-pill a {
  color: var(--primary);
  font-weight: 700;
}

.main {
  min-height: 100vh;
  padding: 24px 0 32px;
}
.site-footer {
  margin-top: 8px;
  padding: 10px 0 18px;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}
.auth-main .site-footer {
  width: 100%;
  max-width: 960px;
  margin-top: -34px;
  text-align: center;
}
.auth-version {
  width: 100%;
}
.auth-main {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 16px 24px 56px;
}
h1, h2, h3, p { margin-top: 0; }
.muted {
  color: var(--muted);
  margin-bottom: 0;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 18px;
}
.brand-panel {
  position: relative;
  overflow: hidden;
  min-height: 180px;
  background:
    radial-gradient(circle at 86% 28%, rgba(255,255,255,.22), transparent 110px),
    linear-gradient(135deg, #d71920 0%, #f05a24 48%, #f5a400 100%);
  color: #fff;
  border: 0;
  padding: 26px;
}
.brand-panel::after {
  content: "HTZ";
  position: absolute;
  right: 22px;
  bottom: -18px;
  color: rgba(255,255,255,.16);
  font-size: 92px;
  font-weight: 900;
  line-height: 1;
}
.brand-panel h2 {
  margin-bottom: 10px;
  font-size: 32px;
  letter-spacing: 0;
}
.brand-panel .muted { color: rgba(255,255,255,.86); }
.auth-card { width: min(440px, 100%); }
.login-shell {
  width: min(960px, calc(100vw - 32px));
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, .95fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(74, 38, 0, .14);
  transform: translateY(-4vh);
}
.login-brand {
  position: relative;
  min-height: 420px;
  padding: 42px;
  background:
    radial-gradient(circle at 78% 18%, rgba(255,255,255,.22), transparent 130px),
    linear-gradient(135deg, #d71920 0%, #f05a24 52%, #f5a400 100%);
  color: #fff;
}
.login-brand::after {
  content: "HTZ";
  position: absolute;
  right: 24px;
  bottom: -20px;
  color: rgba(255,255,255,.16);
  font-size: 112px;
  font-weight: 900;
  line-height: 1;
}
.login-logo {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 14px;
  background: #111;
  color: #ffd36a;
  font-size: 30px;
  font-weight: 900;
  margin-bottom: 24px;
}
.login-brand h1 {
  max-width: 360px;
  margin-bottom: 14px;
  font-size: 34px;
  line-height: 1.18;
}
.login-brand p {
  max-width: 360px;
  color: rgba(255,255,255,.86);
  line-height: 1.8;
}
.login-tags {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 28px;
}
.login-tags span {
  border: 1px solid rgba(255,255,255,.36);
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(255,255,255,.14);
}
.login-card {
  display: grid;
  align-content: center;
  gap: 16px;
  padding: 42px;
}
.login-title span {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--primary);
  font-weight: 900;
  font-size: 12px;
  letter-spacing: 1.5px;
}
.login-title h2 {
  margin-bottom: 0;
  font-size: 30px;
}
.remember-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #5c4638;
  font-size: 13px;
}
.remember-line input {
  width: auto;
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.hero-board {
  display: grid;
  grid-template-columns: minmax(0, 1.28fr) minmax(300px, .72fr);
  gap: 18px;
}
.status-panel {
  background: #111;
  color: #fff;
  border: 0;
}
.status-panel .muted {
  color: rgba(255,255,255,.72);
}
.status-number {
  display: block;
  margin-top: 12px;
  font-size: 30px;
  font-weight: 800;
  color: #ffd36a;
}
.metric {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  box-shadow: var(--shadow);
}
.metric span {
  color: var(--muted);
  font-size: 13px;
}
.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 26px;
}
.overview-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 4px 0 14px;
}
.overview-title h1,
.overview-title h2 {
  position: relative;
  margin-bottom: 4px;
  padding-left: 18px;
  font-size: 25px;
}
.overview-title h1::before,
.overview-title h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  width: 5px;
  height: 28px;
  border-radius: 4px;
  background: var(--primary);
}
.overview-title h1::after,
.overview-title h2::after {
  content: "";
  display: inline-block;
  width: 32px;
  height: 5px;
  margin-left: 10px;
  border-radius: 999px;
  vertical-align: middle;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}
.overview-title p,
.overview-title span {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
.overview-title.compact {
  margin-top: 22px;
}
.overview-card,
.overview-filter-card {
  position: relative;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.78);
  box-shadow: var(--shadow);
}
.overview-card,
.overview-filter-card {
  padding: 18px;
}
.overview-filter-card::before,
.overview-metric::before,
.overview-panel::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 5px;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}
.overview-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.overview-card-head h2 {
  margin-bottom: 0;
  font-size: 20px;
}
.overview-card-head span {
  color: var(--muted);
  font-size: 13px;
}
.compare-mode-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: -2px 0 14px;
}
.compare-mode-pills a {
  border: 1px solid #f1d8aa;
  border-radius: 999px;
  background: #fffdf8;
  color: #7c2d12;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}
.compare-mode-pills a.active,
.compare-mode-pills a:hover {
  border-color: #f97316;
  background: #fff1cf;
  color: #dc2626;
}
.overview-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  align-items: end;
}
.overview-filters input,
.overview-filters select {
  height: 50px;
  border-radius: 8px;
  background: #fffdf9;
}
.overview-filter-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  min-width: 160px;
}
.dark-button {
  border-color: #2b1014 !important;
  background: #1f0d10 !important;
  color: #fff !important;
}
.overview-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.profit-kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.decision-brief {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  align-items: center;
  overflow: hidden;
  margin-bottom: 16px;
  padding: 22px 24px;
  border: 1px solid #f1d8aa;
  border-left: 6px solid #f97316;
  border-radius: 8px;
  background: #fffdf8;
  box-shadow: var(--shadow);
}
.decision-brief.danger {
  border-left-color: #dc2626;
  background: #fff8f7;
}
.decision-brief.warning {
  border-left-color: #f97316;
  background: #fffaf0;
}
.decision-brief.good {
  border-left-color: #16a34a;
  background: #f8fff9;
}
.decision-brief.neutral {
  border-left-color: #a16207;
}
.decision-eyebrow {
  display: inline-block;
  margin-bottom: 6px;
  color: #9a3412;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
}
.decision-brief-copy h2 {
  margin: 0;
  color: #231815;
  font-size: 24px;
  line-height: 1.3;
}
.decision-brief-copy p {
  max-width: 920px;
  margin: 8px 0 0;
  color: #745f55;
  font-size: 14px;
  line-height: 1.7;
}
.decision-brief-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(96px, 1fr));
  gap: 8px;
}
.decision-brief-facts:empty { display: none; }
.decision-brief-facts > div {
  min-width: 104px;
  padding: 11px 12px;
  border: 1px solid #f1d8aa;
  border-radius: 8px;
  background: rgba(255,255,255,.84);
}
.decision-brief-facts span,
.decision-brief-facts strong {
  display: block;
}
.decision-brief-facts span {
  color: var(--muted);
  font-size: 12px;
}
.decision-brief-facts strong {
  margin-top: 4px;
  color: #231815;
  font-size: 17px;
}
.decision-metric {
  position: relative;
  min-height: 108px;
  overflow: hidden;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.88);
  box-shadow: var(--shadow);
}
.decision-metric::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: #a16207;
}
.decision-metric.danger::before { background: #dc2626; }
.decision-metric.warning::before { background: #f97316; }
.decision-metric.good::before { background: #16a34a; }
.decision-metric span,
.decision-metric small,
.decision-metric strong {
  display: block;
}
.decision-metric span {
  color: var(--muted);
  font-size: 12px;
}
.decision-metric strong {
  margin-top: 8px;
  color: #231815;
  font-size: 23px;
  line-height: 1.1;
}
.decision-metric.danger strong { color: #991b1b; }
.decision-metric.good strong { color: #166534; }
.decision-metric small {
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}
.overview-metric {
  position: relative;
  min-height: 116px;
  padding: 17px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.82);
  box-shadow: var(--shadow);
}
.overview-metric span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}
.overview-metric strong {
  display: block;
  margin-top: 8px;
  font-size: 26px;
  line-height: 1.15;
}
.overview-channel-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.overview-panel {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255,255,255,.84);
  box-shadow: var(--shadow);
}
.overview-panel h3 {
  margin: 0;
  padding: 15px 16px;
  background: #fff1cf;
  border-bottom: 1px solid var(--line);
  font-size: 17px;
}
.overview-line {
  margin: 12px 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf9;
}
.overview-line span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 6px;
}
.overview-line strong {
  font-size: 21px;
}
.overview-metric em,
.overview-line em {
  display: inline-block;
  margin-left: 4px;
  font-style: italic;
  font-size: 14px;
}
.overview-metric em {
  margin-top: 6px;
}
.overview-metric em.up,
.overview-line em.up {
  color: #047857;
}
.overview-metric em.down,
.overview-line em.down {
  color: #dc2626;
}
.overview-metric em.flat,
.overview-line em.flat {
  color: var(--muted);
}
.data-note {
  margin: -6px 0 18px;
}
.dashboard-command-title {
  align-items: center;
}
.dashboard-command-filter {
  padding: 14px 18px 18px;
}
.dashboard-filter-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.dashboard-filter-heading .compare-mode-pills {
  margin: 0 0 12px;
}
.dashboard-filter-heading > span {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 12px;
}
.dashboard-command-filters {
  display: grid;
  grid-template-columns: minmax(160px, .85fr) minmax(220px, 1.35fr) repeat(2, minmax(160px, 1fr)) auto;
  gap: 12px;
  align-items: end;
}
.dashboard-command-filters input,
.dashboard-command-filters select {
  height: 46px;
  border-radius: 7px;
  background: #fffdf9;
}
.dashboard-store-picker {
  position: relative;
}
.dashboard-store-picker > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  height: 46px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fffdf9;
  color: #231815;
  cursor: pointer;
  list-style: none;
}
.dashboard-store-picker > summary::-webkit-details-marker { display: none; }
.dashboard-store-picker > summary::after {
  content: "⌄";
  color: var(--muted);
  font-size: 16px;
}
.dashboard-store-picker > summary b {
  margin-left: auto;
  padding: 3px 7px;
  border-radius: 999px;
  background: #fff1cf;
  color: #9a3412;
  font-size: 10px;
}
.dashboard-store-picker-panel {
  position: absolute;
  z-index: 20;
  top: calc(100% + 7px);
  left: 0;
  width: min(430px, 82vw);
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 38px rgba(70, 38, 20, .2);
}
.dashboard-store-picker-panel > input[type="search"] {
  width: 100%;
  height: 40px;
}
.dashboard-store-picker-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
}
.dashboard-store-picker-actions button { min-height: 34px; }
.dashboard-store-picker-note {
  display: block;
  margin: 8px 0;
  color: var(--muted);
  font-size: 11px;
}
.dashboard-store-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 3px;
}
.dashboard-store-options > label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  padding: 8px;
  border: 1px solid #f1e2c8;
  border-radius: 6px;
  background: #fffdf9;
  cursor: pointer;
}
.dashboard-store-options > label:hover { background: #fff4d8; }
.dashboard-store-options input {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin-top: 2px;
}
.dashboard-store-options span,
.dashboard-store-options strong,
.dashboard-store-options small { display: block; min-width: 0; }
.dashboard-store-options strong {
  overflow-wrap: anywhere;
  color: #231815;
  font-size: 12px;
}
.dashboard-store-options small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}
.dashboard-command-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}
.dashboard-data-status {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.72);
  box-shadow: var(--shadow);
}
.dashboard-data-status > div {
  min-width: 0;
  padding: 12px 16px;
  border-right: 1px solid var(--line);
}
.dashboard-data-status > div:last-child { border-right: 0; }
.dashboard-data-status span,
.dashboard-data-status strong {
  display: block;
}
.dashboard-data-status span {
  color: var(--muted);
  font-size: 11px;
}
.dashboard-data-status strong {
  margin-top: 4px;
  overflow-wrap: anywhere;
  color: #231815;
  font-size: 14px;
}
.dashboard-data-status small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}
.dashboard-problem-board {
  display: grid;
  grid-template-columns: minmax(260px, .72fr) minmax(0, 2fr);
  gap: 14px;
  margin-bottom: 20px;
}
.dashboard-problem-list,
.dashboard-priority-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.84);
  box-shadow: var(--shadow);
}
.dashboard-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 66px;
  padding: 12px 15px;
  border-bottom: 1px solid var(--line);
  background: #fff8e7;
}
.dashboard-section-head span,
.dashboard-section-head small {
  color: var(--muted);
  font-size: 11px;
}
.dashboard-section-head h2 {
  margin: 2px 0 0;
  font-size: 18px;
}
.dashboard-problem-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 62px;
  padding: 10px 15px;
  border: 0;
  border-bottom: 1px solid #f3e5cc;
  border-radius: 0;
  background: transparent;
  color: #231815;
  text-align: left;
  box-shadow: none;
}
.dashboard-problem-item:hover,
.dashboard-problem-item.active {
  transform: none;
  background: #fff3d8;
  color: #9a3412;
}
.dashboard-problem-item.active {
  box-shadow: inset 4px 0 #dc2626;
}
.dashboard-problem-item span,
.dashboard-problem-item strong,
.dashboard-problem-item small {
  display: block;
}
.dashboard-problem-item strong { font-size: 13px; }
.dashboard-problem-item small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}
.dashboard-problem-item > b {
  flex: 0 0 auto;
  color: #231815;
  font-size: 16px;
}
.dashboard-problem-item.danger > b { color: #b91c1c; }
.dashboard-problem-item.warning > b { color: #c2410c; }
.dashboard-priority-table {
  max-height: 520px;
  overflow: auto;
  border-bottom: 1px solid var(--line);
}
.dashboard-priority-table table {
  min-width: 780px;
  margin: 0;
}
.dashboard-priority-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fffdf8;
}
.dashboard-priority-row {
  transition: background .15s ease;
}
.dashboard-priority-row:hover,
.dashboard-priority-row.selected {
  background: #fff6df;
}
.dashboard-priority-row.danger { box-shadow: inset 3px 0 #dc2626; }
.dashboard-priority-row.warning { box-shadow: inset 3px 0 #f97316; }
.dashboard-rank {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #2b1014;
  color: #fff;
  font-size: 12px;
}
.dashboard-store-trigger {
  padding: 0;
  border: 0;
  background: transparent;
  color: #231815;
  text-align: left;
  box-shadow: none;
}
.dashboard-store-trigger:hover {
  transform: none;
  color: #dc2626;
}
.dashboard-store-trigger strong,
.dashboard-store-trigger small,
.dashboard-priority-row td > strong,
.dashboard-priority-row td > small {
  display: block;
}
.dashboard-store-trigger small,
.dashboard-priority-row td > small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}
.dashboard-row-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 5px;
}
.dashboard-row-tags span {
  display: inline-flex;
  padding: 2px 6px;
  border-radius: 999px;
  background: #f3eee6;
  color: #6b5a52;
  font-size: 10px;
  line-height: 1.35;
}
.dashboard-row-tags span.danger { background: #fee2e2; color: #991b1b; }
.dashboard-row-tags span.warning { background: #ffedd5; color: #9a3412; }
.dashboard-impact {
  white-space: nowrap;
  font-weight: 900;
}
.dashboard-impact.danger { color: #b91c1c; }
.dashboard-impact.warning { color: #c2410c; }
.dashboard-store-quick {
  padding: 15px;
  background: #fffdf9;
}
.dashboard-store-quick-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.dashboard-store-quick-head span,
.dashboard-store-quick-head small {
  color: var(--muted);
  font-size: 11px;
}
.dashboard-store-quick-head h3 {
  margin: 3px 0 0;
  font-size: 18px;
}
.dashboard-quick-metrics,
.dashboard-quick-conclusion {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.dashboard-quick-metrics > div,
.dashboard-quick-conclusion > div {
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}
.dashboard-quick-conclusion { margin-top: 8px; }
.dashboard-quick-conclusion > div { background: #fffaf0; }
.dashboard-quick-metrics span,
.dashboard-quick-conclusion span,
.dashboard-quick-metrics strong,
.dashboard-quick-conclusion strong {
  display: block;
}
.dashboard-quick-metrics span,
.dashboard-quick-conclusion span {
  color: var(--muted);
  font-size: 11px;
}
.dashboard-quick-metrics strong,
.dashboard-quick-conclusion strong {
  margin-top: 4px;
  overflow-wrap: anywhere;
  color: #231815;
  font-size: 13px;
  line-height: 1.4;
}
.dashboard-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.dashboard-secondary-title { margin-top: 0; }
.dashboard-lower-grid {
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
  gap: 14px;
}
.dashboard-lower-grid .overview-card { margin-bottom: 0; }
.dashboard-threshold-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.dashboard-threshold-grid em {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}
.dashboard-threshold-grid em.up { color: #138a59; }
.dashboard-threshold-grid em.down { color: #d82929; }
.dashboard-threshold-grid > div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fffdf9;
}
.dashboard-threshold-grid span,
.dashboard-threshold-grid strong,
.dashboard-threshold-grid small {
  display: block;
}
.dashboard-threshold-grid span,
.dashboard-threshold-grid small {
  color: var(--muted);
  font-size: 11px;
}
.dashboard-threshold-grid strong {
  margin: 7px 0;
  color: #231815;
  font-size: 22px;
}
.dashboard-activity-filter {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: -3px 0 11px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.dashboard-activity-filter label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.dashboard-activity-filter select {
  min-width: 180px;
  height: 38px;
}
.dashboard-activity-filter a {
  color: #dc2626;
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
}
.dashboard-empty-state { border-left: 5px solid #f97316; }
.data-source-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border-bottom: 1px solid #f1d8aa;
  background: #fffdf8;
  color: var(--muted);
  font-size: 12px;
}
.data-source-bar b {
  border: 1px solid #f1d8aa;
  border-radius: 999px;
  background: #fff1cf;
  color: #7c2d12;
  padding: 4px 8px;
  font-weight: 800;
}
.data-source-bar a {
  margin-left: auto;
  color: #dc2626;
  font-weight: 800;
  text-decoration: none;
}
.threshold-follow .data-source-bar {
  flex: 1 1 100%;
  margin: 8px -16px -16px;
  border-top: 1px solid #f1d8aa;
  border-bottom: 0;
}
.data-source-hint {
  overflow: hidden;
  margin: 12px 0 18px;
  border: 1px solid #f1d8aa;
  border-radius: 8px;
  background: #fffaf0;
}
.operation-card .data-source-hint {
  margin: 10px 0 14px;
}
.data-source-hint-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 10px 13px;
  border-bottom: 1px solid #f1d8aa;
}
.data-source-hint-head strong {
  color: #7c2d12;
  font-size: 13px;
}
.data-source-hint-head a {
  color: #dc2626;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}
.data-source-hint-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1px;
  background: #f1d8aa;
}
.data-source-hint-list > div {
  min-width: 0;
  padding: 11px 13px;
  background: #fffdf8;
}
.data-source-hint-list span,
.data-source-hint-list strong,
.data-source-hint-list small {
  display: block;
}
.data-source-hint-list span {
  color: #9a3412;
  font-size: 12px;
  font-weight: 800;
}
.data-source-hint-list strong {
  margin-top: 4px;
  overflow-wrap: anywhere;
  color: #231815;
  font-size: 13px;
}
.data-source-hint-list small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}
.data-source-guide {
  margin: 18px 0;
  border: 1px solid #f1d8aa;
  border-radius: 8px;
  overflow: hidden;
  background: #fffdf8;
}
.data-source-guide-head {
  padding: 13px 15px;
  background: #fff1cf;
  border-bottom: 1px solid #f1d8aa;
}
.data-source-guide-head h3 {
  margin: 0;
  color: #231815;
  font-size: 16px;
}
.data-source-guide-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.export-file-guide {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
}
.export-file-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid #f1d8aa;
  border-radius: 8px;
  background: #fff;
}
.export-file-card.manual {
  grid-column: 1 / -1;
  background: #fffaf0;
}
.export-file-title {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  padding-bottom: 11px;
  border-bottom: 1px dashed #efd9b4;
}
.export-file-title span,
.export-file-title strong,
.export-file-title small {
  display: block;
}
.export-file-title span {
  color: #9a3412;
  font-size: 14px;
  font-weight: 900;
}
.export-file-title strong {
  margin-top: 4px;
  overflow-wrap: anywhere;
  color: #231815;
  font-size: 12px;
}
.export-file-title small {
  max-width: 42%;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
  text-align: right;
}
.export-field-group {
  margin-top: 11px;
}
.export-field-group > b {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
}
.export-field-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.export-field-chips span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 8px;
  border: 1px solid #ead8bb;
  border-radius: 6px;
  background: #fffaf0;
  color: #5b463f;
  font-size: 11px;
  line-height: 1.35;
}
.export-field-group.required .export-field-chips span {
  border-color: #f2b8b5;
  background: #fff1f0;
  color: #a61b1b;
  font-weight: 800;
}
.export-field-group.settings .export-field-chips span {
  border-color: #f1d18d;
  background: #fff6dc;
  color: #7c2d12;
}
.export-field-group.recommended .export-field-chips span {
  background: #f8f7f4;
  color: #6b625e;
}
.data-source-hint-list .export-field-group {
  margin-top: 9px;
}
.data-source-hint-list .export-field-group > b {
  display: block;
  margin: 0 0 5px;
}
.data-source-hint-list .export-field-chips span {
  display: inline-flex;
}
.export-field-warning {
  margin: 11px 0 0;
  padding: 8px 10px;
  border-left: 3px solid #dc2626;
  background: #fff5f5;
  color: #991b1b;
  font-size: 11px;
  line-height: 1.5;
}

@media (max-width: 900px) {
  .export-file-guide {
    grid-template-columns: 1fr;
  }
  .export-file-card.manual {
    grid-column: auto;
  }
  .export-file-title {
    display: block;
  }
  .export-file-title small {
    max-width: none;
    margin-top: 6px;
    text-align: left;
  }
}

@media (max-width: 600px) {
  .dashboard-command-filters,
  .dashboard-quick-metrics,
  .dashboard-quick-conclusion {
    grid-template-columns: 1fr;
  }
  .dashboard-command-filters .overview-filter-actions {
    grid-column: auto;
  }
  .dashboard-command-filter,
  .dashboard-store-quick {
    padding: 13px;
  }
}

/* AI经营分析 */
.ai-title { align-items: center; }
.ai-control-panel { padding: 16px 18px 18px; }
.ai-analysis-form { display: grid; gap: 15px; }
.ai-provider-select {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.ai-provider-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 68px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  cursor: pointer;
}
.ai-provider-option:has(input:checked) {
  border-color: #ef4444;
  box-shadow: inset 4px 0 0 var(--primary);
  background: #fff8f7;
}
.ai-provider-option.inactive { opacity: .68; }
.ai-provider-option span,
.ai-provider-option strong,
.ai-provider-option small { display: block; min-width: 0; }
.ai-provider-option strong { font-size: 15px; }
.ai-provider-option small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.ai-provider-option b {
  padding: 4px 7px;
  border-radius: 999px;
  background: #ecfdf3;
  color: #166534;
  font-size: 10px;
}
.ai-provider-option.inactive b { background: #fff1cf; color: #9a3412; }
.ai-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  align-items: end;
}
.ai-filter-grid input,
.ai-filter-grid select { height: 46px; border-radius: 7px; background: #fffdf9; }
.ai-generate-button {
  min-height: 46px;
  padding-inline: 20px;
  box-shadow: 0 8px 18px rgba(215, 25, 32, .18);
}
.ai-generate-button:disabled { cursor: not-allowed; opacity: .45; }
.ai-config-needed {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #f8c56b;
  border-radius: 7px;
  background: #fff8e8;
  color: #9a3412;
  font-size: 12px;
}
.ai-preview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.ai-empty-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 110px;
  border-style: dashed;
}
.ai-empty-result strong { display: block; margin-bottom: 6px; font-size: 20px; }
.ai-empty-result p { margin: 0; color: var(--muted); }
.ai-empty-result > span { color: var(--muted); font-size: 12px; }
.ai-result-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.ai-result-section.priority { border-top: 4px solid #dc2626; }
.ai-result-section.opportunity { border-top: 4px solid #16a34a; }
.ai-advice-item {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 10px;
  padding: 13px 0;
  border-top: 1px dashed var(--line);
}
.ai-advice-item:first-of-type { border-top: 0; padding-top: 2px; }
.ai-advice-item > b {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: #fff1cf;
  color: #9a3412;
  font-size: 12px;
}
.ai-advice-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ai-advice-head strong { font-size: 15px; }
.ai-advice-head span { padding: 3px 7px; border-radius: 999px; background: #fff3f2; color: #991b1b; font-size: 11px; }
.ai-advice-item dl {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 5px 8px;
  margin: 9px 0 0;
  font-size: 12px;
  line-height: 1.55;
}
.ai-advice-item dt { color: #9a3412; font-weight: 800; }
.ai-advice-item dd { margin: 0; color: var(--muted); }
.ai-gap-list { display: flex; flex-wrap: wrap; gap: 8px; }
.ai-gap-list span { padding: 7px 9px; border-radius: 7px; background: #fff1cf; color: #7c2d12; font-size: 12px; }
.ai-gap-list span.good { background: #ecfdf3; color: #166534; }
.ai-settings { padding: 0; overflow: hidden; }
.ai-settings > summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 17px 18px;
  cursor: pointer;
  list-style: none;
}
.ai-settings > summary::-webkit-details-marker { display: none; }
.ai-settings > summary span,
.ai-settings > summary strong,
.ai-settings > summary small { display: block; }
.ai-settings > summary small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.ai-settings > summary b { color: var(--primary); font-size: 12px; }
.ai-settings > form { border-top: 1px solid var(--line); padding: 18px; }
.ai-settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.ai-settings-grid > section { padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: #fffdf8; }
.ai-settings-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.ai-settings-head strong,
.ai-settings-head small { display: block; }
.ai-settings-head small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.ai-settings-options { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 10px; color: var(--muted); font-size: 12px; }
.ai-settings-options input[type="number"] { width: 64px; min-height: 34px; padding: 5px; }
.ai-run-status { display: inline-block; padding: 4px 7px; border-radius: 999px; font-size: 11px; }
.ai-run-status.success { background: #ecfdf3; color: #166534; }
.ai-run-status.failed { background: #fef2f2; color: #991b1b; }
.ai-first-question {
  display: grid;
  gap: 10px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}
.ai-first-question > div:first-child { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.ai-first-question > div:first-child strong { font-size: 17px; }
.ai-first-question > div:first-child span { color: var(--muted); font-size: 12px; }
.ai-first-question textarea { min-height: 82px; background: #fff; font-size: 14px; line-height: 1.65; }
.ai-quick-prompts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ai-quick-prompts .ai-generate-button { margin-left: auto; min-width: 132px; }
.ai-current-scope {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 18px;
}
.ai-current-scope span,
.ai-current-scope strong,
.ai-current-scope small { display: block; }
.ai-current-scope span { color: #9a3412; font-size: 11px; font-weight: 800; }
.ai-current-scope strong { margin-top: 3px; font-size: 17px; }
.ai-current-scope small { margin-top: 3px; color: var(--muted); }
.ai-chat-layout {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  gap: 14px;
  margin-bottom: 18px;
  align-items: stretch;
}
.ai-chat-sidebar { padding: 0; overflow: hidden; }
.ai-chat-sidebar-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  border-bottom: 1px solid var(--line);
}
.ai-chat-sidebar-head a { color: var(--primary); font-size: 12px; font-weight: 800; }
.ai-conversation-list { display: grid; max-height: 650px; overflow-y: auto; padding: 7px; }
.ai-conversation-list > a {
  display: grid;
  gap: 5px;
  padding: 11px 10px;
  border-left: 3px solid transparent;
  border-radius: 6px;
  color: var(--text);
}
.ai-conversation-list > a:hover { background: #fff8e8; }
.ai-conversation-list > a.active { border-left-color: var(--primary); background: #fff3f2; }
.ai-conversation-list strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.ai-conversation-list span { color: var(--muted); font-size: 10px; }
.ai-conversation-list > p { padding: 12px 8px; }
.ai-chat-panel { display: flex; flex-direction: column; min-height: 460px; padding: 0; overflow: hidden; }
.ai-chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
  background: #fffdf8;
}
.ai-chat-head span { color: #9a3412; font-size: 10px; font-weight: 800; }
.ai-chat-head h2 { margin: 3px 0 0; font-size: 18px; }
.ai-chat-head > small { color: var(--muted); white-space: nowrap; }
.ai-message-list { display: grid; gap: 18px; flex: 1; max-height: 650px; overflow-y: auto; padding: 20px; background: #fffefa; }
.ai-message { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; align-items: start; }
.ai-message.user { grid-template-columns: minmax(0, 1fr) 34px; }
.ai-message.user .ai-message-avatar { grid-column: 2; }
.ai-message.user > div:last-child { grid-column: 1; grid-row: 1; justify-self: end; }
.ai-message-avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 7px;
  background: #231815;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}
.ai-message.user .ai-message-avatar { background: var(--primary); }
.ai-message > div:last-child { min-width: 0; max-width: 88%; }
.ai-message > div:last-child > span { color: var(--muted); font-size: 10px; }
.ai-message p {
  margin: 5px 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  line-height: 1.75;
  overflow-wrap: anywhere;
}
.ai-message.user p { border-color: #ffd0cc; background: #fff3f2; }
.ai-message.failed p { border-color: #fecaca; background: #fef2f2; color: #991b1b; }
.ai-message > div:last-child > small { color: #a08c82; font-size: 9px; }
.ai-chat-composer { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 14px 16px 8px; border-top: 1px solid var(--line); background: #fff; }
.ai-chat-composer textarea { min-height: 68px; max-height: 180px; font-size: 14px; line-height: 1.55; }
.ai-chat-composer button { min-width: 108px; }
.ai-chat-note { display: block; padding: 0 16px 12px; color: var(--muted); background: #fff; font-size: 10px; }
.ai-chat-welcome { display: flex; align-items: center; justify-content: center; gap: 14px; flex: 1; padding: 40px; }
.ai-chat-welcome > span { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 8px; background: #231815; color: #fff; font-weight: 900; }
.ai-chat-welcome strong { display: block; font-size: 18px; }
.ai-chat-welcome p { max-width: 520px; margin: 7px 0 0; color: var(--muted); line-height: 1.65; }

@media (max-width: 1100px) {
  .ai-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ai-generate-button { grid-column: 1 / -1; }
  .ai-preview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ai-chat-layout { grid-template-columns: 210px minmax(0, 1fr); }
}

@media (max-width: 700px) {
  .ai-title,
  .ai-empty-result { align-items: flex-start; flex-direction: column; }
  .ai-provider-select,
  .ai-filter-grid,
  .ai-preview-grid,
  .ai-result-columns,
  .ai-settings-grid { grid-template-columns: 1fr; }
  .ai-generate-button { grid-column: auto; }
  .ai-quick-prompts .ai-generate-button { width: 100%; margin-left: 0; }
  .ai-current-scope { align-items: flex-start; }
  .ai-chat-layout { grid-template-columns: 1fr; }
  .ai-conversation-list { grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: 190px; }
  .ai-message > div:last-child { max-width: 100%; }
  .ai-chat-composer { grid-template-columns: 1fr; }
  .ai-chat-composer button { min-height: 44px; }
}

/* v1.0.43 decision dashboard and global assistant */
.nav a.active,
.nav-more > summary.active {
  background: #231815;
  color: #fff;
}
.nav-more { position: relative; }
.nav-more > summary {
  padding: 9px 11px;
  border-radius: 999px;
  color: #5c4638;
  cursor: pointer;
  font-size: 13px;
  list-style: none;
}
.nav-more > summary::-webkit-details-marker { display: none; }
.nav-more > summary::after { content: "⌄"; margin-left: 5px; }
.nav-more[open] > summary { background: #fff1cf; color: #9a3412; }
.nav-more > div {
  position: absolute;
  z-index: 50;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  width: 180px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 36px rgba(74, 38, 0, .16);
}
.nav-more > div a { border-radius: 6px; }
.page-title-actions { display: flex; align-items: center; gap: 10px; }
.dashboard-visual-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(280px, .8fr);
  gap: 14px;
  margin-bottom: 18px;
}
.visual-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid #ead6ad;
  border-radius: 8px;
  background: rgba(255,255,255,.92);
  box-shadow: 0 8px 24px rgba(74,38,0,.06);
}
.visual-card-wide { grid-column: span 2; }
.visual-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}
.visual-card-head span,
.visual-card-head small { color: var(--muted); font-size: 11px; }
.visual-card-head span { color: #b91c1c; font-weight: 900; }
.visual-card-head h2 { margin: 3px 0 0; font-size: 17px; }
.chart-canvas { width: 100%; height: 260px; }
.chart-canvas-tall { height: 300px; }
.chart-empty {
  display: grid;
  place-items: center;
  min-height: 240px;
  color: var(--muted);
  font-size: 13px;
}
.dashboard-deep-dive {
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.78);
  box-shadow: var(--shadow);
}
.dashboard-deep-dive > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 72px;
  padding: 14px 18px;
  cursor: pointer;
  list-style: none;
}
.dashboard-deep-dive > summary::-webkit-details-marker { display: none; }
.dashboard-deep-dive > summary span,
.dashboard-deep-dive > summary strong,
.dashboard-deep-dive > summary small { display: block; }
.dashboard-deep-dive > summary strong { font-size: 17px; }
.dashboard-deep-dive > summary small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.dashboard-deep-dive > summary b { color: var(--primary); font-size: 12px; }
.dashboard-deep-dive[open] > summary { border-bottom: 1px solid var(--line); }
.dashboard-deep-dive-body { padding: 16px; }

.business-period-pills { margin: 4px 0 16px; }

.ai-widget-launcher {
  position: fixed;
  z-index: 90;
  right: 24px;
  bottom: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 7px 14px 7px 7px;
  border: 0;
  border-radius: 999px;
  background: #231815;
  color: #fff;
  box-shadow: 0 12px 30px rgba(35,24,21,.26);
}
.ai-widget-launcher:hover { background: #3d2520; }
.ai-widget-launcher span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary);
  font-size: 12px;
  font-weight: 900;
}
.ai-widget-launcher b { font-size: 13px; }
.ai-widget-panel {
  position: fixed;
  z-index: 100;
  right: 24px;
  bottom: 84px;
  display: grid;
  grid-template-rows: auto minmax(160px, 1fr) auto auto auto;
  width: min(400px, calc(100vw - 32px));
  height: min(590px, calc(100vh - 120px));
  overflow: hidden;
  border: 1px solid #e7c98e;
  border-radius: 8px;
  background: #fffdf9;
  box-shadow: 0 24px 60px rgba(35,24,21,.24);
}
.ai-widget-panel[hidden] { display: none; }
.ai-widget-panel > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  background: #231815;
  color: #fff;
}
.ai-widget-panel > header > div { display: flex; align-items: center; gap: 10px; }
.ai-widget-panel > header > div > span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 7px;
  background: var(--primary);
  font-size: 11px;
  font-weight: 900;
}
.ai-widget-panel > header strong,
.ai-widget-panel > header small { display: block; }
.ai-widget-panel > header small { margin-top: 2px; color: #e8d8cf; font-size: 10px; }
.ai-widget-panel > header button { min-width: 32px; min-height: 32px; padding: 0; border-radius: 6px; background: rgba(255,255,255,.12); font-size: 20px; }
.ai-widget-messages { overflow-y: auto; padding: 14px; background: #fffaf0; }
.ai-widget-messages article { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 12px; }
.ai-widget-messages article.user { flex-direction: row-reverse; }
.ai-widget-messages article > span {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: #231815;
  color: #fff;
  font-size: 10px;
  font-weight: 900;
}
.ai-widget-messages article.user > span { background: var(--primary); }
.ai-widget-messages article > div { max-width: 82%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.ai-widget-messages article.user > div { border-color: #f8c2c4; background: #fff3f2; }
.ai-widget-messages article.failed > div { border-color: #fecaca; background: #fff7f7; }
.ai-widget-messages p { margin: 0; white-space: pre-wrap; color: #4b352d; font-size: 13px; line-height: 1.65; }
.ai-widget-prompts { display: flex; gap: 6px; overflow-x: auto; padding: 9px 12px; border-top: 1px solid var(--line); background: #fff; }
.ai-widget-prompts button { flex: 0 0 auto; min-height: 30px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 999px; background: #fff8e8; color: #7c2d12; font-size: 10px; }
#ai-widget-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); background: #fff; }
#ai-widget-form textarea { min-height: 64px; max-height: 120px; resize: vertical; border-radius: 7px; font-size: 13px; }
#ai-widget-form button { min-width: 62px; }
.ai-widget-panel > footer { display: flex; justify-content: space-between; gap: 8px; padding: 0 12px 10px; color: var(--muted); background: #fff; font-size: 10px; }
.ai-widget-panel > footer span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-widget-panel > footer a { flex: 0 0 auto; color: var(--primary); font-weight: 800; }

@media (max-width: 1100px) {
  .dashboard-visual-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .visual-card-wide { grid-column: span 1; }
}

@media (max-width: 700px) {
  .nav-more { width: 100%; }
  .nav-more > summary { width: fit-content; }
  .nav-more > div { position: static; width: 100%; margin-top: 6px; box-shadow: none; }
  .page-title-actions { align-items: flex-start; flex-direction: column; }
  .dashboard-visual-grid { grid-template-columns: 1fr; }
  .chart-canvas,
  .chart-canvas-tall { height: 250px; }
  .dashboard-deep-dive > summary { align-items: flex-start; }
  .ai-widget-launcher { right: 14px; bottom: 14px; }
  .ai-widget-launcher b { display: none; }
  .ai-widget-launcher { padding: 7px; }
  .ai-widget-panel { right: 8px; bottom: 66px; width: calc(100vw - 16px); height: calc(100vh - 82px); }
}

.form-grid, .dashboard-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 14px;
}
.dashboard-filters {
  grid-template-columns: repeat(4, minmax(150px, 1fr)) auto;
}
.field {
  display: grid;
  gap: 7px;
}
.field label {
  color: #5c4638;
  font-size: 13px;
  font-weight: 600;
}
input, select, textarea {
  width: 100%;
  border: 1px solid #ead3a7;
  border-radius: 7px;
  padding: 10px 11px;
  background: #fff;
  color: var(--text);
}
textarea {
  min-height: 88px;
  resize: vertical;
}

.button, button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: 7px;
  padding: 10px 14px;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
}
.button:hover, button:hover { background: var(--primary-dark); }
.button.ghost {
  background: #fff1cf;
  color: #9a3412;
}
button.ghost {
  background: #fff1cf;
  color: #9a3412;
}
.button.small,
button.small {
  padding: 6px 9px;
  border-radius: 6px;
  font-size: 12px;
}
.button.danger, button.danger {
  background: #fee2e2;
  color: #991b1b;
}
.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.inline-form {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
}
.row-edit {
  display: inline-block;
  margin-right: 6px;
}
.row-edit summary {
  list-style: none;
  cursor: pointer;
}
.row-edit summary::-webkit-details-marker {
  display: none;
}
.warning-edit-form {
  position: absolute;
  right: 32px;
  z-index: 5;
  width: min(820px, calc(100vw - 80px));
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  box-shadow: var(--shadow);
  padding: 16px;
  text-align: left;
}
.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 12px 0 16px;
}
.toolbar input {
  max-width: 420px;
}
.bulk-bar {
  display: grid;
  grid-template-columns: auto auto auto minmax(220px, 360px) repeat(2, auto);
  gap: 10px;
  align-items: center;
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #fffdf8, #fff7e6);
  box-shadow: 0 6px 18px rgba(74, 38, 0, .05);
}
.stack-list {
  display: grid;
  gap: 12px;
}
.role-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.role-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: linear-gradient(180deg, #fff, #fffdf8);
  box-shadow: 0 8px 22px rgba(74, 38, 0, .05);
}
.page-checks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px 12px;
  margin: 12px 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.user-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 14px;
  background: #fff;
}
.user-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 14px;
  background: linear-gradient(180deg, #fff, #fffdf8);
  box-shadow: 0 8px 22px rgba(74, 38, 0, .05);
}
.user-card-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}
.user-card-head h3 {
  margin-bottom: 6px;
}
.user-manage-grid {
  display: grid;
  grid-template-columns: 160px 160px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: end;
  padding-top: 14px;
}
.fold-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-start;
  margin-top: 12px;
}
.header-actions,
.user-card-head > .actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  flex: 0 0 auto;
}
.fold-panel {
  min-width: 160px;
}
.fold-panel > summary,
.group-panel > summary {
  cursor: pointer;
  user-select: none;
}
.fold-panel > summary {
  display: inline-flex;
  align-items: center;
  border-radius: 7px;
  padding: 9px 12px;
  background: #fff1cf;
  color: #9a3412;
  font-weight: 700;
}
.fold-panel[open] {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf0;
}
.fold-panel[open] > summary {
  margin-bottom: 12px;
}
.flyout-panel[open] {
  position: absolute;
  right: 14px;
  top: 56px;
  z-index: 12;
  width: min(760px, calc(100vw - 56px));
  max-height: 72vh;
  overflow: auto;
  background: #fffdf8;
  box-shadow: 0 18px 48px rgba(74, 38, 0, .18);
}
.user-flyout[open] {
  width: min(860px, calc(100vw - 56px));
}
.quick-add {
  position: relative;
}
.quick-add > summary {
  list-style: none;
}
.quick-add > summary::-webkit-details-marker,
.fold-panel > summary::-webkit-details-marker {
  display: none;
}
.drawer-form {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 10;
  width: min(760px, calc(100vw - 40px));
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(74, 38, 0, .18);
}
.group-list {
  display: grid;
  gap: 12px;
}
.group-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  overflow: hidden;
}
.group-panel > summary {
  padding: 13px 14px;
  background: #fff1cf;
  color: #5c4638;
  font-weight: 800;
}
.store-card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 12px;
}
.store-card,
.category-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff, #fffdf8);
  padding: 14px 16px;
  box-shadow: 0 7px 18px rgba(74, 38, 0, .045);
}
.store-card:hover,
.category-card:hover,
.user-card:hover,
.role-card:hover {
  border-color: #e8c177;
}
.store-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 8px;
}
.store-card-head > div:not(.header-actions) {
  min-width: 0;
  flex: 1;
}
.store-select {
  padding-top: 2px;
}
.store-card-head strong {
  display: block;
  font-size: 16px;
}
.category-layout {
  display: grid;
  grid-template-columns: minmax(260px, .32fr) minmax(0, .68fr);
  gap: 16px;
}
.category-tree-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fffaf0;
}
.store-bind-groups {
  display: grid;
  gap: 8px;
}
.mini-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.store-bind-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.store-bind-group > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  padding: 10px 12px;
  font-weight: 700;
  background: #fff8ea;
}
.summary-actions {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.summary-actions button {
  position: relative;
  z-index: 1;
}
.store-checks.compact {
  margin: 0;
  max-height: 150px;
  grid-template-columns: repeat(2, minmax(160px, 1fr));
}
.password-row {
  display: grid;
  grid-template-columns: minmax(200px, 320px) auto;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}
.fold-panel .password-row {
  border-top: 0;
  padding-top: 0;
}
.password-row button {
  white-space: nowrap;
}
.store-checks {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 8px 12px;
  margin: 12px 0;
  max-height: 260px;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf0;
}
.checkbox-line {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #5c4638;
}
.checkbox-line input,
.field input[type="checkbox"] { width: auto; }

table {
  width: 100%;
  border-collapse: collapse;
}
th, td {
  border-bottom: 1px solid var(--line);
  padding: 11px 8px;
  text-align: left;
  vertical-align: top;
}
th {
  color: #5c4638;
  font-size: 13px;
  background: #fff8ea;
}
.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 3px 9px;
  background: #fff1cf;
  color: #9a3412;
  font-size: 12px;
}
.badge.pending { background: #fff7ed; color: #9a3412; }
.badge.approved { background: #dcfce7; color: #166534; }
.badge.rejected, .badge.disabled { background: #fee2e2; color: #991b1b; }

.notice {
  padding: 12px 14px;
  border-radius: 8px;
  margin-bottom: 16px;
}
.notice.success { background: #dcfce7; color: var(--success); }
.notice.error { background: #fee2e2; color: var(--danger); }

.tree {
  list-style: none;
  padding-left: 0;
}
.tree ul {
  list-style: none;
  margin: 8px 0 8px 24px;
  padding-left: 14px;
  border-left: 1px solid var(--line);
}
.tree li { margin: 8px 0; }

.channel-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.channel-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fffaf0;
}
.channel-card strong {
  display: block;
  margin: 8px 0 4px;
  font-size: 20px;
}
.chart-bars {
  display: grid;
  gap: 9px;
  max-height: 360px;
  overflow: auto;
  padding-right: 4px;
}
.bar-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) 116px;
  gap: 10px;
  align-items: center;
  font-size: 13px;
}
.bar-track {
  height: 12px;
  border-radius: 999px;
  background: #fff1cf;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #d71920, #f5a400);
}
.rank-list {
  display: grid;
  gap: 10px;
}
.rank-item {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf0;
}
.rank-item strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.section-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-end;
  margin-bottom: 14px;
}
.section-head h2 {
  margin-bottom: 4px;
}
.section-head p {
  color: var(--muted);
  font-size: 13px;
}
.filter-card {
  margin-top: -8px;
  background: rgba(255,255,255,.88);
}
.dashboard-table {
  overflow: auto;
}
.dashboard-table input,
.dashboard-table select {
  min-width: 120px;
}
.dashboard-table td .button,
.dashboard-table td button {
  padding: 8px 10px;
}
.hidden-forms {
  display: none;
}
.nowrap {
  white-space: nowrap;
}
.threshold-section {
  margin: 18px 0;
}
.threshold-section > .section-head {
  align-items: center;
  margin: 0 0 12px;
  padding: 0 4px;
}
.threshold-section .section-head h2 {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding-left: 16px;
  font-size: 24px;
  font-weight: 900;
}
.threshold-section .section-head h2::before {
  content: "";
  position: absolute;
  left: 0;
  width: 5px;
  height: 32px;
  border-radius: 1px;
  background: var(--primary);
}
.threshold-section .section-head h2::after {
  content: "";
  width: 34px;
  height: 5px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}
.threshold-section .section-head p {
  margin: 0;
  font-size: 13px;
}
.threshold-shell {
  overflow: hidden;
  border: 1px solid #efd8aa;
  border-radius: 18px;
  background: rgba(255,255,255,.68);
  box-shadow: var(--shadow);
}
.threshold-filter {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  align-items: center;
  padding: 16px 18px;
  background: #fff3d4;
  border-bottom: 1px solid #efd8aa;
}
.threshold-filter strong {
  font-size: 18px;
  color: #231815;
}
.threshold-filter input,
.threshold-filter select {
  height: 44px;
  border-color: #efd8aa;
  border-radius: 14px;
  background: #fffdf9;
}
.threshold-filter button {
  height: 44px;
  border-radius: 14px;
  padding-inline: 18px;
  white-space: nowrap;
}
.threshold-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 16px;
}
.threshold-card {
  min-height: 174px;
  border: 1px solid #efd8aa;
  border-radius: 18px;
  background: #fffdf8;
  padding: 20px 18px 16px;
}
.threshold-card span {
  display: block;
  color: var(--muted);
  font-size: 14px;
}
.threshold-card strong {
  display: block;
  margin: 12px 0 12px;
  font-size: 34px;
  line-height: 1;
  color: #231815;
}
.threshold-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}
.threshold-follow span {
  color: var(--muted);
  font-size: 14px;
}
.operation-overview-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(220px, .8fr);
  gap: 14px;
  margin-bottom: 18px;
}
.operation-risk-card,
.operation-view-switch,
.operation-summary-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.9);
  box-shadow: var(--shadow);
}
.operation-risk-card {
  display: block;
  padding: 16px;
  color: inherit;
  text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.operation-risk-card:hover,
.operation-risk-card.active {
  border-color: #f97316;
  box-shadow: 0 14px 34px rgba(249,115,22,.16);
  transform: translateY(-1px);
}
.operation-risk-card::before,
.operation-summary-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--accent);
}
.operation-risk-card.danger::before,
.operation-summary-card.danger::before { background: #dc2626; }
.operation-risk-card.warning::before,
.operation-summary-card.warning::before { background: #f97316; }
.operation-risk-card.good::before,
.operation-summary-card.good::before { background: #16a34a; }
.operation-risk-card.missing::before { background: #94a3b8; }
.operation-risk-card.missing.active {
  border-color: #94a3b8;
  background: #f8fafc;
  box-shadow: 0 14px 34px rgba(100,116,139,.14);
}
.operation-risk-card span,
.operation-view-switch span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}
.operation-risk-card strong {
  display: block;
  margin-top: 7px;
  color: #231815;
  font-size: 30px;
  line-height: 1;
}
.operation-risk-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.operation-view-switch {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 16px;
}
.operation-view-switch span {
  flex-basis: 100%;
  font-weight: 800;
}
.operation-view-switch a {
  border-radius: 999px;
  background: #fff1cf;
  color: #7c2d12;
  padding: 8px 14px;
  font-weight: 800;
  text-decoration: none;
}
.operation-view-switch a.active {
  background: linear-gradient(135deg, #dc2626, #f97316);
  color: #fff;
  box-shadow: 0 10px 22px rgba(220,38,38,.18);
}
.operation-section-tabs {
  align-content: center;
}
.operation-summary-list,
.operation-issue-grid {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
}
.operation-board-stack {
  display: grid;
  gap: 16px;
  margin-bottom: 18px;
}
.decision-priority-board {
  overflow: hidden;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.94);
  box-shadow: var(--shadow);
}
.decision-priority-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border-top: 5px solid #dc2626;
  border-bottom: 1px solid #f1d8aa;
  background: #fffaf0;
}
.decision-priority-head span {
  color: #dc2626;
  font-size: 12px;
  font-weight: 900;
}
.decision-priority-head h2 {
  margin: 3px 0 4px;
  color: #231815;
  font-size: 22px;
}
.decision-priority-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
.decision-priority-head > strong {
  flex: 0 0 auto;
  border-radius: 999px;
  background: #fee2e2;
  color: #991b1b;
  padding: 8px 12px;
  font-size: 13px;
}
.priority-store-list {
  display: grid;
}
.priority-store-row {
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 170px;
  gap: 14px;
  align-items: center;
  min-height: 92px;
  border-top: 1px solid #f6e4c2;
  color: inherit;
  padding: 13px 18px;
  text-decoration: none;
  transition: background .15s ease, transform .15s ease;
}
.priority-store-row:first-child { border-top: 0; }
.priority-store-row:hover {
  z-index: 1;
  background: #fff8e8;
  transform: translateX(2px);
}
.priority-store-row.danger { box-shadow: inset 4px 0 #dc2626; }
.priority-store-row.warning { box-shadow: inset 4px 0 #f97316; }
.priority-rank {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: #2b1014;
  color: #fff;
  font-size: 14px;
}
.priority-store-row:nth-child(n+4) .priority-rank {
  background: #fff1cf;
  color: #7c2d12;
}
.priority-store-main > strong,
.priority-store-main > small {
  display: block;
}
.priority-store-main > strong {
  color: #231815;
  font-size: 16px;
}
.priority-store-main > small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}
.priority-reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}
.priority-reason {
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 800;
}
.priority-reason.danger { background: #fee2e2; color: #991b1b; }
.priority-reason.warning { background: #ffedd5; color: #9a3412; }
.priority-reason.good { background: #dcfce7; color: #166534; }
.priority-key-value {
  text-align: right;
}
.priority-key-value span,
.priority-key-value strong,
.priority-key-value small {
  display: block;
}
.priority-key-value span {
  color: var(--muted);
  font-size: 11px;
}
.priority-key-value strong {
  margin-top: 4px;
  color: #991b1b;
  font-size: 19px;
}
.priority-key-value small {
  margin-top: 7px;
  color: #9a3412;
  font-size: 11px;
  font-weight: 800;
}
.decision-empty {
  display: flex;
  gap: 8px;
  align-items: baseline;
  padding: 24px 20px;
}
.decision-empty.good strong { color: #166534; }
.decision-empty span { color: var(--muted); font-size: 13px; }
.operation-decision-board {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.92);
  box-shadow: var(--shadow);
}
.operation-board-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  border-top: 5px solid var(--accent);
  background: #fff8e8;
  padding: 16px 18px;
}
.profit-board .operation-board-head {
  border-top-color: #dc2626;
}
.execution-board .operation-board-head {
  border-top-color: #f97316;
}
.operation-board-head h2 {
  margin: 0 0 4px;
  font-size: 22px;
}
.operation-board-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
.operation-board-head > span {
  border-radius: 999px;
  background: #fff1cf;
  color: #7c2d12;
  padding: 7px 11px;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}
.operation-table {
  overflow-x: auto;
}
.operation-table table {
  width: 100%;
  border-collapse: collapse;
}
.operation-table th,
.operation-table td {
  border-top: 1px solid #f1d8aa;
  padding: 12px 14px;
  text-align: left;
  white-space: nowrap;
}
.operation-table th {
  background: #fffdf8;
  color: #7c2d12;
  font-size: 13px;
}
.operation-table td {
  color: #231815;
  font-size: 14px;
}
.operation-table td.danger {
  color: #991b1b;
  font-weight: 900;
}
.operation-table td.warning {
  color: #9a3412;
  font-weight: 900;
}
.operation-store-name {
  display: grid;
  gap: 3px;
  color: inherit;
  text-decoration: none;
  min-width: 190px;
}
.operation-store-name strong {
  color: #231815;
}
.operation-store-name small {
  color: var(--muted);
  font-size: 12px;
}
.operation-store-name:hover strong {
  color: #dc2626;
}
.operation-selected-risk {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.9);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  padding: 16px;
}
.operation-selected-store-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}
.profit-issue-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.profit-issue-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.92);
  box-shadow: var(--shadow);
}
.profit-issue-card.active {
  border-color: #f97316;
  box-shadow: 0 16px 36px rgba(249,115,22,.18);
}
.profit-issue-card-head {
  display: grid;
  gap: 6px;
  border-top: 5px solid #dc2626;
  background: #fff8e8;
  color: inherit;
  padding: 15px 16px;
  text-decoration: none;
}
.profit-issue-card-head span {
  color: #231815;
  font-size: 17px;
  font-weight: 900;
}
.profit-issue-card-head strong {
  color: #dc2626;
  font-size: 28px;
  line-height: 1;
}
.profit-issue-card-head small {
  color: var(--muted);
  line-height: 1.5;
}
.profit-issue-store-list {
  display: grid;
  gap: 8px;
  padding: 13px 16px 16px;
}
.profit-issue-store-list .operation-store-name {
  min-width: 0;
  border-bottom: 1px dashed #f1d8aa;
  padding-bottom: 8px;
}
.profit-more-link {
  border-radius: 999px;
  background: #fff1cf;
  color: #7c2d12;
  padding: 8px 12px;
  text-align: center;
  text-decoration: none;
  font-weight: 800;
}
.operation-issue-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.operation-summary-card,
.operation-issue-card {
  padding: 18px;
}
.operation-issue-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.9);
  box-shadow: var(--shadow);
}
.operation-issue-card summary {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 12px;
  cursor: pointer;
  list-style: none;
}
.operation-issue-card summary::-webkit-details-marker {
  display: none;
}
.operation-issue-card summary span {
  color: #231815;
  font-size: 17px;
  font-weight: 900;
}
.operation-issue-card summary strong {
  grid-row: span 2;
  align-self: center;
  min-width: 52px;
  border-radius: 8px;
  background: #fff1cf;
  color: #7c2d12;
  padding: 8px 10px;
  text-align: center;
  font-size: 26px;
  line-height: 1;
}
.operation-issue-card.danger summary strong {
  background: #fee2e2;
  color: #991b1b;
}
.operation-issue-card.warning summary strong {
  background: #fff7ed;
  color: #9a3412;
}
.operation-issue-card summary em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}
.operation-issue-store-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}
.operation-issue-store {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #f1d8aa;
  border-radius: 8px;
  background: #fffdf8;
  color: inherit;
  padding: 10px 11px;
  text-decoration: none;
}
.operation-issue-store:hover {
  border-color: #f97316;
  box-shadow: 0 8px 18px rgba(249,115,22,.12);
}
.operation-issue-store strong,
.operation-issue-store small {
  display: block;
}
.operation-issue-store strong {
  color: #231815;
  font-size: 14px;
}
.operation-issue-store small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}
.operation-issue-store b {
  color: #991b1b;
  white-space: nowrap;
}
.operation-summary-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}
.operation-summary-main h2 {
  margin: 8px 0 5px;
  font-size: 20px;
}
.operation-summary-main p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
.operation-summary-score {
  min-width: 82px;
  border-radius: 8px;
  background: #fff7ed;
  color: #7c2d12;
  padding: 10px;
  text-align: center;
}
.operation-summary-score span {
  display: block;
  font-size: 12px;
}
.operation-summary-score strong {
  display: block;
  font-size: 26px;
  line-height: 1.1;
}
.operation-summary-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.operation-summary-metrics .diagnosis-line {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  padding: 11px 12px;
}
.operation-summary-detail {
  margin-top: 12px;
}
.operation-summary-detail summary {
  width: fit-content;
  cursor: pointer;
  border-radius: 999px;
  background: #231815;
  color: #fff;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 800;
}
.operation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}
.operation-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.88);
  box-shadow: var(--shadow);
  padding: 18px;
}
.operation-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}
.operation-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.operation-card-head h2 {
  margin-bottom: 5px;
  font-size: 18px;
}
.operation-card-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
.operation-kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.operation-kpi {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  padding: 12px;
}
.operation-kpi span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.operation-kpi strong {
  display: block;
  margin-top: 6px;
  color: #231815;
  font-size: 18px;
}
.operation-inspection {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  border-radius: 8px;
  background: #fff1cf;
  color: #5c4638;
  padding: 12px;
  font-size: 13px;
}
.diagnosis-status {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 800;
}
.diagnosis-status.good,
.diagnosis-tag.good {
  background: #dcfce7;
  color: #166534;
}
.diagnosis-status.warning,
.diagnosis-tag.warning {
  background: #fff7ed;
  color: #9a3412;
}
.diagnosis-status.danger,
.diagnosis-tag.danger {
  background: #fee2e2;
  color: #991b1b;
}
.diagnosis-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}
.diagnosis-tag {
  border-radius: 999px;
  padding: 6px 9px;
  font-size: 12px;
  font-weight: 800;
}
.diagnosis-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.diagnosis-blocks {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.diagnosis-blocks section,
.diagnosis-problems {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  padding: 12px;
}
.diagnosis-blocks h3 {
  margin: 0 0 10px;
  font-size: 14px;
}
.diagnosis-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px dashed #f1d8aa;
  padding: 8px 0;
  color: var(--muted);
  font-size: 13px;
}
.diagnosis-line:first-child {
  border-top: 0;
  padding-top: 0;
}
.diagnosis-line strong {
  color: #231815;
  text-align: right;
}
.diagnosis-line.warning strong { color: #9a3412; }
.diagnosis-line.danger strong { color: #991b1b; }
.diagnosis-line.good strong { color: #166534; }
.diagnosis-problems {
  display: grid;
  grid-template-columns: minmax(120px, .6fr) minmax(0, 1.4fr);
  gap: 12px;
  margin-top: 12px;
}
.diagnosis-problems strong {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
}
.diagnosis-problems span {
  color: var(--muted);
  font-size: 13px;
}
.diagnosis-issues {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.diagnosis-issues li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}
.diagnosis-issues li strong {
  margin: 0;
  color: #991b1b;
  white-space: nowrap;
}
.redline-detail {
  margin-top: 12px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fff7f7;
  padding: 12px;
}
.redline-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.redline-detail-head strong {
  color: #991b1b;
}
.redline-detail-head span {
  color: var(--muted);
  font-size: 12px;
}
.redline-detail ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.redline-detail li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
  border-top: 1px dashed #fecaca;
  padding-top: 8px;
}
.redline-detail li:first-child {
  border-top: 0;
  padding-top: 0;
}
.redline-detail li strong,
.redline-detail li span {
  display: block;
}
.redline-detail li strong {
  color: #231815;
  font-size: 13px;
}
.redline-detail li span,
.redline-detail time,
.redline-detail p {
  color: var(--muted);
  font-size: 12px;
}
.redline-detail time {
  white-space: nowrap;
}
.redline-detail p {
  grid-column: 1 / -1;
  margin: 0;
}
.import-quality-title { margin-bottom: 14px; }
.data-quality-panel {
  margin: 0 0 18px;
  padding: 16px 18px;
  border: 1px solid #d9eadf;
  border-left: 5px solid #16a34a;
  border-radius: 8px;
  background: #fbfefc;
  box-shadow: 0 10px 24px rgba(56, 38, 20, .06);
}
.data-quality-panel.warning {
  border-color: #f4d6a0;
  border-left-color: #f59e0b;
  background: #fffdf8;
}
.data-quality-panel.danger {
  border-color: #f3b7b7;
  border-left-color: #dc2626;
  background: #fffafa;
}
.data-quality-panel.neutral {
  border-color: #ded8d1;
  border-left-color: #76685f;
  background: #fcfbfa;
}
.data-quality-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}
.data-quality-panel-head > div {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.data-quality-panel-head span {
  color: #8a7063;
  font-size: 13px;
  font-weight: 700;
}
.data-quality-panel-head strong {
  color: #231815;
  font-size: 18px;
}
.data-quality-panel-head a {
  color: #b91c1c;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}
.data-quality-panel-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid #eee4d8;
  border-radius: 7px;
  background: #fff;
}
.data-quality-panel-grid > div {
  min-width: 0;
  padding: 12px 14px;
  border-right: 1px solid #eee4d8;
}
.data-quality-panel-grid > div:last-child { border-right: 0; }
.data-quality-panel-grid span,
.data-quality-panel-grid strong,
.data-quality-panel-grid small { display: block; }
.data-quality-panel-grid span {
  margin-bottom: 5px;
  color: #8a7063;
  font-size: 12px;
}
.data-quality-panel-grid strong {
  overflow: hidden;
  color: #2d211d;
  font-size: 15px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.data-quality-panel-grid small {
  margin-top: 4px;
  color: #8a7063;
  font-size: 12px;
  line-height: 1.45;
}
.data-quality-messages {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}
.data-quality-messages span {
  padding: 5px 8px;
  border-radius: 6px;
  background: #f5eee6;
  color: #6f5548;
  font-size: 12px;
  line-height: 1.5;
}
.data-quality-panel.warning .data-quality-messages span {
  background: #fff1d6;
  color: #8a4b08;
}
.data-quality-panel.danger .data-quality-messages span {
  background: #fee2e2;
  color: #991b1b;
}
.data-quality-panel.compact {
  margin-bottom: 16px;
  box-shadow: none;
}
.import-quality-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.import-upload-card,
.import-gap-card,
.daily-gap-card,
.import-history-card { margin-bottom: 16px; }
.import-upload-card .section-head,
.import-gap-card .section-head,
.daily-gap-card .section-head,
.import-history-card .section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}
.import-upload-card .section-head h2,
.import-gap-card .section-head h2,
.daily-gap-card .section-head h2,
.import-history-card .section-head h2 { margin: 3px 0 5px; }
.import-upload-card .section-head p,
.import-gap-card .section-head p,
.daily-gap-card .section-head p,
.import-history-card .section-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}
.import-safety-note {
  flex: 0 0 auto;
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  background: #f0fdf4;
  color: #166534;
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 800;
}
.import-upload-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin-top: 16px;
  padding: 15px;
  border: 1px dashed #efb75d;
  border-radius: 8px;
  background: #fffaf0;
}
.import-upload-row .field { margin: 0; }
.import-upload-row input[type="file"] {
  min-height: 46px;
  background: #fff;
}
.import-upload-row button { min-height: 46px; }
.import-upload-help { margin: 8px 0 0; }
.import-guide-disclosure {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.import-guide-disclosure > summary {
  cursor: pointer;
  color: #7c2d12;
  font-size: 13px;
  font-weight: 900;
}
.import-guide-disclosure .data-source-guide { margin-bottom: 0; }
.import-month-filter {
  display: flex;
  align-items: center;
  gap: 8px;
}
.import-month-filter input { min-width: 170px; }
.import-gap-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  margin: 15px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.import-gap-summary > div {
  padding: 12px 14px;
  border-right: 1px solid var(--line);
  background: #fffdf8;
}
.import-gap-summary > div:last-child { border-right: 0; }
.import-gap-summary span,
.import-gap-summary strong { display: block; }
.import-gap-summary span {
  color: var(--muted);
  font-size: 11px;
}
.import-gap-summary strong {
  margin-top: 4px;
  color: #231815;
  font-size: 19px;
}
.import-gap-summary strong.good,
.import-gap-value.good { color: #166534; }
.import-gap-summary strong.warning,
.import-gap-value.warning { color: #9a3412; }
.import-gap-summary strong.danger,
.import-gap-value.danger { color: #b91c1c; }
.import-gap-table td:first-child strong,
.import-gap-table td:first-child small { display: block; }
.import-gap-table td:first-child small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}
.import-gap-value {
  white-space: nowrap;
  font-size: 12px;
  font-weight: 700;
}
.import-gap-value strong { font-size: 14px; }
.import-missing-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.import-missing-tags span,
.import-complete-tag {
  display: inline-flex;
  border-radius: 999px;
  padding: 4px 7px;
  font-size: 10px;
  font-weight: 800;
}
.import-missing-tags span {
  background: #fff1f0;
  color: #a61b1b;
}
.import-complete-tag {
  background: #ecfdf5;
  color: #166534;
}
.daily-gap-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.daily-gap-actions input {
  width: 220px;
  min-height: 40px;
}
.daily-gap-actions .button {
  min-height: 40px;
  white-space: nowrap;
}
.daily-gap-list {
  display: grid;
  gap: 8px;
}
.daily-gap-store {
  overflow: hidden;
  border: 1px solid var(--line);
  border-left: 4px solid #f59e0b;
  border-radius: 8px;
  background: #fff;
}
.daily-gap-store > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
  padding: 12px 14px;
  list-style: none;
}
.daily-gap-store > summary::-webkit-details-marker { display: none; }
.daily-gap-store[open] > summary {
  border-bottom: 1px solid var(--line);
  background: #fffaf0;
}
.daily-gap-store-name {
  min-width: 0;
}
.daily-gap-store-name strong,
.daily-gap-store-name span {
  display: block;
}
.daily-gap-store-name strong {
  color: #231815;
  font-size: 13px;
}
.daily-gap-store-name span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}
.daily-gap-store-facts {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}
.daily-gap-store-facts span,
.daily-gap-store-facts b {
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 11px;
  white-space: nowrap;
}
.daily-gap-store-facts span.danger {
  background: #fff1f0;
  color: #991b1b;
}
.daily-gap-store-facts span.warning {
  background: #fff7ed;
  color: #9a3412;
}
.daily-gap-store-facts b {
  background: #f5efe5;
  color: #5c4638;
}
.daily-gap-table {
  min-width: 860px;
}
.daily-gap-table td {
  font-size: 11px;
  vertical-align: top;
}
.daily-gap-table th:first-child,
.daily-gap-table td:first-child {
  width: 120px;
}
.daily-gap-complete,
.daily-gap-search-empty {
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  background: #f0fdf4;
  padding: 18px;
  text-align: center;
}
.daily-gap-complete strong,
.daily-gap-complete span {
  display: block;
}
.daily-gap-complete strong { color: #166534; }
.daily-gap-complete span {
  margin-top: 5px;
  color: #52705c;
  font-size: 12px;
}
.daily-gap-search-empty {
  margin: 0;
  border-color: var(--line);
  background: #fffdf8;
  color: var(--muted);
  font-size: 12px;
}
.import-batch-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}
.import-batch-item {
  overflow: hidden;
  border: 1px solid var(--line);
  border-left: 4px solid #d6c9b1;
  border-radius: 8px;
  background: #fff;
}
.import-batch-item.good { border-left-color: #16a34a; }
.import-batch-item.warning { border-left-color: #f59e0b; }
.import-batch-item.danger { border-left-color: #dc2626; }
.import-batch-item > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
  padding: 13px 15px;
  list-style: none;
}
.import-batch-item > summary::-webkit-details-marker { display: none; }
.import-batch-main { min-width: 0; }
.import-batch-main strong,
.import-batch-main span { display: block; }
.import-batch-main strong {
  overflow: hidden;
  color: #231815;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.import-batch-main span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}
.import-batch-facts {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
}
.quality-pill,
.status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 10px;
  font-weight: 900;
}
.quality-pill.passed,
.status-pill.parsed {
  background: #ecfdf5;
  color: #166534;
}
.quality-pill.warning,
.status-pill.duplicate,
.status-pill.rolled_back,
.status-pill.uploaded {
  background: #fff7e6;
  color: #9a3412;
}
.quality-pill.failed,
.status-pill.failed,
.status-pill.rejected {
  background: #fff1f0;
  color: #b91c1c;
}
.import-batch-detail {
  padding: 14px 15px;
  border-top: 1px solid var(--line);
  background: #fffdf8;
}
.import-batch-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.import-batch-meta > div {
  padding: 10px 12px;
  border-right: 1px solid var(--line);
}
.import-batch-meta > div:last-child { border-right: 0; }
.import-batch-meta span,
.import-batch-meta strong { display: block; }
.import-batch-meta span {
  color: var(--muted);
  font-size: 10px;
}
.import-batch-meta strong {
  margin-top: 3px;
  font-size: 12px;
}
.import-batch-message {
  margin: 10px 0;
  color: #5b463f;
  font-size: 12px;
}
.import-quality-issues {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.import-quality-issues li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 11px;
}
.import-quality-issues li.warning {
  background: #fff7e6;
  color: #7c2d12;
}
.import-quality-issues li.error {
  background: #fff1f0;
  color: #991b1b;
}
.import-quality-pass {
  border-radius: 6px;
  background: #ecfdf5;
  color: #166534;
  padding: 9px 10px;
  font-size: 11px;
}
.import-rollback-form {
  margin-top: 12px;
  text-align: right;
}
.import-rollback-form button {
  padding: 8px 11px;
  font-size: 11px;
}

@media (max-width: 1250px) {
  .data-quality-panel-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .data-quality-panel-grid > div:nth-child(2) { border-right: 0; }
  .data-quality-panel-grid > div:nth-child(-n+2) { border-bottom: 1px solid #eee4d8; }
  .import-quality-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .import-gap-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profit-kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dashboard-command-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .decision-brief { grid-template-columns: 1fr; }
  .decision-brief-facts { justify-self: stretch; }
  .dashboard-command-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dashboard-command-filters .overview-filter-actions {
    grid-column: 1 / -1;
  }
  .dashboard-problem-board { grid-template-columns: minmax(240px, .75fr) minmax(0, 1.6fr); }
  .dashboard-quick-metrics,
  .dashboard-quick-conclusion { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .import-upload-card .section-head,
  .import-gap-card .section-head,
  .daily-gap-card .section-head,
  .import-history-card .section-head,
  .import-batch-item > summary {
    align-items: flex-start;
    flex-direction: column;
  }
  .import-upload-row,
  .import-batch-meta {
    grid-template-columns: 1fr;
  }
  .daily-gap-actions {
    width: 100%;
  }
  .daily-gap-actions input {
    min-width: 0;
    width: auto;
    flex: 1;
  }
  .import-batch-meta > div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .import-batch-meta > div:last-child { border-bottom: 0; }
  .import-batch-main strong { white-space: normal; }
  .site-header { position: static; }
  .site-topbar { grid-template-columns: 1fr; }
  .nav { justify-content: flex-start; }
  .user-pill { width: fit-content; }
  .grid, .form-grid, .dashboard-filters, .hero-board, .channel-grid, .threshold-filter, .threshold-cards, .overview-summary, .profit-kpi-grid, .profit-issue-grid, .overview-channel-grid, .overview-filters, .operation-overview-strip, .operation-summary-metrics, .operation-issue-grid, .operation-selected-store-list, .operation-grid, .operation-kpis, .diagnosis-summary, .diagnosis-blocks, .diagnosis-problems, .redline-detail li {
    grid-template-columns: 1fr;
  }
  .operation-summary-main {
    flex-direction: column;
  }
  .decision-brief-facts {
    grid-template-columns: 1fr;
  }
  .dashboard-filter-heading,
  .dashboard-store-quick-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .dashboard-filter-heading > span { margin-top: -8px; }
  .dashboard-command-kpis,
  .dashboard-data-status,
  .dashboard-problem-board,
  .dashboard-lower-grid {
    grid-template-columns: 1fr;
  }
  .dashboard-data-status > div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .dashboard-data-status > div:last-child { border-bottom: 0; }
  .dashboard-priority-table { max-height: none; }
  .dashboard-threshold-grid { grid-template-columns: 1fr; }
  .priority-store-row {
    grid-template-columns: 36px minmax(0, 1fr);
  }
  .priority-key-value {
    grid-column: 2;
    text-align: left;
  }
  .decision-priority-head {
    flex-direction: column;
  }
  .overview-title,
  .overview-card-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .overview-filter-actions {
    justify-content: flex-start;
  }
  .login-shell, .user-manage-grid, .password-row, .store-card-grid, .category-layout, .bulk-bar, .role-grid, .page-checks {
    grid-template-columns: 1fr;
  }
  .login-shell {
    transform: none;
  }
  .login-brand {
    min-height: auto;
    padding: 28px;
  }
  .drawer-form {
    position: static;
    width: 100%;
    margin-top: 10px;
  }
  .flyout-panel[open] {
    position: static;
    width: 100%;
    max-height: none;
  }
  .login-card {
    padding: 28px;
  }
  .user-card-head {
    flex-direction: column;
  }
  .threshold-section .section-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .threshold-filter {
    padding: 14px;
  }
  .store-checks { grid-template-columns: 1fr; }
  .bar-row {
    grid-template-columns: 90px minmax(0, 1fr);
  }
  .bar-row span:last-child {
    grid-column: 2;
  }
  .topbar {
    align-items: flex-start;
    gap: 12px;
    flex-direction: column;
  }
}

@media (max-width: 600px) {
  .data-quality-panel { padding: 14px; }
  .data-quality-panel-head,
  .data-quality-panel-head > div {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }
  .data-quality-panel-grid { grid-template-columns: 1fr; }
  .data-quality-panel-grid > div,
  .data-quality-panel-grid > div:nth-child(2) {
    border-right: 0;
    border-bottom: 1px solid #eee4d8;
  }
  .data-quality-panel-grid > div:last-child { border-bottom: 0; }
  .data-quality-panel-grid strong {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
  }
  .import-quality-kpis,
  .import-gap-summary {
    grid-template-columns: 1fr;
  }
  .import-gap-summary > div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .import-gap-summary > div:last-child { border-bottom: 0; }
  .import-month-filter { width: 100%; }
  .import-month-filter input {
    min-width: 0;
    flex: 1;
  }
  .daily-gap-actions,
  .daily-gap-store > summary,
  .daily-gap-store-facts {
    align-items: flex-start;
    flex-direction: column;
  }
  .daily-gap-actions .button {
    width: 100%;
    text-align: center;
  }
  .dashboard-command-filters,
  .dashboard-quick-metrics,
  .dashboard-quick-conclusion {
    grid-template-columns: 1fr;
  }
  .dashboard-command-filters .overview-filter-actions {
    grid-column: auto;
  }
  .dashboard-store-picker-panel {
    position: static;
    width: 100%;
    margin-top: 7px;
    box-shadow: none;
  }
  .dashboard-store-options { grid-template-columns: 1fr; }
}
